diff --git a/.eslintignore b/.eslintignore index 404b4177c9773..10b1ba1197ccb 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,12 @@ /built/local/** /tests/** /lib/** -/src/lib/*.generated.d.ts \ No newline at end of file +/src/lib/*.generated.d.ts + +# TODO: Remove the following once typescript-eslint supports `awaited`: +/src/lib/es5.d.ts +/src/lib/es2015.iterable.d.ts +/src/lib/es2015.promise.d.ts +/src/lib/es2018.promise.d.ts +/src/lib/es2020.promise.d.ts +/src/lib/esnext.promise.d.ts \ No newline at end of file diff --git a/lib/cs/diagnosticMessages.generated.json b/lib/cs/diagnosticMessages.generated.json index cffe00f60eb7d..462b5b2e008bb 100644 --- a/lib/cs/diagnosticMessages.generated.json +++ b/lib/cs/diagnosticMessages.generated.json @@ -758,10 +758,12 @@ "Only_amd_and_system_modules_are_supported_alongside_0_6082": "Spolu s --{0} se podporují jenom moduly amd a system.", "Only_emit_d_ts_declaration_files_6014": "Bude vydávat jen soubory deklarací .d.ts.", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "V klauzuli třídy extends se aktuálně podporují jenom identifikátory nebo kvalifikované názvy s volitelnými argumenty typu.", + "Only_named_exports_may_use_export_type_1383": "Jenom pojmenované exporty mohou používat typ exportu.", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "Prostřednictvím klíčového slova super jsou přístupné jenom veřejné a chráněné metody základní třídy.", "Operator_0_cannot_be_applied_to_type_1_2736": "Operátor {0} se nedá použít na typ {1}.", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "Operátor {0} nejde použít u typů {1} a {2}.", - "Option_0_can_only_be_specified_in_tsconfig_json_file_6064": "Možnost {0} je možné zadat jenom v souboru tsconfig.json.", + "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "Možnost {0} jde zadat jenom v souboru tsconfig.json nebo nastavit na příkazovém řádku na hodnotu false nebo null.", + "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "Možnost {0} jde zadat jenom v souboru tsconfig.json nebo nastavit na příkazovém řádku na hodnotu null.", "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "Možnost {0} jde použít jenom při zadání možnosti --inlineSourceMap nebo možnosti --sourceMap.", "Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "Když je možnost target nastavená na ES3, možnost {0} se nedá zadat.", "Option_0_cannot_be_specified_with_option_1_5053": "Možnosti {0} a {1} nejde zadat zároveň.", @@ -1035,7 +1037,7 @@ "Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object_2470": "Odkaz Symbol neodkazuje na globální objekt konstruktoru Symbol.", "Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6228": "Synchronně volat zpětná volání a aktualizovat stav sledování adresářů na platformách, které nepodporují nativně rekurzivní sledování", "Syntax_Colon_0_6023": "Syntaxe: {0}", - "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'.", + "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "Značka {0} očekává nejmíň {1} argumentů, ale objekt pro vytváření JSX {2} poskytuje maximálně {3}.", "Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358": "Označené výrazy šablony se v nepovinném řetězu nepovolují.", "The_0_modifier_can_only_be_used_in_TypeScript_files_8009": "Modifikátor {0} se dá používat jen v typescriptových souborech.", "The_0_operator_cannot_be_applied_to_type_symbol_2469": "Operátor {0} nejde použít u typu symbol.", @@ -1180,6 +1182,7 @@ "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320": "Typ operandu await musí být buď platný příslib, nebo nesmí obsahovat člen then, který se dá volat.", "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418": "Typ hodnoty počítané vlastnosti je {0} a nedá se přiřadit do typu {1}.", "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "Typ iterovaných elementů yield* musí být buď platný příslib, nebo nesmí obsahovat člen then, který se dá volat.", + "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": "Typ vlastnosti {0} cyklicky odkazuje sám na sebe v mapovaném typu {1}.", "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "Typ operandu yield v asynchronním generátoru musí být buď platný příslib, nebo nesmí obsahovat člen then, který se dá volat.", "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038": "Typ pochází z tohoto importu. Import stylu oboru názvů není možné zavolat ani vytvořit a při běhu způsobí chybu. Zvažte možnost použít tady místo toho výchozí import nebo požadavek na import.", "Type_parameter_0_has_a_circular_constraint_2313": "Parametr typu {0} má cyklické omezení.", @@ -1237,6 +1240,7 @@ "Unterminated_template_literal_1160": "Neukončený literál šablony", "Untyped_function_calls_may_not_accept_type_arguments_2347": "Volání netypové funkce nemusí přijmout argumenty typu.", "Unused_label_7028": "Nepoužívaný popisek", + "Unused_ts_expect_error_directive_2578": "Nepoužitá direktiva @ts-expect-error", "Updating_output_of_project_0_6373": "Aktualizuje se výstup projektu {0}...", "Updating_output_timestamps_of_project_0_6359": "Aktualizují se výstupní časová razítka projektu {0}...", "Updating_unchanged_output_timestamps_of_project_0_6371": "Aktualizují se nezměněná výstupní časová razítka projektu {0}...", @@ -1340,6 +1344,7 @@ "file_6025": "soubor", "get_and_set_accessor_must_have_the_same_this_type_2682": "Přístupové objekty get a set musí mít stejný typ this.", "get_and_set_accessor_must_have_the_same_type_2380": "Přístupový objekt get a set musí obsahovat stejný typ.", + "get_and_set_accessors_cannot_declare_this_parameters_2784": "Přístupové objekty get a set nemůžou deklarovat parametry this.", "implements_clause_already_seen_1175": "Klauzule implements se už jednou vyskytla.", "implements_clauses_can_only_be_used_in_TypeScript_files_8005": "Klauzule implements se dají používat jen v typescriptových souborech.", "import_can_only_be_used_in_TypeScript_files_8002": "import = se dá používat jen v typescriptových souborech.", diff --git a/lib/de/diagnosticMessages.generated.json b/lib/de/diagnosticMessages.generated.json index c711b220b1fe9..dc180c7265920 100644 --- a/lib/de/diagnosticMessages.generated.json +++ b/lib/de/diagnosticMessages.generated.json @@ -758,6 +758,7 @@ "Only_amd_and_system_modules_are_supported_alongside_0_6082": "Nur die Module \"amd\" und \"system\" werden in Verbindung mit --{0} unterstützt.", "Only_emit_d_ts_declaration_files_6014": "Geben Sie nur .d.ts-Deklarationsdateien aus.", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "Derzeit werden nur Bezeichner/qualifizierte Namen mit optionalen Typargumenten in den \"extends\"-Klauseln einer Klasse unterstützt.", + "Only_named_exports_may_use_export_type_1383": "\"Exporttyp\" kann nur von benannten Exporten verwendet werden.", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "Nur auf öffentliche und geschützte Methoden der Basisklasse kann über das Schlüsselwort \"super\" zugegriffen werden.", "Operator_0_cannot_be_applied_to_type_1_2736": "Der Operator \"{0}\" kann nicht auf den Typ \"{1}\" angewendet werden.", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "Der Operator \"{0}\" darf nicht auf die Typen \"{1}\" und \"{2}\" angewendet werden.", @@ -1181,6 +1182,7 @@ "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320": "Der Typ des \"await\"-Operanden muss entweder eine gültige Zusage sein oder darf keinen aufrufbaren \"then\"-Member enthalten.", "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418": "Der Typ des Werts der berechneten Eigenschaft lautet \"{0}\" und kann dem Typ \"{1}\" nicht zugewiesen werden.", "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "Der Typ iterierter Elemente eines \"yield*\"-Operanden muss entweder eine gültige Zusage sein oder darf keinen aufrufbaren \"then\"-Member enthalten.", + "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": "Der Typ der Eigenschaft \"{0}\" verweist im zugeordneten Typ \"{1}\" auf sich selbst.", "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "Der Typ eines \"yield\"-Operanden in einem asynchronen Generator muss entweder eine gültige Zusage sein oder darf keinen aufrufbaren \"then\"-Member enthalten.", "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038": "Der Typ stammt aus diesem Import. Ein Import im Namespacestil kann nicht aufgerufen oder erstellt werden und verursacht zur Laufzeit einen Fehler. Erwägen Sie hier stattdessen die Verwendung eines Standardimports oder die Verwendung von \"import require\".", "Type_parameter_0_has_a_circular_constraint_2313": "Der Typparameter \"{0}\" weist eine zirkuläre Einschränkung auf.", @@ -1238,6 +1240,7 @@ "Unterminated_template_literal_1160": "Nicht abgeschlossenes Vorlagenliteral.", "Untyped_function_calls_may_not_accept_type_arguments_2347": "Nicht typisierte Funktionsaufrufe dürfen keine Typargumente annehmen.", "Unused_label_7028": "Nicht verwendete Bezeichnung.", + "Unused_ts_expect_error_directive_2578": "Nicht verwendete @ts-expect-error-Direktive.", "Updating_output_of_project_0_6373": "Ausgabe von Projekt \"{0}\" wird aktualisiert...", "Updating_output_timestamps_of_project_0_6359": "Ausgabezeitstempel von Projekt \"{0}\" werden aktualisiert...", "Updating_unchanged_output_timestamps_of_project_0_6371": "Unveränderte Ausgabezeitstempel von Projekt \"{0}\" werden aktualisiert...", @@ -1341,6 +1344,7 @@ "file_6025": "Datei", "get_and_set_accessor_must_have_the_same_this_type_2682": "Die get- und set-Accessoren müssen den gleichen this-Typ aufweisen.", "get_and_set_accessor_must_have_the_same_type_2380": "Die get- und set-Zugriffsmethoden müssen den gleichen Typ aufweisen.", + "get_and_set_accessors_cannot_declare_this_parameters_2784": "get- und set-Zugriffsmethoden können keine this-Parameter deklarieren.", "implements_clause_already_seen_1175": "Die implements-Klausel ist bereits vorhanden.", "implements_clauses_can_only_be_used_in_TypeScript_files_8005": "implements-Klauseln können nur in TypeScript-Dateien verwendet werden.", "import_can_only_be_used_in_TypeScript_files_8002": "\"import... =\" kann nur in TypeScript-Dateien verwendet werden.", diff --git a/lib/es/diagnosticMessages.generated.json b/lib/es/diagnosticMessages.generated.json index 62155c33cb18f..192a59a610c65 100644 --- a/lib/es/diagnosticMessages.generated.json +++ b/lib/es/diagnosticMessages.generated.json @@ -758,10 +758,12 @@ "Only_amd_and_system_modules_are_supported_alongside_0_6082": "Solo los módulos \"amd\" y \"system\" se admiten con --{0}.", "Only_emit_d_ts_declaration_files_6014": "Solo deben emitirse archivos de declaración \".d.ts\".", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "Actualmente, solo se admiten identificadores o nombres completos con argumentos de tipo opcional en la cláusula \"extends\" de una clase.", + "Only_named_exports_may_use_export_type_1383": "Solo las exportaciones con nombre pueden usar \"tipo de exportación\".", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "Solo es posible tener acceso a los métodos públicos y protegidos de la clase base mediante la palabra clave \"super\".", "Operator_0_cannot_be_applied_to_type_1_2736": "El operador \"{0}\" no se puede aplicar al tipo \"{1}\".", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "El operador '{0}' no se puede aplicar a los tipos '{1}' y '{2}'.", - "Option_0_can_only_be_specified_in_tsconfig_json_file_6064": "La opción '{0}' solo se puede especificar en el archivo 'tsconfig.json'.", + "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "La opción \"{0}\" solo puede especificarse en el archivo \"tsconfig.json\" o establecerse en \"false\" o \"null\" en la línea de comandos.", + "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "La opción \"{0}\" solo puede especificarse en el archivo \"tsconfig.json\" o establecerse en \"null\" en la línea de comandos.", "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "La opción '{0}' solo se puede usar cuando se proporciona '--inlineSourceMap' o '--sourceMap'.", "Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "No se puede especificar la opción \"{0}\" cuando la opción \"target\" es \"ES3\".", "Option_0_cannot_be_specified_with_option_1_5053": "La opción '{0}' no se puede especificar con la opción '{1}'.", @@ -1035,7 +1037,7 @@ "Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object_2470": "La referencia \"Symbol\" no hace referencia al objeto de constructor Symbol global.", "Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6228": "Llame a las devoluciones de llamada de forma sincrónica y actualice el estado de los monitores de directorio en las plataformas que no admitan la supervisión recursiva de forma nativa.", "Syntax_Colon_0_6023": "Sintaxis: {0}", - "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'.", + "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "La etiqueta \"{0}\" espera al menos \"{1}\" argumentos, pero el generador de JSX \"{2}\" proporciona como máximo \"{3}\".", "Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358": "No se permiten expresiones de plantilla con etiquetas en una cadena opcional.", "The_0_modifier_can_only_be_used_in_TypeScript_files_8009": "El modificador \"{0}\" solo se puede usar en los archivos TypeScript.", "The_0_operator_cannot_be_applied_to_type_symbol_2469": "El operador '{0}' no se puede aplicar al tipo \"symbol\".", @@ -1180,6 +1182,7 @@ "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320": "El tipo de operando \"await\" debe ser una promesa válida o no debe contener un miembro \"then\" invocable.", "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418": "El tipo de valor de la propiedad calculada es \"{0}\", que no se puede asignar al tipo \"{1}\".", "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "El tipo de elementos iterados de un operando \"yield*\" debe ser una promesa válida o no debe contener un miembro \"then\" invocable.", + "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": "El tipo de propiedad \"{0}\" hace referencia circular a sí misma en el tipo asignado \"{1}\".", "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "El tipo de operando \"yield\" en un generador asincrónico debe ser una promesa válida o no debe contener un miembro \"then\" invocable.", "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038": "El tipo se origina en esta importación. No se puede construir ni llamar a una importación de estilo de espacio de nombres y provocará un error en tiempo de ejecución. Considere la posibilidad de usar una importación predeterminada o requerir la importación aquí.", "Type_parameter_0_has_a_circular_constraint_2313": "El parámetro de tipo '{0}' tiene una restricción circular.", @@ -1237,6 +1240,7 @@ "Unterminated_template_literal_1160": "Literal de plantilla sin terminar.", "Untyped_function_calls_may_not_accept_type_arguments_2347": "Las llamadas a función sin tipo no pueden aceptar argumentos de tipo.", "Unused_label_7028": "Etiqueta no usada.", + "Unused_ts_expect_error_directive_2578": "Directiva \"@ts-expect-error\" no usada.", "Updating_output_of_project_0_6373": "Actualizando la salida del proyecto \"{0}\"...", "Updating_output_timestamps_of_project_0_6359": "Actualizando las marcas de hora de salida del proyecto \"{0}\"...", "Updating_unchanged_output_timestamps_of_project_0_6371": "Actualizando las marcas de hora de salida no modificadas del proyecto \"{0}\"...", @@ -1340,6 +1344,7 @@ "file_6025": "archivo", "get_and_set_accessor_must_have_the_same_this_type_2682": "Los descriptores de acceso 'get' y 'set' deben tener el mismo tipo 'this'.", "get_and_set_accessor_must_have_the_same_type_2380": "Los descriptores de acceso \"get\" y \"set\" deben tener el mismo tipo.", + "get_and_set_accessors_cannot_declare_this_parameters_2784": "Los descriptores de acceso \"get\" y \"set\" no pueden declarar parámetros \"this\".", "implements_clause_already_seen_1175": "La cláusula \"implements\" ya se ha visto.", "implements_clauses_can_only_be_used_in_TypeScript_files_8005": "Las cláusulas \"implements\" solo se pueden usar en los archivos TypeScript.", "import_can_only_be_used_in_TypeScript_files_8002": "\"import ... =\" solo se puede usar en los archivos TypeScript.", diff --git a/lib/fr/diagnosticMessages.generated.json b/lib/fr/diagnosticMessages.generated.json index 67728facd3955..53badb410234a 100644 --- a/lib/fr/diagnosticMessages.generated.json +++ b/lib/fr/diagnosticMessages.generated.json @@ -758,10 +758,12 @@ "Only_amd_and_system_modules_are_supported_alongside_0_6082": "Seuls les modules 'amd' et 'system' sont pris en charge avec --{0}.", "Only_emit_d_ts_declaration_files_6014": "Émettez uniquement les fichiers de déclaration '.d.ts'.", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "Seuls les identificateurs/noms qualifiés avec des arguments de type facultatifs sont pris en charge dans une clause 'extends' de classe.", + "Only_named_exports_may_use_export_type_1383": "Seules les exportations nommées peuvent utiliser 'export type'.", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "Seules les méthodes publiques et protégées de la classe de base sont accessibles par le biais du mot clé 'super'.", "Operator_0_cannot_be_applied_to_type_1_2736": "Impossible d'appliquer l'opérateur '{0}' au type '{1}'.", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "Impossible d'appliquer l'opérateur '{0}' aux types '{1}' et '{2}'.", - "Option_0_can_only_be_specified_in_tsconfig_json_file_6064": "L'option '{0}' ne peut être spécifiée que dans le fichier 'tsconfig.json'.", + "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "Vous pouvez spécifier l'option '{0}' uniquement dans le fichier 'tsconfig.json', ou lui affecter la valeur 'false' ou 'null' sur la ligne de commande.", + "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "Vous pouvez spécifier l'option '{0}' uniquement dans le fichier 'tsconfig.json', ou lui affecter la valeur 'null' sur la ligne de commande.", "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "L'option '{0}' peut être utilisée uniquement quand l'option '--inlineSourceMap' ou l'option '--sourceMap' est spécifiée.", "Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "Impossible de spécifier l'option '{0}' quand l'option 'target' est 'ES3'.", "Option_0_cannot_be_specified_with_option_1_5053": "Impossible de spécifier l'option '{0}' avec l'option '{1}'.", @@ -1035,7 +1037,7 @@ "Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object_2470": "La référence 'Symbol' ne fait pas référence à l'objet constructeur Symbol global.", "Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6228": "Appelez les rappels de façon synchrone, et mettez à jour l'état des observateurs de répertoire sur les plateformes qui ne prennent pas en charge la surveillance récursive en mode natif.", "Syntax_Colon_0_6023": "Syntaxe : {0}", - "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'.", + "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "La balise '{0}' attend au moins '{1}' arguments, mais la fabrique JSX '{2}' en fournit au maximum '{3}'.", "Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358": "Les expressions de modèle étiquetées ne sont pas autorisées dans une chaîne facultative.", "The_0_modifier_can_only_be_used_in_TypeScript_files_8009": "Le modificateur '{0}' peut uniquement être utilisé dans les fichiers TypeScript.", "The_0_operator_cannot_be_applied_to_type_symbol_2469": "Impossible d'appliquer l'opérateur '{0}' au type 'symbol'.", @@ -1180,6 +1182,7 @@ "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320": "Le type d'un opérande 'await' doit être une promesse valide ou ne doit contenir aucun membre 'then' pouvant être appelé.", "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418": "Le type de la valeur de la propriété calculée est '{0}'. Il ne peut pas être assigné au type '{1}'.", "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "Le type des éléments itérés d'un opérande 'yield*' doit être une promesse valide ou ne doit contenir aucun membre 'then' pouvant être appelé.", + "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": "Le type de la propriété '{0}' se référence de façon circulaire dans le type mappé '{1}'.", "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "Le type d'un opérande 'yield' dans un générateur asynchrone doit être une promesse valide ou ne doit contenir aucun membre 'then' pouvant être appelé.", "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038": "Le type provient de cette importation. Impossible d'appeler ou de construire une importation de style d'espace de noms, ce qui va entraîner un échec au moment de l'exécution. À la place, utilisez une importation par défaut ou une obligation d'importation ici.", "Type_parameter_0_has_a_circular_constraint_2313": "Le paramètre de type '{0}' possède une contrainte circulaire.", @@ -1237,6 +1240,7 @@ "Unterminated_template_literal_1160": "Littéral de modèle inachevé.", "Untyped_function_calls_may_not_accept_type_arguments_2347": "Les appels de fonctions non typées ne peuvent pas accepter d'arguments de type.", "Unused_label_7028": "Étiquette inutilisée.", + "Unused_ts_expect_error_directive_2578": "Directive '@ts-expect-error' inutilisée.", "Updating_output_of_project_0_6373": "Mise à jour de la sortie du projet '{0}'...", "Updating_output_timestamps_of_project_0_6359": "Mise à jour des horodatages de sortie du projet '{0}'...", "Updating_unchanged_output_timestamps_of_project_0_6371": "Mise à jour des horodatages de sortie inchangés du projet '{0}'...", @@ -1340,6 +1344,7 @@ "file_6025": "fichier", "get_and_set_accessor_must_have_the_same_this_type_2682": "Les accesseurs 'get' et 'set' doivent avoir le même type 'this'.", "get_and_set_accessor_must_have_the_same_type_2380": "Les accesseurs 'get' et 'set' doivent avoir le même type.", + "get_and_set_accessors_cannot_declare_this_parameters_2784": "Les accesseurs 'get' et 'set' ne peuvent pas déclarer les paramètres 'this'.", "implements_clause_already_seen_1175": "Clause 'implements' déjà rencontrée.", "implements_clauses_can_only_be_used_in_TypeScript_files_8005": "Les clauses 'implements' peuvent uniquement être utilisées dans les fichiers TypeScript.", "import_can_only_be_used_in_TypeScript_files_8002": "'import ... =' peut uniquement être utilisé dans les fichiers TypeScript.", diff --git a/lib/it/diagnosticMessages.generated.json b/lib/it/diagnosticMessages.generated.json index 7af1b8736474f..89ba482c18b74 100644 --- a/lib/it/diagnosticMessages.generated.json +++ b/lib/it/diagnosticMessages.generated.json @@ -758,10 +758,12 @@ "Only_amd_and_system_modules_are_supported_alongside_0_6082": "Unitamente a --{0} sono supportati solo i moduli 'amd' e 'system'.", "Only_emit_d_ts_declaration_files_6014": "Crea solo i file di dichiarazione '.d.ts'.", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "Nella clausola 'extends' di una classe sono attualmente supportati solo identificatori/nomi qualificati con argomenti tipo facoltativi.", + "Only_named_exports_may_use_export_type_1383": "Solo le esportazioni denominate possono usare 'export type'.", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "Con la parola chiave 'super' è possibile accedere solo ai metodi pubblico e protetto della classe di base.", "Operator_0_cannot_be_applied_to_type_1_2736": "Non è possibile applicare l'operatore '{0}' al tipo '{1}'.", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "Non è possibile applicare l'operatore '{0}' ai tipi '{1}' e '{2}'.", - "Option_0_can_only_be_specified_in_tsconfig_json_file_6064": "L'opzione '{0}' può essere specificata solo nel file 'tsconfig.json'.", + "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "L'opzione '{0}' può essere specificata solo nel file 'tsconfig.json' oppure impostata su 'false' o 'null' sulla riga di comando.", + "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "L'opzione '{0}' può essere specificata solo nel file 'tsconfig.json' oppure impostata su 'null' sulla riga di comando.", "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "L'opzione '{0}' può essere usata solo quando si specifica l'opzione '--inlineSourceMap' o '--sourceMap'.", "Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "Non è possibile specificare l'opzione '{0}' quando l'opzione 'target' è 'ES3'.", "Option_0_cannot_be_specified_with_option_1_5053": "Non è possibile specificare l'opzione '{0}' insieme all'opzione '{1}'.", @@ -1035,7 +1037,7 @@ "Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object_2470": "Il riferimento 'Symbol' non fa riferimento all'oggetto costruttore Symbol globale.", "Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6228": "Chiama in modo sincrono i callback e aggiorna lo stato dei watcher di directory in piattaforme che non supportano il controllo ricorsivo in modo nativo.", "Syntax_Colon_0_6023": "Sintassi: {0}", - "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'.", + "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "Con il tag '{0}' sono previsti almeno '{1}' argomenti, ma la factory JSX '{2}' ne fornisce al massimo '{3}'.", "Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358": "Le espressioni di modello con tag non sono consentite in una catena facoltativa.", "The_0_modifier_can_only_be_used_in_TypeScript_files_8009": "Il modificatore '{0}' può essere usato solo in file TypeScript.", "The_0_operator_cannot_be_applied_to_type_symbol_2469": "Non è possibile applicare l'operatore '{0}' al tipo 'symbol'.", @@ -1180,6 +1182,7 @@ "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320": "Il tipo dell'operando 'await' deve essere una promessa valida oppure non deve contenere un membro 'then' chiamabile.", "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418": "Il tipo del valore della proprietà calcolata è '{0}', che non è assegnabile al tipo '{1}'.", "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "Il tipo di elementi iterati di un operando 'yield*' deve essere una promessa valida oppure non deve contenere un membro 'then' chiamabile.", + "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": "Il tipo di proprietà '{0}' contiene un riferimento circolare a se stesso nel tipo con mapping '{1}'.", "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "Il tipo dell'operando 'yield' in un generatore asincrono deve essere una promessa valida oppure non deve contenere un membro 'then' chiamabile.", "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038": "Il tipo è originato in corrispondenza di questa importazione. Non è possibile chiamare o costruire un'importazione di tipo spazio dei nomi e verrà restituito un errore in fase di esecuzione. Provare a usare un'importazione o un'importazione predefinita in questo punto.", "Type_parameter_0_has_a_circular_constraint_2313": "Il parametro di tipo '{0}' contiene un vincolo circolare.", @@ -1237,6 +1240,7 @@ "Unterminated_template_literal_1160": "Valore letterale di modello senza terminazione.", "Untyped_function_calls_may_not_accept_type_arguments_2347": "Le chiamate di funzione non tipizzate potrebbero non accettare argomenti tipo.", "Unused_label_7028": "Etichetta non usata.", + "Unused_ts_expect_error_directive_2578": "Direttiva '@ts-expect-error' non usata.", "Updating_output_of_project_0_6373": "Aggiornamento dell'output del progetto '{0}'...", "Updating_output_timestamps_of_project_0_6359": "Aggiornamento dei timestamp di output del progetto '{0}'...", "Updating_unchanged_output_timestamps_of_project_0_6371": "Aggiornamento dei timestamp di output non modificati del progetto '{0}'...", @@ -1340,6 +1344,7 @@ "file_6025": "file", "get_and_set_accessor_must_have_the_same_this_type_2682": "Le funzioni di accesso 'get e 'set' devono essere dello stesso tipo 'this'.", "get_and_set_accessor_must_have_the_same_type_2380": "Le funzioni di accesso 'get e 'set' devono essere dello stesso tipo.", + "get_and_set_accessors_cannot_declare_this_parameters_2784": "Le funzioni di accesso 'get' e 'set' non possono dichiarare parametri 'this'.", "implements_clause_already_seen_1175": "La clausola 'implements' è già presente.", "implements_clauses_can_only_be_used_in_TypeScript_files_8005": "Le clausole 'implements' possono essere usate solo in file TypeScript.", "import_can_only_be_used_in_TypeScript_files_8002": "'import ... =' può essere usato solo in file TypeScript.", diff --git a/lib/ja/diagnosticMessages.generated.json b/lib/ja/diagnosticMessages.generated.json index 1b340b186771e..3d3afeb06ffcc 100644 --- a/lib/ja/diagnosticMessages.generated.json +++ b/lib/ja/diagnosticMessages.generated.json @@ -758,10 +758,12 @@ "Only_amd_and_system_modules_are_supported_alongside_0_6082": "--{0} と共にサポートされるのは 'amd' モジュールと 'system' モジュールのみです。", "Only_emit_d_ts_declaration_files_6014": "'.d.ts' 宣言ファイルのみを生成します。", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "クラス 'extends' 句で現在サポートされているのは、オプションの型引数が指定された ID/完全修飾名のみです。", + "Only_named_exports_may_use_export_type_1383": "'export type' を使用できるのは名前付きエクスポートのみです。", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "'super' キーワードを使用してアクセスできるのは、基底クラスのパブリック メソッドと保護されたメソッドのみです。", "Operator_0_cannot_be_applied_to_type_1_2736": "演算子 '{0}' は型 '{1}' に適用できません。", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "演算子 '{0}' を型 '{1}' および '{2}' に適用することはできません。", - "Option_0_can_only_be_specified_in_tsconfig_json_file_6064": "オプション '{0}' は 'tsconfig.json' ファイルにのみ指定できます。", + "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "オプション '{0}' は、'tsconfig.json' ファイルで指定することか、コマンド ラインで 'false' または 'null' に設定することしかできません。", + "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "オプション '{0}' は、'tsconfig.json' ファイルで指定することか、コマンド ラインで 'null' に設定することしかできません。", "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "オプション '{0} を使用できるのは、オプション '--inlineSourceMap' またはオプション '--sourceMap' のいずれかを指定した場合のみです。", "Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "オプション 'target' が 'ES3' の場合、オプション '{0}' を指定することはできません。", "Option_0_cannot_be_specified_with_option_1_5053": "オプション '{0}' をオプション '{1}' とともに指定することはできません。", @@ -1035,7 +1037,7 @@ "Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object_2470": "'Symbol' 参照は、グローバル シンボル コンストラクター オブジェクトを参照しません。", "Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6228": "再帰的な監視をネイティブでサポートしていないプラットフォーム上で、同期的にコールバックを呼び出してディレクトリ監視の状態を更新します。", "Syntax_Colon_0_6023": "構文: {0}", - "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'.", + "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "タグ '{0}' には少なくとも '{1}' 個の引数が必要ですが、JSX ファクトリ '{2}' で提供されるのは最大 '{3}' 個です。", "Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358": "タグ付きテンプレート式は、省略可能なチェーンでは許可されていません。", "The_0_modifier_can_only_be_used_in_TypeScript_files_8009": "'{0}' 修飾子は TypeScript ファイルでのみ使用できます。", "The_0_operator_cannot_be_applied_to_type_symbol_2469": "'{0}' 演算子を 'symbol' 型に適用することはできません。", @@ -1180,6 +1182,7 @@ "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320": "'await' オペランドの型は、有効な Promise であるか、呼び出し可能な 'then' メンバーを含んでいないかのどちらかであることが必要です。", "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418": "計算されたプロパティの値の型は '{0}' です。これは、型 '{1}' に代入することはできません。", "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "'yield*' オペランドの反復要素の型は、有効な Promise であるか、呼び出し可能な 'then' メンバーを含んでいないかのどちらかであることが必要です。", + "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": "マップされた型 '{1}' で、プロパティ '{0}' の型によってそれ自体が循環参照されています。", "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "非同期ジェネレーター内の 'yield' オペランドの型は、有効な Promise であるか、呼び出し可能な 'then' メンバーを含んでいないかのどちらかであることが必要です。", "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038": "型はこのインポートで生成されます。名前空間スタイルのインポートは、呼び出すこともコンストラクトすることもできず、実行時にエラーが発生します。代わりに、ここで既定のインポートまたはインポートの要求を使用することを検討してください。", "Type_parameter_0_has_a_circular_constraint_2313": "型パラメーター '{0}' に循環制約があります。", @@ -1237,6 +1240,7 @@ "Unterminated_template_literal_1160": "未終了のテンプレート リテラルです。", "Untyped_function_calls_may_not_accept_type_arguments_2347": "型指定のない関数の呼び出しで型引数を使用することはできません。", "Unused_label_7028": "未使用のラベル。", + "Unused_ts_expect_error_directive_2578": "'@ts-expect-error' ディレクティブが使用されていません。", "Updating_output_of_project_0_6373": "プロジェクト '{0}' の出力を更新しています...", "Updating_output_timestamps_of_project_0_6359": "プロジェクト '{0}' の出力タイムスタンプを更新しています...", "Updating_unchanged_output_timestamps_of_project_0_6371": "プロジェクト '{0}' の変更されていない出力タイムスタンプを更新しています...", @@ -1303,7 +1307,7 @@ "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693": "'{0}' は型のみを参照しますが、ここで値として使用されています。", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585": "'{0}' は型のみを参照しますが、ここでは値として使用されています。ターゲット ライブラリを変更しますか? `lib` コンパイラ オプションを es2015 以降に変更してみてください。", "_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686": "'{0}' は UMD グローバルを参照していますが、現在のファイルはモジュールです。代わりにインポートを追加することを考慮してください。", - "_0_refers_to_a_value_but_is_being_used_as_a_type_here_2749": "'{0}' は値を参照しますが、ここでは型として使用されています。", + "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749": "'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?", "_0_tag_already_specified_1223": "'{0}' タグは既に指定されています。", "_0_tag_cannot_be_used_independently_as_a_top_level_JSDoc_tag_1253": "'{0}' タグはトップ レベルの JSDoc タグとして個別に使用することはできません。", "_0_was_also_declared_here_6203": "ここでは '{0}' も宣言されました。", @@ -1340,6 +1344,7 @@ "file_6025": "ファイル", "get_and_set_accessor_must_have_the_same_this_type_2682": "'get' アクセサーおよび 'set' アクセサーには、同じ 'this' 型が必要です。", "get_and_set_accessor_must_have_the_same_type_2380": "'get' アクセサーと 'set' アクセサーは同じ型でなければなりません。", + "get_and_set_accessors_cannot_declare_this_parameters_2784": "'get' および 'set' アクセサーでは 'this' パラメーターを宣言できません。", "implements_clause_already_seen_1175": "'implements' 句は既に存在します。", "implements_clauses_can_only_be_used_in_TypeScript_files_8005": "'implements' 句は、TypeScript ファイルでのみ使用できます。", "import_can_only_be_used_in_TypeScript_files_8002": "'import ... =' は、TypeScript ファイルでのみ使用できます。", diff --git a/lib/ko/diagnosticMessages.generated.json b/lib/ko/diagnosticMessages.generated.json index 9b24b74fa25d0..4b62c6b06926f 100644 --- a/lib/ko/diagnosticMessages.generated.json +++ b/lib/ko/diagnosticMessages.generated.json @@ -758,7 +758,7 @@ "Only_amd_and_system_modules_are_supported_alongside_0_6082": "'amd' 및 'system' 모듈만 --{0}과(와) 함께 사용할 수 있습니다.", "Only_emit_d_ts_declaration_files_6014": "'.d.ts' 선언 파일만 내보냅니다.", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "선택적 형식 인수가 포함된 식별자/정규화된 이름만 현재 클래스 'extends' 절에서 지원됩니다.", - "Only_named_exports_may_use_export_type_1383": "Only named exports may use 'export type'.", + "Only_named_exports_may_use_export_type_1383": "명명된 내보내기에서만 '내보내기 형식'을 사용할 수 있습니다.", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "기본 클래스의 공용 및 보호된 메서드만 'super' 키워드를 통해 액세스할 수 있습니다.", "Operator_0_cannot_be_applied_to_type_1_2736": "'{0}' 연산자는 '{1}' 형식에 적용할 수 없습니다.", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "'{0}' 연산자를 '{1}' 및 '{2}' 형식에 적용할 수 없습니다.", @@ -1182,7 +1182,7 @@ "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320": "'await' 형식의 피연산자는 유효한 프라미스여야 하거나 호출 가능 'then' 멤버를 포함하지 않아야 합니다.", "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418": "계산된 속성 값의 형식은 '{1}' 형식에 할당할 수 없는 '{0}'입니다.", "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "'yield*'의 반복되는 요소 형식의 피연산자는 유효한 프라미스여야 하거나 호출 가능 'then' 멤버를 포함하지 않아야 합니다.", - "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": "Type of property '{0}' circularly references itself in mapped type '{1}'.", + "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": "'{0}' 속성의 형식은 매핑된 형식 '{1}'에서 순환적으로 자신을 참조합니다.", "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "비동기 생성기에 있는 'yield' 형식의 피연산자는 유효한 프라미스여야 하거나 호출 가능 'then' 멤버를 포함하지 않아야 합니다.", "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038": "형식이 이 가져오기에서 시작됩니다. 네임스페이스 스타일 가져오기는 호출하거나 생성할 수 없으며, 런타임에 오류를 초래합니다. 여기서는 대신 기본 가져오기 또는 가져오기 필요를 사용하는 것이 좋습니다.", "Type_parameter_0_has_a_circular_constraint_2313": "형식 매개 변수 '{0}'에 순환 제약 조건이 있습니다.", @@ -1240,6 +1240,7 @@ "Unterminated_template_literal_1160": "종결되지 않은 템플릿 리터럴입니다.", "Untyped_function_calls_may_not_accept_type_arguments_2347": "형식화되지 않은 함수 호출에는 형식 인수를 사용할 수 없습니다.", "Unused_label_7028": "사용되지 않는 레이블입니다.", + "Unused_ts_expect_error_directive_2578": "사용되지 않는 '@ts-expect-error' 지시문입니다.", "Updating_output_of_project_0_6373": "'{0}' 프로젝트의 출력을 업데이트하는 중...", "Updating_output_timestamps_of_project_0_6359": "'{0}' 프로젝트의 출력 타임스탬프를 업데이트하는 중...", "Updating_unchanged_output_timestamps_of_project_0_6371": "'{0}' 프로젝트의 변경되지 않은 출력 타임스탬프를 업데이트하는 중...", @@ -1343,6 +1344,7 @@ "file_6025": "파일", "get_and_set_accessor_must_have_the_same_this_type_2682": "'get' 및 'set' 접근자는 동일한 'this' 형식이어야 합니다.", "get_and_set_accessor_must_have_the_same_type_2380": "'get' 및 'set' 접근자의 형식이 같아야 합니다.", + "get_and_set_accessors_cannot_declare_this_parameters_2784": "'get' 및 'set' 접근자는 'this' 매개 변수를 선언할 수 없습니다.", "implements_clause_already_seen_1175": "'implements' 절이 이미 있습니다.", "implements_clauses_can_only_be_used_in_TypeScript_files_8005": "'implements' 절은 TypeScript 파일에서만 사용할 수 있습니다.", "import_can_only_be_used_in_TypeScript_files_8002": "'import ... ='는 TypeScript 파일에서만 사용할 수 있습니다.", diff --git a/lib/lib.es2015.core.d.ts b/lib/lib.es2015.core.d.ts index 728fc76de3398..981072bd46128 100644 --- a/lib/lib.es2015.core.d.ts +++ b/lib/lib.es2015.core.d.ts @@ -62,6 +62,15 @@ interface Array { * @param end If not specified, length of the this object is used as its default value. */ copyWithin(target: number, start: number, end?: number): this; + + /** + * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. + * @param start The zero-based location in the array from which to start removing elements. + * @param deleteCount The number of elements to remove. If deleteCount is omitted, or if its value is equal to or larger + * than array.length - start (that is, if it is equal to or greater than the number of elements left in the array, + * starting at start), then all the elements from start to the end of the array will be deleted. + */ + splice(start: number, deleteCount?: number): T[]; } interface ArrayConstructor { diff --git a/lib/lib.es2015.iterable.d.ts b/lib/lib.es2015.iterable.d.ts index 85d0a4caf6daf..eb06bd46c2844 100644 --- a/lib/lib.es2015.iterable.d.ts +++ b/lib/lib.es2015.iterable.d.ts @@ -223,7 +223,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: Iterable>): Promise; + all(values: Iterable): Promise<(awaited TAll)[]>; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved @@ -231,7 +231,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - race(values: Iterable>): Promise; + race(values: Iterable): Promise; } declare namespace Reflect { diff --git a/lib/lib.es2015.promise.d.ts b/lib/lib.es2015.promise.d.ts index 3eead14f7d85b..ee0519c4c10a3 100644 --- a/lib/lib.es2015.promise.d.ts +++ b/lib/lib.es2015.promise.d.ts @@ -30,7 +30,7 @@ interface PromiseConstructor { * a resolve callback used to resolve the promise with a value or the result of another promise, * and a reject callback used to reject the promise with a provided reason or error. */ - new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; + new (executor: (resolve: (value?: T | PromiseLike | awaited T) => void, reject: (reason?: any) => void) => void): Promise; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -38,7 +38,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + all(values: readonly [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9, awaited T10]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -46,7 +46,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + all(values: readonly [T1, T2, T3, T4, T5, T6, T7, T8, T9]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -54,7 +54,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; + all(values: readonly [T1, T2, T3, T4, T5, T6, T7, T8]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -62,7 +62,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; + all(values: readonly [T1, T2, T3, T4, T5, T6, T7]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -70,7 +70,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; + all(values: readonly [T1, T2, T3, T4, T5, T6]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -78,7 +78,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; + all(values: readonly [T1, T2, T3, T4, T5]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -86,7 +86,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; + all(values: readonly [T1, T2, T3, T4]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -94,7 +94,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; + all(values: readonly [T1, T2, T3]): Promise<[awaited T1, awaited T2, awaited T3]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -102,7 +102,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; + all(values: readonly [T1, T2]): Promise<[awaited T1, awaited T2]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -110,7 +110,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly (T | PromiseLike)[]): Promise; + all(values: readonly T[]): Promise<(awaited T)[]>; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved @@ -118,7 +118,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - race(values: readonly T[]): Promise ? U : T>; + race(values: readonly T[]): Promise; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved @@ -126,21 +126,21 @@ interface PromiseConstructor { * @param values An iterable of Promises. * @returns A new Promise. */ - race(values: Iterable): Promise ? U : T>; + race(values: Iterable): Promise; /** * Creates a new rejected promise for the provided reason. * @param reason The reason the promise was rejected. * @returns A new rejected Promise. */ - reject(reason?: any): Promise; + reject(reason?: any): Promise; /** * Creates a new resolved promise for the provided value. * @param value A promise. * @returns A promise whose internal state matches the provided promise. */ - resolve(value: T | PromiseLike): Promise; + resolve(value: T): Promise; /** * Creates a new resolved promise . diff --git a/lib/lib.es2015.symbol.wellknown.d.ts b/lib/lib.es2015.symbol.wellknown.d.ts index 2c881993c767a..afef55cf043cb 100644 --- a/lib/lib.es2015.symbol.wellknown.d.ts +++ b/lib/lib.es2015.symbol.wellknown.d.ts @@ -227,7 +227,8 @@ interface RegExpConstructor { interface String { /** - * Matches a string an object that supports being matched against, and returns an array containing the results of that search. + * Matches a string or an object that supports being matched against, and returns an array + * containing the results of that search, or null if no matches are found. * @param matcher An object that supports being matched against. */ match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; @@ -315,4 +316,4 @@ interface SetConstructor { } interface ArrayBufferConstructor { readonly [Symbol.species]: ArrayBufferConstructor; -} \ No newline at end of file +} diff --git a/lib/lib.es2018.intl.d.ts b/lib/lib.es2018.intl.d.ts index 13d2fea4cb540..0d7961101e1f0 100644 --- a/lib/lib.es2018.intl.d.ts +++ b/lib/lib.es2018.intl.d.ts @@ -19,25 +19,35 @@ and limitations under the License. declare namespace Intl { + + // http://cldr.unicode.org/index/cldr-spec/plural-rules#TOC-Determining-Plural-Categories + type LDMLPluralRule = "zero" | "one" | "two" | "few" | "many" | "other"; + type PluralRuleType = "cardinal" | "ordinal"; + interface PluralRulesOptions { localeMatcher?: "lookup" | "best fit"; - type?: "cardinal" | "ordinal"; + type?: PluralRuleType; + minimumIntegerDigits?: number; + minimumFractionDigits?: number; + maximumFractionDigits?: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; } interface ResolvedPluralRulesOptions { locale: string; - pluralCategories: string[]; - type: "cardinal" | "ordinal"; + pluralCategories: LDMLPluralRule[]; + type: PluralRuleType; minimumIntegerDigits: number; minimumFractionDigits: number; maximumFractionDigits: number; - minimumSignificantDigits: number; - maximumSignificantDigits: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; } interface PluralRules { resolvedOptions(): ResolvedPluralRulesOptions; - select(n: number): string; + select(n: number): LDMLPluralRule; } const PluralRules: { diff --git a/lib/lib.es2020.bigint.d.ts b/lib/lib.es2020.bigint.d.ts index 1a6b1c20dda33..ad59be008db51 100644 --- a/lib/lib.es2020.bigint.d.ts +++ b/lib/lib.es2020.bigint.d.ts @@ -288,6 +288,9 @@ interface BigInt64Array { /** Returns a string representation of the array. */ toString(): string; + /** Returns the primitive value of the specified object. */ + valueOf(): BigInt64Array; + /** Yields each value in the array. */ values(): IterableIterator; @@ -557,6 +560,9 @@ interface BigUint64Array { /** Returns a string representation of the array. */ toString(): string; + /** Returns the primitive value of the specified object. */ + valueOf(): BigUint64Array; + /** Yields each value in the array. */ values(): IterableIterator; diff --git a/lib/lib.es5.d.ts b/lib/lib.es5.d.ts index 5816582e1f7f4..eb34e6d5f943a 100644 --- a/lib/lib.es5.d.ts +++ b/lib/lib.es5.d.ts @@ -1274,7 +1274,7 @@ interface Array { * @param start The zero-based location in the array from which to start removing elements. * @param deleteCount The number of elements to remove. */ - splice(start: number, deleteCount?: number): T[]; + splice(start: number, deleteCount: number): T[]; /** * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. * @param start The zero-based location in the array from which to start removing elements. @@ -1398,7 +1398,7 @@ declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; -declare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike; +declare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike | awaited T) => void, reject: (reason?: any) => void) => void) => PromiseLike; interface PromiseLike { /** @@ -1407,7 +1407,7 @@ interface PromiseLike { * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of which ever callback is executed. */ - then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): PromiseLike; + then(onfulfilled?: ((value: awaited T) => TResult1) | undefined | null, onrejected?: ((reason: any) => TResult2) | undefined | null): PromiseLike; } /** @@ -1420,14 +1420,14 @@ interface Promise { * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of which ever callback is executed. */ - then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; + then(onfulfilled?: ((value: awaited T) => TResult1) | undefined | null, onrejected?: ((reason: any) => TResult2) | undefined | null): Promise; /** * Attaches a callback for only the rejection of the Promise. * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of the callback. */ - catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; + catch(onrejected?: ((reason: any) => TResult) | undefined | null): Promise; } interface ArrayLike { @@ -1940,6 +1940,9 @@ interface Int8Array { */ toString(): string; + /** Returns the primitive value of the specified object. */ + valueOf(): Int8Array; + [index: number]: number; } interface Int8ArrayConstructor { @@ -2219,6 +2222,9 @@ interface Uint8Array { */ toString(): string; + /** Returns the primitive value of the specified object. */ + valueOf(): Uint8Array; + [index: number]: number; } @@ -2498,6 +2504,9 @@ interface Uint8ClampedArray { */ toString(): string; + /** Returns the primitive value of the specified object. */ + valueOf(): Uint8ClampedArray; + [index: number]: number; } @@ -2775,6 +2784,9 @@ interface Int16Array { */ toString(): string; + /** Returns the primitive value of the specified object. */ + valueOf(): Int16Array; + [index: number]: number; } @@ -3055,6 +3067,9 @@ interface Uint16Array { */ toString(): string; + /** Returns the primitive value of the specified object. */ + valueOf(): Uint16Array; + [index: number]: number; } @@ -3334,6 +3349,9 @@ interface Int32Array { */ toString(): string; + /** Returns the primitive value of the specified object. */ + valueOf(): Int32Array; + [index: number]: number; } @@ -3612,6 +3630,9 @@ interface Uint32Array { */ toString(): string; + /** Returns the primitive value of the specified object. */ + valueOf(): Uint32Array; + [index: number]: number; } @@ -3891,6 +3912,9 @@ interface Float32Array { */ toString(): string; + /** Returns the primitive value of the specified object. */ + valueOf(): Float32Array; + [index: number]: number; } @@ -4162,6 +4186,9 @@ interface Float64Array { toString(): string; + /** Returns the primitive value of the specified object. */ + valueOf(): Float64Array; + [index: number]: number; } diff --git a/lib/lib.esnext.d.ts b/lib/lib.esnext.d.ts index 9b4e8e983de43..c03ea0b11267e 100644 --- a/lib/lib.esnext.d.ts +++ b/lib/lib.esnext.d.ts @@ -20,3 +20,5 @@ and limitations under the License. /// /// +/// +/// diff --git a/lib/lib.esnext.promise.d.ts b/lib/lib.esnext.promise.d.ts new file mode 100644 index 0000000000000..6a56c55128861 --- /dev/null +++ b/lib/lib.esnext.promise.d.ts @@ -0,0 +1,43 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + + +/// + + +interface AggregateError extends Error { + errors: any[] +} + +interface AggregateErrorConstructor { + new(errors: Iterable, message?: string): AggregateError; + (errors: Iterable, message?: string): AggregateError; + readonly prototype: AggregateError; +} + +declare var AggregateError: AggregateErrorConstructor; + +/** + * Represents the completion of an asynchronous operation + */ +interface PromiseConstructor { + /** + * The any function returns a promise that is fulfilled by the first given promise to be fulfilled, or rejected with an AggregateError containing an array of rejection reasons if all of the given promises are rejected. It resolves all elements of the passed iterable to promises as it runs this algorithm. + * @param values An array or iterable of Promises. + * @returns A new Promise. + */ + any(values: (T | PromiseLike)[] | Iterable>): Promise +} diff --git a/lib/lib.esnext.string.d.ts b/lib/lib.esnext.string.d.ts new file mode 100644 index 0000000000000..406f0e6069ea4 --- /dev/null +++ b/lib/lib.esnext.string.d.ts @@ -0,0 +1,28 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + + +/// + + +interface String { + /** + * Replace all instances of a substring in a string, using a regular expression or search string. + * @param searchValue A string to search for. + * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. + */ + replaceAll(searchValue: string | RegExp, replaceValue: string): string; +} diff --git a/lib/pl/diagnosticMessages.generated.json b/lib/pl/diagnosticMessages.generated.json index d588d7c93c4e8..c06c6376dd258 100644 --- a/lib/pl/diagnosticMessages.generated.json +++ b/lib/pl/diagnosticMessages.generated.json @@ -758,7 +758,7 @@ "Only_amd_and_system_modules_are_supported_alongside_0_6082": "Tylko moduły „amd” i „system” są obsługiwane razem z parametrem --{0}.", "Only_emit_d_ts_declaration_files_6014": "Emituj tylko pliki deklaracji „d.ts”.", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "Klauzula „extends” klasy obsługuje obecnie tylko identyfikatory/nazwy kwalifikowane z opcjonalnymi argumentami typu.", - "Only_named_exports_may_use_export_type_1383": "Only named exports may use 'export type'.", + "Only_named_exports_may_use_export_type_1383": "Tylko nazwane eksporty mogą używać elementu „export type”.", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "Tylko publiczne i chronione metody klasy bazowej są dostępne przy użyciu słowa kluczowego „super”.", "Operator_0_cannot_be_applied_to_type_1_2736": "Nie można zastosować operatora „{0}” do typu „{1}”.", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "Nie można zastosować operatora „{0}” do typów „{1}” i „{2}”.", @@ -1182,7 +1182,7 @@ "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320": "Typ operandu „await” musi być prawidłową obietnicą lub nie może zawierać wywoływalnej składowej „then”.", "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418": "Typ wartości właściwości obliczanej to „{0}”, którego nie można przypisać do typu „{1}”.", "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "Typ iterowanych elementów operandu „yield*” musi być prawidłową obietnicą lub nie może zawierać wywoływalnej składowej „then”.", - "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": "Type of property '{0}' circularly references itself in mapped type '{1}'.", + "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": "Typ właściwości „{0}” cyklicznie odwołuje się do siebie w zamapowanym typie „{1}”.", "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "Typ operandu „yield” w generatorze asynchronicznym musi być prawidłową obietnicą lub nie może zawierać wywoływalnej składowej „then”.", "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038": "Typ pochodzi z tego importu. Nie można wywołać ani skonstruować importu w stylu przestrzeni nazw, co spowoduje wystąpienie błędu w czasie wykonywania. Zamiast tego rozważ użycie importu domyślnego lub funkcji require importu.", "Type_parameter_0_has_a_circular_constraint_2313": "Parametr typu „{0}” zawiera ograniczenie cykliczne.", @@ -1240,6 +1240,7 @@ "Unterminated_template_literal_1160": "Niezakończony literał szablonu.", "Untyped_function_calls_may_not_accept_type_arguments_2347": "Wywołania funkcji bez typu nie mogą przyjmować argumentów typu.", "Unused_label_7028": "Nieużywana etykieta.", + "Unused_ts_expect_error_directive_2578": "Nieużywana dyrektywa „@ts-expect-error”.", "Updating_output_of_project_0_6373": "Trwa aktualizowanie danych wyjściowych projektu „{0}”...", "Updating_output_timestamps_of_project_0_6359": "Trwa aktualizowanie sygnatury czasowej danych wyjściowych projektu „{0}”...", "Updating_unchanged_output_timestamps_of_project_0_6371": "Trwa aktualizowanie niezmienionych sygnatur czasowych danych wyjściowych projektu „{0}”...", @@ -1343,6 +1344,7 @@ "file_6025": "plik", "get_and_set_accessor_must_have_the_same_this_type_2682": "Metody dostępu „get” i „set” muszą mieć ten sam typ „this”.", "get_and_set_accessor_must_have_the_same_type_2380": "Metody dostępu „get” i „set” muszą być tego samego typu.", + "get_and_set_accessors_cannot_declare_this_parameters_2784": "Metody dostępu „get” i „set” nie mogą deklarować parametrów „this”.", "implements_clause_already_seen_1175": "Napotkano już klauzulę „implements”.", "implements_clauses_can_only_be_used_in_TypeScript_files_8005": "Klauzule „implements” mogą być używane tylko w plikach TypeScript.", "import_can_only_be_used_in_TypeScript_files_8002": "Ciąg „import ... =” może być używany tylko w plikach TypeScript.", diff --git a/lib/protocol.d.ts b/lib/protocol.d.ts index f954fdea53f40..16e9bfcd60301 100644 --- a/lib/protocol.d.ts +++ b/lib/protocol.d.ts @@ -2377,6 +2377,7 @@ declare namespace ts.server.protocol { newLineCharacter?: string; convertTabsToSpaces?: boolean; indentStyle?: IndentStyle | ts.IndentStyle; + trimTrailingWhitespace?: boolean; } interface FormatCodeSettings extends EditorSettings { insertSpaceAfterCommaDelimiter?: boolean; diff --git a/lib/pt-br/diagnosticMessages.generated.json b/lib/pt-br/diagnosticMessages.generated.json index 01056f134ed44..eef2268de9a1f 100644 --- a/lib/pt-br/diagnosticMessages.generated.json +++ b/lib/pt-br/diagnosticMessages.generated.json @@ -758,7 +758,7 @@ "Only_amd_and_system_modules_are_supported_alongside_0_6082": "Há suporte somente aos módulos 'amd' e 'system' ao lado de --{0}.", "Only_emit_d_ts_declaration_files_6014": "Emita somente arquivos de declaração '.d.ts'.", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "Somente os identificadores/nomes qualificados com argumentos de tipo opcionais tem suporte atualmente nas cláusulas de classe 'extends'.", - "Only_named_exports_may_use_export_type_1383": "Only named exports may use 'export type'.", + "Only_named_exports_may_use_export_type_1383": "Somente as exportações nomeadas podem usar 'tipo de exportação'.", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "Somente métodos protegidos e públicos da classe base são acessíveis pela palavra-chave 'super'.", "Operator_0_cannot_be_applied_to_type_1_2736": "O operador '{0}' não pode ser aplicado ao tipo '{1}'.", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "O operador '{0}' não pode ser aplicado aos tipos '{1}' e '{2}'.", @@ -1182,6 +1182,7 @@ "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320": "O tipo de operando \"await\" deve ser uma promessa válida ou não deve conter um membro \"then\" que pode ser chamado.", "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418": "O tipo de valor da propriedade computada é '{0}', que não pode ser atribuído ao tipo '{1}'.", "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "O tipo de elementos iterados de um operando \"yield*\" deve ser uma promessa válida ou não deve conter um membro \"then\" que pode ser chamado.", + "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": "O tipo de propriedade '{0}' faz referência circular a si mesmo no tipo mapeado '{1}'.", "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "O tipo do operando \"yield\" em um gerador assíncrono deve ser uma promessa válida ou não deve conter um membro \"then\" que pode ser chamado.", "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038": "O tipo se origina nessa importação. Uma importação de estilo de namespace não pode ser chamada nem construída e causará uma falha no runtime. Considere usar uma importação padrão ou solicite uma importação aqui.", "Type_parameter_0_has_a_circular_constraint_2313": "O parâmetro de tipo '{0}' tem uma restrição circular.", @@ -1239,6 +1240,7 @@ "Unterminated_template_literal_1160": "Literal de modelo não finalizado.", "Untyped_function_calls_may_not_accept_type_arguments_2347": "Chamadas de função não tipadas não podem aceitar argumentos de tipo.", "Unused_label_7028": "Rótulo não utilizado.", + "Unused_ts_expect_error_directive_2578": "Diretiva '@ts-expect-error' não usada.", "Updating_output_of_project_0_6373": "Atualizando a saída do projeto '{0}'...", "Updating_output_timestamps_of_project_0_6359": "Atualizando os carimbos de data/hora de saída do projeto '{0}'...", "Updating_unchanged_output_timestamps_of_project_0_6371": "Atualizando os carimbos de data/hora de saída inalterados do projeto '{0}'...", @@ -1342,6 +1344,7 @@ "file_6025": "arquivo", "get_and_set_accessor_must_have_the_same_this_type_2682": "os assessores 'set' e 'get' devem ter o mesmo tipo 'this'.", "get_and_set_accessor_must_have_the_same_type_2380": "Os acessadores 'get' e 'set' devem ser do mesmo tipo.", + "get_and_set_accessors_cannot_declare_this_parameters_2784": "os acessadores 'get' e 'set' não podem declarar os parâmetros 'this'.", "implements_clause_already_seen_1175": "A cláusula 'implements' já foi vista.", "implements_clauses_can_only_be_used_in_TypeScript_files_8005": "Cláusulas 'implements' só podem ser usadas em arquivos TypeScript.", "import_can_only_be_used_in_TypeScript_files_8002": "'import ... =' só pode ser usado em arquivos TypeScript.", diff --git a/lib/ru/diagnosticMessages.generated.json b/lib/ru/diagnosticMessages.generated.json index 6c351ab2a0c49..0ecaa21a6a61e 100644 --- a/lib/ru/diagnosticMessages.generated.json +++ b/lib/ru/diagnosticMessages.generated.json @@ -758,7 +758,7 @@ "Only_amd_and_system_modules_are_supported_alongside_0_6082": "Только модули amd и system поддерживаются вместе с --{0}.", "Only_emit_d_ts_declaration_files_6014": "Порождаются только файлы объявлений \".d.ts\".", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "В предложениях extends класса сейчас поддерживаются только идентификаторы или полные имена с необязательными аргументами типа.", - "Only_named_exports_may_use_export_type_1383": "Only named exports may use 'export type'.", + "Only_named_exports_may_use_export_type_1383": "Только именованные экспорты могут использовать export type.", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "Через ключевое слово super доступны только общие и защищенные методы базового класса.", "Operator_0_cannot_be_applied_to_type_1_2736": "Не удается применить операнд \"{0}\" к типу \"{1}\".", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "Оператор \"{0}\" невозможно применить к типам \"{1}\" и \"{2}\".", @@ -1037,7 +1037,7 @@ "Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object_2470": "Ссылка Symbol не ссылается на глобальный объект конструктора Symbol.", "Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6228": "Синхронно вызывайте обратные вызовы и обновляйте состояние наблюдателей каталогов на платформах, не имеющих собственной поддержки рекурсивного наблюдения.", "Syntax_Colon_0_6023": "Синтаксис: {0}", - "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'.", + "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "Минимальное ожидаемое число аргументов для тега \"{0}\" — \"{1}\", при этом максимальное число аргументов, предоставляемое фабрикой JSX \"{2}\", — \"{3}\".", "Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358": "Выражения шаблона с тегами запрещено использовать в необязательной цепочке.", "The_0_modifier_can_only_be_used_in_TypeScript_files_8009": "Модификатор \"{0}\" можно использовать только в файлах TypeScript.", "The_0_operator_cannot_be_applied_to_type_symbol_2469": "Оператор \"{0}\" невозможно применить к типу Symbol.", @@ -1182,7 +1182,7 @@ "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320": "Тип операнда \"await\" должен быть допустимым обещанием либо не должен содержать вызываемый элемент \"then\".", "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418": "Типом значения вычисляемого свойства является \"{0}\", который не может быть назначен типу \"{1}\".", "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "Тип элементов итерации для операнда \"yield*\" должен быть допустимым обещанием либо не должен содержать вызываемый элемент \"then\".", - "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": "Type of property '{0}' circularly references itself in mapped type '{1}'.", + "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": "Тип свойства \"{0}\" циклически ссылается на самого себя в сопоставленном типе \"{1}\".", "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "Тип операнда \"yield\" в асинхронном генераторе должен быть допустимым обещанием либо не должен содержать вызываемый элемент \"then\".", "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038": "Тип происходит от этого импорта. Импорт стиля пространства имен не может быть вызван или создан и приведет к сбою во время выполнения. Вместо этого рекомендуется использовать импорт по умолчанию или импорт, указанный здесь.", "Type_parameter_0_has_a_circular_constraint_2313": "Параметр типа \"{0}\" содержит циклическое ограничение.", @@ -1240,6 +1240,7 @@ "Unterminated_template_literal_1160": "Незавершенный литерал шаблона.", "Untyped_function_calls_may_not_accept_type_arguments_2347": "Вызовы функций без типов не могут принимать аргументы типов.", "Unused_label_7028": "Неиспользуемая метка.", + "Unused_ts_expect_error_directive_2578": "Неиспользуемая директива \"@ts-expect-error\".", "Updating_output_of_project_0_6373": "Обновление выходных данных проекта \"{0}\"...", "Updating_output_timestamps_of_project_0_6359": "Обновление меток времени в выходных данных проекта \"{0}\"...", "Updating_unchanged_output_timestamps_of_project_0_6371": "Обновление меток времени в неизменившихся выходных данных проекта \"{0}\"...", @@ -1343,6 +1344,7 @@ "file_6025": "файл", "get_and_set_accessor_must_have_the_same_this_type_2682": "Методы доступа \"get\" и \"set\" должны иметь одинаковый тип \"this\".", "get_and_set_accessor_must_have_the_same_type_2380": "Методы доступа get и set должны иметь одинаковый тип.", + "get_and_set_accessors_cannot_declare_this_parameters_2784": "Методы доступа \"get\" и \"set\" не могут объявлять параметры \"this\".", "implements_clause_already_seen_1175": "Предложение implements уже существует.", "implements_clauses_can_only_be_used_in_TypeScript_files_8005": "Предложения \"implements\" можно использовать только в файлах TypeScript.", "import_can_only_be_used_in_TypeScript_files_8002": "Элемент \"import ... =\" можно использовать только в файлах TypeScript.", diff --git a/lib/tr/diagnosticMessages.generated.json b/lib/tr/diagnosticMessages.generated.json index 7ef43c5ec7b7c..1ed417092248e 100644 --- a/lib/tr/diagnosticMessages.generated.json +++ b/lib/tr/diagnosticMessages.generated.json @@ -758,10 +758,12 @@ "Only_amd_and_system_modules_are_supported_alongside_0_6082": "--{0} ile birlikte yalnızca 'amd' ve 'system' modülleri desteklenir.", "Only_emit_d_ts_declaration_files_6014": "Yalnızca '.d.ts' bildirim dosyalarını yayımla.", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "Sınıf 'extends' yan tümceleri içinde, şu an için yalnızca isteğe bağlı tür bağımsız değişkenlerine sahip tanımlayıcılar/tam adlar destekleniyor.", + "Only_named_exports_may_use_export_type_1383": "Yalnızca adlandırılmış dışarı aktarmalarda 'dışarı aktarma türü' kullanılabilir.", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "'super' anahtar sözcüğüyle yalnızca temel sınıfa ait ortak ve korunan metotlara erişilebilir.", "Operator_0_cannot_be_applied_to_type_1_2736": "'{0}' işleci '{1}' türüne uygulanamıyor.", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "'{0}' işleci, '{1}' ve '{2}' türüne uygulanamaz.", - "Option_0_can_only_be_specified_in_tsconfig_json_file_6064": "'{0}' seçeneği yalnızca 'tsconfig.json' dosyasında belirtilebilir.", + "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "'{0}' seçeneği, yalnızca 'tsconfig.json' dosyasında belirtilebilir veya komut satırında 'false' veya 'null' olarak ayarlanabilir.", + "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "'{0}' seçeneği, yalnızca 'tsconfig.json' dosyasında belirtilebilir veya komut satırında 'null' olarak ayarlanabilir.", "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "'{0} seçeneği yalnızca '--inlineSourceMap' veya '--sourceMap' seçeneği sağlandığında kullanılabilir.", "Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "'target' seçeneği 'ES3' olduğunda '{0}' seçeneği belirtilemiyor.", "Option_0_cannot_be_specified_with_option_1_5053": "'{0}' seçeneği, '{1}' seçeneği ile belirtilemez.", @@ -1035,7 +1037,7 @@ "Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object_2470": "'Symbol' başvurusu, genel Simge oluşturucu nesnesine başvurmaz.", "Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6228": "Geri çağırmaları eşzamanlı olarak çağırın ve özyinelemeli izlemeyi yerel olarak desteklemeyen platformlardaki dizin izleyicilerinin durumunu güncelleştirin.", "Syntax_Colon_0_6023": "Söz dizimi: {0}", - "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'.", + "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "'{0}' etiketi en az '{1}' bağımsız değişken bekliyor, ancak '{2}' JSX fabrikası en fazla '{3}' tane sağlıyor.", "Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358": "İsteğe bağlı bir zincirde etiketli şablon ifadelerine izin verilmiyor.", "The_0_modifier_can_only_be_used_in_TypeScript_files_8009": "'{0}' değiştiricisi yalnızca TypeScript dosyalarında kullanılabilir.", "The_0_operator_cannot_be_applied_to_type_symbol_2469": "'{0}' işleci, 'symbol' türüne uygulanamaz.", @@ -1180,6 +1182,7 @@ "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320": "'await' işleneninin türü, geçerli bir promise olmalı veya çağrılabilir 'then' üyesi içermemelidir.", "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418": "Hesaplanan özellik değerinin '{0}' türü, '{1}' türüne atanamıyor.", "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "Bir 'yield*' işleneninin yinelenen öğelerinin türü, geçerli bir promise olmalı veya çağrılabilir 'then' üyesi içermemelidir.", + "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": "'{0}' özelliğinin türü, '{1}' eşlenmiş türünde döngüsel olarak kendine başvuruyor.", "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "Zaman uyumsuz bir oluşturucudaki 'yield' işleneninin türü, geçerli bir promise olmalı veya çağrılabilir 'then' üyesi içermemelidir.", "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038": "Tür bu içeri aktarmadan kaynaklanıyor. Bir ad alanı stili içeri aktarma işlemi çağrılamaz ya da oluşturulamaz ve çalışma zamanında hataya neden olur. Bunun yerine varsayılan içeri aktarmayı kullanmayı veya içeri aktarmayı burada gerektirmeyi deneyin.", "Type_parameter_0_has_a_circular_constraint_2313": "'{0}' tür parametresi döngüsel bir kısıtlamaya sahip.", @@ -1237,6 +1240,7 @@ "Unterminated_template_literal_1160": "Sonlandırılmamış şablon sabit değeri.", "Untyped_function_calls_may_not_accept_type_arguments_2347": "Türü belirtilmemiş işlev çağrıları tür bağımsız değişkenlerini kabul etmeyebilir.", "Unused_label_7028": "Kullanılmayan etiket.", + "Unused_ts_expect_error_directive_2578": "Kullanılmayan '@ts-expect-error' yönergesi.", "Updating_output_of_project_0_6373": "'{0}' projesinin çıkışı güncelleştiriliyor...", "Updating_output_timestamps_of_project_0_6359": "'{0}' projesinin çıkış zaman damgaları güncelleştiriliyor...", "Updating_unchanged_output_timestamps_of_project_0_6371": "'{0}' projesinin değiştirilmemiş çıkış zaman damgaları güncelleştiriliyor...", @@ -1340,6 +1344,7 @@ "file_6025": "dosya", "get_and_set_accessor_must_have_the_same_this_type_2682": "'get' ve 'set' erişimcisi aynı 'this' türüne sahip olmalıdır.", "get_and_set_accessor_must_have_the_same_type_2380": "'get' ve 'set' erişimcisi aynı türde olmalıdır.", + "get_and_set_accessors_cannot_declare_this_parameters_2784": "'get' ve 'set' erişimcileri 'this' parametreleri bildiremez.", "implements_clause_already_seen_1175": "'implements' yan tümcesi zaten görüldü.", "implements_clauses_can_only_be_used_in_TypeScript_files_8005": "'implements' yan tümceleri yalnızca TypeScript dosyalarında kullanılabilir.", "import_can_only_be_used_in_TypeScript_files_8002": "'import ... =' yalnızca TypeScript dosyalarında kullanılabilir.", diff --git a/lib/tsc.js b/lib/tsc.js index a5551a1c25478..ee603072d2722 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -4120,6 +4120,10 @@ var ts; } } ts.forEachAncestorDirectory = forEachAncestorDirectory; + function isNodeModulesDirectory(dirPath) { + return ts.endsWith(dirPath, "/node_modules"); + } + ts.isNodeModulesDirectory = isNodeModulesDirectory; })(ts || (ts = {})); var ts; (function (ts) { @@ -4427,7 +4431,7 @@ var ts; Cannot_find_name_0: diag(2304, ts.DiagnosticCategory.Error, "Cannot_find_name_0_2304", "Cannot find name '{0}'."), Module_0_has_no_exported_member_1: diag(2305, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_2305", "Module '{0}' has no exported member '{1}'."), File_0_is_not_a_module: diag(2306, ts.DiagnosticCategory.Error, "File_0_is_not_a_module_2306", "File '{0}' is not a module."), - Cannot_find_module_0: diag(2307, ts.DiagnosticCategory.Error, "Cannot_find_module_0_2307", "Cannot find module '{0}'."), + Cannot_find_module_0_or_its_corresponding_type_declarations: diag(2307, ts.DiagnosticCategory.Error, "Cannot_find_module_0_or_its_corresponding_type_declarations_2307", "Cannot find module '{0}' or its corresponding type declarations."), Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: diag(2308, ts.DiagnosticCategory.Error, "Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308", "Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."), An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: diag(2309, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", "An export assignment cannot be used in a module with other exported elements."), Type_0_recursively_references_itself_as_a_base_type: diag(2310, ts.DiagnosticCategory.Error, "Type_0_recursively_references_itself_as_a_base_type_2310", "Type '{0}' recursively references itself as a base type."), @@ -4687,6 +4691,7 @@ var ts; No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments: diag(2575, ts.DiagnosticCategory.Error, "No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575", "No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."), Property_0_is_a_static_member_of_type_1: diag(2576, ts.DiagnosticCategory.Error, "Property_0_is_a_static_member_of_type_1_2576", "Property '{0}' is a static member of type '{1}'"), Return_type_annotation_circularly_references_itself: diag(2577, ts.DiagnosticCategory.Error, "Return_type_annotation_circularly_references_itself_2577", "Return type annotation circularly references itself."), + Unused_ts_expect_error_directive: diag(2578, ts.DiagnosticCategory.Error, "Unused_ts_expect_error_directive_2578", "Unused '@ts-expect-error' directive."), Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`."), Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`."), Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`."), @@ -4815,7 +4820,7 @@ var ts; This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided: diag(2746, ts.DiagnosticCategory.Error, "This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746", "This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."), _0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2: diag(2747, ts.DiagnosticCategory.Error, "_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747", "'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."), Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided: diag(2748, ts.DiagnosticCategory.Error, "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748", "Cannot access ambient const enums when the '--isolatedModules' flag is provided."), - _0_refers_to_a_value_but_is_being_used_as_a_type_here: diag(2749, ts.DiagnosticCategory.Error, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_2749", "'{0}' refers to a value, but is being used as a type here."), + _0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0: diag(2749, ts.DiagnosticCategory.Error, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749", "'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"), The_implementation_signature_is_declared_here: diag(2750, ts.DiagnosticCategory.Error, "The_implementation_signature_is_declared_here_2750", "The implementation signature is declared here."), Circularity_originates_in_type_at_this_location: diag(2751, ts.DiagnosticCategory.Error, "Circularity_originates_in_type_at_this_location_2751", "Circularity originates in type at this location."), The_first_export_default_is_here: diag(2752, ts.DiagnosticCategory.Error, "The_first_export_default_is_here_2752", "The first export default is here."), @@ -4850,6 +4855,7 @@ var ts; The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access: diag(2781, ts.DiagnosticCategory.Error, "The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781", "The left-hand side of a 'for...of' statement may not be an optional property access."), _0_needs_an_explicit_type_annotation: diag(2782, ts.DiagnosticCategory.Message, "_0_needs_an_explicit_type_annotation_2782", "'{0}' needs an explicit type annotation."), _0_is_specified_more_than_once_so_this_usage_will_be_overwritten: diag(2783, ts.DiagnosticCategory.Error, "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783", "'{0}' is specified more than once, so this usage will be overwritten."), + get_and_set_accessors_cannot_declare_this_parameters: diag(2784, ts.DiagnosticCategory.Error, "get_and_set_accessors_cannot_declare_this_parameters_2784", "'get' and 'set' accessors cannot declare 'this' parameters."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -4984,6 +4990,7 @@ var ts; Unknown_watch_option_0_Did_you_mean_1: diag(5079, ts.DiagnosticCategory.Error, "Unknown_watch_option_0_Did_you_mean_1_5079", "Unknown watch option '{0}'. Did you mean '{1}'?"), Watch_option_0_requires_a_value_of_type_1: diag(5080, ts.DiagnosticCategory.Error, "Watch_option_0_requires_a_value_of_type_1_5080", "Watch option '{0}' requires a value of type {1}."), Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0: diag(5081, ts.DiagnosticCategory.Error, "Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081", "Cannot find a tsconfig.json file at the current directory: {0}."), + _0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1: diag(5082, ts.DiagnosticCategory.Error, "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082", "'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6000, ts.DiagnosticCategory.Message, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, ts.DiagnosticCategory.Message, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, ts.DiagnosticCategory.Message, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -5396,6 +5403,7 @@ var ts; Import_default_0_from_module_1: diag(90032, ts.DiagnosticCategory.Message, "Import_default_0_from_module_1_90032", "Import default '{0}' from module \"{1}\""), Add_default_import_0_to_existing_import_declaration_from_1: diag(90033, ts.DiagnosticCategory.Message, "Add_default_import_0_to_existing_import_declaration_from_1_90033", "Add default import '{0}' to existing import declaration from \"{1}\""), Add_parameter_name: diag(90034, ts.DiagnosticCategory.Message, "Add_parameter_name_90034", "Add parameter name"), + Declare_private_property_0: diag(90035, ts.DiagnosticCategory.Message, "Declare_private_property_0_90035", "Declare private property '{0}'"), Declare_a_private_field_named_0: diag(90053, ts.DiagnosticCategory.Message, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), @@ -5461,6 +5469,8 @@ var ts; Add_all_missing_imports: diag(95064, ts.DiagnosticCategory.Message, "Add_all_missing_imports_95064", "Add all missing imports"), Convert_to_async_function: diag(95065, ts.DiagnosticCategory.Message, "Convert_to_async_function_95065", "Convert to async function"), Convert_all_to_async_functions: diag(95066, ts.DiagnosticCategory.Message, "Convert_all_to_async_functions_95066", "Convert all to async functions"), + Add_missing_call_parentheses: diag(95067, ts.DiagnosticCategory.Message, "Add_missing_call_parentheses_95067", "Add missing call parentheses"), + Add_all_missing_call_parentheses: diag(95068, ts.DiagnosticCategory.Message, "Add_all_missing_call_parentheses_95068", "Add all missing call parentheses"), Add_unknown_conversion_for_non_overlapping_types: diag(95069, ts.DiagnosticCategory.Message, "Add_unknown_conversion_for_non_overlapping_types_95069", "Add 'unknown' conversion for non-overlapping types"), Add_unknown_to_all_conversions_of_non_overlapping_types: diag(95070, ts.DiagnosticCategory.Message, "Add_unknown_to_all_conversions_of_non_overlapping_types_95070", "Add 'unknown' to all conversions of non-overlapping types"), Add_missing_new_operator_to_call: diag(95071, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_call_95071", "Add missing 'new' operator to call"), @@ -5534,8 +5544,8 @@ var ts; any: 125, as: 123, asserts: 124, - bigint: 151, - boolean: 128, + bigint: 152, + boolean: 129, break: 77, case: 78, catch: 79, @@ -5543,9 +5553,9 @@ var ts; continue: 82, const: 81 }, - _a["" + "constructor"] = 129, + _a["" + "constructor"] = 130, _a.debugger = 83, - _a.declare = 130, + _a.declare = 131, _a.default = 84, _a.delete = 85, _a.do = 86, @@ -5556,49 +5566,49 @@ var ts; _a.false = 91, _a.finally = 92, _a.for = 93, - _a.from = 149, + _a.from = 150, _a.function = 94, - _a.get = 131, + _a.get = 132, _a.if = 95, _a.implements = 113, _a.import = 96, _a.in = 97, - _a.infer = 132, + _a.infer = 133, _a.instanceof = 98, _a.interface = 114, - _a.is = 133, - _a.keyof = 134, + _a.is = 134, + _a.keyof = 135, _a.let = 115, - _a.module = 135, - _a.namespace = 136, - _a.never = 137, + _a.module = 136, + _a.namespace = 137, + _a.never = 138, _a.new = 99, _a.null = 100, - _a.number = 140, - _a.object = 141, + _a.number = 141, + _a.object = 142, _a.package = 116, _a.private = 117, _a.protected = 118, _a.public = 119, - _a.readonly = 138, - _a.require = 139, - _a.global = 150, + _a.readonly = 139, + _a.require = 140, + _a.global = 151, _a.return = 101, - _a.set = 142, + _a.set = 143, _a.static = 120, - _a.string = 143, + _a.string = 144, _a.super = 102, _a.switch = 103, - _a.symbol = 144, + _a.symbol = 145, _a.this = 104, _a.throw = 105, _a.true = 106, _a.try = 107, - _a.type = 145, + _a.type = 146, _a.typeof = 108, - _a.undefined = 146, - _a.unique = 147, - _a.unknown = 148, + _a.undefined = 147, + _a.unique = 148, + _a.unknown = 149, _a.var = 109, _a.void = 110, _a.while = 111, @@ -5606,7 +5616,8 @@ var ts; _a.yield = 121, _a.async = 126, _a.await = 127, - _a.of = 152, + _a.awaited = 128, + _a.of = 153, _a); var textToKeyword = ts.createMapFromTemplate(textToKeywordObj); var textToToken = ts.createMapFromTemplate(__assign(__assign({}, textToKeywordObj), { "{": 18, "}": 19, "(": 20, ")": 21, "[": 22, "]": 23, ".": 24, "...": 25, ";": 26, ",": 27, "<": 29, ">": 31, "<=": 32, ">=": 33, "==": 34, "!=": 35, "===": 36, "!==": 37, "=>": 38, "+": 39, "-": 40, "**": 42, "*": 41, "/": 43, "%": 44, "++": 45, "--": 46, "<<": 47, ">": 48, ">>>": 49, "&": 50, "|": 51, "^": 52, "!": 53, "~": 54, "&&": 55, "||": 56, "?": 57, "??": 60, "?.": 28, ":": 58, "=": 62, "+=": 63, "-=": 64, "*=": 65, "**=": 66, "/=": 67, "%=": 68, "<<=": 69, ">>=": 70, ">>>=": 71, "&=": 72, "|=": 73, "^=": 74, "@": 59, "`": 61 })); @@ -5616,6 +5627,7 @@ var ts; var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; var unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 895, 895, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1488, 1514, 1519, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2144, 2154, 2208, 2228, 2230, 2237, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2432, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2556, 2556, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2809, 2809, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3133, 3160, 3162, 3168, 3169, 3200, 3200, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3412, 3414, 3423, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6264, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6430, 6480, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7401, 7404, 7406, 7411, 7413, 7414, 7418, 7418, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12443, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42653, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43261, 43262, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43488, 43492, 43494, 43503, 43514, 43518, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43646, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66335, 66349, 66378, 66384, 66421, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68096, 68112, 68115, 68117, 68119, 68121, 68149, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68324, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68899, 69376, 69404, 69415, 69415, 69424, 69445, 69600, 69622, 69635, 69687, 69763, 69807, 69840, 69864, 69891, 69926, 69956, 69956, 69968, 70002, 70006, 70006, 70019, 70066, 70081, 70084, 70106, 70106, 70108, 70108, 70144, 70161, 70163, 70187, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70366, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70461, 70461, 70480, 70480, 70493, 70497, 70656, 70708, 70727, 70730, 70751, 70751, 70784, 70831, 70852, 70853, 70855, 70855, 71040, 71086, 71128, 71131, 71168, 71215, 71236, 71236, 71296, 71338, 71352, 71352, 71424, 71450, 71680, 71723, 71840, 71903, 71935, 71935, 72096, 72103, 72106, 72144, 72161, 72161, 72163, 72163, 72192, 72192, 72203, 72242, 72250, 72250, 72272, 72272, 72284, 72329, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72750, 72768, 72768, 72818, 72847, 72960, 72966, 72968, 72969, 72971, 73008, 73030, 73030, 73056, 73061, 73063, 73064, 73066, 73097, 73112, 73112, 73440, 73458, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92880, 92909, 92928, 92975, 92992, 92995, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94032, 94032, 94099, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 123136, 123180, 123191, 123197, 123214, 123214, 123584, 123627, 124928, 125124, 125184, 125251, 125259, 125259, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101]; var unicodeESNextIdentifierPart = [48, 57, 65, 90, 95, 95, 97, 122, 170, 170, 181, 181, 183, 183, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 895, 895, 902, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1519, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2045, 2045, 2048, 2093, 2112, 2139, 2144, 2154, 2208, 2228, 2230, 2237, 2259, 2273, 2275, 2403, 2406, 2415, 2417, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2556, 2556, 2558, 2558, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2809, 2815, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3072, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3168, 3171, 3174, 3183, 3200, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3328, 3331, 3333, 3340, 3342, 3344, 3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3558, 3567, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4969, 4977, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6264, 6272, 6314, 6320, 6389, 6400, 6430, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6832, 6845, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418, 7424, 7673, 7675, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42737, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43047, 43072, 43123, 43136, 43205, 43216, 43225, 43232, 43255, 43259, 43259, 43261, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43488, 43518, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65071, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66045, 66045, 66176, 66204, 66208, 66256, 66272, 66272, 66304, 66335, 66349, 66378, 66384, 66426, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68099, 68101, 68102, 68108, 68115, 68117, 68119, 68121, 68149, 68152, 68154, 68159, 68159, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68326, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68903, 68912, 68921, 69376, 69404, 69415, 69415, 69424, 69456, 69600, 69622, 69632, 69702, 69734, 69743, 69759, 69818, 69840, 69864, 69872, 69881, 69888, 69940, 69942, 69951, 69956, 69958, 69968, 70003, 70006, 70006, 70016, 70084, 70089, 70092, 70096, 70106, 70108, 70108, 70144, 70161, 70163, 70199, 70206, 70206, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70378, 70384, 70393, 70400, 70403, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70459, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70730, 70736, 70745, 70750, 70751, 70784, 70853, 70855, 70855, 70864, 70873, 71040, 71093, 71096, 71104, 71128, 71133, 71168, 71232, 71236, 71236, 71248, 71257, 71296, 71352, 71360, 71369, 71424, 71450, 71453, 71467, 71472, 71481, 71680, 71738, 71840, 71913, 71935, 71935, 72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263, 72263, 72272, 72345, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72758, 72760, 72768, 72784, 72793, 72818, 72847, 72850, 72871, 72873, 72886, 72960, 72966, 72968, 72969, 72971, 73014, 73018, 73018, 73020, 73021, 73023, 73031, 73040, 73049, 73056, 73061, 73063, 73064, 73066, 73102, 73104, 73105, 73107, 73112, 73120, 73129, 73440, 73462, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 92880, 92909, 92912, 92916, 92928, 92982, 92992, 92995, 93008, 93017, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94031, 94087, 94095, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113821, 113822, 119141, 119145, 119149, 119154, 119163, 119170, 119173, 119179, 119210, 119213, 119362, 119364, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 120782, 120831, 121344, 121398, 121403, 121452, 121461, 121461, 121476, 121476, 121499, 121503, 121505, 121519, 122880, 122886, 122888, 122904, 122907, 122913, 122915, 122916, 122918, 122922, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123214, 123584, 123641, 124928, 125124, 125136, 125142, 125184, 125259, 125264, 125273, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 917760, 917999]; + var commentDirectiveRegEx = /^\s*\/\/\/?\s*@(ts-expect-error|ts-ignore)/; function lookupInUnicodeMap(code, map) { if (code < map[0]) { return false; @@ -6100,6 +6112,7 @@ var ts; var token; var tokenValue; var tokenFlags; + var commentDirectives; var inJSDocType = 0; setText(text, start, length); var scanner = { @@ -6115,6 +6128,7 @@ var ts; isIdentifier: function () { return token === 75 || token > 112; }, isReservedWord: function () { return token >= 77 && token <= 112; }, isUnterminated: function () { return (tokenFlags & 4) !== 0; }, + getCommentDirectives: function () { return commentDirectives; }, getTokenFlags: function () { return tokenFlags; }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, @@ -6130,6 +6144,7 @@ var ts; scanJsDocToken: scanJsDocToken, scan: scan, getText: getText, + clearCommentDirectives: clearCommentDirectives, setText: setText, setScriptTarget: setScriptTarget, setLanguageVariant: setLanguageVariant, @@ -6816,6 +6831,13 @@ var ts; } pos++; } + var type = getDirectiveFromComment(text.slice(tokenPos, pos)); + if (type !== undefined) { + commentDirectives = ts.append(commentDirectives, { + range: { pos: tokenPos, end: pos }, + type: type, + }); + } if (skipTrivia) { continue; } @@ -7158,6 +7180,19 @@ var ts; } return token; } + function getDirectiveFromComment(text) { + var match = commentDirectiveRegEx.exec(text); + if (!match) { + return undefined; + } + switch (match[1]) { + case "ts-expect-error": + return 0; + case "ts-ignore": + return 1; + } + return undefined; + } function reScanTemplateToken(isTaggedTemplate) { ts.Debug.assert(token === 19, "'reScanTemplateToken' should only be called on a '}'"); pos = tokenPos; @@ -7375,6 +7410,7 @@ var ts; var saveToken = token; var saveTokenValue = tokenValue; var saveTokenFlags = tokenFlags; + var saveErrorExpectations = commentDirectives; setText(text, start, length); var result = callback(); end = saveEnd; @@ -7384,6 +7420,7 @@ var ts; token = saveToken; tokenValue = saveTokenValue; tokenFlags = saveTokenFlags; + commentDirectives = saveErrorExpectations; return result; } function lookAhead(callback) { @@ -7395,6 +7432,9 @@ var ts; function getText() { return text; } + function clearCommentDirectives() { + commentDirectives = undefined; + } function setText(newText, start, length) { text = newText || ""; end = length === undefined ? text.length : start + length; @@ -7599,9 +7639,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 155) { + if (d && d.kind === 156) { for (var current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 246) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 247) { return current; } } @@ -7609,7 +7649,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node, parent) { - return ts.hasModifier(node, 92) && parent.kind === 162; + return ts.hasModifier(node, 92) && parent.kind === 163; } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -7639,14 +7679,14 @@ var ts; node = walkUpBindingElementsAndPatterns(node); } var flags = getFlags(node); - if (node.kind === 242) { + if (node.kind === 243) { node = node.parent; } - if (node && node.kind === 243) { + if (node && node.kind === 244) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 225) { + if (node && node.kind === 226) { flags |= getFlags(node); } return flags; @@ -7760,30 +7800,30 @@ var ts; return getDeclarationIdentifier(hostNode); } switch (hostNode.kind) { - case 225: + case 226: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 226: + case 227: var expr = hostNode.expression; - if (expr.kind === 209 && expr.operatorToken.kind === 62) { + if (expr.kind === 210 && expr.operatorToken.kind === 62) { expr = expr.left; } switch (expr.kind) { - case 194: - return expr.name; case 195: + return expr.name; + case 196: var arg = expr.argumentExpression; if (isIdentifier(arg)) { return arg; } } break; - case 200: { + case 201: { return getDeclarationIdentifier(hostNode.expression); } - case 238: { + case 239: { if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -7817,16 +7857,16 @@ var ts; switch (declaration.kind) { case 75: return declaration; - case 323: - case 317: { + case 324: + case 318: { var name = declaration.name; - if (name.kind === 153) { + if (name.kind === 154) { return name.right; } break; } - case 196: - case 209: { + case 197: + case 210: { var expr_1 = declaration; switch (ts.getAssignmentDeclarationKind(expr_1)) { case 1: @@ -7842,15 +7882,15 @@ var ts; return undefined; } } - case 322: + case 323: return getNameOfJSDocTypedef(declaration); - case 316: + case 317: return nameForNamelessJSDocTypedef(declaration); - case 259: { + case 260: { var expression = declaration.expression; return isIdentifier(expression) ? expression : undefined; } - case 195: + case 196: var expr = declaration; if (ts.isBindableStaticElementAccessExpression(expr)) { return expr.argumentExpression; @@ -8018,7 +8058,7 @@ var ts; return ts.emptyArray; } if (ts.isJSDocTypeAlias(node)) { - ts.Debug.assert(node.parent.kind === 303); + ts.Debug.assert(node.parent.kind === 304); return ts.flatMap(node.parent.tags, function (tag) { return isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; }); } if (node.typeParameters) { @@ -8084,11 +8124,11 @@ var ts; } ts.isIdentifier = isIdentifier; function isQualifiedName(node) { - return node.kind === 153; + return node.kind === 154; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 154; + return node.kind === 155; } ts.isComputedPropertyName = isComputedPropertyName; function isPrivateIdentifier(node) { @@ -8100,159 +8140,159 @@ var ts; } ts.isIdentifierOrPrivateIdentifier = isIdentifierOrPrivateIdentifier; function isTypeParameterDeclaration(node) { - return node.kind === 155; + return node.kind === 156; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 156; + return node.kind === 157; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 157; + return node.kind === 158; } ts.isDecorator = isDecorator; function isPropertySignature(node) { - return node.kind === 158; + return node.kind === 159; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 159; + return node.kind === 160; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 160; + return node.kind === 161; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 161; + return node.kind === 162; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 162; + return node.kind === 163; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 163; + return node.kind === 164; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 164; + return node.kind === 165; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 165; + return node.kind === 166; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 166; + return node.kind === 167; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 167; + return node.kind === 168; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; function isGetOrSetAccessorDeclaration(node) { - return node.kind === 164 || node.kind === 163; + return node.kind === 165 || node.kind === 164; } ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration; function isTypePredicateNode(node) { - return node.kind === 168; + return node.kind === 169; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 169; + return node.kind === 170; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 170; + return node.kind === 171; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 171; + return node.kind === 172; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 172; + return node.kind === 173; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 173; + return node.kind === 174; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 174; + return node.kind === 175; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 175; + return node.kind === 176; } ts.isTupleTypeNode = isTupleTypeNode; function isUnionTypeNode(node) { - return node.kind === 178; + return node.kind === 179; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 179; + return node.kind === 180; } ts.isIntersectionTypeNode = isIntersectionTypeNode; function isConditionalTypeNode(node) { - return node.kind === 180; + return node.kind === 181; } ts.isConditionalTypeNode = isConditionalTypeNode; function isInferTypeNode(node) { - return node.kind === 181; + return node.kind === 182; } ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 182; + return node.kind === 183; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 183; + return node.kind === 184; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 184; + return node.kind === 185; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 185; + return node.kind === 186; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 186; + return node.kind === 187; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 187; + return node.kind === 188; } ts.isLiteralTypeNode = isLiteralTypeNode; function isImportTypeNode(node) { - return node.kind === 188; + return node.kind === 189; } ts.isImportTypeNode = isImportTypeNode; function isObjectBindingPattern(node) { - return node.kind === 189; + return node.kind === 190; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 190; + return node.kind === 191; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 191; + return node.kind === 192; } ts.isBindingElement = isBindingElement; function isArrayLiteralExpression(node) { - return node.kind === 192; + return node.kind === 193; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 193; + return node.kind === 194; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 194; + return node.kind === 195; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isPropertyAccessChain(node) { @@ -8260,7 +8300,7 @@ var ts; } ts.isPropertyAccessChain = isPropertyAccessChain; function isElementAccessExpression(node) { - return node.kind === 195; + return node.kind === 196; } ts.isElementAccessExpression = isElementAccessExpression; function isElementAccessChain(node) { @@ -8268,7 +8308,7 @@ var ts; } ts.isElementAccessChain = isElementAccessChain; function isCallExpression(node) { - return node.kind === 196; + return node.kind === 197; } ts.isCallExpression = isCallExpression; function isCallChain(node) { @@ -8278,9 +8318,9 @@ var ts; function isOptionalChain(node) { var kind = node.kind; return !!(node.flags & 32) && - (kind === 194 - || kind === 195 - || kind === 196); + (kind === 195 + || kind === 196 + || kind === 197); } ts.isOptionalChain = isOptionalChain; function isOptionalChainRoot(node) { @@ -8298,19 +8338,19 @@ var ts; } ts.isOutermostOptionalChain = isOutermostOptionalChain; function isNullishCoalesce(node) { - return node.kind === 209 && node.operatorToken.kind === 60; + return node.kind === 210 && node.operatorToken.kind === 60; } ts.isNullishCoalesce = isNullishCoalesce; function isNewExpression(node) { - return node.kind === 197; + return node.kind === 198; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 198; + return node.kind === 199; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertion(node) { - return node.kind === 199; + return node.kind === 200; } ts.isTypeAssertion = isTypeAssertion; function isConstTypeReference(node) { @@ -8319,376 +8359,376 @@ var ts; } ts.isConstTypeReference = isConstTypeReference; function isParenthesizedExpression(node) { - return node.kind === 200; + return node.kind === 201; } ts.isParenthesizedExpression = isParenthesizedExpression; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 326) { + while (node.kind === 327) { node = node.expression; } return node; } ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; function isFunctionExpression(node) { - return node.kind === 201; + return node.kind === 202; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 202; + return node.kind === 203; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 203; + return node.kind === 204; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 204; + return node.kind === 205; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 205; + return node.kind === 206; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 206; + return node.kind === 207; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 207; + return node.kind === 208; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 208; + return node.kind === 209; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 209; + return node.kind === 210; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 210; + return node.kind === 211; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 211; + return node.kind === 212; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 212; + return node.kind === 213; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 213; + return node.kind === 214; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 214; + return node.kind === 215; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 215; + return node.kind === 216; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 216; + return node.kind === 217; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 217; + return node.kind === 218; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 218; + return node.kind === 219; } ts.isNonNullExpression = isNonNullExpression; function isMetaProperty(node) { - return node.kind === 219; + return node.kind === 220; } ts.isMetaProperty = isMetaProperty; function isTemplateSpan(node) { - return node.kind === 221; + return node.kind === 222; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 222; + return node.kind === 223; } ts.isSemicolonClassElement = isSemicolonClassElement; function isBlock(node) { - return node.kind === 223; + return node.kind === 224; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 225; + return node.kind === 226; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 224; + return node.kind === 225; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 226; + return node.kind === 227; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 227; + return node.kind === 228; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 228; + return node.kind === 229; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 229; + return node.kind === 230; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 230; + return node.kind === 231; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 231; + return node.kind === 232; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 232; + return node.kind === 233; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 233; + return node.kind === 234; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 234; + return node.kind === 235; } ts.isBreakStatement = isBreakStatement; function isBreakOrContinueStatement(node) { - return node.kind === 234 || node.kind === 233; + return node.kind === 235 || node.kind === 234; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isReturnStatement(node) { - return node.kind === 235; + return node.kind === 236; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 236; + return node.kind === 237; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 237; + return node.kind === 238; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 238; + return node.kind === 239; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 239; + return node.kind === 240; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 240; + return node.kind === 241; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 241; + return node.kind === 242; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 242; + return node.kind === 243; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 243; + return node.kind === 244; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 244; + return node.kind === 245; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 245; + return node.kind === 246; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 246; + return node.kind === 247; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 247; + return node.kind === 248; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 248; + return node.kind === 249; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 249; + return node.kind === 250; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 250; + return node.kind === 251; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 251; + return node.kind === 252; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 252; + return node.kind === 253; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 253; + return node.kind === 254; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 254; + return node.kind === 255; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 255; + return node.kind === 256; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 256; + return node.kind === 257; } ts.isNamespaceImport = isNamespaceImport; function isNamespaceExport(node) { - return node.kind === 262; + return node.kind === 263; } ts.isNamespaceExport = isNamespaceExport; function isNamedExportBindings(node) { - return node.kind === 262 || node.kind === 261; + return node.kind === 263 || node.kind === 262; } ts.isNamedExportBindings = isNamedExportBindings; function isNamedImports(node) { - return node.kind === 257; + return node.kind === 258; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 258; + return node.kind === 259; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 259; + return node.kind === 260; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 260; + return node.kind === 261; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 261; + return node.kind === 262; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 263; + return node.kind === 264; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 264; + return node.kind === 265; } ts.isMissingDeclaration = isMissingDeclaration; function isExternalModuleReference(node) { - return node.kind === 265; + return node.kind === 266; } ts.isExternalModuleReference = isExternalModuleReference; function isJsxElement(node) { - return node.kind === 266; + return node.kind === 267; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 267; + return node.kind === 268; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 268; + return node.kind === 269; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 269; + return node.kind === 270; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 270; + return node.kind === 271; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 271; + return node.kind === 272; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 272; + return node.kind === 273; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 273; + return node.kind === 274; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 274; + return node.kind === 275; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 275; + return node.kind === 276; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 276; + return node.kind === 277; } ts.isJsxExpression = isJsxExpression; function isCaseClause(node) { - return node.kind === 277; + return node.kind === 278; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 278; + return node.kind === 279; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 279; + return node.kind === 280; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 280; + return node.kind === 281; } ts.isCatchClause = isCatchClause; function isPropertyAssignment(node) { - return node.kind === 281; + return node.kind === 282; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 282; + return node.kind === 283; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 283; + return node.kind === 284; } ts.isSpreadAssignment = isSpreadAssignment; function isEnumMember(node) { - return node.kind === 284; + return node.kind === 285; } ts.isEnumMember = isEnumMember; function isSourceFile(node) { - return node.kind === 290; + return node.kind === 291; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 291; + return node.kind === 292; } ts.isBundle = isBundle; function isUnparsedSource(node) { - return node.kind === 292; + return node.kind === 293; } ts.isUnparsedSource = isUnparsedSource; function isUnparsedPrepend(node) { - return node.kind === 286; + return node.kind === 287; } ts.isUnparsedPrepend = isUnparsedPrepend; function isUnparsedTextLike(node) { switch (node.kind) { - case 287: case 288: + case 289: return true; default: return false; @@ -8697,128 +8737,128 @@ var ts; ts.isUnparsedTextLike = isUnparsedTextLike; function isUnparsedNode(node) { return isUnparsedTextLike(node) || - node.kind === 285 || - node.kind === 289; + node.kind === 286 || + node.kind === 290; } ts.isUnparsedNode = isUnparsedNode; function isJSDocTypeExpression(node) { - return node.kind === 294; + return node.kind === 295; } ts.isJSDocTypeExpression = isJSDocTypeExpression; function isJSDocAllType(node) { - return node.kind === 295; + return node.kind === 296; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 296; + return node.kind === 297; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 297; + return node.kind === 298; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 298; + return node.kind === 299; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 299; + return node.kind === 300; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 300; + return node.kind === 301; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 301; + return node.kind === 302; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDoc(node) { - return node.kind === 303; + return node.kind === 304; } ts.isJSDoc = isJSDoc; function isJSDocAuthorTag(node) { - return node.kind === 309; + return node.kind === 310; } ts.isJSDocAuthorTag = isJSDocAuthorTag; function isJSDocAugmentsTag(node) { - return node.kind === 307; + return node.kind === 308; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocImplementsTag(node) { - return node.kind === 308; + return node.kind === 309; } ts.isJSDocImplementsTag = isJSDocImplementsTag; function isJSDocClassTag(node) { - return node.kind === 310; + return node.kind === 311; } ts.isJSDocClassTag = isJSDocClassTag; function isJSDocPublicTag(node) { - return node.kind === 311; + return node.kind === 312; } ts.isJSDocPublicTag = isJSDocPublicTag; function isJSDocPrivateTag(node) { - return node.kind === 312; + return node.kind === 313; } ts.isJSDocPrivateTag = isJSDocPrivateTag; function isJSDocProtectedTag(node) { - return node.kind === 313; + return node.kind === 314; } ts.isJSDocProtectedTag = isJSDocProtectedTag; function isJSDocReadonlyTag(node) { - return node.kind === 314; + return node.kind === 315; } ts.isJSDocReadonlyTag = isJSDocReadonlyTag; function isJSDocEnumTag(node) { - return node.kind === 316; + return node.kind === 317; } ts.isJSDocEnumTag = isJSDocEnumTag; function isJSDocThisTag(node) { - return node.kind === 319; + return node.kind === 320; } ts.isJSDocThisTag = isJSDocThisTag; function isJSDocParameterTag(node) { - return node.kind === 317; + return node.kind === 318; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 318; + return node.kind === 319; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocTypeTag(node) { - return node.kind === 320; + return node.kind === 321; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 321; + return node.kind === 322; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 322; + return node.kind === 323; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocPropertyTag(node) { - return node.kind === 323; + return node.kind === 324; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocPropertyLikeTag(node) { - return node.kind === 323 || node.kind === 317; + return node.kind === 324 || node.kind === 318; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isJSDocTypeLiteral(node) { - return node.kind === 304; + return node.kind === 305; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; function isJSDocCallbackTag(node) { - return node.kind === 315; + return node.kind === 316; } ts.isJSDocCallbackTag = isJSDocCallbackTag; function isJSDocSignature(node) { - return node.kind === 305; + return node.kind === 306; } ts.isJSDocSignature = isJSDocSignature; function isSyntaxList(n) { - return n.kind === 324; + return n.kind === 325; } ts.isSyntaxList = isSyntaxList; function isNode(node) { @@ -8826,11 +8866,11 @@ var ts; } ts.isNode = isNode; function isNodeKind(kind) { - return kind >= 153; + return kind >= 154; } ts.isNodeKind = isNodeKind; function isToken(n) { - return n.kind >= 0 && n.kind <= 152; + return n.kind >= 0 && n.kind <= 153; } ts.isToken = isToken; function isNodeArray(array) { @@ -8865,12 +8905,12 @@ var ts; ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isTypeOnlyImportOrExportDeclaration(node) { switch (node.kind) { - case 258: - case 263: + case 259: + case 264: return node.parent.parent.isTypeOnly; - case 256: + case 257: return node.parent.isTypeOnly; - case 255: + case 256: return node.isTypeOnly; default: return false; @@ -8898,13 +8938,13 @@ var ts; case 122: case 126: case 81: - case 130: + case 131: case 84: case 89: case 119: case 117: case 118: - case 138: + case 139: case 120: return true; } @@ -8925,23 +8965,24 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 153 + return kind === 154 || kind === 75; } ts.isEntityName = isEntityName; function isPropertyName(node) { var kind = node.kind; return kind === 75 + || kind === 76 || kind === 10 || kind === 8 - || kind === 154; + || kind === 155; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 75 - || kind === 189 - || kind === 190; + || kind === 190 + || kind === 191; } ts.isBindingName = isBindingName; function isFunctionLike(node) { @@ -8954,13 +8995,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 244: - case 161: + case 245: case 162: case 163: case 164: - case 201: + case 165: case 202: + case 203: return true; default: return false; @@ -8968,14 +9009,14 @@ var ts; } function isFunctionLikeKind(kind) { switch (kind) { - case 160: - case 165: - case 305: + case 161: case 166: + case 306: case 167: - case 170: - case 300: + case 168: case 171: + case 301: + case 172: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -8988,28 +9029,28 @@ var ts; ts.isFunctionOrModuleBlock = isFunctionOrModuleBlock; function isClassElement(node) { var kind = node.kind; - return kind === 162 - || kind === 159 - || kind === 161 - || kind === 163 + return kind === 163 + || kind === 160 + || kind === 162 || kind === 164 - || kind === 167 - || kind === 222; + || kind === 165 + || kind === 168 + || kind === 223; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 245 || node.kind === 214); + return node && (node.kind === 246 || node.kind === 215); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 163 || node.kind === 164); + return node && (node.kind === 164 || node.kind === 165); } ts.isAccessor = isAccessor; function isMethodOrAccessor(node) { switch (node.kind) { - case 161: - case 163: + case 162: case 164: + case 165: return true; default: return false; @@ -9018,11 +9059,11 @@ var ts; ts.isMethodOrAccessor = isMethodOrAccessor; function isTypeElement(node) { var kind = node.kind; - return kind === 166 - || kind === 165 - || kind === 158 - || kind === 160 - || kind === 167; + return kind === 167 + || kind === 166 + || kind === 159 + || kind === 161 + || kind === 168; } ts.isTypeElement = isTypeElement; function isClassOrTypeElement(node) { @@ -9031,12 +9072,12 @@ var ts; ts.isClassOrTypeElement = isClassOrTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 281 - || kind === 282 + return kind === 282 || kind === 283 - || kind === 161 - || kind === 163 - || kind === 164; + || kind === 284 + || kind === 162 + || kind === 164 + || kind === 165; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; function isTypeNode(node) { @@ -9045,8 +9086,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 170: case 171: + case 172: return true; } return false; @@ -9055,29 +9096,29 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 190 - || kind === 189; + return kind === 191 + || kind === 190; } return false; } ts.isBindingPattern = isBindingPattern; function isAssignmentPattern(node) { var kind = node.kind; - return kind === 192 - || kind === 193; + return kind === 193 + || kind === 194; } ts.isAssignmentPattern = isAssignmentPattern; function isArrayBindingElement(node) { var kind = node.kind; - return kind === 191 - || kind === 215; + return kind === 192 + || kind === 216; } ts.isArrayBindingElement = isArrayBindingElement; function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 242: - case 156: - case 191: + case 243: + case 157: + case 192: return true; } return false; @@ -9090,8 +9131,8 @@ var ts; ts.isBindingOrAssignmentPattern = isBindingOrAssignmentPattern; function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 189: - case 193: + case 190: + case 194: return true; } return false; @@ -9099,8 +9140,8 @@ var ts; ts.isObjectBindingOrAssignmentPattern = isObjectBindingOrAssignmentPattern; function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 190: - case 192: + case 191: + case 193: return true; } return false; @@ -9108,25 +9149,25 @@ var ts; ts.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern; function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { var kind = node.kind; - return kind === 194 - || kind === 153 - || kind === 188; + return kind === 195 + || kind === 154 + || kind === 189; } ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode; function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 194 - || kind === 153; + return kind === 195 + || kind === 154; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { + case 269: case 268: - case 267: - case 196: case 197: case 198: - case 157: + case 199: + case 158: return true; default: return false; @@ -9134,12 +9175,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 196 || node.kind === 197; + return node.kind === 197 || node.kind === 198; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 211 + return kind === 212 || kind === 14; } ts.isTemplateLiteral = isTemplateLiteral; @@ -9149,33 +9190,33 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 194: case 195: - case 197: case 196: - case 266: - case 267: - case 270: case 198: - case 192: - case 200: + case 197: + case 267: + case 268: + case 271: + case 199: case 193: - case 214: case 201: + case 194: + case 215: + case 202: case 75: case 13: case 8: case 9: case 10: case 14: - case 211: + case 212: case 91: case 100: case 104: case 106: case 102: - case 218: case 219: + case 220: case 96: return true; default: @@ -9188,13 +9229,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 207: case 208: - case 203: + case 209: case 204: case 205: case 206: - case 199: + case 207: + case 200: return true; default: return isLeftHandSideExpressionKind(kind); @@ -9202,9 +9243,9 @@ var ts; } function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 208: + case 209: return true; - case 207: + case 208: return expr.operator === 45 || expr.operator === 46; default: @@ -9218,15 +9259,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 210: - case 212: - case 202: - case 209: + case 211: case 213: - case 217: - case 215: + case 203: + case 210: + case 214: + case 218: + case 216: + case 328: case 327: - case 326: return true; default: return isUnaryExpressionKind(kind); @@ -9234,20 +9275,20 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 199 - || kind === 217; + return kind === 200 + || kind === 218; } ts.isAssertionExpression = isAssertionExpression; function isPartiallyEmittedExpression(node) { - return node.kind === 326; + return node.kind === 327; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; function isNotEmittedStatement(node) { - return node.kind === 325; + return node.kind === 326; } ts.isNotEmittedStatement = isNotEmittedStatement; function isSyntheticReference(node) { - return node.kind === 330; + return node.kind === 331; } ts.isSyntheticReference = isSyntheticReference; function isNotEmittedOrPartiallyEmittedNode(node) { @@ -9257,13 +9298,13 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 230: case 231: case 232: - case 228: + case 233: case 229: + case 230: return true; - case 238: + case 239: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -9286,7 +9327,7 @@ var ts; } ts.isExternalModuleIndicator = isExternalModuleIndicator; function isForInOrOfStatement(node) { - return node.kind === 231 || node.kind === 232; + return node.kind === 232 || node.kind === 233; } ts.isForInOrOfStatement = isForInOrOfStatement; function isConciseBody(node) { @@ -9305,109 +9346,109 @@ var ts; ts.isForInitializer = isForInitializer; function isModuleBody(node) { var kind = node.kind; - return kind === 250 - || kind === 249 + return kind === 251 + || kind === 250 || kind === 75; } ts.isModuleBody = isModuleBody; function isNamespaceBody(node) { var kind = node.kind; - return kind === 250 - || kind === 249; + return kind === 251 + || kind === 250; } ts.isNamespaceBody = isNamespaceBody; function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 75 - || kind === 249; + || kind === 250; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; function isNamedImportBindings(node) { var kind = node.kind; - return kind === 257 - || kind === 256; + return kind === 258 + || kind === 257; } ts.isNamedImportBindings = isNamedImportBindings; function isModuleOrEnumDeclaration(node) { - return node.kind === 249 || node.kind === 248; + return node.kind === 250 || node.kind === 249; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 202 - || kind === 191 + return kind === 203 + || kind === 192 + || kind === 246 + || kind === 215 + || kind === 163 + || kind === 249 + || kind === 285 + || kind === 264 || kind === 245 - || kind === 214 + || kind === 202 + || kind === 164 + || kind === 256 + || kind === 254 + || kind === 259 + || kind === 247 + || kind === 274 || kind === 162 - || kind === 248 - || kind === 284 - || kind === 263 - || kind === 244 - || kind === 201 - || kind === 163 - || kind === 255 - || kind === 253 - || kind === 258 - || kind === 246 - || kind === 273 || kind === 161 + || kind === 250 + || kind === 253 + || kind === 257 + || kind === 263 + || kind === 157 + || kind === 282 || kind === 160 - || kind === 249 - || kind === 252 - || kind === 256 - || kind === 262 - || kind === 156 - || kind === 281 || kind === 159 - || kind === 158 - || kind === 164 - || kind === 282 - || kind === 247 - || kind === 155 - || kind === 242 - || kind === 322 - || kind === 315 - || kind === 323; + || kind === 165 + || kind === 283 + || kind === 248 + || kind === 156 + || kind === 243 + || kind === 323 + || kind === 316 + || kind === 324; } function isDeclarationStatementKind(kind) { - return kind === 244 - || kind === 264 - || kind === 245 + return kind === 245 + || kind === 265 || kind === 246 || kind === 247 || kind === 248 || kind === 249 + || kind === 250 + || kind === 255 || kind === 254 - || kind === 253 + || kind === 261 || kind === 260 - || kind === 259 - || kind === 252; + || kind === 253; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 234 + return kind === 235 + || kind === 234 + || kind === 242 + || kind === 229 + || kind === 227 + || kind === 225 + || kind === 232 || kind === 233 - || kind === 241 + || kind === 231 || kind === 228 + || kind === 239 + || kind === 236 + || kind === 238 + || kind === 240 + || kind === 241 || kind === 226 - || kind === 224 - || kind === 231 - || kind === 232 || kind === 230 - || kind === 227 - || kind === 238 - || kind === 235 || kind === 237 - || kind === 239 - || kind === 240 - || kind === 225 - || kind === 229 - || kind === 236 - || kind === 325 - || kind === 329 - || kind === 328; + || kind === 326 + || kind === 330 + || kind === 329; } function isDeclaration(node) { - if (node.kind === 155) { - return (node.parent && node.parent.kind !== 321) || ts.isInJSFile(node); + if (node.kind === 156) { + return (node.parent && node.parent.kind !== 322) || ts.isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -9428,10 +9469,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 223) + if (node.kind !== 224) return false; if (node.parent !== undefined) { - if (node.parent.kind === 240 || node.parent.kind === 280) { + if (node.parent.kind === 241 || node.parent.kind === 281) { return false; } } @@ -9439,8 +9480,8 @@ var ts; } function isModuleReference(node) { var kind = node.kind; - return kind === 265 - || kind === 153 + return kind === 266 + || kind === 154 || kind === 75; } ts.isModuleReference = isModuleReference; @@ -9448,60 +9489,60 @@ var ts; var kind = node.kind; return kind === 104 || kind === 75 - || kind === 194; + || kind === 195; } ts.isJsxTagNameExpression = isJsxTagNameExpression; function isJsxChild(node) { var kind = node.kind; - return kind === 266 - || kind === 276 - || kind === 267 + return kind === 267 + || kind === 277 + || kind === 268 || kind === 11 - || kind === 270; + || kind === 271; } ts.isJsxChild = isJsxChild; function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 273 - || kind === 275; + return kind === 274 + || kind === 276; } ts.isJsxAttributeLike = isJsxAttributeLike; function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 10 - || kind === 276; + || kind === 277; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 268 - || kind === 267; + return kind === 269 + || kind === 268; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 277 - || kind === 278; + return kind === 278 + || kind === 279; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; function isJSDocNode(node) { - return node.kind >= 294 && node.kind <= 323; + return node.kind >= 295 && node.kind <= 324; } ts.isJSDocNode = isJSDocNode; function isJSDocCommentContainingNode(node) { - return node.kind === 303 || node.kind === 302 || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); + return node.kind === 304 || node.kind === 303 || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; function isJSDocTag(node) { - return node.kind >= 306 && node.kind <= 323; + return node.kind >= 307 && node.kind <= 324; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 164; + return node.kind === 165; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 163; + return node.kind === 164; } ts.isGetAccessor = isGetAccessor; function hasJSDocNodes(node) { @@ -9519,13 +9560,13 @@ var ts; ts.hasInitializer = hasInitializer; function hasOnlyExpressionInitializer(node) { switch (node.kind) { - case 242: - case 156: - case 191: - case 158: + case 243: + case 157: + case 192: case 159: - case 281: - case 284: + case 160: + case 282: + case 285: return true; default: return false; @@ -9533,11 +9574,11 @@ var ts; } ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; function isObjectLiteralElement(node) { - return node.kind === 273 || node.kind === 275 || isObjectLiteralElementLike(node); + return node.kind === 274 || node.kind === 276 || isObjectLiteralElementLike(node); } ts.isObjectLiteralElement = isObjectLiteralElement; function isTypeReferenceType(node) { - return node.kind === 169 || node.kind === 216; + return node.kind === 170 || node.kind === 217; } ts.isTypeReferenceType = isTypeReferenceType; var MAX_SMI_X86 = 1073741823; @@ -9817,7 +9858,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 290) { + while (node && node.kind !== 291) { node = node.parent; } return node; @@ -9825,11 +9866,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 223: - case 251: - case 230: + case 224: + case 252: case 231: case 232: + case 233: return true; } return false; @@ -9942,6 +9983,33 @@ var ts; text.charCodeAt(start + 2) === 33; } ts.isPinnedComment = isPinnedComment; + function createCommentDirectivesMap(sourceFile, commentDirectives) { + var directivesByLine = ts.createMapFromEntries(commentDirectives.map(function (commentDirective) { return ([ + "" + ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.pos).line, + commentDirective, + ]); })); + var usedLines = ts.createMap(); + return { getUnusedExpectations: getUnusedExpectations, markUsed: markUsed }; + function getUnusedExpectations() { + return ts.arrayFrom(directivesByLine.entries()) + .filter(function (_a) { + var line = _a[0], directive = _a[1]; + return directive.type === 0 && !usedLines.get(line); + }) + .map(function (_a) { + var _ = _a[0], directive = _a[1]; + return directive; + }); + } + function markUsed(line) { + if (!directivesByLine.has("" + line)) { + return false; + } + usedLines.set("" + line, true); + return true; + } + } + ts.createCommentDirectivesMap = createCommentDirectivesMap; function getTokenPosOfNode(node, sourceFile, includeJsDoc) { if (nodeIsMissing(node)) { return node.pos; @@ -9952,7 +10020,7 @@ var ts; if (includeJsDoc && ts.hasJSDocNodes(node)) { return getTokenPosOfNode(node.jsDoc[0]); } - if (node.kind === 324 && node._children.length > 0) { + if (node.kind === 325 && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -10061,7 +10129,7 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 242 && node.parent.kind === 280; + return node.kind === 243 && node.parent.kind === 281; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { @@ -10085,11 +10153,11 @@ var ts; } ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { - return node && node.kind === 249 && (!node.body); + return node && node.kind === 250 && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 290 || - node.kind === 249 || + return node.kind === 291 || + node.kind === 250 || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -10103,9 +10171,9 @@ var ts; ts.isExternalModuleAugmentation = isExternalModuleAugmentation; function isModuleAugmentationExternal(node) { switch (node.parent.kind) { - case 290: + case 291: return ts.isExternalModule(node.parent); - case 250: + case 251: return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -10149,22 +10217,22 @@ var ts; ts.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile; function isBlockScope(node, parentNode) { switch (node.kind) { - case 290: - case 251: - case 280: - case 249: - case 230: + case 291: + case 252: + case 281: + case 250: case 231: case 232: - case 162: - case 161: + case 233: case 163: + case 162: case 164: - case 244: - case 201: + case 165: + case 245: case 202: + case 203: return true; - case 223: + case 224: return !ts.isFunctionLike(parentNode); } return false; @@ -10172,9 +10240,9 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 315: - case 322: - case 305: + case 316: + case 323: + case 306: return true; default: ts.assertType(node); @@ -10184,25 +10252,25 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isDeclarationWithTypeParameterChildren(node) { switch (node.kind) { - case 165: case 166: - case 160: case 167: - case 170: + case 161: + case 168: case 171: - case 300: - case 245: - case 214: + case 172: + case 301: case 246: + case 215: case 247: - case 321: - case 244: - case 161: + case 248: + case 322: + case 245: case 162: case 163: case 164: - case 201: + case 165: case 202: + case 203: return true; default: ts.assertType(node); @@ -10212,8 +10280,8 @@ var ts; ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren; function isAnyImportSyntax(node) { switch (node.kind) { + case 255: case 254: - case 253: return true; default: return false; @@ -10222,15 +10290,15 @@ var ts; ts.isAnyImportSyntax = isAnyImportSyntax; function isLateVisibilityPaintedStatement(node) { switch (node.kind) { + case 255: case 254: - case 253: - case 225: - case 245: - case 244: - case 249: - case 247: + case 226: case 246: + case 245: + case 250: case 248: + case 247: + case 249: return true; default: return false; @@ -10262,7 +10330,7 @@ var ts; case 8: case 14: return ts.escapeLeadingUnderscores(name.text); - case 154: + case 155: if (isStringOrNumericLiteralLike(name.expression)) return ts.escapeLeadingUnderscores(name.expression.text); return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames"); @@ -10278,9 +10346,9 @@ var ts; case 76: case 75: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 153: + case 154: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 194: + case 195: if (ts.isIdentifier(name.name) || ts.isPrivateIdentifier(name.name)) { return entityNameToString(name.expression) + "." + entityNameToString(name.name); } @@ -10321,6 +10389,17 @@ var ts; }; } ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; + function createDiagnosticForRange(sourceFile, range, message) { + return { + file: sourceFile, + start: range.pos, + length: range.end - range.pos, + code: message.code, + category: message.category, + messageText: message.message, + }; + } + ts.createDiagnosticForRange = createDiagnosticForRange; function getSpanOfTokenAtPosition(sourceFile, pos) { var scanner = ts.createScanner(sourceFile.languageVersion, true, sourceFile.languageVariant, sourceFile.text, undefined, pos); scanner.scan(); @@ -10330,7 +10409,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 223) { + if (node.body && node.body.kind === 224) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -10342,34 +10421,34 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 290: + case 291: var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); if (pos_1 === sourceFile.text.length) { return ts.createTextSpan(0, 0); } return getSpanOfTokenAtPosition(sourceFile, pos_1); - case 242: - case 191: - case 245: - case 214: + case 243: + case 192: case 246: + case 215: + case 247: + case 250: case 249: - case 248: - case 284: - case 244: - case 201: - case 161: - case 163: + case 285: + case 245: + case 202: + case 162: case 164: - case 247: + case 165: + case 248: + case 160: case 159: - case 158: errorNode = node.name; break; - case 202: + case 203: return getErrorSpanForArrowFunction(sourceFile, node); - case 277: case 278: + case 279: var start = ts.skipTrivia(sourceFile.text, node.pos); var end = node.statements.length > 0 ? node.statements[0].pos : node.end; return ts.createTextSpanFromBounds(start, end); @@ -10418,11 +10497,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 196 && n.expression.kind === 102; + return n.kind === 197 && n.expression.kind === 102; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 196 && n.expression.kind === 96; + return n.kind === 197 && n.expression.kind === 96; } ts.isImportCall = isImportCall; function isImportMeta(n) { @@ -10436,7 +10515,7 @@ var ts; } ts.isLiteralImportTypeNode = isLiteralImportTypeNode; function isPrologueDirective(node) { - return node.kind === 226 + return node.kind === 227 && node.expression.kind === 10; } ts.isPrologueDirective = isPrologueDirective; @@ -10445,11 +10524,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 156 || - node.kind === 155 || - node.kind === 201 || + var commentRanges = (node.kind === 157 || + node.kind === 156 || node.kind === 202 || - node.kind === 200) ? + node.kind === 203 || + node.kind === 201) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); return ts.filter(commentRanges, function (comment) { @@ -10464,79 +10543,79 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (168 <= node.kind && node.kind <= 188) { + if (169 <= node.kind && node.kind <= 189) { return true; } switch (node.kind) { case 125: - case 148: - case 140: - case 151: - case 143: - case 128: - case 144: + case 149: case 141: - case 146: - case 137: + case 152: + case 144: + case 129: + case 145: + case 142: + case 147: + case 138: return true; case 110: - return node.parent.kind !== 205; - case 216: + return node.parent.kind !== 206; + case 217: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); - case 155: - return node.parent.kind === 186 || node.parent.kind === 181; + case 156: + return node.parent.kind === 187 || node.parent.kind === 182; case 75: - if (node.parent.kind === 153 && node.parent.right === node) { + if (node.parent.kind === 154 && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 194 && node.parent.name === node) { + else if (node.parent.kind === 195 && node.parent.name === node) { node = node.parent; } - ts.Debug.assert(node.kind === 75 || node.kind === 153 || node.kind === 194, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); - case 153: - case 194: + ts.Debug.assert(node.kind === 75 || node.kind === 154 || node.kind === 195, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + case 154: + case 195: case 104: { var parent = node.parent; - if (parent.kind === 172) { + if (parent.kind === 173) { return false; } - if (parent.kind === 188) { + if (parent.kind === 189) { return !parent.isTypeOf; } - if (168 <= parent.kind && parent.kind <= 188) { + if (169 <= parent.kind && parent.kind <= 189) { return true; } switch (parent.kind) { - case 216: + case 217: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 155: + case 156: return node === parent.constraint; - case 321: + case 322: return node === parent.constraint; + case 160: case 159: - case 158: - case 156: - case 242: + case 157: + case 243: return node === parent.type; - case 244: - case 201: + case 245: case 202: + case 203: + case 163: case 162: case 161: - case 160: - case 163: case 164: - return node === parent.type; case 165: + return node === parent.type; case 166: case 167: + case 168: return node === parent.type; - case 199: + case 200: return node === parent.type; - case 196: case 197: - return ts.contains(parent.typeArguments, node); case 198: + return ts.contains(parent.typeArguments, node); + case 199: return false; } } @@ -10558,23 +10637,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 235: + case 236: return visitor(node); - case 251: - case 223: - case 227: + case 252: + case 224: case 228: case 229: case 230: case 231: case 232: - case 236: + case 233: case 237: - case 277: - case 278: case 238: - case 240: - case 280: + case 278: + case 279: + case 239: + case 241: + case 281: return ts.forEachChild(node, traverse); } } @@ -10584,21 +10663,21 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 212: + case 213: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 248: - case 246: case 249: case 247: + case 250: + case 248: return; default: if (ts.isFunctionLike(node)) { - if (node.name && node.name.kind === 154) { + if (node.name && node.name.kind === 155) { traverse(node.name.expression); return; } @@ -10611,10 +10690,10 @@ var ts; } ts.forEachYieldExpression = forEachYieldExpression; function getRestParameterElementType(node) { - if (node && node.kind === 174) { + if (node && node.kind === 175) { return node.elementType; } - else if (node && node.kind === 169) { + else if (node && node.kind === 170) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -10624,12 +10703,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { + case 247: case 246: - case 245: - case 214: - case 173: + case 215: + case 174: return node.members; - case 193: + case 194: return node.properties; } } @@ -10637,14 +10716,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 191: - case 284: - case 156: - case 281: - case 159: - case 158: + case 192: + case 285: + case 157: case 282: - case 242: + case 160: + case 159: + case 283: + case 243: return true; } } @@ -10656,8 +10735,8 @@ var ts; } ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 243 - && node.parent.parent.kind === 225; + return node.parent.kind === 244 + && node.parent.parent.kind === 226; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -10668,13 +10747,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 161: - case 160: case 162: + case 161: case 163: case 164: - case 244: - case 201: + case 165: + case 245: + case 202: return true; } return false; @@ -10685,7 +10764,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 238) { + if (node.statement.kind !== 239) { return node.statement; } node = node.statement; @@ -10693,17 +10772,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 223 && ts.isFunctionLike(node.parent); + return node && node.kind === 224 && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 161 && node.parent.kind === 193; + return node && node.kind === 162 && node.parent.kind === 194; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 161 && - (node.parent.kind === 193 || - node.parent.kind === 214); + return node.kind === 162 && + (node.parent.kind === 194 || + node.parent.kind === 215); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -10716,7 +10795,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return objectLiteral.properties.filter(function (property) { - if (property.kind === 281) { + if (property.kind === 282) { var propName = getTextOfPropertyName(property.name); return key === propName || (!!key2 && key2 === propName); } @@ -10757,46 +10836,46 @@ var ts; } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { - ts.Debug.assert(node.kind !== 290); + ts.Debug.assert(node.kind !== 291); while (true) { node = node.parent; if (!node) { return ts.Debug.fail(); } switch (node.kind) { - case 154: + case 155: if (ts.isClassLike(node.parent.parent)) { return node; } node = node.parent; break; - case 157: - if (node.parent.kind === 156 && ts.isClassElement(node.parent.parent)) { + case 158: + if (node.parent.kind === 157 && ts.isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (ts.isClassElement(node.parent)) { node = node.parent; } break; - case 202: + case 203: if (!includeArrowFunctions) { continue; } - case 244: - case 201: - case 249: - case 159: - case 158: - case 161: + case 245: + case 202: + case 250: case 160: + case 159: case 162: + case 161: case 163: case 164: case 165: case 166: case 167: - case 248: - case 290: + case 168: + case 249: + case 291: return node; } } @@ -10806,9 +10885,9 @@ var ts; var container = getThisContainer(node, false); if (container) { switch (container.kind) { - case 162: - case 244: - case 201: + case 163: + case 245: + case 202: return container; } } @@ -10822,25 +10901,25 @@ var ts; return node; } switch (node.kind) { - case 154: + case 155: node = node.parent; break; - case 244: - case 201: + case 245: case 202: + case 203: if (!stopOnFunctions) { continue; } - case 159: - case 158: - case 161: case 160: + case 159: case 162: + case 161: case 163: case 164: + case 165: return node; - case 157: - if (node.parent.kind === 156 && ts.isClassElement(node.parent.parent)) { + case 158: + if (node.parent.kind === 157 && ts.isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (ts.isClassElement(node.parent)) { @@ -10852,14 +10931,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 201 || func.kind === 202) { + if (func.kind === 202 || func.kind === 203) { var prev = func; var parent = func.parent; - while (parent.kind === 200) { + while (parent.kind === 201) { prev = parent; parent = parent.parent; } - if (parent.kind === 196 && parent.expression === prev) { + if (parent.kind === 197 && parent.expression === prev) { return parent; } } @@ -10872,26 +10951,26 @@ var ts; ts.isSuperOrSuperProperty = isSuperOrSuperProperty; function isSuperProperty(node) { var kind = node.kind; - return (kind === 194 || kind === 195) + return (kind === 195 || kind === 196) && node.expression.kind === 102; } ts.isSuperProperty = isSuperProperty; function isThisProperty(node) { var kind = node.kind; - return (kind === 194 || kind === 195) + return (kind === 195 || kind === 196) && node.expression.kind === 104; } ts.isThisProperty = isThisProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 169: + case 170: return node.typeName; - case 216: + case 217: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 75: - case 153: + case 154: return node; } return undefined; @@ -10899,10 +10978,10 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { switch (node.kind) { - case 198: + case 199: return node.tag; + case 269: case 268: - case 267: return node.tagName; default: return node.expression; @@ -10914,21 +10993,21 @@ var ts; return false; } switch (node.kind) { - case 245: + case 246: return true; - case 159: - return parent.kind === 245; - case 163: + case 160: + return parent.kind === 246; case 164: - case 161: + case 165: + case 162: return node.body !== undefined - && parent.kind === 245; - case 156: + && parent.kind === 246; + case 157: return parent.body !== undefined - && (parent.kind === 162 - || parent.kind === 161 - || parent.kind === 164) - && grandparent.kind === 245; + && (parent.kind === 163 + || parent.kind === 162 + || parent.kind === 165) + && grandparent.kind === 246; } return false; } @@ -10944,10 +11023,10 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 245: + case 246: return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); - case 161: - case 164: + case 162: + case 165: return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); default: return false; @@ -10956,9 +11035,9 @@ var ts; ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 268 || - parent.kind === 267 || - parent.kind === 269) { + if (parent.kind === 269 || + parent.kind === 268 || + parent.kind === 270) { return parent.tagName === node; } return false; @@ -10971,44 +11050,44 @@ var ts; case 106: case 91: case 13: - case 192: case 193: case 194: case 195: case 196: case 197: case 198: - case 217: case 199: case 218: case 200: + case 219: case 201: - case 214: case 202: - case 205: + case 215: case 203: + case 206: case 204: - case 207: + case 205: case 208: case 209: case 210: - case 213: case 211: - case 215: - case 266: - case 267: - case 270: + case 214: case 212: - case 206: - case 219: + case 216: + case 267: + case 268: + case 271: + case 213: + case 207: + case 220: return true; - case 153: - while (node.parent.kind === 153) { + case 154: + while (node.parent.kind === 154) { node = node.parent; } - return node.parent.kind === 172 || isJSXTagName(node); + return node.parent.kind === 173 || isJSXTagName(node); case 75: - if (node.parent.kind === 172 || isJSXTagName(node)) { + if (node.parent.kind === 173 || isJSXTagName(node)) { return true; } case 8: @@ -11025,49 +11104,49 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 242: - case 156: + case 243: + case 157: + case 160: case 159: - case 158: - case 284: - case 281: - case 191: + case 285: + case 282: + case 192: return parent.initializer === node; - case 226: case 227: case 228: case 229: - case 235: + case 230: case 236: case 237: - case 277: - case 239: + case 238: + case 278: + case 240: return parent.expression === node; - case 230: + case 231: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 243) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 244) || forStatement.condition === node || forStatement.incrementor === node; - case 231: case 232: + case 233: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 243) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 244) || forInStatement.expression === node; - case 199: - case 217: + case 200: + case 218: return node === parent.expression; - case 221: + case 222: return node === parent.expression; - case 154: + case 155: return node === parent.expression; - case 157: + case 158: + case 277: case 276: - case 275: - case 283: + case 284: return true; - case 216: + case 217: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 282: + case 283: return parent.objectAssignmentInitializer === node; default: return isExpressionNode(parent); @@ -11075,14 +11154,14 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isPartOfTypeQuery(node) { - while (node.kind === 153 || node.kind === 75) { + while (node.kind === 154 || node.kind === 75) { node = node.parent; } - return node.kind === 172; + return node.kind === 173; } ts.isPartOfTypeQuery = isPartOfTypeQuery; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 253 && node.moduleReference.kind === 265; + return node.kind === 254 && node.moduleReference.kind === 266; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -11091,7 +11170,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 253 && node.moduleReference.kind !== 265; + return node.kind === 254 && node.moduleReference.kind !== 266; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJS(file) { @@ -11123,11 +11202,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 143 || node.typeArguments[0].kind === 140); + (node.typeArguments[0].kind === 144 || node.typeArguments[0].kind === 141); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, requireStringLiteralLikeArgument) { - if (callExpression.kind !== 196) { + if (callExpression.kind !== 197) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -11243,11 +11322,11 @@ var ts; function getExpandoInitializer(initializer, isPrototypeAssignment) { if (ts.isCallExpression(initializer)) { var e = skipParentheses(initializer.expression); - return e.kind === 201 || e.kind === 202 ? initializer : undefined; + return e.kind === 202 || e.kind === 203 ? initializer : undefined; } - if (initializer.kind === 201 || - initializer.kind === 214 || - initializer.kind === 202) { + if (initializer.kind === 202 || + initializer.kind === 215 || + initializer.kind === 203) { return initializer; } if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -11439,7 +11518,7 @@ var ts; isBindableStaticAccessExpression(lhs)) { return 1; } - if (isBindableStaticNameExpression(lhs, true) || (ts.isElementAccessExpression(lhs) && isDynamicName(lhs) && lhs.expression.kind !== 104)) { + if (isBindableStaticNameExpression(lhs, true) || (ts.isElementAccessExpression(lhs) && isDynamicName(lhs))) { return 5; } } @@ -11459,7 +11538,7 @@ var ts; ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment; function isSpecialPropertyDeclaration(expr) { return isInJSFile(expr) && - expr.parent && expr.parent.kind === 226 && + expr.parent && expr.parent.kind === 227 && (!ts.isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!ts.getJSDocTypeTag(expr.parent); } @@ -11469,7 +11548,7 @@ var ts; return false; } var decl = symbol.valueDeclaration; - return decl.kind === 244 || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); + return decl.kind === 245 || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); } ts.isFunctionSymbol = isFunctionSymbol; function importFromModuleSpecifier(node) { @@ -11478,14 +11557,14 @@ var ts; ts.importFromModuleSpecifier = importFromModuleSpecifier; function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 254: - case 260: + case 255: + case 261: return node.parent; - case 265: + case 266: return node.parent.parent; - case 196: + case 197: return isImportCall(node.parent) || isRequireCall(node.parent, false) ? node.parent : undefined; - case 187: + case 188: ts.Debug.assert(ts.isStringLiteral(node)); return ts.tryCast(node.parent.parent, ts.isImportTypeNode); default: @@ -11495,12 +11574,12 @@ var ts; ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier; function getExternalModuleName(node) { switch (node.kind) { - case 254: - case 260: + case 255: + case 261: return node.moduleSpecifier; - case 253: - return node.moduleReference.kind === 265 ? node.moduleReference.expression : undefined; - case 188: + case 254: + return node.moduleReference.kind === 266 ? node.moduleReference.expression : undefined; + case 189: return isLiteralImportTypeNode(node) ? node.argument.literal : undefined; default: return ts.Debug.assertNever(node); @@ -11509,11 +11588,11 @@ var ts; ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 254: + case 255: return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); - case 253: + case 254: return node; - case 260: + case 261: return node.exportClause && ts.tryCast(node.exportClause, ts.isNamespaceExport); default: return ts.Debug.assertNever(node); @@ -11521,7 +11600,7 @@ var ts; } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 254 && !!node.importClause && !!node.importClause.name; + return node.kind === 255 && !!node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function forEachImportClauseDeclaration(node, action) { @@ -11542,13 +11621,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 156: + case 157: + case 162: case 161: - case 160: + case 283: case 282: - case 281: + case 160: case 159: - case 158: return node.questionToken !== undefined; } } @@ -11562,7 +11641,7 @@ var ts; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function isJSDocTypeAlias(node) { - return node.kind === 322 || node.kind === 315 || node.kind === 316; + return node.kind === 323 || node.kind === 316 || node.kind === 317; } ts.isJSDocTypeAlias = isJSDocTypeAlias; function isTypeAlias(node) { @@ -11587,12 +11666,12 @@ var ts; } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 225: + case 226: var v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 159: + case 160: return node.initializer; - case 281: + case 282: return node.initializer; } } @@ -11603,7 +11682,7 @@ var ts; function getNestedModuleDeclaration(node) { return ts.isModuleDeclaration(node) && node.body && - node.body.kind === 249 + node.body.kind === 250 ? node.body : undefined; } @@ -11617,11 +11696,11 @@ var ts; if (ts.hasJSDocNodes(node)) { result = ts.append(result, ts.last(node.jsDoc)); } - if (node.kind === 156) { + if (node.kind === 157) { result = ts.addRange(result, ts.getJSDocParameterTags(node)); break; } - if (node.kind === 155) { + if (node.kind === 156) { result = ts.addRange(result, ts.getJSDocTypeParameterTags(node)); break; } @@ -11632,10 +11711,10 @@ var ts; ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags; function getNextJSDocCommentLocation(node) { var parent = node.parent; - if (parent.kind === 281 || - parent.kind === 259 || - parent.kind === 159 || - parent.kind === 226 && node.kind === 194 || + if (parent.kind === 282 || + parent.kind === 260 || + parent.kind === 160 || + parent.kind === 227 && node.kind === 195 || getNestedModuleDeclaration(parent) || ts.isBinaryExpression(node) && node.operatorToken.kind === 62) { return parent; @@ -11701,7 +11780,7 @@ var ts; ts.hasRestParameter = hasRestParameter; function isRestParameter(node) { var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type; - return node.dotDotDotToken !== undefined || !!type && type.kind === 301; + return node.dotDotDotToken !== undefined || !!type && type.kind === 302; } ts.isRestParameter = isRestParameter; function hasTypeArguments(node) { @@ -11712,31 +11791,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 209: + case 210: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 62 ? 1 : 2 : 0; - case 207: case 208: + case 209: var unaryOperator = parent.operator; return unaryOperator === 45 || unaryOperator === 46 ? 2 : 0; - case 231: case 232: + case 233: return parent.initializer === node ? 1 : 0; - case 200: - case 192: - case 213: - case 218: + case 201: + case 193: + case 214: + case 219: node = parent; break; - case 282: + case 283: if (parent.name !== node) { return 0; } node = parent.parent; break; - case 281: + case 282: if (parent.name === node) { return 0; } @@ -11755,22 +11834,22 @@ var ts; ts.isAssignmentTarget = isAssignmentTarget; function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 223: - case 225: - case 236: - case 227: + case 224: + case 226: case 237: - case 251: - case 277: - case 278: + case 228: case 238: - case 230: + case 252: + case 278: + case 279: + case 239: case 231: case 232: - case 228: + case 233: case 229: - case 240: - case 280: + case 230: + case 241: + case 281: return true; } return false; @@ -11787,32 +11866,32 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 182); + return walkUp(node, 183); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 200); + return walkUp(node, 201); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; function skipParentheses(node) { - while (node.kind === 200) { + while (node.kind === 201) { node = node.expression; } return node; } ts.skipParentheses = skipParentheses; function skipParenthesesUp(node) { - while (node.kind === 200) { + while (node.kind === 201) { node = node.parent; } return node; } function isDeleteTarget(node) { - if (node.kind !== 194 && node.kind !== 195) { + if (node.kind !== 195 && node.kind !== 196) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 203; + return node && node.kind === 204; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -11862,69 +11941,69 @@ var ts; ts.getDeclarationFromName = getDeclarationFromName; function isLiteralComputedPropertyDeclarationName(node) { return isStringOrNumericLiteralLike(node) && - node.parent.kind === 154 && + node.parent.kind === 155 && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { + case 160: case 159: - case 158: + case 162: case 161: - case 160: - case 163: case 164: - case 284: - case 281: - case 194: + case 165: + case 285: + case 282: + case 195: return parent.name === node; - case 153: + case 154: if (parent.right === node) { - while (parent.kind === 153) { + while (parent.kind === 154) { parent = parent.parent; } - return parent.kind === 172 || parent.kind === 169; + return parent.kind === 173 || parent.kind === 170; } return false; - case 191: - case 258: + case 192: + case 259: return parent.propertyName === node; - case 263: - case 273: + case 264: + case 274: return true; } return false; } ts.isIdentifierName = isIdentifierName; function isAliasSymbolDeclaration(node) { - return node.kind === 253 || - node.kind === 252 || - node.kind === 255 && !!node.name || - node.kind === 256 || - node.kind === 262 || - node.kind === 258 || + return node.kind === 254 || + node.kind === 253 || + node.kind === 256 && !!node.name || + node.kind === 257 || node.kind === 263 || - node.kind === 259 && exportAssignmentIsAlias(node) || + node.kind === 259 || + node.kind === 264 || + node.kind === 260 && exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 && exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 && isAliasableExpression(node.parent.right) || - node.kind === 282 || - node.kind === 281 && isAliasableExpression(node.initializer); + node.kind === 283 || + node.kind === 282 && isAliasableExpression(node.initializer); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getAliasDeclarationFromName(node) { switch (node.parent.kind) { - case 255: - case 258: case 256: - case 263: case 259: - case 253: + case 257: + case 264: + case 260: + case 254: return node.parent; - case 153: + case 154: do { node = node.parent; - } while (node.parent.kind === 153); + } while (node.parent.kind === 154); return getAliasDeclarationFromName(node); } } @@ -11943,7 +12022,7 @@ var ts; } ts.getExportAssignmentExpression = getExportAssignmentExpression; function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 282 ? node.name : node.kind === 281 ? node.initializer : + return node.kind === 283 ? node.name : node.kind === 282 ? node.initializer : node.parent.right; } ts.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression; @@ -12007,11 +12086,11 @@ var ts; } ts.getAncestor = getAncestor; function isKeyword(token) { - return 77 <= token && token <= 152; + return 77 <= token && token <= 153; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 122 <= token && token <= 152; + return 122 <= token && token <= 153; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -12047,13 +12126,13 @@ var ts; } var flags = 0; switch (node.kind) { - case 244: - case 201: - case 161: + case 245: + case 202: + case 162: if (node.asteriskToken) { flags |= 1; } - case 202: + case 203: if (hasModifier(node, 256)) { flags |= 2; } @@ -12067,10 +12146,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 244: - case 201: + case 245: case 202: - case 161: + case 203: + case 162: return node.body !== undefined && node.asteriskToken === undefined && hasModifier(node, 256); @@ -12092,7 +12171,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - if (!(name.kind === 154 || name.kind === 195)) { + if (!(name.kind === 155 || name.kind === 196)) { return false; } var expr = ts.isElementAccessExpression(name) ? name.argumentExpression : name.expression; @@ -12113,7 +12192,7 @@ var ts; case 10: case 8: return ts.escapeLeadingUnderscores(name.text); - case 154: + case 155: var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -12173,11 +12252,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 156; + return root.kind === 157; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 191) { + while (node.kind === 192) { node = node.parent.parent; } return node; @@ -12185,15 +12264,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 162 - || kind === 201 - || kind === 244 + return kind === 163 || kind === 202 - || kind === 161 - || kind === 163 + || kind === 245 + || kind === 203 + || kind === 162 || kind === 164 - || kind === 249 - || kind === 290; + || kind === 165 + || kind === 250 + || kind === 291; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -12207,23 +12286,23 @@ var ts; ts.getOriginalSourceFile = getOriginalSourceFile; function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 197 && expression.arguments !== undefined; + var hasArguments = expression.kind === 198 && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 197: + case 198: return hasArguments ? 0 : 1; - case 207: - case 204: + case 208: case 205: - case 203: case 206: - case 210: - case 212: + case 204: + case 207: + case 211: + case 213: return 1; - case 209: + case 210: switch (operator) { case 42: case 62: @@ -12247,15 +12326,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 197 && expression.arguments !== undefined; + var hasArguments = expression.kind === 198 && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 209) { + if (expression.kind === 210) { return expression.operatorToken.kind; } - else if (expression.kind === 207 || expression.kind === 208) { + else if (expression.kind === 208 || expression.kind === 209) { return expression.operator; } else { @@ -12265,15 +12344,15 @@ var ts; ts.getOperator = getOperator; function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 327: + case 328: return 0; - case 213: + case 214: return 1; - case 212: + case 213: return 2; - case 210: + case 211: return 4; - case 209: + case 210: switch (operatorKind) { case 27: return 0; @@ -12294,21 +12373,21 @@ var ts; default: return getBinaryOperatorPrecedence(operatorKind); } - case 207: - case 204: + case 208: case 205: - case 203: case 206: + case 204: + case 207: return 16; - case 208: + case 209: return 17; - case 196: - return 18; case 197: - return hasArguments ? 19 : 18; + return 18; case 198: - case 194: + return hasArguments ? 19 : 18; + case 199: case 195: + case 196: return 19; case 104: case 102: @@ -12319,19 +12398,19 @@ var ts; case 8: case 9: case 10: - case 192: case 193: - case 201: + case 194: case 202: - case 214: - case 266: + case 203: + case 215: case 267: - case 270: + case 268: + case 271: case 13: case 14: - case 211: - case 200: - case 215: + case 212: + case 201: + case 216: return 20; default: return -1; @@ -12886,10 +12965,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 163) { + if (accessor.kind === 164) { getAccessor = accessor; } - else if (accessor.kind === 164) { + else if (accessor.kind === 165) { setAccessor = accessor; } else { @@ -12909,10 +12988,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 163 && !getAccessor) { + if (member.kind === 164 && !getAccessor) { getAccessor = member; } - if (member.kind === 164 && !setAccessor) { + if (member.kind === 165 && !setAccessor) { setAccessor = member; } } @@ -12951,7 +13030,7 @@ var ts; } ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations; function isNonTypeAliasTemplate(tag) { - return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 303 && tag.parent.tags.some(isJSDocTypeAlias)); + return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 304 && tag.parent.tags.some(isJSDocTypeAlias)); } function getEffectiveSetAccessorTypeAnnotationNode(node) { var parameter = getSetAccessorValueParameter(node); @@ -13127,7 +13206,7 @@ var ts; } ts.getSelectedModifierFlags = getSelectedModifierFlags; function getModifierFlags(node) { - if (node.kind >= 0 && node.kind <= 152) { + if (node.kind >= 0 && node.kind <= 153) { return 0; } if (node.modifierFlagsCache & 536870912) { @@ -13167,11 +13246,11 @@ var ts; case 117: return 8; case 122: return 128; case 89: return 1; - case 130: return 2; + case 131: return 2; case 81: return 2048; case 84: return 512; case 126: return 256; - case 138: return 64; + case 139: return 64; } return 0; } @@ -13210,8 +13289,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, true)) { var kind = node.left.kind; - return kind === 193 - || kind === 192; + return kind === 194 + || kind === 193; } return false; } @@ -13228,12 +13307,12 @@ var ts; switch (node.kind) { case 75: return node; - case 153: + case 154: do { node = node.left; } while (node.kind !== 75); return node; - case 194: + case 195: do { node = node.expression; } while (node.kind !== 75); @@ -13243,14 +13322,19 @@ var ts; ts.getFirstIdentifier = getFirstIdentifier; function isDottedName(node) { return node.kind === 75 || node.kind === 104 || node.kind === 102 || - node.kind === 194 && isDottedName(node.expression) || - node.kind === 200 && isDottedName(node.expression); + node.kind === 195 && isDottedName(node.expression) || + node.kind === 201 && isDottedName(node.expression); } ts.isDottedName = isDottedName; function isPropertyAccessEntityNameExpression(node) { return ts.isPropertyAccessExpression(node) && isEntityNameExpression(node.expression); } ts.isPropertyAccessEntityNameExpression = isPropertyAccessEntityNameExpression; + function isConstructorAccessExpression(expr) { + return (ts.isPropertyAccessExpression(expr) && ts.idText(expr.name) === "constructor" || + ts.isElementAccessExpression(expr) && ts.isStringLiteralLike(expr.argumentExpression) && expr.argumentExpression.text === "constructor"); + } + ts.isConstructorAccessExpression = isConstructorAccessExpression; function tryGetPropertyAccessOrIdentifierToString(expr) { if (ts.isPropertyAccessExpression(expr)) { var baseStr = tryGetPropertyAccessOrIdentifierToString(expr.expression); @@ -13269,17 +13353,17 @@ var ts; } ts.isPrototypeAccess = isPrototypeAccess; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 153 && node.parent.right === node) || - (node.parent.kind === 194 && node.parent.name === node); + return (node.parent.kind === 154 && node.parent.right === node) || + (node.parent.kind === 195 && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 193 && + return expression.kind === 194 && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 192 && + return expression.kind === 193 && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -13517,8 +13601,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 248: case 249: + case 250: return parseNode === parseNode.parent.name; } } @@ -13584,32 +13668,32 @@ var ts; if (!parent) return 0; switch (parent.kind) { - case 200: + case 201: return accessKind(parent); + case 209: case 208: - case 207: var operator = parent.operator; return operator === 45 || operator === 46 ? writeOrReadWrite() : 0; - case 209: + case 210: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 62 ? 1 : writeOrReadWrite() : 0; - case 194: + case 195: return parent.name !== node ? 0 : accessKind(parent); - case 281: { + case 282: { var parentAccess = accessKind(parent.parent); return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess; } - case 282: + case 283: return node === parent.objectAssignmentInitializer ? 0 : accessKind(parent.parent); - case 192: + case 193: return accessKind(parent); default: return 0; } function writeOrReadWrite() { - return parent.parent && skipParenthesesUp(parent.parent).kind === 226 ? 1 : 2; + return parent.parent && skipParenthesesUp(parent.parent).kind === 227 ? 1 : 2; } } function reverseAccessKind(a) { @@ -13740,39 +13824,39 @@ var ts; } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; function isTypeNodeKind(kind) { - return (kind >= 168 && kind <= 188) + return (kind >= 169 && kind <= 189) || kind === 125 - || kind === 148 - || kind === 140 - || kind === 151 + || kind === 149 || kind === 141 - || kind === 128 - || kind === 143 + || kind === 152 + || kind === 142 + || kind === 129 || kind === 144 + || kind === 145 || kind === 104 || kind === 110 - || kind === 146 + || kind === 147 || kind === 100 - || kind === 137 - || kind === 216 - || kind === 295 + || kind === 138 + || kind === 217 || kind === 296 || kind === 297 || kind === 298 || kind === 299 || kind === 300 - || kind === 301; + || kind === 301 + || kind === 302; } ts.isTypeNodeKind = isTypeNodeKind; function isAccessExpression(node) { - return node.kind === 194 || node.kind === 195; + return node.kind === 195 || node.kind === 196; } ts.isAccessExpression = isAccessExpression; function getNameOfAccessExpression(node) { - if (node.kind === 194) { + if (node.kind === 195) { return node.name; } - ts.Debug.assert(node.kind === 195); + ts.Debug.assert(node.kind === 196); return node.argumentExpression; } ts.getNameOfAccessExpression = getNameOfAccessExpression; @@ -13786,12 +13870,8 @@ var ts; } } ts.isBundleFileTextLike = isBundleFileTextLike; - function getDotOrQuestionDotToken(node) { - return node.questionDotToken || ts.createNode(24, node.expression.end, node.name.pos); - } - ts.getDotOrQuestionDotToken = getDotOrQuestionDotToken; function isNamedImportsOrExports(node) { - return node.kind === 257 || node.kind === 261; + return node.kind === 258 || node.kind === 262; } ts.isNamedImportsOrExports = isNamedImportsOrExports; function Symbol(flags, name) { @@ -14755,32 +14835,43 @@ var ts; function isValidTypeOnlyAliasUseSite(useSite) { return !!(useSite.flags & 8388608) || isPartOfTypeQuery(useSite) - || isFirstIdentifierOfNonEmittingHeritageClause(useSite) + || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !isExpressionNode(useSite); } ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite; function typeOnlyDeclarationIsExport(typeOnlyDeclaration) { - return typeOnlyDeclaration.kind === 263; + return typeOnlyDeclaration.kind === 264; } ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport; function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { - while (node.kind === 75 || node.kind === 194) { + while (node.kind === 75 || node.kind === 195) { node = node.parent; } - if (node.kind !== 154) { + if (node.kind !== 155) { return false; } if (hasModifier(node.parent, 128)) { return true; } var containerKind = node.parent.parent.kind; - return containerKind === 246 || containerKind === 173; + return containerKind === 247 || containerKind === 174; } - function isFirstIdentifierOfNonEmittingHeritageClause(node) { - var _a, _b; - var heritageClause = (_a = ts.tryCast(node.parent.parent, ts.isHeritageClause)) !== null && _a !== void 0 ? _a : ts.tryCast((_b = node.parent.parent) === null || _b === void 0 ? void 0 : _b.parent, ts.isHeritageClause); - return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 246; + function isIdentifierInNonEmittingHeritageClause(node) { + if (node.kind !== 75) + return false; + var heritageClause = findAncestor(node.parent, function (parent) { + switch (parent.kind) { + case 280: + return true; + case 195: + case 217: + return false; + default: + return "quit"; + } + }); + return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 247; } })(ts || (ts = {})); var ts; @@ -14791,7 +14882,7 @@ var ts; var PrivateIdentifierConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 290) { + if (kind === 291) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 75) { @@ -14832,19 +14923,19 @@ var ts; } ts.isJSDocLikeText = isJSDocLikeText; function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 152) { + if (!node || node.kind <= 153) { return; } switch (node.kind) { - case 153: + case 154: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 155: + case 156: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 282: + case 283: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -14852,9 +14943,9 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 283: + case 284: return visitNode(cbNode, node.expression); - case 156: + case 157: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || @@ -14862,7 +14953,7 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 159: + case 160: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -14870,51 +14961,51 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 158: + case 159: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 281: + case 282: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.initializer); - case 242: + case 243: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 191: + case 192: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 170: case 171: - case 165: + case 172: case 166: case 167: + case 168: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 161: - case 160: case 162: + case 161: case 163: case 164: - case 201: - case 244: + case 165: case 202: + case 245: + case 203: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -14926,359 +15017,359 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 169: + case 170: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 168: + case 169: return visitNode(cbNode, node.assertsModifier) || visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 172: - return visitNode(cbNode, node.exprName); case 173: - return visitNodes(cbNode, cbNodes, node.members); + return visitNode(cbNode, node.exprName); case 174: - return visitNode(cbNode, node.elementType); + return visitNodes(cbNode, cbNodes, node.members); case 175: + return visitNode(cbNode, node.elementType); + case 176: return visitNodes(cbNode, cbNodes, node.elementTypes); - case 178: case 179: - return visitNodes(cbNode, cbNodes, node.types); case 180: + return visitNodes(cbNode, cbNodes, node.types); + case 181: return visitNode(cbNode, node.checkType) || visitNode(cbNode, node.extendsType) || visitNode(cbNode, node.trueType) || visitNode(cbNode, node.falseType); - case 181: + case 182: return visitNode(cbNode, node.typeParameter); - case 188: + case 189: return visitNode(cbNode, node.argument) || visitNode(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 182: - case 184: - return visitNode(cbNode, node.type); + case 183: case 185: + return visitNode(cbNode, node.type); + case 186: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 186: + case 187: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 187: + case 188: return visitNode(cbNode, node.literal); - case 189: case 190: - return visitNodes(cbNode, cbNodes, node.elements); - case 192: + case 191: return visitNodes(cbNode, cbNodes, node.elements); case 193: - return visitNodes(cbNode, cbNodes, node.properties); + return visitNodes(cbNode, cbNodes, node.elements); case 194: + return visitNodes(cbNode, cbNodes, node.properties); + case 195: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.name); - case 195: + case 196: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.argumentExpression); - case 196: case 197: + case 198: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 198: + case 199: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.template); - case 199: + case 200: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 200: - return visitNode(cbNode, node.expression); - case 203: + case 201: return visitNode(cbNode, node.expression); case 204: return visitNode(cbNode, node.expression); case 205: return visitNode(cbNode, node.expression); - case 207: - return visitNode(cbNode, node.operand); - case 212: - return visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.expression); case 206: return visitNode(cbNode, node.expression); case 208: return visitNode(cbNode, node.operand); + case 213: + return visitNode(cbNode, node.asteriskToken) || + visitNode(cbNode, node.expression); + case 207: + return visitNode(cbNode, node.expression); case 209: + return visitNode(cbNode, node.operand); + case 210: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 217: + case 218: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 218: - return visitNode(cbNode, node.expression); case 219: + return visitNode(cbNode, node.expression); + case 220: return visitNode(cbNode, node.name); - case 210: + case 211: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 213: + case 214: return visitNode(cbNode, node.expression); - case 223: - case 250: + case 224: + case 251: return visitNodes(cbNode, cbNodes, node.statements); - case 290: + case 291: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 225: + case 226: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 243: + case 244: return visitNodes(cbNode, cbNodes, node.declarations); - case 226: - return visitNode(cbNode, node.expression); case 227: + return visitNode(cbNode, node.expression); + case 228: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 228: + case 229: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 229: + case 230: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 230: + case 231: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 231: + case 232: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 232: + case 233: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 233: case 234: - return visitNode(cbNode, node.label); case 235: - return visitNode(cbNode, node.expression); + return visitNode(cbNode, node.label); case 236: + return visitNode(cbNode, node.expression); + case 237: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 237: + case 238: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 251: + case 252: return visitNodes(cbNode, cbNodes, node.clauses); - case 277: + case 278: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 278: + case 279: return visitNodes(cbNode, cbNodes, node.statements); - case 238: + case 239: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 239: - return visitNode(cbNode, node.expression); case 240: + return visitNode(cbNode, node.expression); + case 241: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 280: + case 281: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 157: + case 158: return visitNode(cbNode, node.expression); - case 245: - case 214: + case 246: + case 215: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 246: + case 247: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 247: + case 248: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 248: + case 249: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 284: + case 285: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 249: + case 250: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 253: + case 254: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 254: + case 255: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 255: + case 256: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 252: + case 253: return visitNode(cbNode, node.name); - case 256: + case 257: return visitNode(cbNode, node.name); - case 262: + case 263: return visitNode(cbNode, node.name); - case 257: - case 261: + case 258: + case 262: return visitNodes(cbNode, cbNodes, node.elements); - case 260: + case 261: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 258: - case 263: + case 259: + case 264: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 259: + case 260: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 211: + case 212: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 221: + case 222: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 154: + case 155: return visitNode(cbNode, node.expression); - case 279: + case 280: return visitNodes(cbNode, cbNodes, node.types); - case 216: + case 217: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 265: + case 266: return visitNode(cbNode, node.expression); - case 264: + case 265: return visitNodes(cbNode, cbNodes, node.decorators); - case 327: + case 328: return visitNodes(cbNode, cbNodes, node.elements); - case 266: + case 267: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 270: + case 271: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 267: case 268: + case 269: return visitNode(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.attributes); - case 274: + case 275: return visitNodes(cbNode, cbNodes, node.properties); - case 273: + case 274: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 275: - return visitNode(cbNode, node.expression); case 276: + return visitNode(cbNode, node.expression); + case 277: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 269: + case 270: return visitNode(cbNode, node.tagName); - case 176: case 177: - case 294: - case 298: - case 297: + case 178: + case 295: case 299: - case 301: - return visitNode(cbNode, node.type); + case 298: case 300: + case 302: + return visitNode(cbNode, node.type); + case 301: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 303: + case 304: return visitNodes(cbNode, cbNodes, node.tags); - case 317: - case 323: + case 318: + case 324: return visitNode(cbNode, node.tagName) || (node.isNameFirst ? visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression) : visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name)); - case 309: + case 310: return visitNode(cbNode, node.tagName); - case 308: + case 309: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 307: + case 308: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 321: + case 322: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); - case 322: + case 323: return visitNode(cbNode, node.tagName) || (node.typeExpression && - node.typeExpression.kind === 294 + node.typeExpression.kind === 295 ? visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) : visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression)); - case 315: + case 316: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); - case 318: - case 320: case 319: - case 316: + case 321: + case 320: + case 317: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.typeExpression); - case 305: + case 306: return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); - case 304: + case 305: return ts.forEach(node.jsDocPropertyTags, cbNode); - case 306: - case 310: + case 307: case 311: case 312: case 313: case 314: + case 315: return visitNode(cbNode, node.tagName); - case 326: + case 327: return visitNode(cbNode, node.expression); } } @@ -15448,7 +15539,7 @@ var ts; sourceFile.endOfFileToken = parseTokenNode(); } else { - var statement = createNode(226); + var statement = createNode(227); switch (token()) { case 22: statement.expression = parseArrayLiteralExpression(); @@ -15528,6 +15619,7 @@ var ts; scanner.setLanguageVariant(getLanguageVariant(scriptKind)); } function clearState() { + scanner.clearCommentDirectives(); scanner.setText(""); scanner.setOnError(undefined); parseDiagnostics = undefined; @@ -15551,6 +15643,7 @@ var ts; ts.Debug.assert(token() === 1); sourceFile.endOfFileToken = addJSDocComment(parseTokenNode()); setExternalModuleIndicator(sourceFile); + sourceFile.commentDirectives = scanner.getCommentDirectives(); sourceFile.nodeCount = nodeCount; sourceFile.identifierCount = identifierCount; sourceFile.identifiers = identifiers; @@ -15585,7 +15678,7 @@ var ts; } Parser.fixupParentReferences = fixupParentReferences; function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) { - var sourceFile = new SourceFileConstructor(290, 0, sourceText.length); + var sourceFile = new SourceFileConstructor(291, 0, sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -15859,7 +15952,7 @@ var ts; } function createNodeWithJSDoc(kind, pos) { var node = createNode(kind, pos); - if (scanner.getTokenFlags() & 2) { + if (scanner.getTokenFlags() & 2 && (kind !== 227 || token() !== 20)) { addJSDocComment(node); } return node; @@ -15957,7 +16050,7 @@ var ts; return parsePropertyNameWorker(true); } function parseComputedPropertyName() { - var node = createNode(154); + var node = createNode(155); parseExpected(22); node.expression = allowInAnd(parseExpression); parseExpected(23); @@ -15995,15 +16088,15 @@ var ts; if (token() === 84) { return lookAhead(nextTokenCanFollowDefaultKeyword); } - if (token() === 145) { + if (token() === 146) { return lookAhead(nextTokenCanFollowExportModifier); } return canFollowExportModifier(); case 84: return nextTokenCanFollowDefaultKeyword(); case 120: - case 131: - case 142: + case 132: + case 143: nextToken(); return canFollowModifier(); default: @@ -16303,17 +16396,17 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 162: - case 167: case 163: + case 168: case 164: - case 159: - case 222: + case 165: + case 160: + case 223: return true; - case 161: + case 162: var methodDeclaration = node; var nameIsConstructor = methodDeclaration.name.kind === 75 && - methodDeclaration.name.originalKeywordKind === 129; + methodDeclaration.name.originalKeywordKind === 130; return !nameIsConstructor; } } @@ -16322,8 +16415,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 277: case 278: + case 279: return true; } } @@ -16332,65 +16425,65 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 244: - case 225: - case 223: - case 227: + case 245: case 226: - case 239: + case 224: + case 228: + case 227: + case 240: + case 236: + case 238: case 235: - case 237: case 234: + case 232: case 233: case 231: - case 232: case 230: - case 229: - case 236: - case 224: - case 240: - case 238: - case 228: + case 237: + case 225: case 241: + case 239: + case 229: + case 242: + case 255: case 254: - case 253: + case 261: case 260: - case 259: - case 249: - case 245: + case 250: case 246: - case 248: case 247: + case 249: + case 248: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 284; + return node.kind === 285; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 166: - case 160: case 167: - case 158: - case 165: + case 161: + case 168: + case 159: + case 166: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 242) { + if (node.kind !== 243) { return false; } var variableDeclarator = node; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 156) { + if (node.kind !== 157) { return false; } var parameter = node; @@ -16507,7 +16600,7 @@ var ts; return entity; } function createQualifiedName(entity, name) { - var node = createNode(153, entity.pos); + var node = createNode(154, entity.pos); node.left = entity; node.right = name; return finishNode(node); @@ -16526,7 +16619,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression(isTaggedTemplate) { - var template = createNode(211); + var template = createNode(212); template.head = parseTemplateHead(isTaggedTemplate); ts.Debug.assert(template.head.kind === 15, "Template head has wrong token kind"); var list = []; @@ -16538,7 +16631,7 @@ var ts; return finishNode(template); } function parseTemplateSpan(isTaggedTemplate) { - var span = createNode(221); + var span = createNode(222); span.expression = allowInAnd(parseExpression); var literal; if (token() === 19) { @@ -16597,7 +16690,7 @@ var ts; return node; } function parseTypeReference() { - var node = createNode(169); + var node = createNode(170); node.typeName = parseEntityName(true, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29) { node.typeArguments = parseBracketedList(20, parseType, 29, 31); @@ -16606,14 +16699,14 @@ var ts; } function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 169: - return ts.nodeIsMissing(node.typeName); case 170: - case 171: { + return ts.nodeIsMissing(node.typeName); + case 171: + case 172: { var _a = node, parameters = _a.parameters, type = _a.type; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 182: + case 183: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -16621,20 +16714,20 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(168, lhs.pos); + var node = createNode(169, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(183); + var node = createNode(184); nextToken(); return finishNode(node); } function parseJSDocAllType(postFixEquals) { - var result = createNode(295); + var result = createNode(296); if (postFixEquals) { - return createPostfixType(299, result); + return createPostfixType(300, result); } else { nextToken(); @@ -16642,7 +16735,7 @@ var ts; return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(298); + var result = createNode(299); nextToken(); result.type = parseNonArrayType(); return finishNode(result); @@ -16656,28 +16749,28 @@ var ts; token() === 31 || token() === 62 || token() === 51) { - var result = createNode(296, pos); + var result = createNode(297, pos); return finishNode(result); } else { - var result = createNode(297, pos); + var result = createNode(298, pos); result.type = parseType(); return finishNode(result); } } function parseJSDocFunctionType() { if (lookAhead(nextTokenIsOpenParen)) { - var result = createNodeWithJSDoc(300); + var result = createNodeWithJSDoc(301); nextToken(); fillSignature(58, 4 | 32, result); return finishNode(result); } - var node = createNode(169); + var node = createNode(170); node.typeName = parseIdentifierName(); return finishNode(node); } function parseJSDocParameter() { - var parameter = createNode(156); + var parameter = createNode(157); if (token() === 104 || token() === 99) { parameter.name = parseIdentifierName(); parseExpected(58); @@ -16687,9 +16780,9 @@ var ts; } function parseJSDocType() { scanner.setInJSDocType(true); - var moduleSpecifier = parseOptionalToken(135); + var moduleSpecifier = parseOptionalToken(136); if (moduleSpecifier) { - var moduleTag = createNode(302, moduleSpecifier.pos); + var moduleTag = createNode(303, moduleSpecifier.pos); terminate: while (true) { switch (token()) { case 19: @@ -16708,23 +16801,23 @@ var ts; var type = parseTypeOrTypePredicate(); scanner.setInJSDocType(false); if (dotdotdot) { - var variadic = createNode(301, dotdotdot.pos); + var variadic = createNode(302, dotdotdot.pos); variadic.type = type; type = finishNode(variadic); } if (token() === 62) { - return createPostfixType(299, type); + return createPostfixType(300, type); } return type; } function parseTypeQuery() { - var node = createNode(172); + var node = createNode(173); parseExpected(108); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(155); + var node = createNode(156); node.name = parseIdentifier(); if (parseOptional(90)) { if (isStartOfType() || !isStartOfExpression()) { @@ -16758,7 +16851,7 @@ var ts; isStartOfType(!isJSDocParameter); } function parseParameter() { - var node = createNodeWithJSDoc(156); + var node = createNodeWithJSDoc(157); if (token() === 104) { node.name = createIdentifier(true); node.type = parseParameterType(); @@ -16827,7 +16920,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 166) { + if (kind === 167) { parseExpected(99); } fillSignature(58, 4, node); @@ -16864,7 +16957,7 @@ var ts; return token() === 58 || token() === 27 || token() === 23; } function parseIndexSignatureDeclaration(node) { - node.kind = 167; + node.kind = 168; node.parameters = parseBracketedList(16, parseParameter, 22, 23); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -16874,11 +16967,11 @@ var ts; node.name = parsePropertyName(); node.questionToken = parseOptionalToken(57); if (token() === 20 || token() === 29) { - node.kind = 160; + node.kind = 161; fillSignature(58, 4, node); } else { - node.kind = 158; + node.kind = 159; node.type = parseTypeAnnotation(); if (token() === 62) { node.initializer = parseInitializer(); @@ -16915,10 +17008,10 @@ var ts; } function parseTypeMember() { if (token() === 20 || token() === 29) { - return parseSignatureMember(165); + return parseSignatureMember(166); } if (token() === 99 && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(166); + return parseSignatureMember(167); } var node = createNodeWithJSDoc(0); node.modifiers = parseModifiers(); @@ -16944,7 +17037,7 @@ var ts; return false; } function parseTypeLiteral() { - var node = createNode(173); + var node = createNode(174); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -16962,27 +17055,27 @@ var ts; function isStartOfMappedType() { nextToken(); if (token() === 39 || token() === 40) { - return nextToken() === 138; + return nextToken() === 139; } - if (token() === 138) { + if (token() === 139) { nextToken(); } return token() === 22 && nextTokenIsIdentifier() && nextToken() === 97; } function parseMappedTypeParameter() { - var node = createNode(155); + var node = createNode(156); node.name = parseIdentifier(); parseExpected(97); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(186); + var node = createNode(187); parseExpected(18); - if (token() === 138 || token() === 39 || token() === 40) { + if (token() === 139 || token() === 39 || token() === 40) { node.readonlyToken = parseTokenNode(); - if (node.readonlyToken.kind !== 138) { - parseExpectedToken(138); + if (node.readonlyToken.kind !== 139) { + parseExpectedToken(139); } } parseExpected(22); @@ -17002,23 +17095,23 @@ var ts; function parseTupleElementType() { var pos = getNodePos(); if (parseOptional(25)) { - var node = createNode(177, pos); + var node = createNode(178, pos); node.type = parseType(); return finishNode(node); } var type = parseType(); - if (!(contextFlags & 4194304) && type.kind === 297 && type.pos === type.type.pos) { - type.kind = 176; + if (!(contextFlags & 4194304) && type.kind === 298 && type.pos === type.type.pos) { + type.kind = 177; } return type; } function parseTupleType() { - var node = createNode(175); + var node = createNode(176); node.elementTypes = parseBracketedList(21, parseTupleElementType, 22, 23); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(182); + var node = createNode(183); parseExpected(20); node.type = parseType(); parseExpected(21); @@ -17026,7 +17119,7 @@ var ts; } function parseFunctionOrConstructorType() { var pos = getNodePos(); - var kind = parseOptional(99) ? 171 : 170; + var kind = parseOptional(99) ? 172 : 171; var node = createNodeWithJSDoc(kind, pos); fillSignature(38, 4, node); return finishNode(node); @@ -17036,10 +17129,10 @@ var ts; return token() === 24 ? undefined : node; } function parseLiteralTypeNode(negative) { - var node = createNode(187); + var node = createNode(188); var unaryMinusExpression; if (negative) { - unaryMinusExpression = createNode(207); + unaryMinusExpression = createNode(208); unaryMinusExpression.operator = 40; nextToken(); } @@ -17060,7 +17153,7 @@ var ts; } function parseImportType() { sourceFile.flags |= 1048576; - var node = createNode(188); + var node = createNode(189); if (parseOptional(108)) { node.isTypeOf = true; } @@ -17083,15 +17176,15 @@ var ts; function parseNonArrayType() { switch (token()) { case 125: - case 148: - case 143: - case 140: - case 151: + case 149: case 144: - case 128: - case 146: - case 137: case 141: + case 152: + case 145: + case 129: + case 147: + case 138: + case 142: return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 41: return parseJSDocAllType(false); @@ -17119,7 +17212,7 @@ var ts; return parseTokenNode(); case 104: { var thisKeyword = parseThisTypeNode(); - if (token() === 133 && !scanner.hasPrecedingLineBreak()) { + if (token() === 134 && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -17145,20 +17238,20 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 125: - case 148: - case 143: - case 140: - case 151: - case 128: - case 138: + case 149: case 144: - case 147: + case 141: + case 152: + case 129: + case 139: + case 145: + case 148: case 110: - case 146: + case 147: case 100: case 104: case 108: - case 137: + case 138: case 18: case 22: case 29: @@ -17170,12 +17263,12 @@ var ts; case 9: case 106: case 91: - case 141: + case 142: case 41: case 57: case 53: case 25: - case 132: + case 133: case 96: case 124: return true; @@ -17198,25 +17291,25 @@ var ts; while (!scanner.hasPrecedingLineBreak()) { switch (token()) { case 53: - type = createPostfixType(298, type); + type = createPostfixType(299, type); break; case 57: if (!(contextFlags & 4194304) && lookAhead(nextTokenIsStartOfType)) { return type; } - type = createPostfixType(297, type); + type = createPostfixType(298, type); break; case 22: parseExpected(22); if (isStartOfType()) { - var node = createNode(185, type.pos); + var node = createNode(186, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(23); type = finishNode(node); } else { - var node = createNode(174, type.pos); + var node = createNode(175, type.pos); node.elementType = type; parseExpected(23); type = finishNode(node); @@ -17235,16 +17328,16 @@ var ts; return finishNode(postfix); } function parseTypeOperator(operator) { - var node = createNode(184); + var node = createNode(185); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); return finishNode(node); } function parseInferType() { - var node = createNode(181); - parseExpected(132); - var typeParameter = createNode(155); + var node = createNode(182); + parseExpected(133); + var typeParameter = createNode(156); typeParameter.name = parseIdentifier(); node.typeParameter = finishNode(typeParameter); return finishNode(node); @@ -17252,11 +17345,12 @@ var ts; function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 134: - case 147: - case 138: + case 135: + case 148: + case 139: + case 128: return parseTypeOperator(operator); - case 132: + case 133: return parseInferType(); } return parsePostfixTypeOrHigher(); @@ -17277,10 +17371,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(179, parseTypeOperatorOrHigher, 50); + return parseUnionOrIntersectionType(180, parseTypeOperatorOrHigher, 50); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(178, parseIntersectionTypeOrHigher, 51); + return parseUnionOrIntersectionType(179, parseIntersectionTypeOrHigher, 51); } function isStartOfFunctionType() { if (token() === 29) { @@ -17326,7 +17420,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(168, typePredicateVariable.pos); + var node = createNode(169, typePredicateVariable.pos); node.assertsModifier = undefined; node.parameterName = typePredicateVariable; node.type = type; @@ -17338,16 +17432,16 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 133 && !scanner.hasPrecedingLineBreak()) { + if (token() === 134 && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } } function parseAssertsTypePredicate() { - var node = createNode(168); + var node = createNode(169); node.assertsModifier = parseExpectedToken(124); node.parameterName = token() === 104 ? parseThisTypeNode() : parseIdentifier(); - node.type = parseOptional(133) ? parseType() : undefined; + node.type = parseOptional(134) ? parseType() : undefined; return finishNode(node); } function parseType() { @@ -17359,7 +17453,7 @@ var ts; } var type = parseUnionTypeOrHigher(); if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(90)) { - var node = createNode(180, type.pos); + var node = createNode(181, type.pos); node.checkType = type; node.extendsType = parseTypeWorker(true); parseExpected(57); @@ -17483,7 +17577,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(212); + var node = createNode(213); nextToken(); if (!scanner.hasPrecedingLineBreak() && (token() === 41 || isStartOfExpression())) { @@ -17499,13 +17593,13 @@ var ts; ts.Debug.assert(token() === 38, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(202, asyncModifier.pos); + node = createNode(203, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(202, identifier.pos); + node = createNode(203, identifier.pos); } - var parameter = createNode(156, identifier.pos); + var parameter = createNode(157, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); @@ -17659,7 +17753,7 @@ var ts; return 0; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNodeWithJSDoc(202); + var node = createNodeWithJSDoc(203); node.modifiers = parseModifiersForArrowFunction(); var isAsync = hasModifierOfKind(node, 126) ? 2 : 0; if (!fillSignature(58, isAsync, node) && !allowAmbiguity) { @@ -17691,7 +17785,7 @@ var ts; if (!questionToken) { return leftOperand; } - var node = createNode(210, leftOperand.pos); + var node = createNode(211, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -17706,7 +17800,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 97 || t === 152; + return t === 97 || t === 153; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -17743,39 +17837,39 @@ var ts; return ts.getBinaryOperatorPrecedence(token()) > 0; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(209, left.pos); + var node = createNode(210, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(217, left.pos); + var node = createNode(218, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(207); + var node = createNode(208); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(203); + var node = createNode(204); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(204); + var node = createNode(205); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(205); + var node = createNode(206); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -17790,7 +17884,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(206); + var node = createNode(207); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -17807,7 +17901,7 @@ var ts; if (token() === 42) { var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); var end = simpleUnaryExpression.end; - if (simpleUnaryExpression.kind === 199) { + if (simpleUnaryExpression.kind === 200) { parseErrorAt(pos, end, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -17860,7 +17954,7 @@ var ts; } function parseUpdateExpression() { if (token() === 45 || token() === 46) { - var node = createNode(207); + var node = createNode(208); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -17872,7 +17966,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 45 || token() === 46) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(208, expression.pos); + var node = createNode(209, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -17891,7 +17985,7 @@ var ts; var fullStart = scanner.getStartPos(); nextToken(); nextToken(); - var node = createNode(219, fullStart); + var node = createNode(220, fullStart); node.keywordToken = 96; node.name = parseIdentifierName(); expression = finishNode(node); @@ -17922,7 +18016,7 @@ var ts; if (token() === 20 || token() === 24 || token() === 22) { return expression; } - var node = createNode(194, expression.pos); + var node = createNode(195, expression.pos); node.expression = expression; parseExpectedToken(24, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(true, true); @@ -17931,8 +18025,8 @@ var ts; function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 268) { - var node = createNode(266, opening.pos); + if (opening.kind === 269) { + var node = createNode(267, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -17941,22 +18035,22 @@ var ts; } result = finishNode(node); } - else if (opening.kind === 271) { - var node = createNode(270, opening.pos); + else if (opening.kind === 272) { + var node = createNode(271, opening.pos); node.openingFragment = opening; node.children = parseJsxChildren(node.openingFragment); node.closingFragment = parseJsxClosingFragment(inExpressionContext); result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 267); + ts.Debug.assert(opening.kind === 268); result = opening; } if (inExpressionContext && token() === 29) { var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(209, result.pos); + var badNode = createNode(210, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -18013,7 +18107,7 @@ var ts; return createNodeArray(list, listPos); } function parseJsxAttributes() { - var jsxAttributes = createNode(274); + var jsxAttributes = createNode(275); jsxAttributes.properties = parseList(13, parseJsxAttribute); return finishNode(jsxAttributes); } @@ -18021,7 +18115,7 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(29); if (token() === 31) { - var node_1 = createNode(271, fullStart); + var node_1 = createNode(272, fullStart); scanJsxText(); return finishNode(node_1); } @@ -18030,7 +18124,7 @@ var ts; var attributes = parseJsxAttributes(); var node; if (token() === 31) { - node = createNode(268, fullStart); + node = createNode(269, fullStart); scanJsxText(); } else { @@ -18042,7 +18136,7 @@ var ts; parseExpected(31, undefined, false); scanJsxText(); } - node = createNode(267, fullStart); + node = createNode(268, fullStart); } node.tagName = tagName; node.typeArguments = typeArguments; @@ -18054,7 +18148,7 @@ var ts; var expression = token() === 104 ? parseTokenNode() : parseIdentifierName(); while (parseOptional(24)) { - var propertyAccess = createNode(194, expression.pos); + var propertyAccess = createNode(195, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(true, false); expression = finishNode(propertyAccess); @@ -18062,7 +18156,7 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(276); + var node = createNode(277); if (!parseExpected(18)) { return undefined; } @@ -18085,7 +18179,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(273); + var node = createNode(274); node.name = parseIdentifierName(); if (token() === 62) { switch (scanJsxAttributeValue()) { @@ -18100,7 +18194,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(275); + var node = createNode(276); parseExpected(18); parseExpected(25); node.expression = parseExpression(); @@ -18108,7 +18202,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(269); + var node = createNode(270); parseExpected(30); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -18121,7 +18215,7 @@ var ts; return finishNode(node); } function parseJsxClosingFragment(inExpressionContext) { - var node = createNode(272); + var node = createNode(273); parseExpected(30); if (ts.tokenIsIdentifierOrKeyword(token())) { parseErrorAtRange(parseJsxElementName(), ts.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment); @@ -18136,7 +18230,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(199); + var node = createNode(200); parseExpected(29); node.type = parseType(); parseExpected(31); @@ -18154,7 +18248,7 @@ var ts; && lookAhead(nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate); } function parsePropertyAccessExpressionRest(expression, questionDotToken) { - var propertyAccess = createNode(194, expression.pos); + var propertyAccess = createNode(195, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = parseRightSideOfDot(true, true); @@ -18167,7 +18261,7 @@ var ts; return finishNode(propertyAccess); } function parseElementAccessExpressionRest(expression, questionDotToken) { - var indexedAccess = createNode(195, expression.pos); + var indexedAccess = createNode(196, expression.pos); indexedAccess.expression = expression; indexedAccess.questionDotToken = questionDotToken; if (token() === 23) { @@ -18203,7 +18297,7 @@ var ts; } if (!questionDotToken && token() === 53 && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(218, expression.pos); + var nonNullExpression = createNode(219, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; @@ -18223,7 +18317,7 @@ var ts; return token() === 14 || token() === 15; } function parseTaggedTemplateRest(tag, questionDotToken, typeArguments) { - var tagExpression = createNode(198, tag.pos); + var tagExpression = createNode(199, tag.pos); tagExpression.tag = tag; tagExpression.questionDotToken = questionDotToken; tagExpression.typeArguments = typeArguments; @@ -18246,7 +18340,7 @@ var ts; expression = parseTaggedTemplateRest(expression, questionDotToken, typeArguments); continue; } - var callExpr = createNode(196, expression.pos); + var callExpr = createNode(197, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.typeArguments = typeArguments; @@ -18259,7 +18353,7 @@ var ts; } } else if (token() === 20) { - var callExpr = createNode(196, expression.pos); + var callExpr = createNode(197, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.arguments = parseArgumentList(); @@ -18270,7 +18364,7 @@ var ts; continue; } if (questionDotToken) { - var propertyAccess = createNode(194, expression.pos); + var propertyAccess = createNode(195, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = createMissingNode(75, false, ts.Diagnostics.Identifier_expected); @@ -18372,28 +18466,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNodeWithJSDoc(200); + var node = createNodeWithJSDoc(201); parseExpected(20); node.expression = allowInAnd(parseExpression); parseExpected(21); return finishNode(node); } function parseSpreadElement() { - var node = createNode(213); + var node = createNode(214); parseExpected(25); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 25 ? parseSpreadElement() : - token() === 27 ? createNode(215) : + token() === 27 ? createNode(216) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(192); + var node = createNode(193); parseExpected(22); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -18405,18 +18499,18 @@ var ts; function parseObjectLiteralElement() { var node = createNodeWithJSDoc(0); if (parseOptionalToken(25)) { - node.kind = 283; + node.kind = 284; node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); - if (parseContextualModifier(131)) { - return parseAccessorDeclaration(node, 163); - } - if (parseContextualModifier(142)) { + if (parseContextualModifier(132)) { return parseAccessorDeclaration(node, 164); } + if (parseContextualModifier(143)) { + return parseAccessorDeclaration(node, 165); + } var asteriskToken = parseOptionalToken(41); var tokenIsIdentifier = isIdentifier(); node.name = parsePropertyName(); @@ -18427,7 +18521,7 @@ var ts; } var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 58); if (isShorthandPropertyAssignment) { - node.kind = 282; + node.kind = 283; var equalsToken = parseOptionalToken(62); if (equalsToken) { node.equalsToken = equalsToken; @@ -18435,20 +18529,26 @@ var ts; } } else { - node.kind = 281; + node.kind = 282; parseExpected(58); node.initializer = allowInAnd(parseAssignmentExpressionOrHigher); } return finishNode(node); } function parseObjectLiteralExpression() { - var node = createNode(193); + var node = createNode(194); + var openBracePosition = scanner.getTokenPos(); parseExpected(18); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; } node.properties = parseDelimitedList(12, parseObjectLiteralElement, true); - parseExpected(19); + if (!parseExpected(19)) { + var lastError = ts.lastOrUndefined(parseDiagnostics); + if (lastError && lastError.code === ts.Diagnostics._0_expected.code) { + ts.addRelatedInfo(lastError, ts.createFileDiagnostic(sourceFile, openBracePosition, 1, ts.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here)); + } + } return finishNode(node); } function parseFunctionExpression() { @@ -18456,7 +18556,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(false); } - var node = createNodeWithJSDoc(201); + var node = createNodeWithJSDoc(202); node.modifiers = parseModifiers(); parseExpected(94); node.asteriskToken = parseOptionalToken(41); @@ -18481,7 +18581,7 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(99); if (parseOptional(24)) { - var node_2 = createNode(219, fullStart); + var node_2 = createNode(220, fullStart); node_2.keywordToken = 99; node_2.name = parseIdentifierName(); return finishNode(node_2); @@ -18498,7 +18598,7 @@ var ts; } break; } - var node = createNode(197, fullStart); + var node = createNode(198, fullStart); node.expression = expression; node.typeArguments = typeArguments; if (node.typeArguments || token() === 20) { @@ -18507,7 +18607,7 @@ var ts; return finishNode(node); } function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(223); + var node = createNode(224); var openBracePosition = scanner.getTokenPos(); if (parseExpected(18, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { @@ -18544,12 +18644,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(224); + var node = createNode(225); parseExpected(26); return finishNode(node); } function parseIfStatement() { - var node = createNode(227); + var node = createNode(228); parseExpected(95); parseExpected(20); node.expression = allowInAnd(parseExpression); @@ -18559,7 +18659,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(228); + var node = createNode(229); parseExpected(86); node.statement = parseStatement(); parseExpected(111); @@ -18570,7 +18670,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(229); + var node = createNode(230); parseExpected(111); parseExpected(20); node.expression = allowInAnd(parseExpression); @@ -18593,8 +18693,8 @@ var ts; } } var forOrForInOrForOfStatement; - if (awaitToken ? parseExpected(152) : parseOptional(152)) { - var forOfStatement = createNode(232, pos); + if (awaitToken ? parseExpected(153) : parseOptional(153)) { + var forOfStatement = createNode(233, pos); forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); @@ -18602,14 +18702,14 @@ var ts; forOrForInOrForOfStatement = forOfStatement; } else if (parseOptional(97)) { - var forInStatement = createNode(231, pos); + var forInStatement = createNode(232, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(21); forOrForInOrForOfStatement = forInStatement; } else { - var forStatement = createNode(230, pos); + var forStatement = createNode(231, pos); forStatement.initializer = initializer; parseExpected(26); if (token() !== 26 && token() !== 21) { @@ -18627,7 +18727,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 234 ? 77 : 82); + parseExpected(kind === 235 ? 77 : 82); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -18635,7 +18735,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(235); + var node = createNode(236); parseExpected(101); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -18644,7 +18744,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(236); + var node = createNode(237); parseExpected(112); parseExpected(20); node.expression = allowInAnd(parseExpression); @@ -18653,7 +18753,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(277); + var node = createNode(278); parseExpected(78); node.expression = allowInAnd(parseExpression); parseExpected(58); @@ -18661,7 +18761,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(278); + var node = createNode(279); parseExpected(84); parseExpected(58); node.statements = parseList(3, parseStatement); @@ -18671,12 +18771,12 @@ var ts; return token() === 78 ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(237); + var node = createNode(238); parseExpected(103); parseExpected(20); node.expression = allowInAnd(parseExpression); parseExpected(21); - var caseBlock = createNode(251); + var caseBlock = createNode(252); parseExpected(18); caseBlock.clauses = parseList(2, parseCaseOrDefaultClause); parseExpected(19); @@ -18684,14 +18784,14 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(239); + var node = createNode(240); parseExpected(105); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } function parseTryStatement() { - var node = createNode(240); + var node = createNode(241); parseExpected(107); node.tryBlock = parseBlock(false); node.catchClause = token() === 79 ? parseCatchClause() : undefined; @@ -18702,7 +18802,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(280); + var result = createNode(281); parseExpected(79); if (parseOptional(20)) { result.variableDeclaration = parseVariableDeclaration(); @@ -18715,21 +18815,21 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(241); + var node = createNode(242); parseExpected(83); parseSemicolon(); return finishNode(node); } function parseExpressionOrLabeledStatement() { - var node = createNodeWithJSDoc(0); + var node = createNodeWithJSDoc(token() === 75 ? 0 : 227); var expression = allowInAnd(parseExpression); if (expression.kind === 75 && parseOptional(58)) { - node.kind = 238; + node.kind = 239; node.label = expression; node.statement = parseStatement(); } else { - node.kind = 226; + node.kind = 227; node.expression = expression; parseSemicolon(); } @@ -18762,24 +18862,24 @@ var ts; case 88: return true; case 114: - case 145: + case 146: return nextTokenIsIdentifierOnSameLine(); - case 135: case 136: + case 137: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 122: case 126: - case 130: + case 131: case 117: case 118: case 119: - case 138: + case 139: nextToken(); if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 150: + case 151: nextToken(); return token() === 18 || token() === 75 || token() === 89; case 96: @@ -18788,7 +18888,7 @@ var ts; token() === 18 || ts.tokenIsIdentifierOrKeyword(token()); case 89: var currentToken_1 = nextToken(); - if (currentToken_1 === 145) { + if (currentToken_1 === 146) { currentToken_1 = lookAhead(nextToken); } if (currentToken_1 === 62 || currentToken_1 === 41 || @@ -18839,18 +18939,18 @@ var ts; case 89: return isStartOfDeclaration(); case 126: - case 130: + case 131: case 114: - case 135: case 136: - case 145: - case 150: + case 137: + case 146: + case 151: return true; case 119: case 117: case 118: case 120: - case 138: + case 139: return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); default: return isStartOfExpression(); @@ -18870,16 +18970,16 @@ var ts; case 18: return parseBlock(false); case 109: - return parseVariableStatement(createNodeWithJSDoc(242)); + return parseVariableStatement(createNodeWithJSDoc(243)); case 115: if (isLetDeclaration()) { - return parseVariableStatement(createNodeWithJSDoc(242)); + return parseVariableStatement(createNodeWithJSDoc(243)); } break; case 94: - return parseFunctionDeclaration(createNodeWithJSDoc(244)); + return parseFunctionDeclaration(createNodeWithJSDoc(245)); case 80: - return parseClassDeclaration(createNodeWithJSDoc(245)); + return parseClassDeclaration(createNodeWithJSDoc(246)); case 95: return parseIfStatement(); case 86: @@ -18889,9 +18989,9 @@ var ts; case 93: return parseForOrForInOrForOfStatement(); case 82: - return parseBreakOrContinueStatement(233); - case 77: return parseBreakOrContinueStatement(234); + case 77: + return parseBreakOrContinueStatement(235); case 101: return parseReturnStatement(); case 112: @@ -18910,10 +19010,10 @@ var ts; return parseDeclaration(); case 126: case 114: - case 145: - case 135: + case 146: case 136: - case 130: + case 137: + case 131: case 81: case 88: case 89: @@ -18923,8 +19023,8 @@ var ts; case 119: case 122: case 120: - case 138: - case 150: + case 139: + case 151: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -18933,7 +19033,7 @@ var ts; return parseExpressionOrLabeledStatement(); } function isDeclareModifier(modifier) { - return modifier.kind === 130; + return modifier.kind === 131; } function parseDeclaration() { var modifiers = lookAhead(function () { return (parseDecorators(), parseModifiers()); }); @@ -18978,13 +19078,13 @@ var ts; return parseClassDeclaration(node); case 114: return parseInterfaceDeclaration(node); - case 145: + case 146: return parseTypeAliasDeclaration(node); case 88: return parseEnumDeclaration(node); - case 150: - case 135: + case 151: case 136: + case 137: return parseModuleDeclaration(node); case 96: return parseImportDeclarationOrImportEqualsDeclaration(node); @@ -19001,7 +19101,7 @@ var ts; } default: if (node.decorators || node.modifiers) { - var missing = createMissingNode(264, true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(265, true, ts.Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; @@ -19023,16 +19123,16 @@ var ts; } function parseArrayBindingElement() { if (token() === 27) { - return createNode(215); + return createNode(216); } - var node = createNode(191); + var node = createNode(192); node.dotDotDotToken = parseOptionalToken(25); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(191); + var node = createNode(192); node.dotDotDotToken = parseOptionalToken(25); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -19048,14 +19148,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(189); + var node = createNode(190); parseExpected(18); node.elements = parseDelimitedList(9, parseObjectBindingElement); parseExpected(19); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(190); + var node = createNode(191); parseExpected(22); node.elements = parseDelimitedList(10, parseArrayBindingElement); parseExpected(23); @@ -19080,7 +19180,7 @@ var ts; return parseVariableDeclaration(true); } function parseVariableDeclaration(allowExclamation) { - var node = createNode(242); + var node = createNode(243); node.name = parseIdentifierOrPattern(ts.Diagnostics.Private_identifiers_are_not_allowed_in_variable_declarations); if (allowExclamation && node.name.kind === 75 && token() === 53 && !scanner.hasPrecedingLineBreak()) { @@ -19093,7 +19193,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(243); + var node = createNode(244); switch (token()) { case 109: break; @@ -19107,7 +19207,7 @@ var ts; ts.Debug.fail(); } nextToken(); - if (token() === 152 && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 153 && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -19122,13 +19222,13 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 21; } function parseVariableStatement(node) { - node.kind = 225; + node.kind = 226; node.declarationList = parseVariableDeclarationList(false); parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(node) { - node.kind = 244; + node.kind = 245; parseExpected(94); node.asteriskToken = parseOptionalToken(41); node.name = hasModifierOfKind(node, 84) ? parseOptionalIdentifier() : parseIdentifier(); @@ -19139,8 +19239,8 @@ var ts; return finishNode(node); } function parseConstructorName() { - if (token() === 129) { - return parseExpected(129); + if (token() === 130) { + return parseExpected(130); } if (token() === 10 && lookAhead(nextToken) === 20) { return tryParse(function () { @@ -19152,7 +19252,7 @@ var ts; function tryParseConstructorDeclaration(node) { return tryParse(function () { if (parseConstructorName()) { - node.kind = 162; + node.kind = 163; fillSignature(58, 0, node); node.body = parseFunctionBlockOrSemicolon(0, ts.Diagnostics.or_expected); return finishNode(node); @@ -19160,7 +19260,7 @@ var ts; }); } function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) { - node.kind = 161; + node.kind = 162; node.asteriskToken = asteriskToken; var isGenerator = asteriskToken ? 1 : 0; var isAsync = hasModifierOfKind(node, 126) ? 2 : 0; @@ -19169,7 +19269,7 @@ var ts; return finishNode(node); } function parsePropertyDeclaration(node) { - node.kind = 159; + node.kind = 160; if (!node.questionToken && token() === 53 && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -19217,7 +19317,7 @@ var ts; return true; } if (idToken !== undefined) { - if (!ts.isKeyword(idToken) || idToken === 142 || idToken === 131) { + if (!ts.isKeyword(idToken) || idToken === 143 || idToken === 132) { return true; } switch (token()) { @@ -19242,7 +19342,7 @@ var ts; if (!parseOptional(59)) { break; } - var decorator = createNode(157, decoratorStart); + var decorator = createNode(158, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); (list || (list = [])).push(decorator); @@ -19283,20 +19383,20 @@ var ts; } function parseClassElement() { if (token() === 26) { - var result = createNode(222); + var result = createNode(223); nextToken(); return finishNode(result); } var node = createNodeWithJSDoc(0); node.decorators = parseDecorators(); node.modifiers = parseModifiers(true); - if (parseContextualModifier(131)) { - return parseAccessorDeclaration(node, 163); - } - if (parseContextualModifier(142)) { + if (parseContextualModifier(132)) { return parseAccessorDeclaration(node, 164); } - if (token() === 129 || token() === 10) { + if (parseContextualModifier(143)) { + return parseAccessorDeclaration(node, 165); + } + if (token() === 130 || token() === 10) { var constructorDeclaration = tryParseConstructorDeclaration(node); if (constructorDeclaration) { return constructorDeclaration; @@ -19329,10 +19429,10 @@ var ts; return ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(createNodeWithJSDoc(0), 214); + return parseClassDeclarationOrExpression(createNodeWithJSDoc(0), 215); } function parseClassDeclaration(node) { - return parseClassDeclarationOrExpression(node, 245); + return parseClassDeclarationOrExpression(node, 246); } function parseClassDeclarationOrExpression(node, kind) { node.kind = kind; @@ -19366,14 +19466,14 @@ var ts; function parseHeritageClause() { var tok = token(); ts.Debug.assert(tok === 90 || tok === 113); - var node = createNode(279); + var node = createNode(280); node.token = tok; nextToken(); node.types = parseDelimitedList(7, parseExpressionWithTypeArguments); return finishNode(node); } function parseExpressionWithTypeArguments() { - var node = createNode(216); + var node = createNode(217); node.expression = parseLeftHandSideExpressionOrHigher(); node.typeArguments = tryParseTypeArguments(); return finishNode(node); @@ -19389,7 +19489,7 @@ var ts; return parseList(5, parseClassElement); } function parseInterfaceDeclaration(node) { - node.kind = 246; + node.kind = 247; parseExpected(114); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); @@ -19398,8 +19498,8 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(node) { - node.kind = 247; - parseExpected(145); + node.kind = 248; + parseExpected(146); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(62); @@ -19408,13 +19508,13 @@ var ts; return finishNode(node); } function parseEnumMember() { - var node = createNodeWithJSDoc(284); + var node = createNodeWithJSDoc(285); node.name = parsePropertyName(); node.initializer = allowInAnd(parseInitializer); return finishNode(node); } function parseEnumDeclaration(node) { - node.kind = 248; + node.kind = 249; parseExpected(88); node.name = parseIdentifier(); if (parseExpected(18)) { @@ -19427,7 +19527,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(250); + var node = createNode(251); if (parseExpected(18)) { node.statements = parseList(1, parseStatement); parseExpected(19); @@ -19438,7 +19538,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(node, flags) { - node.kind = 249; + node.kind = 250; var namespaceFlag = flags & 16; node.flags |= flags; node.name = parseIdentifier(); @@ -19448,8 +19548,8 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(node) { - node.kind = 249; - if (token() === 150) { + node.kind = 250; + if (token() === 151) { node.name = parseIdentifier(); node.flags |= 1024; } @@ -19467,14 +19567,14 @@ var ts; } function parseModuleDeclaration(node) { var flags = 0; - if (token() === 150) { + if (token() === 151) { return parseAmbientExternalModuleDeclaration(node); } - else if (parseOptional(136)) { + else if (parseOptional(137)) { flags |= 16; } else { - parseExpected(135); + parseExpected(136); if (token() === 10) { return parseAmbientExternalModuleDeclaration(node); } @@ -19482,7 +19582,7 @@ var ts; return parseModuleOrNamespaceDeclaration(node, flags); } function isExternalModuleReference() { - return token() === 139 && + return token() === 140 && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -19492,9 +19592,9 @@ var ts; return nextToken() === 43; } function parseNamespaceExportDeclaration(node) { - node.kind = 252; + node.kind = 253; parseExpected(123); - parseExpected(136); + parseExpected(137); node.name = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -19507,7 +19607,7 @@ var ts; identifier = parseIdentifier(); } var isTypeOnly = false; - if (token() !== 149 && + if (token() !== 150 && (identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) === "type" && (isIdentifier() || tokenAfterImportDefinitelyProducesImportDeclaration())) { isTypeOnly = true; @@ -19516,12 +19616,12 @@ var ts; if (identifier && !tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration()) { return parseImportEqualsDeclaration(node, identifier, isTypeOnly); } - node.kind = 254; + node.kind = 255; if (identifier || token() === 41 || token() === 18) { node.importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); - parseExpected(149); + parseExpected(150); } node.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -19531,10 +19631,10 @@ var ts; return token() === 41 || token() === 18; } function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { - return token() === 27 || token() === 149; + return token() === 27 || token() === 150; } function parseImportEqualsDeclaration(node, identifier, isTypeOnly) { - node.kind = 253; + node.kind = 254; node.name = identifier; parseExpected(62); node.moduleReference = parseModuleReference(); @@ -19546,14 +19646,14 @@ var ts; return finished; } function parseImportClause(identifier, fullStart, isTypeOnly) { - var importClause = createNode(255, fullStart); + var importClause = createNode(256, fullStart); importClause.isTypeOnly = isTypeOnly; if (identifier) { importClause.name = identifier; } if (!importClause.name || parseOptional(27)) { - importClause.namedBindings = token() === 41 ? parseNamespaceImport() : parseNamedImportsOrExports(257); + importClause.namedBindings = token() === 41 ? parseNamespaceImport() : parseNamedImportsOrExports(258); } return finishNode(importClause); } @@ -19563,8 +19663,8 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(265); - parseExpected(139); + var node = createNode(266); + parseExpected(140); parseExpected(20); node.expression = parseModuleSpecifier(); parseExpected(21); @@ -19581,7 +19681,7 @@ var ts; } } function parseNamespaceImport() { - var namespaceImport = createNode(256); + var namespaceImport = createNode(257); parseExpected(41); parseExpected(123); namespaceImport.name = parseIdentifier(); @@ -19589,14 +19689,14 @@ var ts; } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(23, kind === 257 ? parseImportSpecifier : parseExportSpecifier, 18, 19); + node.elements = parseBracketedList(23, kind === 258 ? parseImportSpecifier : parseExportSpecifier, 18, 19); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(263); + return parseImportOrExportSpecifier(264); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(258); + return parseImportOrExportSpecifier(259); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -19615,31 +19715,31 @@ var ts; else { node.name = identifierName; } - if (kind === 258 && checkIdentifierIsKeyword) { + if (kind === 259 && checkIdentifierIsKeyword) { parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseNamespaceExport(pos) { - var node = createNode(262, pos); + var node = createNode(263, pos); node.name = parseIdentifier(); return finishNode(node); } function parseExportDeclaration(node) { - node.kind = 260; - node.isTypeOnly = parseOptional(145); + node.kind = 261; + node.isTypeOnly = parseOptional(146); var namespaceExportPos = scanner.getStartPos(); if (parseOptional(41)) { if (parseOptional(123)) { node.exportClause = parseNamespaceExport(namespaceExportPos); } - parseExpected(149); + parseExpected(150); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(261); - if (token() === 149 || (token() === 10 && !scanner.hasPrecedingLineBreak())) { - parseExpected(149); + node.exportClause = parseNamedImportsOrExports(262); + if (token() === 150 || (token() === 10 && !scanner.hasPrecedingLineBreak())) { + parseExpected(150); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -19647,7 +19747,7 @@ var ts; return finishNode(node); } function parseExportAssignment(node) { - node.kind = 259; + node.kind = 260; if (parseOptional(62)) { node.isExportEquals = true; } @@ -19665,10 +19765,10 @@ var ts; } function isAnExternalModuleIndicatorNode(node) { return hasModifierOfKind(node, 89) - || node.kind === 253 && node.moduleReference.kind === 265 - || node.kind === 254 - || node.kind === 259 - || node.kind === 260 ? node : undefined; + || node.kind === 254 && node.moduleReference.kind === 266 + || node.kind === 255 + || node.kind === 260 + || node.kind === 261 ? node : undefined; } function getImportMetaIfNecessary(sourceFile) { return sourceFile.flags & 2097152 ? @@ -19698,7 +19798,7 @@ var ts; } JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; function parseJSDocTypeExpression(mayOmitBraces) { - var result = createNode(294); + var result = createNode(295); var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(18); result.type = doInsideOfContext(4194304, parseJSDocType); if (!mayOmitBraces || hasBrace) { @@ -19834,7 +19934,7 @@ var ts; } } function createJSDocComment() { - var result = createNode(303, start); + var result = createNode(304, start); result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd); result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -19903,19 +20003,19 @@ var ts; break; case "class": case "constructor": - tag = parseSimpleTag(start, 310, tagName); + tag = parseSimpleTag(start, 311, tagName); break; case "public": - tag = parseSimpleTag(start, 311, tagName); + tag = parseSimpleTag(start, 312, tagName); break; case "private": - tag = parseSimpleTag(start, 312, tagName); + tag = parseSimpleTag(start, 313, tagName); break; case "protected": - tag = parseSimpleTag(start, 313, tagName); + tag = parseSimpleTag(start, 314, tagName); break; case "readonly": - tag = parseSimpleTag(start, 314, tagName); + tag = parseSimpleTag(start, 315, tagName); break; case "this": tag = parseThisTag(start, tagName); @@ -20041,7 +20141,7 @@ var ts; return comments.length === 0 ? undefined : comments.join(""); } function parseUnknownTag(start, tagName) { - var result = createNode(306, start); + var result = createNode(307, start); result.tagName = tagName; return finishNode(result); } @@ -20083,9 +20183,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 141: + case 142: return true; - case 174: + case 175: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; @@ -20101,8 +20201,8 @@ var ts; typeExpression = tryParseTypeExpression(); } var result = target === 1 ? - createNode(323, start) : - createNode(317, start); + createNode(324, start) : + createNode(318, start); var comment = parseTagComments(indent + scanner.getStartPos() - start); var nestedTypeLiteral = target !== 4 && parseNestedTypeLiteral(typeExpression, name, target, indent); if (nestedTypeLiteral) { @@ -20119,20 +20219,20 @@ var ts; } function parseNestedTypeLiteral(typeExpression, name, target, indent) { if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { - var typeLiteralExpression = createNode(294, scanner.getTokenPos()); + var typeLiteralExpression = createNode(295, scanner.getTokenPos()); var child = void 0; var jsdocTypeLiteral = void 0; var start_3 = scanner.getStartPos(); var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) { - if (child.kind === 317 || child.kind === 323) { + if (child.kind === 318 || child.kind === 324) { children = ts.append(children, child); } } if (children) { - jsdocTypeLiteral = createNode(304, start_3); + jsdocTypeLiteral = createNode(305, start_3); jsdocTypeLiteral.jsDocPropertyTags = children; - if (typeExpression.type.kind === 174) { + if (typeExpression.type.kind === 175) { jsdocTypeLiteral.isArrayType = true; } typeLiteralExpression.type = finishNode(jsdocTypeLiteral); @@ -20144,7 +20244,7 @@ var ts; if (ts.some(tags, ts.isJSDocReturnTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(318, start); + var result = createNode(319, start); result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); @@ -20153,13 +20253,13 @@ var ts; if (ts.some(tags, ts.isJSDocTypeTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(320, start); + var result = createNode(321, start); result.tagName = tagName; result.typeExpression = parseJSDocTypeExpression(true); return finishNode(result); } function parseAuthorTag(start, tagName, indent) { - var result = createNode(309, start); + var result = createNode(310, start); result.tagName = tagName; var authorInfoWithEmail = tryParse(function () { return tryParseAuthorNameAndEmail(); }); if (!authorInfoWithEmail) { @@ -20213,20 +20313,20 @@ var ts; } } function parseImplementsTag(start, tagName) { - var result = createNode(308, start); + var result = createNode(309, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseAugmentsTag(start, tagName) { - var result = createNode(307, start); + var result = createNode(308, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseExpressionWithTypeArgumentsForAugments() { var usedBrace = parseOptional(18); - var node = createNode(216); + var node = createNode(217); node.expression = parsePropertyAccessEntityNameExpression(); node.typeArguments = tryParseTypeArguments(); var res = finishNode(node); @@ -20238,7 +20338,7 @@ var ts; function parsePropertyAccessEntityNameExpression() { var node = parseJSDocIdentifierName(); while (parseOptional(24)) { - var prop = createNode(194, node.pos); + var prop = createNode(195, node.pos); prop.expression = node; prop.name = parseJSDocIdentifierName(); node = finishNode(prop); @@ -20251,14 +20351,14 @@ var ts; return finishNode(tag); } function parseThisTag(start, tagName) { - var tag = createNode(319, start); + var tag = createNode(320, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(true); skipWhitespace(); return finishNode(tag); } function parseEnumTag(start, tagName) { - var tag = createNode(316, start); + var tag = createNode(317, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(true); skipWhitespace(); @@ -20267,7 +20367,7 @@ var ts; function parseTypedefTag(start, tagName, indent) { var typeExpression = tryParseTypeExpression(); skipWhitespaceOrAsterisk(); - var typedefTag = createNode(322, start); + var typedefTag = createNode(323, start); typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(); typedefTag.name = getJSDocTypeAliasName(typedefTag.fullName); @@ -20281,9 +20381,9 @@ var ts; var childTypeTag = void 0; while (child = tryParse(function () { return parseChildPropertyTag(indent); })) { if (!jsdocTypeLiteral) { - jsdocTypeLiteral = createNode(304, start); + jsdocTypeLiteral = createNode(305, start); } - if (child.kind === 320) { + if (child.kind === 321) { if (childTypeTag) { break; } @@ -20296,7 +20396,7 @@ var ts; } } if (jsdocTypeLiteral) { - if (typeExpression && typeExpression.type.kind === 174) { + if (typeExpression && typeExpression.type.kind === 175) { jsdocTypeLiteral.isArrayType = true; } typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? @@ -20314,7 +20414,7 @@ var ts; } var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (parseOptional(24)) { - var jsDocNamespaceNode = createNode(249, pos); + var jsDocNamespaceNode = createNode(250, pos); if (nested) { jsDocNamespaceNode.flags |= 4; } @@ -20328,14 +20428,14 @@ var ts; return typeNameOrNamespaceName; } function parseCallbackTag(start, tagName, indent) { - var callbackTag = createNode(315, start); + var callbackTag = createNode(316, start); callbackTag.tagName = tagName; callbackTag.fullName = parseJSDocTypeNameWithNamespace(); callbackTag.name = getJSDocTypeAliasName(callbackTag.fullName); skipWhitespace(); callbackTag.comment = parseTagComments(indent); var child; - var jsdocSignature = createNode(305, start); + var jsdocSignature = createNode(306, start); jsdocSignature.parameters = []; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(4, indent); })) { jsdocSignature.parameters = ts.append(jsdocSignature.parameters, child); @@ -20343,7 +20443,7 @@ var ts; var returnTag = tryParse(function () { if (parseOptionalJsdoc(59)) { var tag = parseTag(indent); - if (tag && tag.kind === 318) { + if (tag && tag.kind === 319) { return tag; } } @@ -20388,7 +20488,7 @@ var ts; case 59: if (canParseTag) { var child = tryParseChildTag(target, indent); - if (child && (child.kind === 317 || child.kind === 323) && + if (child && (child.kind === 318 || child.kind === 324) && target !== 4 && name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; @@ -20451,13 +20551,13 @@ var ts; var typeParametersPos = getNodePos(); do { skipWhitespace(); - var typeParameter = createNode(155); + var typeParameter = createNode(156); typeParameter.name = parseJSDocIdentifierName(ts.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces); finishNode(typeParameter); skipWhitespaceOrAsterisk(); typeParameters.push(typeParameter); } while (parseOptionalJsdoc(27)); - var result = createNode(321, start); + var result = createNode(322, start); result.tagName = tagName; result.constraint = constraint; result.typeParameters = createNodeArray(typeParameters, typeParametersPos); @@ -21052,7 +21152,9 @@ var ts; ["esnext.symbol", "lib.es2019.symbol.d.ts"], ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"], ["esnext.intl", "lib.esnext.intl.d.ts"], - ["esnext.bigint", "lib.es2020.bigint.d.ts"] + ["esnext.bigint", "lib.es2020.bigint.d.ts"], + ["esnext.string", "lib.esnext.string.d.ts"], + ["esnext.promise", "lib.esnext.promise.d.ts"] ]; ts.libs = libEntries.map(function (entry) { return entry[0]; }); ts.libMap = ts.createMapFromEntries(libEntries); @@ -22463,7 +22565,7 @@ var ts; function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) { var result = returnValue ? {} : undefined; var _loop_3 = function (element) { - if (element.kind !== 281) { + if (element.kind !== 282) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); return "continue"; } @@ -22547,13 +22649,13 @@ var ts; case 8: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 207: + case 208: if (valueExpression.operator !== 40 || valueExpression.operand.kind !== 8) { break; } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 193: + case 194: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; if (option) { @@ -22563,7 +22665,7 @@ var ts; else { return convertObjectLiteralExpressionToJson(objectLiteralExpression, undefined, undefined, undefined); } - case 192: + case 193: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -23538,7 +23640,12 @@ var ts; ts.Debug.assert(ts.extensionIsTS(resolved.extension)); return { fileName: resolved.path, packageId: resolved.packageId }; } - function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations) { + function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, resultFromCache) { + var _a; + if (resultFromCache) { + (_a = resultFromCache.failedLookupLocations).push.apply(_a, failedLookupLocations); + return resultFromCache; + } return { resolvedModule: resolved && { resolvedFileName: resolved.path, originalPath: resolved.originalPath === true ? undefined : resolved.originalPath, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, failedLookupLocations: failedLookupLocations @@ -24104,15 +24211,12 @@ var ts; } ts.nodeModuleNameResolver = nodeModuleNameResolver; function nodeModuleNameResolverWorker(moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference) { + var _a, _b; var traceEnabled = isTraceEnabled(compilerOptions, host); var failedLookupLocations = []; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations }; var result = ts.forEach(extensions, function (ext) { return tryResolve(ext); }); - if (result && result.value) { - var _a = result.value, resolved = _a.resolved, isExternalLibraryImport = _a.isExternalLibraryImport; - return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations); - } - return { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; + return createResolvedModuleWithFailedLookupLocations((_a = result === null || result === void 0 ? void 0 : result.value) === null || _a === void 0 ? void 0 : _a.resolved, (_b = result === null || result === void 0 ? void 0 : result.value) === null || _b === void 0 ? void 0 : _b.isExternalLibraryImport, failedLookupLocations, state.resultFromCache); function tryResolve(extensions) { var loader = function (extensions, candidate, onlyRecordFailures, state) { return nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, true); }; var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, state); @@ -24507,13 +24611,12 @@ var ts; } ts.unmangleScopedPackageName = unmangleScopedPackageName; function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, state) { - var _a; var result = cache && cache.get(containingDirectory); if (result) { if (state.traceEnabled) { trace(state.host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory); } - (_a = state.failedLookupLocations).push.apply(_a, result.failedLookupLocations); + state.resultFromCache = result; return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, originalPath: result.resolvedModule.originalPath || true, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId } }; } } @@ -24523,7 +24626,7 @@ var ts; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations }; var containingDirectory = ts.getDirectoryPath(containingFile); var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); - return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, false, failedLookupLocations); + return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, false, failedLookupLocations, state.resultFromCache); function tryResolve(extensions) { var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state); if (resolvedUsingSettings) { @@ -24561,7 +24664,7 @@ var ts; var failedLookupLocations = []; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations }; var resolved = loadModuleFromImmediateNodeModulesDirectory(Extensions.DtsOnly, moduleName, globalCache, state, false); - return createResolvedModuleWithFailedLookupLocations(resolved, true, failedLookupLocations); + return createResolvedModuleWithFailedLookupLocations(resolved, true, failedLookupLocations, state.resultFromCache); } ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache; function toSearchResult(value) { @@ -24590,23 +24693,23 @@ var ts; } function getModuleInstanceStateWorker(node, visited) { switch (node.kind) { - case 246: case 247: - return 0; case 248: + return 0; + case 249: if (ts.isEnumConst(node)) { return 2; } break; + case 255: case 254: - case 253: if (!(ts.hasModifier(node, 1))) { return 0; } break; - case 260: + case 261: var exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 261) { + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 262) { var state = 0; for (var _i = 0, _a = exportDeclaration.exportClause.elements; _i < _a.length; _i++) { var specifier = _a[_i]; @@ -24621,7 +24724,7 @@ var ts; return state; } break; - case 250: { + case 251: { var state_1 = 0; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateCached(n, visited); @@ -24640,7 +24743,7 @@ var ts; }); return state_1; } - case 249: + case 250: return getModuleInstanceState(node, visited); case 75: if (node.isInJSDocNamespace) { @@ -24804,7 +24907,7 @@ var ts; } } function getDeclarationName(node) { - if (node.kind === 259) { + if (node.kind === 260) { return node.isExportEquals ? "export=" : "default"; } var name = ts.getNameOfDeclaration(node); @@ -24813,7 +24916,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 154) { + if (name.kind === 155) { var nameExpression = name.expression; if (ts.isStringOrNumericLiteralLike(nameExpression)) { return ts.escapeLeadingUnderscores(nameExpression.text); @@ -24838,31 +24941,31 @@ var ts; return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { - case 162: + case 163: return "__constructor"; - case 170: - case 165: - case 305: - return "__call"; case 171: case 166: - return "__new"; + case 306: + return "__call"; + case 172: case 167: + return "__new"; + case 168: return "__index"; - case 260: + case 261: return "__export"; - case 290: + case 291: return "export="; - case 209: + case 210: if (ts.getAssignmentDeclarationKind(node) === 2) { return "export="; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 300: + case 301: return (ts.isJSDocConstructSignature(node) ? "__new" : "__call"); - case 156: - ts.Debug.assert(node.parent.kind === 300, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); + case 157: + ts.Debug.assert(node.parent.kind === 301, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); var functionType = node.parent; var index = functionType.parameters.indexOf(node); return "arg" + index; @@ -24917,7 +25020,7 @@ var ts; } else { if (symbol.declarations && symbol.declarations.length && - (node.kind === 259 && !node.isExportEquals)) { + (node.kind === 260 && !node.isExportEquals)) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName_1 = false; multipleDefaultExports_1 = true; @@ -24955,7 +25058,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1; if (symbolFlags & 2097152) { - if (node.kind === 263 || (node.kind === 253 && hasExportModifier)) { + if (node.kind === 264 || (node.kind === 254 && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -24985,7 +25088,7 @@ var ts; var saveThisParentContainer = thisParentContainer; var savedBlockScopeContainer = blockScopeContainer; if (containerFlags & 1) { - if (node.kind !== 202) { + if (node.kind !== 203) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -25014,7 +25117,7 @@ var ts; currentFlow.node = node; } } - currentReturnTarget = isIIFE || node.kind === 162 ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 163 ? createBranchLabel() : undefined; currentExceptionTarget = undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; @@ -25028,13 +25131,13 @@ var ts; node.flags |= 512; node.endFlowNode = currentFlow; } - if (node.kind === 290) { + if (node.kind === 291) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 162) { + if (node.kind === 163) { node.returnFlowNode = currentFlow; } } @@ -25078,8 +25181,8 @@ var ts; } } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, function (n) { return n.kind === 244 ? bind(n) : undefined; }); - bindEach(nodes, function (n) { return n.kind !== 244 ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind === 245 ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind !== 245 ? bind(n) : undefined; }); } function bindEach(nodes, bindFunction) { if (bindFunction === void 0) { bindFunction = bind; } @@ -25111,89 +25214,89 @@ var ts; bindJSDoc(node); return; } - if (node.kind >= 225 && node.kind <= 241 && !options.allowUnreachableCode) { + if (node.kind >= 226 && node.kind <= 242 && !options.allowUnreachableCode) { node.flowNode = currentFlow; } switch (node.kind) { - case 229: + case 230: bindWhileStatement(node); break; - case 228: + case 229: bindDoStatement(node); break; - case 230: + case 231: bindForStatement(node); break; - case 231: case 232: + case 233: bindForInOrForOfStatement(node); break; - case 227: + case 228: bindIfStatement(node); break; - case 235: - case 239: + case 236: + case 240: bindReturnOrThrow(node); break; + case 235: case 234: - case 233: bindBreakOrContinueStatement(node); break; - case 240: + case 241: bindTryStatement(node); break; - case 237: + case 238: bindSwitchStatement(node); break; - case 251: + case 252: bindCaseBlock(node); break; - case 277: + case 278: bindCaseClause(node); break; - case 226: + case 227: bindExpressionStatement(node); break; - case 238: + case 239: bindLabeledStatement(node); break; - case 207: + case 208: bindPrefixUnaryExpressionFlow(node); break; - case 208: + case 209: bindPostfixUnaryExpressionFlow(node); break; - case 209: + case 210: bindBinaryExpressionFlow(node); break; - case 203: + case 204: bindDeleteExpressionFlow(node); break; - case 210: + case 211: bindConditionalExpressionFlow(node); break; - case 242: + case 243: bindVariableDeclarationFlow(node); break; - case 194: case 195: + case 196: bindAccessExpressionFlow(node); break; - case 196: + case 197: bindCallExpressionFlow(node); break; - case 322: - case 315: + case 323: case 316: + case 317: bindJSDocTypeAlias(node); break; - case 290: { + case 291: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 223: - case 250: + case 224: + case 251: bindEachFunctionsFirst(node.statements); break; default: @@ -25206,18 +25309,18 @@ var ts; switch (expr.kind) { case 75: case 104: - case 194: case 195: - return containsNarrowableReference(expr); case 196: + return containsNarrowableReference(expr); + case 197: return hasNarrowableArgument(expr); - case 200: + case 201: return isNarrowingExpression(expr.expression); - case 209: + case 210: return isNarrowingBinaryExpression(expr); - case 207: + case 208: return expr.operator === 53 && isNarrowingExpression(expr.operand); - case 204: + case 205: return isNarrowingExpression(expr.expression); } return false; @@ -25239,7 +25342,7 @@ var ts; } } } - if (expr.expression.kind === 194 && + if (expr.expression.kind === 195 && containsNarrowableReference(expr.expression.expression)) { return true; } @@ -25272,9 +25375,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 200: + case 201: return isNarrowableOperand(expr.expression); - case 209: + case 210: switch (expr.operatorToken.kind) { case 62: return isNarrowableOperand(expr.left); @@ -25349,26 +25452,26 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 227: - case 229: case 228: - return parent.expression === node; case 230: - case 210: + case 229: + return parent.expression === node; + case 231: + case 211: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 200) { + if (node.kind === 201) { node = node.expression; } - else if (node.kind === 207 && node.operator === 53) { + else if (node.kind === 208 && node.operator === 53) { node = node.operand; } else { - return node.kind === 209 && (node.operatorToken.kind === 55 || + return node.kind === 210 && (node.operatorToken.kind === 55 || node.operatorToken.kind === 56 || node.operatorToken.kind === 60); } @@ -25410,7 +25513,7 @@ var ts; } function setContinueTarget(node, target) { var label = activeLabelList; - while (label && node.parent.kind === 238) { + while (label && node.parent.kind === 239) { label.continueTarget = target; label = label.next; node = node.parent; @@ -25461,12 +25564,12 @@ var ts; bind(node.expression); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 232) { + if (node.kind === 233) { bind(node.awaitModifier); } addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 243) { + if (node.initializer.kind !== 244) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -25488,7 +25591,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 235) { + if (node.kind === 236) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -25505,7 +25608,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 234 ? breakTarget : continueTarget; + var flowLabel = node.kind === 235 ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -25575,7 +25678,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 278; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 279; }); node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents; if (!hasDefault) { addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0)); @@ -25619,7 +25722,7 @@ var ts; } function bindExpressionStatement(node) { bind(node.expression); - if (node.expression.kind === 196) { + if (node.expression.kind === 197) { var call = node.expression; if (ts.isDottedName(call.expression)) { currentFlow = createFlowCall(currentFlow, call); @@ -25645,7 +25748,7 @@ var ts; currentFlow = finishFlowLabel(postStatementLabel); } function bindDestructuringTargetFlow(node) { - if (node.kind === 209 && node.operatorToken.kind === 62) { + if (node.kind === 210 && node.operatorToken.kind === 62) { bindAssignmentTargetFlow(node.left); } else { @@ -25656,10 +25759,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowMutation(16, currentFlow, node); } - else if (node.kind === 192) { + else if (node.kind === 193) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 213) { + if (e.kind === 214) { bindAssignmentTargetFlow(e.expression); } else { @@ -25667,16 +25770,16 @@ var ts; } } } - else if (node.kind === 193) { + else if (node.kind === 194) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 281) { + if (p.kind === 282) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 282) { + else if (p.kind === 283) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 283) { + else if (p.kind === 284) { bindAssignmentTargetFlow(p.expression); } } @@ -25782,7 +25885,7 @@ var ts; var operator = node.operatorToken.kind; if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 62 && node.left.kind === 195) { + if (operator === 62 && node.left.kind === 196) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowMutation(256, currentFlow, node); @@ -25837,7 +25940,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 194) { + if (node.expression.kind === 195) { bindAssignmentTargetFlow(node.expression); } } @@ -25876,14 +25979,14 @@ var ts; } function bindJSDocTypeAlias(node) { node.tagName.parent = node; - if (node.kind !== 316 && node.fullName) { + if (node.kind !== 317 && node.fullName) { setParentPointers(node, node.fullName); } } function bindJSDocClassTag(node) { bindEachChild(node); var host = ts.getHostSignatureFromJSDoc(node); - if (host && host.kind !== 161) { + if (host && host.kind !== 162) { addDeclarationToSymbol(host.symbol, host, 32); } } @@ -25897,13 +26000,13 @@ var ts; function bindOptionalChainRest(node) { bind(node.questionDotToken); switch (node.kind) { - case 194: + case 195: bind(node.name); break; - case 195: + case 196: bind(node.argumentExpression); break; - case 196: + case 197: bindEach(node.typeArguments); bindEach(node.arguments); break; @@ -25945,7 +26048,7 @@ var ts; } else { var expr = ts.skipParentheses(node.expression); - if (expr.kind === 201 || expr.kind === 202) { + if (expr.kind === 202 || expr.kind === 203) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -25954,7 +26057,7 @@ var ts; bindEachChild(node); } } - if (node.expression.kind === 194) { + if (node.expression.kind === 195) { var propertyAccess = node.expression; if (ts.isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowMutation(256, currentFlow, node); @@ -25963,53 +26066,53 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 214: - case 245: - case 248: - case 193: - case 173: - case 304: - case 274: - return 1; + case 215: case 246: - return 1 | 64; case 249: + case 194: + case 174: + case 305: + case 275: + return 1; case 247: - case 186: + return 1 | 64; + case 250: + case 248: + case 187: return 1 | 32; - case 290: + case 291: return 1 | 4 | 32; - case 161: + case 162: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 | 4 | 32 | 8 | 128; } - case 162: - case 244: - case 160: case 163: + case 245: + case 161: case 164: case 165: - case 305: - case 300: - case 170: case 166: - case 167: + case 306: + case 301: case 171: + case 167: + case 168: + case 172: return 1 | 4 | 32 | 8; - case 201: case 202: + case 203: return 1 | 4 | 32 | 8 | 16; - case 250: + case 251: return 4; - case 159: + case 160: return node.initializer ? 4 : 0; - case 280: - case 230: + case 281: case 231: case 232: - case 251: + case 233: + case 252: return 2; - case 223: + case 224: return ts.isFunctionLike(node.parent) ? 0 : 2; } return 0; @@ -26022,40 +26125,40 @@ var ts; } function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) { switch (container.kind) { - case 249: + case 250: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 290: + case 291: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 214: - case 245: + case 215: + case 246: return declareClassMember(node, symbolFlags, symbolExcludes); - case 248: + case 249: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 173: - case 304: - case 193: - case 246: - case 274: + case 174: + case 305: + case 194: + case 247: + case 275: return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 170: case 171: - case 165: + case 172: case 166: - case 305: case 167: - case 161: - case 160: + case 306: + case 168: case 162: + case 161: case 163: case 164: - case 244: - case 201: + case 165: + case 245: case 202: - case 300: - case 322: - case 315: - case 247: - case 186: + case 203: + case 301: + case 323: + case 316: + case 248: + case 187: return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); } } @@ -26134,11 +26237,11 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 283 || prop.name.kind !== 75) { + if (prop.kind === 284 || prop.name.kind !== 75) { continue; } var identifier = prop.name; - var currentKind = prop.kind === 281 || prop.kind === 282 || prop.kind === 161 + var currentKind = prop.kind === 282 || prop.kind === 283 || prop.kind === 162 ? 1 : 2; var existingKind = seen.get(identifier.escapedText); @@ -26170,10 +26273,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 249: + case 250: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 290: + case 291: if (ts.isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -26334,8 +26437,8 @@ var ts; } function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2) { - if (blockScopeContainer.kind !== 290 && - blockScopeContainer.kind !== 249 && + if (blockScopeContainer.kind !== 291 && + blockScopeContainer.kind !== 250 && !ts.isFunctionLike(blockScopeContainer)) { var errorSpan = ts.getErrorSpanForNode(file, node); file.bindDiagnostics.push(ts.createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node))); @@ -26397,7 +26500,7 @@ var ts; node.parent = parent; var saveInStrictMode = inStrictMode; bindWorker(node); - if (node.kind > 152) { + if (node.kind > 153) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -26465,14 +26568,14 @@ var ts; break; } case 104: - if (currentFlow && (ts.isExpression(node) || parent.kind === 282)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 283)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); case 76: return checkPrivateIdentifier(node); - case 194: case 195: + case 196: var expr = node; if (currentFlow && isNarrowableReference(expr)) { expr.flowNode = currentFlow; @@ -26487,7 +26590,7 @@ var ts; declareSymbol(file.locals, undefined, expr.expression, 1 | 134217728, 111550); } break; - case 209: + case 210: var specialKind = ts.getAssignmentDeclarationKind(node); switch (specialKind) { case 1: @@ -26514,74 +26617,74 @@ var ts; ts.Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 280: + case 281: return checkStrictModeCatchClause(node); - case 203: + case 204: return checkStrictModeDeleteExpression(node); case 8: return checkStrictModeNumericLiteral(node); - case 208: + case 209: return checkStrictModePostfixUnaryExpression(node); - case 207: + case 208: return checkStrictModePrefixUnaryExpression(node); - case 236: + case 237: return checkStrictModeWithStatement(node); - case 238: + case 239: return checkStrictModeLabeledStatement(node); - case 183: + case 184: seenThisKeyword = true; return; - case 168: + case 169: break; - case 155: - return bindTypeParameter(node); case 156: + return bindTypeParameter(node); + case 157: return bindParameter(node); - case 242: + case 243: return bindVariableDeclarationOrBindingElement(node); - case 191: + case 192: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); + case 160: case 159: - case 158: return bindPropertyWorker(node); - case 281: case 282: + case 283: return bindPropertyOrMethodOrAccessor(node, 4, 0); - case 284: + case 285: return bindPropertyOrMethodOrAccessor(node, 8, 900095); - case 165: case 166: case 167: + case 168: return declareSymbolAndAddToSymbolTable(node, 131072, 0); + case 162: case 161: - case 160: return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 16777216 : 0), ts.isObjectLiteralMethod(node) ? 0 : 103359); - case 244: + case 245: return bindFunctionDeclaration(node); - case 162: - return declareSymbolAndAddToSymbolTable(node, 16384, 0); case 163: - return bindPropertyOrMethodOrAccessor(node, 32768, 46015); + return declareSymbolAndAddToSymbolTable(node, 16384, 0); case 164: + return bindPropertyOrMethodOrAccessor(node, 32768, 46015); + case 165: return bindPropertyOrMethodOrAccessor(node, 65536, 78783); - case 170: - case 300: - case 305: case 171: + case 301: + case 306: + case 172: return bindFunctionOrConstructorType(node); - case 173: - case 304: - case 186: + case 174: + case 305: + case 187: return bindAnonymousTypeWorker(node); - case 310: + case 311: return bindJSDocClassTag(node); - case 193: + case 194: return bindObjectLiteralExpression(node); - case 201: case 202: + case 203: return bindFunctionExpression(node); - case 196: + case 197: var assignmentKind = ts.getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7: @@ -26599,60 +26702,60 @@ var ts; bindCallExpression(node); } break; - case 214: - case 245: + case 215: + case 246: inStrictMode = true; return bindClassLikeDeclaration(node); - case 246: - return bindBlockScopedDeclaration(node, 64, 788872); case 247: - return bindBlockScopedDeclaration(node, 524288, 788968); + return bindBlockScopedDeclaration(node, 64, 788872); case 248: - return bindEnumDeclaration(node); + return bindBlockScopedDeclaration(node, 524288, 788968); case 249: + return bindEnumDeclaration(node); + case 250: return bindModuleDeclaration(node); - case 274: + case 275: return bindJsxAttributes(node); - case 273: + case 274: return bindJsxAttribute(node, 4, 0); - case 253: - case 256: - case 258: - case 263: + case 254: + case 257: + case 259: + case 264: return declareSymbolAndAddToSymbolTable(node, 2097152, 2097152); - case 252: + case 253: return bindNamespaceExportDeclaration(node); - case 255: + case 256: return bindImportClause(node); - case 260: + case 261: return bindExportDeclaration(node); - case 259: + case 260: return bindExportAssignment(node); - case 290: + case 291: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 223: + case 224: if (!ts.isFunctionLike(node.parent)) { return; } - case 250: + case 251: return updateStrictModeStatementList(node.statements); - case 317: - if (node.parent.kind === 305) { + case 318: + if (node.parent.kind === 306) { return bindParameter(node); } - if (node.parent.kind !== 304) { + if (node.parent.kind !== 305) { break; } - case 323: + case 324: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 299 ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 300 ? 4 | 16777216 : 4; return declareSymbolAndAddToSymbolTable(propTag, flags, 0); - case 322: - case 315: + case 323: case 316: + case 317: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); } } @@ -26789,8 +26892,8 @@ var ts; } var thisContainer = ts.getThisContainer(node, false); switch (thisContainer.kind) { - case 244: - case 201: + case 245: + case 202: var constructorSymbol = thisContainer.symbol; if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 62) { var l = thisContainer.parent.left; @@ -26809,11 +26912,11 @@ var ts; addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32); } break; - case 162: - case 159: - case 161: case 163: + case 160: + case 162: case 164: + case 165: var containingClass = thisContainer.parent; var symbolTable = ts.hasModifier(thisContainer, 32) ? containingClass.symbol.exports : containingClass.symbol.members; if (ts.hasDynamicName(node)) { @@ -26823,7 +26926,7 @@ var ts; declareSymbol(symbolTable, containingClass.symbol, node, 4 | 67108864, 0, true); } break; - case 290: + case 291: if (ts.hasDynamicName(node)) { break; } @@ -26852,7 +26955,7 @@ var ts; if (node.expression.kind === 104) { bindThisPropertyAssignment(node); } - else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 290) { + else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 291) { if (ts.isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } @@ -26883,7 +26986,7 @@ var ts; } function bindObjectDefinePropertyAssignment(node) { var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - var isToplevel = node.parent.parent.kind === 290; + var isToplevel = node.parent.parent.kind === 291; namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, false, false); bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, false); } @@ -26970,8 +27073,8 @@ var ts; } function isTopLevelNamespaceAssignment(propertyAccess) { return ts.isBinaryExpression(propertyAccess.parent) - ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 290 - : propertyAccess.parent.parent.kind === 290; + ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 291 + : propertyAccess.parent.parent.kind === 291; } function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { var namespaceSymbol = lookupSymbolForPropertyAccess(name); @@ -27037,7 +27140,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 245) { + if (node.kind === 246) { bindBlockScopedDeclaration(node, 32, 899503); } else { @@ -27081,7 +27184,7 @@ var ts; } } function bindParameter(node) { - if (node.kind === 317 && container.kind !== 305) { + if (node.kind === 318 && container.kind !== 306) { return; } if (inStrictMode && !(node.flags & 8388608)) { @@ -27154,7 +27257,7 @@ var ts; declareSymbolAndAddToSymbolTable(node, 262144, 526824); } } - else if (node.parent.kind === 181) { + else if (node.parent.kind === 182) { var container_2 = getInferTypeContainer(node.parent); if (container_2) { if (!container_2.locals) { @@ -27179,9 +27282,9 @@ var ts; return false; } if (currentFlow === unreachableFlow) { - var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 224) || - node.kind === 245 || - (node.kind === 249 && shouldReportErrorOnModuleDeclaration(node)); + var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 225) || + node.kind === 246 || + (node.kind === 250 && shouldReportErrorOnModuleDeclaration(node)); if (reportError) { currentFlow = reportedUnreachableFlow; if (!options.allowUnreachableCode) { @@ -27213,12 +27316,12 @@ var ts; } function isPurelyTypeDeclaration(s) { switch (s.kind) { - case 246: case 247: + case 248: return true; - case 249: + case 250: return getModuleInstanceState(s) !== 1; - case 248: + case 249: return ts.hasModifier(s, 2048); default: return false; @@ -27261,58 +27364,58 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 196: - return computeCallExpression(node, subtreeFlags); case 197: + return computeCallExpression(node, subtreeFlags); + case 198: return computeNewExpression(node, subtreeFlags); - case 249: + case 250: return computeModuleDeclaration(node, subtreeFlags); - case 200: + case 201: return computeParenthesizedExpression(node, subtreeFlags); - case 209: + case 210: return computeBinaryExpression(node, subtreeFlags); - case 226: + case 227: return computeExpressionStatement(node, subtreeFlags); - case 156: + case 157: return computeParameter(node, subtreeFlags); - case 202: + case 203: return computeArrowFunction(node, subtreeFlags); - case 201: + case 202: return computeFunctionExpression(node, subtreeFlags); - case 244: + case 245: return computeFunctionDeclaration(node, subtreeFlags); - case 242: - return computeVariableDeclaration(node, subtreeFlags); case 243: + return computeVariableDeclaration(node, subtreeFlags); + case 244: return computeVariableDeclarationList(node, subtreeFlags); - case 225: + case 226: return computeVariableStatement(node, subtreeFlags); - case 238: + case 239: return computeLabeledStatement(node, subtreeFlags); - case 245: + case 246: return computeClassDeclaration(node, subtreeFlags); - case 214: + case 215: return computeClassExpression(node, subtreeFlags); - case 279: - return computeHeritageClause(node, subtreeFlags); case 280: + return computeHeritageClause(node, subtreeFlags); + case 281: return computeCatchClause(node, subtreeFlags); - case 216: + case 217: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 162: + case 163: return computeConstructor(node, subtreeFlags); - case 159: + case 160: return computePropertyDeclaration(node, subtreeFlags); - case 161: + case 162: return computeMethod(node, subtreeFlags); - case 163: case 164: + case 165: return computeAccessor(node, subtreeFlags); - case 253: + case 254: return computeImportEquals(node, subtreeFlags); - case 194: - return computePropertyAccess(node, subtreeFlags); case 195: + return computePropertyAccess(node, subtreeFlags); + case 196: return computeElementAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); @@ -27359,10 +27462,10 @@ var ts; if (operatorTokenKind === 60) { transformFlags |= 8; } - else if (operatorTokenKind === 62 && leftKind === 193) { + else if (operatorTokenKind === 62 && leftKind === 194) { transformFlags |= 32 | 256 | 1024; } - else if (operatorTokenKind === 62 && leftKind === 192) { + else if (operatorTokenKind === 62 && leftKind === 193) { transformFlags |= 256 | 1024; } else if (operatorTokenKind === 42 @@ -27399,8 +27502,8 @@ var ts; var transformFlags = subtreeFlags; var expression = node.expression; var expressionKind = expression.kind; - if (expressionKind === 217 - || expressionKind === 199) { + if (expressionKind === 218 + || expressionKind === 200) { transformFlags |= 1; } node.transformFlags = transformFlags | 536870912; @@ -27684,12 +27787,12 @@ var ts; case 126: transformFlags |= 32 | 64; break; - case 206: + case 207: transformFlags |= 32 | 64 | 524288; break; - case 199: - case 217: - case 326: + case 200: + case 218: + case 327: transformFlags |= 1; excludeFlags = 536870912; break; @@ -27697,19 +27800,18 @@ var ts; case 117: case 118: case 122: - case 130: + case 131: case 81: - case 248: - case 284: - case 218: - case 138: + case 249: + case 285: + case 219: + case 139: transformFlags |= 1; break; - case 266: case 267: case 268: - case 11: case 269: + case 11: case 270: case 271: case 272: @@ -27717,6 +27819,7 @@ var ts; case 274: case 275: case 276: + case 277: transformFlags |= 2; break; case 14: @@ -27727,15 +27830,15 @@ var ts; transformFlags |= 32; break; } - case 198: + case 199: if (ts.hasInvalidEscape(node.template)) { transformFlags |= 32; break; } - case 211: - case 282: + case 212: + case 283: case 120: - case 219: + case 220: transformFlags |= 256; break; case 10: @@ -27751,28 +27854,27 @@ var ts; case 9: transformFlags |= 4; break; - case 232: + case 233: if (node.awaitModifier) { transformFlags |= 32; } transformFlags |= 256; break; - case 212: + case 213: transformFlags |= 32 | 256 | 262144; break; case 125: - case 140: - case 151: - case 137: case 141: - case 143: - case 128: + case 152: + case 138: + case 142: case 144: + case 129: + case 145: case 110: - case 155: - case 158: - case 160: - case 165: + case 156: + case 159: + case 161: case 166: case 167: case 168: @@ -27790,24 +27892,25 @@ var ts; case 180: case 181: case 182: - case 246: - case 247: case 183: + case 247: + case 248: case 184: case 185: case 186: case 187: - case 252: + case 188: + case 253: transformFlags = 1; excludeFlags = -2; break; - case 154: + case 155: transformFlags |= 32768; break; - case 213: + case 214: transformFlags |= 256 | 8192; break; - case 283: + case 284: transformFlags |= 32 | 16384; break; case 102: @@ -27817,27 +27920,27 @@ var ts; case 104: transformFlags |= 4096; break; - case 189: + case 190: transformFlags |= 256 | 131072; if (subtreeFlags & 8192) { transformFlags |= 32 | 16384; } excludeFlags = 536879104; break; - case 190: + case 191: transformFlags |= 256 | 131072; excludeFlags = 536879104; break; - case 191: + case 192: transformFlags |= 256; if (node.dotDotDotToken) { transformFlags |= 8192; } break; - case 157: + case 158: transformFlags |= 1 | 2048; break; - case 193: + case 194: excludeFlags = 536922112; if (subtreeFlags & 32768) { transformFlags |= 256; @@ -27846,27 +27949,27 @@ var ts; transformFlags |= 32; } break; - case 192: + case 193: excludeFlags = 536879104; break; - case 228: case 229: case 230: case 231: + case 232: if (subtreeFlags & 65536) { transformFlags |= 256; } break; - case 290: + case 291: break; - case 262: + case 263: transformFlags |= 4; break; - case 235: + case 236: transformFlags |= 1048576 | 32; break; - case 233: case 234: + case 235: transformFlags |= 1048576; break; case 76: @@ -27880,67 +27983,67 @@ var ts; return transformFlags | (node.transformFlags & 4096); } function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 168 && kind <= 188) { + if (kind >= 169 && kind <= 189) { return -2; } switch (kind) { - case 196: case 197: - case 192: + case 198: + case 193: return 536879104; - case 249: + case 250: return 537991168; - case 156: + case 157: return 536870912; - case 202: + case 203: return 538920960; - case 201: - case 244: + case 202: + case 245: return 538925056; - case 243: + case 244: return 537018368; - case 245: - case 214: + case 246: + case 215: return 536905728; - case 162: - return 538923008; - case 161: case 163: + return 538923008; + case 162: case 164: + case 165: return 538923008; case 125: - case 140: - case 151: - case 137: - case 143: case 141: - case 128: + case 152: + case 138: case 144: + case 142: + case 129: + case 145: case 110: - case 155: - case 158: - case 160: - case 165: + case 156: + case 159: + case 161: case 166: case 167: - case 246: + case 168: case 247: + case 248: return -2; - case 193: + case 194: return 536922112; - case 280: + case 281: return 536887296; - case 189: case 190: + case 191: return 536879104; - case 199: - case 217: - case 326: case 200: + case 218: + case 327: + case 201: case 102: return 536870912; - case 194: case 195: + case 196: return 536870912; default: return 536870912; @@ -28102,7 +28205,7 @@ var ts; symbol.exports.forEach(visitSymbol); } ts.forEach(symbol.declarations, function (d) { - if (d.type && d.type.kind === 172) { + if (d.type && d.type.kind === 173) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -28143,6 +28246,11 @@ var ts; function: 16384 }); var isNotOverloadAndNotAccessor = ts.and(isNotOverload, isNotAccessor); + function SymbolLinks() { + } + function NodeLinks() { + this.flags = 0; + } function getNodeId(node) { if (!node.id) { node.id = nextNodeId; @@ -28193,7 +28301,6 @@ var ts; var constraintDepth = 0; var currentNode; var emptySymbols = ts.createSymbolTable(); - var identityMapper = ts.identity; var arrayVariances = [1]; var compilerOptions = host.getCompilerOptions(); var languageVersion = ts.getEmitScriptTarget(compilerOptions); @@ -28530,6 +28637,7 @@ var ts; var literalTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); var substitutionTypes = ts.createMap(); + var awaitedTypes = ts.createMap(); var evolvingArrayTypes = []; var undefinedProperties = ts.createMap(); var unknownSymbol = createSymbol(4, "unknown"); @@ -28575,6 +28683,8 @@ var ts; var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); var keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; var numberOrBigIntType = getUnionType([numberType, bigintType]); + var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 ? getRestrictiveTypeParameter(t) : t; }); + var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 ? wildcardType : t; }); var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var emptyJsxObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); emptyJsxObjectType.objectFlags |= 4096; @@ -29044,14 +29154,14 @@ var ts; if (symbol.flags & 33554432) return symbol; var id = getSymbolId(symbol); - return symbolLinks[id] || (symbolLinks[id] = {}); + return symbolLinks[id] || (symbolLinks[id] = new SymbolLinks()); } function getNodeLinks(node) { var nodeId = getNodeId(node); - return nodeLinks[nodeId] || (nodeLinks[nodeId] = { flags: 0 }); + return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); } function isGlobalSourceFile(node) { - return node.kind === 290 && !ts.isExternalOrCommonJsModule(node); + return node.kind === 291 && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -29097,15 +29207,15 @@ var ts; return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile); } if (declaration.pos <= usage.pos) { - if (declaration.kind === 191) { - var errorBindingElement = ts.getAncestor(usage, 191); + if (declaration.kind === 192) { + var errorBindingElement = ts.getAncestor(usage, 192); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 242), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 243), usage); } - else if (declaration.kind === 242) { + else if (declaration.kind === 243) { return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } else if (ts.isClassDeclaration(declaration)) { @@ -29122,10 +29232,10 @@ var ts; } return true; } - if (usage.parent.kind === 263 || (usage.parent.kind === 259 && usage.parent.isExportEquals)) { + if (usage.parent.kind === 264 || (usage.parent.kind === 260 && usage.parent.isExportEquals)) { return true; } - if (usage.kind === 259 && usage.isExportEquals) { + if (usage.kind === 260 && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -29145,9 +29255,9 @@ var ts; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 225: - case 230: - case 232: + case 226: + case 231: + case 233: if (isSameScopeDescendentOf(usage, declaration, container)) { return true; } @@ -29165,16 +29275,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 159 && + current.parent.kind === 160 && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasModifier(current.parent, 32)) { - if (declaration.kind === 161) { + if (declaration.kind === 162) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 159 && !ts.hasModifier(declaration, 32); + var isDeclarationInstanceProperty = declaration.kind === 160 && !ts.hasModifier(declaration, 32); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -29192,18 +29302,18 @@ var ts; return "quit"; } switch (node.kind) { - case 202: + case 203: return true; - case 159: + case 160: return stopAtAnyPropertyDeclaration && (ts.isPropertyDeclaration(declaration) && node.parent === declaration.parent || ts.isParameterPropertyDeclaration(declaration, declaration.parent) && node.parent === declaration.parent.parent) ? "quit" : true; - case 223: + case 224: switch (node.parent.kind) { - case 163: - case 161: case 164: + case 162: + case 165: return true; default: return false; @@ -29235,11 +29345,11 @@ var ts; if (result = lookup(location.locals, name, meaning)) { var useResult = true; if (ts.isFunctionLike(location) && lastLocation && lastLocation !== location.body) { - if (meaning & result.flags & 788968 && lastLocation.kind !== 303) { + if (meaning & result.flags & 788968 && lastLocation.kind !== 304) { useResult = result.flags & 262144 ? lastLocation === location.type || - lastLocation.kind === 156 || - lastLocation.kind === 155 + lastLocation.kind === 157 || + lastLocation.kind === 156 : false; } if (meaning & result.flags & 3) { @@ -29250,13 +29360,13 @@ var ts; } else if (result.flags & 1) { useResult = - lastLocation.kind === 156 || + lastLocation.kind === 157 || (lastLocation === location.type && !!ts.findAncestor(result.valueDeclaration, ts.isParameter)); } } } - else if (location.kind === 180) { + else if (location.kind === 181) { useResult = lastLocation === location.trueType; } if (useResult) { @@ -29269,13 +29379,13 @@ var ts; } withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 290: + case 291: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; - case 249: + case 250: var moduleExports = getSymbolOfNode(location).exports || emptySymbols; - if (location.kind === 290 || (ts.isModuleDeclaration(location) && location.flags & 8388608 && !ts.isGlobalScopeAugmentation(location))) { + if (location.kind === 291 || (ts.isModuleDeclaration(location) && location.flags & 8388608 && !ts.isGlobalScopeAugmentation(location))) { if (result = moduleExports.get("default")) { var localSymbol = ts.getLocalSymbolForExportDefault(result); if (localSymbol && (result.flags & meaning) && localSymbol.escapedName === name) { @@ -29286,7 +29396,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 && - (ts.getDeclarationOfKind(moduleExport, 263) || ts.getDeclarationOfKind(moduleExport, 262))) { + (ts.getDeclarationOfKind(moduleExport, 264) || ts.getDeclarationOfKind(moduleExport, 263))) { break; } } @@ -29299,12 +29409,12 @@ var ts; } } break; - case 248: + case 249: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8)) { break loop; } break; - case 159: + case 160: if (!ts.hasModifier(location, 32)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { @@ -29314,9 +29424,9 @@ var ts; } } break; - case 245: - case 214: case 246: + case 215: + case 247: if (result = lookup(getSymbolOfNode(location).members || emptySymbols, name, meaning & 788968)) { if (!isTypeParameterSymbolDeclaredInContainer(result, location)) { result = undefined; @@ -29328,7 +29438,7 @@ var ts; } break loop; } - if (location.kind === 214 && meaning & 32) { + if (location.kind === 215 && meaning & 32) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -29336,7 +29446,7 @@ var ts; } } break; - case 216: + case 217: if (lastLocation === location.expression && location.parent.token === 90) { var container = location.parent.parent; if (ts.isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 788968))) { @@ -29347,30 +29457,30 @@ var ts; } } break; - case 154: + case 155: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 246) { + if (ts.isClassLike(grandparent) || grandparent.kind === 247) { if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); return undefined; } } break; - case 202: + case 203: if (compilerOptions.target >= 2) { break; } - case 161: case 162: case 163: case 164: - case 244: + case 165: + case 245: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 201: + case 202: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; @@ -29383,28 +29493,28 @@ var ts; } } break; - case 157: - if (location.parent && location.parent.kind === 156) { + case 158: + if (location.parent && location.parent.kind === 157) { location = location.parent; } - if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 245)) { + if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 246)) { location = location.parent; } break; - case 322: - case 315: + case 323: case 316: + case 317: location = ts.getJSDocHost(location); break; - case 156: + case 157: if (lastLocation && lastLocation === location.initializer) { associatedDeclarationForContainingInitializer = location; } break; - case 191: + case 192: if (lastLocation && lastLocation === location.initializer) { var root = ts.getRootDeclaration(location); - if (root.kind === 156) { + if (root.kind === 157) { associatedDeclarationForContainingInitializer = location; } } @@ -29421,7 +29531,7 @@ var ts; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 290); + ts.Debug.assert(lastLocation.kind === 291); if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) { return lastLocation.symbol; } @@ -29519,9 +29629,9 @@ var ts; } } function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 202 && location.kind !== 201) { + if (location.kind !== 203 && location.kind !== 202) { return ts.isTypeQueryNode(location) || ((ts.isFunctionLikeDeclaration(location) || - (location.kind === 159 && !ts.hasModifier(location, 32))) && (!lastLocation || lastLocation !== location.name)); + (location.kind === 160 && !ts.hasModifier(location, 32))) && (!lastLocation || lastLocation !== location.name)); } if (lastLocation && lastLocation === location.name) { return false; @@ -29533,12 +29643,12 @@ var ts; } function isSelfReferenceLocation(node) { switch (node.kind) { - case 244: case 245: case 246: - case 248: case 247: case 249: + case 248: + case 250: return true; default: return false; @@ -29550,7 +29660,7 @@ var ts; function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 155) { + if (decl.kind === 156) { var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent; if (parent === container) { return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias)); @@ -29599,9 +29709,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 75: - case 194: + case 195: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 216: + case 217: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -29634,7 +29744,7 @@ var ts; if (meaning & (788968 & ~1920)) { var symbol = resolveSymbol(resolveName(errorLocation, name, ~788968 & 111551, undefined, undefined, false)); if (symbol && !(symbol.flags & 1920)) { - error(errorLocation, ts.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here, ts.unescapeLeadingUnderscores(name)); + error(errorLocation, ts.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0, ts.unescapeLeadingUnderscores(name)); return true; } } @@ -29644,7 +29754,7 @@ var ts; return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; } function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 263) { + if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 264) { error(errorLocation, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); return true; } @@ -29701,7 +29811,7 @@ var ts; if (result.flags & (16 | 1 | 67108864) && result.flags & 32) { return; } - var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 248); }); + var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 249); }); if (declaration === undefined) return ts.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); if (!(declaration.flags & 8388608) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { @@ -29732,13 +29842,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 253: + case 254: return node; - case 255: - return node.parent; case 256: + return node.parent; + case 257: return node.parent.parent; - case 258: + case 259: return node.parent.parent.parent; default: return undefined; @@ -29748,28 +29858,28 @@ var ts; return ts.find(symbol.declarations, isAliasSymbolDeclaration); } function isAliasSymbolDeclaration(node) { - return node.kind === 253 || - node.kind === 252 || - node.kind === 255 && !!node.name || - node.kind === 256 || - node.kind === 262 || - node.kind === 258 || + return node.kind === 254 || + node.kind === 253 || + node.kind === 256 && !!node.name || + node.kind === 257 || node.kind === 263 || - node.kind === 259 && ts.exportAssignmentIsAlias(node) || + node.kind === 259 || + node.kind === 264 || + node.kind === 260 && ts.exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 && ts.exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 && isAliasableOrJsExpression(node.parent.right) || - node.kind === 282 || - node.kind === 281 && isAliasableOrJsExpression(node.initializer); + node.kind === 283 || + node.kind === 282 && isAliasableOrJsExpression(node.initializer); } function isAliasableOrJsExpression(e) { return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - if (node.moduleReference.kind === 265) { + if (node.moduleReference.kind === 266) { var immediate = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var resolved_4 = resolveExternalModuleSymbol(immediate); markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved_4, false); @@ -30036,28 +30146,28 @@ var ts; function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; } switch (node.kind) { - case 253: + case 254: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 255: - return getTargetOfImportClause(node, dontRecursivelyResolve); case 256: + return getTargetOfImportClause(node, dontRecursivelyResolve); + case 257: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 262: + case 263: return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 258: + case 259: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 263: + case 264: return getTargetOfExportSpecifier(node, 111551 | 788968 | 1920, dontRecursivelyResolve); - case 259: - case 209: + case 260: + case 210: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 252: + case 253: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 282: + case 283: return resolveEntityName(node.name, 111551 | 788968 | 1920, true, dontRecursivelyResolve); - case 281: + case 282: return getTargetOfPropertyAssignment(node, dontRecursivelyResolve); - case 194: + case 195: return getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve); default: return ts.Debug.fail(); @@ -30093,6 +30203,13 @@ var ts; } return links.target; } + function tryResolveAlias(symbol) { + var links = getSymbolLinks(symbol); + if (links.target !== resolvingSymbol) { + return resolveAlias(symbol); + } + return undefined; + } function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty) { if (!aliasDeclaration) return false; @@ -30158,11 +30275,11 @@ var ts; if (entityName.kind === 75 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 75 || entityName.parent.kind === 153) { + if (entityName.kind === 75 || entityName.parent.kind === 154) { return resolveEntityName(entityName, 1920, false, dontResolveAlias); } else { - ts.Debug.assert(entityName.parent.kind === 253); + ts.Debug.assert(entityName.parent.kind === 254); return resolveEntityName(entityName, 111551 | 788968 | 1920, false, dontResolveAlias); } } @@ -30183,9 +30300,9 @@ var ts; return symbolFromJSPrototype; } } - else if (name.kind === 153 || name.kind === 194) { - var left = name.kind === 153 ? name.left : name.expression; - var right = name.kind === 153 ? name.right : name.name; + else if (name.kind === 154 || name.kind === 195) { + var left = name.kind === 154 ? name.left : name.expression; + var right = name.kind === 154 ? name.right : name.name; var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -30220,7 +30337,7 @@ var ts; throw ts.Debug.assertNever(name, "Unknown entity name kind."); } ts.Debug.assert((ts.getCheckFlags(symbol) & 1) === 0, "Should never get an instantiated symbol here."); - if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 || name.parent.kind === 259)) { + if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 || name.parent.kind === 260)) { markSymbolOfAliasDeclarationIfTypeOnly(ts.getAliasDeclarationFromName(name), symbol, undefined, true); } return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); @@ -30285,7 +30402,7 @@ var ts; } } function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) { - return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : ts.Diagnostics.Cannot_find_module_0); + return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : ts.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations); } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } @@ -30414,7 +30531,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 | 3)) && !ts.getDeclarationOfKind(symbol, 290)) { + if (!suppressInteropError && !(symbol.flags & (1536 | 3)) && !ts.getDeclarationOfKind(symbol, 291)) { var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; @@ -30678,7 +30795,7 @@ var ts; var members = node.members; for (var _i = 0, members_3 = members; _i < members_3.length; _i++) { var member = members_3[_i]; - if (member.kind === 162 && ts.nodeIsPresent(member.body)) { + if (member.kind === 163 && ts.nodeIsPresent(member.body)) { return member; } } @@ -30760,19 +30877,19 @@ var ts; } } switch (location.kind) { - case 290: + case 291: if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 249: + case 250: var sym = getSymbolOfNode(location); if (result = callback((sym === null || sym === void 0 ? void 0 : sym.exports) || emptySymbols)) { return { value: result }; } break; - case 245: - case 214: case 246: + case 215: + case 247: var table_1; (getSymbolOfNode(location).members || emptySymbols).forEach(function (memberSymbol, key) { if (memberSymbol.flags & (788968 & ~67108864)) { @@ -30833,7 +30950,7 @@ var ts; && symbolFromSymbolTable.escapedName !== "default" && !(ts.isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(ts.getSourceFileOfNode(enclosingDeclaration))) && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) - && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 263))) { + && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 264))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); var candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); if (candidate) { @@ -30869,7 +30986,7 @@ var ts; if (symbolFromSymbolTable === symbol) { return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 263)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 264)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -30883,10 +31000,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 159: - case 161: - case 163: + case 160: + case 162: case 164: + case 165: continue; default: return false; @@ -30984,10 +31101,10 @@ var ts; return node && getSymbolOfNode(node); } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 290 && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 291 && ts.isExternalOrCommonJsModule(declaration)); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 290 && ts.isExternalOrCommonJsModule(declaration)); + return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 291 && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -31027,13 +31144,13 @@ var ts; } function isEntityNameVisible(entityName, enclosingDeclaration) { var meaning; - if (entityName.parent.kind === 172 || + if (entityName.parent.kind === 173 || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 154) { + entityName.parent.kind === 155) { meaning = 111551 | 1048576; } - else if (entityName.kind === 153 || entityName.kind === 194 || - entityName.parent.kind === 253) { + else if (entityName.kind === 154 || entityName.kind === 195 || + entityName.parent.kind === 254) { meaning = 1920; } else { @@ -31078,10 +31195,10 @@ var ts; function signatureToStringWorker(writer) { var sigOutput; if (flags & 262144) { - sigOutput = kind === 1 ? 171 : 170; + sigOutput = kind === 1 ? 172 : 171; } else { - sigOutput = kind === 1 ? 166 : 165; + sigOutput = kind === 1 ? 167 : 166; } var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 | 512); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); @@ -31164,6 +31281,7 @@ var ts; getSourceFiles: function () { return host.getSourceFiles(); }, getCurrentDirectory: ts.maybeBind(host, host.getCurrentDirectory), getProbableSymlinks: ts.maybeBind(host, host.getProbableSymlinks), + useCaseSensitiveFileNames: ts.maybeBind(host, host.useCaseSensitiveFileNames) } : undefined }, encounteredError: false, visitedTypes: undefined, @@ -31195,23 +31313,23 @@ var ts; return ts.createKeywordTypeNode(125); } if (type.flags & 2) { - return ts.createKeywordTypeNode(148); + return ts.createKeywordTypeNode(149); } if (type.flags & 4) { context.approximateLength += 6; - return ts.createKeywordTypeNode(143); + return ts.createKeywordTypeNode(144); } if (type.flags & 8) { context.approximateLength += 6; - return ts.createKeywordTypeNode(140); + return ts.createKeywordTypeNode(141); } if (type.flags & 64) { context.approximateLength += 6; - return ts.createKeywordTypeNode(151); + return ts.createKeywordTypeNode(152); } if (type.flags & 16) { context.approximateLength += 7; - return ts.createKeywordTypeNode(128); + return ts.createKeywordTypeNode(129); } if (type.flags & 1024 && !(type.flags & 1048576)) { var parentSymbol = getParentOfSymbol(type.symbol); @@ -31252,7 +31370,7 @@ var ts; } } context.approximateLength += 13; - return ts.createTypeOperatorNode(147, ts.createKeywordTypeNode(144)); + return ts.createTypeOperatorNode(148, ts.createKeywordTypeNode(145)); } if (type.flags & 16384) { context.approximateLength += 4; @@ -31260,7 +31378,7 @@ var ts; } if (type.flags & 32768) { context.approximateLength += 9; - return ts.createKeywordTypeNode(146); + return ts.createKeywordTypeNode(147); } if (type.flags & 65536) { context.approximateLength += 4; @@ -31268,15 +31386,15 @@ var ts; } if (type.flags & 131072) { context.approximateLength += 5; - return ts.createKeywordTypeNode(137); + return ts.createKeywordTypeNode(138); } if (type.flags & 4096) { context.approximateLength += 6; - return ts.createKeywordTypeNode(144); + return ts.createKeywordTypeNode(145); } if (type.flags & 67108864) { context.approximateLength += 6; - return ts.createKeywordTypeNode(141); + return ts.createKeywordTypeNode(142); } if (isThisTypeParameter(type)) { if (context.flags & 4194304) { @@ -31324,7 +31442,7 @@ var ts; } var typeNodes = mapToTypeNodes(types, context, true); if (typeNodes && typeNodes.length > 0) { - var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 ? 178 : 179, typeNodes); + var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 ? 179 : 180, typeNodes); return unionOrIntersectionTypeNode; } else { @@ -31350,6 +31468,11 @@ var ts; context.approximateLength += 2; return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); } + if (type.flags & 134217728) { + var awaitedTypeNode = typeToTypeNodeHelper(type.awaitedType, context); + context.approximateLength += 9; + return ts.createTypeOperatorNode(128, awaitedTypeNode); + } if (type.flags & 16777216) { var checkTypeNode = typeToTypeNodeHelper(type.checkType, context); var saveInferTypeParameters = context.inferTypeParameters; @@ -31362,7 +31485,7 @@ var ts; return ts.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode); } if (type.flags & 33554432) { - return typeToTypeNodeHelper(type.typeVariable, context); + return typeToTypeNodeHelper(type.baseType, context); } return ts.Debug.fail("Should be unreachable."); function createMappedTypeNodeFromType(type) { @@ -31390,7 +31513,7 @@ var ts; var isInstanceType = type === getDeclaredTypeOfClassOrInterface(symbol) ? 788968 : 111551; return symbolToTypeNode(symbol, context, isInstanceType); } - else if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 214 && context.flags & 2048) || + else if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 215 && context.flags & 2048) || symbol.flags & (384 | 512) || shouldWriteTypeOfFunctionSymbol()) { return symbolToTypeNode(symbol, context, 111551); @@ -31417,7 +31540,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 290 || declaration.parent.kind === 250; + return declaration.parent.kind === 291 || declaration.parent.kind === 251; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return (!!(context.flags & 4096) || (context.visitedTypes && context.visitedTypes.has(typeId))) && @@ -31465,12 +31588,12 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 170, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 171, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 171, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 172, context); return signatureNode; } } @@ -31491,7 +31614,7 @@ var ts; } var elementType = typeToTypeNodeHelper(typeArguments[0], context); var arrayType = ts.createArrayTypeNode(elementType); - return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(138, arrayType); + return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(139, arrayType); } else if (type.target.objectFlags & 8) { if (typeArguments.length > 0) { @@ -31505,12 +31628,12 @@ var ts; ts.createOptionalTypeNode(tupleConstituentNodes[i]); } var tupleTypeNode = ts.createTupleTypeNode(tupleConstituentNodes); - return type.target.readonly ? ts.createTypeOperatorNode(138, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(139, tupleTypeNode) : tupleTypeNode; } } if (context.encounteredError || (context.flags & 524288)) { var tupleTypeNode = ts.createTupleTypeNode([]); - return type.target.readonly ? ts.createTypeOperatorNode(138, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(139, tupleTypeNode) : tupleTypeNode; } context.encounteredError = true; return undefined; @@ -31598,11 +31721,11 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 165, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 166, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 166, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 167, context)); } if (resolvedType.stringIndexInfo) { var indexSignature = void 0; @@ -31679,7 +31802,7 @@ var ts; var signatures = getSignaturesOfType(filterType(propertyType, function (t) { return !(t.flags & 32768); }), 0); for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) { var signature = signatures_1[_i]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 160, context); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 161, context); methodDeclaration.name = propertyName; methodDeclaration.questionToken = optionalToken; typeElements.push(preserveCommentsOn(methodDeclaration)); @@ -31696,7 +31819,7 @@ var ts; propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(125); } context.flags = savedFlags; - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(138)] : undefined; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(139)] : undefined; if (modifiers) { context.approximateLength += 9; } @@ -31704,8 +31827,8 @@ var ts; typeElements.push(preserveCommentsOn(propertySignature)); } function preserveCommentsOn(node) { - if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 323; })) { - var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 323; }); + if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 324; })) { + var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 324; }); var commentText = d.comment; if (commentText) { ts.setSyntheticLeadingComments(node, [{ kind: 3, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); @@ -31755,14 +31878,14 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 ? 143 : 140); + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 ? 144 : 141); var indexingParameter = ts.createParameter(undefined, undefined, undefined, name, undefined, indexerTypeNode, undefined); var typeNode = typeToTypeNodeHelper(indexInfo.type || anyType, context); if (!indexInfo.type && !(context.flags & 2097152)) { context.encounteredError = true; } context.approximateLength += (name.length + 4); - return ts.createIndexSignature(undefined, indexInfo.isReadonly ? [ts.createToken(138)] : undefined, [indexingParameter], typeNode); + return ts.createIndexSignature(undefined, indexInfo.isReadonly ? [ts.createToken(139)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context) { var suppressAny = context.flags & 256; @@ -31776,7 +31899,7 @@ var ts; else { typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); } - var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 162); }); + var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 163); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); @@ -31820,9 +31943,9 @@ var ts; return typeParameterToDeclarationWithConstraint(type, context, constraintNode); } function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 156); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 157); if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) { - parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 317); + parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 318); } var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { @@ -31834,7 +31957,7 @@ var ts; var dotDotDotToken = isRest ? ts.createToken(25) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 75 ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name), 16777216) : - parameterDeclaration.name.kind === 153 ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216) : + parameterDeclaration.name.kind === 154 ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216) : cloneBindingName(parameterDeclaration.name) : ts.symbolName(parameterSymbol) : ts.symbolName(parameterSymbol); @@ -31851,7 +31974,7 @@ var ts; } var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, undefined, elideInitializerAndSetEmitFlags); var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited); - if (clone.kind === 191) { + if (clone.kind === 192) { clone.initializer = undefined; } return ts.setEmitFlags(clone, 1 | 16777216); @@ -31958,10 +32081,10 @@ var ts; var typeParameterNodes; if (context.flags & 512 && index < (chain.length - 1)) { var parentSymbol = symbol; - var nextSymbol = chain[index + 1]; - if (ts.getCheckFlags(nextSymbol) & 1) { + var nextSymbol_1 = chain[index + 1]; + if (ts.getCheckFlags(nextSymbol_1) & 1) { var params = getTypeParametersOfClassOrInterface(parentSymbol.flags & 2097152 ? resolveAlias(parentSymbol) : parentSymbol); - typeParameterNodes = mapToTypeNodes(ts.map(params, nextSymbol.mapper), context); + typeParameterNodes = mapToTypeNodes(ts.map(params, function (t) { return getMappedType(t, nextSymbol_1.mapper); }), context); } else { typeParameterNodes = typeParametersToTypeParameterDeclarations(symbol, context); @@ -31976,7 +32099,7 @@ var ts; return top; } function getSpecifierForModuleSymbol(symbol, context) { - var file = ts.getDeclarationOfKind(symbol, 290); + var file = ts.getDeclarationOfKind(symbol, 291); if (file && file.moduleName !== undefined) { return file.moduleName; } @@ -32259,8 +32382,8 @@ var ts; return initial; } function symbolTableToDeclarationStatements(symbolTable, context, bundled) { - var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 161, true); - var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 160, false); + var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 162, true); + var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 161, false); var enclosingDeclaration = context.enclosingDeclaration; var results = []; var visitedSymbols = ts.createMap(); @@ -32543,8 +32666,8 @@ var ts; var baseTypes = getBaseTypes(interfaceType); var baseType = ts.length(baseTypes) ? getIntersectionType(baseTypes) : undefined; var members = ts.flatMap(getPropertiesOfType(interfaceType), function (p) { return serializePropertySymbolForInterface(p, baseType); }); - var callSignatures = serializeSignatures(0, interfaceType, baseType, 165); - var constructSignatures = serializeSignatures(1, interfaceType, baseType, 166); + var callSignatures = serializeSignatures(0, interfaceType, baseType, 166); + var constructSignatures = serializeSignatures(1, interfaceType, baseType, 167); var indexSignatures = serializeIndexSignatures(interfaceType, baseType); var heritageClauses = !ts.length(baseTypes) ? undefined : [ts.createHeritageClause(90, ts.mapDefined(baseTypes, function (b) { return trySerializeAsTypeReference(b); }))]; addResult(ts.createInterfaceDeclaration(undefined, undefined, getInternalSymbolName(symbol, symbolName), typeParamDecls, heritageClauses, __spreadArrays(indexSignatures, constructSignatures, callSignatures, members)), modifierFlags); @@ -32617,7 +32740,7 @@ var ts; var signatures = getSignaturesOfType(type, 0); for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { var sig = signatures_2[_i]; - var decl = signatureToSignatureDeclarationHelper(sig, 244, context); + var decl = signatureToSignatureDeclarationHelper(sig, 245, context); decl.name = ts.createIdentifier(localName); addResult(ts.setTextRange(decl, sig.declaration), modifierFlags); } @@ -32686,7 +32809,7 @@ var ts; var staticMembers = symbol.flags & (16 | 512) ? [] : ts.flatMap(ts.filter(getPropertiesOfType(staticType), function (p) { return !(p.flags & 4194304) && p.escapedName !== "prototype"; }), function (p) { return serializePropertySymbolForClass(p, true, staticBaseType); }); - var constructors = serializeSignatures(1, staticType, baseTypes[0], 162); + var constructors = serializeSignatures(1, staticType, baseTypes[0], 163); for (var _i = 0, constructors_1 = constructors; _i < constructors_1.length; _i++) { var c = constructors_1[_i]; c.type = undefined; @@ -32710,38 +32833,38 @@ var ts; var targetName = getInternalSymbolName(target, verbatimTargetName); includePrivateSymbol(target); switch (node.kind) { - case 253: + case 254: var isLocalImport = !(target.flags & 512); addResult(ts.createImportEqualsDeclaration(undefined, undefined, ts.createIdentifier(localName), isLocalImport ? symbolToName(target, context, 67108863, false) : ts.createExternalModuleReference(ts.createLiteral(getSpecifierForModuleSymbol(symbol, context)))), isLocalImport ? modifierFlags : 0); break; - case 252: + case 253: addResult(ts.createNamespaceExportDeclaration(ts.idText(node.name)), 0); break; - case 255: + case 256: addResult(ts.createImportDeclaration(undefined, undefined, ts.createImportClause(ts.createIdentifier(localName), undefined), ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0); break; - case 256: + case 257: addResult(ts.createImportDeclaration(undefined, undefined, ts.createImportClause(undefined, ts.createNamespaceImport(ts.createIdentifier(localName))), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0); break; - case 262: + case 263: addResult(ts.createExportDeclaration(undefined, undefined, ts.createNamespaceExport(ts.createIdentifier(localName)), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0); break; - case 258: + case 259: addResult(ts.createImportDeclaration(undefined, undefined, ts.createImportClause(undefined, ts.createNamedImports([ ts.createImportSpecifier(localName !== verbatimTargetName ? ts.createIdentifier(verbatimTargetName) : undefined, ts.createIdentifier(localName)) ])), ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0); break; - case 263: + case 264: var specifier = node.parent.parent.moduleSpecifier; serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), specifier ? verbatimTargetName : targetName, specifier && ts.isStringLiteralLike(specifier) ? ts.createLiteral(specifier.text) : undefined); break; - case 259: + case 260: serializeMaybeAliasAssignment(symbol); break; - case 209: - case 194: + case 210: + case 195: if (symbol.escapedName === "default" || symbol.escapedName === "export=") { serializeMaybeAliasAssignment(symbol); } @@ -32902,17 +33025,17 @@ var ts; context.flags = oldFlags; return result; function visitExistingNodeTreeSymbols(node) { - if (ts.isJSDocAllType(node)) { + if (ts.isJSDocAllType(node) || node.kind === 303) { return ts.createKeywordTypeNode(125); } if (ts.isJSDocUnknownType(node)) { - return ts.createKeywordTypeNode(148); + return ts.createKeywordTypeNode(149); } if (ts.isJSDocNullableType(node)) { return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(100)]); } if (ts.isJSDocOptionalType(node)) { - return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(146)]); + return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(147)]); } if (ts.isJSDocNonNullableType(node)) { return ts.visitNode(node.type, visitExistingNodeTreeSymbols); @@ -33160,8 +33283,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048) { - var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 182; }); - if (node.kind === 247) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 183; }); + if (node.kind === 248) { return getSymbolOfNode(node); } } @@ -33169,11 +33292,11 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 250 && + node.parent.kind === 251 && ts.isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 290 || ts.isAmbientModule(location); + return location.kind === 291 || ts.isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { var nameType = getSymbolLinks(symbol).nameType; @@ -33221,17 +33344,17 @@ var ts; if (!declaration) { declaration = symbol.declarations[0]; } - if (declaration.parent && declaration.parent.kind === 242) { + if (declaration.parent && declaration.parent.kind === 243) { return ts.declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 214: - case 201: + case 215: case 202: + case 203: if (context && !context.encounteredError && !(context.flags & 131072)) { context.encounteredError = true; } - return declaration.kind === 214 ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 215 ? "(Anonymous class)" : "(Anonymous function)"; } } var name = getNameOfSymbolFromNameType(symbol, context); @@ -33248,67 +33371,67 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 315: - case 322: case 316: + case 323: + case 317: return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent)); - case 191: + case 192: return isDeclarationVisible(node.parent.parent); - case 242: + case 243: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { return false; } - case 249: - case 245: + case 250: case 246: case 247: - case 244: case 248: - case 253: + case 245: + case 249: + case 254: if (ts.isExternalModuleAugmentation(node)) { return true; } var parent = getDeclarationContainer(node); if (!(ts.getCombinedModifierFlags(node) & 1) && - !(node.kind !== 253 && parent.kind !== 290 && parent.flags & 8388608)) { + !(node.kind !== 254 && parent.kind !== 291 && parent.flags & 8388608)) { return isGlobalSourceFile(parent); } return isDeclarationVisible(parent); + case 160: case 159: - case 158: - case 163: case 164: + case 165: + case 162: case 161: - case 160: if (ts.hasModifier(node, 8 | 16)) { return false; } - case 162: - case 166: - case 165: + case 163: case 167: - case 156: - case 250: - case 170: + case 166: + case 168: + case 157: + case 251: case 171: - case 173: - case 169: + case 172: case 174: + case 170: case 175: - case 178: + case 176: case 179: - case 182: + case 180: + case 183: return isDeclarationVisible(node.parent); - case 255: case 256: - case 258: + case 257: + case 259: return false; - case 155: - case 290: - case 252: + case 156: + case 291: + case 253: return true; - case 259: + case 260: return false; default: return false; @@ -33317,10 +33440,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 259) { + if (node.parent && node.parent.kind === 260) { exportSymbol = resolveName(node, node.escapedText, 111551 | 788968 | 1920 | 2097152, undefined, node, false); } - else if (node.parent.kind === 263) { + else if (node.parent.kind === 264) { exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 | 788968 | 1920 | 2097152); } var result; @@ -33406,12 +33529,12 @@ var ts; function getDeclarationContainer(node) { return ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 242: case 243: + case 244: + case 259: case 258: case 257: case 256: - case 255: return false; default: return true; @@ -33437,7 +33560,7 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, false); } function isComputedNonLiteralName(name) { - return name.kind === 154 && !ts.isStringOrNumericLiteralLike(name.expression); + return name.kind === 155 && !ts.isStringOrNumericLiteralLike(name.expression); } function getRestType(source, properties, symbol) { source = filterType(source, function (t) { return !(t.flags & 98304); }); @@ -33482,7 +33605,7 @@ var ts; if (parentAccess && parentAccess.flowNode) { var propName = getDestructuringPropertyName(node); if (propName) { - var result = ts.createNode(195, node.pos, node.end); + var result = ts.createNode(196, node.pos, node.end); result.parent = node; result.expression = parentAccess; var literal = ts.createNode(10, node.pos, node.end); @@ -33497,23 +33620,23 @@ var ts; function getParentElementAccess(node) { var ancestor = node.parent.parent; switch (ancestor.kind) { - case 191: - case 281: - return getSyntheticElementAccess(ancestor); case 192: + case 282: + return getSyntheticElementAccess(ancestor); + case 193: return getSyntheticElementAccess(node.parent); - case 242: + case 243: return ancestor.initializer; - case 209: + case 210: return ancestor.right; } } function getDestructuringPropertyName(node) { var parent = node.parent; - if (node.kind === 191 && parent.kind === 189) { + if (node.kind === 192 && parent.kind === 190) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 281 || node.kind === 282) { + if (node.kind === 282 || node.kind === 283) { return getLiteralPropertyNameText(node.name); } return "" + parent.elements.indexOf(node); @@ -33531,8 +33654,11 @@ var ts; if (strictNullChecks && declaration.flags & 8388608 && ts.isParameterDeclaration(declaration)) { parentType = getNonNullableType(parentType); } + else if (strictNullChecks && pattern.parent.initializer) { + parentType = getTypeWithFacts(parentType, 524288); + } var type; - if (pattern.kind === 189) { + if (pattern.kind === 190) { if (declaration.dotDotDotToken) { parentType = getReducedType(parentType); if (parentType.flags & 2 || !isValidSpreadType(parentType)) { @@ -33596,18 +33722,18 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 192 && expr.elements.length === 0; + return expr.kind === 193 && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } return strictNullChecks && optional ? getOptionalType(type) : type; } function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 231) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232) { var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression))); return indexType.flags & (262144 | 4194304) ? getExtractStringType(indexType) : stringType; } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 233) { var forOfStatement = declaration.parent.parent; return checkRightHandSideOfForOf(forOfStatement.expression, forOfStatement.awaitModifier) || anyType; } @@ -33621,7 +33747,7 @@ var ts; return addOptionality(declaredType, isOptional); } if ((noImplicitAny || ts.isInJSFile(declaration)) && - declaration.kind === 242 && !ts.isBindingPattern(declaration.name) && + declaration.kind === 243 && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1) && !(declaration.flags & 8388608)) { if (!(ts.getCombinedNodeFlags(declaration) & 2) && (!declaration.initializer || isNullOrUndefined(declaration.initializer))) { return autoType; @@ -33630,10 +33756,10 @@ var ts; return autoArrayType; } } - if (declaration.kind === 156) { + if (declaration.kind === 157) { var func = declaration.parent; - if (func.kind === 164 && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 163); + if (func.kind === 165 && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 164); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -33834,9 +33960,9 @@ var ts; } function isDeclarationInConstructor(expression) { var thisContainer = ts.getThisContainer(expression, false); - return thisContainer.kind === 162 || - thisContainer.kind === 244 || - (thisContainer.kind === 201 && !ts.isPrototypePropertyAssignment(thisContainer.parent)); + return thisContainer.kind === 163 || + thisContainer.kind === 245 || + (thisContainer.kind === 202 && !ts.isPrototypePropertyAssignment(thisContainer.parent)); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { ts.Debug.assert(types.length === declarations.length); @@ -33906,7 +34032,7 @@ var ts; function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) { var elements = pattern.elements; var lastElement = ts.lastOrUndefined(elements); - var hasRestElement = !!(lastElement && lastElement.kind === 191 && lastElement.dotDotDotToken); + var hasRestElement = !!(lastElement && lastElement.kind === 192 && lastElement.dotDotDotToken); if (elements.length === 0 || elements.length === 1 && hasRestElement) { return languageVersion >= 2 ? createIterableType(anyType) : anyArrayType; } @@ -33923,7 +34049,7 @@ var ts; function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { if (includePatternInType === void 0) { includePatternInType = false; } if (reportErrors === void 0) { reportErrors = false; } - return pattern.kind === 189 + return pattern.kind === 190 ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -33950,7 +34076,7 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 156 ? root.parent : root; + var memberDeclaration = root.kind === 157 ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(declaration) { @@ -33999,7 +34125,7 @@ var ts; return reportCircularityError(symbol); } var type; - if (declaration.kind === 259) { + if (declaration.kind === 260) { type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration); } else if (ts.isBinaryExpression(declaration) || @@ -34066,7 +34192,7 @@ var ts; } function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { - if (accessor.kind === 163) { + if (accessor.kind === 164) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; } @@ -34100,15 +34226,15 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 163); + var getter = ts.getDeclarationOfKind(symbol, 164); error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } return type; } function resolveTypeOfAccessors(symbol) { - var getter = ts.getDeclarationOfKind(symbol, 163); - var setter = ts.getDeclarationOfKind(symbol, 164); + var getter = ts.getDeclarationOfKind(symbol, 164); + var setter = ts.getDeclarationOfKind(symbol, 165); if (getter && ts.isInJSFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -34171,9 +34297,9 @@ var ts; if (symbol.flags & 1536 && ts.isShorthandAmbientModuleSymbol(symbol)) { return anyType; } - else if (declaration.kind === 209 || + else if (declaration.kind === 210 || ts.isAccessExpression(declaration) && - declaration.parent.kind === 209) { + declaration.parent.kind === 210) { return getWidenedTypeForAssignmentDeclaration(symbol); } else if (symbol.flags & 512 && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) { @@ -34233,7 +34359,7 @@ var ts; error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); return errorType; } - if (noImplicitAny && (declaration.kind !== 156 || declaration.initializer)) { + if (noImplicitAny && (declaration.kind !== 157 || declaration.initializer)) { error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); } return anyType; @@ -34323,43 +34449,43 @@ var ts; return undefined; } switch (node.kind) { - case 245: - case 214: case 246: - case 165: + case 215: + case 247: case 166: - case 160: - case 170: - case 171: - case 300: - case 244: + case 167: case 161: - case 201: + case 171: + case 172: + case 301: + case 245: + case 162: case 202: - case 247: - case 321: + case 203: + case 248: case 322: + case 323: + case 317: case 316: - case 315: - case 186: - case 180: + case 187: + case 181: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 186) { + if (node.kind === 187) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } - else if (node.kind === 180) { + else if (node.kind === 181) { return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node)); var thisType = includeThisTypes && - (node.kind === 245 || node.kind === 214 || node.kind === 246 || isJSConstructor(node)) && + (node.kind === 246 || node.kind === 215 || node.kind === 247 || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } } } function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 246); + var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 247); ts.Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); } @@ -34367,9 +34493,9 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 246 || - node.kind === 245 || - node.kind === 214 || + if (node.kind === 247 || + node.kind === 246 || + node.kind === 215 || isJSConstructor(node) || ts.isTypeAlias(node)) { var declaration = node; @@ -34558,7 +34684,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 246 && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 247 && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getReducedType(getTypeFromTypeNode(node)); @@ -34587,7 +34713,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 246) { + if (declaration.kind === 247) { if (declaration.flags & 128) { return false; } @@ -34664,7 +34790,7 @@ var ts; if (ts.isStringLiteralLike(expr)) { return true; } - else if (expr.kind === 209) { + else if (expr.kind === 210) { return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right); } return false; @@ -34679,12 +34805,12 @@ var ts; case 8: case 14: return true; - case 207: + case 208: return expr.operator === 40 && expr.operand.kind === 8; case 75: return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText); - case 209: + case 210: return isStringConcatExpression(expr); default: return false; @@ -34698,7 +34824,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 248) { + if (declaration.kind === 249) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && ts.isStringLiteralLike(member.initializer)) { @@ -34725,7 +34851,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 248) { + if (declaration.kind === 249) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var value = getEnumMemberValue(member); @@ -34793,22 +34919,22 @@ var ts; function isThislessType(node) { switch (node.kind) { case 125: - case 148: - case 143: - case 140: - case 151: - case 128: + case 149: case 144: case 141: + case 152: + case 129: + case 145: + case 142: case 110: - case 146: + case 147: case 100: - case 137: - case 187: + case 138: + case 188: return true; - case 174: + case 175: return isThislessType(node.elementType); - case 169: + case 170: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -34824,7 +34950,7 @@ var ts; function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - return (node.kind === 162 || (!!returnType && isThislessType(returnType))) && + return (node.kind === 163 || (!!returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } @@ -34833,14 +34959,14 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { + case 160: case 159: - case 158: return isThislessVariableLikeDeclaration(declaration); - case 161: - case 160: case 162: + case 161: case 163: case 164: + case 165: return isThislessFunctionLikeDeclaration(declaration); } } @@ -35048,7 +35174,6 @@ var ts; var stringIndexInfo; var numberIndexInfo; if (ts.rangeEquals(typeParameters, typeArguments, 0, typeParameters.length)) { - mapper = identityMapper; members = source.symbol ? getMembersOfSymbol(source.symbol) : ts.createSymbolTable(source.declaredProperties); callSignatures = source.declaredCallSignatures; constructSignatures = source.declaredConstructSignatures; @@ -35511,8 +35636,7 @@ var ts; var checkType = type.checkType; var constraint = getLowerBoundOfKeyType(checkType); if (constraint !== checkType) { - var mapper = makeUnaryTypeMapper(type.root.checkType, constraint); - return getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); + return getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper)); } } return type; @@ -35553,7 +35677,7 @@ var ts; } setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); function addMemberForKeyType(t) { - var templateMapper = combineTypeMappers(type.mapper, createTypeMapper([typeParameter], [t])); + var templateMapper = appendTypeMapping(type.mapper, typeParameter, t); if (isTypeUsableAsPropertyName(t)) { var propName = getPropertyNameFromType(t); var modifiersProp = getPropertyOfType(modifiersType, propName); @@ -35598,6 +35722,7 @@ var ts; type = errorType; } symbol.type = type; + symbol.mapper = undefined; } return symbol.type; } @@ -35612,7 +35737,7 @@ var ts; function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? - instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4)), type.mapper || identityMapper) : + instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4)), type.mapper) : errorType); } function getConstraintDeclarationForMappedType(type) { @@ -35620,19 +35745,19 @@ var ts; } function isMappedTypeWithKeyofConstraintDeclaration(type) { var constraintDeclaration = getConstraintDeclarationForMappedType(type); - return constraintDeclaration.kind === 184 && - constraintDeclaration.operator === 134; + return constraintDeclaration.kind === 185 && + constraintDeclaration.operator === 135; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { if (isMappedTypeWithKeyofConstraintDeclaration(type)) { - type.modifiersType = instantiateType(getTypeFromTypeNode(getConstraintDeclarationForMappedType(type).type), type.mapper || identityMapper); + type.modifiersType = instantiateType(getTypeFromTypeNode(getConstraintDeclarationForMappedType(type).type), type.mapper); } else { var declaredType = getTypeFromMappedTypeNode(type.declaration); var constraint = getConstraintTypeFromMappedType(declaredType); var extendedConstraint = constraint && constraint.flags & 262144 ? getConstraintOfTypeParameter(constraint) : constraint; - type.modifiersType = extendedConstraint && extendedConstraint.flags & 4194304 ? instantiateType(extendedConstraint.type, type.mapper || identityMapper) : unknownType; + type.modifiersType = extendedConstraint && extendedConstraint.flags & 4194304 ? instantiateType(extendedConstraint.type, type.mapper) : unknownType; } } return type.modifiersType; @@ -35714,7 +35839,7 @@ var ts; } } } - if (type.flags & 1048576) { + if (type.flags & 1048576 && !getIndexInfoOfType(current, 0) && !getIndexInfoOfType(current, 1)) { break; } } @@ -35799,8 +35924,7 @@ var ts; var simplified = getSimplifiedType(type.checkType, false); var constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified; if (constraint && constraint !== type.checkType) { - var mapper = makeUnaryTypeMapper(type.root.checkType, constraint); - var instantiated = getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); + var instantiated = getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper)); if (!(instantiated.flags & 131072)) { return instantiated; } @@ -35819,7 +35943,7 @@ var ts; var hasDisjointDomainType = false; for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { var t = types_4[_i]; - if (t.flags & 63176704) { + if (t.flags & 197394432) { var constraint = getConstraintOfType(t); while (constraint && constraint.flags & (262144 | 4194304 | 16777216)) { constraint = getConstraintOfType(constraint); @@ -35849,7 +35973,7 @@ var ts; return undefined; } function getBaseConstraintOfType(type) { - if (type.flags & (58982400 | 3145728)) { + if (type.flags & (193200128 | 3145728)) { var constraint = getResolvedBaseConstraint(type); return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined; } @@ -35938,6 +36062,10 @@ var ts; constraintDepth--; return result; } + if (t.flags & 134217728) { + var basePromiseType = getBaseConstraint(t.awaitedType); + return basePromiseType ? getAwaitedType(basePromiseType) : undefined; + } if (t.flags & 33554432) { return getBaseConstraint(t.substitute); } @@ -35985,14 +36113,13 @@ var ts; if (typeVariable) { var constraint = getConstraintOfTypeParameter(typeVariable); if (constraint && (isArrayType(constraint) || isTupleType(constraint))) { - var mapper = makeUnaryTypeMapper(typeVariable, constraint); - return instantiateType(type, combineTypeMappers(mapper, type.mapper)); + return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper)); } } return type; } function getApparentType(type) { - var t = type.flags & 63176704 ? getBaseConstraintOfType(type) || unknownType : type; + var t = type.flags & 197394432 ? getBaseConstraintOfType(type) || unknownType : type; return ts.getObjectFlags(t) & 32 ? getApparentTypeOfMappedType(t) : t.flags & 2097152 ? getApparentTypeOfIntersectionType(t) : t.flags & 132 ? globalStringType : @@ -36222,7 +36349,7 @@ var ts; ts.append(propTypes, getIndexTypeOfType(type, 1)); } if (propTypes.length) { - return getUnionType(propTypes, 2); + return getUnionType(propTypes); } } return undefined; @@ -36245,10 +36372,10 @@ var ts; return result; } function isJSDocOptionalParameter(node) { - return ts.isInJSFile(node) && (node.type && node.type.kind === 299 + return ts.isInJSFile(node) && (node.type && node.type.kind === 300 || ts.getJSDocParameterTags(node).some(function (_a) { var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 299; + return isBracketed || !!typeExpression && typeExpression.type.kind === 300; })); } function tryFindAmbientModule(moduleName, withAugmentations) { @@ -36266,7 +36393,7 @@ var ts; var signature = getSignatureFromDeclaration(node.parent); var parameterIndex = node.parent.parameters.indexOf(node); ts.Debug.assert(parameterIndex >= 0); - return parameterIndex >= getMinArgumentCount(signature); + return parameterIndex >= getMinArgumentCount(signature, true); } var iife = ts.getImmediatelyInvokedFunctionExpression(node.parent); if (iife) { @@ -36281,7 +36408,7 @@ var ts; return false; } var isBracketed = node.isBracketed, typeExpression = node.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 299; + return isBracketed || !!typeExpression && typeExpression.type.kind === 300; } function createTypePredicate(kind, parameterName, parameterIndex, type) { return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; @@ -36336,6 +36463,9 @@ var ts; ts.isValueSignatureDeclaration(declaration) && !ts.hasJSDocParameterTags(declaration) && !ts.getJSDocType(declaration); + if (isUntypedSignatureInJSFile) { + flags |= 16; + } for (var i = isJSConstructSignature ? 1 : 0; i < declaration.parameters.length; i++) { var param = declaration.parameters[i]; var paramSymbol = param.symbol; @@ -36351,28 +36481,27 @@ var ts; else { parameters.push(paramSymbol); } - if (type && type.kind === 187) { + if (type && type.kind === 188) { flags |= 2; } var isOptionalParameter_1 = isOptionalJSDocParameterTag(param) || param.initializer || param.questionToken || param.dotDotDotToken || iife && parameters.length > iife.arguments.length && !type || - isUntypedSignatureInJSFile || isJSDocOptionalParameter(param); if (!isOptionalParameter_1) { minArgumentCount = parameters.length; } } - if ((declaration.kind === 163 || declaration.kind === 164) && + if ((declaration.kind === 164 || declaration.kind === 165) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 163 ? 164 : 163; + var otherKind = declaration.kind === 164 ? 165 : 164; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 162 ? + var classType = declaration.kind === 163 ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); @@ -36426,11 +36555,11 @@ var ts; switch (node.kind) { case 75: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 159: - case 161: - case 163: + case 160: + case 162: case 164: - return node.name.kind === 154 + case 165: + return node.name.kind === 155 && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse); @@ -36499,7 +36628,7 @@ var ts; function createTypePredicateFromTypePredicateNode(node, signature) { var parameterName = node.parameterName; var type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 183 ? + return parameterName.kind === 184 ? createTypePredicate(node.assertsModifier ? 2 : 0, undefined, undefined, type) : createTypePredicate(node.assertsModifier ? 3 : 1, parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type); } @@ -36542,7 +36671,7 @@ var ts; return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 162) { + if (declaration.kind === 163) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } if (ts.isJSDocConstructSignature(declaration)) { @@ -36552,12 +36681,12 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 163 && !hasNonBindableDynamicName(declaration)) { + if (declaration.kind === 164 && !hasNonBindableDynamicName(declaration)) { var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 164); + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 165); var setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -36636,7 +36765,7 @@ var ts; function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { var kind = signature.declaration ? signature.declaration.kind : 0; - var isConstructor = kind === 162 || kind === 166 || kind === 171; + var isConstructor = kind === 163 || kind === 167 || kind === 172; var type = createObjectType(16); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -36650,7 +36779,7 @@ var ts; return symbol.members.get("__index"); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 ? 140 : 143; + var syntaxKind = kind === 1 ? 141 : 144; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -36684,9 +36813,9 @@ var ts; if (typeParameter.symbol) { for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.parent.kind === 181) { + if (declaration.parent.kind === 182) { var grandParent = declaration.parent.parent; - if (grandParent.kind === 169) { + if (grandParent.kind === 170) { var typeReference = grandParent; var typeParameters = getTypeParametersForTypeReference(typeReference); if (typeParameters) { @@ -36703,7 +36832,7 @@ var ts; } } } - else if (grandParent.kind === 156 && grandParent.dotDotDotToken) { + else if (grandParent.kind === 157 && grandParent.dotDotDotToken) { inferences = ts.append(inferences, createArrayType(unknownType)); } } @@ -36719,14 +36848,22 @@ var ts; } else { var constraintDeclaration = getConstraintDeclaration(typeParameter); - typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : - getInferredTypeParameterConstraint(typeParameter) || noConstraintType; + if (!constraintDeclaration) { + typeParameter.constraint = getInferredTypeParameterConstraint(typeParameter) || noConstraintType; + } + else { + var type = getTypeFromTypeNode(constraintDeclaration); + if (type.flags & 1 && type !== errorType) { + type = constraintDeclaration.parent.parent.kind === 187 ? keyofConstraintType : unknownType; + } + typeParameter.constraint = type; + } } } return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - var tp = ts.getDeclarationOfKind(typeParameter.symbol, 155); + var tp = ts.getDeclarationOfKind(typeParameter.symbol, 156); var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent; return host && getSymbolOfNode(host); } @@ -36802,8 +36939,8 @@ var ts; } var node = type.node; var typeArguments = !node ? ts.emptyArray : - node.kind === 169 ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : - node.kind === 174 ? [getTypeFromTypeNode(node.elementType)] : + node.kind === 170 ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : + node.kind === 175 ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments; @@ -36843,7 +36980,7 @@ var ts; return errorType; } } - if (node.kind === 169 && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { + if (node.kind === 170 && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { return createDeferredTypeReference(type, node, undefined); } var typeArguments = ts.concatenate(type.outerTypeParameters, fillMissingTypeArguments(typeArgumentsFromTypeReferenceNode(node), typeParameters, minTypeArgumentCount, isJs)); @@ -36880,9 +37017,9 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 169: + case 170: return node.typeName; - case 216: + case 217: var expr = node.expression; if (ts.isEntityNameExpression(expr)) { return expr; @@ -36909,9 +37046,7 @@ var ts; } var res = tryGetDeclaredTypeOfSymbol(symbol); if (res) { - return checkNoTypeArguments(node, symbol) ? - res.flags & 262144 ? getConstrainedTypeVariable(res, node) : getRegularTypeOfLiteralType(res) : - errorType; + return checkNoTypeArguments(node, symbol) ? getRegularTypeOfLiteralType(res) : errorType; } if (symbol.flags & 111551 && isJSDocTypeReference(node)) { var jsdocType = getTypeFromJSDocValueReference(node, symbol); @@ -36940,7 +37075,7 @@ var ts; } isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, true) && !!valueType.symbol; } - var isImportTypeWithQualifier = node.kind === 188 && node.qualifier; + var isImportTypeWithQualifier = node.kind === 189 && node.qualifier; if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier)) { typeType = getTypeReferenceType(node, valueType.symbol); } @@ -36949,45 +37084,45 @@ var ts; } return links.resolvedJSDocType; } - function getSubstitutionType(typeVariable, substitute) { - if (substitute.flags & 3 || substitute === typeVariable) { - return typeVariable; + function getSubstitutionType(baseType, substitute) { + if (substitute.flags & 3 || substitute === baseType) { + return baseType; } - var id = getTypeId(typeVariable) + ">" + getTypeId(substitute); + var id = getTypeId(baseType) + ">" + getTypeId(substitute); var cached = substitutionTypes.get(id); if (cached) { return cached; } var result = createType(33554432); - result.typeVariable = typeVariable; + result.baseType = baseType; result.substitute = substitute; substitutionTypes.set(id, result); return result; } function isUnaryTupleTypeNode(node) { - return node.kind === 175 && node.elementTypes.length === 1; + return node.kind === 176 && node.elementTypes.length === 1; } - function getImpliedConstraint(typeVariable, checkNode, extendsNode) { - return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(typeVariable, checkNode.elementTypes[0], extendsNode.elementTypes[0]) : - getActualTypeVariable(getTypeFromTypeNode(checkNode)) === typeVariable ? getTypeFromTypeNode(extendsNode) : + function getImpliedConstraint(type, checkNode, extendsNode) { + return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elementTypes[0], extendsNode.elementTypes[0]) : + getActualTypeVariable(getTypeFromTypeNode(checkNode)) === type ? getTypeFromTypeNode(extendsNode) : undefined; } - function getConstrainedTypeVariable(typeVariable, node) { + function getConditionalFlowTypeOfType(type, node) { var constraints; - while (node && !ts.isStatement(node) && node.kind !== 303) { + while (node && !ts.isStatement(node) && node.kind !== 304) { var parent = node.parent; - if (parent.kind === 180 && node === parent.trueType) { - var constraint = getImpliedConstraint(typeVariable, parent.checkType, parent.extendsType); + if (parent.kind === 181 && node === parent.trueType) { + var constraint = getImpliedConstraint(type, parent.checkType, parent.extendsType); if (constraint) { constraints = ts.append(constraints, constraint); } } node = parent; } - return constraints ? getSubstitutionType(typeVariable, getIntersectionType(ts.append(constraints, typeVariable))) : typeVariable; + return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type; } function isJSDocTypeReference(node) { - return !!(node.flags & 4194304) && (node.kind === 169 || node.kind === 188); + return !!(node.flags & 4194304) && (node.kind === 170 || node.kind === 189); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { @@ -37093,9 +37228,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 245: case 246: - case 248: + case 247: + case 249: return declaration; } } @@ -37212,58 +37347,58 @@ var ts; } function getArrayOrTupleTargetType(node) { var readonly = isReadonlyTypeOperator(node.parent); - if (node.kind === 174 || node.elementTypes.length === 1 && node.elementTypes[0].kind === 177) { + if (node.kind === 175 || node.elementTypes.length === 1 && node.elementTypes[0].kind === 178) { return readonly ? globalReadonlyArrayType : globalArrayType; } var lastElement = ts.lastOrUndefined(node.elementTypes); - var restElement = lastElement && lastElement.kind === 177 ? lastElement : undefined; - var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 176 && n !== restElement; }) + 1; + var restElement = lastElement && lastElement.kind === 178 ? lastElement : undefined; + var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 177 && n !== restElement; }) + 1; return getTupleTypeOfArity(node.elementTypes.length, minLength, !!restElement, readonly, undefined); } function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { - return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 174 ? mayResolveTypeAlias(node.elementType) : - node.kind === 175 ? ts.some(node.elementTypes, mayResolveTypeAlias) : + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 175 ? mayResolveTypeAlias(node.elementType) : + node.kind === 176 ? ts.some(node.elementTypes, mayResolveTypeAlias) : hasDefaultTypeArguments || ts.some(node.typeArguments, mayResolveTypeAlias)); } function isResolvedByTypeAlias(node) { var parent = node.parent; switch (parent.kind) { - case 182: - case 169: - case 178: + case 183: + case 170: case 179: - case 185: case 180: - case 184: + case 186: + case 181: + case 185: return isResolvedByTypeAlias(parent); - case 247: + case 248: return true; } return false; } function mayResolveTypeAlias(node) { switch (node.kind) { - case 169: + case 170: return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node.typeName, 788968).flags & 524288); - case 172: + case 173: return true; - case 184: - return node.operator !== 147 && mayResolveTypeAlias(node.type); - case 182: - case 176: - case 299: - case 297: + case 185: + return node.operator !== 148 && mayResolveTypeAlias(node.type); + case 183: + case 177: + case 300: case 298: - case 294: + case 299: + case 295: return mayResolveTypeAlias(node.type); - case 177: - return node.type.kind !== 174 || mayResolveTypeAlias(node.type.elementType); case 178: + return node.type.kind !== 175 || mayResolveTypeAlias(node.type.elementType); case 179: + case 180: return ts.some(node.types, mayResolveTypeAlias); - case 185: + case 186: return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 180: + case 181: return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); } @@ -37277,18 +37412,18 @@ var ts; links.resolvedType = emptyObjectType; } else if (isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 175 && node.elementTypes.length === 0 ? target : + links.resolvedType = node.kind === 176 && node.elementTypes.length === 0 ? target : createDeferredTypeReference(target, node, undefined); } else { - var elementTypes = node.kind === 174 ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); + var elementTypes = node.kind === 175 ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); links.resolvedType = createTypeReference(target, elementTypes); } } return links.resolvedType; } function isReadonlyTypeOperator(node) { - return ts.isTypeOperatorNode(node) && node.operator === 138; + return ts.isTypeOperatorNode(node) && node.operator === 139; } function createTupleTypeOfArity(arity, minLength, hasRestElement, readonly, associatedNames) { var typeParameters; @@ -37384,7 +37519,7 @@ var ts; } if (!(flags & 131072)) { includes |= flags & 71041023; - if (flags & 66846720) + if (flags & 201064448) includes |= 262144; if (type === wildcardType) includes |= 8388608; @@ -37502,7 +37637,7 @@ var ts; neverType; } } - var objectFlags = (includes & 66994211 ? 0 : 262144) | + var objectFlags = (includes & 201211939 ? 0 : 262144) | (includes & 2097152 ? 268435456 : 0); return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments); } @@ -37805,7 +37940,7 @@ var ts; type = getReducedType(type); return type.flags & 1048576 ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : type.flags & 2097152 ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : - maybeTypeOfKind(type, 58982400) ? getIndexTypeForGenericType(type, stringsOnly) : + maybeTypeOfKind(type, 193200128) ? getIndexTypeForGenericType(type, stringsOnly) : ts.getObjectFlags(type) & 32 ? filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 | 4)); }) : type === wildcardType ? wildcardType : type.flags & 2 ? neverType : @@ -37827,20 +37962,24 @@ var ts; return indexType.flags & 131072 ? stringType : indexType; } function getTypeFromTypeOperatorNode(node) { + var _a; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 134: + case 135: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 147: - links.resolvedType = node.type.kind === 144 + case 148: + links.resolvedType = node.type.kind === 145 ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : errorType; break; - case 138: + case 139: links.resolvedType = getTypeFromTypeNode(node.type); break; + case 128: + links.resolvedType = (_a = getAwaitedType(getTypeFromTypeNode(node.type))) !== null && _a !== void 0 ? _a : unknownType; + break; default: throw ts.Debug.assertNever(node.operator); } @@ -37866,13 +38005,13 @@ var ts; if (type.flags & 2097152) { return ts.some(type.types, isJSLiteralType); } - if (type.flags & 63176704) { + if (type.flags & 197394432) { return isJSLiteralType(getResolvedBaseConstraint(type)); } return false; } function getPropertyNameFromIndex(indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 195 ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 196 ? accessNode : undefined; return isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, false) ? @@ -37882,7 +38021,7 @@ var ts; undefined; } function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags) { - var accessExpression = accessNode && accessNode.kind === 195 ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 196 ? accessNode : undefined; var propName = accessNode && ts.isPrivateIdentifier(accessNode) ? undefined : getPropertyNameFromIndex(indexType, accessNode); if (propName !== undefined) { var prop = getPropertyOfType(objectType, propName); @@ -38019,9 +38158,9 @@ var ts; } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 195 ? accessNode.argumentExpression : - accessNode.kind === 185 ? accessNode.indexType : - accessNode.kind === 154 ? accessNode.expression : + return accessNode.kind === 196 ? accessNode.argumentExpression : + accessNode.kind === 186 ? accessNode.indexType : + accessNode.kind === 155 ? accessNode.expression : accessNode; } function isGenericObjectType(type) { @@ -38032,7 +38171,7 @@ var ts; } return !!(type.objectFlags & 8388608); } - return !!(type.flags & 58982400) || isGenericMappedType(type); + return !!(type.flags & 193200128) || isGenericMappedType(type); } function isGenericIndexType(type) { if (type.flags & 3145728) { @@ -38042,7 +38181,7 @@ var ts; } return !!(type.objectFlags & 33554432); } - return !!(type.flags & (58982400 | 4194304)); + return !!(type.flags & (193200128 | 4194304)); } function isThisTypeParameter(type) { return !!(type.flags & 262144 && type.isThisType); @@ -38082,7 +38221,7 @@ var ts; if (distributedOverIndex) { return type[cache] = distributedOverIndex; } - if (!(indexType.flags & 63176704)) { + if (!(indexType.flags & 197394432)) { var distributedOverObject = distributeIndexOverObjectType(objectType, indexType, writing); if (distributedOverObject) { return type[cache] = distributedOverObject; @@ -38135,7 +38274,7 @@ var ts; if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304) && isTypeAssignableToKind(indexType, 4 | 8)) { indexType = stringType; } - if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 185) && isGenericObjectType(objectType)) { + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 186) && isGenericObjectType(objectType)) { if (objectType.flags & 3) { return objectType; } @@ -38179,7 +38318,7 @@ var ts; links.resolvedType = resolved.flags & 8388608 && resolved.objectType === objectType && resolved.indexType === indexType ? - getConstrainedTypeVariable(resolved, node) : resolved; + getConditionalFlowTypeOfType(resolved, node) : resolved; } return links.resolvedType; } @@ -38197,7 +38336,7 @@ var ts; } function getActualTypeVariable(type) { if (type.flags & 33554432) { - return type.typeVariable; + return type.baseType; } if (type.flags & 8388608 && (type.objectType.flags & 33554432 || type.indexType.flags & 33554432)) { @@ -38218,7 +38357,7 @@ var ts; if (!checkTypeInstantiable || !ts.some(root.inferTypeParameters, function (t) { return t === extendsType; })) { inferTypes(context.inferences, checkType, extendsType, 128 | 256); } - combinedMapper = combineTypeMappers(mapper, context.mapper); + combinedMapper = mergeTypeMappers(mapper, context.mapper); } var inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType; if (!checkTypeInstantiable && !isGenericObjectType(inferredExtendsType) && !isGenericIndexType(inferredExtendsType)) { @@ -38394,7 +38533,7 @@ var ts; } function getAliasSymbolForTypeNode(node) { var host = node.parent; - while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 138) { + while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 139) { host = host.parent; } return ts.isTypeAlias(host) ? getSymbolOfNode(host) : undefined; @@ -38449,7 +38588,7 @@ var ts; return spread; } } - function getSpreadType(left, right, symbol, objectFlags, readonly, isParentTypeNullable) { + function getSpreadType(left, right, symbol, objectFlags, readonly) { if (left.flags & 1 || right.flags & 1) { return anyType; } @@ -38465,16 +38604,16 @@ var ts; if (left.flags & 1048576) { var merged = tryMergeUnionOfObjectTypeAndEmptyObject(left, readonly); if (merged) { - return getSpreadType(merged, right, symbol, objectFlags, readonly, isParentTypeNullable); + return getSpreadType(merged, right, symbol, objectFlags, readonly); } - return mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly, isParentTypeNullable); }); + return mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly); }); } if (right.flags & 1048576) { var merged = tryMergeUnionOfObjectTypeAndEmptyObject(right, readonly); if (merged) { - return getSpreadType(left, merged, symbol, objectFlags, readonly, maybeTypeOfKind(right, 98304)); + return getSpreadType(left, merged, symbol, objectFlags, readonly); } - return mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly, maybeTypeOfKind(right, 98304)); }); + return mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly); }); } if (right.flags & (528 | 296 | 2112 | 132 | 1056 | 67108864 | 4194304)) { return left; @@ -38532,14 +38671,6 @@ var ts; result.nameType = getSymbolLinks(leftProp).nameType; members.set(leftProp.escapedName, result); } - else if (strictNullChecks && - !isParentTypeNullable && - symbol && - !isFromSpreadAssignment(leftProp, symbol) && - isFromSpreadAssignment(rightProp, symbol) && - !maybeTypeOfKind(rightType, 98304)) { - error(leftProp.valueDeclaration, ts.Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, ts.unescapeLeadingUnderscores(leftProp.escapedName)); - } } else { members.set(leftProp.escapedName, getSpreadSymbol(leftProp, readonly)); @@ -38633,7 +38764,7 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 246)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 247)) { if (!ts.hasModifier(container, 32) && (!ts.isConstructorDeclaration(container) || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -38660,88 +38791,91 @@ var ts; return links.resolvedType; } function getTypeFromTypeNode(node) { + return getConditionalFlowTypeOfType(getTypeFromTypeNodeWorker(node), node); + } + function getTypeFromTypeNodeWorker(node) { switch (node.kind) { case 125: - case 295: case 296: + case 297: return anyType; - case 148: + case 149: return unknownType; - case 143: + case 144: return stringType; - case 140: + case 141: return numberType; - case 151: + case 152: return bigintType; - case 128: + case 129: return booleanType; - case 144: + case 145: return esSymbolType; case 110: return voidType; - case 146: + case 147: return undefinedType; case 100: return nullType; - case 137: + case 138: return neverType; - case 141: + case 142: return node.flags & 131072 && !noImplicitAny ? anyType : nonPrimitiveType; - case 183: + case 184: case 104: return getTypeFromThisTypeNode(node); - case 187: + case 188: return getTypeFromLiteralTypeNode(node); - case 169: + case 170: return getTypeFromTypeReference(node); - case 168: + case 169: return node.assertsModifier ? voidType : booleanType; - case 216: + case 217: return getTypeFromTypeReference(node); - case 172: + case 173: return getTypeFromTypeQueryNode(node); - case 174: case 175: - return getTypeFromArrayOrTupleTypeNode(node); case 176: + return getTypeFromArrayOrTupleTypeNode(node); + case 177: return getTypeFromOptionalTypeNode(node); - case 178: - return getTypeFromUnionTypeNode(node); case 179: + return getTypeFromUnionTypeNode(node); + case 180: return getTypeFromIntersectionTypeNode(node); - case 297: + case 298: return getTypeFromJSDocNullableTypeNode(node); - case 299: + case 300: return addOptionality(getTypeFromTypeNode(node.type)); - case 182: - case 298: - case 294: + case 183: + case 299: + case 295: return getTypeFromTypeNode(node.type); - case 177: + case 178: return getElementTypeOfArrayType(getTypeFromTypeNode(node.type)) || errorType; - case 301: + case 302: return getTypeFromJSDocVariadicType(node); - case 170: case 171: - case 173: - case 304: - case 300: + case 172: + case 174: case 305: + case 301: + case 306: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 184: - return getTypeFromTypeOperatorNode(node); case 185: - return getTypeFromIndexedAccessTypeNode(node); + return getTypeFromTypeOperatorNode(node); case 186: + return getTypeFromIndexedAccessTypeNode(node); + case 187: return getTypeFromMappedTypeNode(node); - case 180: - return getTypeFromConditionalTypeNode(node); case 181: + return getTypeFromConditionalTypeNode(node); + case 182: return getTypeFromInferTypeNode(node); - case 188: + case 189: return getTypeFromImportTypeNode(node); case 75: - case 153: + case 154: var symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -38771,55 +38905,65 @@ var ts; function instantiateSignatures(signatures, mapper) { return instantiateList(signatures, mapper, instantiateSignature); } - function makeUnaryTypeMapper(source, target) { - return function (t) { return t === source ? target : t; }; + function createTypeMapper(sources, targets) { + return sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : makeArrayTypeMapper(sources, targets); } - function makeBinaryTypeMapper(source1, target1, source2, target2) { - return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; }; + function getMappedType(type, mapper) { + switch (mapper.kind) { + case 0: + return type === mapper.source ? mapper.target : type; + case 1: + var sources = mapper.sources; + var targets = mapper.targets; + for (var i = 0; i < sources.length; i++) { + if (type === sources[i]) { + return targets ? targets[i] : anyType; + } + } + return type; + case 2: + return mapper.func(type); + case 3: + case 4: + var t1 = getMappedType(type, mapper.mapper1); + return t1 !== type && mapper.kind === 3 ? instantiateType(t1, mapper.mapper2) : getMappedType(t1, mapper.mapper2); + } + } + function makeUnaryTypeMapper(source, target) { + return { kind: 0, source: source, target: target }; } function makeArrayTypeMapper(sources, targets) { - return function (t) { - for (var i = 0; i < sources.length; i++) { - if (t === sources[i]) { - return targets ? targets[i] : anyType; - } - } - return t; - }; + return { kind: 1, sources: sources, targets: targets }; } - function createTypeMapper(sources, targets) { - ts.Debug.assert(targets === undefined || sources.length === targets.length); - return sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : - sources.length === 2 ? makeBinaryTypeMapper(sources[0], targets ? targets[0] : anyType, sources[1], targets ? targets[1] : anyType) : - makeArrayTypeMapper(sources, targets); + function makeFunctionTypeMapper(func) { + return { kind: 2, func: func }; + } + function makeCompositeTypeMapper(kind, mapper1, mapper2) { + return { kind: kind, mapper1: mapper1, mapper2: mapper2 }; } function createTypeEraser(sources) { return createTypeMapper(sources, undefined); } function createBackreferenceMapper(context, index) { - return function (t) { return ts.findIndex(context.inferences, function (info) { return info.typeParameter === t; }) >= index ? unknownType : t; }; + return makeFunctionTypeMapper(function (t) { return ts.findIndex(context.inferences, function (info) { return info.typeParameter === t; }) >= index ? unknownType : t; }); } function combineTypeMappers(mapper1, mapper2) { - if (!mapper1) - return mapper2; - if (!mapper2) - return mapper1; - return function (t) { return instantiateType(mapper1(t), mapper2); }; + return mapper1 ? makeCompositeTypeMapper(3, mapper1, mapper2) : mapper2; + } + function mergeTypeMappers(mapper1, mapper2) { + return mapper1 ? makeCompositeTypeMapper(4, mapper1, mapper2) : mapper2; } - function createReplacementMapper(source, target, baseMapper) { - return function (t) { return t === source ? target : baseMapper(t); }; + function prependTypeMapping(source, target, mapper) { + return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(4, makeUnaryTypeMapper(source, target), mapper); } - function permissiveMapper(type) { - return type.flags & 262144 ? wildcardType : type; + function appendTypeMapping(mapper, source, target) { + return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(4, mapper, makeUnaryTypeMapper(source, target)); } function getRestrictiveTypeParameter(tp) { return tp.constraint === unknownType ? tp : tp.restrictiveInstantiation || (tp.restrictiveInstantiation = createTypeParameter(tp.symbol), tp.restrictiveInstantiation.constraint = unknownType, tp.restrictiveInstantiation); } - function restrictiveMapper(type) { - return type.flags & 262144 ? getRestrictiveTypeParameter(type) : type; - } function cloneTypeParameter(typeParameter) { var result = createTypeParameter(typeParameter.symbol); result.target = typeParameter; @@ -38845,7 +38989,7 @@ var ts; } function instantiateSymbol(symbol, mapper) { var links = getSymbolLinks(symbol); - if (links.type && !maybeTypeOfKind(links.type, 524288 | 63176704)) { + if (links.type && !couldContainTypeVariables(links.type)) { return symbol; } if (ts.getCheckFlags(symbol) & 1) { @@ -38897,7 +39041,8 @@ var ts; } } if (typeParameters.length) { - var typeArguments = ts.map(typeParameters, combineTypeMappers(type.mapper, mapper)); + var combinedMapper_1 = combineTypeMappers(type.mapper, mapper); + var typeArguments = ts.map(typeParameters, function (t) { return getMappedType(t, combinedMapper_1); }); var id = getTypeListId(typeArguments); var result = links.instantiations.get(id); if (!result) { @@ -38912,15 +39057,15 @@ var ts; return type; } function maybeTypeParameterReference(node) { - return !(node.kind === 153 || - node.parent.kind === 169 && node.parent.typeArguments && node === node.parent.typeName || - node.parent.kind === 188 && node.parent.typeArguments && node === node.parent.qualifier); + return !(node.kind === 154 || + node.parent.kind === 170 && node.parent.typeArguments && node === node.parent.typeName || + node.parent.kind === 189 && node.parent.typeArguments && node === node.parent.qualifier); } function isTypeParameterPossiblyReferenced(tp, node) { if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container = tp.symbol.declarations[0].parent; for (var n = node; n !== container; n = n.parent) { - if (!n || n.kind === 223 || n.kind === 180 && ts.forEachChild(n.extendsType, containsReference)) { + if (!n || n.kind === 224 || n.kind === 181 && ts.forEachChild(n.extendsType, containsReference)) { return true; } } @@ -38929,12 +39074,12 @@ var ts; return true; function containsReference(node) { switch (node.kind) { - case 183: + case 184: return !!tp.isThisType; case 75: return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) && - getTypeFromTypeNode(node) === tp; - case 172: + getTypeFromTypeNodeWorker(node) === tp; + case 173: return true; } return !!ts.forEachChild(node, containsReference); @@ -38956,8 +39101,8 @@ var ts; var mappedTypeVariable = instantiateType(typeVariable, mapper); if (typeVariable !== mappedTypeVariable) { return mapType(getReducedType(mappedTypeVariable), function (t) { - if (t.flags & (3 | 58982400 | 524288 | 2097152) && t !== wildcardType && t !== errorType) { - var replacementMapper = createReplacementMapper(typeVariable, t, mapper); + if (t.flags & (3 | 193200128 | 524288 | 2097152) && t !== wildcardType && t !== errorType) { + var replacementMapper = prependTypeMapping(typeVariable, t, mapper); return isArrayType(t) ? instantiateMappedArrayType(t, type, replacementMapper) : isTupleType(t) ? instantiateMappedTupleType(t, type, replacementMapper) : instantiateAnonymousType(type, replacementMapper); @@ -38990,7 +39135,7 @@ var ts; createTupleType(elementTypes, newMinLength, tupleType.target.hasRestElement, newReadonly, tupleType.target.associatedNames); } function instantiateMappedTypeTemplate(type, key, isOptional, mapper) { - var templateMapper = combineTypeMappers(mapper, createTypeMapper([getTypeParameterFromMappedType(type)], [key])); + var templateMapper = appendTypeMapping(mapper, getTypeParameterFromMappedType(type), key); var propType = instantiateType(getTemplateTypeFromMappedType(type.target || type), templateMapper); var modifiers = getMappedTypeModifiers(type); return strictNullChecks && modifiers & 4 && !maybeTypeOfKind(propType, 32768 | 16384) ? getOptionalType(propType) : @@ -39016,7 +39161,7 @@ var ts; function getConditionalTypeInstantiation(type, mapper) { var root = type.root; if (root.outerTypeParameters) { - var typeArguments = ts.map(root.outerTypeParameters, mapper); + var typeArguments = ts.map(root.outerTypeParameters, function (t) { return getMappedType(t, mapper); }); var id = getTypeListId(typeArguments); var result = root.instantiations.get(id); if (!result) { @@ -39031,15 +39176,15 @@ var ts; function instantiateConditionalType(root, mapper) { if (root.isDistributive) { var checkType_1 = root.checkType; - var instantiatedType = mapper(checkType_1); + var instantiatedType = getMappedType(checkType_1, mapper); if (checkType_1 !== instantiatedType && instantiatedType.flags & (1048576 | 131072)) { - return mapType(instantiatedType, function (t) { return getConditionalType(root, createReplacementMapper(checkType_1, t, mapper)); }); + return mapType(instantiatedType, function (t) { return getConditionalType(root, prependTypeMapping(checkType_1, t, mapper)); }); } } return getConditionalType(root, mapper); } function instantiateType(type, mapper) { - if (!type || !mapper || mapper === identityMapper) { + if (!type || !mapper) { return type; } if (instantiationDepth === 50 || instantiationCount >= 5000000) { @@ -39054,9 +39199,10 @@ var ts; return result; } function instantiateTypeWorker(type, mapper) { + var _a; var flags = type.flags; if (flags & 262144) { - return mapper(type); + return getMappedType(type, mapper); } if (flags & 524288) { var objectFlags = type.objectFlags; @@ -39098,8 +39244,11 @@ var ts; if (flags & 16777216) { return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper)); } + if (flags & 134217728) { + return (_a = getAwaitedType(instantiateType(type.awaitedType, mapper))) !== null && _a !== void 0 ? _a : unknownType; + } if (flags & 33554432) { - var maybeVariable = instantiateType(type.typeVariable, mapper); + var maybeVariable = instantiateType(type.baseType, mapper); if (maybeVariable.flags & 8650752) { return getSubstitutionType(maybeVariable, instantiateType(type.substitute, mapper)); } @@ -39132,34 +39281,34 @@ var ts; return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration); } function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 161 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 201: case 202: - case 161: - case 244: + case 203: + case 162: + case 245: return isContextSensitiveFunctionLikeDeclaration(node); - case 193: + case 194: return ts.some(node.properties, isContextSensitive); - case 192: + case 193: return ts.some(node.elements, isContextSensitive); - case 210: + case 211: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 209: + case 210: return (node.operatorToken.kind === 56 || node.operatorToken.kind === 60) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 281: + case 282: return isContextSensitive(node.initializer); - case 200: + case 201: return isContextSensitive(node.expression); - case 274: + case 275: return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive); - case 273: { + case 274: { var initializer = node.initializer; return !!initializer && isContextSensitive(initializer); } - case 276: { + case 277: { var expression = node.expression; return !!expression && isContextSensitive(expression); } @@ -39175,7 +39324,7 @@ var ts; if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 202) { + if (node.kind !== 203) { var parameter = ts.firstOrUndefined(node.parameters); if (!(parameter && ts.parameterIsThisKeyword(parameter))) { return true; @@ -39185,7 +39334,7 @@ var ts; return false; } function hasContextSensitiveReturnExpression(node) { - return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 223 && isContextSensitive(node.body); + return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 224 && isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && @@ -39229,7 +39378,7 @@ var ts; function isTypeDerivedFrom(source, target) { return source.flags & 1048576 ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) : target.flags & 1048576 ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) : - source.flags & 58982400 ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : + source.flags & 193200128 ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : target === globalObjectType ? !!(source.flags & (524288 | 67108864)) : target === globalFunctionType ? !!(source.flags & 524288) && isFunctionObjectType(source) : hasBaseType(source, getTargetType(target)); @@ -39265,23 +39414,23 @@ var ts; return true; } switch (node.kind) { - case 276: - case 200: + case 277: + case 201: return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 209: + case 210: switch (node.operatorToken.kind) { case 62: case 27: return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; - case 193: + case 194: return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 192: + case 193: return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 274: + case 275: return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 202: + case 203: return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); } return false; @@ -39459,16 +39608,16 @@ var ts; } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 276: + case 277: return { errorNode: child, innerExpression: child.expression, nameType: nameType }; case 11: if (child.containsOnlyTriviaWhiteSpaces) { break; } return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() }; - case 266: case 267: - case 270: + case 268: + case 271: return { errorNode: child, innerExpression: child, nameType: nameType }; default: return ts.Debug.assertNever(child, "Found invalid jsx child"); @@ -39613,11 +39762,11 @@ var ts; } _b = prop.kind; switch (_b) { + case 165: return [3, 2]; case 164: return [3, 2]; - case 163: return [3, 2]; - case 161: return [3, 2]; - case 282: return [3, 2]; - case 281: return [3, 4]; + case 162: return [3, 2]; + case 283: return [3, 2]; + case 282: return [3, 4]; } return [3, 6]; case 2: return [4, { errorNode: prop.name, innerExpression: undefined, nameType: type }]; @@ -39681,8 +39830,8 @@ var ts; return 0; } var kind = target.declaration ? target.declaration.kind : 0; - var strictVariance = !(checkMode & 3) && strictFunctionTypes && kind !== 161 && - kind !== 160 && kind !== 162; + var strictVariance = !(checkMode & 3) && strictFunctionTypes && kind !== 162 && + kind !== 161 && kind !== 163; var result = -1; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -39923,7 +40072,7 @@ var ts; return !!(related & 1); } } - if (source.flags & 66846720 || target.flags & 66846720) { + if (source.flags & 201064448 || target.flags & 201064448) { return checkTypeRelatedTo(source, target, relation, undefined); } return false; @@ -39936,7 +40085,7 @@ var ts; var t = isFreshLiteralType(type) ? type.regularType : ts.getObjectFlags(type) & 4 && type.node ? createTypeReference(type.target, getTypeArguments(type)) : type.flags & 3145728 ? getReducedType(type) : - type.flags & 33554432 ? writing ? type.typeVariable : type.substitute : + type.flags & 33554432 ? writing ? type.baseType : type.substitute : type.flags & 25165824 ? getSimplifiedType(type, writing) : type; if (t === type) @@ -40131,8 +40280,15 @@ var ts; if (incompatibleStack.length) reportIncompatibleStack(); var _a = getTypeNamesForErrorDisplay(source, target), sourceType = _a[0], targetType = _a[1]; - if (target.flags & 262144 && target.immediateBaseConstraint !== undefined && isTypeAssignableTo(source, target.immediateBaseConstraint)) { - reportError(ts.Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2, sourceType, targetType, typeToString(target.immediateBaseConstraint)); + if (target.flags & 262144) { + var constraint = getBaseConstraintOfType(target); + var constraintElab = constraint && isTypeAssignableTo(source, constraint); + if (constraintElab) { + reportError(ts.Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2, sourceType, targetType, typeToString(constraint)); + } + else { + reportError(ts.Diagnostics._0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1, targetType, sourceType); + } } if (!message) { if (relation === comparableRelation) { @@ -40233,7 +40389,7 @@ var ts; if (source.flags & 1048576) { result = relation === comparableRelation ? someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068), intersectionState) : - eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068)); + eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068), intersectionState & 4); } else { if (target.flags & 1048576) { @@ -40241,16 +40397,18 @@ var ts; } else if (target.flags & 2097152) { result = typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2); - if (result && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks)) { - if (!propertiesRelatedTo(source, target, reportErrors, undefined, 0)) { + if (result && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) && !(intersectionState & 4)) { + if (!propertiesRelatedTo(source, target, reportErrors, undefined, 4)) { return 0; } } } else if (source.flags & 2097152) { - result = someTypeRelatedToType(source, target, false, 1); + if (!isNonGenericObjectType(target) || !ts.every(source.types, function (t) { return isNonGenericObjectType(t) && !(ts.getObjectFlags(t) & 2097152); })) { + result = someTypeRelatedToType(source, target, false, 1); + } } - if (!result && (source.flags & 66846720 || target.flags & 66846720)) { + if (!result && (source.flags & 201064448 || target.flags & 201064448)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) { resetErrorInfo(saveErrorInfo); } @@ -40453,12 +40611,12 @@ var ts; } return 0; } - function eachTypeRelatedToType(source, target, reportErrors) { + function eachTypeRelatedToType(source, target, reportErrors, intersectionState) { var result = -1; var sourceTypes = source.types; for (var _i = 0, sourceTypes_2 = sourceTypes; _i < sourceTypes_2.length; _i++) { var sourceType = sourceTypes_2[_i]; - var related = isRelatedTo(sourceType, target, reportErrors); + var related = isRelatedTo(sourceType, target, reportErrors, undefined, intersectionState); if (!related) { return 0; } @@ -40524,10 +40682,10 @@ var ts; if (outofbandVarianceMarkerHandler) { var saved = entry & 24; if (saved & 8) { - instantiateType(source, reportUnmeasurableMarkers); + instantiateType(source, makeFunctionTypeMapper(reportUnmeasurableMarkers)); } if (saved & 16) { - instantiateType(source, reportUnreliableMarkers); + instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers)); } } return entry & 1 ? -1 : 0; @@ -40565,7 +40723,8 @@ var ts; if (outofbandVarianceMarkerHandler) { originalHandler = outofbandVarianceMarkerHandler; outofbandVarianceMarkerHandler = function (onlyUnreliable) { - propagatingVarianceFlags |= onlyUnreliable ? 16 : 8; + propagatingVarianceFlags |= + onlyUnreliable ? 16 : 8; return originalHandler(onlyUnreliable); }; } @@ -40676,6 +40835,13 @@ var ts; } } } + else if (target.flags & 134217728 && source.flags & 134217728) { + var targetType = target.awaitedType; + var sourceType = instantiateType(source.awaitedType, makeFunctionTypeMapper(reportUnreliableMarkers)); + if (result = isRelatedTo(sourceType, targetType, reportErrors)) { + return result; + } + } else if (isGenericMappedType(target)) { var template = getTemplateTypeFromMappedType(target); var modifiers = getMappedTypeModifiers(target); @@ -40778,6 +40944,15 @@ var ts; } } } + else if (source.flags & 134217728) { + var constraint = getConstraintOfType(source.awaitedType); + var awaitedConstraint = constraint && getAwaitedType(constraint); + if (awaitedConstraint) { + if (result = isRelatedTo(awaitedConstraint, target, reportErrors)) { + return result; + } + } + } else { if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target) && isEmptyObjectType(source)) { return -1; @@ -40891,7 +41066,7 @@ var ts; if (modifiersRelated) { var result_6; var targetConstraint = getConstraintTypeFromMappedType(target); - var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers); + var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers)); if (result_6 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) { var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); return result_6 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); @@ -41301,7 +41476,7 @@ var ts; return function (source, target) { return reportIncompatibleError(ts.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible, typeToString(source), typeToString(target)); }; } function signatureRelatedTo(source, target, erase, reportErrors, incompatibleReporter) { - return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 : 0, reportErrors, reportError, incompatibleReporter, isRelatedTo, reportUnreliableMarkers); + return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 : 0, reportErrors, reportError, incompatibleReporter, isRelatedTo, makeFunctionTypeMapper(reportUnreliableMarkers)); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -41441,10 +41616,6 @@ var ts; var match = discriminable.indexOf(true); return match === -1 || discriminable.indexOf(true, match + 1) !== -1 ? defaultValue : target.types[match]; } - function isFromSpreadAssignment(prop, container) { - var _a; - return ((_a = prop.valueDeclaration) === null || _a === void 0 ? void 0 : _a.parent) !== container.valueDeclaration; - } function isWeakType(type) { if (type.flags & 524288) { var resolved = resolveStructuredTypeMembers(type); @@ -41499,13 +41670,11 @@ var ts; variance = 4; } outofbandVarianceMarkerHandler = oldHandler; - if (unmeasurable || unreliable) { - if (unmeasurable) { - variance |= 8; - } - if (unreliable) { - variance |= 16; - } + if (unmeasurable) { + variance |= 8; + } + if (unreliable) { + variance |= 16; } variances.push(variance); }; @@ -42168,12 +42337,12 @@ var ts; } var diagnostic; switch (declaration.kind) { - case 209: + case 210: + case 160: case 159: - case 158: diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 156: + case 157: var param = declaration; if (ts.isIdentifier(param.name) && (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && @@ -42188,22 +42357,22 @@ var ts; noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 191: + case 192: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; if (!noImplicitAny) { return; } break; - case 300: + case 301: error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 244: + case 245: + case 162: case 161: - case 160: - case 163: case 164: - case 201: + case 165: case 202: + case 203: if (noImplicitAny && !declaration.name) { if (wideningKind === 1) { error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); @@ -42217,7 +42386,7 @@ var ts; wideningKind === 1 ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 186: + case 187: if (noImplicitAny) { error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } @@ -42278,8 +42447,8 @@ var ts; signature: signature, flags: flags, compareTypes: compareTypes, - mapper: function (t) { return mapToInferredType(context, t, true); }, - nonFixingMapper: function (t) { return mapToInferredType(context, t, false); }, + mapper: makeFunctionTypeMapper(function (t) { return mapToInferredType(context, t, true); }), + nonFixingMapper: makeFunctionTypeMapper(function (t) { return mapToInferredType(context, t, false); }), }; return context; } @@ -42341,7 +42510,7 @@ var ts; if (objectFlags & 67108864) { return !!(objectFlags & 134217728); } - var result = !!(type.flags & 63176704 || + var result = !!(type.flags & 197394432 || objectFlags & 4 && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 && type.symbol && type.symbol.flags & (16 | 8192 | 32 | 2048 | 4096) && type.symbol.declarations || objectFlags & (32 | 131072) || @@ -42581,7 +42750,7 @@ var ts; } else if (target.flags & 8388608) { var indexType = getSimplifiedType(target.indexType, false); - if (indexType.flags & 63176704) { + if (indexType.flags & 197394432) { var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, false), indexType, false); if (simplified_1 && simplified_1 !== target) { invokeOnce(source, simplified_1, inferFromTypes); @@ -42615,6 +42784,9 @@ var ts; inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } + else if (source.flags & 134217728 && target.flags & 134217728) { + inferFromTypes(source.awaitedType, target.awaitedType); + } else if (target.flags & 16777216) { var savePriority = priority; priority |= contravariant ? 16 : 0; @@ -42622,6 +42794,10 @@ var ts; inferToMultipleTypes(source, targetTypes, target.flags); priority = savePriority; } + else if (target.flags & 134217728) { + var targetTypes = [target.awaitedType, createPromiseLikeType(target.awaitedType)]; + inferToMultipleTypes(source, targetTypes, target.flags); + } else if (target.flags & 3145728) { inferToMultipleTypes(source, target.types, target.flags); } @@ -42634,7 +42810,7 @@ var ts; } else { source = getReducedType(source); - if (!(priority & 128 && source.flags & (2097152 | 63176704))) { + if (!(priority & 128 && source.flags & (2097152 | 197394432))) { var apparentSource = getApparentType(source); if (apparentSource !== source && allowComplexConstraintInference && !(apparentSource.flags & (524288 | 2097152))) { allowComplexConstraintInference = false; @@ -42865,6 +43041,32 @@ var ts; } } if (!typesDefinitelyUnrelated(source, target)) { + if (isArrayType(source) || isTupleType(source)) { + if (isTupleType(target)) { + var sourceLength = isTupleType(source) ? getLengthOfTupleType(source) : 0; + var targetLength = getLengthOfTupleType(target); + var sourceRestType = isTupleType(source) ? getRestTypeOfTupleType(source) : getElementTypeOfArrayType(source); + var targetRestType = getRestTypeOfTupleType(target); + var fixedLength = targetLength < sourceLength || sourceRestType ? targetLength : sourceLength; + for (var i = 0; i < fixedLength; i++) { + inferFromTypes(i < sourceLength ? getTypeArguments(source)[i] : sourceRestType, getTypeArguments(target)[i]); + } + if (targetRestType) { + var types = fixedLength < sourceLength ? getTypeArguments(source).slice(fixedLength, sourceLength) : []; + if (sourceRestType) { + types.push(sourceRestType); + } + if (types.length) { + inferFromTypes(getUnionType(types), targetRestType); + } + } + return; + } + if (isArrayType(target)) { + inferFromIndexTypes(source, target); + return; + } + } inferFromProperties(source, target); inferFromSignatures(source, target, 0); inferFromSignatures(source, target, 1); @@ -42872,32 +43074,6 @@ var ts; } } function inferFromProperties(source, target) { - if (isArrayType(source) || isTupleType(source)) { - if (isTupleType(target)) { - var sourceLength = isTupleType(source) ? getLengthOfTupleType(source) : 0; - var targetLength = getLengthOfTupleType(target); - var sourceRestType = isTupleType(source) ? getRestTypeOfTupleType(source) : getElementTypeOfArrayType(source); - var targetRestType = getRestTypeOfTupleType(target); - var fixedLength = targetLength < sourceLength || sourceRestType ? targetLength : sourceLength; - for (var i = 0; i < fixedLength; i++) { - inferFromTypes(i < sourceLength ? getTypeArguments(source)[i] : sourceRestType, getTypeArguments(target)[i]); - } - if (targetRestType) { - var types = fixedLength < sourceLength ? getTypeArguments(source).slice(fixedLength, sourceLength) : []; - if (sourceRestType) { - types.push(sourceRestType); - } - if (types.length) { - inferFromTypes(getUnionType(types), targetRestType); - } - } - return; - } - if (isArrayType(target)) { - inferFromIndexTypes(source, target); - return; - } - } var properties = getPropertiesOfObjectType(target); for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { var targetProp = properties_3[_i]; @@ -42915,14 +43091,14 @@ var ts; var len = sourceLen < targetLen ? sourceLen : targetLen; var skipParameters = !!(ts.getObjectFlags(source) & 2097152); for (var i = 0; i < len; i++) { - inferFromSignature(getBaseSignature(sourceSignatures[sourceLen - len + i]), getBaseSignature(targetSignatures[targetLen - len + i]), skipParameters); + inferFromSignature(getBaseSignature(sourceSignatures[sourceLen - len + i]), getErasedSignature(targetSignatures[targetLen - len + i]), skipParameters); } } function inferFromSignature(source, target, skipParameters) { if (!skipParameters) { var saveBivariant = bivariant; var kind = target.declaration ? target.declaration.kind : 0; - bivariant = bivariant || kind === 161 || kind === 160 || kind === 162; + bivariant = bivariant || kind === 162 || kind === 161 || kind === 163; applyToParameterTypes(source, target, inferFromContravariantTypes); bivariant = saveBivariant; } @@ -43013,7 +43189,7 @@ var ts; else { var defaultType = getDefaultFromTypeParameter(inference.typeParameter); if (defaultType) { - inferredType = instantiateType(defaultType, combineTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper)); + inferredType = instantiateType(defaultType, mergeTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper)); } } } @@ -43074,7 +43250,7 @@ var ts; case "AsyncIterator": return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later; default: - if (node.parent.kind === 282) { + if (node.parent.kind === 283) { return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; } else { @@ -43091,7 +43267,7 @@ var ts; return links.resolvedSymbol; } function isInTypeQuery(node) { - return !!ts.findAncestor(node, function (n) { return n.kind === 172 ? true : n.kind === 75 || n.kind === 153 ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 173 ? true : n.kind === 75 || n.kind === 154 ? false : "quit"; }); } function getFlowCacheKey(node, declaredType, initialType, flowContainer) { switch (node.kind) { @@ -43100,11 +43276,11 @@ var ts; return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; case 104: return "0"; - case 218: - case 200: + case 219: + case 201: return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - case 194: case 195: + case 196: var propName = getAccessedPropertyName(node); if (propName !== undefined) { var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); @@ -43115,24 +43291,24 @@ var ts; } function isMatchingReference(source, target) { switch (target.kind) { - case 200: - case 218: + case 201: + case 219: return isMatchingReference(source, target.expression); } switch (source.kind) { case 75: return target.kind === 75 && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 242 || target.kind === 191) && + (target.kind === 243 || target.kind === 192) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 104: return target.kind === 104; case 102: return target.kind === 102; - case 218: - case 200: + case 219: + case 201: return isMatchingReference(source.expression, target); - case 194: case 195: + case 196: return ts.isAccessExpression(target) && getAccessedPropertyName(source) === getAccessedPropertyName(target) && isMatchingReference(source.expression, target.expression); @@ -43140,7 +43316,7 @@ var ts; return false; } function getAccessedPropertyName(access) { - return access.kind === 194 ? access.name.escapedText : + return access.kind === 195 ? access.name.escapedText : ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } @@ -43169,7 +43345,7 @@ var ts; if (prop.isDiscriminantProperty === undefined) { prop.isDiscriminantProperty = (prop.checkFlags & 192) === 192 && - !maybeTypeOfKind(getTypeOfSymbol(prop), 63176704); + !maybeTypeOfKind(getTypeOfSymbol(prop), 197394432); } return !!prop.isDiscriminantProperty; } @@ -43202,7 +43378,7 @@ var ts; } } } - if (callExpression.expression.kind === 194 && + if (callExpression.expression.kind === 195 && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -43311,7 +43487,7 @@ var ts; if (flags & 67108864) { return strictNullChecks ? 7888800 : 16736160; } - if (flags & 63176704) { + if (flags & 197394432) { return getTypeFacts(getBaseConstraintOfType(type) || unknownType); } if (flags & 3145728) { @@ -43348,15 +43524,15 @@ var ts; return createArrayType(checkIteratedTypeOrElementType(65, type, undefinedType, undefined) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 192 && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 281 && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 193 && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 282 && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 209 && parent.parent.left === parent || - parent.parent.kind === 232 && parent.parent.initializer === parent; + return parent.parent.kind === 210 && parent.parent.left === parent || + parent.parent.kind === 233 && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -43373,21 +43549,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 231: - return stringType; case 232: + return stringType; + case 233: return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || errorType; - case 209: + case 210: return getAssignedTypeOfBinaryExpression(parent); - case 203: + case 204: return undefinedType; - case 192: + case 193: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 213: + case 214: return getAssignedTypeOfSpreadExpression(parent); - case 281: - return getAssignedTypeOfPropertyAssignment(parent); case 282: + return getAssignedTypeOfPropertyAssignment(parent); + case 283: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return errorType; @@ -43395,7 +43571,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 189 ? + var type = pattern.kind === 190 ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : @@ -43410,30 +43586,30 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 231) { + if (node.parent.parent.kind === 232) { return stringType; } - if (node.parent.parent.kind === 232) { + if (node.parent.parent.kind === 233) { return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 242 ? + return node.kind === 243 ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function isEmptyArrayAssignment(node) { - return node.kind === 242 && node.initializer && + return node.kind === 243 && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 191 && node.parent.kind === 209 && + node.kind !== 192 && node.parent.kind === 210 && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 200: + case 201: return getReferenceCandidate(node.expression); - case 209: + case 210: switch (node.operatorToken.kind) { case 62: return getReferenceCandidate(node.left); @@ -43445,13 +43621,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 200 || - parent.kind === 209 && parent.operatorToken.kind === 62 && parent.left === node || - parent.kind === 209 && parent.operatorToken.kind === 27 && parent.right === node ? + return parent.kind === 201 || + parent.kind === 210 && parent.operatorToken.kind === 62 && parent.left === node || + parent.kind === 210 && parent.operatorToken.kind === 27 && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 277) { + if (clause.kind === 278) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -43467,18 +43643,19 @@ var ts; } return links.switchTypes; } - function getSwitchClauseTypeOfWitnesses(switchStatement) { + function getSwitchClauseTypeOfWitnesses(switchStatement, retainDefault) { var witnesses = []; for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) { var clause = _a[_i]; - if (clause.kind === 277) { + if (clause.kind === 278) { if (ts.isStringLiteralLike(clause.expression)) { witnesses.push(clause.expression.text); continue; } return ts.emptyArray; } - witnesses.push(undefined); + if (retainDefault) + witnesses.push(undefined); } return witnesses; } @@ -43616,12 +43793,12 @@ var ts; var root = getReferenceRoot(node); var parent = root.parent; var isLengthPushOrUnshift = ts.isPropertyAccessExpression(parent) && (parent.name.escapedText === "length" || - parent.parent.kind === 196 + parent.parent.kind === 197 && ts.isIdentifier(parent.name) && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 195 && + var isElementAssignment = parent.kind === 196 && parent.expression === root && - parent.parent.kind === 209 && + parent.parent.kind === 210 && parent.parent.operatorToken.kind === 62 && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -43629,8 +43806,8 @@ var ts; return isLengthPushOrUnshift || isElementAssignment; } function isDeclarationWithExplicitTypeAnnotation(declaration) { - return !!(declaration && (declaration.kind === 242 || declaration.kind === 156 || - declaration.kind === 159 || declaration.kind === 158) && + return !!(declaration && (declaration.kind === 243 || declaration.kind === 157 || + declaration.kind === 160 || declaration.kind === 159) && ts.getEffectiveTypeAnnotationNode(declaration)); } function getExplicitTypeOfSymbol(symbol, diagnostic) { @@ -43656,11 +43833,11 @@ var ts; return getExplicitThisType(node); case 102: return checkSuperExpression(node); - case 194: + case 195: var type = getTypeOfDottedName(node.expression, diagnostic); var prop = type && getPropertyOfType(type, node.name.escapedText); return prop && getExplicitTypeOfSymbol(prop, diagnostic); - case 200: + case 201: return getTypeOfDottedName(node.expression, diagnostic); } } @@ -43670,7 +43847,7 @@ var ts; var signature = links.effectsSignature; if (signature === undefined) { var funcType = void 0; - if (node.parent.kind === 226) { + if (node.parent.kind === 227) { funcType = getTypeOfDottedName(node.expression, undefined); } else if (node.expression.kind !== 102) { @@ -43714,7 +43891,7 @@ var ts; } function isFalseExpression(expr) { var node = ts.skipParentheses(expr); - return node.kind === 91 || node.kind === 209 && (node.operatorToken.kind === 55 && (isFalseExpression(node.left) || isFalseExpression(node.right)) || + return node.kind === 91 || node.kind === 210 && (node.operatorToken.kind === 55 && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 && isFalseExpression(node.left) && isFalseExpression(node.right)); } function isReachableFlowNodeWorker(flow, noCacheCheck) { @@ -43784,7 +43961,7 @@ var ts; if (flowAnalysisDisabled) { return errorType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 133970943)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 268188671)) { return declaredType; } flowInvocationCount++; @@ -43792,7 +43969,7 @@ var ts; var evolvedType = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode)); sharedFlowCount = sharedFlowStart; var resultType = ts.getObjectFlags(evolvedType) & 256 && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); - if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 218 && getTypeWithFacts(resultType, 2097152).flags & 131072) { + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 219 && getTypeWithFacts(resultType, 2097152).flags & 131072) { return declaredType; } return resultType; @@ -43867,8 +44044,8 @@ var ts; else if (flags & 2) { var container = flow.node; if (container && container !== flowContainer && - reference.kind !== 194 && reference.kind !== 195 && + reference.kind !== 196 && reference.kind !== 104) { flow = container.flowNode; continue; @@ -43889,7 +44066,7 @@ var ts; } function getInitialOrAssignedType(flow) { var node = flow.node; - return getConstraintForLocation(node.kind === 242 || node.kind === 191 ? + return getConstraintForLocation(node.kind === 243 || node.kind === 192 ? getInitialType(node) : getAssignedType(node), reference); } @@ -43921,13 +44098,13 @@ var ts; } if (ts.isVariableDeclaration(node) && (ts.isInJSFile(node) || ts.isVarConst(node))) { var init = ts.getDeclaredExpandoInitializer(node); - if (init && (init.kind === 201 || init.kind === 202)) { + if (init && (init.kind === 202 || init.kind === 203)) { return getTypeAtFlowNode(flow.antecedent); } } return declaredType; } - if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 231 && isMatchingReference(reference, node.parent.parent.expression)) { + if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 232 && isMatchingReference(reference, node.parent.parent.expression)) { return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))); } return undefined; @@ -43937,7 +44114,7 @@ var ts; if (node.kind === 91) { return unreachableNeverType; } - if (node.kind === 209) { + if (node.kind === 210) { if (node.operatorToken.kind === 55) { return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); } @@ -43968,7 +44145,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 196 ? + var expr = node.kind === 197 ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -43976,7 +44153,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256) { var evolvedType_1 = type; - if (node.kind === 196) { + if (node.kind === 197) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -44018,7 +44195,7 @@ var ts; if (isMatchingReference(reference, expr)) { type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } - else if (expr.kind === 204 && isMatchingReference(reference, expr.expression)) { + else if (expr.kind === 205 && isMatchingReference(reference, expr.expression)) { type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } else { @@ -44026,7 +44203,7 @@ var ts; if (optionalChainContainsReference(expr, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & (32768 | 131072)); }); } - else if (expr.kind === 204 && optionalChainContainsReference(expr.expression, reference)) { + else if (expr.kind === 205 && optionalChainContainsReference(expr.expression, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & 131072 || t.flags & 128 && t.value === "undefined"); }); } } @@ -44199,12 +44376,18 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 204 && ts.isStringLiteralLike(right_1)) { + if (left_1.kind === 205 && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 204 && ts.isStringLiteralLike(left_1)) { + if (right_1.kind === 205 && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } + if (ts.isConstructorAccessExpression(left_1)) { + return narrowTypeByConstructor(type, left_1, operator_1, right_1, assumeTrue); + } + if (ts.isConstructorAccessExpression(right_1)) { + return narrowTypeByConstructor(type, right_1, operator_1, left_1, assumeTrue); + } if (isMatchingReference(reference, left_1)) { return narrowTypeByEquality(type, operator_1, right_1, assumeTrue); } @@ -44322,7 +44505,7 @@ var ts; if (isTypeSubtypeOf(targetType, type)) { return targetType; } - if (type.flags & 63176704) { + if (type.flags & 197394432) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(targetType, constraint)) { return getIntersectionType([type, targetType]); @@ -44388,7 +44571,7 @@ var ts; if (isTypeSubtypeOf(candidate, type)) { return candidate; } - if (type.flags & 63176704) { + if (type.flags & 197394432) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(candidate, constraint)) { return getIntersectionType([type, candidate]); @@ -44398,7 +44581,7 @@ var ts; }; } function narrowBySwitchOnTypeOf(type, switchStatement, clauseStart, clauseEnd) { - var switchWitnesses = getSwitchClauseTypeOfWitnesses(switchStatement); + var switchWitnesses = getSwitchClauseTypeOfWitnesses(switchStatement, true); if (!switchWitnesses.length) { return type; } @@ -44426,6 +44609,38 @@ var ts; } return getTypeWithFacts(mapType(type, narrowTypeForTypeofSwitch(impliedType)), switchFacts); } + function narrowTypeByConstructor(type, constructorAccessExpr, operator, identifier, assumeTrue) { + if (assumeTrue ? (operator !== 34 && operator !== 36) : (operator !== 35 && operator !== 37)) { + return type; + } + if (!isMatchingReference(reference, constructorAccessExpr.expression)) { + return declaredType; + } + var identifierType = getTypeOfExpression(identifier); + if (!isFunctionType(identifierType) && !isConstructorType(identifierType)) { + return type; + } + var prototypeProperty = getPropertyOfType(identifierType, "prototype"); + if (!prototypeProperty) { + return type; + } + var prototypeType = getTypeOfSymbol(prototypeProperty); + var candidate = !isTypeAny(prototypeType) ? prototypeType : undefined; + if (!candidate || candidate === globalObjectType || candidate === globalFunctionType) { + return type; + } + if (isTypeAny(type)) { + return candidate; + } + return filterType(type, function (t) { return isConstructedBy(t, candidate); }); + function isConstructedBy(source, target) { + if (source.flags & 524288 && ts.getObjectFlags(source) & 1 || + target.flags & 524288 && ts.getObjectFlags(target) & 1) { + return source.symbol === target.symbol; + } + return isTypeSubtypeOf(source, target); + } + } function narrowTypeByInstanceof(type, expr, assumeTrue) { var left = getReferenceCandidate(expr.left); if (!isMatchingReference(reference, left)) { @@ -44506,16 +44721,16 @@ var ts; case 75: case 104: case 102: - case 194: case 195: - return narrowTypeByTruthiness(type, expr, assumeTrue); case 196: + return narrowTypeByTruthiness(type, expr, assumeTrue); + case 197: return narrowTypeByCallExpression(type, expr, assumeTrue); - case 200: + case 201: return narrowType(type, expr.expression, assumeTrue); - case 209: + case 210: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 207: + case 208: if (expr.operator === 53) { return narrowType(type, expr.operand, !assumeTrue); } @@ -44551,9 +44766,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 250 || - node.kind === 290 || - node.kind === 159; + node.kind === 251 || + node.kind === 291 || + node.kind === 160; }); } function isParameterAssigned(symbol) { @@ -44574,7 +44789,7 @@ var ts; if (node.kind === 75) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 156) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 157) { symbol.isAssigned = true; } } @@ -44589,7 +44804,7 @@ var ts; function removeOptionalityFromDeclaredType(declaredType, declaration) { if (pushTypeResolution(declaration.symbol, 2)) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 156 && + declaration.kind === 157 && declaration.initializer && getFalsyFlags(declaredType) & 32768 && !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768); @@ -44603,13 +44818,13 @@ var ts; } function isConstraintPosition(node) { var parent = node.parent; - return parent.kind === 194 || + return parent.kind === 195 || + parent.kind === 197 && parent.expression === node || parent.kind === 196 && parent.expression === node || - parent.kind === 195 && parent.expression === node || - parent.kind === 191 && parent.name === node && !!parent.initializer; + parent.kind === 192 && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { - return type.flags & 58982400 && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304); + return type.flags & 193200128 && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304); } function getConstraintForLocation(type, node) { if (type && isConstraintPosition(node) && forEachType(type, typeHasNullableConstraint)) { @@ -44638,7 +44853,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2) { - if (container.kind === 202) { + if (container.kind === 203) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasModifier(container, 256)) { @@ -44654,7 +44869,7 @@ var ts; var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); var declaration = localOrExportSymbol.valueDeclaration; if (localOrExportSymbol.flags & 32) { - if (declaration.kind === 245 + if (declaration.kind === 246 && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -44666,11 +44881,11 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 214) { + else if (declaration.kind === 215) { var container = ts.getThisContainer(node, false); - while (container.kind !== 290) { + while (container.kind !== 291) { if (container.parent === declaration) { - if (container.kind === 159 && ts.hasModifier(container, 32)) { + if (container.kind === 160 && ts.hasModifier(container, 32)) { getNodeLinks(declaration).flags |= 16777216; getNodeLinks(node).flags |= 33554432; } @@ -44714,22 +44929,22 @@ var ts; if (!declaration) { return type; } - var isParameter = ts.getRootDeclaration(declaration).kind === 156; + var isParameter = ts.getRootDeclaration(declaration).kind === 157; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; var isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && ts.isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent); var isModuleExports = symbol.flags & 134217728; - while (flowContainer !== declarationContainer && (flowContainer.kind === 201 || - flowContainer.kind === 202 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 202 || + flowContainer.kind === 203 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 | 16384)) !== 0 || - isInTypeQuery(node) || node.parent.kind === 263) || - node.parent.kind === 218 || - declaration.kind === 242 && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 264) || + node.parent.kind === 219 || + declaration.kind === 243 && declaration.exclamationToken || declaration.flags & 8388608; var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : @@ -44760,7 +44975,7 @@ var ts; if (languageVersion >= 2 || (symbol.flags & (2 | 32)) === 0 || ts.isSourceFile(symbol.valueDeclaration) || - symbol.valueDeclaration.parent.kind === 280) { + symbol.valueDeclaration.parent.kind === 281) { return; } var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); @@ -44778,7 +44993,7 @@ var ts; if (usedInFunction) { var capturesBlockScopeBindingInLoopBody = true; if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244); if (varDeclList && varDeclList.parent === container) { var part = getPartOfForStatementContainingNode(node.parent, container); if (part) { @@ -44797,7 +45012,7 @@ var ts; } } if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244); if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 4194304; } @@ -44814,14 +45029,14 @@ var ts; } function isAssignedInBodyOfForStatement(node, container) { var current = node; - while (current.parent.kind === 200) { + while (current.parent.kind === 201) { current = current.parent; } var isAssigned = false; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 207 || current.parent.kind === 208)) { + else if ((current.parent.kind === 208 || current.parent.kind === 209)) { var expr = current.parent; isAssigned = expr.operator === 45 || expr.operator === 46; } @@ -44832,7 +45047,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2; - if (container.kind === 159 || container.kind === 162) { + if (container.kind === 160 || container.kind === 163) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4; } @@ -44876,32 +45091,32 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var capturedByArrowFunction = false; - if (container.kind === 162) { + if (container.kind === 163) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } - if (container.kind === 202) { + if (container.kind === 203) { container = ts.getThisContainer(container, false); capturedByArrowFunction = true; } switch (container.kind) { - case 249: + case 250: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); break; - case 248: + case 249: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 162: + case 163: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; + case 160: case 159: - case 158: if (ts.hasModifier(container, 32) && !(compilerOptions.target === 99 && compilerOptions.useDefineForClassFields)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 154: + case 155: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -44937,11 +45152,13 @@ var ts; var classSymbol = checkExpression(className).symbol; if (classSymbol && classSymbol.members && (classSymbol.flags & 16)) { var classType = getDeclaredTypeOfSymbol(classSymbol).thisType; - return getFlowTypeOfReference(node, classType); + if (classType) { + return getFlowTypeOfReference(node, classType); + } } } else if (isInJS && - (container.kind === 201 || container.kind === 244) && + (container.kind === 202 || container.kind === 245) && ts.getJSDocClassTag(container)) { var classType = getDeclaredTypeOfSymbol(getMergedSymbol(container.symbol)).thisType; return getFlowTypeOfReference(node, classType); @@ -44986,7 +45203,7 @@ var ts; } } function getClassNameFromPrototypeMethod(container) { - if (container.kind === 201 && + if (container.kind === 202 && ts.isBinaryExpression(container.parent) && ts.getAssignmentDeclarationKind(container.parent) === 3) { return container.parent @@ -44994,20 +45211,20 @@ var ts; .expression .expression; } - else if (container.kind === 161 && - container.parent.kind === 193 && + else if (container.kind === 162 && + container.parent.kind === 194 && ts.isBinaryExpression(container.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent) === 6) { return container.parent.parent.left.expression; } - else if (container.kind === 201 && - container.parent.kind === 281 && - container.parent.parent.kind === 193 && + else if (container.kind === 202 && + container.parent.kind === 282 && + container.parent.parent.kind === 194 && ts.isBinaryExpression(container.parent.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6) { return container.parent.parent.parent.left.expression; } - else if (container.kind === 201 && + else if (container.kind === 202 && ts.isPropertyAssignment(container.parent) && ts.isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && @@ -45029,7 +45246,7 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 300) { + if (jsdocType && jsdocType.kind === 301) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -45043,14 +45260,14 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 156 && n.parent === constructorDecl; }); + return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 157 && n.parent === constructorDecl; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 196 && node.parent.expression === node; + var isCallExpression = node.parent.kind === 197 && node.parent.expression === node; var container = ts.getSuperContainer(node, true); var needToCaptureLexicalThis = false; if (!isCallExpression) { - while (container && container.kind === 202) { + while (container && container.kind === 203) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = languageVersion < 2; } @@ -45058,14 +45275,14 @@ var ts; var canUseSuperExpression = isLegalUsageOfSuperExpression(container); var nodeCheckFlag = 0; if (!canUseSuperExpression) { - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 154; }); - if (current && current.kind === 154) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 155; }); + if (current && current.kind === 155) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 193)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 194)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -45073,7 +45290,7 @@ var ts; } return errorType; } - if (!isCallExpression && container.kind === 162) { + if (!isCallExpression && container.kind === 163) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasModifier(container, 32) || isCallExpression) { @@ -45083,7 +45300,7 @@ var ts; nodeCheckFlag = 256; } getNodeLinks(node).flags |= nodeCheckFlag; - if (container.kind === 161 && ts.hasModifier(container, 256)) { + if (container.kind === 162 && ts.hasModifier(container, 256)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096; } @@ -45094,7 +45311,7 @@ var ts; if (needToCaptureLexicalThis) { captureLexicalThis(node.parent, container); } - if (container.parent.kind === 193) { + if (container.parent.kind === 194) { if (languageVersion < 2) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return errorType; @@ -45113,7 +45330,7 @@ var ts; if (!baseClassType) { return errorType; } - if (container.kind === 162 && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 163 && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return errorType; } @@ -45125,24 +45342,24 @@ var ts; return false; } if (isCallExpression) { - return container.kind === 162; + return container.kind === 163; } else { - if (ts.isClassLike(container.parent) || container.parent.kind === 193) { + if (ts.isClassLike(container.parent) || container.parent.kind === 194) { if (ts.hasModifier(container, 32)) { - return container.kind === 161 || - container.kind === 160 || - container.kind === 163 || - container.kind === 164; + return container.kind === 162 || + container.kind === 161 || + container.kind === 164 || + container.kind === 165; } else { - return container.kind === 161 || - container.kind === 160 || - container.kind === 163 || + return container.kind === 162 || + container.kind === 161 || container.kind === 164 || + container.kind === 165 || + container.kind === 160 || container.kind === 159 || - container.kind === 158 || - container.kind === 162; + container.kind === 163; } } } @@ -45150,10 +45367,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 161 || - func.kind === 163 || - func.kind === 164) && func.parent.kind === 193 ? func.parent : - func.kind === 201 && func.parent.kind === 281 ? func.parent.parent : + return (func.kind === 162 || + func.kind === 164 || + func.kind === 165) && func.parent.kind === 194 ? func.parent : + func.kind === 202 && func.parent.kind === 282 ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -45165,7 +45382,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 202) { + if (func.kind === 203) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -45189,7 +45406,7 @@ var ts; if (thisType) { return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); } - if (literal.parent.kind !== 281) { + if (literal.parent.kind !== 282) { break; } literal = literal.parent.parent; @@ -45198,7 +45415,7 @@ var ts; return getWidenedType(contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral)); } var parent = ts.walkUpParenthesizedExpressions(func.parent); - if (parent.kind === 209 && parent.operatorToken.kind === 62) { + if (parent.kind === 210 && parent.operatorToken.kind === 62) { var target = parent.left; if (ts.isAccessExpression(target)) { var expression = target.expression; @@ -45249,9 +45466,9 @@ var ts; return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 156: + case 157: return getContextuallyTypedParameterType(declaration); - case 191: + case 192: return getContextualTypeForBindingElement(declaration); } } @@ -45259,7 +45476,7 @@ var ts; var parent = declaration.parent.parent; var name = declaration.propertyName || declaration.name; var parentType = getContextualTypeForVariableLikeDeclaration(parent) || - parent.kind !== 191 && parent.initializer && checkDeclarationInitializer(parent); + parent.kind !== 192 && parent.initializer && checkDeclarationInitializer(parent); if (parentType && !ts.isBindingPattern(name) && !isComputedNonLiteralName(name)) { var nameType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(nameType)) { @@ -45292,6 +45509,9 @@ var ts; if (contextualReturnType) { if (functionFlags & 2) { var contextualAwaitedType = getAwaitedTypeOfPromise(contextualReturnType); + if (contextualAwaitedType && contextualAwaitedType.flags & 134217728) { + contextualAwaitedType = contextualAwaitedType.awaitedType; + } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return contextualReturnType; @@ -45303,6 +45523,9 @@ var ts; var contextualType = getContextualType(node); if (contextualType) { var contextualAwaitedType = getAwaitedType(contextualType); + if (contextualAwaitedType && contextualAwaitedType.flags & 134217728) { + contextualAwaitedType = contextualAwaitedType.awaitedType; + } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return undefined; @@ -45366,7 +45589,7 @@ var ts; return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 198) { + if (template.parent.kind === 199) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -45574,21 +45797,21 @@ var ts; case 91: case 100: case 75: - case 146: + case 147: return true; - case 194: - case 200: + case 195: + case 201: return isPossiblyDiscriminantValue(node.expression); - case 276: + case 277: return !node.expression || isPossiblyDiscriminantValue(node.expression); } return false; } function discriminateContextualTypeByObjectMembers(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 281 && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 282 && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } function discriminateContextualTypeByJSXAttributes(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 273 && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 274 && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } function getApparentTypeOfContextualType(node, contextFlags) { var contextualType = ts.isObjectLiteralMethod(node) ? @@ -45609,7 +45832,7 @@ var ts; } } function instantiateContextualType(contextualType, node, contextFlags) { - if (contextualType && maybeTypeOfKind(contextualType, 63176704)) { + if (contextualType && maybeTypeOfKind(contextualType, 197394432)) { var inferenceContext = getInferenceContext(node); if (inferenceContext && ts.some(inferenceContext.inferences, hasInferenceCandidates)) { if (contextFlags && contextFlags & 1) { @@ -45623,7 +45846,7 @@ var ts; return contextualType; } function instantiateInstantiableTypes(type, mapper) { - if (type.flags & 63176704) { + if (type.flags & 197394432) { return instantiateType(type, mapper); } if (type.flags & 1048576) { @@ -45643,56 +45866,56 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 242: - case 156: + case 243: + case 157: + case 160: case 159: - case 158: - case 191: + case 192: return getContextualTypeForInitializerExpression(node); - case 202: - case 235: + case 203: + case 236: return getContextualTypeForReturnExpression(node); - case 212: + case 213: return getContextualTypeForYieldOperand(parent); - case 206: + case 207: return getContextualTypeForAwaitOperand(parent); - case 196: + case 197: if (parent.expression.kind === 96) { return stringType; } - case 197: + case 198: return getContextualTypeForArgument(parent, node); - case 199: - case 217: + case 200: + case 218: return ts.isConstTypeReference(parent.type) ? undefined : getTypeFromTypeNode(parent.type); - case 209: + case 210: return getContextualTypeForBinaryOperand(node, contextFlags); - case 281: case 282: - return getContextualTypeForObjectLiteralElement(parent, contextFlags); case 283: + return getContextualTypeForObjectLiteralElement(parent, contextFlags); + case 284: return getApparentTypeOfContextualType(parent.parent, contextFlags); - case 192: { + case 193: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 210: + case 211: return getContextualTypeForConditionalOperand(node, contextFlags); - case 221: - ts.Debug.assert(parent.parent.kind === 211); + case 222: + ts.Debug.assert(parent.parent.kind === 212); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 200: { + case 201: { var tag = ts.isInJSFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent, contextFlags); } - case 276: + case 277: return getContextualTypeForJsxExpression(parent); - case 273: - case 275: + case 274: + case 276: return getContextualTypeForJsxAttribute(parent); + case 269: case 268: - case 267: return getContextualJsxElementAttributesType(parent, contextFlags); } return undefined; @@ -45832,7 +46055,7 @@ var ts; return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 201 || node.kind === 202; + return node.kind === 202 || node.kind === 203; } function getContextualSignatureForFunctionLikeDeclaration(node) { return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node) @@ -45840,7 +46063,7 @@ var ts; : undefined; } function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 161 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 || ts.isObjectLiteralMethod(node)); var typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; @@ -45881,8 +46104,8 @@ var ts; return checkIteratedTypeOrElementType(33, arrayOrIterableType, undefinedType, node.expression); } function hasDefaultValue(node) { - return (node.kind === 191 && !!node.initializer) || - (node.kind === 209 && node.operatorToken.kind === 62); + return (node.kind === 192 && !!node.initializer) || + (node.kind === 210 && node.operatorToken.kind === 62); } function checkArrayLiteral(node, checkMode, forceTuple) { var elements = node.elements; @@ -45895,7 +46118,7 @@ var ts; var inConstContext = isConstContext(node); for (var i = 0; i < elementCount; i++) { var e = elements[i]; - var spread = e.kind === 213 && e.expression; + var spread = e.kind === 214 && e.expression; var spreadType = spread && checkExpression(spread, checkMode, forceTuple); if (spreadType && isTupleType(spreadType)) { elementTypes.push.apply(elementTypes, getTypeArguments(spreadType)); @@ -45966,7 +46189,7 @@ var ts; } function isNumericName(name) { switch (name.kind) { - case 154: + case 155: return isNumericComputedName(name); case 75: return isNumericLiteralName(name.escapedText); @@ -46026,11 +46249,12 @@ var ts; var inDestructuringPattern = ts.isAssignmentTarget(node); checkGrammarObjectLiteralExpression(node, inDestructuringPattern); var propertiesTable; + var allPropertiesTable = ts.createSymbolTable(); var propertiesArray = []; var spread = emptyObjectType; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 189 || contextualType.pattern.kind === 193); + (contextualType.pattern.kind === 190 || contextualType.pattern.kind === 194); var inConstContext = isConstContext(node); var checkFlags = inConstContext ? 8 : 0; var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node); @@ -46045,13 +46269,13 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = getSymbolOfNode(memberDecl); - var computedNameType = memberDecl.name && memberDecl.name.kind === 154 && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? + var computedNameType = memberDecl.name && memberDecl.name.kind === 155 && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? checkComputedPropertyName(memberDecl.name) : undefined; - if (memberDecl.kind === 281 || - memberDecl.kind === 282 || + if (memberDecl.kind === 282 || + memberDecl.kind === 283 || ts.isObjectLiteralMethod(memberDecl)) { - var type = memberDecl.kind === 281 ? checkPropertyAssignment(memberDecl, checkMode) : - memberDecl.kind === 282 ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : + var type = memberDecl.kind === 282 ? checkPropertyAssignment(memberDecl, checkMode) : + memberDecl.kind === 283 ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode); if (isInJavascript) { var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -46072,8 +46296,8 @@ var ts; prop.nameType = nameType; } if (inDestructuringPattern) { - var isOptional = (memberDecl.kind === 281 && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 282 && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 282 && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 283 && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216; } @@ -46095,8 +46319,9 @@ var ts; prop.type = type; prop.target = member; member = prop; + allPropertiesTable.set(prop.escapedName, prop); } - else if (memberDecl.kind === 283) { + else if (memberDecl.kind === 284) { if (languageVersion < 2) { checkExternalEmitHelpers(memberDecl, 2); } @@ -46112,12 +46337,22 @@ var ts; error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); return errorType; } + for (var _i = 0, _a = getPropertiesOfType(type); _i < _a.length; _i++) { + var right = _a[_i]; + var rightType = getTypeOfSymbol(right); + var left = allPropertiesTable.get(right.escapedName); + if (strictNullChecks && + left && + !maybeTypeOfKind(rightType, 98304)) { + error(left.valueDeclaration, ts.Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, ts.unescapeLeadingUnderscores(left.escapedName)); + } + } spread = getSpreadType(spread, type, node.symbol, objectFlags, inConstContext); offset = i + 1; continue; } else { - ts.Debug.assert(memberDecl.kind === 163 || memberDecl.kind === 164); + ts.Debug.assert(memberDecl.kind === 164 || memberDecl.kind === 165); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576)) { @@ -46138,9 +46373,9 @@ var ts; } propertiesArray.push(member); } - if (contextualTypeHasPattern && node.parent.kind !== 283) { - for (var _i = 0, _a = getPropertiesOfType(contextualType); _i < _a.length; _i++) { - var prop = _a[_i]; + if (contextualTypeHasPattern && node.parent.kind !== 284) { + for (var _b = 0, _c = getPropertiesOfType(contextualType); _b < _c.length; _b++) { + var prop = _c[_b]; if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) { if (!(prop.flags & 16777216)) { error(prop.valueDeclaration || prop.bindingElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); @@ -46179,13 +46414,13 @@ var ts; } } function isValidSpreadType(type) { - if (type.flags & 63176704) { + if (type.flags & 197394432) { var constraint = getBaseConstraintOfType(type); if (constraint !== undefined) { return isValidSpreadType(constraint); } } - return !!(type.flags & (1 | 67108864 | 524288 | 58982400) || + return !!(type.flags & (1 | 67108864 | 524288 | 193200128) || getFalsyFlags(type) & 117632 && isValidSpreadType(removeDefinitelyFalsyTypes(type)) || type.flags & 3145728 && ts.every(type.types, isValidSpreadType)); } @@ -46261,7 +46496,7 @@ var ts; } } else { - ts.Debug.assert(attributeDecl.kind === 275); + ts.Debug.assert(attributeDecl.kind === 276); if (attributesTable.size > 0) { spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, false); attributesTable = ts.createSymbolTable(); @@ -46283,7 +46518,7 @@ var ts; spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, false); } } - var parent = openingLikeElement.parent.kind === 266 ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 267 ? openingLikeElement.parent : undefined; if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") { @@ -46606,7 +46841,7 @@ var ts; } function checkPropertyAccessibility(node, isSuper, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 153 ? node.right : node.kind === 188 ? node : node.name; + var errorNode = node.kind === 154 ? node.right : node.kind === 189 ? node : node.name; if (ts.getCheckFlags(prop) & 1024) { error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type)); return false; @@ -46740,7 +46975,7 @@ var ts; return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right); } function isMethodAccessForCall(node) { - while (node.parent.kind === 200) { + while (node.parent.kind === 201) { node = node.parent; } return ts.isCallOrNewExpression(node.parent) && node.parent.expression === node; @@ -46878,7 +47113,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 162 && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608)) { + if (flowContainer.kind === 163 && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608)) { assumeUninitialized = true; } } @@ -46909,8 +47144,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName); } - else if (valueDeclaration.kind === 245 && - node.parent.kind !== 169 && + else if (valueDeclaration.kind === 246 && + node.parent.kind !== 170 && !(valueDeclaration.flags & 8388608) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName); @@ -46922,22 +47157,22 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 159: + case 160: return true; - case 281: - case 161: - case 163: + case 282: + case 162: case 164: - case 283: - case 154: - case 221: - case 276: - case 273: + case 165: + case 284: + case 155: + case 222: + case 277: case 274: case 275: - case 268: - case 216: - case 279: + case 276: + case 269: + case 217: + case 280: return false; default: return ts.isExpressionNode(node) ? false : "quit"; @@ -47064,7 +47299,19 @@ var ts; return ts.getSpellingSuggestion(name, symbols, getCandidateName); function getCandidateName(candidate) { var candidateName = ts.symbolName(candidate); - return !ts.startsWith(candidateName, "\"") && candidate.flags & meaning ? candidateName : undefined; + if (ts.startsWith(candidateName, "\"")) { + return undefined; + } + if (candidate.flags & meaning) { + return candidateName; + } + if (candidate.flags & 2097152) { + var alias = tryResolveAlias(candidate); + if (alias && alias.flags & meaning) { + return candidateName; + } + } + return undefined; } } function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isThisAccess) { @@ -47077,7 +47324,7 @@ var ts; if (!hasPrivateModifier && !hasPrivateIdentifier) { return; } - if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 && !(prop.flags & 32768))) { + if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536)) { return; } if (isThisAccess) { @@ -47090,16 +47337,16 @@ var ts; } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 194: + case 195: return isValidPropertyAccessWithType(node, node.expression.kind === 102, propertyName, getWidenedType(checkExpression(node.expression))); - case 153: + case 154: return isValidPropertyAccessWithType(node, false, propertyName, getWidenedType(checkExpression(node.left))); - case 188: + case 189: return isValidPropertyAccessWithType(node, false, propertyName, getTypeFromTypeNode(node)); } } function isValidPropertyAccessForCompletions(node, type, property) { - return isValidPropertyAccessWithType(node, node.kind === 194 && node.expression.kind === 102, property.escapedName, type); + return isValidPropertyAccessWithType(node, node.kind === 195 && node.expression.kind === 102, property.escapedName, type); } function isValidPropertyAccessWithType(node, isSuper, propertyName, type) { if (type === errorType || isTypeAny(type)) { @@ -47117,7 +47364,7 @@ var ts; } function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 243) { + if (initializer.kind === 244) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -47139,7 +47386,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 231 && + if (node.kind === 232 && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -47216,13 +47463,13 @@ var ts; if (callLikeExpressionMayHaveTypeArguments(node)) { ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 198) { + if (node.kind === 199) { checkExpression(node.template); } else if (ts.isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); } - else if (node.kind !== 157) { + else if (node.kind !== 158) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -47271,7 +47518,7 @@ var ts; } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 213 || arg.kind === 220 && arg.isSpread); + return !!arg && (arg.kind === 214 || arg.kind === 221 && arg.isSpread); } function getSpreadArgumentIndex(args) { return ts.findIndex(args, isSpreadArgument); @@ -47285,9 +47532,9 @@ var ts; var callIsIncomplete = false; var effectiveParameterCount = getParameterCount(signature); var effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 198) { + if (node.kind === 199) { argCount = args.length; - if (node.template.kind === 211) { + if (node.template.kind === 212) { var lastSpan = ts.last(node.template.templateSpans); callIsIncomplete = ts.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } @@ -47297,7 +47544,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 157) { + else if (node.kind === 158) { argCount = getDecoratorArgumentCount(node, signature); } else if (ts.isJsxOpeningLikeElement(node)) { @@ -47311,7 +47558,7 @@ var ts; } else { if (!node.arguments) { - ts.Debug.assert(node.kind === 197); + ts.Debug.assert(node.kind === 198); return getMinArgumentCount(signature) === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; @@ -47387,7 +47634,7 @@ var ts; if (ts.isJsxOpeningLikeElement(node)) { return inferJsxTypeArguments(node, signature, checkMode, context); } - if (node.kind !== 157) { + if (node.kind !== 158) { var contextualType = getContextualType(node); if (contextualType) { var outerContext = getInferenceContext(node); @@ -47415,7 +47662,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 215) { + if (arg.kind !== 216) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); inferTypes(context.inferences, argType, paramType); @@ -47429,7 +47676,7 @@ var ts; } function getArrayifiedType(type) { return type.flags & 1048576 ? mapType(type, getArrayifiedType) : - type.flags & (1 | 63176704) || isMutableArrayOrTuple(type) ? type : + type.flags & (1 | 197394432) || isMutableArrayOrTuple(type) ? type : isTupleType(type) ? createTupleType(getTypeArguments(type), type.target.minLength, type.target.hasRestElement, false, type.target.associatedNames) : createArrayType(getIndexedAccessType(type, numberType)); } @@ -47437,7 +47684,7 @@ var ts; if (index >= argCount - 1) { var arg = args[argCount - 1]; if (isSpreadArgument(arg)) { - return arg.kind === 220 ? + return arg.kind === 221 ? createArrayType(arg.type) : getArrayifiedType(checkExpressionWithContextualType(arg.expression, restType, context, 0)); } @@ -47579,7 +47826,7 @@ var ts; return undefined; } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 197) { + if (thisType && thisType !== voidType && node.kind !== 198) { var thisArgumentNode = getThisArgumentOfCall(node); var thisArgumentType = void 0; if (thisArgumentNode) { @@ -47606,7 +47853,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 215) { + if (arg.kind !== 216) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, undefined, checkMode); var checkArgType = checkMode & 4 ? getRegularTypeOfObjectLiteral(argType) : argType; @@ -47640,7 +47887,7 @@ var ts; } } function getThisArgumentOfCall(node) { - if (node.kind === 196) { + if (node.kind === 197) { var callee = ts.skipOuterExpressions(node.expression); if (ts.isAccessExpression(callee)) { return callee.expression; @@ -47648,24 +47895,24 @@ var ts; } } function createSyntheticExpression(parent, type, isSpread) { - var result = ts.createNode(220, parent.pos, parent.end); + var result = ts.createNode(221, parent.pos, parent.end); result.parent = parent; result.type = type; result.isSpread = isSpread || false; return result; } function getEffectiveCallArguments(node) { - if (node.kind === 198) { + if (node.kind === 199) { var template = node.template; var args_3 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 211) { + if (template.kind === 212) { ts.forEach(template.templateSpans, function (span) { args_3.push(span.expression); }); } return args_3; } - if (node.kind === 157) { + if (node.kind === 158) { return getEffectiveDecoratorArguments(node); } if (ts.isJsxOpeningLikeElement(node)) { @@ -47689,23 +47936,23 @@ var ts; var parent = node.parent; var expr = node.expression; switch (parent.kind) { - case 245: - case 214: + case 246: + case 215: return [ createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent))) ]; - case 156: + case 157: var func = parent.parent; return [ - createSyntheticExpression(expr, parent.parent.kind === 162 ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), + createSyntheticExpression(expr, parent.parent.kind === 163 ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), createSyntheticExpression(expr, anyType), createSyntheticExpression(expr, numberType) ]; - case 159: - case 161: - case 163: + case 160: + case 162: case 164: - var hasPropDesc = parent.kind !== 159 && languageVersion !== 0; + case 165: + var hasPropDesc = parent.kind !== 160 && languageVersion !== 0; return [ createSyntheticExpression(expr, getParentTypeOfClassElement(parent)), createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)), @@ -47716,16 +47963,16 @@ var ts; } function getDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 245: - case 214: + case 246: + case 215: return 1; - case 159: + case 160: return 2; - case 161: - case 163: + case 162: case 164: + case 165: return languageVersion === 0 || signature.parameters.length <= 2 ? 2 : 3; - case 156: + case 157: return 3; default: return ts.Debug.fail(); @@ -47848,8 +48095,8 @@ var ts; return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { - var isTaggedTemplate = node.kind === 198; - var isDecorator = node.kind === 157; + var isTaggedTemplate = node.kind === 199; + var isDecorator = node.kind === 158; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var reportErrors = !candidatesOutArray; var typeArguments; @@ -47874,7 +48121,7 @@ var ts; var candidateForArgumentArityError; var candidateForTypeArgumentError; var result; - var signatureHelpTrailingComma = !!(checkMode & 16) && node.kind === 196 && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = !!(checkMode & 16) && node.kind === 197 && node.arguments.hasTrailingComma; if (candidates.length > 1) { result = chooseOverload(candidates, subtypeRelation, signatureHelpTrailingComma); } @@ -48295,7 +48542,7 @@ var ts; } var declaration = signature.declaration; var modifiers = ts.getSelectedModifierFlags(declaration, 24); - if (!modifiers || declaration.kind !== 162) { + if (!modifiers || declaration.kind !== 163) { return true; } var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -48415,16 +48662,16 @@ var ts; } function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 245: - case 214: + case 246: + case 215: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 156: + case 157: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 159: + case 160: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 161: - case 163: + case 162: case 164: + case 165: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return ts.Debug.fail(); @@ -48501,16 +48748,16 @@ var ts; } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 196: - return resolveCallExpression(node, candidatesOutArray, checkMode); case 197: - return resolveNewExpression(node, candidatesOutArray, checkMode); + return resolveCallExpression(node, candidatesOutArray, checkMode); case 198: + return resolveNewExpression(node, candidatesOutArray, checkMode); + case 199: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 157: + case 158: return resolveDecorator(node, candidatesOutArray, checkMode); + case 269: case 268: - case 267: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); } throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -48577,7 +48824,7 @@ var ts; return false; } var parent = node.parent; - while (parent && parent.kind === 194) { + while (parent && parent.kind === 195) { parent = parent.parent; } if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 62) { @@ -48595,12 +48842,12 @@ var ts; if (node.expression.kind === 102) { return voidType; } - if (node.kind === 197) { + if (node.kind === 198) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 162 && - declaration.kind !== 166 && - declaration.kind !== 171 && + declaration.kind !== 163 && + declaration.kind !== 167 && + declaration.kind !== 172 && !ts.isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { if (noImplicitAny) { @@ -48616,7 +48863,7 @@ var ts; if (returnType.flags & 12288 && isSymbolOrSymbolForCall(node)) { return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent)); } - if (node.kind === 196 && node.parent.kind === 226 && + if (node.kind === 197 && node.parent.kind === 227 && returnType.flags & 16384 && getTypePredicateOfSignature(signature)) { if (!ts.isDottedName(node.expression)) { error(node.expression, ts.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); @@ -48717,9 +48964,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 - ? 244 + ? 245 : resolvedRequire.flags & 3 - ? 242 + ? 243 : 0; if (targetDeclarationKind !== 0) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -48746,18 +48993,18 @@ var ts; case 9: case 106: case 91: - case 192: case 193: + case 194: return true; - case 200: + case 201: return isValidConstAssertionArgument(node.expression); - case 207: + case 208: var op = node.operator; var arg = node.operand; return op === 40 && (arg.kind === 8 || arg.kind === 9) || op === 39 && arg.kind === 8; - case 194: case 195: + case 196: var expr = node.expression; if (ts.isIdentifier(expr)) { var symbol = getSymbolAtLocation(expr); @@ -48807,7 +49054,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return errorType; } - else if (container.kind === 162) { + else if (container.kind === 163) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -48897,7 +49144,7 @@ var ts; } return length; } - function getMinArgumentCount(signature) { + function getMinArgumentCount(signature, strongArityForUntypedJS) { if (signatureHasRestParameter(signature)) { var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); if (isTupleType(restType)) { @@ -48907,6 +49154,9 @@ var ts; } } } + if (!strongArityForUntypedJS && signature.flags & 16) { + return 0; + } return signature.minArgumentCount; } function hasEffectiveRestParameter(signature) { @@ -49056,7 +49306,7 @@ var ts; var yieldType; var nextType; var fallbackReturnType = voidType; - if (func.body.kind !== 223) { + if (func.body.kind !== 224) { returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8); if (isAsync) { returnType = checkAwaitedType(returnType, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); @@ -49208,9 +49458,9 @@ var ts; return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node)); } function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 204) { + if (node.expression.kind === 205) { var operandType = getTypeOfExpression(node.expression.expression); - var witnesses = getSwitchClauseTypeOfWitnesses(node); + var witnesses = getSwitchClauseTypeOfWitnesses(node, false); var notEqualFacts_1 = getFactsFromTypeofSwitch(0, 0, witnesses, true); var type_3 = getBaseConstraintOfType(operandType) || operandType; return !!(filterType(type_3, function (t) { return (getTypeFacts(t) & notEqualFacts_1) === notEqualFacts_1; }).flags & 131072); @@ -49260,11 +49510,11 @@ var ts; } function mayReturnNever(func) { switch (func.kind) { - case 201: case 202: + case 203: return true; - case 161: - return func.parent.kind === 193; + case 162: + return func.parent.kind === 194; default: return false; } @@ -49278,7 +49528,7 @@ var ts; if (type && maybeTypeOfKind(type, 1 | 16384)) { return; } - if (func.kind === 160 || ts.nodeIsMissing(func.body) || func.body.kind !== 223 || !functionHasImplicitReturn(func)) { + if (func.kind === 161 || ts.nodeIsMissing(func.body) || func.body.kind !== 224 || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 512; @@ -49305,7 +49555,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 161 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 || ts.isObjectLiteralMethod(node)); checkNodeDeferred(node); if (checkMode && checkMode & 4 && isContextSensitive(node)) { if (!ts.getEffectiveReturnTypeNode(node) && !hasContextSensitiveParameters(node)) { @@ -49325,7 +49575,7 @@ var ts; return anyFunctionType; } var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 201) { + if (!hasGrammarError && node.kind === 202) { checkGrammarForGenerator(node); } contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -49373,7 +49623,7 @@ var ts; type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 161 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnType = getReturnTypeFromAnnotation(node); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); @@ -49381,7 +49631,7 @@ var ts; if (!ts.getEffectiveReturnTypeNode(node)) { getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 223) { + if (node.body.kind === 224) { checkSourceElement(node.body); } else { @@ -49453,7 +49703,7 @@ var ts; ts.isAccessExpression(expr) && expr.expression.kind === 104) { var ctor = ts.getContainingFunction(expr); - if (!(ctor && ctor.kind === 162)) { + if (!(ctor && ctor.kind === 163)) { return true; } if (symbol.valueDeclaration) { @@ -49477,7 +49727,7 @@ var ts; var symbol_2 = getNodeLinks(node).resolvedSymbol; if (symbol_2.flags & 2097152) { var declaration = getDeclarationOfAliasSymbol(symbol_2); - return !!declaration && declaration.kind === 256; + return !!declaration && declaration.kind === 257; } } } @@ -49502,7 +49752,7 @@ var ts; error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); return booleanType; } - if (expr.kind === 194 && ts.isPrivateIdentifier(expr.name)) { + if (expr.kind === 195 && ts.isPrivateIdentifier(expr.name)) { error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier); } var links = getNodeLinks(expr); @@ -49550,7 +49800,7 @@ var ts; var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos); var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); var func = ts.getContainingFunction(node); - if (func && func.kind !== 162 && (ts.getFunctionFlags(func) & 2) === 0) { + if (func && func.kind !== 163 && (ts.getFunctionFlags(func) & 2) === 0) { var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); } @@ -49707,7 +49957,7 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 296 | 12288))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!allTypesAssignableToKind(rightType, 67108864 | 58982400)) { + if (!allTypesAssignableToKind(rightType, 67108864 | 193200128)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -49726,7 +49976,7 @@ var ts; if (rightIsThis === void 0) { rightIsThis = false; } var properties = node.properties; var property = properties[propertyIndex]; - if (property.kind === 281 || property.kind === 282) { + if (property.kind === 282 || property.kind === 283) { var name = property.name; var exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -49739,9 +49989,9 @@ var ts; } var elementType = getIndexedAccessType(objectLiteralType, exprType, name); var type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 282 ? property : property.initializer, type); + return checkDestructuringAssignment(property.kind === 283 ? property : property.initializer, type); } - else if (property.kind === 283) { + else if (property.kind === 284) { if (propertyIndex < properties.length - 1) { error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } @@ -49781,8 +50031,8 @@ var ts; function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 215) { - if (element.kind !== 213) { + if (element.kind !== 216) { + if (element.kind !== 214) { var indexType = getLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { var accessFlags = hasDefaultValue(element) ? 8 : 0; @@ -49798,7 +50048,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 209 && restExpression.operatorToken.kind === 62) { + if (restExpression.kind === 210 && restExpression.operatorToken.kind === 62) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -49814,7 +50064,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { var target; - if (exprOrAssignment.kind === 282) { + if (exprOrAssignment.kind === 283) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { if (strictNullChecks && @@ -49828,24 +50078,24 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 209 && target.operatorToken.kind === 62) { + if (target.kind === 210 && target.operatorToken.kind === 62) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 193) { + if (target.kind === 194) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 192) { + if (target.kind === 193) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 283 ? + var error = target.parent.kind === 284 ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; - var optionalError = target.parent.kind === 283 ? + var optionalError = target.parent.kind === 284 ? ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; if (checkReferenceExpression(target, error, optionalError)) { @@ -49862,36 +50112,36 @@ var ts; case 75: case 10: case 13: - case 198: - case 211: + case 199: + case 212: case 14: case 8: case 9: case 106: case 91: case 100: - case 146: - case 201: - case 214: + case 147: case 202: - case 192: + case 215: + case 203: case 193: - case 204: - case 218: + case 194: + case 205: + case 219: + case 268: case 267: - case 266: return true; - case 210: + case 211: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 209: + case 210: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 207: case 208: + case 209: switch (node.operator) { case 53: case 39: @@ -49900,9 +50150,9 @@ var ts; return true; } return false; - case 205: - case 199: - case 217: + case 206: + case 200: + case 218: default: return false; } @@ -49928,7 +50178,7 @@ var ts; } checkGrammarNullishCoalesceWithLogicalExpression(node); var operator = node.operatorToken.kind; - if (operator === 62 && (node.left.kind === 193 || node.left.kind === 192)) { + if (operator === 62 && (node.left.kind === 194 || node.left.kind === 193)) { finishInvocation(checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 104)); break; } @@ -49989,7 +50239,7 @@ var ts; } function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 62 && (left.kind === 193 || left.kind === 192)) { + if (operator === 62 && (left.kind === 194 || left.kind === 193)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 104); } var leftType; @@ -50351,7 +50601,7 @@ var ts; return stringType; } function getContextNode(node) { - if (node.kind === 274 && !ts.isJsxSelfClosingElement(node.parent)) { + if (node.kind === 275 && !ts.isJsxSelfClosingElement(node.parent)) { return node.parent.parent; } return node; @@ -50391,13 +50641,13 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 199 || node.kind === 217; + return node.kind === 200 || node.kind === 218; } function checkDeclarationInitializer(declaration, contextualType) { var initializer = ts.getEffectiveInitializer(declaration); var type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, undefined, 0) : checkExpressionCached(initializer)); - return ts.isParameter(declaration) && declaration.name.kind === 190 && + return ts.isParameter(declaration) && declaration.name.kind === 191 && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type; } @@ -50407,7 +50657,7 @@ var ts; var elementTypes = arity ? getTypeArguments(type).slice() : []; for (var i = arity; i < patternElements.length; i++) { var e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === 191 && e.dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === 192 && e.dotDotDotToken)) { elementTypes.push(!ts.isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, false, false) : anyType); if (!ts.isOmittedExpression(e) && !hasDefaultValue(e)) { reportImplicitAny(e, anyType); @@ -50436,7 +50686,7 @@ var ts; var types = contextualType.types; return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); }); } - if (contextualType.flags & 58982400) { + if (contextualType.flags & 193200128) { var constraint = getBaseConstraintOfType(contextualType) || unknownType; return maybeTypeOfKind(constraint, 4) && maybeTypeOfKind(candidateType, 128) || maybeTypeOfKind(constraint, 8) && maybeTypeOfKind(candidateType, 256) || @@ -50465,14 +50715,14 @@ var ts; getWidenedLiteralLikeTypeForContextualType(type, instantiateContextualType(arguments.length === 2 ? getContextualType(node) : contextualType, node)); } function checkPropertyAssignment(node, checkMode) { - if (node.name.kind === 154) { + if (node.name.kind === 155) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); } function checkObjectLiteralMethod(node, checkMode) { checkGrammarMethod(node); - if (node.name.kind === 154) { + if (node.name.kind === 155) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -50666,11 +50916,11 @@ var ts; return type; } function checkConstEnumAccess(node, type) { - var ok = (node.parent.kind === 194 && node.parent.expression === node) || - (node.parent.kind === 195 && node.parent.expression === node) || - ((node.kind === 75 || node.kind === 153) && isInRightSideOfImportOrExportAssignment(node) || - (node.parent.kind === 172 && node.parent.exprName === node)) || - (node.parent.kind === 263); + var ok = (node.parent.kind === 195 && node.parent.expression === node) || + (node.parent.kind === 196 && node.parent.expression === node) || + ((node.kind === 75 || node.kind === 154) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 173 && node.parent.exprName === node)) || + (node.parent.kind === 264); if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } @@ -50693,9 +50943,9 @@ var ts; var kind = node.kind; if (cancellationToken) { switch (kind) { - case 214: - case 201: + case 215: case 202: + case 203: cancellationToken.throwIfCancellationRequested(); } } @@ -50721,77 +50971,77 @@ var ts; return trueType; case 91: return falseType; - case 211: + case 212: return checkTemplateExpression(node); case 13: return globalRegExpType; - case 192: - return checkArrayLiteral(node, checkMode, forceTuple); case 193: - return checkObjectLiteral(node, checkMode); + return checkArrayLiteral(node, checkMode, forceTuple); case 194: + return checkObjectLiteral(node, checkMode); + case 195: return checkPropertyAccessExpression(node); - case 153: + case 154: return checkQualifiedName(node); - case 195: - return checkIndexedAccess(node); case 196: + return checkIndexedAccess(node); + case 197: if (node.expression.kind === 96) { return checkImportCallExpression(node); } - case 197: - return checkCallExpression(node, checkMode); case 198: + return checkCallExpression(node, checkMode); + case 199: return checkTaggedTemplateExpression(node); - case 200: + case 201: return checkParenthesizedExpression(node, checkMode); - case 214: + case 215: return checkClassExpression(node); - case 201: case 202: + case 203: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 204: + case 205: return checkTypeOfExpression(node); - case 199: - case 217: - return checkAssertion(node); + case 200: case 218: - return checkNonNullAssertion(node); + return checkAssertion(node); case 219: + return checkNonNullAssertion(node); + case 220: return checkMetaProperty(node); - case 203: + case 204: return checkDeleteExpression(node); - case 205: - return checkVoidExpression(node); case 206: - return checkAwaitExpression(node); + return checkVoidExpression(node); case 207: - return checkPrefixUnaryExpression(node); + return checkAwaitExpression(node); case 208: - return checkPostfixUnaryExpression(node); + return checkPrefixUnaryExpression(node); case 209: - return checkBinaryExpression(node, checkMode); + return checkPostfixUnaryExpression(node); case 210: + return checkBinaryExpression(node, checkMode); + case 211: return checkConditionalExpression(node, checkMode); - case 213: + case 214: return checkSpreadExpression(node, checkMode); - case 215: + case 216: return undefinedWideningType; - case 212: + case 213: return checkYieldExpression(node); - case 220: + case 221: return node.type; - case 276: + case 277: return checkJsxExpression(node, checkMode); - case 266: - return checkJsxElement(node, checkMode); case 267: + return checkJsxElement(node, checkMode); + case 268: return checkJsxSelfClosingElement(node, checkMode); - case 270: + case 271: return checkJsxFragment(node); - case 274: + case 275: return checkJsxAttributes(node, checkMode); - case 268: + case 269: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -50821,7 +51071,7 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasModifier(node, 92)) { - if (!(func.kind === 162 && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 163 && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -50832,12 +51082,15 @@ var ts; if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 162 || func.kind === 166 || func.kind === 171) { + if (func.kind === 163 || func.kind === 167 || func.kind === 172) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 202) { + if (func.kind === 203) { error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } + if (func.kind === 164 || func.kind === 165) { + error(node, ts.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); + } } if (node.dotDotDotToken && !ts.isBindingPattern(node.name) && !isTypeAssignableTo(getTypeOfSymbol(node.symbol), anyReadonlyArrayType)) { error(node, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); @@ -50889,13 +51142,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { + case 203: + case 166: + case 245: case 202: - case 165: - case 244: - case 201: - case 170: + case 171: + case 162: case 161: - case 160: var parent = node.parent; if (node === parent.type) { return parent; @@ -50913,7 +51166,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 190 || name.kind === 189) { + else if (name.kind === 191 || name.kind === 190) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -50921,12 +51174,12 @@ var ts; } } function checkSignatureDeclaration(node) { - if (node.kind === 167) { + if (node.kind === 168) { checkGrammarIndexSignature(node); } - else if (node.kind === 170 || node.kind === 244 || node.kind === 171 || - node.kind === 165 || node.kind === 162 || - node.kind === 166) { + else if (node.kind === 171 || node.kind === 245 || node.kind === 172 || + node.kind === 166 || node.kind === 163 || + node.kind === 167) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -50951,10 +51204,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 166: + case 167: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 165: + case 166: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -50978,7 +51231,7 @@ var ts; checkAsyncFunctionReturnType(node, returnTypeNode); } } - if (node.kind !== 167 && node.kind !== 300) { + if (node.kind !== 168 && node.kind !== 301) { registerForUnusedIdentifiersCheck(node); } } @@ -50989,7 +51242,7 @@ var ts; var privateIdentifiers = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 162) { + if (member.kind === 163) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param, member) && !ts.isBindingPattern(param.name)) { @@ -51009,16 +51262,16 @@ var ts; var memberName = name && ts.getPropertyNameForPropertyNameNode(name); if (memberName) { switch (member.kind) { - case 163: + case 164: addName(names, name, memberName, 1); break; - case 164: + case 165: addName(names, name, memberName, 2); break; - case 159: + case 160: addName(names, name, memberName, 3); break; - case 161: + case 162: addName(names, name, memberName, 8); break; } @@ -51070,7 +51323,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 158) { + if (member.kind === 159) { var memberName = void 0; var name = member.name; switch (name.kind) { @@ -51095,7 +51348,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 246) { + if (node.kind === 247) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -51110,7 +51363,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 143: + case 144: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -51118,7 +51371,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 140: + case 141: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -51154,7 +51407,7 @@ var ts; error(node, ts.Diagnostics.A_method_cannot_be_named_with_a_private_identifier); } checkFunctionOrMethodDeclaration(node); - if (ts.hasModifier(node, 128) && node.kind === 161 && node.body) { + if (ts.hasModifier(node, 128) && node.kind === 162 && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -51178,7 +51431,7 @@ var ts; if (ts.isPrivateIdentifierPropertyDeclaration(n)) { return true; } - return n.kind === 159 && + return n.kind === 160 && !ts.hasModifier(n, 32) && !!n.initializer; } @@ -51198,7 +51451,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_3 = statements; _i < statements_3.length; _i++) { var statement = statements_3[_i]; - if (statement.kind === 226 && ts.isSuperCall(statement.expression)) { + if (statement.kind === 227 && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -51222,21 +51475,21 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 163) { + if (node.kind === 164) { if (!(node.flags & 8388608) && ts.nodeIsPresent(node.body) && (node.flags & 256)) { if (!(node.flags & 512)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); } } } - if (node.name.kind === 154) { + if (node.name.kind === 155) { checkComputedPropertyName(node.name); } if (ts.isPrivateIdentifier(node.name)) { error(node.name, ts.Diagnostics.An_accessor_cannot_be_named_with_a_private_identifier); } if (!hasNonBindableDynamicName(node)) { - var otherKind = node.kind === 163 ? 164 : 163; + var otherKind = node.kind === 164 ? 165 : 164; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getModifierFlags(node); @@ -51252,7 +51505,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 163) { + if (node.kind === 164) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -51300,7 +51553,7 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 169 && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 170 && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } ts.forEach(node.typeArguments, checkSourceElement); @@ -51345,7 +51598,7 @@ var ts; var seenOptionalElement = false; for (var i = 0; i < elementTypes.length; i++) { var e = elementTypes[i]; - if (e.kind === 177) { + if (e.kind === 178) { if (i !== elementTypes.length - 1) { grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); break; @@ -51354,7 +51607,7 @@ var ts; error(e, ts.Diagnostics.A_rest_element_type_must_be_an_array_type); } } - else if (e.kind === 176) { + else if (e.kind === 177) { seenOptionalElement = true; } else if (seenOptionalElement) { @@ -51374,7 +51627,7 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType, false))) { - if (accessNode.kind === 195 && ts.isAssignmentTarget(accessNode) && + if (accessNode.kind === 196 && ts.isAssignmentTarget(accessNode) && ts.getObjectFlags(objectType) & 32 && getMappedTypeModifiers(objectType) & 1) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } @@ -51423,7 +51676,7 @@ var ts; ts.forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 180 && n.parent.extendsType === n; })) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 181 && n.parent.extendsType === n; })) { grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); @@ -51438,9 +51691,9 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedModifierFlags(n); - if (n.parent.kind !== 246 && - n.parent.kind !== 245 && - n.parent.kind !== 214 && + if (n.parent.kind !== 247 && + n.parent.kind !== 246 && + n.parent.kind !== 215 && n.flags & 8388608) { if (!(flags & 2) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) { flags |= 1; @@ -51521,7 +51774,7 @@ var ts; ts.isComputedPropertyName(node.name) && ts.isComputedPropertyName(subsequentName) || ts.isPropertyNameLiteral(node.name) && ts.isPropertyNameLiteral(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 161 || node.kind === 160) && + var reportError = (node.kind === 162 || node.kind === 161) && ts.hasModifier(node, 32) !== ts.hasModifier(subsequentNode, 32); if (reportError) { var diagnostic = ts.hasModifier(node, 32) ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; @@ -51555,14 +51808,14 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 8388608; - var inAmbientContextOrInterface = node.parent.kind === 246 || node.parent.kind === 173 || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 247 || node.parent.kind === 174 || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if ((node.kind === 245 || node.kind === 214) && !inAmbientContext) { + if ((node.kind === 246 || node.kind === 215) && !inAmbientContext) { hasNonAmbientClass = true; } - if (node.kind === 244 || node.kind === 161 || node.kind === 160 || node.kind === 162) { + if (node.kind === 245 || node.kind === 162 || node.kind === 161 || node.kind === 163) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -51680,38 +51933,38 @@ var ts; function getDeclarationSpaces(decl) { var d = decl; switch (d.kind) { - case 246: case 247: - case 322: - case 315: + case 248: + case 323: case 316: + case 317: return 2; - case 249: + case 250: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 ? 4 | 1 : 4; - case 245: - case 248: - case 284: + case 246: + case 249: + case 285: return 2 | 1; - case 290: + case 291: return 2 | 1 | 4; - case 259: + case 260: if (!ts.isEntityNameExpression(d.expression)) { return 1; } d = d.expression; - case 253: + case 254: + case 257: case 256: - case 255: var result_8 = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_8 |= getDeclarationSpaces(d); }); return result_8; - case 242: - case 191: - case 244: - case 258: + case 243: + case 192: + case 245: + case 259: case 75: return 1; default: @@ -51723,18 +51976,19 @@ var ts; var promisedType = getPromisedTypeOfPromise(type, errorNode); return promisedType && getAwaitedType(promisedType, errorNode, diagnosticMessage, arg0); } - function getPromisedTypeOfPromise(promise, errorNode) { - if (isTypeAny(promise)) { + function getPromisedTypeOfPromise(type, errorNode) { + if (isTypeAny(type)) { return undefined; } - var typeAsPromise = promise; + var typeAsPromise = type; if (typeAsPromise.promisedTypeOfPromise) { return typeAsPromise.promisedTypeOfPromise; } - if (isReferenceToType(promise, getGlobalPromiseType(false))) { - return typeAsPromise.promisedTypeOfPromise = getTypeArguments(promise)[0]; + if (isReferenceToType(type, getGlobalPromiseType(false)) || + isReferenceToType(type, getGlobalPromiseLikeType(false))) { + return typeAsPromise.promisedTypeOfPromise = getAwaitedType(getTypeArguments(type)[0], errorNode); } - var thenFunction = getTypeOfPropertyOfType(promise, "then"); + var thenFunction = getTypeOfPropertyOfType(type, "then"); if (isTypeAny(thenFunction)) { return undefined; } @@ -51762,28 +52016,67 @@ var ts; var awaitedType = getAwaitedType(type, errorNode, diagnosticMessage, arg0); return awaitedType || errorType; } + function getAwaitedTypeForGenericType(type) { + var typeId = "" + type.id; + var awaitedType = awaitedTypes.get(typeId); + if (!awaitedType) { + awaitedType = createType(134217728); + awaitedType.awaitedType = type; + awaitedTypes.set(typeId, awaitedType); + } + return awaitedType; + } + function unwrapAwaitedType(type) { + return type.flags & 1048576 ? + mapType(type, unwrapAwaitedType) : + type.flags & 134217728 ? type.awaitedType : type; + } + function isThenableType(type) { + var thenFunction = getTypeOfPropertyOfType(type, "then"); + return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, 2097152), 0).length > 0; + } + function isGenericAwaitableType(type) { + if (isGenericObjectType(type)) { + if (type.flags & 2097152) { + return ts.some(type.types, isGenericAwaitableType); + } + var baseConstraint = getBaseConstraintOfType(type); + return !baseConstraint || + !!(baseConstraint.flags & (3 | 67108864)) || + baseConstraint === emptyObjectType || + baseConstraint === emptyGenericType || + isThenableType(baseConstraint); + } + return false; + } function getAwaitedType(type, errorNode, diagnosticMessage, arg0) { + if (isTypeAny(type)) { + return type; + } + if (type.flags & 134217728) { + return type; + } var typeAsAwaitable = type; if (typeAsAwaitable.awaitedTypeOfType) { return typeAsAwaitable.awaitedTypeOfType; } - if (isTypeAny(type)) { - return typeAsAwaitable.awaitedTypeOfType = type; + return typeAsAwaitable.awaitedTypeOfType = + mapType(type, errorNode ? function (constituentType) { return getAwaitedTypeWorker(constituentType, errorNode, diagnosticMessage, arg0); } : getAwaitedTypeWorker); + } + function getAwaitedTypeWorker(type, errorNode, diagnosticMessage, arg0) { + if (type.flags & 134217728) { + return type; } - if (type.flags & 1048576) { - var types = void 0; - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var constituentType = _a[_i]; - types = ts.append(types, getAwaitedType(constituentType, errorNode, diagnosticMessage, arg0)); - } - if (!types) { - return undefined; - } - return typeAsAwaitable.awaitedTypeOfType = getUnionType(types); + if (isGenericAwaitableType(type)) { + return getAwaitedTypeForGenericType(type); + } + var typeAsAwaitable = type; + if (typeAsAwaitable.awaitedTypeOfType) { + return typeAsAwaitable.awaitedTypeOfType; } var promisedType = getPromisedTypeOfPromise(type); if (promisedType) { - if (type.id === promisedType.id || awaitedTypeStack.indexOf(promisedType.id) >= 0) { + if (type.id === promisedType.id || awaitedTypeStack.lastIndexOf(promisedType.id) >= 0) { if (errorNode) { error(errorNode, ts.Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method); } @@ -51797,8 +52090,7 @@ var ts; } return typeAsAwaitable.awaitedTypeOfType = awaitedType; } - var thenFunction = getTypeOfPropertyOfType(type, "then"); - if (thenFunction && getSignaturesOfType(thenFunction, 0).length > 0) { + if (isThenableType(type)) { if (errorNode) { if (!diagnosticMessage) return ts.Debug.fail(); @@ -51868,22 +52160,22 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 245: + case 246: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 156: + case 157: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 159: + case 160: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 161: - case 163: + case 162: case 164: + case 165: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -51919,14 +52211,14 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { + case 180: case 179: - case 178: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 180: + case 181: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 182: + case 183: return getEntityNameForDecoratorMetadata(node.type); - case 169: + case 170: return node.typeName; } } @@ -51935,13 +52227,13 @@ var ts; var commonEntityName; for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { var typeNode = types_19[_i]; - while (typeNode.kind === 182) { + while (typeNode.kind === 183) { typeNode = typeNode.type; } - if (typeNode.kind === 137) { + if (typeNode.kind === 138) { continue; } - if (!strictNullChecks && (typeNode.kind === 100 || typeNode.kind === 146)) { + if (!strictNullChecks && (typeNode.kind === 100 || typeNode.kind === 147)) { continue; } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -51977,13 +52269,13 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8); - if (node.kind === 156) { + if (node.kind === 157) { checkExternalEmitHelpers(firstDecorator, 32); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16); switch (node.kind) { - case 245: + case 246: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -51992,23 +52284,23 @@ var ts; } } break; - case 163: case 164: - var otherKind = node.kind === 163 ? 164 : 163; + case 165: + var otherKind = node.kind === 164 ? 165 : 164; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 161: + case 162: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 159: + case 160: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 156: + case 157: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -52067,7 +52359,7 @@ var ts; else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && node.typeExpression && node.typeExpression.type && !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 153 ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 154 ? node.name.right : node.name)); } } } @@ -52108,7 +52400,7 @@ var ts; switch (node.kind) { case 75: return node; - case 194: + case 195: return node.name; default: return undefined; @@ -52118,7 +52410,7 @@ var ts; checkDecorators(node); checkSignatureDeclaration(node); var functionFlags = ts.getFunctionFlags(node); - if (node.name && node.name.kind === 154) { + if (node.name && node.name.kind === 155) { checkComputedPropertyName(node.name); } if (!hasNonBindableDynamicName(node)) { @@ -52134,7 +52426,7 @@ var ts; } } } - var body = node.kind === 160 ? undefined : node.body; + var body = node.kind === 161 ? undefined : node.body; checkSourceElement(body); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); if (produceDiagnostics && !ts.getEffectiveReturnTypeNode(node)) { @@ -52167,42 +52459,42 @@ var ts; for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) { var node = potentiallyUnusedIdentifiers_1[_i]; switch (node.kind) { - case 245: - case 214: + case 246: + case 215: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 290: - case 249: - case 223: - case 251: - case 230: + case 291: + case 250: + case 224: + case 252: case 231: case 232: + case 233: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 162: - case 201: - case 244: - case 202: - case 161: case 163: + case 202: + case 245: + case 203: + case 162: case 164: + case 165: if (node.body) { checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 160: - case 165: + case 161: case 166: - case 170: + case 167: case 171: + case 172: + case 248: case 247: - case 246: checkUnusedTypeParameters(node, addDiagnostic); break; - case 181: + case 182: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -52222,11 +52514,11 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 161: - case 159: - case 163: + case 162: + case 160: case 164: - if (member.kind === 164 && member.symbol.flags & 32768) { + case 165: + if (member.kind === 165 && member.symbol.flags & 32768) { break; } var symbol = getSymbolOfNode(member); @@ -52236,7 +52528,7 @@ var ts; addDiagnostic(member, 0, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); } break; - case 162: + case 163: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8)) { @@ -52244,8 +52536,8 @@ var ts; } } break; - case 167: - case 222: + case 168: + case 223: break; default: ts.Debug.fail(); @@ -52269,7 +52561,7 @@ var ts; continue; var name = ts.idText(typeParameter.name); var parent = typeParameter.parent; - if (parent.kind !== 181 && parent.typeParameters.every(isTypeParameterUnused)) { + if (parent.kind !== 182 && parent.typeParameters.every(isTypeParameterUnused)) { if (seenParentsWithEveryUnused.tryAdd(parent)) { var range = ts.isJSDocTemplateTag(parent) ? ts.rangeOfNode(parent) @@ -52346,7 +52638,7 @@ var ts; var importDecl = importClause.parent; var nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? - (importClause.namedBindings.kind === 256 ? 1 : importClause.namedBindings.elements.length) + (importClause.namedBindings.kind === 257 ? 1 : importClause.namedBindings.elements.length) : 0); if (nDeclarations === unuseds.length) { addDiagnostic(importDecl, 0, unuseds.length === 1 @@ -52364,7 +52656,7 @@ var ts; var bindingPattern = _a[0], bindingElements = _a[1]; var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 : 0; if (bindingPattern.elements.length === bindingElements.length) { - if (bindingElements.length === 1 && bindingPattern.parent.kind === 242 && bindingPattern.parent.parent.kind === 243) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 243 && bindingPattern.parent.parent.kind === 244) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { @@ -52385,7 +52677,7 @@ var ts; if (declarationList.declarations.length === declarations.length) { addDiagnostic(declarationList, 0, declarations.length === 1 ? ts.createDiagnosticForNode(ts.first(declarations).name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(declarations).name)) - : ts.createDiagnosticForNode(declarationList.parent.kind === 225 ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); + : ts.createDiagnosticForNode(declarationList.parent.kind === 226 ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); } else { for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { @@ -52399,21 +52691,21 @@ var ts; switch (name.kind) { case 75: return ts.idText(name); + case 191: case 190: - case 189: return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name); default: return ts.Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 255 || node.kind === 258 || node.kind === 256; + return node.kind === 256 || node.kind === 259 || node.kind === 257; } function importClauseFromImported(decl) { - return decl.kind === 255 ? decl : decl.kind === 256 ? decl.parent : decl.parent.parent; + return decl.kind === 256 ? decl : decl.kind === 257 ? decl.parent : decl.parent.parent; } function checkBlock(node) { - if (node.kind === 223) { + if (node.kind === 224) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -52442,19 +52734,19 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 159 || - node.kind === 158 || + if (node.kind === 160 || + node.kind === 159 || + node.kind === 162 || node.kind === 161 || - node.kind === 160 || - node.kind === 163 || - node.kind === 164) { + node.kind === 164 || + node.kind === 165) { return false; } if (node.flags & 8388608) { return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 156 && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 157 && ts.nodeIsMissing(root.parent.body)) { return false; } return true; @@ -52506,7 +52798,7 @@ var ts; return; } var parent = getDeclarationContainer(node); - if (parent.kind === 290 && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 291 && ts.isExternalOrCommonJsModule(parent)) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -52518,7 +52810,7 @@ var ts; return; } var parent = getDeclarationContainer(node); - if (parent.kind === 290 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048) { + if (parent.kind === 291 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -52526,7 +52818,7 @@ var ts; if ((ts.getCombinedNodeFlags(node) & 3) !== 0 || ts.isParameterDeclaration(node)) { return; } - if (node.kind === 242 && !node.initializer) { + if (node.kind === 243 && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -52538,15 +52830,15 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 243); - var container = varDeclList.parent.kind === 225 && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 244); + var container = varDeclList.parent.kind === 226 && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; var namesShareScope = container && - (container.kind === 223 && ts.isFunctionLike(container.parent) || + (container.kind === 224 && ts.isFunctionLike(container.parent) || + container.kind === 251 || container.kind === 250 || - container.kind === 249 || - container.kind === 290); + container.kind === 291); if (!namesShareScope) { var name = symbolToString(localDeclarationSymbol); error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name); @@ -52566,17 +52858,17 @@ var ts; if (!node.name) { return; } - if (node.name.kind === 154) { + if (node.name.kind === 155) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 191) { - if (node.parent.kind === 189 && languageVersion < 99) { + if (node.kind === 192) { + if (node.parent.kind === 190 && languageVersion < 99) { checkExternalEmitHelpers(node, 4); } - if (node.propertyName && node.propertyName.kind === 154) { + if (node.propertyName && node.propertyName.kind === 155) { checkComputedPropertyName(node.propertyName); } var parent = node.parent.parent; @@ -52595,17 +52887,17 @@ var ts; } } if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 190 && languageVersion < 2 && compilerOptions.downlevelIteration) { + if (node.name.kind === 191 && languageVersion < 2 && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512); } ts.forEach(node.name.elements, checkSourceElement); } - if (node.initializer && ts.getRootDeclaration(node).kind === 156 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 157 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } if (ts.isBindingPattern(node.name)) { - var needCheckInitializer = node.initializer && node.parent.parent.kind !== 231; + var needCheckInitializer = node.initializer && node.parent.parent.kind !== 232; var needCheckWidenedType = node.name.elements.length === 0; if (needCheckInitializer || needCheckWidenedType) { var widenedType = getWidenedTypeForVariableLikeDeclaration(node); @@ -52638,7 +52930,7 @@ var ts; ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) && ts.hasEntries(symbol.exports); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 231) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 232) { checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, undefined); } } @@ -52662,9 +52954,9 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 159 && node.kind !== 158) { + if (node.kind !== 160 && node.kind !== 159) { checkExportsOnMergedDeclarations(node); - if (node.kind === 242 || node.kind === 191) { + if (node.kind === 243 || node.kind === 192) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -52676,7 +52968,7 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 159 || nextDeclaration.kind === 158 + var message = nextDeclaration.kind === 160 || nextDeclaration.kind === 159 ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; var declName = ts.declarationNameToString(nextDeclarationName); @@ -52686,8 +52978,8 @@ var ts; } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 156 && right.kind === 242) || - (left.kind === 242 && right.kind === 156)) { + if ((left.kind === 157 && right.kind === 243) || + (left.kind === 243 && right.kind === 157)) { return true; } if (ts.hasQuestionToken(left) !== ts.hasQuestionToken(right)) { @@ -52723,7 +53015,7 @@ var ts; var type = checkTruthinessExpression(node.expression); checkTestingKnownTruthyCallableType(node.expression, node.thenStatement, type); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 224) { + if (node.thenStatement.kind === 225) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -52786,12 +53078,12 @@ var ts; } function checkForStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 243) { + if (node.initializer && node.initializer.kind === 244) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 243) { + if (node.initializer.kind === 244) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -52818,13 +53110,13 @@ var ts; else if (compilerOptions.downlevelIteration && languageVersion < 2) { checkExternalEmitHelpers(node, 256); } - if (node.initializer.kind === 243) { + if (node.initializer.kind === 244) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier); - if (varExpr.kind === 192 || varExpr.kind === 193) { + if (varExpr.kind === 193 || varExpr.kind === 194) { checkDestructuringAssignment(varExpr, iteratedType || errorType); } else { @@ -52843,7 +53135,7 @@ var ts; function checkForInStatement(node) { checkGrammarForInOrForOfStatement(node); var rightType = getNonNullableTypeIfNeeded(checkExpression(node.expression)); - if (node.initializer.kind === 243) { + if (node.initializer.kind === 244) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -52853,7 +53145,7 @@ var ts; else { var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 192 || varExpr.kind === 193) { + if (varExpr.kind === 193 || varExpr.kind === 194) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -52863,7 +53155,7 @@ var ts; checkReferenceExpression(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access); } } - if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 | 58982400)) { + if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 | 193200128)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, typeToString(rightType)); } checkSourceElement(node.statement); @@ -53305,7 +53597,7 @@ var ts; var isGenerator = !!(functionFlags & 1); var isAsync = !!(functionFlags & 2); return isGenerator ? getIterationTypeOfGeneratorFunctionReturnType(1, returnType, isAsync) || errorType : - isAsync ? getPromisedTypeOfPromise(returnType) || errorType : + isAsync ? unwrapAwaitedType(getAwaitedType(returnType) || errorType) : returnType; } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { @@ -53326,12 +53618,12 @@ var ts; var functionFlags = ts.getFunctionFlags(func); if (strictNullChecks || node.expression || returnType.flags & 131072) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 164) { + if (func.kind === 165) { if (node.expression) { error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 162) { + else if (func.kind === 163) { if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -53339,14 +53631,14 @@ var ts; else if (getReturnTypeFromAnnotation(func)) { var unwrappedReturnType = unwrapReturnType(returnType, functionFlags); var unwrappedExprType = functionFlags & 2 - ? checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) + ? unwrapAwaitedType(checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)) : exprType; if (unwrappedReturnType) { checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, node, node.expression); } } } - else if (func.kind !== 162 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 163 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } } @@ -53371,7 +53663,7 @@ var ts; var expressionType = checkExpression(node.expression); var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { - if (clause.kind === 278 && !hasDuplicateDefaultClause) { + if (clause.kind === 279 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -53380,7 +53672,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 277) { + if (produceDiagnostics && clause.kind === 278) { var caseType = checkExpression(clause.expression); var caseIsLiteral = isLiteralType(caseType); var comparedExpressionType = expressionType; @@ -53407,7 +53699,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 238 && current.label.escapedText === node.label.escapedText) { + if (current.kind === 239 && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label)); return true; } @@ -53502,8 +53794,8 @@ var ts; } var errorNode; if (propDeclaration && name && - (propDeclaration.kind === 209 || - name.kind === 154 || + (propDeclaration.kind === 210 || + name.kind === 155 || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -53568,7 +53860,7 @@ var ts; function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 169) { + if (node.kind === 170) { var type = getTypeFromTypeReference(node); if (type.flags & 262144) { for (var i = index; i < typeParameters.length; i++) { @@ -53793,7 +54085,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 245 || d.kind === 246; + return d.kind === 246 || d.kind === 247; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -53824,7 +54116,7 @@ var ts; continue basePropertyCheck; } } - if (derivedClassDecl.kind === 214) { + if (derivedClassDecl.kind === 215) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -53843,7 +54135,7 @@ var ts; if (basePropertyFlags && derivedPropertyFlags) { if (!compilerOptions.useDefineForClassFields || baseDeclarationFlags & 128 && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer) - || base.valueDeclaration && base.valueDeclaration.parent.kind === 246 + || base.valueDeclaration && base.valueDeclaration.parent.kind === 247 || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) { continue; } @@ -53856,7 +54148,7 @@ var ts; error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type)); } else { - var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 159 && !d.initializer; }); + var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 160 && !d.initializer; }); if (uninitialized && !(derived.flags & 33554432) && !(baseDeclarationFlags & 128) @@ -53951,7 +54243,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 159 && + return node.kind === 160 && !ts.hasModifier(node, 32 | 128) && !node.exclamationToken && !node.initializer; @@ -53973,7 +54265,7 @@ var ts; checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 246); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 247); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -54070,7 +54362,7 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 207: + case 208: var value_2 = evaluate(expr.operand); if (typeof value_2 === "number") { switch (expr.operator) { @@ -54080,7 +54372,7 @@ var ts; } } break; - case 209: + case 210: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -54109,7 +54401,7 @@ var ts; case 8: checkGrammarNumericLiteral(expr); return +expr.text; - case 200: + case 201: return evaluate(expr.expression); case 75: var identifier = expr; @@ -54117,14 +54409,14 @@ var ts; return +(identifier.escapedText); } return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText); + case 196: case 195: - case 194: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384) { var name = void 0; - if (ex.kind === 194) { + if (ex.kind === 195) { name = ex.name.escapedText; } else { @@ -54154,8 +54446,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 75 || - node.kind === 194 && isConstantMemberAccess(node.expression) || - node.kind === 195 && isConstantMemberAccess(node.expression) && + node.kind === 195 && isConstantMemberAccess(node.expression) || + node.kind === 196 && isConstantMemberAccess(node.expression) && ts.isStringLiteralLike(node.argumentExpression); } function checkEnumDeclaration(node) { @@ -54182,7 +54474,7 @@ var ts; } var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 248) { + if (declaration.kind !== 249) { return false; } var enumDeclaration = declaration; @@ -54210,8 +54502,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { var declaration = declarations_8[_i]; - if ((declaration.kind === 245 || - (declaration.kind === 244 && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 246 || + (declaration.kind === 245 && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 8388608)) { return declaration; } @@ -54269,7 +54561,7 @@ var ts; error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } - var mergedClass = ts.getDeclarationOfKind(symbol, 245); + var mergedClass = ts.getDeclarationOfKind(symbol, 246); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768; @@ -54312,22 +54604,22 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 225: + case 226: for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 259: case 260: + case 261: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 253: case 254: + case 255: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 191: - case 242: + case 192: + case 243: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -54336,12 +54628,12 @@ var ts; } break; } - case 245: - case 248: - case 244: case 246: case 249: + case 245: case 247: + case 250: + case 248: if (isGlobalAugmentation) { return; } @@ -54359,12 +54651,12 @@ var ts; switch (node.kind) { case 75: return node; - case 153: + case 154: do { node = node.left; } while (node.kind !== 75); return node; - case 194: + case 195: do { if (ts.isModuleExportsAccessExpression(node.expression) && !ts.isPrivateIdentifier(node.name)) { return node.name; @@ -54383,9 +54675,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 250 && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 290 && !inAmbientExternalModule) { - error(moduleName, node.kind === 260 ? + var inAmbientExternalModule = node.parent.kind === 251 && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 291 && !inAmbientExternalModule) { + error(moduleName, node.kind === 261 ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -54408,13 +54700,13 @@ var ts; (symbol.flags & 788968 ? 788968 : 0) | (symbol.flags & 1920 ? 1920 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 263 ? + var message = node.kind === 264 ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } if (compilerOptions.isolatedModules - && node.kind === 263 + && node.kind === 264 && !node.parent.parent.isTypeOnly && !(target.flags & 111551) && !(node.flags & 8388608)) { @@ -54441,7 +54733,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 256) { + if (importClause.namedBindings.kind === 257) { checkImportBinding(importClause.namedBindings); } else { @@ -54464,7 +54756,7 @@ var ts; if (ts.hasModifier(node, 1)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 265) { + if (node.moduleReference.kind !== 266) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 111551) { @@ -54504,10 +54796,10 @@ var ts; else if (!ts.isNamespaceExport(node.exportClause)) { checkImportBinding(node.exportClause); } - var inAmbientExternalModule = node.parent.kind === 250 && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 250 && + var inAmbientExternalModule = node.parent.kind === 251 && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 251 && !node.moduleSpecifier && node.flags & 8388608; - if (node.parent.kind !== 290 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 291 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -54524,14 +54816,14 @@ var ts; } function checkGrammarExportDeclaration(node) { var _a; - var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 261; + var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 262; if (isTypeOnlyExportStar) { grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type); } return !isTypeOnlyExportStar; } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 290 || node.parent.kind === 250 || node.parent.kind === 249; + var isInAppropriateContext = node.parent.kind === 291 || node.parent.kind === 251 || node.parent.kind === 250; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -54584,8 +54876,8 @@ var ts; if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_assignment_can_only_be_used_in_a_module)) { return; } - var container = node.parent.kind === 290 ? node.parent : node.parent.parent; - if (container.kind === 249 && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 291 ? node.parent : node.parent.parent; + if (container.kind === 250 && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -54687,164 +54979,164 @@ var ts; var kind = node.kind; if (cancellationToken) { switch (kind) { - case 249: - case 245: + case 250: case 246: - case 244: + case 247: + case 245: cancellationToken.throwIfCancellationRequested(); } } - if (kind >= 225 && kind <= 241 && node.flowNode && !isReachableFlowNode(node.flowNode)) { + if (kind >= 226 && kind <= 242 && node.flowNode && !isReachableFlowNode(node.flowNode)) { errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, ts.Diagnostics.Unreachable_code_detected); } switch (kind) { - case 155: - return checkTypeParameter(node); case 156: + return checkTypeParameter(node); + case 157: return checkParameter(node); - case 159: + case 160: return checkPropertyDeclaration(node); - case 158: + case 159: return checkPropertySignature(node); - case 170: case 171: - case 165: + case 172: case 166: case 167: + case 168: return checkSignatureDeclaration(node); + case 162: case 161: - case 160: return checkMethodDeclaration(node); - case 162: - return checkConstructorDeclaration(node); case 163: + return checkConstructorDeclaration(node); case 164: + case 165: return checkAccessorDeclaration(node); - case 169: + case 170: return checkTypeReferenceNode(node); - case 168: + case 169: return checkTypePredicate(node); - case 172: - return checkTypeQuery(node); case 173: - return checkTypeLiteral(node); + return checkTypeQuery(node); case 174: - return checkArrayType(node); + return checkTypeLiteral(node); case 175: + return checkArrayType(node); + case 176: return checkTupleType(node); - case 178: case 179: + case 180: return checkUnionOrIntersectionType(node); - case 182: - case 176: + case 183: case 177: + case 178: return checkSourceElement(node.type); - case 183: - return checkThisType(node); case 184: + return checkThisType(node); + case 185: return checkTypeOperator(node); - case 180: - return checkConditionalType(node); case 181: + return checkConditionalType(node); + case 182: return checkInferType(node); - case 188: + case 189: return checkImportType(node); - case 307: - return checkJSDocAugmentsTag(node); case 308: + return checkJSDocAugmentsTag(node); + case 309: return checkJSDocImplementsTag(node); - case 322: - case 315: + case 323: case 316: + case 317: return checkJSDocTypeAliasTag(node); - case 321: + case 322: return checkJSDocTemplateTag(node); - case 320: + case 321: return checkJSDocTypeTag(node); - case 317: + case 318: return checkJSDocParameterTag(node); - case 300: + case 301: checkJSDocFunctionType(node); + case 299: case 298: - case 297: - case 295: case 296: - case 304: + case 297: + case 305: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 301: + case 302: checkJSDocVariadicType(node); return; - case 294: + case 295: return checkSourceElement(node.type); - case 185: - return checkIndexedAccessType(node); case 186: + return checkIndexedAccessType(node); + case 187: return checkMappedType(node); - case 244: + case 245: return checkFunctionDeclaration(node); - case 223: - case 250: + case 224: + case 251: return checkBlock(node); - case 225: - return checkVariableStatement(node); case 226: - return checkExpressionStatement(node); + return checkVariableStatement(node); case 227: - return checkIfStatement(node); + return checkExpressionStatement(node); case 228: - return checkDoStatement(node); + return checkIfStatement(node); case 229: - return checkWhileStatement(node); + return checkDoStatement(node); case 230: - return checkForStatement(node); + return checkWhileStatement(node); case 231: - return checkForInStatement(node); + return checkForStatement(node); case 232: - return checkForOfStatement(node); + return checkForInStatement(node); case 233: + return checkForOfStatement(node); case 234: - return checkBreakOrContinueStatement(node); case 235: - return checkReturnStatement(node); + return checkBreakOrContinueStatement(node); case 236: - return checkWithStatement(node); + return checkReturnStatement(node); case 237: - return checkSwitchStatement(node); + return checkWithStatement(node); case 238: - return checkLabeledStatement(node); + return checkSwitchStatement(node); case 239: - return checkThrowStatement(node); + return checkLabeledStatement(node); case 240: + return checkThrowStatement(node); + case 241: return checkTryStatement(node); - case 242: + case 243: return checkVariableDeclaration(node); - case 191: + case 192: return checkBindingElement(node); - case 245: - return checkClassDeclaration(node); case 246: - return checkInterfaceDeclaration(node); + return checkClassDeclaration(node); case 247: - return checkTypeAliasDeclaration(node); + return checkInterfaceDeclaration(node); case 248: - return checkEnumDeclaration(node); + return checkTypeAliasDeclaration(node); case 249: + return checkEnumDeclaration(node); + case 250: return checkModuleDeclaration(node); - case 254: + case 255: return checkImportDeclaration(node); - case 253: + case 254: return checkImportEqualsDeclaration(node); - case 260: + case 261: return checkExportDeclaration(node); - case 259: + case 260: return checkExportAssignment(node); - case 224: - case 241: + case 225: + case 242: checkGrammarStatementInAmbientContext(node); return; - case 264: + case 265: return checkMissingDeclaration(node); } } @@ -54920,30 +55212,30 @@ var ts; currentNode = node; instantiationCount = 0; switch (node.kind) { - case 196: case 197: case 198: - case 157: - case 268: + case 199: + case 158: + case 269: resolveUntypedCall(node); break; - case 201: case 202: + case 203: + case 162: case 161: - case 160: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 163: case 164: + case 165: checkAccessorDeclaration(node); break; - case 214: + case 215: checkClassExpressionDeferred(node); break; - case 267: + case 268: checkJsxSelfClosingElementDeferred(node); break; - case 266: + case 267: checkJsxElementDeferred(node); break; } @@ -55070,27 +55362,27 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 290: + case 291: if (!ts.isExternalOrCommonJsModule(location)) break; - case 249: + case 250: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475); break; - case 248: + case 249: copySymbols(getSymbolOfNode(location).exports, meaning & 8); break; - case 214: + case 215: var className = location.name; if (className) { copySymbol(location.symbol, meaning); } - case 245: case 246: + case 247: if (!isStatic) { copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968); } break; - case 201: + case 202: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -55128,32 +55420,32 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 155: - case 245: + case 156: case 246: case 247: case 248: + case 249: return true; - case 255: + case 256: return node.isTypeOnly; - case 258: - case 263: + case 259: + case 264: return node.parent.parent.isTypeOnly; default: return false; } } function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 153) { + while (node.parent.kind === 154) { node = node.parent; } - return node.parent.kind === 169; + return node.parent.kind === 170; } function isHeritageClauseElementIdentifier(node) { - while (node.parent.kind === 194) { + while (node.parent.kind === 195) { node = node.parent; } - return node.parent.kind === 216; + return node.parent.kind === 217; } function forEachEnclosingClass(node, callback) { var result; @@ -55181,13 +55473,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 153) { + while (nodeOnRightSide.parent.kind === 154) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 253) { + if (nodeOnRightSide.parent.kind === 254) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } - if (nodeOnRightSide.parent.kind === 259) { + if (nodeOnRightSide.parent.kind === 260) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } return undefined; @@ -55213,7 +55505,7 @@ var ts; node = parent; parent = parent.parent; } - if (parent && parent.kind === 188 && parent.qualifier === node) { + if (parent && parent.kind === 189 && parent.qualifier === node) { return parent; } return undefined; @@ -55223,7 +55515,7 @@ var ts; return getSymbolOfNode(name.parent); } if (ts.isInJSFile(name) && - name.parent.kind === 194 && + name.parent.kind === 195 && name.parent === name.parent.parent.left) { if (!ts.isPrivateIdentifier(name)) { var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(name); @@ -55232,14 +55524,14 @@ var ts; } } } - if (name.parent.kind === 259 && ts.isEntityNameExpression(name)) { + if (name.parent.kind === 260 && ts.isEntityNameExpression(name)) { var success = resolveEntityName(name, 111551 | 788968 | 1920 | 2097152, true); if (success && success !== unknownSymbol) { return success; } } else if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name) && isInRightSideOfImportOrExportAssignment(name)) { - var importEqualsDeclaration = ts.getAncestor(name, 253); + var importEqualsDeclaration = ts.getAncestor(name, 254); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(name, true); } @@ -55256,7 +55548,7 @@ var ts; } if (isHeritageClauseElementIdentifier(name)) { var meaning = 0; - if (name.parent.kind === 216) { + if (name.parent.kind === 217) { meaning = 788968; if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { meaning |= 111551; @@ -55271,10 +55563,10 @@ var ts; return entityNameSymbol; } } - if (name.parent.kind === 317) { + if (name.parent.kind === 318) { return ts.getParameterSymbolFromJSDoc(name.parent); } - if (name.parent.kind === 155 && name.parent.parent.kind === 321) { + if (name.parent.kind === 156 && name.parent.parent.kind === 322) { ts.Debug.assert(!ts.isInJSFile(name)); var typeParameter = ts.getTypeParameterFromJsDoc(name.parent); return typeParameter && typeParameter.symbol; @@ -55290,12 +55582,12 @@ var ts; } return resolveEntityName(name, 111551, false, true); } - else if (name.kind === 194 || name.kind === 153) { + else if (name.kind === 195 || name.kind === 154) { var links = getNodeLinks(name); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (name.kind === 194) { + if (name.kind === 195) { checkPropertyAccessExpression(name); } else { @@ -55305,16 +55597,16 @@ var ts; } } else if (isTypeReferenceIdentifier(name)) { - var meaning = name.parent.kind === 169 ? 788968 : 1920; + var meaning = name.parent.kind === 170 ? 788968 : 1920; return resolveEntityName(name, meaning, false, true); } - if (name.parent.kind === 168) { + if (name.parent.kind === 169) { return resolveEntityName(name, 1); } return undefined; } function getSymbolAtLocation(node, ignoreErrors) { - if (node.kind === 290) { + if (node.kind === 291) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } var parent = node.parent; @@ -55335,8 +55627,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); } - else if (parent.kind === 191 && - grandParent.kind === 189 && + else if (parent.kind === 192 && + grandParent.kind === 190 && node === parent.propertyName) { var typeOfPattern = getTypeOfNode(grandParent); var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); @@ -55348,8 +55640,8 @@ var ts; switch (node.kind) { case 75: case 76: - case 194: - case 153: + case 195: + case 154: return getSymbolOfNameOrPropertyAccessExpression(node); case 104: var container = ts.getThisContainer(node, false); @@ -55362,20 +55654,20 @@ var ts; if (ts.isInExpressionContext(node)) { return checkExpression(node).symbol; } - case 183: + case 184: return getTypeFromThisTypeNode(node).symbol; case 102: return checkExpression(node).symbol; - case 129: + case 130: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 162) { + if (constructorDeclaration && constructorDeclaration.kind === 163) { return constructorDeclaration.parent.symbol; } return undefined; case 10: case 14: if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 254 || node.parent.kind === 260) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 255 || node.parent.kind === 261) && node.parent.moduleSpecifier === node) || ((ts.isInJSFile(node) && ts.isRequireCall(node.parent, false)) || ts.isImportCall(node.parent)) || (ts.isLiteralTypeNode(node.parent) && ts.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent)) { return resolveExternalModuleName(node, node, ignoreErrors); @@ -55395,7 +55687,7 @@ var ts; case 38: case 80: return getSymbolOfNode(node.parent); - case 188: + case 189: return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : undefined; case 89: return ts.isExportAssignment(node.parent) ? ts.Debug.checkDefined(node.parent.symbol) : undefined; @@ -55404,7 +55696,7 @@ var ts; } } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 282) { + if (location && location.kind === 283) { return resolveEntityName(location.name, 111551 | 2097152); } return undefined; @@ -55463,16 +55755,16 @@ var ts; return errorType; } function getTypeOfAssignmentPattern(expr) { - ts.Debug.assert(expr.kind === 193 || expr.kind === 192); - if (expr.parent.kind === 232) { + ts.Debug.assert(expr.kind === 194 || expr.kind === 193); + if (expr.parent.kind === 233) { var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier); return checkDestructuringAssignment(expr, iteratedType || errorType); } - if (expr.parent.kind === 209) { + if (expr.parent.kind === 210) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || errorType); } - if (expr.parent.kind === 281) { + if (expr.parent.kind === 282) { var node_4 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression); var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_4) || errorType; var propertyIndex = ts.indexOfNode(node_4.properties, expr.parent); @@ -55507,7 +55799,7 @@ var ts; case 8: case 10: return getLiteralType(name.text); - case 154: + case 155: var nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288) ? nameType : stringType; default: @@ -55560,7 +55852,7 @@ var ts; if (!ts.isGeneratedIdentifier(nodeIn)) { var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier); if (node) { - var isPropertyName_1 = node.parent.kind === 194 && node.parent.name === node; + var isPropertyName_1 = node.parent.kind === 195 && node.parent.name === node; return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } @@ -55602,7 +55894,7 @@ var ts; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 && parentSymbol_1.valueDeclaration.kind === 290) { + if (parentSymbol_1.flags & 512 && parentSymbol_1.valueDeclaration.kind === 291) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); var symbolIsUmdExport = symbolFile !== referenceFile; @@ -55625,7 +55917,7 @@ var ts; } function isSymbolOfDestructuredElementOfCatchBinding(symbol) { return ts.isBindingElement(symbol.valueDeclaration) - && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 280; + && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 281; } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 && !ts.isSourceFile(symbol.valueDeclaration)) { @@ -55640,7 +55932,7 @@ var ts; else if (nodeLinks_1.flags & 262144) { var isDeclaredInLoop = nodeLinks_1.flags & 524288; var inLoopInitializer = ts.isIterationStatement(container, false); - var inLoopBodyBlock = container.kind === 223 && ts.isIterationStatement(container.parent, false); + var inLoopBodyBlock = container.kind === 224 && ts.isIterationStatement(container.parent, false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -55676,19 +55968,19 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 253: + case 254: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 255: case 256: - case 258: - case 263: + case 257: + case 259: + case 264: var symbol = getSymbolOfNode(node) || unknownSymbol; return isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol); - case 260: + case 261: var exportClause = node.exportClause; return !!exportClause && (ts.isNamespaceExport(exportClause) || ts.some(exportClause.elements, isValueAliasDeclaration)); - case 259: + case 260: return node.expression && node.expression.kind === 75 ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) : true; @@ -55697,7 +55989,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 290 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 291 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); @@ -55784,15 +56076,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 284: - case 194: + case 285: case 195: + case 196: return true; } return false; } function getConstantValue(node) { - if (node.kind === 284) { + if (node.kind === 285) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -55960,7 +56252,9 @@ var ts; return; } var file = host.getSourceFile(resolvedDirective.resolvedFileName); - addReferencedFilesToTypeDirective(file, key); + if (file) { + addReferencedFilesToTypeDirective(file, key); + } }); } return { @@ -56016,12 +56310,12 @@ var ts; getJsxFactoryEntity: getJsxFactoryEntity, getAllAccessorDeclarations: function (accessor) { accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration); - var otherKind = accessor.kind === 164 ? 163 : 164; + var otherKind = accessor.kind === 165 ? 164 : 165; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind); var firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor; var secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor; - var setAccessor = accessor.kind === 164 ? accessor : otherAccessor; - var getAccessor = accessor.kind === 163 ? accessor : otherAccessor; + var setAccessor = accessor.kind === 165 ? accessor : otherAccessor; + var getAccessor = accessor.kind === 164 ? accessor : otherAccessor; return { firstAccessor: firstAccessor, secondAccessor: secondAccessor, @@ -56037,7 +56331,7 @@ var ts; }, getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) { var n = ts.getParseTreeNode(node); - ts.Debug.assert(n && n.kind === 290, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + ts.Debug.assert(n && n.kind === 291, "Non-sourcefile node passed into getDeclarationsForSourceFile"); var sym = getSymbolOfNode(node); if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); @@ -56046,14 +56340,14 @@ var ts; } }; function isInHeritageClause(node) { - return node.parent && node.parent.kind === 216 && node.parent.parent && node.parent.parent.kind === 279; + return node.parent && node.parent.kind === 217 && node.parent.parent && node.parent.parent.kind === 280; } function getTypeReferenceDirectivesForEntityName(node) { if (!fileToDirective) { return undefined; } var meaning = 788968 | 1920; - if ((node.kind === 75 && isInTypeQuery(node)) || (node.kind === 194 && !isInHeritageClause(node))) { + if ((node.kind === 75 && isInTypeQuery(node)) || (node.kind === 195 && !isInHeritageClause(node))) { meaning = 111551 | 1048576; } var symbol = resolveEntityName(node, meaning, true); @@ -56096,7 +56390,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 290 && current.flags & 512) { + if (current.valueDeclaration && current.valueDeclaration.kind === 291 && current.flags & 512) { return false; } for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { @@ -56123,12 +56417,12 @@ var ts; } } function getExternalModuleFileFromDeclaration(declaration) { - var specifier = declaration.kind === 249 ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); + var specifier = declaration.kind === 250 ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, undefined); if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 290); + return ts.getDeclarationOfKind(moduleSymbol, 291); } function initializeTypeChecker() { for (var _i = 0, _a = host.getSourceFiles(); _i < _a.length; _i++) { @@ -56299,14 +56593,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 161 && !ts.nodeIsPresent(node.body)) { + if (node.kind === 162 && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 163 || node.kind === 164) { + else if (node.kind === 164 || node.kind === 165) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -56323,17 +56617,17 @@ var ts; var flags = 0; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 138) { - if (node.kind === 158 || node.kind === 160) { + if (modifier.kind !== 139) { + if (node.kind === 159 || node.kind === 161) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 167) { + if (node.kind === 168) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 81: - if (node.kind !== 248) { + if (node.kind !== 249) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(81)); } break; @@ -56353,7 +56647,7 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 250 || node.parent.kind === 290) { + else if (node.parent.kind === 251 || node.parent.kind === 291) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128) { @@ -56379,10 +56673,10 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 250 || node.parent.kind === 290) { + else if (node.parent.kind === 251 || node.parent.kind === 291) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 156) { + else if (node.kind === 157) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128) { @@ -56394,11 +56688,11 @@ var ts; flags |= 32; lastStatic = modifier; break; - case 138: + case 139: if (flags & 64) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 159 && node.kind !== 158 && node.kind !== 167 && node.kind !== 156) { + else if (node.kind !== 160 && node.kind !== 159 && node.kind !== 168 && node.kind !== 157) { return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } flags |= 64; @@ -56420,19 +56714,19 @@ var ts; else if (ts.isClassLike(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 156) { + else if (node.kind === 157) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1; break; case 84: - var container = node.parent.kind === 290 ? node.parent : node.parent.parent; - if (container.kind === 249 && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 291 ? node.parent : node.parent.parent; + if (container.kind === 250 && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512; break; - case 130: + case 131: if (flags & 2) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } @@ -56442,10 +56736,10 @@ var ts; else if (ts.isClassLike(node.parent) && !ts.isPropertyDeclaration(node)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 156) { + else if (node.kind === 157) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 8388608) && node.parent.kind === 250) { + else if ((node.parent.flags & 8388608) && node.parent.kind === 251) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } else if (ts.isPrivateIdentifierPropertyDeclaration(node)) { @@ -56458,14 +56752,14 @@ var ts; if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 245) { - if (node.kind !== 161 && - node.kind !== 159 && - node.kind !== 163 && - node.kind !== 164) { + if (node.kind !== 246) { + if (node.kind !== 162 && + node.kind !== 160 && + node.kind !== 164 && + node.kind !== 165) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 245 && ts.hasModifier(node.parent, 128))) { + if (!(node.parent.kind === 246 && ts.hasModifier(node.parent, 128))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32) { @@ -56487,7 +56781,7 @@ var ts; else if (flags & 2 || node.parent.flags & 8388608) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 156) { + else if (node.kind === 157) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256; @@ -56495,7 +56789,7 @@ var ts; break; } } - if (node.kind === 162) { + if (node.kind === 163) { if (flags & 32) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -56510,13 +56804,13 @@ var ts; } return false; } - else if ((node.kind === 254 || node.kind === 253) && flags & 2) { + else if ((node.kind === 255 || node.kind === 254) && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 156 && (flags & 92) && ts.isBindingPattern(node.name)) { + else if (node.kind === 157 && (flags & 92) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 156 && (flags & 92) && node.dotDotDotToken) { + else if (node.kind === 157 && (flags & 92) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256) { @@ -56533,37 +56827,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 163: case 164: - case 162: + case 165: + case 163: + case 160: case 159: - case 158: + case 162: case 161: - case 160: - case 167: - case 249: + case 168: + case 250: + case 255: case 254: - case 253: + case 261: case 260: - case 259: - case 201: case 202: - case 156: + case 203: + case 157: return false; default: - if (node.parent.kind === 250 || node.parent.kind === 290) { + if (node.parent.kind === 251 || node.parent.kind === 291) { return false; } switch (node.kind) { - case 244: - return nodeHasAnyModifiersExcept(node, 126); case 245: - return nodeHasAnyModifiersExcept(node, 122); + return nodeHasAnyModifiersExcept(node, 126); case 246: - case 225: + return nodeHasAnyModifiersExcept(node, 122); case 247: - return true; + case 226: case 248: + return true; + case 249: return nodeHasAnyModifiersExcept(node, 81); default: ts.Debug.fail(); @@ -56576,10 +56870,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 161: - case 244: - case 201: + case 162: + case 245: case 202: + case 203: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -56693,7 +56987,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 143 && parameter.type.kind !== 140) { + if (parameter.type.kind !== 144 && parameter.type.kind !== 141) { var type = getTypeFromTypeNode(parameter.type); if (type.flags & 4 || type.flags & 8) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType)); @@ -56734,7 +57028,7 @@ var ts; if (args) { for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 215) { + if (arg.kind === 216) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -56808,20 +57102,20 @@ var ts; return false; } function checkGrammarComputedPropertyName(node) { - if (node.kind !== 154) { + if (node.kind !== 155) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 209 && computedPropertyName.expression.operatorToken.kind === 27) { + if (computedPropertyName.expression.kind === 210 && computedPropertyName.expression.operatorToken.kind === 27) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } return false; } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 244 || - node.kind === 201 || - node.kind === 161); + ts.Debug.assert(node.kind === 245 || + node.kind === 202 || + node.kind === 162); if (node.flags & 8388608) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -56840,7 +57134,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 283) { + if (prop.kind === 284) { if (inDestructuring) { var expression = ts.skipParentheses(prop.expression); if (ts.isArrayLiteralExpression(expression) || ts.isObjectLiteralExpression(expression)) { @@ -56850,10 +57144,10 @@ var ts; continue; } var name = prop.name; - if (name.kind === 154) { + if (name.kind === 155) { checkGrammarComputedPropertyName(name); } - if (prop.kind === 282 && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 283 && !inDestructuring && prop.objectAssignmentInitializer) { return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); } if (name.kind === 76) { @@ -56862,29 +57156,29 @@ var ts; if (prop.modifiers) { for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { var mod = _c[_b]; - if (mod.kind !== 126 || prop.kind !== 161) { + if (mod.kind !== 126 || prop.kind !== 162) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } } var currentKind = void 0; switch (prop.kind) { - case 282: + case 283: checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); - case 281: + case 282: checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8) { checkGrammarNumericLiteral(name); } currentKind = 4; break; - case 161: + case 162: currentKind = 8; break; - case 163: + case 164: currentKind = 1; break; - case 164: + case 165: currentKind = 2; break; default: @@ -56923,7 +57217,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 275) { + if (attr.kind === 276) { continue; } var name = attr.name, initializer = attr.initializer; @@ -56933,7 +57227,7 @@ var ts; else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 276 && !initializer.expression) { + if (initializer && initializer.kind === 277 && !initializer.expression) { return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -56947,13 +57241,13 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 232 && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 233 && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 32768) === 0) { var sourceFile = ts.getSourceFileOfNode(forInOrOfStatement); if (!hasParseDiagnostics(sourceFile)) { var diagnostic = ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); var func = ts.getContainingFunction(forInOrOfStatement); - if (func && func.kind !== 162) { + if (func && func.kind !== 163) { ts.Debug.assert((ts.getFunctionFlags(func) & 2) === 0, "Enclosing function should never be an async function."); var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); @@ -56964,7 +57258,7 @@ var ts; return false; } } - if (forInOrOfStatement.initializer.kind === 243) { + if (forInOrOfStatement.initializer.kind === 244) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -56972,20 +57266,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 231 + var diagnostic = forInOrOfStatement.kind === 232 ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 231 + var diagnostic = forInOrOfStatement.kind === 232 ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 231 + var diagnostic = forInOrOfStatement.kind === 232 ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -57010,11 +57304,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, accessor.kind === 163 ? + return grammarErrorOnNode(accessor.name, accessor.kind === 164 ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - if (accessor.kind === 164) { + if (accessor.kind === 165) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -57032,21 +57326,21 @@ var ts; return false; } function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 163 ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 164 ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 163 ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 164 ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 147) { - if (node.type.kind !== 144) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(144)); + if (node.operator === 148) { + if (node.type.kind !== 145) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(145)); } var parent = ts.walkUpParenthesizedTypes(node.parent); switch (parent.kind) { - case 242: + case 243: var decl = parent; if (decl.name.kind !== 75) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -57058,13 +57352,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 159: + case 160: if (!ts.hasModifier(parent, 32) || !ts.hasModifier(parent, 64)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 158: + case 159: if (!ts.hasModifier(parent, 64)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -57073,9 +57367,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_not_allowed_here); } } - else if (node.operator === 138) { - if (node.type.kind !== 174 && node.type.kind !== 175) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(144)); + else if (node.operator === 139) { + if (node.type.kind !== 175 && node.type.kind !== 176) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(145)); } } } @@ -57088,8 +57382,8 @@ var ts; if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 161) { - if (node.parent.kind === 193) { + if (node.kind === 162) { + if (node.parent.kind === 194) { if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 126)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } @@ -57111,14 +57405,14 @@ var ts; if (node.flags & 8388608) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.kind === 161 && !node.body) { + else if (node.kind === 162 && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 246) { + else if (node.parent.kind === 247) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 173) { + else if (node.parent.kind === 174) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -57129,9 +57423,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 238: + case 239: if (node.label && current.label.escapedText === node.label.escapedText) { - var isMisplacedContinueLabel = node.kind === 233 + var isMisplacedContinueLabel = node.kind === 234 && !ts.isIterationStatement(current.statement, true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -57139,8 +57433,8 @@ var ts; return false; } break; - case 237: - if (node.kind === 234 && !node.label) { + case 238: + if (node.kind === 235 && !node.label) { return false; } break; @@ -57153,13 +57447,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 234 + var message = node.kind === 235 ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 234 + var message = node.kind === 235 ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -57182,12 +57476,12 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return ts.isStringOrNumericLiteralLike(expr) || - expr.kind === 207 && expr.operator === 40 && + expr.kind === 208 && expr.operator === 40 && expr.operand.kind === 8; } function isBigIntLiteralExpression(expr) { return expr.kind === 9 || - expr.kind === 207 && expr.operator === 40 && + expr.kind === 208 && expr.operator === 40 && expr.operand.kind === 9; } function isSimpleLiteralEnumReference(expr) { @@ -57218,7 +57512,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 231 && node.parent.parent.kind !== 232) { + if (node.parent.parent.kind !== 232 && node.parent.parent.kind !== 233) { if (node.flags & 8388608) { checkAmbientInitializer(node); } @@ -57231,7 +57525,7 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 225 || !node.type || node.initializer || node.flags & 8388608)) { + if (node.exclamationToken && (node.parent.parent.kind !== 226 || !node.type || node.initializer || node.flags & 8388608)) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation); } var moduleKind = ts.getEmitModuleKind(compilerOptions); @@ -57288,15 +57582,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 227: case 228: case 229: - case 236: case 230: + case 237: case 231: case 232: + case 233: return false; - case 238: + case 239: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -57380,7 +57674,7 @@ var ts; return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } } - else if (node.parent.kind === 246) { + else if (node.parent.kind === 247) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -57388,7 +57682,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 173) { + else if (node.parent.kind === 174) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -57405,13 +57699,13 @@ var ts; } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 246 || - node.kind === 247 || + if (node.kind === 247 || + node.kind === 248 || + node.kind === 255 || node.kind === 254 || - node.kind === 253 || + node.kind === 261 || node.kind === 260 || - node.kind === 259 || - node.kind === 252 || + node.kind === 253 || ts.hasModifier(node, 2 | 1 | 512)) { return false; } @@ -57420,7 +57714,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 225) { + if (ts.isDeclaration(decl) || decl.kind === 226) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -57437,7 +57731,7 @@ var ts; if (!links.hasReportedStatementInAmbientContext && (ts.isFunctionLike(node.parent) || ts.isAccessor(node.parent))) { return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } - if (node.parent.kind === 223 || node.parent.kind === 250 || node.parent.kind === 290) { + if (node.parent.kind === 224 || node.parent.kind === 251 || node.parent.kind === 291) { var links_2 = getNodeLinks(node.parent); if (!links_2.hasReportedStatementInAmbientContext) { return links_2.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); @@ -57454,10 +57748,10 @@ var ts; if (languageVersion >= 1) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 187)) { + else if (ts.isChildOfNodeWithKind(node, 188)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 284)) { + else if (ts.isChildOfNodeWithKind(node, 285)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -57615,13 +57909,13 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 244 && declaration.kind !== 161) || + return (declaration.kind !== 245 && declaration.kind !== 162) || !!declaration.body; } function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 258: - case 263: + case 259: + case 264: return ts.isIdentifier(name); default: return ts.isDeclarationName(name); @@ -57629,13 +57923,13 @@ var ts; } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 255: - case 253: case 256: - case 258: + case 254: + case 257: + case 259: return true; case 75: - return decl.parent.kind === 258; + return decl.parent.kind === 259; default: return false; } @@ -57879,7 +58173,7 @@ var ts; result.push(createModifier(89)); } if (flags & 2) { - result.push(createModifier(130)); + result.push(createModifier(131)); } if (flags & 512) { result.push(createModifier(84)); @@ -57903,7 +58197,7 @@ var ts; result.push(createModifier(120)); } if (flags & 64) { - result.push(createModifier(138)); + result.push(createModifier(139)); } if (flags & 256) { result.push(createModifier(126)); @@ -57912,7 +58206,7 @@ var ts; } ts.createModifiersFromModifierFlags = createModifiersFromModifierFlags; function createQualifiedName(left, right) { - var node = createSynthesizedNode(153); + var node = createSynthesizedNode(154); node.left = left; node.right = asName(right); return node; @@ -57931,7 +58225,7 @@ var ts; : expression; } function createComputedPropertyName(expression) { - var node = createSynthesizedNode(154); + var node = createSynthesizedNode(155); node.expression = parenthesizeForComputedName(expression); return node; } @@ -57943,7 +58237,7 @@ var ts; } ts.updateComputedPropertyName = updateComputedPropertyName; function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createSynthesizedNode(155); + var node = createSynthesizedNode(156); node.name = asName(name); node.constraint = constraint; node.default = defaultType; @@ -57959,7 +58253,7 @@ var ts; } ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createSynthesizedNode(156); + var node = createSynthesizedNode(157); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; @@ -57983,7 +58277,7 @@ var ts; } ts.updateParameter = updateParameter; function createDecorator(expression) { - var node = createSynthesizedNode(157); + var node = createSynthesizedNode(158); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -57995,7 +58289,7 @@ var ts; } ts.updateDecorator = updateDecorator; function createPropertySignature(modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(158); + var node = createSynthesizedNode(159); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -58015,7 +58309,7 @@ var ts; } ts.updatePropertySignature = updatePropertySignature; function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - var node = createSynthesizedNode(159); + var node = createSynthesizedNode(160); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -58039,7 +58333,7 @@ var ts; } ts.updateProperty = updateProperty; function createMethodSignature(typeParameters, parameters, type, name, questionToken) { - var node = createSignatureDeclaration(160, typeParameters, parameters, type); + var node = createSignatureDeclaration(161, typeParameters, parameters, type); node.name = asName(name); node.questionToken = questionToken; return node; @@ -58056,7 +58350,7 @@ var ts; } ts.updateMethodSignature = updateMethodSignature; function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(161); + var node = createSynthesizedNode(162); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -58113,7 +58407,7 @@ var ts; } ts.updateMethod = updateMethod; function createConstructor(decorators, modifiers, parameters, body) { - var node = createSynthesizedNode(162); + var node = createSynthesizedNode(163); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; @@ -58133,7 +58427,7 @@ var ts; } ts.updateConstructor = updateConstructor; function createGetAccessor(decorators, modifiers, name, parameters, type, body) { - var node = createSynthesizedNode(163); + var node = createSynthesizedNode(164); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -58156,7 +58450,7 @@ var ts; } ts.updateGetAccessor = updateGetAccessor; function createSetAccessor(decorators, modifiers, name, parameters, body) { - var node = createSynthesizedNode(164); + var node = createSynthesizedNode(165); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -58177,7 +58471,7 @@ var ts; } ts.updateSetAccessor = updateSetAccessor; function createCallSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(165, typeParameters, parameters, type); + return createSignatureDeclaration(166, typeParameters, parameters, type); } ts.createCallSignature = createCallSignature; function updateCallSignature(node, typeParameters, parameters, type) { @@ -58185,7 +58479,7 @@ var ts; } ts.updateCallSignature = updateCallSignature; function createConstructSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(166, typeParameters, parameters, type); + return createSignatureDeclaration(167, typeParameters, parameters, type); } ts.createConstructSignature = createConstructSignature; function updateConstructSignature(node, typeParameters, parameters, type) { @@ -58193,7 +58487,7 @@ var ts; } ts.updateConstructSignature = updateConstructSignature; function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createSynthesizedNode(167); + var node = createSynthesizedNode(168); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); @@ -58235,7 +58529,7 @@ var ts; } ts.createTypePredicateNode = createTypePredicateNode; function createTypePredicateNodeWithModifier(assertsModifier, parameterName, type) { - var node = createSynthesizedNode(168); + var node = createSynthesizedNode(169); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); node.type = type; @@ -58255,7 +58549,7 @@ var ts; } ts.updateTypePredicateNodeWithModifier = updateTypePredicateNodeWithModifier; function createTypeReferenceNode(typeName, typeArguments) { - var node = createSynthesizedNode(169); + var node = createSynthesizedNode(170); node.typeName = asName(typeName); node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments); return node; @@ -58269,7 +58563,7 @@ var ts; } ts.updateTypeReferenceNode = updateTypeReferenceNode; function createFunctionTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(170, typeParameters, parameters, type); + return createSignatureDeclaration(171, typeParameters, parameters, type); } ts.createFunctionTypeNode = createFunctionTypeNode; function updateFunctionTypeNode(node, typeParameters, parameters, type) { @@ -58277,7 +58571,7 @@ var ts; } ts.updateFunctionTypeNode = updateFunctionTypeNode; function createConstructorTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(171, typeParameters, parameters, type); + return createSignatureDeclaration(172, typeParameters, parameters, type); } ts.createConstructorTypeNode = createConstructorTypeNode; function updateConstructorTypeNode(node, typeParameters, parameters, type) { @@ -58285,7 +58579,7 @@ var ts; } ts.updateConstructorTypeNode = updateConstructorTypeNode; function createTypeQueryNode(exprName) { - var node = createSynthesizedNode(172); + var node = createSynthesizedNode(173); node.exprName = exprName; return node; } @@ -58297,7 +58591,7 @@ var ts; } ts.updateTypeQueryNode = updateTypeQueryNode; function createTypeLiteralNode(members) { - var node = createSynthesizedNode(173); + var node = createSynthesizedNode(174); node.members = createNodeArray(members); return node; } @@ -58309,7 +58603,7 @@ var ts; } ts.updateTypeLiteralNode = updateTypeLiteralNode; function createArrayTypeNode(elementType) { - var node = createSynthesizedNode(174); + var node = createSynthesizedNode(175); node.elementType = ts.parenthesizeArrayTypeMember(elementType); return node; } @@ -58321,7 +58615,7 @@ var ts; } ts.updateArrayTypeNode = updateArrayTypeNode; function createTupleTypeNode(elementTypes) { - var node = createSynthesizedNode(175); + var node = createSynthesizedNode(176); node.elementTypes = createNodeArray(elementTypes); return node; } @@ -58333,7 +58627,7 @@ var ts; } ts.updateTupleTypeNode = updateTupleTypeNode; function createOptionalTypeNode(type) { - var node = createSynthesizedNode(176); + var node = createSynthesizedNode(177); node.type = ts.parenthesizeArrayTypeMember(type); return node; } @@ -58345,7 +58639,7 @@ var ts; } ts.updateOptionalTypeNode = updateOptionalTypeNode; function createRestTypeNode(type) { - var node = createSynthesizedNode(177); + var node = createSynthesizedNode(178); node.type = type; return node; } @@ -58357,7 +58651,7 @@ var ts; } ts.updateRestTypeNode = updateRestTypeNode; function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(178, types); + return createUnionOrIntersectionTypeNode(179, types); } ts.createUnionTypeNode = createUnionTypeNode; function updateUnionTypeNode(node, types) { @@ -58365,7 +58659,7 @@ var ts; } ts.updateUnionTypeNode = updateUnionTypeNode; function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(179, types); + return createUnionOrIntersectionTypeNode(180, types); } ts.createIntersectionTypeNode = createIntersectionTypeNode; function updateIntersectionTypeNode(node, types) { @@ -58384,7 +58678,7 @@ var ts; : node; } function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - var node = createSynthesizedNode(180); + var node = createSynthesizedNode(181); node.checkType = ts.parenthesizeConditionalTypeMember(checkType); node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType); node.trueType = trueType; @@ -58402,7 +58696,7 @@ var ts; } ts.updateConditionalTypeNode = updateConditionalTypeNode; function createInferTypeNode(typeParameter) { - var node = createSynthesizedNode(181); + var node = createSynthesizedNode(182); node.typeParameter = typeParameter; return node; } @@ -58414,7 +58708,7 @@ var ts; } ts.updateInferTypeNode = updateInferTypeNode; function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) { - var node = createSynthesizedNode(188); + var node = createSynthesizedNode(189); node.argument = argument; node.qualifier = qualifier; node.typeArguments = ts.parenthesizeTypeParameters(typeArguments); @@ -58432,7 +58726,7 @@ var ts; } ts.updateImportTypeNode = updateImportTypeNode; function createParenthesizedType(type) { - var node = createSynthesizedNode(182); + var node = createSynthesizedNode(183); node.type = type; return node; } @@ -58444,12 +58738,12 @@ var ts; } ts.updateParenthesizedType = updateParenthesizedType; function createThisTypeNode() { - return createSynthesizedNode(183); + return createSynthesizedNode(184); } ts.createThisTypeNode = createThisTypeNode; function createTypeOperatorNode(operatorOrType, type) { - var node = createSynthesizedNode(184); - node.operator = typeof operatorOrType === "number" ? operatorOrType : 134; + var node = createSynthesizedNode(185); + node.operator = typeof operatorOrType === "number" ? operatorOrType : 135; node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); return node; } @@ -58459,7 +58753,7 @@ var ts; } ts.updateTypeOperatorNode = updateTypeOperatorNode; function createIndexedAccessTypeNode(objectType, indexType) { - var node = createSynthesizedNode(185); + var node = createSynthesizedNode(186); node.objectType = ts.parenthesizeElementTypeMember(objectType); node.indexType = indexType; return node; @@ -58473,7 +58767,7 @@ var ts; } ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { - var node = createSynthesizedNode(186); + var node = createSynthesizedNode(187); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.questionToken = questionToken; @@ -58491,7 +58785,7 @@ var ts; } ts.updateMappedTypeNode = updateMappedTypeNode; function createLiteralTypeNode(literal) { - var node = createSynthesizedNode(187); + var node = createSynthesizedNode(188); node.literal = literal; return node; } @@ -58503,7 +58797,7 @@ var ts; } ts.updateLiteralTypeNode = updateLiteralTypeNode; function createObjectBindingPattern(elements) { - var node = createSynthesizedNode(189); + var node = createSynthesizedNode(190); node.elements = createNodeArray(elements); return node; } @@ -58515,7 +58809,7 @@ var ts; } ts.updateObjectBindingPattern = updateObjectBindingPattern; function createArrayBindingPattern(elements) { - var node = createSynthesizedNode(190); + var node = createSynthesizedNode(191); node.elements = createNodeArray(elements); return node; } @@ -58527,7 +58821,7 @@ var ts; } ts.updateArrayBindingPattern = updateArrayBindingPattern; function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createSynthesizedNode(191); + var node = createSynthesizedNode(192); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -58545,7 +58839,7 @@ var ts; } ts.updateBindingElement = updateBindingElement; function createArrayLiteral(elements, multiLine) { - var node = createSynthesizedNode(192); + var node = createSynthesizedNode(193); node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) node.multiLine = true; @@ -58559,7 +58853,7 @@ var ts; } ts.updateArrayLiteral = updateArrayLiteral; function createObjectLiteral(properties, multiLine) { - var node = createSynthesizedNode(193); + var node = createSynthesizedNode(194); node.properties = createNodeArray(properties); if (multiLine) node.multiLine = true; @@ -58573,7 +58867,7 @@ var ts; } ts.updateObjectLiteral = updateObjectLiteral; function createPropertyAccess(expression, name) { - var node = createSynthesizedNode(194); + var node = createSynthesizedNode(195); node.expression = ts.parenthesizeForAccess(expression); node.name = asName(name); setEmitFlags(node, 131072); @@ -58592,7 +58886,7 @@ var ts; } ts.updatePropertyAccess = updatePropertyAccess; function createPropertyAccessChain(expression, questionDotToken, name) { - var node = createSynthesizedNode(194); + var node = createSynthesizedNode(195); node.flags |= 32; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -58611,7 +58905,7 @@ var ts; } ts.updatePropertyAccessChain = updatePropertyAccessChain; function createElementAccess(expression, index) { - var node = createSynthesizedNode(195); + var node = createSynthesizedNode(196); node.expression = ts.parenthesizeForAccess(expression); node.argumentExpression = asExpression(index); return node; @@ -58628,7 +58922,7 @@ var ts; } ts.updateElementAccess = updateElementAccess; function createElementAccessChain(expression, questionDotToken, index) { - var node = createSynthesizedNode(195); + var node = createSynthesizedNode(196); node.flags |= 32; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -58646,7 +58940,7 @@ var ts; } ts.updateElementAccessChain = updateElementAccessChain; function createCall(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(196); + var node = createSynthesizedNode(197); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); @@ -58665,7 +58959,7 @@ var ts; } ts.updateCall = updateCall; function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { - var node = createSynthesizedNode(196); + var node = createSynthesizedNode(197); node.flags |= 32; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -58685,7 +58979,7 @@ var ts; } ts.updateCallChain = updateCallChain; function createNew(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(197); + var node = createSynthesizedNode(198); node.expression = ts.parenthesizeForNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; @@ -58701,7 +58995,7 @@ var ts; } ts.updateNew = updateNew; function createTaggedTemplate(tag, typeArgumentsOrTemplate, template) { - var node = createSynthesizedNode(198); + var node = createSynthesizedNode(199); node.tag = ts.parenthesizeForAccess(tag); if (template) { node.typeArguments = asNodeArray(typeArgumentsOrTemplate); @@ -58724,7 +59018,7 @@ var ts; } ts.updateTaggedTemplate = updateTaggedTemplate; function createTypeAssertion(type, expression) { - var node = createSynthesizedNode(199); + var node = createSynthesizedNode(200); node.type = type; node.expression = ts.parenthesizePrefixOperand(expression); return node; @@ -58738,7 +59032,7 @@ var ts; } ts.updateTypeAssertion = updateTypeAssertion; function createParen(expression) { - var node = createSynthesizedNode(200); + var node = createSynthesizedNode(201); node.expression = expression; return node; } @@ -58750,7 +59044,7 @@ var ts; } ts.updateParen = updateParen; function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(201); + var node = createSynthesizedNode(202); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -58774,7 +59068,7 @@ var ts; } ts.updateFunctionExpression = updateFunctionExpression; function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createSynthesizedNode(202); + var node = createSynthesizedNode(203); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -58796,7 +59090,7 @@ var ts; } ts.updateArrowFunction = updateArrowFunction; function createDelete(expression) { - var node = createSynthesizedNode(203); + var node = createSynthesizedNode(204); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -58808,7 +59102,7 @@ var ts; } ts.updateDelete = updateDelete; function createTypeOf(expression) { - var node = createSynthesizedNode(204); + var node = createSynthesizedNode(205); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -58820,7 +59114,7 @@ var ts; } ts.updateTypeOf = updateTypeOf; function createVoid(expression) { - var node = createSynthesizedNode(205); + var node = createSynthesizedNode(206); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -58832,7 +59126,7 @@ var ts; } ts.updateVoid = updateVoid; function createAwait(expression) { - var node = createSynthesizedNode(206); + var node = createSynthesizedNode(207); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -58844,7 +59138,7 @@ var ts; } ts.updateAwait = updateAwait; function createPrefix(operator, operand) { - var node = createSynthesizedNode(207); + var node = createSynthesizedNode(208); node.operator = operator; node.operand = ts.parenthesizePrefixOperand(operand); return node; @@ -58857,7 +59151,7 @@ var ts; } ts.updatePrefix = updatePrefix; function createPostfix(operand, operator) { - var node = createSynthesizedNode(208); + var node = createSynthesizedNode(209); node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; @@ -58870,7 +59164,7 @@ var ts; } ts.updatePostfix = updatePostfix; function createBinary(left, operator, right) { - var node = createSynthesizedNode(209); + var node = createSynthesizedNode(210); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = ts.parenthesizeBinaryOperand(operatorKind, left, true, undefined); @@ -58887,7 +59181,7 @@ var ts; } ts.updateBinary = updateBinary; function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - var node = createSynthesizedNode(210); + var node = createSynthesizedNode(211); node.condition = ts.parenthesizeForConditionalHead(condition); node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(57); node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); @@ -58907,7 +59201,7 @@ var ts; } ts.updateConditional = updateConditional; function createTemplateExpression(head, templateSpans) { - var node = createSynthesizedNode(211); + var node = createSynthesizedNode(212); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; @@ -59004,7 +59298,7 @@ var ts; } ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral; function createYield(asteriskTokenOrExpression, expression) { - var node = createSynthesizedNode(212); + var node = createSynthesizedNode(213); node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 41 ? asteriskTokenOrExpression : undefined; node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 41 ? asteriskTokenOrExpression : expression; return node; @@ -59018,7 +59312,7 @@ var ts; } ts.updateYield = updateYield; function createSpread(expression) { - var node = createSynthesizedNode(213); + var node = createSynthesizedNode(214); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -59030,7 +59324,7 @@ var ts; } ts.updateSpread = updateSpread; function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(214); + var node = createSynthesizedNode(215); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -59051,11 +59345,11 @@ var ts; } ts.updateClassExpression = updateClassExpression; function createOmittedExpression() { - return createSynthesizedNode(215); + return createSynthesizedNode(216); } ts.createOmittedExpression = createOmittedExpression; function createExpressionWithTypeArguments(typeArguments, expression) { - var node = createSynthesizedNode(216); + var node = createSynthesizedNode(217); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); return node; @@ -59069,7 +59363,7 @@ var ts; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; function createAsExpression(expression, type) { - var node = createSynthesizedNode(217); + var node = createSynthesizedNode(218); node.expression = expression; node.type = type; return node; @@ -59083,7 +59377,7 @@ var ts; } ts.updateAsExpression = updateAsExpression; function createNonNullExpression(expression) { - var node = createSynthesizedNode(218); + var node = createSynthesizedNode(219); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -59095,7 +59389,7 @@ var ts; } ts.updateNonNullExpression = updateNonNullExpression; function createMetaProperty(keywordToken, name) { - var node = createSynthesizedNode(219); + var node = createSynthesizedNode(220); node.keywordToken = keywordToken; node.name = name; return node; @@ -59108,7 +59402,7 @@ var ts; } ts.updateMetaProperty = updateMetaProperty; function createTemplateSpan(expression, literal) { - var node = createSynthesizedNode(221); + var node = createSynthesizedNode(222); node.expression = expression; node.literal = literal; return node; @@ -59122,11 +59416,11 @@ var ts; } ts.updateTemplateSpan = updateTemplateSpan; function createSemicolonClassElement() { - return createSynthesizedNode(222); + return createSynthesizedNode(223); } ts.createSemicolonClassElement = createSemicolonClassElement; function createBlock(statements, multiLine) { - var block = createSynthesizedNode(223); + var block = createSynthesizedNode(224); block.statements = createNodeArray(statements); if (multiLine) block.multiLine = multiLine; @@ -59140,7 +59434,7 @@ var ts; } ts.updateBlock = updateBlock; function createVariableStatement(modifiers, declarationList) { - var node = createSynthesizedNode(225); + var node = createSynthesizedNode(226); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; @@ -59155,11 +59449,11 @@ var ts; } ts.updateVariableStatement = updateVariableStatement; function createEmptyStatement() { - return createSynthesizedNode(224); + return createSynthesizedNode(225); } ts.createEmptyStatement = createEmptyStatement; function createExpressionStatement(expression) { - var node = createSynthesizedNode(226); + var node = createSynthesizedNode(227); node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } @@ -59173,7 +59467,7 @@ var ts; ts.createStatement = createExpressionStatement; ts.updateStatement = updateExpressionStatement; function createIf(expression, thenStatement, elseStatement) { - var node = createSynthesizedNode(227); + var node = createSynthesizedNode(228); node.expression = expression; node.thenStatement = asEmbeddedStatement(thenStatement); node.elseStatement = asEmbeddedStatement(elseStatement); @@ -59189,7 +59483,7 @@ var ts; } ts.updateIf = updateIf; function createDo(statement, expression) { - var node = createSynthesizedNode(228); + var node = createSynthesizedNode(229); node.statement = asEmbeddedStatement(statement); node.expression = expression; return node; @@ -59203,7 +59497,7 @@ var ts; } ts.updateDo = updateDo; function createWhile(expression, statement) { - var node = createSynthesizedNode(229); + var node = createSynthesizedNode(230); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -59217,7 +59511,7 @@ var ts; } ts.updateWhile = updateWhile; function createFor(initializer, condition, incrementor, statement) { - var node = createSynthesizedNode(230); + var node = createSynthesizedNode(231); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -59235,7 +59529,7 @@ var ts; } ts.updateFor = updateFor; function createForIn(initializer, expression, statement) { - var node = createSynthesizedNode(231); + var node = createSynthesizedNode(232); node.initializer = initializer; node.expression = expression; node.statement = asEmbeddedStatement(statement); @@ -59251,7 +59545,7 @@ var ts; } ts.updateForIn = updateForIn; function createForOf(awaitModifier, initializer, expression, statement) { - var node = createSynthesizedNode(232); + var node = createSynthesizedNode(233); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = ts.isCommaSequence(expression) ? createParen(expression) : expression; @@ -59269,7 +59563,7 @@ var ts; } ts.updateForOf = updateForOf; function createContinue(label) { - var node = createSynthesizedNode(233); + var node = createSynthesizedNode(234); node.label = asName(label); return node; } @@ -59281,7 +59575,7 @@ var ts; } ts.updateContinue = updateContinue; function createBreak(label) { - var node = createSynthesizedNode(234); + var node = createSynthesizedNode(235); node.label = asName(label); return node; } @@ -59293,7 +59587,7 @@ var ts; } ts.updateBreak = updateBreak; function createReturn(expression) { - var node = createSynthesizedNode(235); + var node = createSynthesizedNode(236); node.expression = expression; return node; } @@ -59305,7 +59599,7 @@ var ts; } ts.updateReturn = updateReturn; function createWith(expression, statement) { - var node = createSynthesizedNode(236); + var node = createSynthesizedNode(237); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -59319,7 +59613,7 @@ var ts; } ts.updateWith = updateWith; function createSwitch(expression, caseBlock) { - var node = createSynthesizedNode(237); + var node = createSynthesizedNode(238); node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; @@ -59333,7 +59627,7 @@ var ts; } ts.updateSwitch = updateSwitch; function createLabel(label, statement) { - var node = createSynthesizedNode(238); + var node = createSynthesizedNode(239); node.label = asName(label); node.statement = asEmbeddedStatement(statement); return node; @@ -59347,7 +59641,7 @@ var ts; } ts.updateLabel = updateLabel; function createThrow(expression) { - var node = createSynthesizedNode(239); + var node = createSynthesizedNode(240); node.expression = expression; return node; } @@ -59359,7 +59653,7 @@ var ts; } ts.updateThrow = updateThrow; function createTry(tryBlock, catchClause, finallyBlock) { - var node = createSynthesizedNode(240); + var node = createSynthesizedNode(241); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -59375,11 +59669,11 @@ var ts; } ts.updateTry = updateTry; function createDebuggerStatement() { - return createSynthesizedNode(241); + return createSynthesizedNode(242); } ts.createDebuggerStatement = createDebuggerStatement; function createVariableDeclaration(name, type, initializer) { - var node = createSynthesizedNode(242); + var node = createSynthesizedNode(243); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -59395,7 +59689,7 @@ var ts; } ts.updateVariableDeclaration = updateVariableDeclaration; function createTypeScriptVariableDeclaration(name, exclaimationToken, type, initializer) { - var node = createSynthesizedNode(242); + var node = createSynthesizedNode(243); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -59414,7 +59708,7 @@ var ts; ts.updateTypeScriptVariableDeclaration = updateTypeScriptVariableDeclaration; function createVariableDeclarationList(declarations, flags) { if (flags === void 0) { flags = 0; } - var node = createSynthesizedNode(243); + var node = createSynthesizedNode(244); node.flags |= flags & 3; node.declarations = createNodeArray(declarations); return node; @@ -59427,7 +59721,7 @@ var ts; } ts.updateVariableDeclarationList = updateVariableDeclarationList; function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(244); + var node = createSynthesizedNode(245); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -59453,7 +59747,7 @@ var ts; } ts.updateFunctionDeclaration = updateFunctionDeclaration; function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(245); + var node = createSynthesizedNode(246); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -59475,7 +59769,7 @@ var ts; } ts.updateClassDeclaration = updateClassDeclaration; function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(246); + var node = createSynthesizedNode(247); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -59497,7 +59791,7 @@ var ts; } ts.updateInterfaceDeclaration = updateInterfaceDeclaration; function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createSynthesizedNode(247); + var node = createSynthesizedNode(248); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -59517,7 +59811,7 @@ var ts; } ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration; function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createSynthesizedNode(248); + var node = createSynthesizedNode(249); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -59536,7 +59830,7 @@ var ts; ts.updateEnumDeclaration = updateEnumDeclaration; function createModuleDeclaration(decorators, modifiers, name, body, flags) { if (flags === void 0) { flags = 0; } - var node = createSynthesizedNode(249); + var node = createSynthesizedNode(250); node.flags |= flags & (16 | 4 | 1024); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); @@ -59555,7 +59849,7 @@ var ts; } ts.updateModuleDeclaration = updateModuleDeclaration; function createModuleBlock(statements) { - var node = createSynthesizedNode(250); + var node = createSynthesizedNode(251); node.statements = createNodeArray(statements); return node; } @@ -59567,7 +59861,7 @@ var ts; } ts.updateModuleBlock = updateModuleBlock; function createCaseBlock(clauses) { - var node = createSynthesizedNode(251); + var node = createSynthesizedNode(252); node.clauses = createNodeArray(clauses); return node; } @@ -59579,7 +59873,7 @@ var ts; } ts.updateCaseBlock = updateCaseBlock; function createNamespaceExportDeclaration(name) { - var node = createSynthesizedNode(252); + var node = createSynthesizedNode(253); node.name = asName(name); return node; } @@ -59591,7 +59885,7 @@ var ts; } ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration; function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createSynthesizedNode(253); + var node = createSynthesizedNode(254); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -59609,7 +59903,7 @@ var ts; } ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createSynthesizedNode(254); + var node = createSynthesizedNode(255); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -59628,7 +59922,7 @@ var ts; ts.updateImportDeclaration = updateImportDeclaration; function createImportClause(name, namedBindings, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(255); + var node = createSynthesizedNode(256); node.name = name; node.namedBindings = namedBindings; node.isTypeOnly = isTypeOnly; @@ -59644,13 +59938,13 @@ var ts; } ts.updateImportClause = updateImportClause; function createNamespaceImport(name) { - var node = createSynthesizedNode(256); + var node = createSynthesizedNode(257); node.name = name; return node; } ts.createNamespaceImport = createNamespaceImport; function createNamespaceExport(name) { - var node = createSynthesizedNode(262); + var node = createSynthesizedNode(263); node.name = name; return node; } @@ -59668,7 +59962,7 @@ var ts; } ts.updateNamespaceExport = updateNamespaceExport; function createNamedImports(elements) { - var node = createSynthesizedNode(257); + var node = createSynthesizedNode(258); node.elements = createNodeArray(elements); return node; } @@ -59680,7 +59974,7 @@ var ts; } ts.updateNamedImports = updateNamedImports; function createImportSpecifier(propertyName, name) { - var node = createSynthesizedNode(258); + var node = createSynthesizedNode(259); node.propertyName = propertyName; node.name = name; return node; @@ -59694,7 +59988,7 @@ var ts; } ts.updateImportSpecifier = updateImportSpecifier; function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createSynthesizedNode(259); + var node = createSynthesizedNode(260); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -59712,7 +60006,7 @@ var ts; ts.updateExportAssignment = updateExportAssignment; function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(260); + var node = createSynthesizedNode(261); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isTypeOnly = isTypeOnly; @@ -59736,7 +60030,7 @@ var ts; } ts.createEmptyExports = createEmptyExports; function createNamedExports(elements) { - var node = createSynthesizedNode(261); + var node = createSynthesizedNode(262); node.elements = createNodeArray(elements); return node; } @@ -59748,7 +60042,7 @@ var ts; } ts.updateNamedExports = updateNamedExports; function createExportSpecifier(propertyName, name) { - var node = createSynthesizedNode(263); + var node = createSynthesizedNode(264); node.propertyName = asName(propertyName); node.name = asName(name); return node; @@ -59762,7 +60056,7 @@ var ts; } ts.updateExportSpecifier = updateExportSpecifier; function createExternalModuleReference(expression) { - var node = createSynthesizedNode(265); + var node = createSynthesizedNode(266); node.expression = expression; return node; } @@ -59774,33 +60068,33 @@ var ts; } ts.updateExternalModuleReference = updateExternalModuleReference; function createJSDocTypeExpression(type) { - var node = createSynthesizedNode(294); + var node = createSynthesizedNode(295); node.type = type; return node; } ts.createJSDocTypeExpression = createJSDocTypeExpression; function createJSDocTypeTag(typeExpression, comment) { - var tag = createJSDocTag(320, "type"); + var tag = createJSDocTag(321, "type"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; } ts.createJSDocTypeTag = createJSDocTypeTag; function createJSDocReturnTag(typeExpression, comment) { - var tag = createJSDocTag(318, "returns"); + var tag = createJSDocTag(319, "returns"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; } ts.createJSDocReturnTag = createJSDocReturnTag; function createJSDocThisTag(typeExpression) { - var tag = createJSDocTag(319, "this"); + var tag = createJSDocTag(320, "this"); tag.typeExpression = typeExpression; return tag; } ts.createJSDocThisTag = createJSDocThisTag; function createJSDocParamTag(name, isBracketed, typeExpression, comment) { - var tag = createJSDocTag(317, "param"); + var tag = createJSDocTag(318, "param"); tag.typeExpression = typeExpression; tag.name = name; tag.isBracketed = isBracketed; @@ -59809,7 +60103,7 @@ var ts; } ts.createJSDocParamTag = createJSDocParamTag; function createJSDocComment(comment, tags) { - var node = createSynthesizedNode(303); + var node = createSynthesizedNode(304); node.comment = comment; node.tags = tags; return node; @@ -59821,7 +60115,7 @@ var ts; return node; } function createJsxElement(openingElement, children, closingElement) { - var node = createSynthesizedNode(266); + var node = createSynthesizedNode(267); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -59837,7 +60131,7 @@ var ts; } ts.updateJsxElement = updateJsxElement; function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(267); + var node = createSynthesizedNode(268); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -59853,7 +60147,7 @@ var ts; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; function createJsxOpeningElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(268); + var node = createSynthesizedNode(269); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -59869,7 +60163,7 @@ var ts; } ts.updateJsxOpeningElement = updateJsxOpeningElement; function createJsxClosingElement(tagName) { - var node = createSynthesizedNode(269); + var node = createSynthesizedNode(270); node.tagName = tagName; return node; } @@ -59881,7 +60175,7 @@ var ts; } ts.updateJsxClosingElement = updateJsxClosingElement; function createJsxFragment(openingFragment, children, closingFragment) { - var node = createSynthesizedNode(270); + var node = createSynthesizedNode(271); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -59903,11 +60197,11 @@ var ts; } ts.updateJsxText = updateJsxText; function createJsxOpeningFragment() { - return createSynthesizedNode(271); + return createSynthesizedNode(272); } ts.createJsxOpeningFragment = createJsxOpeningFragment; function createJsxJsxClosingFragment() { - return createSynthesizedNode(272); + return createSynthesizedNode(273); } ts.createJsxJsxClosingFragment = createJsxJsxClosingFragment; function updateJsxFragment(node, openingFragment, children, closingFragment) { @@ -59919,7 +60213,7 @@ var ts; } ts.updateJsxFragment = updateJsxFragment; function createJsxAttribute(name, initializer) { - var node = createSynthesizedNode(273); + var node = createSynthesizedNode(274); node.name = name; node.initializer = initializer; return node; @@ -59933,7 +60227,7 @@ var ts; } ts.updateJsxAttribute = updateJsxAttribute; function createJsxAttributes(properties) { - var node = createSynthesizedNode(274); + var node = createSynthesizedNode(275); node.properties = createNodeArray(properties); return node; } @@ -59945,7 +60239,7 @@ var ts; } ts.updateJsxAttributes = updateJsxAttributes; function createJsxSpreadAttribute(expression) { - var node = createSynthesizedNode(275); + var node = createSynthesizedNode(276); node.expression = expression; return node; } @@ -59957,7 +60251,7 @@ var ts; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; function createJsxExpression(dotDotDotToken, expression) { - var node = createSynthesizedNode(276); + var node = createSynthesizedNode(277); node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; @@ -59970,7 +60264,7 @@ var ts; } ts.updateJsxExpression = updateJsxExpression; function createCaseClause(expression, statements) { - var node = createSynthesizedNode(277); + var node = createSynthesizedNode(278); node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; @@ -59984,7 +60278,7 @@ var ts; } ts.updateCaseClause = updateCaseClause; function createDefaultClause(statements) { - var node = createSynthesizedNode(278); + var node = createSynthesizedNode(279); node.statements = createNodeArray(statements); return node; } @@ -59996,7 +60290,7 @@ var ts; } ts.updateDefaultClause = updateDefaultClause; function createHeritageClause(token, types) { - var node = createSynthesizedNode(279); + var node = createSynthesizedNode(280); node.token = token; node.types = createNodeArray(types); return node; @@ -60009,7 +60303,7 @@ var ts; } ts.updateHeritageClause = updateHeritageClause; function createCatchClause(variableDeclaration, block) { - var node = createSynthesizedNode(280); + var node = createSynthesizedNode(281); node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -60023,7 +60317,7 @@ var ts; } ts.updateCatchClause = updateCatchClause; function createPropertyAssignment(name, initializer) { - var node = createSynthesizedNode(281); + var node = createSynthesizedNode(282); node.name = asName(name); node.questionToken = undefined; node.initializer = ts.parenthesizeExpressionForList(initializer); @@ -60038,7 +60332,7 @@ var ts; } ts.updatePropertyAssignment = updatePropertyAssignment; function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createSynthesizedNode(282); + var node = createSynthesizedNode(283); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; @@ -60052,7 +60346,7 @@ var ts; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; function createSpreadAssignment(expression) { - var node = createSynthesizedNode(283); + var node = createSynthesizedNode(284); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -60064,7 +60358,7 @@ var ts; } ts.updateSpreadAssignment = updateSpreadAssignment; function createEnumMember(name, initializer) { - var node = createSynthesizedNode(284); + var node = createSynthesizedNode(285); node.name = asName(name); node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); return node; @@ -60084,7 +60378,7 @@ var ts; (typeReferences !== undefined && node.typeReferenceDirectives !== typeReferences) || (libReferences !== undefined && node.libReferenceDirectives !== libReferences) || (hasNoDefaultLib !== undefined && node.hasNoDefaultLib !== hasNoDefaultLib)) { - var updated = createSynthesizedNode(290); + var updated = createSynthesizedNode(291); updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; @@ -60158,28 +60452,28 @@ var ts; } ts.getMutableClone = getMutableClone; function createNotEmittedStatement(original) { - var node = createSynthesizedNode(325); + var node = createSynthesizedNode(326); node.original = original; setTextRange(node, original); return node; } ts.createNotEmittedStatement = createNotEmittedStatement; function createEndOfDeclarationMarker(original) { - var node = createSynthesizedNode(329); + var node = createSynthesizedNode(330); node.emitNode = {}; node.original = original; return node; } ts.createEndOfDeclarationMarker = createEndOfDeclarationMarker; function createMergeDeclarationMarker(original) { - var node = createSynthesizedNode(328); + var node = createSynthesizedNode(329); node.emitNode = {}; node.original = original; return node; } ts.createMergeDeclarationMarker = createMergeDeclarationMarker; function createPartiallyEmittedExpression(expression, original) { - var node = createSynthesizedNode(326); + var node = createSynthesizedNode(327); node.expression = expression; node.original = original; setTextRange(node, original); @@ -60195,7 +60489,7 @@ var ts; ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; function flattenCommaElements(node) { if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { - if (node.kind === 327) { + if (node.kind === 328) { return node.elements; } if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27) { @@ -60205,7 +60499,7 @@ var ts; return node; } function createCommaList(elements) { - var node = createSynthesizedNode(327); + var node = createSynthesizedNode(328); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); return node; } @@ -60217,7 +60511,7 @@ var ts; } ts.updateCommaList = updateCommaList; function createSyntheticReferenceExpression(expression, thisArg) { - var node = createSynthesizedNode(330); + var node = createSynthesizedNode(331); node.expression = expression; node.thisArg = thisArg; return node; @@ -60232,7 +60526,7 @@ var ts; ts.updateSyntheticReferenceExpression = updateSyntheticReferenceExpression; function createBundle(sourceFiles, prepends) { if (prepends === void 0) { prepends = ts.emptyArray; } - var node = ts.createNode(291); + var node = ts.createNode(292); node.prepends = prepends; node.sourceFiles = sourceFiles; return node; @@ -60267,7 +60561,7 @@ var ts; ], function (helper) { return helper.name; })); } function createUnparsedSource() { - var node = ts.createNode(292); + var node = ts.createNode(293); node.prologues = ts.emptyArray; node.referencedFiles = ts.emptyArray; node.libReferenceDirectives = ts.emptyArray; @@ -60400,10 +60694,10 @@ var ts; } function mapBundleFileSectionKindToSyntaxKind(kind) { switch (kind) { - case "prologue": return 285; - case "prepend": return 286; - case "internal": return 288; - case "text": return 287; + case "prologue": return 286; + case "prepend": return 287; + case "internal": return 289; + case "text": return 288; case "emitHelpers": case "no-default-lib": case "reference": @@ -60421,14 +60715,14 @@ var ts; return node; } function createUnparsedSyntheticReference(section, parent) { - var node = ts.createNode(289, section.pos, section.end); + var node = ts.createNode(290, section.pos, section.end); node.parent = parent; node.data = section.data; node.section = section; return node; } function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapTextOrBuildInfoPath, javascriptPath, declarationPath, buildInfoPath, buildInfo, oldFileOfCurrentEmit) { - var node = ts.createNode(293); + var node = ts.createNode(294); if (!ts.isString(javascriptTextOrReadFileText)) { var cache_1 = ts.createMap(); var textGetter_1 = function (path) { @@ -60591,7 +60885,7 @@ var ts; function getOrCreateEmitNode(node) { if (!node.emitNode) { if (ts.isParseTreeNode(node)) { - if (node.kind === 290) { + if (node.kind === 291) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node))); @@ -61045,7 +61339,7 @@ var ts; if (!outermostLabeledStatement) { return node; } - var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 238 + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 239 ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node); if (afterRestoreLabelCallback) { @@ -61064,13 +61358,13 @@ var ts; case 9: case 10: return false; - case 192: + case 193: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 193: + case 194: return target.properties.length > 0; default: return true; @@ -61097,7 +61391,7 @@ var ts; } else { switch (callee.kind) { - case 194: { + case 195: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { thisArg = ts.createTempVariable(recordTempVariable); target = ts.createPropertyAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.name); @@ -61109,7 +61403,7 @@ var ts; } break; } - case 195: { + case 196: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { thisArg = ts.createTempVariable(recordTempVariable); target = ts.createElementAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.argumentExpression); @@ -61165,14 +61459,14 @@ var ts; ts.Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); } switch (property.kind) { - case 163: case 164: + case 165: return createExpressionForAccessorDeclaration(node.properties, property, receiver, !!node.multiLine); - case 281: - return createExpressionForPropertyAssignment(property, receiver); case 282: + return createExpressionForPropertyAssignment(property, receiver); + case 283: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 161: + case 162: return createExpressionForMethodDeclaration(property, receiver); } } @@ -61377,7 +61671,7 @@ var ts; ts.ensureUseStrict = ensureUseStrict; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); - if (skipped.kind === 200) { + if (skipped.kind === 201) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -61386,10 +61680,10 @@ var ts; } ts.parenthesizeBinaryOperand = parenthesizeBinaryOperand; function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { - var binaryOperatorPrecedence = ts.getOperatorPrecedence(209, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(209, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(210, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(210, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 202 && binaryOperatorPrecedence > 3) { + if (!isLeftSideOfBinary && operand.kind === 203 && binaryOperatorPrecedence > 3) { return true; } var operandPrecedence = ts.getExpressionPrecedence(emittedOperand); @@ -61397,7 +61691,7 @@ var ts; case -1: if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 - && operand.kind === 212) { + && operand.kind === 213) { return false; } return true; @@ -61436,7 +61730,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 209 && node.operatorToken.kind === 39) { + if (node.kind === 210 && node.operatorToken.kind === 39) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -61449,7 +61743,7 @@ var ts; return 0; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(210, 57); + var conditionalPrecedence = ts.getOperatorPrecedence(211, 57); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) !== 1) { @@ -61470,8 +61764,8 @@ var ts; var needsParens = isCommaSequence(check); if (!needsParens) { switch (getLeftmostExpression(check, false).kind) { - case 214: - case 201: + case 215: + case 202: needsParens = true; } } @@ -61481,9 +61775,9 @@ var ts; function parenthesizeForNew(expression) { var leftmostExpr = getLeftmostExpression(expression, true); switch (leftmostExpr.kind) { - case 196: - return ts.createParen(expression); case 197: + return ts.createParen(expression); + case 198: return !leftmostExpr.arguments ? ts.createParen(expression) : expression; @@ -61494,7 +61788,7 @@ var ts; function parenthesizeForAccess(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 197 || emittedExpression.arguments)) { + && (emittedExpression.kind !== 198 || emittedExpression.arguments)) { return expression; } return ts.setTextRange(ts.createParen(expression), expression); @@ -61532,7 +61826,7 @@ var ts; function parenthesizeExpressionForList(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(209, 27); + var commaPrecedence = ts.getOperatorPrecedence(210, 27); return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(ts.createParen(expression), expression); @@ -61543,29 +61837,29 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 201 || kind === 202) { + if (kind === 202 || kind === 203) { var mutableCall = ts.getMutableClone(emittedExpression); mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); return recreateOuterExpressions(expression, mutableCall, 4); } } var leftmostExpressionKind = getLeftmostExpression(emittedExpression, false).kind; - if (leftmostExpressionKind === 193 || leftmostExpressionKind === 201) { + if (leftmostExpressionKind === 194 || leftmostExpressionKind === 202) { return ts.setTextRange(ts.createParen(expression), expression); } return expression; } ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; function parenthesizeConditionalTypeMember(member) { - return member.kind === 180 ? ts.createParenthesizedType(member) : member; + return member.kind === 181 ? ts.createParenthesizedType(member) : member; } ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember; function parenthesizeElementTypeMember(member) { switch (member.kind) { - case 178: case 179: - case 170: + case 180: case 171: + case 172: return ts.createParenthesizedType(member); } return parenthesizeConditionalTypeMember(member); @@ -61573,9 +61867,9 @@ var ts; ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember; function parenthesizeArrayTypeMember(member) { switch (member.kind) { - case 172: - case 184: - case 181: + case 173: + case 185: + case 182: return ts.createParenthesizedType(member); } return parenthesizeElementTypeMember(member); @@ -61601,27 +61895,27 @@ var ts; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 208: + case 209: node = node.operand; continue; - case 209: + case 210: node = node.left; continue; - case 210: + case 211: node = node.condition; continue; - case 198: + case 199: node = node.tag; continue; - case 196: + case 197: if (stopAtCallExpressions) { return node; } - case 217: - case 195: - case 194: case 218: - case 326: + case 196: + case 195: + case 219: + case 327: node = node.expression; continue; } @@ -61630,27 +61924,27 @@ var ts; } ts.getLeftmostExpression = getLeftmostExpression; function parenthesizeConciseBody(body) { - if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, false).kind === 193)) { + if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, false).kind === 194)) { return ts.setTextRange(ts.createParen(body), body); } return body; } ts.parenthesizeConciseBody = parenthesizeConciseBody; function isCommaSequence(node) { - return node.kind === 209 && node.operatorToken.kind === 27 || - node.kind === 327; + return node.kind === 210 && node.operatorToken.kind === 27 || + node.kind === 328; } ts.isCommaSequence = isCommaSequence; function isOuterExpression(node, kinds) { if (kinds === void 0) { kinds = 7; } switch (node.kind) { - case 200: + case 201: return (kinds & 1) !== 0; - case 199: - case 217: + case 200: case 218: + case 219: return (kinds & 2) !== 0; - case 326: + case 327: return (kinds & 4) !== 0; } return false; @@ -61675,7 +61969,7 @@ var ts; } ts.skipOuterExpressions = skipOuterExpressions; function skipAssertions(node) { - while (ts.isAssertionExpression(node) || node.kind === 218) { + while (ts.isAssertionExpression(node) || node.kind === 219) { node = node.expression; } return node; @@ -61683,15 +61977,15 @@ var ts; ts.skipAssertions = skipAssertions; function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 200: return ts.updateParen(outerExpression, expression); - case 199: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 217: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); - case 218: return ts.updateNonNullExpression(outerExpression, expression); - case 326: return ts.updatePartiallyEmittedExpression(outerExpression, expression); + case 201: return ts.updateParen(outerExpression, expression); + case 200: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 218: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); + case 219: return ts.updateNonNullExpression(outerExpression, expression); + case 327: return ts.updatePartiallyEmittedExpression(outerExpression, expression); } } function isIgnorableParen(node) { - return node.kind === 200 + return node.kind === 201 && ts.nodeIsSynthesized(node) && ts.nodeIsSynthesized(ts.getSourceMapRange(node)) && ts.nodeIsSynthesized(ts.getCommentRange(node)) @@ -61800,10 +62094,10 @@ var ts; var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 254 && node.importClause) { + if (node.kind === 255 && node.importClause) { return ts.getGeneratedNameForNode(node); } - if (node.kind === 260 && node.moduleSpecifier) { + if (node.kind === 261 && node.moduleSpecifier) { return ts.getGeneratedNameForNode(node); } return undefined; @@ -61866,11 +62160,11 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 281: - return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); case 282: - return bindingElement.name; + return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); case 283: + return bindingElement.name; + case 284: return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } return undefined; @@ -61886,11 +62180,11 @@ var ts; ts.getTargetOfBindingOrAssignmentElement = getTargetOfBindingOrAssignmentElement; function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 156: - case 191: + case 157: + case 192: return bindingElement.dotDotDotToken; - case 213: - case 283: + case 214: + case 284: return bindingElement; } return undefined; @@ -61904,7 +62198,7 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 191: + case 192: if (bindingElement.propertyName) { var propertyName = bindingElement.propertyName; if (ts.isPrivateIdentifier(propertyName)) { @@ -61915,7 +62209,7 @@ var ts; : propertyName; } break; - case 281: + case 282: if (bindingElement.name) { var propertyName = bindingElement.name; if (ts.isPrivateIdentifier(propertyName)) { @@ -61926,7 +62220,7 @@ var ts; : propertyName; } break; - case 283: + case 284: if (bindingElement.name && ts.isPrivateIdentifier(bindingElement.name)) { return ts.Debug.failBadSyntaxKind(bindingElement.name); } @@ -61945,11 +62239,11 @@ var ts; } function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 189: case 190: - case 192: - return name.elements; + case 191: case 193: + return name.elements; + case 194: return name.properties; } } @@ -61988,11 +62282,11 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 190: - case 192: - return convertToArrayAssignmentPattern(node); - case 189: + case 191: case 193: + return convertToArrayAssignmentPattern(node); + case 190: + case 194: return convertToObjectAssignmentPattern(node); } } @@ -62127,272 +62421,272 @@ var ts; return undefined; } var kind = node.kind; - if ((kind > 0 && kind <= 152) || kind === 183) { + if ((kind > 0 && kind <= 153) || kind === 184) { return node; } switch (kind) { case 75: return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); - case 153: - return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); case 154: - return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); case 155: - return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); + return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); case 156: - return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); case 157: - return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); case 158: - return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); case 159: - return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); case 160: - return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); + return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); case 161: - return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); case 162: - return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); + return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); case 163: - return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); case 164: - return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); + return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); case 165: - return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); case 166: - return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); case 167: - return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); case 168: - return ts.updateTypePredicateNodeWithModifier(node, visitNode(node.assertsModifier, visitor), visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); case 169: - return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); + return ts.updateTypePredicateNodeWithModifier(node, visitNode(node.assertsModifier, visitor), visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); case 170: - return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); case 171: - return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); case 172: - return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); + return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); case 173: - return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); + return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); case 174: - return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); + return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); case 175: - return ts.updateTupleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); + return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); case 176: - return ts.updateOptionalTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateTupleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); case 177: - return ts.updateRestTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateOptionalTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); case 178: - return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); + return ts.updateRestTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); case 179: - return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); + return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); case 180: - return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode)); + return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); case 181: + return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode)); + case 182: return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); - case 188: + case 189: return ts.updateImportTypeNode(node, visitNode(node.argument, visitor, ts.isTypeNode), visitNode(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf); - case 182: + case 183: return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 184: - return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); case 185: - return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); + return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); case 186: - return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); case 187: + return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); + case 188: return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); - case 189: - return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); case 190: - return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); + return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); case 191: - return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); case 192: - return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); + return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); case 193: - return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); + return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); case 194: + return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); + case 195: if (node.flags & 32) { - return ts.updatePropertyAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, visitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier)); + return ts.updatePropertyAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier)); } return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifierOrPrivateIdentifier)); - case 195: + case 196: if (node.flags & 32) { - return ts.updateElementAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, visitor, ts.isToken), visitNode(node.argumentExpression, visitor, ts.isExpression)); + return ts.updateElementAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.argumentExpression, visitor, ts.isExpression)); } return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 196: + case 197: if (node.flags & 32) { - return ts.updateCallChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, visitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + return ts.updateCallChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); } return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 197: - return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); case 198: - return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); + return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); case 199: - return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); case 200: - return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); case 201: - return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); case 202: - return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, visitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); + return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); case 203: - return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, tokenVisitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); case 204: - return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); case 205: - return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); case 206: - return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); case 207: - return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); + return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); case 208: - return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); + return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); case 209: - return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, visitor, ts.isToken)); + return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); case 210: - return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, visitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); + return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, tokenVisitor, ts.isToken)); case 211: - return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); + return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, tokenVisitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); case 212: - return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); case 213: - return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); case 214: + return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); + case 215: return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 216: - return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); case 217: - return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); case 218: - return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); case 219: + return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); + case 220: return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 221: + case 222: return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); - case 223: + case 224: return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 225: - return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); case 226: - return ts.updateExpressionStatement(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); case 227: - return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); + return ts.updateExpressionStatement(node, visitNode(node.expression, visitor, ts.isExpression)); case 228: - return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); case 229: - return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); case 230: - return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); case 231: - return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); case 232: - return ts.updateForOf(node, visitNode(node.awaitModifier, visitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); case 233: - return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); + return ts.updateForOf(node, visitNode(node.awaitModifier, tokenVisitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); case 234: - return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); + return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); case 235: - return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); case 236: - return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); case 237: - return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); + return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); case 238: - return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); case 239: - return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); case 240: + return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); + case 241: return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); - case 242: - return ts.updateTypeScriptVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); case 243: - return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); + return ts.updateTypeScriptVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); case 244: - return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); case 245: - return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); + return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); case 246: - return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); + return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); case 247: - return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); case 248: - return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); + return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); case 249: - return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); + return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); case 250: - return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); case 251: - return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); + return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); case 252: - return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); + return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); case 253: - return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); + return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); case 254: - return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); + return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); case 255: - return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings), node.isTypeOnly); + return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); case 256: + return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings), node.isTypeOnly); + case 257: return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 262: + case 263: return ts.updateNamespaceExport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 257: - return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); case 258: - return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); + return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); case 259: - return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); case 260: - return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExportBindings), visitNode(node.moduleSpecifier, visitor, ts.isExpression), node.isTypeOnly); + return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); case 261: + return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExportBindings), visitNode(node.moduleSpecifier, visitor, ts.isExpression), node.isTypeOnly); + case 262: return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 263: + case 264: return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); - case 265: - return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); case 266: - return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); + return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); case 267: - return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); case 268: - return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); case 269: - return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); + return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); case 270: + return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); + case 271: return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 273: - return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); case 274: - return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); + return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); case 275: - return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); case 276: - return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); case 277: - return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); + return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); case 278: - return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); case 279: - return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); + return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); case 280: - return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); + return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); case 281: - return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); case 282: - return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); + return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); case 283: - return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); case 284: + return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); + case 285: return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 290: + case 291: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); - case 326: - return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); case 327: + return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); + case 328: return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: return node; @@ -62419,52 +62713,52 @@ var ts; var reduceNodes = cbNodeArray ? reduceNodeArray : ts.reduceLeft; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; - if ((kind > 0 && kind <= 152)) { + if ((kind > 0 && kind <= 153)) { return initial; } - if ((kind >= 168 && kind <= 187)) { + if ((kind >= 169 && kind <= 188)) { return initial; } var result = initial; switch (node.kind) { - case 222: - case 224: - case 215: - case 241: - case 325: + case 223: + case 225: + case 216: + case 242: + case 326: break; - case 153: + case 154: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 154: + case 155: result = reduceNode(node.expression, cbNode, result); break; - case 156: + case 157: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 157: + case 158: result = reduceNode(node.expression, cbNode, result); break; - case 158: + case 159: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.questionToken, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 159: + case 160: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 161: + case 162: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -62473,12 +62767,12 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 162: + case 163: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; - case 163: + case 164: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -62486,56 +62780,56 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 164: + case 165: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; - case 189: case 190: + case 191: result = reduceNodes(node.elements, cbNodes, result); break; - case 191: + case 192: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 192: + case 193: result = reduceNodes(node.elements, cbNodes, result); break; - case 193: + case 194: result = reduceNodes(node.properties, cbNodes, result); break; - case 194: + case 195: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 195: + case 196: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.argumentExpression, cbNode, result); break; - case 196: + case 197: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 197: + case 198: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 198: + case 199: result = reduceNode(node.tag, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNode(node.template, cbNode, result); break; - case 199: + case 200: result = reduceNode(node.type, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 201: + case 202: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -62543,121 +62837,121 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 202: + case 203: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 200: - case 203: + case 201: case 204: case 205: case 206: - case 212: + case 207: case 213: - case 218: + case 214: + case 219: result = reduceNode(node.expression, cbNode, result); break; - case 207: case 208: + case 209: result = reduceNode(node.operand, cbNode, result); break; - case 209: + case 210: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 210: + case 211: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 211: + case 212: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 214: + case 215: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 216: + case 217: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; - case 217: + case 218: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.type, cbNode, result); break; - case 221: + case 222: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; - case 223: + case 224: result = reduceNodes(node.statements, cbNodes, result); break; - case 225: + case 226: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 226: + case 227: result = reduceNode(node.expression, cbNode, result); break; - case 227: + case 228: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 228: + case 229: result = reduceNode(node.statement, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 229: - case 236: + case 230: + case 237: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 230: + case 231: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 231: case 232: + case 233: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 235: - case 239: + case 236: + case 240: result = reduceNode(node.expression, cbNode, result); break; - case 237: + case 238: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 238: + case 239: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 240: + case 241: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 242: + case 243: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 243: + case 244: result = reduceNodes(node.declarations, cbNodes, result); break; - case 244: + case 245: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -62666,7 +62960,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 245: + case 246: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -62674,135 +62968,135 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 248: + case 249: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.members, cbNodes, result); break; - case 249: + case 250: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 250: + case 251: result = reduceNodes(node.statements, cbNodes, result); break; - case 251: + case 252: result = reduceNodes(node.clauses, cbNodes, result); break; - case 253: + case 254: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.moduleReference, cbNode, result); break; - case 254: + case 255: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 255: + case 256: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 256: + case 257: result = reduceNode(node.name, cbNode, result); break; - case 262: + case 263: result = reduceNode(node.name, cbNode, result); break; - case 257: - case 261: + case 258: + case 262: result = reduceNodes(node.elements, cbNodes, result); break; - case 258: - case 263: + case 259: + case 264: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 259: + case 260: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 260: + case 261: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 265: + case 266: result = reduceNode(node.expression, cbNode, result); break; - case 266: + case 267: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 270: + case 271: result = reduceNode(node.openingFragment, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingFragment, cbNode, result); break; - case 267: case 268: + case 269: result = reduceNode(node.tagName, cbNode, result); result = reduceNodes(node.typeArguments, cbNode, result); result = reduceNode(node.attributes, cbNode, result); break; - case 274: + case 275: result = reduceNodes(node.properties, cbNodes, result); break; - case 269: + case 270: result = reduceNode(node.tagName, cbNode, result); break; - case 273: + case 274: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 275: - result = reduceNode(node.expression, cbNode, result); - break; case 276: result = reduceNode(node.expression, cbNode, result); break; case 277: result = reduceNode(node.expression, cbNode, result); + break; case 278: + result = reduceNode(node.expression, cbNode, result); + case 279: result = reduceNodes(node.statements, cbNodes, result); break; - case 279: + case 280: result = reduceNodes(node.types, cbNodes, result); break; - case 280: + case 281: result = reduceNode(node.variableDeclaration, cbNode, result); result = reduceNode(node.block, cbNode, result); break; - case 281: + case 282: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 282: + case 283: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 283: + case 284: result = reduceNode(node.expression, cbNode, result); break; - case 284: + case 285: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 290: + case 291: result = reduceNodes(node.statements, cbNodes, result); break; - case 326: + case 327: result = reduceNode(node.expression, cbNode, result); break; - case 327: + case 328: result = reduceNodes(node.elements, cbNodes, result); break; default: @@ -62855,7 +63149,7 @@ var ts; return subtreeFlags; } function aggregateTransformFlagsForSubtree(node) { - if (ts.hasModifier(node, 2) || (ts.isTypeNode(node) && node.kind !== 216)) { + if (ts.hasModifier(node, 2) || (ts.isTypeNode(node) && node.kind !== 217)) { return 0; } return reduceEachChild(node, 0, aggregateTransformFlagsForChildNode, aggregateTransformFlagsForChildNodes); @@ -63478,7 +63772,7 @@ var ts; function chainBundle(transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 290 ? transformSourceFile(node) : transformBundle(node); + return node.kind === 291 ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return ts.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends); @@ -63527,7 +63821,7 @@ var ts; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 254: + case 255: externalImports.push(node); if (!hasImportStar && getImportNeedsImportStarHelper(node)) { hasImportStar = true; @@ -63536,12 +63830,12 @@ var ts; hasImportDefault = true; } break; - case 253: - if (node.moduleReference.kind === 265) { + case 254: + if (node.moduleReference.kind === 266) { externalImports.push(node); } break; - case 260: + case 261: if (node.moduleSpecifier) { if (!node.exportClause) { externalImports.push(node); @@ -63568,12 +63862,12 @@ var ts; } } break; - case 259: + case 260: if (node.isExportEquals && !exportEquals) { exportEquals = node; } break; - case 225: + case 226: if (ts.hasModifier(node, 1)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -63581,7 +63875,7 @@ var ts; } } break; - case 244: + case 245: if (ts.hasModifier(node, 1)) { if (ts.hasModifier(node, 512)) { if (!hasExportDefault) { @@ -63599,7 +63893,7 @@ var ts; } } break; - case 245: + case 246: if (ts.hasModifier(node, 1)) { if (ts.hasModifier(node, 512)) { if (!hasExportDefault) { @@ -63733,7 +64027,7 @@ var ts; && ts.hasStaticModifier(member) === isStatic; } function isInitializedProperty(member) { - return member.kind === 159 + return member.kind === 160 && member.initializer !== undefined; } ts.isInitializedProperty = isInitializedProperty; @@ -64182,8 +64476,8 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(194); context.enableSubstitution(195); + context.enableSubstitution(196); var currentSourceFile; var currentNamespace; var currentNamespaceContainerName; @@ -64196,14 +64490,14 @@ var ts; var applicableSubstitutions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 291) { + if (node.kind === 292) { return transformBundle(node); } return transformSourceFile(node); } function transformBundle(node) { return ts.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 293) { + if (prepend.kind === 294) { return ts.createUnparsedSourceFile(prepend, "js"); } return prepend; @@ -64236,16 +64530,16 @@ var ts; } function onBeforeVisitNode(node) { switch (node.kind) { - case 290: + case 291: + case 252: case 251: - case 250: - case 223: + case 224: currentLexicalScope = node; currentNameScope = undefined; currentScopeFirstDeclarationsOfName = undefined; break; + case 246: case 245: - case 244: if (ts.hasModifier(node, 2)) { break; } @@ -64253,7 +64547,7 @@ var ts; recordEmittedDeclarationInScope(node); } else { - ts.Debug.assert(node.kind === 245 || ts.hasModifier(node, 512)); + ts.Debug.assert(node.kind === 246 || ts.hasModifier(node, 512)); } if (ts.isClassDeclaration(node)) { currentNameScope = node; @@ -64275,10 +64569,10 @@ var ts; } function sourceElementVisitorWorker(node) { switch (node.kind) { + case 255: case 254: - case 253: - case 259: case 260: + case 261: return visitEllidableStatement(node); default: return visitorWorker(node); @@ -64293,13 +64587,13 @@ var ts; return node; } switch (node.kind) { - case 254: + case 255: return visitImportDeclaration(node); - case 253: + case 254: return visitImportEqualsDeclaration(node); - case 259: - return visitExportAssignment(node); case 260: + return visitExportAssignment(node); + case 261: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -64309,11 +64603,11 @@ var ts; return saveStateAndInvoke(node, namespaceElementVisitorWorker); } function namespaceElementVisitorWorker(node) { - if (node.kind === 260 || - node.kind === 254 || + if (node.kind === 261 || node.kind === 255 || - (node.kind === 253 && - node.moduleReference.kind === 265)) { + node.kind === 256 || + (node.kind === 254 && + node.moduleReference.kind === 266)) { return undefined; } else if (node.transformFlags & 1 || ts.hasModifier(node, 1)) { @@ -64326,16 +64620,16 @@ var ts; } function classElementVisitorWorker(node) { switch (node.kind) { - case 162: + case 163: return visitConstructor(node); - case 159: + case 160: return visitPropertyDeclaration(node); - case 167: - case 163: + case 168: case 164: - case 161: + case 165: + case 162: return visitorWorker(node); - case 222: + case 223: return node; default: return ts.Debug.failBadSyntaxKind(node); @@ -64363,92 +64657,92 @@ var ts; case 118: case 122: case 81: - case 130: - case 138: - case 174: + case 131: + case 139: case 175: case 176: case 177: - case 173: - case 168: - case 155: + case 178: + case 174: + case 169: + case 156: case 125: - case 148: - case 128: - case 143: - case 140: - case 137: - case 110: + case 149: + case 129: case 144: + case 141: + case 138: + case 110: + case 145: + case 172: case 171: + case 173: case 170: - case 172: - case 169: - case 178: case 179: case 180: - case 182: + case 181: case 183: case 184: case 185: case 186: case 187: - case 167: - case 157: - case 247: + case 188: + case 168: + case 158: + case 248: return undefined; - case 159: + case 160: return visitPropertyDeclaration(node); - case 252: + case 253: return undefined; - case 162: + case 163: return visitConstructor(node); - case 246: + case 247: return ts.createNotEmittedStatement(node); - case 245: + case 246: return visitClassDeclaration(node); - case 214: + case 215: return visitClassExpression(node); - case 279: + case 280: return visitHeritageClause(node); - case 216: + case 217: return visitExpressionWithTypeArguments(node); - case 161: + case 162: return visitMethodDeclaration(node); - case 163: - return visitGetAccessor(node); case 164: + return visitGetAccessor(node); + case 165: return visitSetAccessor(node); - case 244: + case 245: return visitFunctionDeclaration(node); - case 201: - return visitFunctionExpression(node); case 202: + return visitFunctionExpression(node); + case 203: return visitArrowFunction(node); - case 156: + case 157: return visitParameter(node); - case 200: + case 201: return visitParenthesizedExpression(node); - case 199: - case 217: + case 200: + case 218: return visitAssertionExpression(node); - case 196: - return visitCallExpression(node); case 197: - return visitNewExpression(node); + return visitCallExpression(node); case 198: + return visitNewExpression(node); + case 199: return visitTaggedTemplateExpression(node); - case 218: + case 219: return visitNonNullExpression(node); - case 248: + case 249: return visitEnumDeclaration(node); - case 225: + case 226: return visitVariableStatement(node); - case 242: + case 243: return visitVariableDeclaration(node); - case 249: + case 250: return visitModuleDeclaration(node); - case 253: + case 254: return visitImportEqualsDeclaration(node); default: return ts.visitEachChild(node, visitor, context); @@ -64664,12 +64958,12 @@ var ts; } function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 163: case 164: + case 165: return getAllDecoratorsOfAccessors(node, member); - case 161: + case 162: return getAllDecoratorsOfMethod(member); - case 159: + case 160: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -64748,7 +65042,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, true); var descriptor = languageVersion > 0 - ? member.kind === 159 + ? member.kind === 160 ? ts.createVoidZero() : ts.createNull() : undefined; @@ -64832,22 +65126,22 @@ var ts; } function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 161 - || kind === 163 + return kind === 162 || kind === 164 - || kind === 159; + || kind === 165 + || kind === 160; } function shouldAddReturnTypeMetadata(node) { - return node.kind === 161; + return node.kind === 162; } function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 245: - case 214: + case 246: + case 215: return ts.getFirstConstructorWithBody(node) !== undefined; - case 161: - case 163: + case 162: case 164: + case 165: return true; } return false; @@ -64859,15 +65153,15 @@ var ts; } function serializeTypeOfNode(node) { switch (node.kind) { - case 159: - case 156: + case 160: + case 157: return serializeTypeNode(node.type); + case 165: case 164: - case 163: return serializeTypeNode(getAccessorTypeNode(node)); - case 245: - case 214: - case 161: + case 246: + case 215: + case 162: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); @@ -64899,7 +65193,7 @@ var ts; return ts.createArrayLiteral(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 163) { + if (container && node.kind === 164) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -64922,30 +65216,30 @@ var ts; } switch (node.kind) { case 110: - case 146: + case 147: case 100: - case 137: + case 138: return ts.createVoidZero(); - case 182: + case 183: return serializeTypeNode(node.type); - case 170: case 171: + case 172: return ts.createIdentifier("Function"); - case 174: case 175: + case 176: return ts.createIdentifier("Array"); - case 168: - case 128: + case 169: + case 129: return ts.createIdentifier("Boolean"); - case 143: + case 144: return ts.createIdentifier("String"); - case 141: + case 142: return ts.createIdentifier("Object"); - case 187: + case 188: switch (node.literal.kind) { case 10: return ts.createIdentifier("String"); - case 207: + case 208: case 8: return ts.createIdentifier("Number"); case 9: @@ -64956,34 +65250,34 @@ var ts; default: return ts.Debug.failBadSyntaxKind(node.literal); } - case 140: + case 141: return ts.createIdentifier("Number"); - case 151: + case 152: return getGlobalBigIntNameWithFallback(); - case 144: + case 145: return languageVersion < 2 ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 169: + case 170: return serializeTypeReferenceNode(node); + case 180: case 179: - case 178: return serializeTypeList(node.types); - case 180: + case 181: return serializeTypeList([node.trueType, node.falseType]); - case 184: - if (node.operator === 138) { + case 185: + if (node.operator === 139) { return serializeTypeNode(node.type); } break; - case 172: - case 185: - case 186: case 173: + case 186: + case 187: + case 174: case 125: - case 148: - case 183: - case 188: + case 149: + case 184: + case 189: break; default: return ts.Debug.failBadSyntaxKind(node); @@ -64994,13 +65288,13 @@ var ts; var serializedUnion; for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { var typeNode = types_20[_i]; - while (typeNode.kind === 182) { + while (typeNode.kind === 183) { typeNode = typeNode.type; } - if (typeNode.kind === 137) { + if (typeNode.kind === 138) { continue; } - if (!strictNullChecks && (typeNode.kind === 100 || typeNode.kind === 146)) { + if (!strictNullChecks && (typeNode.kind === 100 || typeNode.kind === 147)) { continue; } var serializedIndividual = serializeTypeNode(typeNode); @@ -65081,7 +65375,7 @@ var ts; name.original = undefined; name.parent = ts.getParseTreeNode(currentLexicalScope); return name; - case 153: + case 154: return serializeQualifiedNameAsExpression(node); } } @@ -65420,11 +65714,11 @@ var ts; function addVarForEnumOrModuleDeclaration(statements, node) { var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getLocalName(node, false, true)) - ], currentLexicalScope.kind === 290 ? 0 : 1)); + ], currentLexicalScope.kind === 291 ? 0 : 1)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { - if (node.kind === 248) { + if (node.kind === 249) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -65490,7 +65784,7 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 250) { + if (body.kind === 251) { saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; @@ -65514,13 +65808,13 @@ var ts; currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName; var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), true); ts.setTextRange(block, blockLocation); - if (body.kind !== 250) { + if (body.kind !== 251) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 249) { + if (moduleDeclaration.body.kind === 250) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -65548,7 +65842,7 @@ var ts; return (name || namedBindings) ? ts.updateImportClause(node, name, namedBindings, false) : undefined; } function visitNamedImportBindings(node) { - if (node.kind === 256) { + if (node.kind === 257) { return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } else { @@ -65694,15 +65988,15 @@ var ts; if ((enabledSubstitutions & 2) === 0) { enabledSubstitutions |= 2; context.enableSubstitution(75); - context.enableSubstitution(282); - context.enableEmitNotification(249); + context.enableSubstitution(283); + context.enableEmitNotification(250); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 249; + return ts.getOriginalNode(node).kind === 250; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 248; + return ts.getOriginalNode(node).kind === 249; } function onEmitNode(hint, node, emitCallback) { var savedApplicableSubstitutions = applicableSubstitutions; @@ -65748,9 +66042,9 @@ var ts; switch (node.kind) { case 75: return substituteExpressionIdentifier(node); - case 194: - return substitutePropertyAccessExpression(node); case 195: + return substitutePropertyAccessExpression(node); + case 196: return substituteElementAccessExpression(node); } return node; @@ -65780,9 +66074,9 @@ var ts; function trySubstituteNamespaceExportedName(node) { if (enabledSubstitutions & applicableSubstitutions && !ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var container = resolver.getReferencedExportContainer(node, false); - if (container && container.kind !== 290) { - var substitute = (applicableSubstitutions & 2 && container.kind === 249) || - (applicableSubstitutions & 8 && container.kind === 248); + if (container && container.kind !== 291) { + var substitute = (applicableSubstitutions & 2 && container.kind === 250) || + (applicableSubstitutions & 8 && container.kind === 249); if (substitute) { return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), node); } @@ -65900,40 +66194,40 @@ var ts; if (!(node.transformFlags & 4194304)) return node; switch (node.kind) { - case 214: - case 245: + case 215: + case 246: return visitClassLike(node); - case 159: + case 160: return visitPropertyDeclaration(node); - case 225: + case 226: return visitVariableStatement(node); - case 154: + case 155: return visitComputedPropertyName(node); - case 194: + case 195: return visitPropertyAccessExpression(node); - case 207: - return visitPrefixUnaryExpression(node); case 208: + return visitPrefixUnaryExpression(node); + case 209: return visitPostfixUnaryExpression(node, false); - case 196: + case 197: return visitCallExpression(node); - case 209: + case 210: return visitBinaryExpression(node); case 76: return visitPrivateIdentifier(node); - case 226: + case 227: return visitExpressionStatement(node); - case 230: + case 231: return visitForStatement(node); - case 198: + case 199: return visitTaggedTemplateExpression(node); } return ts.visitEachChild(node, visitor, context); } function visitorDestructuringTarget(node) { switch (node.kind) { + case 194: case 193: - case 192: return visitAssignmentPattern(node); default: return visitor(node); @@ -65947,17 +66241,17 @@ var ts; } function classElementVisitor(node) { switch (node.kind) { - case 162: - return undefined; case 163: + return undefined; case 164: - case 161: + case 165: + case 162: return ts.visitEachChild(node, classElementVisitor, context); - case 159: + case 160: return visitPropertyDeclaration(node); - case 154: + case 155: return visitComputedPropertyName(node); - case 222: + case 223: return node; default: return visitor(node); @@ -66568,31 +66862,31 @@ var ts; switch (node.kind) { case 126: return undefined; - case 206: + case 207: return visitAwaitExpression(node); - case 161: + case 162: return doWithContext(1 | 2, visitMethodDeclaration, node); - case 244: + case 245: return doWithContext(1 | 2, visitFunctionDeclaration, node); - case 201: - return doWithContext(1 | 2, visitFunctionExpression, node); case 202: + return doWithContext(1 | 2, visitFunctionExpression, node); + case 203: return doWithContext(1, visitArrowFunction, node); - case 194: + case 195: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 195: + case 196: if (capturedSuperProperties && node.expression.kind === 102) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 163: case 164: - case 162: - case 245: - case 214: + case 165: + case 163: + case 246: + case 215: return doWithContext(1 | 2, visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -66601,27 +66895,27 @@ var ts; function asyncBodyVisitor(node) { if (ts.isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 225: + case 226: return visitVariableStatementInAsyncBody(node); - case 230: - return visitForStatementInAsyncBody(node); case 231: - return visitForInStatementInAsyncBody(node); + return visitForStatementInAsyncBody(node); case 232: + return visitForInStatementInAsyncBody(node); + case 233: return visitForOfStatementInAsyncBody(node); - case 280: + case 281: return visitCatchClauseInAsyncBody(node); - case 223: - case 237: - case 251: - case 277: + case 224: + case 238: + case 252: case 278: - case 240: - case 228: + case 279: + case 241: case 229: - case 227: - case 236: - case 238: + case 230: + case 228: + case 237: + case 239: return ts.visitEachChild(node, asyncBodyVisitor, context); default: return ts.Debug.assertNever(node, "Unhandled node."); @@ -66773,7 +67067,7 @@ var ts; var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 202; + var isArrowFunction = node.kind === 203; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192) !== 0; var savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames; enclosingFunctionParameterNames = ts.createUnderscoreEscapedMap(); @@ -66854,15 +67148,15 @@ var ts; function enableSubstitutionForAsyncMethodsWithSuper() { if ((enabledSubstitutions & 1) === 0) { enabledSubstitutions |= 1; - context.enableSubstitution(196); - context.enableSubstitution(194); + context.enableSubstitution(197); context.enableSubstitution(195); - context.enableEmitNotification(245); - context.enableEmitNotification(161); - context.enableEmitNotification(163); - context.enableEmitNotification(164); + context.enableSubstitution(196); + context.enableEmitNotification(246); context.enableEmitNotification(162); - context.enableEmitNotification(225); + context.enableEmitNotification(164); + context.enableEmitNotification(165); + context.enableEmitNotification(163); + context.enableEmitNotification(226); } } function onEmitNode(hint, node, emitCallback) { @@ -66894,11 +67188,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 194: - return substitutePropertyAccessExpression(node); case 195: - return substituteElementAccessExpression(node); + return substitutePropertyAccessExpression(node); case 196: + return substituteElementAccessExpression(node); + case 197: return substituteCallExpression(node); } return node; @@ -66929,11 +67223,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 245 - || kind === 162 - || kind === 161 + return kind === 246 || kind === 163 - || kind === 164; + || kind === 162 + || kind === 164 + || kind === 165; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096) { @@ -67061,64 +67355,64 @@ var ts; return node; } switch (node.kind) { - case 206: + case 207: return visitAwaitExpression(node); - case 212: + case 213: return visitYieldExpression(node); - case 235: + case 236: return visitReturnStatement(node); - case 238: + case 239: return visitLabeledStatement(node); - case 193: + case 194: return visitObjectLiteralExpression(node); - case 209: + case 210: return visitBinaryExpression(node, noDestructuringValue); - case 280: + case 281: return visitCatchClause(node); - case 225: + case 226: return visitVariableStatement(node); - case 242: + case 243: return visitVariableDeclaration(node); - case 232: + case 233: return visitForOfStatement(node, undefined); - case 230: + case 231: return visitForStatement(node); - case 205: + case 206: return visitVoidExpression(node); - case 162: + case 163: return doWithLexicalThis(visitConstructorDeclaration, node); - case 161: + case 162: return doWithLexicalThis(visitMethodDeclaration, node); - case 163: - return doWithLexicalThis(visitGetAccessorDeclaration, node); case 164: + return doWithLexicalThis(visitGetAccessorDeclaration, node); + case 165: return doWithLexicalThis(visitSetAccessorDeclaration, node); - case 244: + case 245: return doWithLexicalThis(visitFunctionDeclaration, node); - case 201: - return doWithLexicalThis(visitFunctionExpression, node); case 202: + return doWithLexicalThis(visitFunctionExpression, node); + case 203: return visitArrowFunction(node); - case 156: + case 157: return visitParameter(node); - case 226: + case 227: return visitExpressionStatement(node); - case 200: + case 201: return visitParenthesizedExpression(node, noDestructuringValue); - case 198: + case 199: return visitTaggedTemplateExpression(node); - case 194: + case 195: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 195: + case 196: if (capturedSuperProperties && node.expression.kind === 102) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 245: - case 214: + case 246: + case 215: return doWithLexicalThis(visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -67151,7 +67445,7 @@ var ts; function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 232 && statement.awaitModifier) { + if (statement.kind === 233 && statement.awaitModifier) { return visitForOfStatement(statement, node); } return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node); @@ -67163,7 +67457,7 @@ var ts; var objects = []; for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { var e = elements_4[_i]; - if (e.kind === 283) { + if (e.kind === 284) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -67172,7 +67466,7 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - chunkObject = ts.append(chunkObject, e.kind === 281 + chunkObject = ts.append(chunkObject, e.kind === 282 ? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } @@ -67185,7 +67479,7 @@ var ts; function visitObjectLiteralExpression(node) { if (node.transformFlags & 16384) { var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 193) { + if (objects.length && objects[0].kind !== 194) { objects.unshift(ts.createObjectLiteral()); } var expression = objects[0]; @@ -67505,15 +67799,15 @@ var ts; function enableSubstitutionForAsyncMethodsWithSuper() { if ((enabledSubstitutions & 1) === 0) { enabledSubstitutions |= 1; - context.enableSubstitution(196); - context.enableSubstitution(194); + context.enableSubstitution(197); context.enableSubstitution(195); - context.enableEmitNotification(245); - context.enableEmitNotification(161); - context.enableEmitNotification(163); - context.enableEmitNotification(164); + context.enableSubstitution(196); + context.enableEmitNotification(246); context.enableEmitNotification(162); - context.enableEmitNotification(225); + context.enableEmitNotification(164); + context.enableEmitNotification(165); + context.enableEmitNotification(163); + context.enableEmitNotification(226); } } function onEmitNode(hint, node, emitCallback) { @@ -67545,11 +67839,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 194: - return substitutePropertyAccessExpression(node); case 195: - return substituteElementAccessExpression(node); + return substitutePropertyAccessExpression(node); case 196: + return substituteElementAccessExpression(node); + case 197: return substituteCallExpression(node); } return node; @@ -67580,11 +67874,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 245 - || kind === 162 - || kind === 161 + return kind === 246 || kind === 163 - || kind === 164; + || kind === 162 + || kind === 164 + || kind === 165; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096) { @@ -67674,7 +67968,7 @@ var ts; return node; } switch (node.kind) { - case 280: + case 281: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -67705,21 +67999,21 @@ var ts; return node; } switch (node.kind) { - case 194: case 195: case 196: + case 197: if (node.flags & 32) { var updated = visitOptionalExpression(node, false, false); ts.Debug.assertNotNode(updated, ts.isSyntheticReference); return updated; } return ts.visitEachChild(node, visitor, context); - case 209: + case 210: if (node.operatorToken.kind === 60) { return transformNullishCoalescingExpression(node); } return ts.visitEachChild(node, visitor, context); - case 203: + case 204: return visitDeleteExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -67756,7 +68050,7 @@ var ts; thisArg = expression; } } - expression = node.kind === 194 + expression = node.kind === 195 ? ts.updatePropertyAccess(node, expression, ts.visitNode(node.name, visitor, ts.isIdentifier)) : ts.updateElementAccess(node, expression, ts.visitNode(node.argumentExpression, visitor, ts.isExpression)); return thisArg ? ts.createSyntheticReferenceExpression(expression, thisArg) : expression; @@ -67769,10 +68063,10 @@ var ts; } function visitNonOptionalExpression(node, captureThisArg, isDelete) { switch (node.kind) { - case 200: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 194: - case 195: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 196: return visitNonOptionalCallExpression(node, captureThisArg); + case 201: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); + case 195: + case 196: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); + case 197: return visitNonOptionalCallExpression(node, captureThisArg); default: return ts.visitNode(node, visitor, ts.isExpression); } } @@ -67791,8 +68085,8 @@ var ts; for (var i = 0; i < chain.length; i++) { var segment = chain[i]; switch (segment.kind) { - case 194: case 195: + case 196: if (i === chain.length - 1 && captureThisArg) { if (shouldCaptureInTempVariable(rightExpression)) { thisArg = ts.createTempVariable(hoistVariableDeclaration); @@ -67802,11 +68096,11 @@ var ts; thisArg = rightExpression; } } - rightExpression = segment.kind === 194 + rightExpression = segment.kind === 195 ? ts.createPropertyAccess(rightExpression, ts.visitNode(segment.name, visitor, ts.isIdentifier)) : ts.createElementAccess(rightExpression, ts.visitNode(segment.argumentExpression, visitor, ts.isExpression)); break; - case 196: + case 197: if (i === 0 && leftThisArg) { rightExpression = ts.createFunctionCall(rightExpression, leftThisArg.kind === 102 ? ts.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression)); } @@ -67894,13 +68188,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 266: - return visitJsxElement(node, false); case 267: + return visitJsxElement(node, false); + case 268: return visitJsxSelfClosingElement(node, false); - case 270: + case 271: return visitJsxFragment(node, false); - case 276: + case 277: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -67910,13 +68204,13 @@ var ts; switch (node.kind) { case 11: return visitJsxText(node); - case 276: + case 277: return visitJsxExpression(node); - case 266: - return visitJsxElement(node, true); case 267: + return visitJsxElement(node, true); + case 268: return visitJsxSelfClosingElement(node, true); - case 270: + case 271: return visitJsxFragment(node, true); default: return ts.Debug.failBadSyntaxKind(node); @@ -67980,7 +68274,7 @@ var ts; literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile); return ts.setTextRange(literal, node); } - else if (node.kind === 276) { + else if (node.kind === 277) { if (node.expression === undefined) { return ts.createTrue(); } @@ -68040,7 +68334,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 266) { + if (node.kind === 267) { return getTagName(node.openingElement); } else { @@ -68340,7 +68634,7 @@ var ts; return node; } switch (node.kind) { - case 209: + case 210: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -68430,13 +68724,13 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return (hierarchyFacts & 8192) !== 0 - && node.kind === 235 + && node.kind === 236 && !node.expression; } function shouldVisitNode(node) { return (node.transformFlags & 256) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 8192 && (ts.isStatement(node) || (node.kind === 223))) + || (hierarchyFacts & 8192 && (ts.isStatement(node) || (node.kind === 224))) || (ts.isIterationStatement(node, false) && shouldConvertIterationStatement(node)) || (ts.getEmitFlags(node) & 33554432) !== 0; } @@ -68458,63 +68752,63 @@ var ts; switch (node.kind) { case 120: return undefined; - case 245: + case 246: return visitClassDeclaration(node); - case 214: + case 215: return visitClassExpression(node); - case 156: + case 157: return visitParameter(node); - case 244: + case 245: return visitFunctionDeclaration(node); - case 202: + case 203: return visitArrowFunction(node); - case 201: + case 202: return visitFunctionExpression(node); - case 242: + case 243: return visitVariableDeclaration(node); case 75: return visitIdentifier(node); - case 243: + case 244: return visitVariableDeclarationList(node); - case 237: + case 238: return visitSwitchStatement(node); - case 251: + case 252: return visitCaseBlock(node); - case 223: + case 224: return visitBlock(node, false); + case 235: case 234: - case 233: return visitBreakOrContinueStatement(node); - case 238: + case 239: return visitLabeledStatement(node); - case 228: case 229: - return visitDoOrWhileStatement(node, undefined); case 230: - return visitForStatement(node, undefined); + return visitDoOrWhileStatement(node, undefined); case 231: - return visitForInStatement(node, undefined); + return visitForStatement(node, undefined); case 232: + return visitForInStatement(node, undefined); + case 233: return visitForOfStatement(node, undefined); - case 226: + case 227: return visitExpressionStatement(node); - case 193: + case 194: return visitObjectLiteralExpression(node); - case 280: + case 281: return visitCatchClause(node); - case 282: + case 283: return visitShorthandPropertyAssignment(node); - case 154: + case 155: return visitComputedPropertyName(node); - case 192: + case 193: return visitArrayLiteralExpression(node); - case 196: - return visitCallExpression(node); case 197: + return visitCallExpression(node); + case 198: return visitNewExpression(node); - case 200: + case 201: return visitParenthesizedExpression(node, true); - case 209: + case 210: return visitBinaryExpression(node, true); case 14: case 15: @@ -68525,28 +68819,28 @@ var ts; return visitStringLiteral(node); case 8: return visitNumericLiteral(node); - case 198: + case 199: return visitTaggedTemplateExpression(node); - case 211: - return visitTemplateExpression(node); case 212: - return visitYieldExpression(node); + return visitTemplateExpression(node); case 213: + return visitYieldExpression(node); + case 214: return visitSpreadElement(node); case 102: return visitSuperKeyword(false); case 104: return visitThisKeyword(node); - case 219: + case 220: return visitMetaProperty(node); - case 161: + case 162: return visitMethodDeclaration(node); - case 163: case 164: + case 165: return visitAccessorDeclaration(node); - case 225: + case 226: return visitVariableStatement(node); - case 235: + case 236: return visitReturnStatement(node); default: return ts.visitEachChild(node, visitor, context); @@ -68631,14 +68925,14 @@ var ts; } function visitBreakOrContinueStatement(node) { if (convertedLoopState) { - var jump = node.kind === 234 ? 2 : 4; + var jump = node.kind === 235 ? 2 : 4; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; var label = node.label; if (!label) { - if (node.kind === 234) { + if (node.kind === 235) { convertedLoopState.nonLocalJumps |= 2; labelMarker = "break"; } @@ -68648,7 +68942,7 @@ var ts; } } else { - if (node.kind === 234) { + if (node.kind === 235) { labelMarker = "break-" + label.escapedText; setLabeledJump(convertedLoopState, true, ts.idText(label), labelMarker); } @@ -68834,17 +69128,17 @@ var ts; return block; } function isSufficientlyCoveredByReturnStatements(statement) { - if (statement.kind === 235) { + if (statement.kind === 236) { return true; } - else if (statement.kind === 227) { + else if (statement.kind === 228) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); } } - else if (statement.kind === 223) { + else if (statement.kind === 224) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -68952,7 +69246,7 @@ var ts; return true; } function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 32768 && node.kind !== 202) { + if (hierarchyFacts & 32768 && node.kind !== 203) { insertCaptureThisForNode(statements, node, ts.createThis()); return true; } @@ -68971,18 +69265,18 @@ var ts; if (hierarchyFacts & 16384) { var newTarget = void 0; switch (node.kind) { - case 202: + case 203: return statements; - case 161: - case 163: + case 162: case 164: + case 165: newTarget = ts.createVoidZero(); break; - case 162: + case 163: newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4), "constructor"); break; - case 244: - case 201: + case 245: + case 202: newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4), 98, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4), "constructor"), ts.createVoidZero()); break; default: @@ -69003,20 +69297,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 222: + case 223: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 161: + case 162: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 163: case 164: + case 165: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 162: + case 163: break; default: ts.Debug.failBadSyntaxKind(member, currentSourceFile && currentSourceFile.fileName); @@ -69151,7 +69445,7 @@ var ts; : enterSubtree(16286, 65); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 && !name && (node.kind === 244 || node.kind === 201)) { + if (hierarchyFacts & 16384 && !name && (node.kind === 245 || node.kind === 202)) { name = ts.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152, 0); @@ -69182,7 +69476,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 202); + ts.Debug.assert(node.kind === 203); statementsLocation = ts.moveRangeEnd(body, -1); var equalsGreaterThanToken = node.equalsGreaterThanToken; if (!ts.nodeIsSynthesized(equalsGreaterThanToken) && !ts.nodeIsSynthesized(body)) { @@ -69235,9 +69529,9 @@ var ts; } function visitExpressionStatement(node) { switch (node.expression.kind) { - case 200: + case 201: return ts.updateExpressionStatement(node, visitParenthesizedExpression(node.expression, false)); - case 209: + case 210: return ts.updateExpressionStatement(node, visitBinaryExpression(node.expression, false)); } return ts.visitEachChild(node, visitor, context); @@ -69245,9 +69539,9 @@ var ts; function visitParenthesizedExpression(node, needsDestructuringValue) { if (!needsDestructuringValue) { switch (node.expression.kind) { - case 200: + case 201: return ts.updateParen(node, visitParenthesizedExpression(node.expression, false)); - case 209: + case 210: return ts.updateParen(node, visitBinaryExpression(node.expression, false)); } } @@ -69383,14 +69677,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 228: case 229: - return visitDoOrWhileStatement(node, outermostLabeledStatement); case 230: - return visitForStatement(node, outermostLabeledStatement); + return visitDoOrWhileStatement(node, outermostLabeledStatement); case 231: - return visitForInStatement(node, outermostLabeledStatement); + return visitForStatement(node, outermostLabeledStatement); case 232: + return visitForInStatement(node, outermostLabeledStatement); + case 233: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -69517,7 +69811,7 @@ var ts; && i < numInitialPropertiesWithoutYield) { numInitialPropertiesWithoutYield = i; } - if (property.name.kind === 154) { + if (property.name.kind === 155) { numInitialProperties = i; break; } @@ -69628,11 +69922,11 @@ var ts; } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 230: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 231: return convertForInStatement(node, convertedLoopBody); - case 232: return convertForOfStatement(node, convertedLoopBody); - case 228: return convertDoStatement(node, convertedLoopBody); - case 229: return convertWhileStatement(node, convertedLoopBody); + case 231: return convertForStatement(node, initializerFunction, convertedLoopBody); + case 232: return convertForInStatement(node, convertedLoopBody); + case 233: return convertForOfStatement(node, convertedLoopBody); + case 229: return convertDoStatement(node, convertedLoopBody); + case 230: return convertWhileStatement(node, convertedLoopBody); default: return ts.Debug.failBadSyntaxKind(node, "IterationStatement expected"); } } @@ -69656,11 +69950,11 @@ var ts; function createConvertedLoopState(node) { var loopInitializer; switch (node.kind) { - case 230: case 231: case 232: + case 233: var initializer = node.initializer; - if (initializer && initializer.kind === 243) { + if (initializer && initializer.kind === 244) { loopInitializer = initializer; } break; @@ -69919,20 +70213,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 163: case 164: + case 165: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 161: + case 162: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 281: + case 282: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 282: + case 283: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -70003,7 +70297,7 @@ var ts; var updated; var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 163) { + if (node.kind === 164) { updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -70250,13 +70544,13 @@ var ts; if ((enabledSubstitutions & 1) === 0) { enabledSubstitutions |= 1; context.enableSubstitution(104); - context.enableEmitNotification(162); - context.enableEmitNotification(161); context.enableEmitNotification(163); + context.enableEmitNotification(162); context.enableEmitNotification(164); + context.enableEmitNotification(165); + context.enableEmitNotification(203); context.enableEmitNotification(202); - context.enableEmitNotification(201); - context.enableEmitNotification(244); + context.enableEmitNotification(245); } } function onSubstituteNode(hint, node) { @@ -70280,10 +70574,10 @@ var ts; } function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 191: - case 245: - case 248: - case 242: + case 192: + case 246: + case 249: + case 243: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } @@ -70344,11 +70638,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 226) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 227) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 196) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 197) { return false; } var callTarget = statementExpression.expression; @@ -70356,7 +70650,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 213) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 214) { return false; } var expression = callArgument.expression; @@ -70388,24 +70682,24 @@ var ts; if (compilerOptions.jsx === 1 || compilerOptions.jsx === 3) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(268); context.enableEmitNotification(269); - context.enableEmitNotification(267); + context.enableEmitNotification(270); + context.enableEmitNotification(268); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(194); - context.enableSubstitution(281); + context.enableSubstitution(195); + context.enableSubstitution(282); return ts.chainBundle(transformSourceFile); function transformSourceFile(node) { return node; } function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 268: case 269: - case 267: + case 270: + case 268: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -70525,13 +70819,13 @@ var ts; } function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 228: - return visitDoStatement(node); case 229: + return visitDoStatement(node); + case 230: return visitWhileStatement(node); - case 237: - return visitSwitchStatement(node); case 238: + return visitSwitchStatement(node); + case 239: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -70539,24 +70833,24 @@ var ts; } function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 244: + case 245: return visitFunctionDeclaration(node); - case 201: + case 202: return visitFunctionExpression(node); - case 163: case 164: + case 165: return visitAccessorDeclaration(node); - case 225: + case 226: return visitVariableStatement(node); - case 230: - return visitForStatement(node); case 231: + return visitForStatement(node); + case 232: return visitForInStatement(node); - case 234: + case 235: return visitBreakStatement(node); - case 233: + case 234: return visitContinueStatement(node); - case 235: + case 236: return visitReturnStatement(node); default: if (node.transformFlags & 262144) { @@ -70572,21 +70866,21 @@ var ts; } function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 209: - return visitBinaryExpression(node); case 210: + return visitBinaryExpression(node); + case 211: return visitConditionalExpression(node); - case 212: + case 213: return visitYieldExpression(node); - case 192: - return visitArrayLiteralExpression(node); case 193: + return visitArrayLiteralExpression(node); + case 194: return visitObjectLiteralExpression(node); - case 195: - return visitElementAccessExpression(node); case 196: - return visitCallExpression(node); + return visitElementAccessExpression(node); case 197: + return visitCallExpression(node); + case 198: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -70594,9 +70888,9 @@ var ts; } function visitGenerator(node) { switch (node.kind) { - case 244: + case 245: return visitFunctionDeclaration(node); - case 201: + case 202: return visitFunctionExpression(node); default: return ts.Debug.failBadSyntaxKind(node); @@ -70733,10 +71027,10 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 194: + case 195: target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 195: + case 196: target = ts.updateElementAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), cacheExpression(ts.visitNode(left.argumentExpression, visitor, ts.isExpression))); break; default: @@ -70937,35 +71231,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 223: + case 224: return transformAndEmitBlock(node); - case 226: - return transformAndEmitExpressionStatement(node); case 227: - return transformAndEmitIfStatement(node); + return transformAndEmitExpressionStatement(node); case 228: - return transformAndEmitDoStatement(node); + return transformAndEmitIfStatement(node); case 229: - return transformAndEmitWhileStatement(node); + return transformAndEmitDoStatement(node); case 230: - return transformAndEmitForStatement(node); + return transformAndEmitWhileStatement(node); case 231: + return transformAndEmitForStatement(node); + case 232: return transformAndEmitForInStatement(node); - case 233: - return transformAndEmitContinueStatement(node); case 234: - return transformAndEmitBreakStatement(node); + return transformAndEmitContinueStatement(node); case 235: - return transformAndEmitReturnStatement(node); + return transformAndEmitBreakStatement(node); case 236: - return transformAndEmitWithStatement(node); + return transformAndEmitReturnStatement(node); case 237: - return transformAndEmitSwitchStatement(node); + return transformAndEmitWithStatement(node); case 238: - return transformAndEmitLabeledStatement(node); + return transformAndEmitSwitchStatement(node); case 239: - return transformAndEmitThrowStatement(node); + return transformAndEmitLabeledStatement(node); case 240: + return transformAndEmitThrowStatement(node); + case 241: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -71259,7 +71553,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 278 && defaultClauseIndex === -1) { + if (clause.kind === 279 && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -71269,7 +71563,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 277) { + if (clause.kind === 278) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -72085,11 +72379,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75); - context.enableSubstitution(209); - context.enableSubstitution(207); + context.enableSubstitution(210); context.enableSubstitution(208); - context.enableSubstitution(282); - context.enableEmitNotification(290); + context.enableSubstitution(209); + context.enableSubstitution(283); + context.enableEmitNotification(291); var moduleInfoMap = []; var deferredExports = []; var currentSourceFile; @@ -72280,23 +72574,23 @@ var ts; } function sourceElementVisitor(node) { switch (node.kind) { - case 254: + case 255: return visitImportDeclaration(node); - case 253: + case 254: return visitImportEqualsDeclaration(node); - case 260: + case 261: return visitExportDeclaration(node); - case 259: + case 260: return visitExportAssignment(node); - case 225: + case 226: return visitVariableStatement(node); - case 244: - return visitFunctionDeclaration(node); case 245: + return visitFunctionDeclaration(node); + case 246: return visitClassDeclaration(node); - case 328: - return visitMergeDeclarationMarker(node); case 329: + return visitMergeDeclarationMarker(node); + case 330: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, moduleExpressionElementVisitor, context); @@ -72321,24 +72615,24 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var elem = _a[_i]; switch (elem.kind) { - case 281: + case 282: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 282: + case 283: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 283: + case 284: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 161: - case 163: + case 162: case 164: + case 165: return false; default: ts.Debug.assertNever(elem, "Unhandled object member kind"); } @@ -72675,7 +72969,7 @@ var ts; } } function visitMergeDeclarationMarker(node) { - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -72707,10 +73001,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 256: + case 257: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 257: + case 258: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding, true); @@ -72825,7 +73119,7 @@ var ts; return node; } function onEmitNode(hint, node, emitCallback) { - if (node.kind === 290) { + if (node.kind === 291) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -72867,10 +73161,10 @@ var ts; switch (node.kind) { case 75: return substituteExpressionIdentifier(node); - case 209: + case 210: return substituteBinaryExpression(node); + case 209: case 208: - case 207: return substituteUnaryExpression(node); } return node; @@ -72885,7 +73179,7 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 290) { + if (exportContainer && exportContainer.kind === 291) { return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), node); } var importDeclaration = resolver.getReferencedImportDeclaration(node); @@ -72928,7 +73222,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 208 + var expression = node.kind === 209 ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 45 ? 63 : 64), ts.createLiteral(1)), node) : node; for (var _i = 0, exportedNames_3 = exportedNames; _i < exportedNames_3.length; _i++) { @@ -73015,12 +73309,12 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75); - context.enableSubstitution(282); - context.enableSubstitution(209); - context.enableSubstitution(207); + context.enableSubstitution(283); + context.enableSubstitution(210); context.enableSubstitution(208); - context.enableSubstitution(219); - context.enableEmitNotification(290); + context.enableSubstitution(209); + context.enableSubstitution(220); + context.enableEmitNotification(291); var moduleInfoMap = []; var deferredExports = []; var exportFunctionsMap = []; @@ -73128,7 +73422,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 260 && externalImport.exportClause) { + if (externalImport.kind === 261 && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -73151,7 +73445,7 @@ var ts; } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 260) { + if (externalImport.kind !== 261) { continue; } if (!externalImport.exportClause) { @@ -73207,15 +73501,15 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); switch (entry.kind) { - case 254: + case 255: if (!entry.importClause) { break; } - case 253: + case 254: ts.Debug.assert(importVariableName !== undefined); statements.push(ts.createExpressionStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 260: + case 261: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { if (ts.isNamedExports(entry.exportClause)) { @@ -73245,13 +73539,13 @@ var ts; } function sourceElementVisitor(node) { switch (node.kind) { - case 254: + case 255: return visitImportDeclaration(node); - case 253: + case 254: return visitImportEqualsDeclaration(node); - case 260: + case 261: return visitExportDeclaration(node); - case 259: + case 260: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -73376,7 +73670,7 @@ var ts; } function shouldHoistVariableDeclarationList(node) { return (ts.getEmitFlags(node) & 2097152) === 0 - && (enclosingBlockScopedContainer.kind === 290 + && (enclosingBlockScopedContainer.kind === 291 || (ts.getOriginalNode(node).flags & 3) === 0); } function transformInitializedVariable(node, isExportedDeclaration) { @@ -73398,7 +73692,7 @@ var ts; : preventSubstitution(ts.setTextRange(ts.createAssignment(name, value), location)); } function visitMergeDeclarationMarker(node) { - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -73437,10 +73731,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 256: + case 257: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 257: + case 258: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -73540,43 +73834,43 @@ var ts; } function nestedElementVisitor(node) { switch (node.kind) { - case 225: + case 226: return visitVariableStatement(node); - case 244: - return visitFunctionDeclaration(node); case 245: + return visitFunctionDeclaration(node); + case 246: return visitClassDeclaration(node); - case 230: - return visitForStatement(node); case 231: - return visitForInStatement(node); + return visitForStatement(node); case 232: + return visitForInStatement(node); + case 233: return visitForOfStatement(node); - case 228: - return visitDoStatement(node); case 229: + return visitDoStatement(node); + case 230: return visitWhileStatement(node); - case 238: + case 239: return visitLabeledStatement(node); - case 236: - return visitWithStatement(node); case 237: + return visitWithStatement(node); + case 238: return visitSwitchStatement(node); - case 251: + case 252: return visitCaseBlock(node); - case 277: - return visitCaseClause(node); case 278: + return visitCaseClause(node); + case 279: return visitDefaultClause(node); - case 240: + case 241: return visitTryStatement(node); - case 280: + case 281: return visitCatchClause(node); - case 223: + case 224: return visitBlock(node); - case 328: - return visitMergeDeclarationMarker(node); case 329: + return visitMergeDeclarationMarker(node); + case 330: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -73712,7 +74006,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 290; + return container !== undefined && container.kind === 291; } else { return false; @@ -73727,7 +74021,7 @@ var ts; return node; } function onEmitNode(hint, node, emitCallback) { - if (node.kind === 290) { + if (node.kind === 291) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -73763,7 +74057,7 @@ var ts; } function substituteUnspecified(node) { switch (node.kind) { - case 282: + case 283: return substituteShorthandPropertyAssignment(node); } return node; @@ -73787,12 +74081,12 @@ var ts; switch (node.kind) { case 75: return substituteExpressionIdentifier(node); - case 209: + case 210: return substituteBinaryExpression(node); - case 207: case 208: + case 209: return substituteUnaryExpression(node); - case 219: + case 220: return substituteMetaProperty(node); } return node; @@ -73844,14 +74138,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 208 + var expression = node.kind === 209 ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) { var exportName = exportedNames_5[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 208) { + if (node.kind === 209) { expression = node.operator === 45 ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -73874,7 +74168,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, false); - if (exportContainer && exportContainer.kind === 290) { + if (exportContainer && exportContainer.kind === 291) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -73902,7 +74196,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(290); + context.enableEmitNotification(291); context.enableSubstitution(75); var helperNameSubstitutions; return ts.chainBundle(transformSourceFile); @@ -73927,11 +74221,11 @@ var ts; } function visitor(node) { switch (node.kind) { - case 253: + case 254: return undefined; - case 259: - return visitExportAssignment(node); case 260: + return visitExportAssignment(node); + case 261: var exportDecl = node; return visitExportDeclaration(exportDecl); } @@ -74035,7 +74329,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 245) { + else if (node.parent.kind === 246) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -74064,7 +74358,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 245) { + else if (node.parent.kind === 246) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -74111,15 +74405,15 @@ var ts; return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]); } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 242 || node.kind === 191) { + if (node.kind === 243 || node.kind === 192) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 159 || node.kind === 194 || node.kind === 158 || - (node.kind === 156 && ts.hasModifier(node.parent, 8))) { + else if (node.kind === 160 || node.kind === 195 || node.kind === 159 || + (node.kind === 157 && ts.hasModifier(node.parent, 8))) { if (ts.hasModifier(node, 32)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -74127,7 +74421,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 245 || node.kind === 156) { + else if (node.parent.kind === 246 || node.kind === 157) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -74151,7 +74445,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (node.kind === 164) { + if (node.kind === 165) { if (ts.hasModifier(node, 32)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : @@ -74188,23 +74482,23 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 166: + case 167: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 165: + case 166: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 167: + case 168: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; + case 162: case 161: - case 160: if (ts.hasModifier(node, 32)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -74212,7 +74506,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 245) { + else if (node.parent.kind === 246) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -74225,7 +74519,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 244: + case 245: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -74250,27 +74544,27 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 162: + case 163: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 166: - case 171: + case 167: + case 172: return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 165: + case 166: return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 167: + case 168: return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; + case 162: case 161: - case 160: if (ts.hasModifier(node.parent, 32)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -74278,7 +74572,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 245) { + else if (node.parent.parent.kind === 246) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -74290,15 +74584,15 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 244: - case 170: + case 245: + case 171: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; + case 165: case 164: - case 163: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -74311,39 +74605,39 @@ var ts; function getTypeParameterConstraintVisibilityError() { var diagnosticMessage; switch (node.parent.kind) { - case 245: + case 246: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 246: + case 247: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 186: + case 187: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 171: - case 166: + case 172: + case 167: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 165: + case 166: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; + case 162: case 161: - case 160: if (ts.hasModifier(node.parent, 32)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 245) { + else if (node.parent.parent.kind === 246) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 170: - case 244: + case 171: + case 245: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 247: + case 248: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -74357,7 +74651,7 @@ var ts; } function getHeritageClauseVisibilityError() { var diagnosticMessage; - if (node.parent.parent.kind === 245) { + if (node.parent.parent.kind === 246) { diagnosticMessage = ts.isHeritageClause(node.parent) && node.parent.token === 113 ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1; @@ -74405,7 +74699,7 @@ var ts; } function isInternalDeclaration(node, currentSourceFile) { var parseTreeNode = ts.getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 156) { + if (parseTreeNode && parseTreeNode.kind === 157) { var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : undefined; var text = currentSourceFile.text; @@ -74549,10 +74843,10 @@ var ts; return result; } function transformRoot(node) { - if (node.kind === 290 && node.isDeclarationFile) { + if (node.kind === 291 && node.isDeclarationFile) { return node; } - if (node.kind === 291) { + if (node.kind === 292) { isBundledEmit = true; refs = ts.createMap(); libs = ts.createMap(); @@ -74575,14 +74869,14 @@ var ts; resultHasExternalModuleIndicator = false; needsDeclare = false; var statements = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile, true)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); - var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(130)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], true, [], [], false, []); + var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(131)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], true, [], [], false, []); return newFile; } needsDeclare = true; var updated = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); return ts.updateSourceFileNode(sourceFile, transformAndReplaceLatePaintedStatements(updated), true, [], [], false, []); }), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 293) { + if (prepend.kind === 294) { var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal); hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib; collectReferences(sourceFile, refs); @@ -74714,7 +75008,7 @@ var ts; return name; } else { - if (name.kind === 190) { + if (name.kind === 191) { return ts.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement)); } else { @@ -74722,7 +75016,7 @@ var ts; } } function visitBindingElement(elem) { - if (elem.kind === 215) { + if (elem.kind === 216) { return elem; } return ts.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined); @@ -74756,7 +75050,7 @@ var ts; if (shouldPrintWithInitializer(node)) { return; } - var shouldUseResolverType = node.kind === 156 && + var shouldUseResolverType = node.kind === 157 && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { @@ -74765,7 +75059,7 @@ var ts; if (!ts.getParseTreeNode(node)) { return type ? ts.visitNode(type, visitDeclarationSubtree) : ts.createKeywordTypeNode(125); } - if (node.kind === 164) { + if (node.kind === 165) { return ts.createKeywordTypeNode(125); } errorNameNode = node.name; @@ -74774,12 +75068,12 @@ var ts; oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node); } - if (node.kind === 242 || node.kind === 191) { + if (node.kind === 243 || node.kind === 192) { return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); } - if (node.kind === 156 - || node.kind === 159 - || node.kind === 158) { + if (node.kind === 157 + || node.kind === 160 + || node.kind === 159) { if (!node.initializer) return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType)); return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); @@ -74796,19 +75090,19 @@ var ts; function isDeclarationAndNotVisible(node) { node = ts.getParseTreeNode(node); switch (node.kind) { - case 244: - case 249: - case 246: case 245: + case 250: case 247: + case 246: case 248: + case 249: return !resolver.isDeclarationVisible(node); - case 242: + case 243: return !getBindingNameVisible(node); - case 253: case 254: + case 255: + case 261: case 260: - case 259: return false; } return false; @@ -74885,7 +75179,7 @@ var ts; function rewriteModuleSpecifier(parent, input) { if (!input) return undefined; - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 249 && parent.kind !== 188); + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 250 && parent.kind !== 189); if (ts.isStringLiteralLike(input)) { if (isBundledEmit) { var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent); @@ -74905,7 +75199,7 @@ var ts; function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 265) { + if (decl.moduleReference.kind === 266) { var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl); return ts.updateImportEqualsDeclaration(decl, undefined, decl.modifiers, decl.name, ts.updateExternalModuleReference(decl.moduleReference, rewriteModuleSpecifier(decl, specifier))); } @@ -74925,7 +75219,7 @@ var ts; if (!decl.importClause.namedBindings) { return visibleDefaultBinding && ts.updateImportDeclaration(decl, undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, undefined, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)); } - if (decl.importClause.namedBindings.kind === 256) { + if (decl.importClause.namedBindings.kind === 257) { var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : undefined; return visibleDefaultBinding || namedBindings ? ts.updateImportDeclaration(decl, undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, namedBindings, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined; } @@ -74989,7 +75283,7 @@ var ts; var oldDiag = getSymbolAccessibilityDiagnostic; var canProduceDiagnostic = ts.canProduceDiagnostics(input); var oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 173 || input.kind === 186) && input.parent.kind !== 247); + var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 174 || input.kind === 187) && input.parent.kind !== 248); if (ts.isMethodDeclaration(input) || ts.isMethodSignature(input)) { if (ts.hasModifier(input, 8)) { if (input.symbol && input.symbol.declarations && input.symbol.declarations[0] !== input) @@ -75008,71 +75302,71 @@ var ts; } if (isProcessedComponent(input)) { switch (input.kind) { - case 216: { + case 217: { if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateExpressionWithTypeArguments(node, ts.parenthesizeTypeParameters(node.typeArguments), node.expression)); } - case 169: { + case 170: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateTypeReferenceNode(node, node.typeName, ts.parenthesizeTypeParameters(node.typeArguments))); } - case 166: + case 167: return cleanup(ts.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); - case 162: { - var ctor = ts.createSignatureDeclaration(162, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0), undefined); + case 163: { + var ctor = ts.createSignatureDeclaration(163, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0), undefined); ctor.modifiers = ts.createNodeArray(ensureModifiers(input)); return cleanup(ctor); } - case 161: { + case 162: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(undefined); } - var sig = ts.createSignatureDeclaration(160, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); + var sig = ts.createSignatureDeclaration(161, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); sig.name = input.name; sig.modifiers = ts.createNodeArray(ensureModifiers(input)); sig.questionToken = input.questionToken; return cleanup(sig); } - case 163: { + case 164: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(undefined); } var accessorType = getTypeAnnotationFromAllAccessorDeclarations(input, resolver.getAllAccessorDeclarations(input)); return cleanup(ts.updateGetAccessor(input, undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8)), ensureType(input, accessorType), undefined)); } - case 164: { + case 165: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(undefined); } return cleanup(ts.updateSetAccessor(input, undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8)), undefined)); } - case 159: + case 160: if (ts.isPrivateIdentifier(input.name)) { return cleanup(undefined); } return cleanup(ts.updateProperty(input, undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 158: + case 159: if (ts.isPrivateIdentifier(input.name)) { return cleanup(undefined); } return cleanup(ts.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 160: { + case 161: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(undefined); } return cleanup(ts.updateMethodSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), input.name, input.questionToken)); } - case 165: { + case 166: { return cleanup(ts.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 167: { + case 168: { return cleanup(ts.updateIndexSignature(input, undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || ts.createKeywordTypeNode(125))); } - case 242: { + case 243: { if (ts.isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -75080,13 +75374,13 @@ var ts; suppressNewDiagnosticContexts = true; return cleanup(ts.updateTypeScriptVariableDeclaration(input, input.name, undefined, ensureType(input, input.type), ensureNoInitializer(input))); } - case 155: { + case 156: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(ts.updateTypeParameterDeclaration(input, input.name, undefined, undefined)); } return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context)); } - case 180: { + case 181: { var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree); var extendsType = ts.visitNode(input.extendsType, visitDeclarationSubtree); var oldEnclosingDecl = enclosingDeclaration; @@ -75096,13 +75390,13 @@ var ts; var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree); return cleanup(ts.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 170: { + case 171: { return cleanup(ts.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 171: { + case 172: { return cleanup(ts.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 188: { + case 189: { if (!ts.isLiteralImportTypeNode(input)) return cleanup(input); return cleanup(ts.updateImportTypeNode(input, ts.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf)); @@ -75131,7 +75425,7 @@ var ts; } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 161 && ts.hasModifier(node.parent, 8); + return node.parent.kind === 162 && ts.hasModifier(node.parent, 8); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -75140,14 +75434,14 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 260: { + case 261: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } resultHasScopeMarker = true; return ts.updateExportDeclaration(input, undefined, input.modifiers, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier), input.isTypeOnly); } - case 259: { + case 260: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -75162,7 +75456,7 @@ var ts; errorNode: input }); }; var varDecl = ts.createVariableDeclaration(newId, resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130)] : [], ts.createVariableDeclarationList([varDecl], 2)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131)] : [], ts.createVariableDeclarationList([varDecl], 2)); return [statement, ts.updateExportAssignment(input, input.decorators, input.modifiers, newId)]; } } @@ -75184,10 +75478,10 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 253: { + case 254: { return transformImportEqualsDeclaration(input); } - case 254: { + case 255: { return transformImportDeclaration(input); } } @@ -75207,12 +75501,12 @@ var ts; } var previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 247: + case 248: return cleanup(ts.updateTypeAliasDeclaration(input, undefined, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode))); - case 246: { + case 247: { return cleanup(ts.updateInterfaceDeclaration(input, undefined, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree))); } - case 244: { + case 245: { var clean = cleanup(ts.updateFunctionDeclaration(input, undefined, ensureModifiers(input), undefined, input.name, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), undefined)); if (clean && resolver.isExpandoFunctionDeclaration(input)) { var props = resolver.getPropertiesOfContainerFunction(input); @@ -75249,10 +75543,10 @@ var ts; return clean; } } - case 249: { + case 250: { needsDeclare = false; var inner = input.body; - if (inner && inner.kind === 250) { + if (inner && inner.kind === 251) { var oldNeedsScopeFix = needsScopeFixMarker; var oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; @@ -75288,7 +75582,7 @@ var ts; return cleanup(ts.updateModuleDeclaration(input, undefined, mods, input.name, body)); } } - case 245: { + case 246: { var modifiers = ts.createNodeArray(ensureModifiers(input)); var typeParameters = ensureTypeParams(input, input.typeParameters); var ctor = ts.getFirstConstructorWithBody(input); @@ -75338,7 +75632,7 @@ var ts; typeName: input.name }); }; var varDecl = ts.createVariableDeclaration(newId_1, resolver.createTypeOfExpression(extendsClause_1.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130)] : [], ts.createVariableDeclarationList([varDecl], 2)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131)] : [], ts.createVariableDeclarationList([varDecl], 2)); var heritageClauses = ts.createNodeArray(ts.map(input.heritageClauses, function (clause) { if (clause.token === 90) { var oldDiag_2 = getSymbolAccessibilityDiagnostic; @@ -75356,10 +75650,10 @@ var ts; return cleanup(ts.updateClassDeclaration(input, undefined, modifiers, input.name, typeParameters, heritageClauses, members)); } } - case 225: { + case 226: { return cleanup(transformVariableStatement(input)); } - case 248: { + case 249: { return cleanup(ts.updateEnumDeclaration(input, undefined, ts.createNodeArray(ensureModifiers(input)), input.name, ts.createNodeArray(ts.mapDefined(input.members, function (m) { if (shouldStripInternal(m)) return; @@ -75376,7 +75670,7 @@ var ts; if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 249) { + if (input.kind === 250) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -75397,7 +75691,7 @@ var ts; return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); })); } function recreateBindingElement(e) { - if (e.kind === 215) { + if (e.kind === 216) { return; } if (e.name) { @@ -75447,7 +75741,7 @@ var ts; function ensureModifierFlags(node) { var mask = 3071 ^ (4 | 256); var additions = (needsDeclare && !isAlwaysType(node)) ? 2 : 0; - var parentIsFile = node.parent.kind === 290; + var parentIsFile = node.parent.kind === 291; if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) { mask ^= 2; additions = 0; @@ -75474,7 +75768,7 @@ var ts; } ts.transformDeclarations = transformDeclarations; function isAlwaysType(node) { - if (node.kind === 246) { + if (node.kind === 247) { return true; } return false; @@ -75496,7 +75790,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 163 + return accessor.kind === 164 ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type @@ -75505,52 +75799,52 @@ var ts; } function canHaveLiteralInitializer(node) { switch (node.kind) { + case 160: case 159: - case 158: return !ts.hasModifier(node, 8); - case 156: - case 242: + case 157: + case 243: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 244: - case 249: - case 253: - case 246: case 245: + case 250: + case 254: case 247: + case 246: case 248: - case 225: - case 254: + case 249: + case 226: + case 255: + case 261: case 260: - case 259: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 166: - case 162: - case 161: + case 167: case 163: + case 162: case 164: - case 159: - case 158: - case 160: case 165: - case 167: - case 242: - case 155: - case 216: - case 169: - case 180: + case 160: + case 159: + case 161: + case 166: + case 168: + case 243: + case 156: + case 217: case 170: + case 181: case 171: - case 188: + case 172: + case 189: return true; } return false; @@ -75652,7 +75946,7 @@ var ts; } ts.noEmitNotification = noEmitNotification; function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(331); + var enabledSyntaxKindFeatures = new Array(332); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -75942,7 +76236,7 @@ var ts; ts.getOutputPathsForBundle = getOutputPathsForBundle; function getOutputPathsFor(sourceFile, host, forceDtsPaths) { var options = host.getCompilerOptions(); - if (sourceFile.kind === 291) { + if (sourceFile.kind === 292) { return getOutputPathsForBundle(options, forceDtsPaths); } else { @@ -76248,7 +76542,7 @@ var ts; mapRoot: compilerOptions.mapRoot, extendedDiagnostics: compilerOptions.extendedDiagnostics, }); - if (forceDtsEmit && declarationTransform.transformed[0].kind === 290) { + if (forceDtsEmit && declarationTransform.transformed[0].kind === 291) { var sourceFile = declarationTransform.transformed[0]; exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit; } @@ -76271,8 +76565,8 @@ var ts; ts.forEachChild(node, collectLinkedAliases); } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) { - var bundle = sourceFileOrBundle.kind === 291 ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 290 ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 292 ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 291 ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; var sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -76310,7 +76604,7 @@ var ts; } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { return (mapOptions.sourceMap || mapOptions.inlineSourceMap) - && (sourceFileOrBundle.kind !== 290 || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json")); + && (sourceFileOrBundle.kind !== 291 || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json")); } function getSourceRoot(mapOptions) { var sourceRoot = ts.normalizeSlashes(mapOptions.sourceRoot || ""); @@ -76405,7 +76699,7 @@ var ts; }; function createSourceFilesFromBundleBuildInfo(bundle, buildInfoDirectory, host) { var sourceFiles = bundle.sourceFiles.map(function (fileName) { - var sourceFile = ts.createNode(290, 0, 0); + var sourceFile = ts.createNode(291, 0, 0); sourceFile.fileName = ts.getRelativePathFromDirectory(host.getCurrentDirectory(), ts.getNormalizedAbsolutePath(fileName, buildInfoDirectory), !host.useCaseSensitiveFileNames()); sourceFile.text = ""; sourceFile.statements = ts.createNodeArray(); @@ -76417,7 +76711,7 @@ var ts; sourceFile.text = prologueInfo.text; sourceFile.end = prologueInfo.text.length; sourceFile.statements = ts.createNodeArray(prologueInfo.directives.map(function (directive) { - var statement = ts.createNode(226, directive.pos, directive.end); + var statement = ts.createNode(227, directive.pos, directive.end); statement.expression = ts.createNode(10, directive.expression.pos, directive.expression.end); statement.expression.text = directive.expression.text; return statement; @@ -76575,9 +76869,9 @@ var ts; break; } switch (node.kind) { - case 290: return printFile(node); - case 291: return printBundle(node); - case 292: return printUnparsedSource(node); + case 291: return printFile(node); + case 292: return printBundle(node); + case 293: return printUnparsedSource(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); @@ -76824,11 +77118,11 @@ var ts; return pipelineEmitWithSubstitution; } case 2: - if (!commentsDisabled && node.kind !== 290) { + if (!commentsDisabled && node.kind !== 291) { return pipelineEmitWithComments; } case 3: - if (!sourceMapsDisabled && node.kind !== 290 && !ts.isInJsonFile(node)) { + if (!sourceMapsDisabled && node.kind !== 291 && !ts.isInJsonFile(node)) { return pipelineEmitWithSourceMap; } case 4: @@ -76868,261 +77162,261 @@ var ts; case 16: case 17: return emitLiteral(node, false); - case 292: - case 286: + case 293: + case 287: return emitUnparsedSourceOrPrepend(node); - case 285: + case 286: return writeUnparsedNode(node); - case 287: case 288: - return emitUnparsedTextLike(node); case 289: + return emitUnparsedTextLike(node); + case 290: return emitUnparsedSyntheticReference(node); case 75: return emitIdentifier(node); case 76: return emitPrivateIdentifier(node); - case 153: - return emitQualifiedName(node); case 154: - return emitComputedPropertyName(node); + return emitQualifiedName(node); case 155: - return emitTypeParameter(node); + return emitComputedPropertyName(node); case 156: - return emitParameter(node); + return emitTypeParameter(node); case 157: - return emitDecorator(node); + return emitParameter(node); case 158: - return emitPropertySignature(node); + return emitDecorator(node); case 159: - return emitPropertyDeclaration(node); + return emitPropertySignature(node); case 160: - return emitMethodSignature(node); + return emitPropertyDeclaration(node); case 161: - return emitMethodDeclaration(node); + return emitMethodSignature(node); case 162: - return emitConstructor(node); + return emitMethodDeclaration(node); case 163: + return emitConstructor(node); case 164: - return emitAccessorDeclaration(node); case 165: - return emitCallSignature(node); + return emitAccessorDeclaration(node); case 166: - return emitConstructSignature(node); + return emitCallSignature(node); case 167: - return emitIndexSignature(node); + return emitConstructSignature(node); case 168: - return emitTypePredicate(node); + return emitIndexSignature(node); case 169: - return emitTypeReference(node); + return emitTypePredicate(node); case 170: + return emitTypeReference(node); + case 171: return emitFunctionType(node); - case 300: + case 301: return emitJSDocFunctionType(node); - case 171: - return emitConstructorType(node); case 172: - return emitTypeQuery(node); + return emitConstructorType(node); case 173: - return emitTypeLiteral(node); + return emitTypeQuery(node); case 174: - return emitArrayType(node); + return emitTypeLiteral(node); case 175: - return emitTupleType(node); + return emitArrayType(node); case 176: + return emitTupleType(node); + case 177: return emitOptionalType(node); - case 178: - return emitUnionType(node); case 179: - return emitIntersectionType(node); + return emitUnionType(node); case 180: - return emitConditionalType(node); + return emitIntersectionType(node); case 181: - return emitInferType(node); + return emitConditionalType(node); case 182: + return emitInferType(node); + case 183: return emitParenthesizedType(node); - case 216: + case 217: return emitExpressionWithTypeArguments(node); - case 183: - return emitThisType(); case 184: - return emitTypeOperator(node); + return emitThisType(); case 185: - return emitIndexedAccessType(node); + return emitTypeOperator(node); case 186: - return emitMappedType(node); + return emitIndexedAccessType(node); case 187: - return emitLiteralType(node); + return emitMappedType(node); case 188: + return emitLiteralType(node); + case 189: return emitImportTypeNode(node); - case 295: + case 296: writePunctuation("*"); return; - case 296: + case 297: writePunctuation("?"); return; - case 297: - return emitJSDocNullableType(node); case 298: - return emitJSDocNonNullableType(node); + return emitJSDocNullableType(node); case 299: + return emitJSDocNonNullableType(node); + case 300: return emitJSDocOptionalType(node); - case 177: - case 301: + case 178: + case 302: return emitRestOrJSDocVariadicType(node); - case 189: - return emitObjectBindingPattern(node); case 190: - return emitArrayBindingPattern(node); + return emitObjectBindingPattern(node); case 191: + return emitArrayBindingPattern(node); + case 192: return emitBindingElement(node); - case 221: - return emitTemplateSpan(node); case 222: - return emitSemicolonClassElement(); + return emitTemplateSpan(node); case 223: + return emitSemicolonClassElement(); + case 224: return emitBlock(node); - case 225: + case 226: return emitVariableStatement(node); - case 224: + case 225: return emitEmptyStatement(false); - case 226: - return emitExpressionStatement(node); case 227: - return emitIfStatement(node); + return emitExpressionStatement(node); case 228: - return emitDoStatement(node); + return emitIfStatement(node); case 229: - return emitWhileStatement(node); + return emitDoStatement(node); case 230: - return emitForStatement(node); + return emitWhileStatement(node); case 231: - return emitForInStatement(node); + return emitForStatement(node); case 232: - return emitForOfStatement(node); + return emitForInStatement(node); case 233: - return emitContinueStatement(node); + return emitForOfStatement(node); case 234: - return emitBreakStatement(node); + return emitContinueStatement(node); case 235: - return emitReturnStatement(node); + return emitBreakStatement(node); case 236: - return emitWithStatement(node); + return emitReturnStatement(node); case 237: - return emitSwitchStatement(node); + return emitWithStatement(node); case 238: - return emitLabeledStatement(node); + return emitSwitchStatement(node); case 239: - return emitThrowStatement(node); + return emitLabeledStatement(node); case 240: - return emitTryStatement(node); + return emitThrowStatement(node); case 241: - return emitDebuggerStatement(node); + return emitTryStatement(node); case 242: - return emitVariableDeclaration(node); + return emitDebuggerStatement(node); case 243: - return emitVariableDeclarationList(node); + return emitVariableDeclaration(node); case 244: - return emitFunctionDeclaration(node); + return emitVariableDeclarationList(node); case 245: - return emitClassDeclaration(node); + return emitFunctionDeclaration(node); case 246: - return emitInterfaceDeclaration(node); + return emitClassDeclaration(node); case 247: - return emitTypeAliasDeclaration(node); + return emitInterfaceDeclaration(node); case 248: - return emitEnumDeclaration(node); + return emitTypeAliasDeclaration(node); case 249: - return emitModuleDeclaration(node); + return emitEnumDeclaration(node); case 250: - return emitModuleBlock(node); + return emitModuleDeclaration(node); case 251: - return emitCaseBlock(node); + return emitModuleBlock(node); case 252: - return emitNamespaceExportDeclaration(node); + return emitCaseBlock(node); case 253: - return emitImportEqualsDeclaration(node); + return emitNamespaceExportDeclaration(node); case 254: - return emitImportDeclaration(node); + return emitImportEqualsDeclaration(node); case 255: - return emitImportClause(node); + return emitImportDeclaration(node); case 256: + return emitImportClause(node); + case 257: return emitNamespaceImport(node); - case 262: + case 263: return emitNamespaceExport(node); - case 257: - return emitNamedImports(node); case 258: - return emitImportSpecifier(node); + return emitNamedImports(node); case 259: - return emitExportAssignment(node); + return emitImportSpecifier(node); case 260: - return emitExportDeclaration(node); + return emitExportAssignment(node); case 261: + return emitExportDeclaration(node); + case 262: return emitNamedExports(node); - case 263: - return emitExportSpecifier(node); case 264: - return; + return emitExportSpecifier(node); case 265: + return; + case 266: return emitExternalModuleReference(node); case 11: return emitJsxText(node); - case 268: - case 271: - return emitJsxOpeningElementOrFragment(node); case 269: case 272: - return emitJsxClosingElementOrFragment(node); + return emitJsxOpeningElementOrFragment(node); + case 270: case 273: - return emitJsxAttribute(node); + return emitJsxClosingElementOrFragment(node); case 274: - return emitJsxAttributes(node); + return emitJsxAttribute(node); case 275: - return emitJsxSpreadAttribute(node); + return emitJsxAttributes(node); case 276: - return emitJsxExpression(node); + return emitJsxSpreadAttribute(node); case 277: - return emitCaseClause(node); + return emitJsxExpression(node); case 278: - return emitDefaultClause(node); + return emitCaseClause(node); case 279: - return emitHeritageClause(node); + return emitDefaultClause(node); case 280: - return emitCatchClause(node); + return emitHeritageClause(node); case 281: - return emitPropertyAssignment(node); + return emitCatchClause(node); case 282: - return emitShorthandPropertyAssignment(node); + return emitPropertyAssignment(node); case 283: - return emitSpreadAssignment(node); + return emitShorthandPropertyAssignment(node); case 284: + return emitSpreadAssignment(node); + case 285: return emitEnumMember(node); - case 317: - case 323: - return emitJSDocPropertyLikeTag(node); case 318: - case 320: + case 324: + return emitJSDocPropertyLikeTag(node); case 319: - case 316: + case 321: + case 320: + case 317: return emitJSDocSimpleTypedTag(node); + case 309: case 308: - case 307: return emitJSDocHeritageTag(node); - case 321: - return emitJSDocTemplateTag(node); case 322: + return emitJSDocTemplateTag(node); + case 323: return emitJSDocTypedefTag(node); - case 315: + case 316: return emitJSDocCallbackTag(node); - case 305: + case 306: return emitJSDocSignature(node); - case 304: + case 305: return emitJSDocTypeLiteral(node); - case 310: - case 306: + case 311: + case 307: return emitJSDocSimpleTag(node); - case 303: + case 304: return emitJSDoc(node); } if (ts.isExpression(node)) { @@ -77154,69 +77448,69 @@ var ts; case 96: writeTokenNode(node, writeKeyword); return; - case 192: - return emitArrayLiteralExpression(node); case 193: - return emitObjectLiteralExpression(node); + return emitArrayLiteralExpression(node); case 194: - return emitPropertyAccessExpression(node); + return emitObjectLiteralExpression(node); case 195: - return emitElementAccessExpression(node); + return emitPropertyAccessExpression(node); case 196: - return emitCallExpression(node); + return emitElementAccessExpression(node); case 197: - return emitNewExpression(node); + return emitCallExpression(node); case 198: - return emitTaggedTemplateExpression(node); + return emitNewExpression(node); case 199: - return emitTypeAssertionExpression(node); + return emitTaggedTemplateExpression(node); case 200: - return emitParenthesizedExpression(node); + return emitTypeAssertionExpression(node); case 201: - return emitFunctionExpression(node); + return emitParenthesizedExpression(node); case 202: - return emitArrowFunction(node); + return emitFunctionExpression(node); case 203: - return emitDeleteExpression(node); + return emitArrowFunction(node); case 204: - return emitTypeOfExpression(node); + return emitDeleteExpression(node); case 205: - return emitVoidExpression(node); + return emitTypeOfExpression(node); case 206: - return emitAwaitExpression(node); + return emitVoidExpression(node); case 207: - return emitPrefixUnaryExpression(node); + return emitAwaitExpression(node); case 208: - return emitPostfixUnaryExpression(node); + return emitPrefixUnaryExpression(node); case 209: - return emitBinaryExpression(node); + return emitPostfixUnaryExpression(node); case 210: - return emitConditionalExpression(node); + return emitBinaryExpression(node); case 211: - return emitTemplateExpression(node); + return emitConditionalExpression(node); case 212: - return emitYieldExpression(node); + return emitTemplateExpression(node); case 213: - return emitSpreadExpression(node); + return emitYieldExpression(node); case 214: - return emitClassExpression(node); + return emitSpreadExpression(node); case 215: + return emitClassExpression(node); + case 216: return; - case 217: - return emitAsExpression(node); case 218: - return emitNonNullExpression(node); + return emitAsExpression(node); case 219: + return emitNonNullExpression(node); + case 220: return emitMetaProperty(node); - case 266: - return emitJsxElement(node); case 267: + return emitJsxElement(node); + case 268: return emitJsxSelfClosingElement(node); - case 270: + case 271: return emitJsxFragment(node); - case 326: - return emitPartiallyEmittedExpression(node); case 327: + return emitPartiallyEmittedExpression(node); + case 328: return emitCommaList(node); } } @@ -77258,7 +77552,7 @@ var ts; } function emitHelpers(node) { var helpersEmitted = false; - var bundle = node.kind === 291 ? node : undefined; + var bundle = node.kind === 292 ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -77332,7 +77626,7 @@ var ts; var pos = getTextPosWithWriteLine(); writeUnparsedNode(unparsed); if (bundleFileInfo) { - updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 287 ? + updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 288 ? "text" : "internal"); } @@ -77395,7 +77689,7 @@ var ts; emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 300 && !node.name) { + if (node.parent && node.parent.kind === 301 && !node.name) { emit(node.type); } else { @@ -77453,7 +77747,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - writeKeyword(node.kind === 163 ? "get" : "set"); + writeKeyword(node.kind === 164 ? "get" : "set"); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -77633,7 +77927,7 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - if (node.readonlyToken.kind !== 138) { + if (node.readonlyToken.kind !== 139) { writeKeyword("readonly"); } writeSpace(); @@ -77718,7 +78012,7 @@ var ts; } function emitPropertyAccessExpression(node) { var expression = ts.cast(emitExpression(node.expression), ts.isExpression); - var token = ts.getDotOrQuestionDotToken(node); + var token = node.questionDotToken || ts.createNode(24, node.expression.end, node.name.pos); var indentBeforeDot = needsIndentation(node, node.expression, token); var indentAfterDot = needsIndentation(node, token, node.name); increaseIndentIf(indentBeforeDot, false); @@ -77729,7 +78023,12 @@ var ts; if (shouldEmitDotDot) { writePunctuation("."); } - emitTokenWithComment(token.kind, node.expression.end, writePunctuation, node); + if (node.questionDotToken) { + emit(token); + } + else { + emitTokenWithComment(token.kind, node.expression.end, writePunctuation, node); + } increaseIndentIf(indentAfterDot, false); emit(node.name); decreaseIndentIf(indentBeforeDot, indentAfterDot); @@ -77828,7 +78127,7 @@ var ts; } function shouldEmitWhitespaceBeforeOperand(node) { var operand = node.operand; - return operand.kind === 207 + return operand.kind === 208 && ((node.operator === 39 && (operand.operator === 39 || operand.operator === 45)) || (node.operator === 40 && (operand.operator === 40 || operand.operator === 46))); } @@ -77987,7 +78286,7 @@ var ts; if (node.elseStatement) { writeLineOrSpace(node); emitTokenWithComment(87, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 227) { + if (node.elseStatement.kind === 228) { writeSpace(); emit(node.elseStatement); } @@ -78050,7 +78349,7 @@ var ts; emitTokenWithComment(20, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - emitTokenWithComment(152, node.initializer.end, writeKeyword, node); + emitTokenWithComment(153, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTokenWithComment(21, node.expression.end, writePunctuation, node); @@ -78058,7 +78357,7 @@ var ts; } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 243) { + if (node.kind === 244) { emit(node); } else { @@ -78344,7 +78643,7 @@ var ts; var body = node.body; if (!body) return writeTrailingSemicolon(); - while (body.kind === 249) { + while (body.kind === 250) { writePunctuation("."); emit(body.name); body = body.body; @@ -78389,7 +78688,7 @@ var ts; if (node.importClause) { emit(node.importClause); writeSpace(); - emitTokenWithComment(149, node.importClause.end, writeKeyword, node); + emitTokenWithComment(150, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -78397,7 +78696,7 @@ var ts; } function emitImportClause(node) { if (node.isTypeOnly) { - emitTokenWithComment(145, node.pos, writeKeyword, node); + emitTokenWithComment(146, node.pos, writeKeyword, node); writeSpace(); } emit(node.name); @@ -78437,7 +78736,7 @@ var ts; var nextPos = emitTokenWithComment(89, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { - nextPos = emitTokenWithComment(145, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(146, nextPos, writeKeyword, node); writeSpace(); } if (node.exportClause) { @@ -78449,7 +78748,7 @@ var ts; if (node.moduleSpecifier) { writeSpace(); var fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(149, fromPos, writeKeyword, node); + emitTokenWithComment(150, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } @@ -78460,7 +78759,7 @@ var ts; writeSpace(); nextPos = emitTokenWithComment(123, nextPos, writeKeyword, node); writeSpace(); - nextPos = emitTokenWithComment(136, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(137, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeTrailingSemicolon(); @@ -78653,7 +78952,7 @@ var ts; } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 320 && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 321 && !node.comment) { writeSpace(); emit(node.tags[0]); } @@ -78687,7 +78986,7 @@ var ts; function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 294) { + if (tag.typeExpression.kind === 295) { emitJSDocTypeExpression(tag.typeExpression); } else { @@ -78706,7 +79005,7 @@ var ts; emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 304) { + if (tag.typeExpression && tag.typeExpression.kind === 305) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -79438,7 +79737,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 200 && ts.nodeIsSynthesized(node)) { + while (node.kind === 201 && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -79497,84 +79796,84 @@ var ts; if (!node) return; switch (node.kind) { - case 223: + case 224: ts.forEach(node.statements, generateNames); break; - case 238: - case 236: - case 228: + case 239: + case 237: case 229: + case 230: generateNames(node.statement); break; - case 227: + case 228: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 230: - case 232: case 231: + case 233: + case 232: generateNames(node.initializer); generateNames(node.statement); break; - case 237: + case 238: generateNames(node.caseBlock); break; - case 251: + case 252: ts.forEach(node.clauses, generateNames); break; - case 277: case 278: + case 279: ts.forEach(node.statements, generateNames); break; - case 240: + case 241: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 280: + case 281: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 225: + case 226: generateNames(node.declarationList); break; - case 243: + case 244: ts.forEach(node.declarations, generateNames); break; - case 242: - case 156: - case 191: - case 245: + case 243: + case 157: + case 192: + case 246: generateNameIfNeeded(node.name); break; - case 244: + case 245: generateNameIfNeeded(node.name); if (ts.getEmitFlags(node) & 524288) { ts.forEach(node.parameters, generateNames); generateNames(node.body); } break; - case 189: case 190: + case 191: ts.forEach(node.elements, generateNames); break; - case 254: + case 255: generateNames(node.importClause); break; - case 255: + case 256: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; - case 256: + case 257: generateNameIfNeeded(node.name); break; - case 262: + case 263: generateNameIfNeeded(node.name); break; - case 257: + case 258: ts.forEach(node.elements, generateNames); break; - case 258: + case 259: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -79583,12 +79882,12 @@ var ts; if (!node) return; switch (node.kind) { - case 281: case 282: - case 159: - case 161: - case 163: + case 283: + case 160: + case 162: case 164: + case 165: generateNameIfNeeded(node.name); break; } @@ -79722,23 +80021,23 @@ var ts; switch (node.kind) { case 75: return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16), !!(flags & 8)); + case 250: case 249: - case 248: return generateNameForModuleOrEnum(node); - case 254: - case 260: + case 255: + case 261: return generateNameForImportOrExportDeclaration(node); - case 244: case 245: - case 259: + case 246: + case 260: return generateNameForExportDefault(); - case 214: + case 215: return generateNameForClassExpression(); - case 161: - case 163: + case 162: case 164: + case 165: return generateNameForMethodOrAccessor(node); - case 154: + case 155: return makeTempVariableName(0, true); default: return makeTempVariableName(0); @@ -79776,7 +80075,7 @@ var ts; hasWrittenComment = false; var emitFlags = ts.getEmitFlags(node); var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var isEmittedNode = node.kind !== 325; + var isEmittedNode = node.kind !== 326; var skipLeadingComments = pos < 0 || (emitFlags & 512) !== 0 || node.kind === 11; var skipTrailingComments = end < 0 || (emitFlags & 1024) !== 0 || node.kind === 11; var savedContainerPos = containerPos; @@ -79791,7 +80090,7 @@ var ts; } if (!skipTrailingComments || (end >= 0 && (emitFlags & 1024) !== 0)) { containerEnd = end; - if (node.kind === 243) { + if (node.kind === 244) { declarationListContainerEnd = end; } } @@ -80027,7 +80326,7 @@ var ts; else { var _a = ts.getSourceMapRange(node), pos = _a.pos, end = _a.end, _b = _a.source, source = _b === void 0 ? sourceMapSource : _b; var emitFlags = ts.getEmitFlags(node); - if (node.kind !== 325 + if (node.kind !== 326 && (emitFlags & 16) === 0 && pos >= 0) { emitSourcePos(source, skipSourceTrivia(source, pos)); @@ -80040,7 +80339,7 @@ var ts; else { pipelinePhase(hint, node); } - if (node.kind !== 325 + if (node.kind !== 326 && (emitFlags & 32) === 0 && end >= 0) { emitSourcePos(source, end); @@ -80439,7 +80738,6 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var ignoreDiagnosticCommentRegEx = /(^\s*$)|(^\s*\/\/\/?\s*(@ts-ignore)?)/; function findConfigFile(searchPath, fileExists, configName) { if (configName === void 0) { configName = "tsconfig.json"; } return ts.forEachAncestorDirectory(searchPath, function (ancestor) { @@ -80957,6 +81255,7 @@ var ts; }; } function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) { + var _a; var createProgramOptions = ts.isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions; var rootNames = createProgramOptions.rootNames, options = createProgramOptions.options, configFileParsingDiagnostics = createProgramOptions.configFileParsingDiagnostics, projectReferences = createProgramOptions.projectReferences; var oldProgram = createProgramOptions.oldProgram; @@ -81026,7 +81325,16 @@ var ts; var projectReferenceRedirects; var mapFromFileToProjectReferenceRedirects; var mapFromToProjectReferenceRedirectSource; - var useSourceOfProjectReferenceRedirect = !!host.useSourceOfProjectReferenceRedirect && host.useSourceOfProjectReferenceRedirect(); + var useSourceOfProjectReferenceRedirect = !!((_a = host.useSourceOfProjectReferenceRedirect) === null || _a === void 0 ? void 0 : _a.call(host)) && + !options.disableSourceOfProjectReferenceRedirect; + var onProgramCreateComplete = updateHostForUseSourceOfProjectReferenceRedirect({ + compilerHost: host, + useSourceOfProjectReferenceRedirect: useSourceOfProjectReferenceRedirect, + toPath: toPath, + getResolvedProjectReferences: getResolvedProjectReferences, + getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, + forEachResolvedProjectReference: forEachResolvedProjectReference + }); var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); var structuralIsReused; structuralIsReused = tryReuseStructureFromOldProgram(); @@ -81037,12 +81345,6 @@ var ts; if (!resolvedProjectReferences) { resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); } - if (host.setResolvedProjectReferenceCallbacks) { - host.setResolvedProjectReferenceCallbacks({ - getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, - forEachResolvedProjectReference: forEachResolvedProjectReference - }); - } if (rootNames.length) { for (var _i = 0, resolvedProjectReferences_1 = resolvedProjectReferences; _i < resolvedProjectReferences_1.length; _i++) { var parsedRef = resolvedProjectReferences_1[_i]; @@ -81051,8 +81353,8 @@ var ts; var out = parsedRef.commandLine.options.outFile || parsedRef.commandLine.options.out; if (useSourceOfProjectReferenceRedirect) { if (out || ts.getEmitModuleKind(parsedRef.commandLine.options) === ts.ModuleKind.None) { - for (var _a = 0, _b = parsedRef.commandLine.fileNames; _a < _b.length; _a++) { - var fileName = _b[_a]; + for (var _b = 0, _c = parsedRef.commandLine.fileNames; _b < _c.length; _b++) { + var fileName = _c[_b]; processSourceFile(fileName, false, false, undefined); } } @@ -81062,8 +81364,8 @@ var ts; processSourceFile(ts.changeExtension(out, ".d.ts"), false, false, undefined); } else if (ts.getEmitModuleKind(parsedRef.commandLine.options) === ts.ModuleKind.None) { - for (var _c = 0, _d = parsedRef.commandLine.fileNames; _c < _d.length; _c++) { - var fileName = _d[_c]; + for (var _d = 0, _e = parsedRef.commandLine.fileNames; _d < _e.length; _d++) { + var fileName = _e[_d]; if (!ts.fileExtensionIs(fileName, ".d.ts") && !ts.fileExtensionIs(fileName, ".json")) { processSourceFile(ts.getOutputDeclarationFileName(fileName, parsedRef.commandLine, !host.useCaseSensitiveFileNames()), false, false, undefined); } @@ -81105,8 +81407,8 @@ var ts; ts.Debug.assert(!!missingFilePaths); if (oldProgram && host.onReleaseOldSourceFile) { var oldSourceFiles = oldProgram.getSourceFiles(); - for (var _e = 0, oldSourceFiles_1 = oldSourceFiles; _e < oldSourceFiles_1.length; _e++) { - var oldSourceFile = oldSourceFiles_1[_e]; + for (var _f = 0, oldSourceFiles_1 = oldSourceFiles; _f < oldSourceFiles_1.length; _f++) { + var oldSourceFile = oldSourceFiles_1[_f]; var newFile = getSourceFileByPath(oldSourceFile.resolvedPath); if (shouldCreateNewSourceFile || !newFile || (oldSourceFile.resolvedPath === oldSourceFile.path && newFile.resolvedPath !== oldSourceFile.path)) { @@ -81169,8 +81471,10 @@ var ts; forEachResolvedProjectReference: forEachResolvedProjectReference, isSourceOfProjectReferenceRedirect: isSourceOfProjectReferenceRedirect, emitBuildInfo: emitBuildInfo, - getProbableSymlinks: getProbableSymlinks + getProbableSymlinks: getProbableSymlinks, + useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); }, }; + onProgramCreateComplete(); verifyCompilerOptions(); ts.performance.mark("afterProgram"); ts.performance.measure("Program", "beforeProgram", "afterProgram"); @@ -81361,12 +81665,6 @@ var ts; } if (projectReferences) { resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); - if (host.setResolvedProjectReferenceCallbacks) { - host.setResolvedProjectReferenceCallbacks({ - getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, - forEachResolvedProjectReference: forEachResolvedProjectReference - }); - } } var newSourceFiles = []; var modifiedSourceFiles = []; @@ -81636,19 +81934,19 @@ var ts; } var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName); var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName); - var diagnostics; - for (var _i = 0, _a = [fileProcessingDiagnosticsInFile, programDiagnosticsInFile]; _i < _a.length; _i++) { - var diags = _a[_i]; - if (diags) { - for (var _b = 0, diags_4 = diags; _b < diags_4.length; _b++) { - var diag = diags_4[_b]; - if (shouldReportDiagnostic(diag)) { - diagnostics = ts.append(diagnostics, diag); - } - } - } + return getMergedProgramDiagnostics(sourceFile, fileProcessingDiagnosticsInFile, programDiagnosticsInFile); + } + function getMergedProgramDiagnostics(sourceFile) { + var allDiagnostics = []; + for (var _i = 1; _i < arguments.length; _i++) { + allDiagnostics[_i - 1] = arguments[_i]; } - return diagnostics || ts.emptyArray; + var _a; + var flatDiagnostics = ts.flatten(allDiagnostics); + if (!((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { + return flatDiagnostics; + } + return getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics).diagnostics; } function getDeclarationDiagnostics(sourceFile, cancellationToken) { var options = program.getCompilerOptions(); @@ -81699,44 +81997,54 @@ var ts; sourceFile.scriptKind === 5 || isCheckJs || sourceFile.scriptKind === 7); var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray; var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray; - var diagnostics; - for (var _i = 0, _a = [bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined]; _i < _a.length; _i++) { - var diags = _a[_i]; - if (diags) { - for (var _b = 0, diags_5 = diags; _b < diags_5.length; _b++) { - var diag = diags_5[_b]; - if (shouldReportDiagnostic(diag)) { - diagnostics = ts.append(diagnostics, diag); - } - } - } - } - return diagnostics || ts.emptyArray; + return getMergedBindAndCheckDiagnostics(sourceFile, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined); }); } + function getMergedBindAndCheckDiagnostics(sourceFile) { + var allDiagnostics = []; + for (var _i = 1; _i < arguments.length; _i++) { + allDiagnostics[_i - 1] = arguments[_i]; + } + var _a; + var flatDiagnostics = ts.flatten(allDiagnostics); + if (!((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { + return flatDiagnostics; + } + var _b = getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics), diagnostics = _b.diagnostics, directives = _b.directives; + for (var _c = 0, _d = directives.getUnusedExpectations(); _c < _d.length; _c++) { + var errorExpectation = _d[_c]; + diagnostics.push(ts.createDiagnosticForRange(sourceFile, errorExpectation.range, ts.Diagnostics.Unused_ts_expect_error_directive)); + } + return diagnostics; + } + function getDiagnosticsWithPrecedingDirectives(sourceFile, commentDirectives, flatDiagnostics) { + var directives = ts.createCommentDirectivesMap(sourceFile, commentDirectives); + var diagnostics = flatDiagnostics.filter(function (diagnostic) { return markPrecedingCommentDirectiveLine(diagnostic, directives) === -1; }); + return { diagnostics: diagnostics, directives: directives }; + } function getSuggestionDiagnostics(sourceFile, cancellationToken) { return runWithCancellationToken(function () { return getDiagnosticsProducingTypeChecker().getSuggestionDiagnostics(sourceFile, cancellationToken); }); } - function shouldReportDiagnostic(diagnostic) { + function markPrecedingCommentDirectiveLine(diagnostic, directives) { var file = diagnostic.file, start = diagnostic.start; - if (file) { - var lineStarts = ts.getLineStarts(file); - var line = ts.computeLineAndCharacterOfPosition(lineStarts, start).line; - while (line > 0) { - var previousLineText = file.text.slice(lineStarts[line - 1], lineStarts[line]); - var result = ignoreDiagnosticCommentRegEx.exec(previousLineText); - if (!result) { - return true; - } - if (result[3]) { - return false; - } - line--; + if (!file) { + return -1; + } + var lineStarts = ts.getLineStarts(file); + var line = ts.computeLineAndCharacterOfPosition(lineStarts, start).line - 1; + while (line >= 0) { + if (directives.markUsed(line)) { + return line; + } + var lineText = file.text.slice(lineStarts[line - 1], lineStarts[line]).trim(); + if (lineText !== "" && !/^(\s*)\/\/(.*)$/.test(lineText)) { + return -1; } + line--; } - return true; + return -1; } function getJSSyntacticDiagnosticsForFile(sourceFile) { return runWithCancellationToken(function () { @@ -81746,79 +82054,79 @@ var ts; return diagnostics; function walk(node, parent) { switch (parent.kind) { - case 156: - case 159: - case 161: + case 157: + case 160: + case 162: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); return "skip"; } - case 160: - case 162: + case 161: case 163: case 164: - case 201: - case 244: + case 165: case 202: - case 242: + case 245: + case 203: + case 243: if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); return "skip"; } } switch (node.kind) { - case 255: + case 256: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node.parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); return "skip"; } break; - case 260: + case 261: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); return "skip"; } break; - case 253: + case 254: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_TypeScript_files)); return "skip"; - case 259: + case 260: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 279: + case 280: var heritageClause = node; if (heritageClause.token === 113) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 246: + case 247: var interfaceKeyword = ts.tokenToString(114); ts.Debug.assertIsDefined(interfaceKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); return "skip"; - case 249: - var moduleKeyword = node.flags & 16 ? ts.tokenToString(136) : ts.tokenToString(135); + case 250: + var moduleKeyword = node.flags & 16 ? ts.tokenToString(137) : ts.tokenToString(136); ts.Debug.assertIsDefined(moduleKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); return "skip"; - case 247: + case 248: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); return "skip"; - case 248: + case 249: var enumKeyword = ts.Debug.checkDefined(ts.tokenToString(88)); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); return "skip"; - case 218: + case 219: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 217: + case 218: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 199: + case 200: ts.Debug.fail(); } } @@ -81827,26 +82135,26 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); } switch (parent.kind) { - case 245: - case 214: - case 161: + case 246: + case 215: case 162: case 163: case 164: - case 201: - case 244: + case 165: case 202: + case 245: + case 203: if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } - case 225: + case 226: if (nodes === parent.modifiers) { - checkModifiers(parent.modifiers, parent.kind === 225); + checkModifiers(parent.modifiers, parent.kind === 226); return "skip"; } break; - case 159: + case 160: if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { var modifier = _a[_i]; @@ -81857,18 +82165,18 @@ var ts; return "skip"; } break; - case 156: + case 157: if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 196: case 197: - case 216: - case 267: - case 268: case 198: + case 217: + case 268: + case 269: + case 199: if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); return "skip"; @@ -81887,8 +82195,8 @@ var ts; case 119: case 117: case 118: - case 138: - case 130: + case 139: + case 131: case 122: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind))); break; @@ -83022,6 +83330,136 @@ var ts; } } ts.createProgram = createProgram; + function updateHostForUseSourceOfProjectReferenceRedirect(host) { + var mapOfDeclarationDirectories; + var symlinkedDirectories; + var symlinkedFiles; + var originalFileExists = host.compilerHost.fileExists; + var originalDirectoryExists = host.compilerHost.directoryExists; + var originalGetDirectories = host.compilerHost.getDirectories; + var originalRealpath = host.compilerHost.realpath; + if (!host.useSourceOfProjectReferenceRedirect) + return ts.noop; + host.compilerHost.fileExists = function (file) { + if (originalFileExists.call(host.compilerHost, file)) + return true; + if (!host.getResolvedProjectReferences()) + return false; + if (!ts.isDeclarationFileName(file)) + return false; + return fileOrDirectoryExistsUsingSource(file, true); + }; + if (originalDirectoryExists) { + host.compilerHost.directoryExists = function (path) { + if (originalDirectoryExists.call(host.compilerHost, path)) { + handleDirectoryCouldBeSymlink(path); + return true; + } + if (!host.getResolvedProjectReferences()) + return false; + if (!mapOfDeclarationDirectories) { + mapOfDeclarationDirectories = ts.createMap(); + host.forEachResolvedProjectReference(function (ref) { + if (!ref) + return; + var out = ref.commandLine.options.outFile || ref.commandLine.options.out; + if (out) { + mapOfDeclarationDirectories.set(ts.getDirectoryPath(host.toPath(out)), true); + } + else { + var declarationDir = ref.commandLine.options.declarationDir || ref.commandLine.options.outDir; + if (declarationDir) { + mapOfDeclarationDirectories.set(host.toPath(declarationDir), true); + } + } + }); + } + return fileOrDirectoryExistsUsingSource(path, false); + }; + } + if (originalGetDirectories) { + host.compilerHost.getDirectories = function (path) { + return !host.getResolvedProjectReferences() || (originalDirectoryExists && originalDirectoryExists.call(host.compilerHost, path)) ? + originalGetDirectories.call(host.compilerHost, path) : + []; + }; + } + if (originalRealpath) { + host.compilerHost.realpath = function (s) { + return (symlinkedFiles === null || symlinkedFiles === void 0 ? void 0 : symlinkedFiles.get(host.toPath(s))) || + originalRealpath.call(host.compilerHost, s); + }; + } + return onProgramCreateComplete; + function onProgramCreateComplete() { + host.compilerHost.fileExists = originalFileExists; + host.compilerHost.directoryExists = originalDirectoryExists; + host.compilerHost.getDirectories = originalGetDirectories; + } + function fileExistsIfProjectReferenceDts(file) { + var source = host.getSourceOfProjectReferenceRedirect(file); + return source !== undefined ? + ts.isString(source) ? originalFileExists.call(host.compilerHost, source) : true : + undefined; + } + function directoryExistsIfProjectReferenceDeclDir(dir) { + var dirPath = host.toPath(dir); + var dirPathWithTrailingDirectorySeparator = "" + dirPath + ts.directorySeparator; + return ts.forEachKey(mapOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath || + ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) || + ts.startsWith(dirPath, declDirPath + "/"); }); + } + function handleDirectoryCouldBeSymlink(directory) { + if (!host.getResolvedProjectReferences()) + return; + if (!originalRealpath || !ts.stringContains(directory, ts.nodeModulesPathPart)) + return; + if (!symlinkedDirectories) + symlinkedDirectories = ts.createMap(); + var directoryPath = ts.ensureTrailingDirectorySeparator(host.toPath(directory)); + if (symlinkedDirectories.has(directoryPath)) + return; + var real = ts.normalizePath(originalRealpath.call(host.compilerHost, directory)); + var realPath; + if (real === directory || + (realPath = ts.ensureTrailingDirectorySeparator(host.toPath(real))) === directoryPath) { + symlinkedDirectories.set(directoryPath, false); + return; + } + symlinkedDirectories.set(directoryPath, { + real: ts.ensureTrailingDirectorySeparator(real), + realPath: realPath + }); + } + function fileOrDirectoryExistsUsingSource(fileOrDirectory, isFile) { + var fileOrDirectoryExistsUsingSource = isFile ? + function (file) { return fileExistsIfProjectReferenceDts(file); } : + function (dir) { return directoryExistsIfProjectReferenceDeclDir(dir); }; + var result = fileOrDirectoryExistsUsingSource(fileOrDirectory); + if (result !== undefined) + return result; + if (!symlinkedDirectories) + return false; + var fileOrDirectoryPath = host.toPath(fileOrDirectory); + if (!ts.stringContains(fileOrDirectoryPath, ts.nodeModulesPathPart)) + return false; + if (isFile && symlinkedFiles && symlinkedFiles.has(fileOrDirectoryPath)) + return true; + return ts.firstDefinedIterator(symlinkedDirectories.entries(), function (_a) { + var directoryPath = _a[0], symlinkedDirectory = _a[1]; + if (!symlinkedDirectory || !ts.startsWith(fileOrDirectoryPath, directoryPath)) + return undefined; + var result = fileOrDirectoryExistsUsingSource(fileOrDirectoryPath.replace(directoryPath, symlinkedDirectory.realPath)); + if (isFile && result) { + if (!symlinkedFiles) + symlinkedFiles = ts.createMap(); + var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory()); + symlinkedFiles.set(fileOrDirectoryPath, "" + symlinkedDirectory.real + absolutePath.replace(new RegExp(directoryPath, "i"), "")); + } + return result; + }) || false; + } + } function handleNoEmitOptions(program, sourceFile, cancellationToken) { var options = program.getCompilerOptions(); if (options.noEmit) { @@ -83506,6 +83944,7 @@ var ts; state.affectedFilesPendingEmit = oldState.affectedFilesPendingEmit.slice(); state.affectedFilesPendingEmitKind = ts.cloneMapOrUndefined(oldState.affectedFilesPendingEmitKind); state.affectedFilesPendingEmitIndex = oldState.affectedFilesPendingEmitIndex; + state.seenAffectedFiles = ts.createMap(); } } var referencedMap = state.referencedMap; @@ -83542,8 +83981,8 @@ var ts; }); if (oldCompilerOptions && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) { newProgram.getSourceFiles().forEach(function (f) { return addToAffectedFilesPendingEmit(state, f.resolvedPath, 1); }); - ts.Debug.assert(state.seenAffectedFiles === undefined); - state.seenAffectedFiles = ts.createMap(); + ts.Debug.assert(!state.seenAffectedFiles || !state.seenAffectedFiles.size); + state.seenAffectedFiles = state.seenAffectedFiles || ts.createMap(); } state.emittedBuildInfo = !state.changedFilesSet.size && !state.affectedFilesPendingEmit; return state; @@ -84257,13 +84696,13 @@ var ts; return true; } ts.canWatchDirectory = canWatchDirectory; - ts.maxNumberOfFilesToIterateForInvalidation = 256; function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) { var filesWithChangedSetOfUnresolvedImports; var filesWithInvalidatedResolutions; var filesWithInvalidatedNonRelativeUnresolvedImports; - var allFilesHaveInvalidatedResolution = false; var nonRelativeExternalModuleResolutions = ts.createMultiMap(); + var resolutionsWithFailedLookups = []; + var resolvedFileToResolution = ts.createMultiMap(); var getCurrentDirectory = ts.memoize(function () { return resolutionHost.getCurrentDirectory(); }); var cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost(); var resolvedModuleNames = ts.createMap(); @@ -84315,7 +84754,8 @@ var ts; closeTypeRootsWatch(); resolvedModuleNames.clear(); resolvedTypeReferenceDirectives.clear(); - allFilesHaveInvalidatedResolution = false; + resolvedFileToResolution.clear(); + resolutionsWithFailedLookups.length = 0; clearPerDirectoryResolutions(); } function startRecordingFilesWithChangedResolutions() { @@ -84334,7 +84774,7 @@ var ts; return !!value && !!value.length; } function createHasInvalidatedResolution(forceAllFilesAsInvalidated) { - if (allFilesHaveInvalidatedResolution || forceAllFilesAsInvalidated) { + if (forceAllFilesAsInvalidated) { filesWithInvalidatedResolutions = undefined; return ts.returnTrue; } @@ -84351,7 +84791,6 @@ var ts; nonRelativeExternalModuleResolutions.clear(); } function finishCachingPerDirectoryResolution() { - allFilesHaveInvalidatedResolution = false; filesWithInvalidatedNonRelativeUnresolvedImports = undefined; clearPerDirectoryResolutions(); directoryWatchesOfFailedLookups.forEach(function (watcher, path) { @@ -84362,20 +84801,25 @@ var ts; }); } function resolveModuleName(moduleName, containingFile, compilerOptions, host, redirectedReference) { + var _a; var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference); if (!resolutionHost.getGlobalCache) { return primaryResult; } var globalCache = resolutionHost.getGlobalCache(); if (globalCache !== undefined && !ts.isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && ts.extensionIsTS(primaryResult.resolvedModule.extension))) { - var _a = ts.loadModuleFromGlobalCache(ts.Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName), resolutionHost.projectName, compilerOptions, host, globalCache), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations; + var _b = ts.loadModuleFromGlobalCache(ts.Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName), resolutionHost.projectName, compilerOptions, host, globalCache), resolvedModule = _b.resolvedModule, failedLookupLocations = _b.failedLookupLocations; if (resolvedModule) { - return { resolvedModule: resolvedModule, failedLookupLocations: ts.addRange(primaryResult.failedLookupLocations, failedLookupLocations) }; + primaryResult.resolvedModule = resolvedModule; + (_a = primaryResult.failedLookupLocations).push.apply(_a, failedLookupLocations); + return primaryResult; } } return primaryResult; } - function resolveNamesWithLocalCache(names, containingFile, redirectedReference, cache, perDirectoryCacheWithRedirects, loader, getResolutionWithResolvedFileName, shouldRetryResolution, reusedNames, logChanges) { + function resolveNamesWithLocalCache(_a) { + var names = _a.names, containingFile = _a.containingFile, redirectedReference = _a.redirectedReference, cache = _a.cache, perDirectoryCacheWithRedirects = _a.perDirectoryCacheWithRedirects, loader = _a.loader, getResolutionWithResolvedFileName = _a.getResolutionWithResolvedFileName, shouldRetryResolution = _a.shouldRetryResolution, reusedNames = _a.reusedNames, logChanges = _a.logChanges; + var _b; var path = resolutionHost.toPath(containingFile); var resolutionsInFile = cache.get(path) || cache.set(path, ts.createMap()).get(path); var dirPath = ts.getDirectoryPath(path); @@ -84398,7 +84842,7 @@ var ts; var name = names_3[_i]; var resolution = resolutionsInFile.get(name); if (!seenNamesInFile.has(name) && - allFilesHaveInvalidatedResolution || unmatchedRedirects || !resolution || resolution.isInvalidated || + unmatchedRedirects || !resolution || resolution.isInvalidated || (hasInvalidatedNonRelativeUnresolvedImport && !ts.isExternalModuleNameRelative(name) && shouldRetryResolution(resolution))) { var existingResolution = resolution; var resolutionInDirectory = perDirectoryResolution.get(name); @@ -84406,13 +84850,13 @@ var ts; resolution = resolutionInDirectory; } else { - resolution = loader(name, containingFile, compilerOptions, resolutionHost, redirectedReference); + resolution = loader(name, containingFile, compilerOptions, ((_b = resolutionHost.getCompilerHost) === null || _b === void 0 ? void 0 : _b.call(resolutionHost)) || resolutionHost, redirectedReference); perDirectoryResolution.set(name, resolution); } resolutionsInFile.set(name, resolution); - watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution); + watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName); if (existingResolution) { - stopWatchFailedLookupLocationOfResolution(existingResolution); + stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName); } if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) { filesWithChangedSetOfUnresolvedImports.push(path); @@ -84425,7 +84869,7 @@ var ts; } resolutionsInFile.forEach(function (resolution, name) { if (!seenNamesInFile.has(name) && !ts.contains(reusedNames, name)) { - stopWatchFailedLookupLocationOfResolution(resolution); + stopWatchFailedLookupLocationOfResolution(resolution, path, getResolutionWithResolvedFileName); resolutionsInFile.delete(name); } }); @@ -84449,18 +84893,35 @@ var ts; } } function resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference) { - return resolveNamesWithLocalCache(typeDirectiveNames, containingFile, redirectedReference, resolvedTypeReferenceDirectives, perDirectoryResolvedTypeReferenceDirectives, ts.resolveTypeReferenceDirective, getResolvedTypeReferenceDirective, function (resolution) { return resolution.resolvedTypeReferenceDirective === undefined; }, undefined, false); + return resolveNamesWithLocalCache({ + names: typeDirectiveNames, + containingFile: containingFile, + redirectedReference: redirectedReference, + cache: resolvedTypeReferenceDirectives, + perDirectoryCacheWithRedirects: perDirectoryResolvedTypeReferenceDirectives, + loader: ts.resolveTypeReferenceDirective, + getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective, + shouldRetryResolution: function (resolution) { return resolution.resolvedTypeReferenceDirective === undefined; }, + }); } function resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference) { - return resolveNamesWithLocalCache(moduleNames, containingFile, redirectedReference, resolvedModuleNames, perDirectoryResolvedModuleNames, resolveModuleName, getResolvedModule, function (resolution) { return !resolution.resolvedModule || !ts.resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension); }, reusedNames, logChangesWhenResolvingModule); + return resolveNamesWithLocalCache({ + names: moduleNames, + containingFile: containingFile, + redirectedReference: redirectedReference, + cache: resolvedModuleNames, + perDirectoryCacheWithRedirects: perDirectoryResolvedModuleNames, + loader: resolveModuleName, + getResolutionWithResolvedFileName: getResolvedModule, + shouldRetryResolution: function (resolution) { return !resolution.resolvedModule || !ts.resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension); }, + reusedNames: reusedNames, + logChanges: logChangesWhenResolvingModule + }); } function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName, containingFile) { var cache = resolvedModuleNames.get(resolutionHost.toPath(containingFile)); return cache && cache.get(moduleName); } - function isNodeModulesDirectory(dirPath) { - return ts.endsWith(dirPath, "/node_modules"); - } function isNodeModulesAtTypesDirectory(dirPath) { return ts.endsWith(dirPath, "/node_modules/@types"); } @@ -84491,7 +84952,7 @@ var ts; dir = ts.getDirectoryPath(dir); dirPath = ts.getDirectoryPath(dirPath); } - if (isNodeModulesDirectory(dirPath)) { + if (ts.isNodeModulesDirectory(dirPath)) { return canWatchDirectory(ts.getDirectoryPath(dirPath)) ? { dir: dir, dirPath: dirPath } : undefined; } var nonRecursive = true; @@ -84514,25 +84975,33 @@ var ts; function isPathWithDefaultFailedLookupExtension(path) { return ts.fileExtensionIsOneOf(path, failedLookupDefaultExtensions); } - function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution) { - if (resolution.failedLookupLocations && resolution.failedLookupLocations.length) { - if (resolution.refCount) { - resolution.refCount++; + function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName) { + if (resolution.refCount) { + resolution.refCount++; + ts.Debug.assertDefined(resolution.files); + } + else { + resolution.refCount = 1; + ts.Debug.assert(resolution.files === undefined); + if (ts.isExternalModuleNameRelative(name)) { + watchFailedLookupLocationOfResolution(resolution); } else { - resolution.refCount = 1; - if (ts.isExternalModuleNameRelative(name)) { - watchFailedLookupLocationOfResolution(resolution); - } - else { - nonRelativeExternalModuleResolutions.add(name, resolution); - } + nonRelativeExternalModuleResolutions.add(name, resolution); + } + var resolved = getResolutionWithResolvedFileName(resolution); + if (resolved && resolved.resolvedFileName) { + resolvedFileToResolution.add(resolutionHost.toPath(resolved.resolvedFileName), resolution); } } + (resolution.files || (resolution.files = [])).push(filePath); } function watchFailedLookupLocationOfResolution(resolution) { ts.Debug.assert(!!resolution.refCount); var failedLookupLocations = resolution.failedLookupLocations; + if (!failedLookupLocations.length) + return; + resolutionsWithFailedLookups.push(resolution); var setAtRoot = false; for (var _i = 0, failedLookupLocations_1 = failedLookupLocations; _i < failedLookupLocations_1.length; _i++) { var failedLookupLocation = failedLookupLocations_1[_i]; @@ -84557,14 +85026,11 @@ var ts; setDirectoryWatcher(rootDir, rootPath, true); } } - function setRefCountToUndefined(resolution) { - resolution.refCount = undefined; - } function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name) { var program = resolutionHost.getCurrentProgram(); - var updateResolution = program && program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name) ? - setRefCountToUndefined : watchFailedLookupLocationOfResolution; - resolutions.forEach(updateResolution); + if (!program || !program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name)) { + resolutions.forEach(watchFailedLookupLocationOfResolution); + } } function setDirectoryWatcher(dir, dirPath, nonRecursive) { var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); @@ -84576,14 +85042,19 @@ var ts; directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath, nonRecursive), refCount: 1, nonRecursive: nonRecursive }); } } - function stopWatchFailedLookupLocationOfResolution(resolution) { - if (!resolution.refCount) { - return; - } + function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName) { + ts.unorderedRemoveItem(ts.Debug.assertDefined(resolution.files), filePath); resolution.refCount--; if (resolution.refCount) { return; } + var resolved = getResolutionWithResolvedFileName(resolution); + if (resolved && resolved.resolvedFileName) { + resolvedFileToResolution.remove(resolutionHost.toPath(resolved.resolvedFileName), resolution); + } + if (!ts.unorderedRemoveItem(resolutionsWithFailedLookups, resolution)) { + return; + } var failedLookupLocations = resolution.failedLookupLocations; var removeAtRoot = false; for (var _i = 0, failedLookupLocations_2 = failedLookupLocations; _i < failedLookupLocations_2.length; _i++) { @@ -84624,15 +85095,15 @@ var ts; if (cachedDirectoryStructureHost) { cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); } - if (!allFilesHaveInvalidatedResolution && invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath)) { + if (invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath)) { resolutionHost.onInvalidatedResolution(); } }, nonRecursive ? 0 : 1); } - function removeResolutionsOfFileFromCache(cache, filePath) { + function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName) { var resolutions = cache.get(filePath); if (resolutions) { - resolutions.forEach(stopWatchFailedLookupLocationOfResolution); + resolutions.forEach(function (resolution) { return stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName); }); cache.delete(filePath); } } @@ -84651,51 +85122,24 @@ var ts; resolvedProjectReference.commandLine.fileNames.forEach(function (f) { return removeResolutionsOfFile(resolutionHost.toPath(f)); }); } function removeResolutionsOfFile(filePath) { - removeResolutionsOfFileFromCache(resolvedModuleNames, filePath); - removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath); - } - function invalidateResolutionCache(cache, isInvalidatedResolution, getResolutionWithResolvedFileName) { - var seen = ts.createMap(); - cache.forEach(function (resolutions, containingFilePath) { - var dirPath = ts.getDirectoryPath(containingFilePath); - var seenInDir = seen.get(dirPath); - if (!seenInDir) { - seenInDir = ts.createMap(); - seen.set(dirPath, seenInDir); - } - resolutions.forEach(function (resolution, name) { - if (seenInDir.has(name)) { - return; - } - seenInDir.set(name, true); - if (!resolution.isInvalidated && isInvalidatedResolution(resolution, getResolutionWithResolvedFileName)) { - resolution.isInvalidated = true; - (filesWithInvalidatedResolutions || (filesWithInvalidatedResolutions = ts.createMap())).set(containingFilePath, true); - if (ts.endsWith(containingFilePath, ts.inferredTypesContainingFile)) { - resolutionHost.onChangedAutomaticTypeDirectiveNames(); - } - } - }); - }); - } - function hasReachedResolutionIterationLimit() { - var maxSize = resolutionHost.maxNumberOfFilesToIterateForInvalidation || ts.maxNumberOfFilesToIterateForInvalidation; - return resolvedModuleNames.size > maxSize || resolvedTypeReferenceDirectives.size > maxSize; - } - function invalidateResolutions(isInvalidatedResolution) { - if (hasReachedResolutionIterationLimit()) { - allFilesHaveInvalidatedResolution = true; - return; + removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule); + removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective); + } + function invalidateResolution(resolution) { + resolution.isInvalidated = true; + var changedInAutoTypeReferenced = false; + for (var _i = 0, _a = ts.Debug.assertDefined(resolution.files); _i < _a.length; _i++) { + var containingFilePath = _a[_i]; + (filesWithInvalidatedResolutions || (filesWithInvalidatedResolutions = ts.createMap())).set(containingFilePath, true); + changedInAutoTypeReferenced = changedInAutoTypeReferenced || containingFilePath.endsWith(ts.inferredTypesContainingFile); + } + if (changedInAutoTypeReferenced) { + resolutionHost.onChangedAutomaticTypeDirectiveNames(); } - invalidateResolutionCache(resolvedModuleNames, isInvalidatedResolution, getResolvedModule); - invalidateResolutionCache(resolvedTypeReferenceDirectives, isInvalidatedResolution, getResolvedTypeReferenceDirective); } function invalidateResolutionOfFile(filePath) { removeResolutionsOfFile(filePath); - invalidateResolutions(function (resolution, getResolutionWithResolvedFileName) { - var result = getResolutionWithResolvedFileName(resolution); - return !!result && resolutionHost.toPath(result.resolvedFileName) === filePath; - }); + ts.forEach(resolvedFileToResolution.get(filePath), invalidateResolution); } function setFilesWithInvalidatedNonRelativeUnresolvedImports(filesMap) { ts.Debug.assert(filesWithInvalidatedNonRelativeUnresolvedImports === filesMap || filesWithInvalidatedNonRelativeUnresolvedImports === undefined); @@ -84715,8 +85159,8 @@ var ts; return false; } var dirOfFileOrDirectory = ts.getDirectoryPath(fileOrDirectoryPath); - if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || isNodeModulesDirectory(fileOrDirectoryPath) || - isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || isNodeModulesDirectory(dirOfFileOrDirectory)) { + if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || ts.isNodeModulesDirectory(fileOrDirectoryPath) || + isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || ts.isNodeModulesDirectory(dirOfFileOrDirectory)) { isChangedFailedLookupLocation = function (location) { var locationPath = resolutionHost.toPath(location); return locationPath === fileOrDirectoryPath || ts.startsWith(resolutionHost.toPath(location), fileOrDirectoryPath); @@ -84732,18 +85176,20 @@ var ts; isChangedFailedLookupLocation = function (location) { return resolutionHost.toPath(location) === fileOrDirectoryPath; }; } } - var hasChangedFailedLookupLocation = function (resolution) { return ts.some(resolution.failedLookupLocations, isChangedFailedLookupLocation); }; - var invalidatedFilesCount = filesWithInvalidatedResolutions && filesWithInvalidatedResolutions.size; - invalidateResolutions(hasChangedFailedLookupLocation); - return allFilesHaveInvalidatedResolution || filesWithInvalidatedResolutions && filesWithInvalidatedResolutions.size !== invalidatedFilesCount; + var invalidated = false; + for (var _i = 0, resolutionsWithFailedLookups_1 = resolutionsWithFailedLookups; _i < resolutionsWithFailedLookups_1.length; _i++) { + var resolution = resolutionsWithFailedLookups_1[_i]; + if (resolution.failedLookupLocations.some(isChangedFailedLookupLocation)) { + invalidateResolution(resolution); + invalidated = true; + } + } + return invalidated; } function closeTypeRootsWatch() { ts.clearMap(typeRootsWatches, ts.closeFileWatcher); } function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath) { - if (allFilesHaveInvalidatedResolution) { - return undefined; - } if (isInDirectoryPath(rootPath, typeRootPath)) { return rootPath; } @@ -84903,33 +85349,45 @@ var ts; function comparePathsByNumberOfDirectorySeparators(a, b) { return ts.compareValues(numberOfDirectorySeparators(a), numberOfDirectorySeparators(b)); } - function getAllModulePaths(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap) { + function forEachFileNameOfModule(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap, preferSymlinks, cb) { var redirects = redirectTargetsMap.get(importedFileName); var importedFileNames = redirects ? __spreadArrays(redirects, [importedFileName]) : [importedFileName]; var cwd = host.getCurrentDirectory ? host.getCurrentDirectory() : ""; var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); }); + if (!preferSymlinks) { + var result_10 = ts.forEach(targets, cb); + if (result_10) + return result_10; + } var links = host.getProbableSymlinks ? host.getProbableSymlinks(files) : ts.discoverProbableSymlinks(files, getCanonicalFileName, cwd); - var result = []; var compareStrings = (!host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames()) ? ts.compareStringsCaseSensitive : ts.compareStringsCaseInsensitive; - links.forEach(function (resolved, path) { + var result = ts.forEachEntry(links, function (resolved, path) { if (ts.startsWithDirectory(importingFileName, resolved, getCanonicalFileName)) { - return; + return undefined; } var target = ts.find(targets, function (t) { return compareStrings(t.slice(0, resolved.length + 1), resolved + "/") === 0; }); if (target === undefined) - return; + return undefined; var relative = ts.getRelativePathFromDirectory(resolved, target, getCanonicalFileName); var option = ts.resolvePath(path, relative); if (!host.fileExists || host.fileExists(option)) { - result.push(option); + var result_11 = cb(option); + if (result_11) + return result_11; } }); - result.push.apply(result, targets); - if (result.length < 2) - return result; - var allFileNames = ts.arrayToMap(result, ts.identity, getCanonicalFileName); + return result || + (preferSymlinks ? ts.forEach(targets, cb) : undefined); + } + moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule; + function getAllModulePaths(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap) { + var cwd = host.getCurrentDirectory ? host.getCurrentDirectory() : ""; + var allFileNames = ts.createMap(); + forEachFileNameOfModule(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap, true, function (path) { + allFileNames.set(path, getCanonicalFileName(path)); + }); var sortedPaths = []; var _loop_18 = function (directory) { var directoryStart = ts.ensureTrailingDirectorySeparator(directory); @@ -85413,8 +85871,6 @@ var ts; ts.setGetSourceFileAsHashVersioned = setGetSourceFileAsHashVersioned; function createProgramHost(system, createProgram) { var getDefaultLibLocation = ts.memoize(function () { return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath())); }); - var host = system; - host; return { useCaseSensitiveFileNames: function () { return system.useCaseSensitiveFileNames; }, getNewLine: function () { return system.newLine; }, @@ -85431,7 +85887,6 @@ var ts; trace: function (s) { return system.write(s + system.newLine); }, createDirectory: function (path) { return system.createDirectory(path); }, writeFile: function (path, data, writeByteOrderMark) { return system.writeFile(path, data, writeByteOrderMark); }, - onCachedDirectoryStructureHostCreate: function (cacheHost) { return host = cacheHost || system; }, createHash: ts.maybeBind(system, system.createHash), createProgram: createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram }; @@ -85547,9 +86002,6 @@ var ts; var canConfigFileJsonReportNoInputFiles = false; var hasChangedConfigFileParsingErrors = false; var cachedDirectoryStructureHost = configFileName === undefined ? undefined : ts.createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames); - if (cachedDirectoryStructureHost && host.onCachedDirectoryStructureHostCreate) { - host.onCachedDirectoryStructureHostCreate(cachedDirectoryStructureHost); - } var directoryStructureHost = cachedDirectoryStructureHost || host; var parseConfigFileHost = ts.parseConfigHostFromCompilerHostLike(host, directoryStructureHost); var newLine = updateNewLine(); @@ -85587,6 +86039,7 @@ var ts; compilerHost.onReleaseOldSourceFile = onReleaseOldSourceFile; compilerHost.toPath = toPath; compilerHost.getCompilationSettings = function () { return compilerOptions; }; + compilerHost.useSourceOfProjectReferenceRedirect = ts.maybeBind(host, host.useSourceOfProjectReferenceRedirect); compilerHost.watchDirectoryOfFailedLookupLocation = function (dir, cb, flags) { return watchDirectory(host, dir, cb, flags, watchOptions, ts.WatchType.FailedLookupLocations); }; compilerHost.watchTypeRootsDirectory = function (dir, cb, flags) { return watchDirectory(host, dir, cb, flags, watchOptions, ts.WatchType.TypeRoots); }; compilerHost.getCachedDirectoryStructureHost = function () { return cachedDirectoryStructureHost; }; @@ -85596,7 +86049,6 @@ var ts; scheduleProgramUpdate(); }; compilerHost.fileIsOpen = ts.returnFalse; - compilerHost.maxNumberOfFilesToIterateForInvalidation = host.maxNumberOfFilesToIterateForInvalidation; compilerHost.getCurrentProgram = getCurrentProgram; compilerHost.writeLog = writeLog; var resolutionCache = ts.createResolutionCache(compilerHost, configFileName ? @@ -85625,8 +86077,8 @@ var ts; synchronizeProgram(); watchConfigFileWildCardDirectories(); return configFileName ? - { getCurrentProgram: getCurrentBuilderProgram, getProgram: synchronizeProgram, close: close } : - { getCurrentProgram: getCurrentBuilderProgram, getProgram: synchronizeProgram, updateRootFileNames: updateRootFileNames, close: close }; + { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close: close } : + { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames: updateRootFileNames, close: close }; function close() { resolutionCache.clear(); ts.clearMap(sourceFilesCache, function (value) { @@ -85673,7 +86125,7 @@ var ts; else { createNewProgram(hasInvalidatedResolution); } - if (host.afterProgramCreate) { + if (host.afterProgramCreate && program !== builderProgram) { host.afterProgramCreate(builderProgram); } return builderProgram; @@ -85688,6 +86140,7 @@ var ts; resolutionCache.startCachingPerDirectoryResolution(); compilerHost.hasInvalidatedResolution = hasInvalidatedResolution; compilerHost.hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames; + hasChangedAutomaticTypeDirectiveNames = false; builderProgram = createProgram(rootFileNames, compilerOptions, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences); resolutionCache.finishCachingPerDirectoryResolution(); ts.updateMissingFilePathsWatch(builderProgram.getProgram(), missingFilesMap || (missingFilesMap = ts.createMap()), watchMissingFilePath); @@ -85724,7 +86177,7 @@ var ts; function fileExists(fileName) { var path = toPath(fileName); if (isFileMissingOnHost(sourceFilesCache.get(path))) { - return true; + return false; } return directoryStructureHost.fileExists(fileName); } @@ -85808,16 +86261,19 @@ var ts; host.clearTimeout(timerToUpdateProgram); } writeLog("Scheduling update"); - timerToUpdateProgram = host.setTimeout(updateProgram, 250); + timerToUpdateProgram = host.setTimeout(updateProgramWithWatchStatus, 250); } function scheduleProgramReload() { ts.Debug.assert(!!configFileName); reloadLevel = ts.ConfigFileProgramReloadLevel.Full; scheduleProgramUpdate(); } - function updateProgram() { + function updateProgramWithWatchStatus() { timerToUpdateProgram = undefined; reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation); + updateProgram(); + } + function updateProgram() { switch (reloadLevel) { case ts.ConfigFileProgramReloadLevel.Partial: ts.perfLogger.logStartUpdateProgram("PartialConfigReload"); @@ -85833,6 +86289,7 @@ var ts; break; } ts.perfLogger.logStopUpdateProgram("Done"); + return getCurrentBuilderProgram(); } function reloadFileNamesFromConfigFile() { writeLog("Reloading new file names and options"); @@ -87441,7 +87898,7 @@ var ts; return Array(paddingLength + 1).join(" "); } } - function executeCommandLineWorker(sys, cb, commandLine, maxNumberOfFilesToIterateForInvalidation) { + function executeCommandLineWorker(sys, cb, commandLine) { var reportDiagnostic = ts.createDiagnosticReporter(sys); if (commandLine.options.build) { reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.Option_build_must_be_the_first_command_line_argument)); @@ -87524,7 +87981,7 @@ var ts; if (ts.isWatchSet(configParseResult.options)) { if (reportWatchModeWithoutSysSupport(sys, reportDiagnostic)) return; - return createWatchOfConfigFile(sys, cb, reportDiagnostic, configParseResult, commandLineOptions, commandLine.watchOptions, maxNumberOfFilesToIterateForInvalidation); + return createWatchOfConfigFile(sys, cb, reportDiagnostic, configParseResult, commandLineOptions, commandLine.watchOptions); } else if (ts.isIncrementalCompilation(configParseResult.options)) { performIncrementalCompilation(sys, cb, reportDiagnostic, configParseResult); @@ -87542,7 +87999,7 @@ var ts; if (ts.isWatchSet(commandLineOptions)) { if (reportWatchModeWithoutSysSupport(sys, reportDiagnostic)) return; - return createWatchOfFilesAndCompilerOptions(sys, cb, reportDiagnostic, commandLine.fileNames, commandLineOptions, commandLine.watchOptions, maxNumberOfFilesToIterateForInvalidation); + return createWatchOfFilesAndCompilerOptions(sys, cb, reportDiagnostic, commandLine.fileNames, commandLineOptions, commandLine.watchOptions); } else if (ts.isIncrementalCompilation(commandLineOptions)) { performIncrementalCompilation(sys, cb, reportDiagnostic, __assign(__assign({}, commandLine), { options: commandLineOptions })); @@ -87560,7 +88017,7 @@ var ts; return false; } ts.isBuild = isBuild; - function executeCommandLine(system, cb, commandLineArgs, maxNumberOfFilesToIterateForInvalidation) { + function executeCommandLine(system, cb, commandLineArgs) { if (isBuild(commandLineArgs)) { var _a = ts.parseBuildCommand(commandLineArgs.slice(1)), buildOptions_1 = _a.buildOptions, watchOptions_1 = _a.watchOptions, projects_1 = _a.projects, errors_1 = _a.errors; if (buildOptions_1.generateCpuProfile && system.enableCPUProfiler) { @@ -87572,10 +88029,10 @@ var ts; } var commandLine = ts.parseCommandLine(commandLineArgs, function (path) { return system.readFile(path); }); if (commandLine.options.generateCpuProfile && system.enableCPUProfiler) { - system.enableCPUProfiler(commandLine.options.generateCpuProfile, function () { return executeCommandLineWorker(system, cb, commandLine, maxNumberOfFilesToIterateForInvalidation); }); + system.enableCPUProfiler(commandLine.options.generateCpuProfile, function () { return executeCommandLineWorker(system, cb, commandLine); }); } else { - return executeCommandLineWorker(system, cb, commandLine, maxNumberOfFilesToIterateForInvalidation); + return executeCommandLineWorker(system, cb, commandLine); } } ts.executeCommandLine = executeCommandLine; @@ -87688,9 +88145,8 @@ var ts; return compileUsingBuilder(rootNames, options, host, oldProgram, configFileParsingDiagnostics, projectReferences); }; } - function updateWatchCompilationHost(sys, cb, watchCompilerHost, maxNumberOfFilesToIterateForInvalidation) { + function updateWatchCompilationHost(sys, cb, watchCompilerHost) { updateCreateProgram(sys, watchCompilerHost); - watchCompilerHost.maxNumberOfFilesToIterateForInvalidation = maxNumberOfFilesToIterateForInvalidation; var emitFilesUsingBuilder = watchCompilerHost.afterProgramCreate; watchCompilerHost.afterProgramCreate = function (builderProgram) { emitFilesUsingBuilder(builderProgram); @@ -87701,15 +88157,15 @@ var ts; function createWatchStatusReporter(sys, options) { return ts.createWatchStatusReporter(sys, shouldBePretty(sys, options)); } - function createWatchOfConfigFile(sys, cb, reportDiagnostic, configParseResult, optionsToExtend, watchOptionsToExtend, maxNumberOfFilesToIterateForInvalidation) { + function createWatchOfConfigFile(sys, cb, reportDiagnostic, configParseResult, optionsToExtend, watchOptionsToExtend) { var watchCompilerHost = ts.createWatchCompilerHostOfConfigFile(configParseResult.options.configFilePath, optionsToExtend, watchOptionsToExtend, sys, undefined, reportDiagnostic, createWatchStatusReporter(sys, configParseResult.options)); - updateWatchCompilationHost(sys, cb, watchCompilerHost, maxNumberOfFilesToIterateForInvalidation); + updateWatchCompilationHost(sys, cb, watchCompilerHost); watchCompilerHost.configFileParsingResult = configParseResult; return ts.createWatchProgram(watchCompilerHost); } - function createWatchOfFilesAndCompilerOptions(sys, cb, reportDiagnostic, rootFiles, options, watchOptions, maxNumberOfFilesToIterateForInvalidation) { + function createWatchOfFilesAndCompilerOptions(sys, cb, reportDiagnostic, rootFiles, options, watchOptions) { var watchCompilerHost = ts.createWatchCompilerHostOfFilesAndCompilerOptions(rootFiles, options, watchOptions, sys, undefined, reportDiagnostic, createWatchStatusReporter(sys, options)); - updateWatchCompilationHost(sys, cb, watchCompilerHost, maxNumberOfFilesToIterateForInvalidation); + updateWatchCompilationHost(sys, cb, watchCompilerHost); return ts.createWatchProgram(watchCompilerHost); } function canReportDiagnostics(system, compilerOptions) { diff --git a/lib/tsserver.js b/lib/tsserver.js index 03bd6a47cad95..e2697170d6aa1 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -3053,233 +3053,234 @@ var ts; SyntaxKind[SyntaxKind["AnyKeyword"] = 125] = "AnyKeyword"; SyntaxKind[SyntaxKind["AsyncKeyword"] = 126] = "AsyncKeyword"; SyntaxKind[SyntaxKind["AwaitKeyword"] = 127] = "AwaitKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 128] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 129] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 130] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 131] = "GetKeyword"; - SyntaxKind[SyntaxKind["InferKeyword"] = 132] = "InferKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 133] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 134] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 135] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 136] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 137] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 138] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 139] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 140] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 141] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 142] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 143] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 144] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 145] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 146] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 147] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["UnknownKeyword"] = 148] = "UnknownKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 149] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 150] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["BigIntKeyword"] = 151] = "BigIntKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 152] = "OfKeyword"; + SyntaxKind[SyntaxKind["AwaitedKeyword"] = 128] = "AwaitedKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 129] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 130] = "ConstructorKeyword"; + SyntaxKind[SyntaxKind["DeclareKeyword"] = 131] = "DeclareKeyword"; + SyntaxKind[SyntaxKind["GetKeyword"] = 132] = "GetKeyword"; + SyntaxKind[SyntaxKind["InferKeyword"] = 133] = "InferKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 134] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 135] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 136] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 137] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 138] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 139] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 140] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 141] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 142] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 143] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 144] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 145] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 146] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 147] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 148] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["UnknownKeyword"] = 149] = "UnknownKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 150] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 151] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["BigIntKeyword"] = 152] = "BigIntKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 153] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 153] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 154] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 154] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 155] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 155] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 156] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 157] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 156] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 157] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 158] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 158] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 159] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 160] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 161] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 162] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 163] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 164] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 165] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 166] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 167] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 159] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 160] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 161] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 162] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 163] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 164] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 165] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 166] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 167] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 168] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 168] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 169] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 170] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 171] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 172] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 173] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 174] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 175] = "TupleType"; - SyntaxKind[SyntaxKind["OptionalType"] = 176] = "OptionalType"; - SyntaxKind[SyntaxKind["RestType"] = 177] = "RestType"; - SyntaxKind[SyntaxKind["UnionType"] = 178] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 179] = "IntersectionType"; - SyntaxKind[SyntaxKind["ConditionalType"] = 180] = "ConditionalType"; - SyntaxKind[SyntaxKind["InferType"] = 181] = "InferType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 182] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 183] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 184] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 185] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 186] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 187] = "LiteralType"; - SyntaxKind[SyntaxKind["ImportType"] = 188] = "ImportType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 169] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 170] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 171] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 172] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 173] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 174] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 175] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 176] = "TupleType"; + SyntaxKind[SyntaxKind["OptionalType"] = 177] = "OptionalType"; + SyntaxKind[SyntaxKind["RestType"] = 178] = "RestType"; + SyntaxKind[SyntaxKind["UnionType"] = 179] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 180] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 181] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 182] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 183] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 184] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 185] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 186] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 187] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 188] = "LiteralType"; + SyntaxKind[SyntaxKind["ImportType"] = 189] = "ImportType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 189] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 190] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 191] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 190] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 191] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 192] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 192] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 193] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 194] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 195] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 196] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 197] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 198] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 199] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 200] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 201] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 202] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 203] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 204] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 205] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 206] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 207] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 208] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 209] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 210] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 211] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 212] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 213] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 214] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 215] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 216] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 217] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 218] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 219] = "MetaProperty"; - SyntaxKind[SyntaxKind["SyntheticExpression"] = 220] = "SyntheticExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 193] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 194] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 195] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 196] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 197] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 198] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 199] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 200] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 201] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 202] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 203] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 204] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 205] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 206] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 207] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 208] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 209] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 210] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 211] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 212] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 213] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 214] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 215] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 216] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 217] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 218] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 219] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 220] = "MetaProperty"; + SyntaxKind[SyntaxKind["SyntheticExpression"] = 221] = "SyntheticExpression"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 221] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 222] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 222] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 223] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 223] = "Block"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 224] = "EmptyStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 225] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 226] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 227] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 228] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 229] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 230] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 231] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 232] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 233] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 234] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 235] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 236] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 237] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 238] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 239] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 240] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 241] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 242] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 243] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 244] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 245] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 246] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 247] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 248] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 249] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 250] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 251] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 252] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 253] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 254] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 255] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 256] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 257] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 258] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 259] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 260] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 261] = "NamedExports"; - SyntaxKind[SyntaxKind["NamespaceExport"] = 262] = "NamespaceExport"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 263] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 264] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 224] = "Block"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 225] = "EmptyStatement"; + SyntaxKind[SyntaxKind["VariableStatement"] = 226] = "VariableStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 227] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 228] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 229] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 230] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 231] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 232] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 233] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 234] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 235] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 236] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 237] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 238] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 239] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 240] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 241] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 242] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 243] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 244] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 245] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 246] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 247] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 248] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 249] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 250] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 251] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 252] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 253] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 254] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 255] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 256] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 257] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 258] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 259] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 260] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 261] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 262] = "NamedExports"; + SyntaxKind[SyntaxKind["NamespaceExport"] = 263] = "NamespaceExport"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 264] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 265] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 265] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 266] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 266] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 267] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 268] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 269] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 270] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 271] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 272] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 273] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 274] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 275] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 276] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 267] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 268] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 269] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 270] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 271] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 272] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 273] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 274] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 275] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 276] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 277] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 277] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 278] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 279] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 280] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 278] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 279] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 280] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 281] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 281] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 282] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 283] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 282] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 283] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 284] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 284] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 285] = "EnumMember"; // Unparsed - SyntaxKind[SyntaxKind["UnparsedPrologue"] = 285] = "UnparsedPrologue"; - SyntaxKind[SyntaxKind["UnparsedPrepend"] = 286] = "UnparsedPrepend"; - SyntaxKind[SyntaxKind["UnparsedText"] = 287] = "UnparsedText"; - SyntaxKind[SyntaxKind["UnparsedInternalText"] = 288] = "UnparsedInternalText"; - SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 289] = "UnparsedSyntheticReference"; + SyntaxKind[SyntaxKind["UnparsedPrologue"] = 286] = "UnparsedPrologue"; + SyntaxKind[SyntaxKind["UnparsedPrepend"] = 287] = "UnparsedPrepend"; + SyntaxKind[SyntaxKind["UnparsedText"] = 288] = "UnparsedText"; + SyntaxKind[SyntaxKind["UnparsedInternalText"] = 289] = "UnparsedInternalText"; + SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 290] = "UnparsedSyntheticReference"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 290] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 291] = "Bundle"; - SyntaxKind[SyntaxKind["UnparsedSource"] = 292] = "UnparsedSource"; - SyntaxKind[SyntaxKind["InputFiles"] = 293] = "InputFiles"; + SyntaxKind[SyntaxKind["SourceFile"] = 291] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 292] = "Bundle"; + SyntaxKind[SyntaxKind["UnparsedSource"] = 293] = "UnparsedSource"; + SyntaxKind[SyntaxKind["InputFiles"] = 294] = "InputFiles"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 294] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 295] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 295] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 296] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 296] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 297] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 298] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 299] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 300] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 301] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 297] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 298] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 299] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 300] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 301] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 302] = "JSDocVariadicType"; // https://jsdoc.app/about-namepaths.html - SyntaxKind[SyntaxKind["JSDocNamepathType"] = 302] = "JSDocNamepathType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 303] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 304] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocSignature"] = 305] = "JSDocSignature"; - SyntaxKind[SyntaxKind["JSDocTag"] = 306] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 307] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 308] = "JSDocImplementsTag"; - SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 309] = "JSDocAuthorTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 310] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocPublicTag"] = 311] = "JSDocPublicTag"; - SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 312] = "JSDocPrivateTag"; - SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 313] = "JSDocProtectedTag"; - SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 314] = "JSDocReadonlyTag"; - SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 315] = "JSDocCallbackTag"; - SyntaxKind[SyntaxKind["JSDocEnumTag"] = 316] = "JSDocEnumTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 317] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 318] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocThisTag"] = 319] = "JSDocThisTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 320] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 321] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 322] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 323] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocNamepathType"] = 303] = "JSDocNamepathType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 304] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 305] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocSignature"] = 306] = "JSDocSignature"; + SyntaxKind[SyntaxKind["JSDocTag"] = 307] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 308] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 309] = "JSDocImplementsTag"; + SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 310] = "JSDocAuthorTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 311] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocPublicTag"] = 312] = "JSDocPublicTag"; + SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 313] = "JSDocPrivateTag"; + SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 314] = "JSDocProtectedTag"; + SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 315] = "JSDocReadonlyTag"; + SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 316] = "JSDocCallbackTag"; + SyntaxKind[SyntaxKind["JSDocEnumTag"] = 317] = "JSDocEnumTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 318] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 319] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocThisTag"] = 320] = "JSDocThisTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 321] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 322] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 323] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 324] = "JSDocPropertyTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 324] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 325] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 325] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 326] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 327] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 328] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 329] = "EndOfDeclarationMarker"; - SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 330] = "SyntheticReferenceExpression"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 326] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 327] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 328] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 329] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 330] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 331] = "SyntheticReferenceExpression"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 331] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 332] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 62] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 74] = "LastAssignment"; @@ -3288,15 +3289,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 77] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 112] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 77] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 152] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 153] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 113] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 121] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 168] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 188] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 169] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 189] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 18] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 74] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 152] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 153] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -3305,15 +3306,15 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 17] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 29] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 74] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstStatement"] = 225] = "FirstStatement"; - SyntaxKind[SyntaxKind["LastStatement"] = 241] = "LastStatement"; - SyntaxKind[SyntaxKind["FirstNode"] = 153] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 294] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 323] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 306] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 323] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstStatement"] = 226] = "FirstStatement"; + SyntaxKind[SyntaxKind["LastStatement"] = 242] = "LastStatement"; + SyntaxKind[SyntaxKind["FirstNode"] = 154] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 295] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 324] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 307] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 324] = "LastJSDocTagNode"; /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 122] = "FirstContextualKeyword"; - /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 152] = "LastContextualKeyword"; + /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 153] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -3469,6 +3470,12 @@ var ts; FlowFlags[FlowFlags["Label"] = 12] = "Label"; FlowFlags[FlowFlags["Condition"] = 96] = "Condition"; })(FlowFlags = ts.FlowFlags || (ts.FlowFlags = {})); + /* @internal */ + var CommentDirectiveType; + (function (CommentDirectiveType) { + CommentDirectiveType[CommentDirectiveType["ExpectError"] = 0] = "ExpectError"; + CommentDirectiveType[CommentDirectiveType["Ignore"] = 1] = "Ignore"; + })(CommentDirectiveType = ts.CommentDirectiveType || (ts.CommentDirectiveType = {})); var OperationCanceledException = /** @class */ (function () { function OperationCanceledException() { } @@ -3853,6 +3860,7 @@ var ts; TypeFlags[TypeFlags["Conditional"] = 16777216] = "Conditional"; TypeFlags[TypeFlags["Substitution"] = 33554432] = "Substitution"; TypeFlags[TypeFlags["NonPrimitive"] = 67108864] = "NonPrimitive"; + TypeFlags[TypeFlags["Awaited"] = 134217728] = "Awaited"; /* @internal */ TypeFlags[TypeFlags["AnyOrUnknown"] = 3] = "AnyOrUnknown"; /* @internal */ @@ -3881,10 +3889,10 @@ var ts; TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType"; TypeFlags[TypeFlags["TypeVariable"] = 8650752] = "TypeVariable"; - TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 58982400] = "InstantiableNonPrimitive"; + TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 193200128] = "InstantiableNonPrimitive"; TypeFlags[TypeFlags["InstantiablePrimitive"] = 4194304] = "InstantiablePrimitive"; - TypeFlags[TypeFlags["Instantiable"] = 63176704] = "Instantiable"; - TypeFlags[TypeFlags["StructuredOrInstantiable"] = 66846720] = "StructuredOrInstantiable"; + TypeFlags[TypeFlags["Instantiable"] = 197394432] = "Instantiable"; + TypeFlags[TypeFlags["StructuredOrInstantiable"] = 201064448] = "StructuredOrInstantiable"; /* @internal */ TypeFlags[TypeFlags["ObjectFlagsType"] = 3899393] = "ObjectFlagsType"; /* @internal */ @@ -3893,10 +3901,10 @@ var ts; TypeFlags[TypeFlags["Substructure"] = 66584576] = "Substructure"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 133970943] = "Narrowable"; + TypeFlags[TypeFlags["Narrowable"] = 268188671] = "Narrowable"; TypeFlags[TypeFlags["NotUnionOrUnit"] = 67637251] = "NotUnionOrUnit"; /* @internal */ - TypeFlags[TypeFlags["NotPrimitiveUnion"] = 66994211] = "NotPrimitiveUnion"; + TypeFlags[TypeFlags["NotPrimitiveUnion"] = 201211939] = "NotPrimitiveUnion"; // The following flags are aggregated during union and intersection type construction /* @internal */ TypeFlags[TypeFlags["IncludesMask"] = 71041023] = "IncludesMask"; @@ -3995,6 +4003,7 @@ var ts; SignatureFlags[SignatureFlags["HasLiteralTypes"] = 2] = "HasLiteralTypes"; SignatureFlags[SignatureFlags["IsInnerCallChain"] = 4] = "IsInnerCallChain"; SignatureFlags[SignatureFlags["IsOuterCallChain"] = 8] = "IsOuterCallChain"; + SignatureFlags[SignatureFlags["IsUntypedSignatureInJSFile"] = 16] = "IsUntypedSignatureInJSFile"; // We do not propagate `IsInnerCallChain` to instantiated signatures, as that would result in us // attempting to add `| undefined` on each recursive call to `getReturnTypeOfSignature` when // instantiating the return type. @@ -4006,6 +4015,15 @@ var ts; IndexKind[IndexKind["String"] = 0] = "String"; IndexKind[IndexKind["Number"] = 1] = "Number"; })(IndexKind = ts.IndexKind || (ts.IndexKind = {})); + /* @internal */ + var TypeMapKind; + (function (TypeMapKind) { + TypeMapKind[TypeMapKind["Simple"] = 0] = "Simple"; + TypeMapKind[TypeMapKind["Array"] = 1] = "Array"; + TypeMapKind[TypeMapKind["Function"] = 2] = "Function"; + TypeMapKind[TypeMapKind["Composite"] = 3] = "Composite"; + TypeMapKind[TypeMapKind["Merged"] = 4] = "Merged"; + })(TypeMapKind = ts.TypeMapKind || (ts.TypeMapKind = {})); var InferencePriority; (function (InferencePriority) { InferencePriority[InferencePriority["NakedTypeVariable"] = 1] = "NakedTypeVariable"; @@ -6599,6 +6617,10 @@ var ts; } } ts.forEachAncestorDirectory = forEachAncestorDirectory; + function isNodeModulesDirectory(dirPath) { + return ts.endsWith(dirPath, "/node_modules"); + } + ts.isNodeModulesDirectory = isNodeModulesDirectory; })(ts || (ts = {})); // // generated from './diagnosticInformationMap.generated.ts' by 'src/compiler' @@ -6909,7 +6931,7 @@ var ts; Cannot_find_name_0: diag(2304, ts.DiagnosticCategory.Error, "Cannot_find_name_0_2304", "Cannot find name '{0}'."), Module_0_has_no_exported_member_1: diag(2305, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_2305", "Module '{0}' has no exported member '{1}'."), File_0_is_not_a_module: diag(2306, ts.DiagnosticCategory.Error, "File_0_is_not_a_module_2306", "File '{0}' is not a module."), - Cannot_find_module_0: diag(2307, ts.DiagnosticCategory.Error, "Cannot_find_module_0_2307", "Cannot find module '{0}'."), + Cannot_find_module_0_or_its_corresponding_type_declarations: diag(2307, ts.DiagnosticCategory.Error, "Cannot_find_module_0_or_its_corresponding_type_declarations_2307", "Cannot find module '{0}' or its corresponding type declarations."), Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: diag(2308, ts.DiagnosticCategory.Error, "Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308", "Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."), An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: diag(2309, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", "An export assignment cannot be used in a module with other exported elements."), Type_0_recursively_references_itself_as_a_base_type: diag(2310, ts.DiagnosticCategory.Error, "Type_0_recursively_references_itself_as_a_base_type_2310", "Type '{0}' recursively references itself as a base type."), @@ -7169,6 +7191,7 @@ var ts; No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments: diag(2575, ts.DiagnosticCategory.Error, "No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575", "No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."), Property_0_is_a_static_member_of_type_1: diag(2576, ts.DiagnosticCategory.Error, "Property_0_is_a_static_member_of_type_1_2576", "Property '{0}' is a static member of type '{1}'"), Return_type_annotation_circularly_references_itself: diag(2577, ts.DiagnosticCategory.Error, "Return_type_annotation_circularly_references_itself_2577", "Return type annotation circularly references itself."), + Unused_ts_expect_error_directive: diag(2578, ts.DiagnosticCategory.Error, "Unused_ts_expect_error_directive_2578", "Unused '@ts-expect-error' directive."), Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`."), Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`."), Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`."), @@ -7297,7 +7320,7 @@ var ts; This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided: diag(2746, ts.DiagnosticCategory.Error, "This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746", "This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."), _0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2: diag(2747, ts.DiagnosticCategory.Error, "_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747", "'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."), Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided: diag(2748, ts.DiagnosticCategory.Error, "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748", "Cannot access ambient const enums when the '--isolatedModules' flag is provided."), - _0_refers_to_a_value_but_is_being_used_as_a_type_here: diag(2749, ts.DiagnosticCategory.Error, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_2749", "'{0}' refers to a value, but is being used as a type here."), + _0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0: diag(2749, ts.DiagnosticCategory.Error, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749", "'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"), The_implementation_signature_is_declared_here: diag(2750, ts.DiagnosticCategory.Error, "The_implementation_signature_is_declared_here_2750", "The implementation signature is declared here."), Circularity_originates_in_type_at_this_location: diag(2751, ts.DiagnosticCategory.Error, "Circularity_originates_in_type_at_this_location_2751", "Circularity originates in type at this location."), The_first_export_default_is_here: diag(2752, ts.DiagnosticCategory.Error, "The_first_export_default_is_here_2752", "The first export default is here."), @@ -7332,6 +7355,7 @@ var ts; The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access: diag(2781, ts.DiagnosticCategory.Error, "The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781", "The left-hand side of a 'for...of' statement may not be an optional property access."), _0_needs_an_explicit_type_annotation: diag(2782, ts.DiagnosticCategory.Message, "_0_needs_an_explicit_type_annotation_2782", "'{0}' needs an explicit type annotation."), _0_is_specified_more_than_once_so_this_usage_will_be_overwritten: diag(2783, ts.DiagnosticCategory.Error, "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783", "'{0}' is specified more than once, so this usage will be overwritten."), + get_and_set_accessors_cannot_declare_this_parameters: diag(2784, ts.DiagnosticCategory.Error, "get_and_set_accessors_cannot_declare_this_parameters_2784", "'get' and 'set' accessors cannot declare 'this' parameters."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -7466,6 +7490,7 @@ var ts; Unknown_watch_option_0_Did_you_mean_1: diag(5079, ts.DiagnosticCategory.Error, "Unknown_watch_option_0_Did_you_mean_1_5079", "Unknown watch option '{0}'. Did you mean '{1}'?"), Watch_option_0_requires_a_value_of_type_1: diag(5080, ts.DiagnosticCategory.Error, "Watch_option_0_requires_a_value_of_type_1_5080", "Watch option '{0}' requires a value of type {1}."), Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0: diag(5081, ts.DiagnosticCategory.Error, "Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081", "Cannot find a tsconfig.json file at the current directory: {0}."), + _0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1: diag(5082, ts.DiagnosticCategory.Error, "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082", "'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6000, ts.DiagnosticCategory.Message, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, ts.DiagnosticCategory.Message, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, ts.DiagnosticCategory.Message, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -7878,6 +7903,7 @@ var ts; Import_default_0_from_module_1: diag(90032, ts.DiagnosticCategory.Message, "Import_default_0_from_module_1_90032", "Import default '{0}' from module \"{1}\""), Add_default_import_0_to_existing_import_declaration_from_1: diag(90033, ts.DiagnosticCategory.Message, "Add_default_import_0_to_existing_import_declaration_from_1_90033", "Add default import '{0}' to existing import declaration from \"{1}\""), Add_parameter_name: diag(90034, ts.DiagnosticCategory.Message, "Add_parameter_name_90034", "Add parameter name"), + Declare_private_property_0: diag(90035, ts.DiagnosticCategory.Message, "Declare_private_property_0_90035", "Declare private property '{0}'"), Declare_a_private_field_named_0: diag(90053, ts.DiagnosticCategory.Message, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), @@ -7943,6 +7969,8 @@ var ts; Add_all_missing_imports: diag(95064, ts.DiagnosticCategory.Message, "Add_all_missing_imports_95064", "Add all missing imports"), Convert_to_async_function: diag(95065, ts.DiagnosticCategory.Message, "Convert_to_async_function_95065", "Convert to async function"), Convert_all_to_async_functions: diag(95066, ts.DiagnosticCategory.Message, "Convert_all_to_async_functions_95066", "Convert all to async functions"), + Add_missing_call_parentheses: diag(95067, ts.DiagnosticCategory.Message, "Add_missing_call_parentheses_95067", "Add missing call parentheses"), + Add_all_missing_call_parentheses: diag(95068, ts.DiagnosticCategory.Message, "Add_all_missing_call_parentheses_95068", "Add all missing call parentheses"), Add_unknown_conversion_for_non_overlapping_types: diag(95069, ts.DiagnosticCategory.Message, "Add_unknown_conversion_for_non_overlapping_types_95069", "Add 'unknown' conversion for non-overlapping types"), Add_unknown_to_all_conversions_of_non_overlapping_types: diag(95070, ts.DiagnosticCategory.Message, "Add_unknown_to_all_conversions_of_non_overlapping_types_95070", "Add 'unknown' to all conversions of non-overlapping types"), Add_missing_new_operator_to_call: diag(95071, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_call_95071", "Add missing 'new' operator to call"), @@ -8018,8 +8046,8 @@ var ts; any: 125 /* AnyKeyword */, as: 123 /* AsKeyword */, asserts: 124 /* AssertsKeyword */, - bigint: 151 /* BigIntKeyword */, - boolean: 128 /* BooleanKeyword */, + bigint: 152 /* BigIntKeyword */, + boolean: 129 /* BooleanKeyword */, break: 77 /* BreakKeyword */, case: 78 /* CaseKeyword */, catch: 79 /* CatchKeyword */, @@ -8027,9 +8055,9 @@ var ts; continue: 82 /* ContinueKeyword */, const: 81 /* ConstKeyword */ }, - _a["" + "constructor"] = 129 /* ConstructorKeyword */, + _a["" + "constructor"] = 130 /* ConstructorKeyword */, _a.debugger = 83 /* DebuggerKeyword */, - _a.declare = 130 /* DeclareKeyword */, + _a.declare = 131 /* DeclareKeyword */, _a.default = 84 /* DefaultKeyword */, _a.delete = 85 /* DeleteKeyword */, _a.do = 86 /* DoKeyword */, @@ -8040,49 +8068,49 @@ var ts; _a.false = 91 /* FalseKeyword */, _a.finally = 92 /* FinallyKeyword */, _a.for = 93 /* ForKeyword */, - _a.from = 149 /* FromKeyword */, + _a.from = 150 /* FromKeyword */, _a.function = 94 /* FunctionKeyword */, - _a.get = 131 /* GetKeyword */, + _a.get = 132 /* GetKeyword */, _a.if = 95 /* IfKeyword */, _a.implements = 113 /* ImplementsKeyword */, _a.import = 96 /* ImportKeyword */, _a.in = 97 /* InKeyword */, - _a.infer = 132 /* InferKeyword */, + _a.infer = 133 /* InferKeyword */, _a.instanceof = 98 /* InstanceOfKeyword */, _a.interface = 114 /* InterfaceKeyword */, - _a.is = 133 /* IsKeyword */, - _a.keyof = 134 /* KeyOfKeyword */, + _a.is = 134 /* IsKeyword */, + _a.keyof = 135 /* KeyOfKeyword */, _a.let = 115 /* LetKeyword */, - _a.module = 135 /* ModuleKeyword */, - _a.namespace = 136 /* NamespaceKeyword */, - _a.never = 137 /* NeverKeyword */, + _a.module = 136 /* ModuleKeyword */, + _a.namespace = 137 /* NamespaceKeyword */, + _a.never = 138 /* NeverKeyword */, _a.new = 99 /* NewKeyword */, _a.null = 100 /* NullKeyword */, - _a.number = 140 /* NumberKeyword */, - _a.object = 141 /* ObjectKeyword */, + _a.number = 141 /* NumberKeyword */, + _a.object = 142 /* ObjectKeyword */, _a.package = 116 /* PackageKeyword */, _a.private = 117 /* PrivateKeyword */, _a.protected = 118 /* ProtectedKeyword */, _a.public = 119 /* PublicKeyword */, - _a.readonly = 138 /* ReadonlyKeyword */, - _a.require = 139 /* RequireKeyword */, - _a.global = 150 /* GlobalKeyword */, + _a.readonly = 139 /* ReadonlyKeyword */, + _a.require = 140 /* RequireKeyword */, + _a.global = 151 /* GlobalKeyword */, _a.return = 101 /* ReturnKeyword */, - _a.set = 142 /* SetKeyword */, + _a.set = 143 /* SetKeyword */, _a.static = 120 /* StaticKeyword */, - _a.string = 143 /* StringKeyword */, + _a.string = 144 /* StringKeyword */, _a.super = 102 /* SuperKeyword */, _a.switch = 103 /* SwitchKeyword */, - _a.symbol = 144 /* SymbolKeyword */, + _a.symbol = 145 /* SymbolKeyword */, _a.this = 104 /* ThisKeyword */, _a.throw = 105 /* ThrowKeyword */, _a.true = 106 /* TrueKeyword */, _a.try = 107 /* TryKeyword */, - _a.type = 145 /* TypeKeyword */, + _a.type = 146 /* TypeKeyword */, _a.typeof = 108 /* TypeOfKeyword */, - _a.undefined = 146 /* UndefinedKeyword */, - _a.unique = 147 /* UniqueKeyword */, - _a.unknown = 148 /* UnknownKeyword */, + _a.undefined = 147 /* UndefinedKeyword */, + _a.unique = 148 /* UniqueKeyword */, + _a.unknown = 149 /* UnknownKeyword */, _a.var = 109 /* VarKeyword */, _a.void = 110 /* VoidKeyword */, _a.while = 111 /* WhileKeyword */, @@ -8090,7 +8118,8 @@ var ts; _a.yield = 121 /* YieldKeyword */, _a.async = 126 /* AsyncKeyword */, _a.await = 127 /* AwaitKeyword */, - _a.of = 152 /* OfKeyword */, + _a.awaited = 128 /* AwaitedKeyword */, + _a.of = 153 /* OfKeyword */, _a); var textToKeyword = ts.createMapFromTemplate(textToKeywordObj); var textToToken = ts.createMapFromTemplate(__assign(__assign({}, textToKeywordObj), { "{": 18 /* OpenBraceToken */, "}": 19 /* CloseBraceToken */, "(": 20 /* OpenParenToken */, ")": 21 /* CloseParenToken */, "[": 22 /* OpenBracketToken */, "]": 23 /* CloseBracketToken */, ".": 24 /* DotToken */, "...": 25 /* DotDotDotToken */, ";": 26 /* SemicolonToken */, ",": 27 /* CommaToken */, "<": 29 /* LessThanToken */, ">": 31 /* GreaterThanToken */, "<=": 32 /* LessThanEqualsToken */, ">=": 33 /* GreaterThanEqualsToken */, "==": 34 /* EqualsEqualsToken */, "!=": 35 /* ExclamationEqualsToken */, "===": 36 /* EqualsEqualsEqualsToken */, "!==": 37 /* ExclamationEqualsEqualsToken */, "=>": 38 /* EqualsGreaterThanToken */, "+": 39 /* PlusToken */, "-": 40 /* MinusToken */, "**": 42 /* AsteriskAsteriskToken */, "*": 41 /* AsteriskToken */, "/": 43 /* SlashToken */, "%": 44 /* PercentToken */, "++": 45 /* PlusPlusToken */, "--": 46 /* MinusMinusToken */, "<<": 47 /* LessThanLessThanToken */, ">": 48 /* GreaterThanGreaterThanToken */, ">>>": 49 /* GreaterThanGreaterThanGreaterThanToken */, "&": 50 /* AmpersandToken */, "|": 51 /* BarToken */, "^": 52 /* CaretToken */, "!": 53 /* ExclamationToken */, "~": 54 /* TildeToken */, "&&": 55 /* AmpersandAmpersandToken */, "||": 56 /* BarBarToken */, "?": 57 /* QuestionToken */, "??": 60 /* QuestionQuestionToken */, "?.": 28 /* QuestionDotToken */, ":": 58 /* ColonToken */, "=": 62 /* EqualsToken */, "+=": 63 /* PlusEqualsToken */, "-=": 64 /* MinusEqualsToken */, "*=": 65 /* AsteriskEqualsToken */, "**=": 66 /* AsteriskAsteriskEqualsToken */, "/=": 67 /* SlashEqualsToken */, "%=": 68 /* PercentEqualsToken */, "<<=": 69 /* LessThanLessThanEqualsToken */, ">>=": 70 /* GreaterThanGreaterThanEqualsToken */, ">>>=": 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */, "&=": 72 /* AmpersandEqualsToken */, "|=": 73 /* BarEqualsToken */, "^=": 74 /* CaretEqualsToken */, "@": 59 /* AtToken */, "`": 61 /* BacktickToken */ })); @@ -8148,6 +8177,10 @@ var ts; */ var unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 895, 895, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1488, 1514, 1519, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2144, 2154, 2208, 2228, 2230, 2237, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2432, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2556, 2556, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2809, 2809, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3133, 3160, 3162, 3168, 3169, 3200, 3200, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3412, 3414, 3423, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6264, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6430, 6480, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7401, 7404, 7406, 7411, 7413, 7414, 7418, 7418, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12443, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42653, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43261, 43262, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43488, 43492, 43494, 43503, 43514, 43518, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43646, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66335, 66349, 66378, 66384, 66421, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68096, 68112, 68115, 68117, 68119, 68121, 68149, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68324, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68899, 69376, 69404, 69415, 69415, 69424, 69445, 69600, 69622, 69635, 69687, 69763, 69807, 69840, 69864, 69891, 69926, 69956, 69956, 69968, 70002, 70006, 70006, 70019, 70066, 70081, 70084, 70106, 70106, 70108, 70108, 70144, 70161, 70163, 70187, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70366, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70461, 70461, 70480, 70480, 70493, 70497, 70656, 70708, 70727, 70730, 70751, 70751, 70784, 70831, 70852, 70853, 70855, 70855, 71040, 71086, 71128, 71131, 71168, 71215, 71236, 71236, 71296, 71338, 71352, 71352, 71424, 71450, 71680, 71723, 71840, 71903, 71935, 71935, 72096, 72103, 72106, 72144, 72161, 72161, 72163, 72163, 72192, 72192, 72203, 72242, 72250, 72250, 72272, 72272, 72284, 72329, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72750, 72768, 72768, 72818, 72847, 72960, 72966, 72968, 72969, 72971, 73008, 73030, 73030, 73056, 73061, 73063, 73064, 73066, 73097, 73112, 73112, 73440, 73458, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92880, 92909, 92928, 92975, 92992, 92995, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94032, 94032, 94099, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 123136, 123180, 123191, 123197, 123214, 123214, 123584, 123627, 124928, 125124, 125184, 125251, 125259, 125259, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101]; var unicodeESNextIdentifierPart = [48, 57, 65, 90, 95, 95, 97, 122, 170, 170, 181, 181, 183, 183, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 895, 895, 902, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1519, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2045, 2045, 2048, 2093, 2112, 2139, 2144, 2154, 2208, 2228, 2230, 2237, 2259, 2273, 2275, 2403, 2406, 2415, 2417, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2556, 2556, 2558, 2558, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2809, 2815, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3072, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3168, 3171, 3174, 3183, 3200, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3328, 3331, 3333, 3340, 3342, 3344, 3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3558, 3567, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4969, 4977, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6264, 6272, 6314, 6320, 6389, 6400, 6430, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6832, 6845, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418, 7424, 7673, 7675, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42737, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43047, 43072, 43123, 43136, 43205, 43216, 43225, 43232, 43255, 43259, 43259, 43261, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43488, 43518, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65071, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66045, 66045, 66176, 66204, 66208, 66256, 66272, 66272, 66304, 66335, 66349, 66378, 66384, 66426, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68099, 68101, 68102, 68108, 68115, 68117, 68119, 68121, 68149, 68152, 68154, 68159, 68159, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68326, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68903, 68912, 68921, 69376, 69404, 69415, 69415, 69424, 69456, 69600, 69622, 69632, 69702, 69734, 69743, 69759, 69818, 69840, 69864, 69872, 69881, 69888, 69940, 69942, 69951, 69956, 69958, 69968, 70003, 70006, 70006, 70016, 70084, 70089, 70092, 70096, 70106, 70108, 70108, 70144, 70161, 70163, 70199, 70206, 70206, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70378, 70384, 70393, 70400, 70403, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70459, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70730, 70736, 70745, 70750, 70751, 70784, 70853, 70855, 70855, 70864, 70873, 71040, 71093, 71096, 71104, 71128, 71133, 71168, 71232, 71236, 71236, 71248, 71257, 71296, 71352, 71360, 71369, 71424, 71450, 71453, 71467, 71472, 71481, 71680, 71738, 71840, 71913, 71935, 71935, 72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263, 72263, 72272, 72345, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72758, 72760, 72768, 72784, 72793, 72818, 72847, 72850, 72871, 72873, 72886, 72960, 72966, 72968, 72969, 72971, 73014, 73018, 73018, 73020, 73021, 73023, 73031, 73040, 73049, 73056, 73061, 73063, 73064, 73066, 73102, 73104, 73105, 73107, 73112, 73120, 73129, 73440, 73462, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 92880, 92909, 92912, 92916, 92928, 92982, 92992, 92995, 93008, 93017, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94031, 94087, 94095, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113821, 113822, 119141, 119145, 119149, 119154, 119163, 119170, 119173, 119179, 119210, 119213, 119362, 119364, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 120782, 120831, 121344, 121398, 121403, 121452, 121461, 121461, 121476, 121476, 121499, 121503, 121505, 121519, 122880, 122886, 122888, 122904, 122907, 122913, 122915, 122916, 122918, 122922, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123214, 123584, 123641, 124928, 125124, 125136, 125142, 125184, 125259, 125264, 125273, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 917760, 917999]; + /** + * Test for whether a comment's text contains a `@ts-expect-error` or `@ts-ignore` directive. + */ + var commentDirectiveRegEx = /^\s*\/\/\/?\s*@(ts-expect-error|ts-ignore)/; function lookupInUnicodeMap(code, map) { // Bail out quickly if it couldn't possibly be in the map. if (code < map[0]) { @@ -8714,6 +8747,7 @@ var ts; var token; var tokenValue; var tokenFlags; + var commentDirectives; var inJSDocType = 0; setText(text, start, length); var scanner = { @@ -8729,6 +8763,7 @@ var ts; isIdentifier: function () { return token === 75 /* Identifier */ || token > 112 /* LastReservedWord */; }, isReservedWord: function () { return token >= 77 /* FirstReservedWord */ && token <= 112 /* LastReservedWord */; }, isUnterminated: function () { return (tokenFlags & 4 /* Unterminated */) !== 0; }, + getCommentDirectives: function () { return commentDirectives; }, getTokenFlags: function () { return tokenFlags; }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, @@ -8744,6 +8779,7 @@ var ts; scanJsDocToken: scanJsDocToken, scan: scan, getText: getText, + clearCommentDirectives: clearCommentDirectives, setText: setText, setScriptTarget: setScriptTarget, setLanguageVariant: setLanguageVariant, @@ -9473,6 +9509,13 @@ var ts; } pos++; } + var type = getDirectiveFromComment(text.slice(tokenPos, pos)); + if (type !== undefined) { + commentDirectives = ts.append(commentDirectives, { + range: { pos: tokenPos, end: pos }, + type: type, + }); + } if (skipTrivia) { continue; } @@ -9827,6 +9870,19 @@ var ts; } return token; } + function getDirectiveFromComment(text) { + var match = commentDirectiveRegEx.exec(text); + if (!match) { + return undefined; + } + switch (match[1]) { + case "ts-expect-error": + return 0 /* ExpectError */; + case "ts-ignore": + return 1 /* Ignore */; + } + return undefined; + } /** * Unconditionally back up and scan a template expression portion. */ @@ -10066,6 +10122,7 @@ var ts; var saveToken = token; var saveTokenValue = tokenValue; var saveTokenFlags = tokenFlags; + var saveErrorExpectations = commentDirectives; setText(text, start, length); var result = callback(); end = saveEnd; @@ -10075,6 +10132,7 @@ var ts; token = saveToken; tokenValue = saveTokenValue; tokenFlags = saveTokenFlags; + commentDirectives = saveErrorExpectations; return result; } function lookAhead(callback) { @@ -10086,6 +10144,9 @@ var ts; function getText() { return text; } + function clearCommentDirectives() { + commentDirectives = undefined; + } function setText(newText, start, length) { text = newText || ""; end = length === undefined ? text.length : start + length; @@ -10393,9 +10454,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 155 /* TypeParameter */) { + if (d && d.kind === 156 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 246 /* InterfaceDeclaration */) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 247 /* InterfaceDeclaration */) { return current; } } @@ -10403,7 +10464,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node, parent) { - return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 162 /* Constructor */; + return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 163 /* Constructor */; } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -10433,14 +10494,14 @@ var ts; node = walkUpBindingElementsAndPatterns(node); } var flags = getFlags(node); - if (node.kind === 242 /* VariableDeclaration */) { + if (node.kind === 243 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 243 /* VariableDeclarationList */) { + if (node && node.kind === 244 /* VariableDeclarationList */) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 225 /* VariableStatement */) { + if (node && node.kind === 226 /* VariableStatement */) { flags |= getFlags(node); } return flags; @@ -10589,30 +10650,30 @@ var ts; } // Covers remaining cases (returning undefined if none match). switch (hostNode.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: var expr = hostNode.expression; - if (expr.kind === 209 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { + if (expr.kind === 210 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { expr = expr.left; } switch (expr.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return expr.name; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: var arg = expr.argumentExpression; if (isIdentifier(arg)) { return arg; } } break; - case 200 /* ParenthesizedExpression */: { + case 201 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 238 /* LabeledStatement */: { + case 239 /* LabeledStatement */: { if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -10649,16 +10710,16 @@ var ts; switch (declaration.kind) { case 75 /* Identifier */: return declaration; - case 323 /* JSDocPropertyTag */: - case 317 /* JSDocParameterTag */: { + case 324 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: { var name = declaration.name; - if (name.kind === 153 /* QualifiedName */) { + if (name.kind === 154 /* QualifiedName */) { return name.right; } break; } - case 196 /* CallExpression */: - case 209 /* BinaryExpression */: { + case 197 /* CallExpression */: + case 210 /* BinaryExpression */: { var expr_1 = declaration; switch (ts.getAssignmentDeclarationKind(expr_1)) { case 1 /* ExportsProperty */: @@ -10674,15 +10735,15 @@ var ts; return undefined; } } - case 322 /* JSDocTypedefTag */: + case 323 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 316 /* JSDocEnumTag */: + case 317 /* JSDocEnumTag */: return nameForNamelessJSDocTypedef(declaration); - case 259 /* ExportAssignment */: { + case 260 /* ExportAssignment */: { var expression = declaration.expression; return isIdentifier(expression) ? expression : undefined; } - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: var expr = declaration; if (ts.isBindableStaticElementAccessExpression(expr)) { return expr.argumentExpression; @@ -10918,7 +10979,7 @@ var ts; return ts.emptyArray; } if (ts.isJSDocTypeAlias(node)) { - ts.Debug.assert(node.parent.kind === 303 /* JSDocComment */); + ts.Debug.assert(node.parent.kind === 304 /* JSDocComment */); return ts.flatMap(node.parent.tags, function (tag) { return isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; }); } if (node.typeParameters) { @@ -10989,11 +11050,11 @@ var ts; ts.isIdentifier = isIdentifier; // Names function isQualifiedName(node) { - return node.kind === 153 /* QualifiedName */; + return node.kind === 154 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 154 /* ComputedPropertyName */; + return node.kind === 155 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; function isPrivateIdentifier(node) { @@ -11006,164 +11067,164 @@ var ts; ts.isIdentifierOrPrivateIdentifier = isIdentifierOrPrivateIdentifier; // Signature elements function isTypeParameterDeclaration(node) { - return node.kind === 155 /* TypeParameter */; + return node.kind === 156 /* TypeParameter */; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 156 /* Parameter */; + return node.kind === 157 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 157 /* Decorator */; + return node.kind === 158 /* Decorator */; } ts.isDecorator = isDecorator; // TypeMember function isPropertySignature(node) { - return node.kind === 158 /* PropertySignature */; + return node.kind === 159 /* PropertySignature */; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 159 /* PropertyDeclaration */; + return node.kind === 160 /* PropertyDeclaration */; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 160 /* MethodSignature */; + return node.kind === 161 /* MethodSignature */; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 161 /* MethodDeclaration */; + return node.kind === 162 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 162 /* Constructor */; + return node.kind === 163 /* Constructor */; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 163 /* GetAccessor */; + return node.kind === 164 /* GetAccessor */; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 164 /* SetAccessor */; + return node.kind === 165 /* SetAccessor */; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 165 /* CallSignature */; + return node.kind === 166 /* CallSignature */; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 166 /* ConstructSignature */; + return node.kind === 167 /* ConstructSignature */; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 167 /* IndexSignature */; + return node.kind === 168 /* IndexSignature */; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; /* @internal */ function isGetOrSetAccessorDeclaration(node) { - return node.kind === 164 /* SetAccessor */ || node.kind === 163 /* GetAccessor */; + return node.kind === 165 /* SetAccessor */ || node.kind === 164 /* GetAccessor */; } ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration; // Type function isTypePredicateNode(node) { - return node.kind === 168 /* TypePredicate */; + return node.kind === 169 /* TypePredicate */; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 169 /* TypeReference */; + return node.kind === 170 /* TypeReference */; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 170 /* FunctionType */; + return node.kind === 171 /* FunctionType */; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 171 /* ConstructorType */; + return node.kind === 172 /* ConstructorType */; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 172 /* TypeQuery */; + return node.kind === 173 /* TypeQuery */; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 173 /* TypeLiteral */; + return node.kind === 174 /* TypeLiteral */; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 174 /* ArrayType */; + return node.kind === 175 /* ArrayType */; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 175 /* TupleType */; + return node.kind === 176 /* TupleType */; } ts.isTupleTypeNode = isTupleTypeNode; function isUnionTypeNode(node) { - return node.kind === 178 /* UnionType */; + return node.kind === 179 /* UnionType */; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 179 /* IntersectionType */; + return node.kind === 180 /* IntersectionType */; } ts.isIntersectionTypeNode = isIntersectionTypeNode; function isConditionalTypeNode(node) { - return node.kind === 180 /* ConditionalType */; + return node.kind === 181 /* ConditionalType */; } ts.isConditionalTypeNode = isConditionalTypeNode; function isInferTypeNode(node) { - return node.kind === 181 /* InferType */; + return node.kind === 182 /* InferType */; } ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 182 /* ParenthesizedType */; + return node.kind === 183 /* ParenthesizedType */; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 183 /* ThisType */; + return node.kind === 184 /* ThisType */; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 184 /* TypeOperator */; + return node.kind === 185 /* TypeOperator */; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 185 /* IndexedAccessType */; + return node.kind === 186 /* IndexedAccessType */; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 186 /* MappedType */; + return node.kind === 187 /* MappedType */; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 187 /* LiteralType */; + return node.kind === 188 /* LiteralType */; } ts.isLiteralTypeNode = isLiteralTypeNode; function isImportTypeNode(node) { - return node.kind === 188 /* ImportType */; + return node.kind === 189 /* ImportType */; } ts.isImportTypeNode = isImportTypeNode; // Binding patterns function isObjectBindingPattern(node) { - return node.kind === 189 /* ObjectBindingPattern */; + return node.kind === 190 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 190 /* ArrayBindingPattern */; + return node.kind === 191 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 191 /* BindingElement */; + return node.kind === 192 /* BindingElement */; } ts.isBindingElement = isBindingElement; // Expression function isArrayLiteralExpression(node) { - return node.kind === 192 /* ArrayLiteralExpression */; + return node.kind === 193 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 193 /* ObjectLiteralExpression */; + return node.kind === 194 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 194 /* PropertyAccessExpression */; + return node.kind === 195 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isPropertyAccessChain(node) { @@ -11171,7 +11232,7 @@ var ts; } ts.isPropertyAccessChain = isPropertyAccessChain; function isElementAccessExpression(node) { - return node.kind === 195 /* ElementAccessExpression */; + return node.kind === 196 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isElementAccessChain(node) { @@ -11179,7 +11240,7 @@ var ts; } ts.isElementAccessChain = isElementAccessChain; function isCallExpression(node) { - return node.kind === 196 /* CallExpression */; + return node.kind === 197 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isCallChain(node) { @@ -11189,9 +11250,9 @@ var ts; function isOptionalChain(node) { var kind = node.kind; return !!(node.flags & 32 /* OptionalChain */) && - (kind === 194 /* PropertyAccessExpression */ - || kind === 195 /* ElementAccessExpression */ - || kind === 196 /* CallExpression */); + (kind === 195 /* PropertyAccessExpression */ + || kind === 196 /* ElementAccessExpression */ + || kind === 197 /* CallExpression */); } ts.isOptionalChain = isOptionalChain; /* @internal */ @@ -11225,19 +11286,19 @@ var ts; } ts.isOutermostOptionalChain = isOutermostOptionalChain; function isNullishCoalesce(node) { - return node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; + return node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; } ts.isNullishCoalesce = isNullishCoalesce; function isNewExpression(node) { - return node.kind === 197 /* NewExpression */; + return node.kind === 198 /* NewExpression */; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 198 /* TaggedTemplateExpression */; + return node.kind === 199 /* TaggedTemplateExpression */; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertion(node) { - return node.kind === 199 /* TypeAssertionExpression */; + return node.kind === 200 /* TypeAssertionExpression */; } ts.isTypeAssertion = isTypeAssertion; function isConstTypeReference(node) { @@ -11246,384 +11307,384 @@ var ts; } ts.isConstTypeReference = isConstTypeReference; function isParenthesizedExpression(node) { - return node.kind === 200 /* ParenthesizedExpression */; + return node.kind === 201 /* ParenthesizedExpression */; } ts.isParenthesizedExpression = isParenthesizedExpression; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 326 /* PartiallyEmittedExpression */) { + while (node.kind === 327 /* PartiallyEmittedExpression */) { node = node.expression; } return node; } ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; function isFunctionExpression(node) { - return node.kind === 201 /* FunctionExpression */; + return node.kind === 202 /* FunctionExpression */; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 202 /* ArrowFunction */; + return node.kind === 203 /* ArrowFunction */; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 203 /* DeleteExpression */; + return node.kind === 204 /* DeleteExpression */; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 204 /* TypeOfExpression */; + return node.kind === 205 /* TypeOfExpression */; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 205 /* VoidExpression */; + return node.kind === 206 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 206 /* AwaitExpression */; + return node.kind === 207 /* AwaitExpression */; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 207 /* PrefixUnaryExpression */; + return node.kind === 208 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 208 /* PostfixUnaryExpression */; + return node.kind === 209 /* PostfixUnaryExpression */; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 209 /* BinaryExpression */; + return node.kind === 210 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 210 /* ConditionalExpression */; + return node.kind === 211 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 211 /* TemplateExpression */; + return node.kind === 212 /* TemplateExpression */; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 212 /* YieldExpression */; + return node.kind === 213 /* YieldExpression */; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 213 /* SpreadElement */; + return node.kind === 214 /* SpreadElement */; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 214 /* ClassExpression */; + return node.kind === 215 /* ClassExpression */; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 215 /* OmittedExpression */; + return node.kind === 216 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 216 /* ExpressionWithTypeArguments */; + return node.kind === 217 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 217 /* AsExpression */; + return node.kind === 218 /* AsExpression */; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 218 /* NonNullExpression */; + return node.kind === 219 /* NonNullExpression */; } ts.isNonNullExpression = isNonNullExpression; function isMetaProperty(node) { - return node.kind === 219 /* MetaProperty */; + return node.kind === 220 /* MetaProperty */; } ts.isMetaProperty = isMetaProperty; // Misc function isTemplateSpan(node) { - return node.kind === 221 /* TemplateSpan */; + return node.kind === 222 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 222 /* SemicolonClassElement */; + return node.kind === 223 /* SemicolonClassElement */; } ts.isSemicolonClassElement = isSemicolonClassElement; // Block function isBlock(node) { - return node.kind === 223 /* Block */; + return node.kind === 224 /* Block */; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 225 /* VariableStatement */; + return node.kind === 226 /* VariableStatement */; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 224 /* EmptyStatement */; + return node.kind === 225 /* EmptyStatement */; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 226 /* ExpressionStatement */; + return node.kind === 227 /* ExpressionStatement */; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 227 /* IfStatement */; + return node.kind === 228 /* IfStatement */; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 228 /* DoStatement */; + return node.kind === 229 /* DoStatement */; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 229 /* WhileStatement */; + return node.kind === 230 /* WhileStatement */; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 230 /* ForStatement */; + return node.kind === 231 /* ForStatement */; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 231 /* ForInStatement */; + return node.kind === 232 /* ForInStatement */; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 232 /* ForOfStatement */; + return node.kind === 233 /* ForOfStatement */; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 233 /* ContinueStatement */; + return node.kind === 234 /* ContinueStatement */; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 234 /* BreakStatement */; + return node.kind === 235 /* BreakStatement */; } ts.isBreakStatement = isBreakStatement; function isBreakOrContinueStatement(node) { - return node.kind === 234 /* BreakStatement */ || node.kind === 233 /* ContinueStatement */; + return node.kind === 235 /* BreakStatement */ || node.kind === 234 /* ContinueStatement */; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isReturnStatement(node) { - return node.kind === 235 /* ReturnStatement */; + return node.kind === 236 /* ReturnStatement */; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 236 /* WithStatement */; + return node.kind === 237 /* WithStatement */; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 237 /* SwitchStatement */; + return node.kind === 238 /* SwitchStatement */; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 238 /* LabeledStatement */; + return node.kind === 239 /* LabeledStatement */; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 239 /* ThrowStatement */; + return node.kind === 240 /* ThrowStatement */; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 240 /* TryStatement */; + return node.kind === 241 /* TryStatement */; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 241 /* DebuggerStatement */; + return node.kind === 242 /* DebuggerStatement */; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 242 /* VariableDeclaration */; + return node.kind === 243 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 243 /* VariableDeclarationList */; + return node.kind === 244 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 244 /* FunctionDeclaration */; + return node.kind === 245 /* FunctionDeclaration */; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 245 /* ClassDeclaration */; + return node.kind === 246 /* ClassDeclaration */; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 246 /* InterfaceDeclaration */; + return node.kind === 247 /* InterfaceDeclaration */; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 247 /* TypeAliasDeclaration */; + return node.kind === 248 /* TypeAliasDeclaration */; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 248 /* EnumDeclaration */; + return node.kind === 249 /* EnumDeclaration */; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 249 /* ModuleDeclaration */; + return node.kind === 250 /* ModuleDeclaration */; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 250 /* ModuleBlock */; + return node.kind === 251 /* ModuleBlock */; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 251 /* CaseBlock */; + return node.kind === 252 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 252 /* NamespaceExportDeclaration */; + return node.kind === 253 /* NamespaceExportDeclaration */; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */; + return node.kind === 254 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 254 /* ImportDeclaration */; + return node.kind === 255 /* ImportDeclaration */; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 255 /* ImportClause */; + return node.kind === 256 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 256 /* NamespaceImport */; + return node.kind === 257 /* NamespaceImport */; } ts.isNamespaceImport = isNamespaceImport; function isNamespaceExport(node) { - return node.kind === 262 /* NamespaceExport */; + return node.kind === 263 /* NamespaceExport */; } ts.isNamespaceExport = isNamespaceExport; function isNamedExportBindings(node) { - return node.kind === 262 /* NamespaceExport */ || node.kind === 261 /* NamedExports */; + return node.kind === 263 /* NamespaceExport */ || node.kind === 262 /* NamedExports */; } ts.isNamedExportBindings = isNamedExportBindings; function isNamedImports(node) { - return node.kind === 257 /* NamedImports */; + return node.kind === 258 /* NamedImports */; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 258 /* ImportSpecifier */; + return node.kind === 259 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 259 /* ExportAssignment */; + return node.kind === 260 /* ExportAssignment */; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 260 /* ExportDeclaration */; + return node.kind === 261 /* ExportDeclaration */; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 261 /* NamedExports */; + return node.kind === 262 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 263 /* ExportSpecifier */; + return node.kind === 264 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 264 /* MissingDeclaration */; + return node.kind === 265 /* MissingDeclaration */; } ts.isMissingDeclaration = isMissingDeclaration; // Module References function isExternalModuleReference(node) { - return node.kind === 265 /* ExternalModuleReference */; + return node.kind === 266 /* ExternalModuleReference */; } ts.isExternalModuleReference = isExternalModuleReference; // JSX function isJsxElement(node) { - return node.kind === 266 /* JsxElement */; + return node.kind === 267 /* JsxElement */; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 267 /* JsxSelfClosingElement */; + return node.kind === 268 /* JsxSelfClosingElement */; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 268 /* JsxOpeningElement */; + return node.kind === 269 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 269 /* JsxClosingElement */; + return node.kind === 270 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 270 /* JsxFragment */; + return node.kind === 271 /* JsxFragment */; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 271 /* JsxOpeningFragment */; + return node.kind === 272 /* JsxOpeningFragment */; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 272 /* JsxClosingFragment */; + return node.kind === 273 /* JsxClosingFragment */; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 273 /* JsxAttribute */; + return node.kind === 274 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 274 /* JsxAttributes */; + return node.kind === 275 /* JsxAttributes */; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 275 /* JsxSpreadAttribute */; + return node.kind === 276 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 276 /* JsxExpression */; + return node.kind === 277 /* JsxExpression */; } ts.isJsxExpression = isJsxExpression; // Clauses function isCaseClause(node) { - return node.kind === 277 /* CaseClause */; + return node.kind === 278 /* CaseClause */; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 278 /* DefaultClause */; + return node.kind === 279 /* DefaultClause */; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 279 /* HeritageClause */; + return node.kind === 280 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 280 /* CatchClause */; + return node.kind === 281 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 281 /* PropertyAssignment */; + return node.kind === 282 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 282 /* ShorthandPropertyAssignment */; + return node.kind === 283 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 283 /* SpreadAssignment */; + return node.kind === 284 /* SpreadAssignment */; } ts.isSpreadAssignment = isSpreadAssignment; // Enum function isEnumMember(node) { - return node.kind === 284 /* EnumMember */; + return node.kind === 285 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Top-level nodes function isSourceFile(node) { - return node.kind === 290 /* SourceFile */; + return node.kind === 291 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 291 /* Bundle */; + return node.kind === 292 /* Bundle */; } ts.isBundle = isBundle; function isUnparsedSource(node) { - return node.kind === 292 /* UnparsedSource */; + return node.kind === 293 /* UnparsedSource */; } ts.isUnparsedSource = isUnparsedSource; function isUnparsedPrepend(node) { - return node.kind === 286 /* UnparsedPrepend */; + return node.kind === 287 /* UnparsedPrepend */; } ts.isUnparsedPrepend = isUnparsedPrepend; function isUnparsedTextLike(node) { switch (node.kind) { - case 287 /* UnparsedText */: - case 288 /* UnparsedInternalText */: + case 288 /* UnparsedText */: + case 289 /* UnparsedInternalText */: return true; default: return false; @@ -11632,125 +11693,125 @@ var ts; ts.isUnparsedTextLike = isUnparsedTextLike; function isUnparsedNode(node) { return isUnparsedTextLike(node) || - node.kind === 285 /* UnparsedPrologue */ || - node.kind === 289 /* UnparsedSyntheticReference */; + node.kind === 286 /* UnparsedPrologue */ || + node.kind === 290 /* UnparsedSyntheticReference */; } ts.isUnparsedNode = isUnparsedNode; // JSDoc function isJSDocTypeExpression(node) { - return node.kind === 294 /* JSDocTypeExpression */; + return node.kind === 295 /* JSDocTypeExpression */; } ts.isJSDocTypeExpression = isJSDocTypeExpression; function isJSDocAllType(node) { - return node.kind === 295 /* JSDocAllType */; + return node.kind === 296 /* JSDocAllType */; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 296 /* JSDocUnknownType */; + return node.kind === 297 /* JSDocUnknownType */; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 297 /* JSDocNullableType */; + return node.kind === 298 /* JSDocNullableType */; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 298 /* JSDocNonNullableType */; + return node.kind === 299 /* JSDocNonNullableType */; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 299 /* JSDocOptionalType */; + return node.kind === 300 /* JSDocOptionalType */; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 300 /* JSDocFunctionType */; + return node.kind === 301 /* JSDocFunctionType */; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 301 /* JSDocVariadicType */; + return node.kind === 302 /* JSDocVariadicType */; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDoc(node) { - return node.kind === 303 /* JSDocComment */; + return node.kind === 304 /* JSDocComment */; } ts.isJSDoc = isJSDoc; function isJSDocAuthorTag(node) { - return node.kind === 309 /* JSDocAuthorTag */; + return node.kind === 310 /* JSDocAuthorTag */; } ts.isJSDocAuthorTag = isJSDocAuthorTag; function isJSDocAugmentsTag(node) { - return node.kind === 307 /* JSDocAugmentsTag */; + return node.kind === 308 /* JSDocAugmentsTag */; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocImplementsTag(node) { - return node.kind === 308 /* JSDocImplementsTag */; + return node.kind === 309 /* JSDocImplementsTag */; } ts.isJSDocImplementsTag = isJSDocImplementsTag; function isJSDocClassTag(node) { - return node.kind === 310 /* JSDocClassTag */; + return node.kind === 311 /* JSDocClassTag */; } ts.isJSDocClassTag = isJSDocClassTag; function isJSDocPublicTag(node) { - return node.kind === 311 /* JSDocPublicTag */; + return node.kind === 312 /* JSDocPublicTag */; } ts.isJSDocPublicTag = isJSDocPublicTag; function isJSDocPrivateTag(node) { - return node.kind === 312 /* JSDocPrivateTag */; + return node.kind === 313 /* JSDocPrivateTag */; } ts.isJSDocPrivateTag = isJSDocPrivateTag; function isJSDocProtectedTag(node) { - return node.kind === 313 /* JSDocProtectedTag */; + return node.kind === 314 /* JSDocProtectedTag */; } ts.isJSDocProtectedTag = isJSDocProtectedTag; function isJSDocReadonlyTag(node) { - return node.kind === 314 /* JSDocReadonlyTag */; + return node.kind === 315 /* JSDocReadonlyTag */; } ts.isJSDocReadonlyTag = isJSDocReadonlyTag; function isJSDocEnumTag(node) { - return node.kind === 316 /* JSDocEnumTag */; + return node.kind === 317 /* JSDocEnumTag */; } ts.isJSDocEnumTag = isJSDocEnumTag; function isJSDocThisTag(node) { - return node.kind === 319 /* JSDocThisTag */; + return node.kind === 320 /* JSDocThisTag */; } ts.isJSDocThisTag = isJSDocThisTag; function isJSDocParameterTag(node) { - return node.kind === 317 /* JSDocParameterTag */; + return node.kind === 318 /* JSDocParameterTag */; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 318 /* JSDocReturnTag */; + return node.kind === 319 /* JSDocReturnTag */; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocTypeTag(node) { - return node.kind === 320 /* JSDocTypeTag */; + return node.kind === 321 /* JSDocTypeTag */; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 321 /* JSDocTemplateTag */; + return node.kind === 322 /* JSDocTemplateTag */; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 322 /* JSDocTypedefTag */; + return node.kind === 323 /* JSDocTypedefTag */; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocPropertyTag(node) { - return node.kind === 323 /* JSDocPropertyTag */; + return node.kind === 324 /* JSDocPropertyTag */; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocPropertyLikeTag(node) { - return node.kind === 323 /* JSDocPropertyTag */ || node.kind === 317 /* JSDocParameterTag */; + return node.kind === 324 /* JSDocPropertyTag */ || node.kind === 318 /* JSDocParameterTag */; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isJSDocTypeLiteral(node) { - return node.kind === 304 /* JSDocTypeLiteral */; + return node.kind === 305 /* JSDocTypeLiteral */; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; function isJSDocCallbackTag(node) { - return node.kind === 315 /* JSDocCallbackTag */; + return node.kind === 316 /* JSDocCallbackTag */; } ts.isJSDocCallbackTag = isJSDocCallbackTag; function isJSDocSignature(node) { - return node.kind === 305 /* JSDocSignature */; + return node.kind === 306 /* JSDocSignature */; } ts.isJSDocSignature = isJSDocSignature; // #endregion @@ -11761,7 +11822,7 @@ var ts; // they may be used with transformations. /* @internal */ function isSyntaxList(n) { - return n.kind === 324 /* SyntaxList */; + return n.kind === 325 /* SyntaxList */; } ts.isSyntaxList = isSyntaxList; /* @internal */ @@ -11771,7 +11832,7 @@ var ts; ts.isNode = isNode; /* @internal */ function isNodeKind(kind) { - return kind >= 153 /* FirstNode */; + return kind >= 154 /* FirstNode */; } ts.isNodeKind = isNodeKind; /** @@ -11780,7 +11841,7 @@ var ts; * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 152 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 153 /* LastToken */; } ts.isToken = isToken; // Node Arrays @@ -11821,12 +11882,12 @@ var ts; ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isTypeOnlyImportOrExportDeclaration(node) { switch (node.kind) { - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return node.parent.isTypeOnly; - case 255 /* ImportClause */: + case 256 /* ImportClause */: return node.isTypeOnly; default: return false; @@ -11861,13 +11922,13 @@ var ts; case 122 /* AbstractKeyword */: case 126 /* AsyncKeyword */: case 81 /* ConstKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 84 /* DefaultKeyword */: case 89 /* ExportKeyword */: case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: case 120 /* StaticKeyword */: return true; } @@ -11890,23 +11951,24 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 153 /* QualifiedName */ + return kind === 154 /* QualifiedName */ || kind === 75 /* Identifier */; } ts.isEntityName = isEntityName; function isPropertyName(node) { var kind = node.kind; return kind === 75 /* Identifier */ + || kind === 76 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 154 /* ComputedPropertyName */; + || kind === 155 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 75 /* Identifier */ - || kind === 189 /* ObjectBindingPattern */ - || kind === 190 /* ArrayBindingPattern */; + || kind === 190 /* ObjectBindingPattern */ + || kind === 191 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Functions @@ -11921,13 +11983,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return true; default: return false; @@ -11936,14 +11998,14 @@ var ts; /* @internal */ function isFunctionLikeKind(kind) { switch (kind) { - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 305 /* JSDocSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 170 /* FunctionType */: - case 300 /* JSDocFunctionType */: - case 171 /* ConstructorType */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 306 /* JSDocSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 171 /* FunctionType */: + case 301 /* JSDocFunctionType */: + case 172 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -11958,29 +12020,29 @@ var ts; // Classes function isClassElement(node) { var kind = node.kind; - return kind === 162 /* Constructor */ - || kind === 159 /* PropertyDeclaration */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */ - || kind === 167 /* IndexSignature */ - || kind === 222 /* SemicolonClassElement */; + return kind === 163 /* Constructor */ + || kind === 160 /* PropertyDeclaration */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */ + || kind === 168 /* IndexSignature */ + || kind === 223 /* SemicolonClassElement */; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */); + return node && (node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 163 /* GetAccessor */ || node.kind === 164 /* SetAccessor */); + return node && (node.kind === 164 /* GetAccessor */ || node.kind === 165 /* SetAccessor */); } ts.isAccessor = isAccessor; /* @internal */ function isMethodOrAccessor(node) { switch (node.kind) { - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return true; default: return false; @@ -11990,11 +12052,11 @@ var ts; // Type members function isTypeElement(node) { var kind = node.kind; - return kind === 166 /* ConstructSignature */ - || kind === 165 /* CallSignature */ - || kind === 158 /* PropertySignature */ - || kind === 160 /* MethodSignature */ - || kind === 167 /* IndexSignature */; + return kind === 167 /* ConstructSignature */ + || kind === 166 /* CallSignature */ + || kind === 159 /* PropertySignature */ + || kind === 161 /* MethodSignature */ + || kind === 168 /* IndexSignature */; } ts.isTypeElement = isTypeElement; function isClassOrTypeElement(node) { @@ -12003,12 +12065,12 @@ var ts; ts.isClassOrTypeElement = isClassOrTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 281 /* PropertyAssignment */ - || kind === 282 /* ShorthandPropertyAssignment */ - || kind === 283 /* SpreadAssignment */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */; + return kind === 282 /* PropertyAssignment */ + || kind === 283 /* ShorthandPropertyAssignment */ + || kind === 284 /* SpreadAssignment */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type @@ -12023,8 +12085,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 170 /* FunctionType */: - case 171 /* ConstructorType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: return true; } return false; @@ -12035,8 +12097,8 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 190 /* ArrayBindingPattern */ - || kind === 189 /* ObjectBindingPattern */; + return kind === 191 /* ArrayBindingPattern */ + || kind === 190 /* ObjectBindingPattern */; } return false; } @@ -12044,15 +12106,15 @@ var ts; /* @internal */ function isAssignmentPattern(node) { var kind = node.kind; - return kind === 192 /* ArrayLiteralExpression */ - || kind === 193 /* ObjectLiteralExpression */; + return kind === 193 /* ArrayLiteralExpression */ + || kind === 194 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; /* @internal */ function isArrayBindingElement(node) { var kind = node.kind; - return kind === 191 /* BindingElement */ - || kind === 215 /* OmittedExpression */; + return kind === 192 /* BindingElement */ + || kind === 216 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -12061,9 +12123,9 @@ var ts; /* @internal */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 191 /* BindingElement */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 192 /* BindingElement */: return true; } return false; @@ -12084,8 +12146,8 @@ var ts; /* @internal */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 189 /* ObjectBindingPattern */: - case 193 /* ObjectLiteralExpression */: + case 190 /* ObjectBindingPattern */: + case 194 /* ObjectLiteralExpression */: return true; } return false; @@ -12097,8 +12159,8 @@ var ts; /* @internal */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 190 /* ArrayBindingPattern */: - case 192 /* ArrayLiteralExpression */: + case 191 /* ArrayBindingPattern */: + case 193 /* ArrayLiteralExpression */: return true; } return false; @@ -12107,26 +12169,26 @@ var ts; /* @internal */ function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { var kind = node.kind; - return kind === 194 /* PropertyAccessExpression */ - || kind === 153 /* QualifiedName */ - || kind === 188 /* ImportType */; + return kind === 195 /* PropertyAccessExpression */ + || kind === 154 /* QualifiedName */ + || kind === 189 /* ImportType */; } ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode; // Expression function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 194 /* PropertyAccessExpression */ - || kind === 153 /* QualifiedName */; + return kind === 195 /* PropertyAccessExpression */ + || kind === 154 /* QualifiedName */; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 198 /* TaggedTemplateExpression */: - case 157 /* Decorator */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 199 /* TaggedTemplateExpression */: + case 158 /* Decorator */: return true; default: return false; @@ -12134,12 +12196,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 196 /* CallExpression */ || node.kind === 197 /* NewExpression */; + return node.kind === 197 /* CallExpression */ || node.kind === 198 /* NewExpression */; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 211 /* TemplateExpression */ + return kind === 212 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; @@ -12150,33 +12212,33 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: - case 197 /* NewExpression */: - case 196 /* CallExpression */: - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 270 /* JsxFragment */: - case 198 /* TaggedTemplateExpression */: - case 192 /* ArrayLiteralExpression */: - case 200 /* ParenthesizedExpression */: - case 193 /* ObjectLiteralExpression */: - case 214 /* ClassExpression */: - case 201 /* FunctionExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: + case 198 /* NewExpression */: + case 197 /* CallExpression */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 271 /* JsxFragment */: + case 199 /* TaggedTemplateExpression */: + case 193 /* ArrayLiteralExpression */: + case 201 /* ParenthesizedExpression */: + case 194 /* ObjectLiteralExpression */: + case 215 /* ClassExpression */: + case 202 /* FunctionExpression */: case 75 /* Identifier */: case 13 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: case 91 /* FalseKeyword */: case 100 /* NullKeyword */: case 104 /* ThisKeyword */: case 106 /* TrueKeyword */: case 102 /* SuperKeyword */: - case 218 /* NonNullExpression */: - case 219 /* MetaProperty */: + case 219 /* NonNullExpression */: + case 220 /* MetaProperty */: case 96 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression return true; default: @@ -12190,13 +12252,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: - case 203 /* DeleteExpression */: - case 204 /* TypeOfExpression */: - case 205 /* VoidExpression */: - case 206 /* AwaitExpression */: - case 199 /* TypeAssertionExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: + case 204 /* DeleteExpression */: + case 205 /* TypeOfExpression */: + case 206 /* VoidExpression */: + case 207 /* AwaitExpression */: + case 200 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -12205,9 +12267,9 @@ var ts; /* @internal */ function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return true; - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; default: @@ -12226,15 +12288,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 210 /* ConditionalExpression */: - case 212 /* YieldExpression */: - case 202 /* ArrowFunction */: - case 209 /* BinaryExpression */: - case 213 /* SpreadElement */: - case 217 /* AsExpression */: - case 215 /* OmittedExpression */: - case 327 /* CommaListExpression */: - case 326 /* PartiallyEmittedExpression */: + case 211 /* ConditionalExpression */: + case 213 /* YieldExpression */: + case 203 /* ArrowFunction */: + case 210 /* BinaryExpression */: + case 214 /* SpreadElement */: + case 218 /* AsExpression */: + case 216 /* OmittedExpression */: + case 328 /* CommaListExpression */: + case 327 /* PartiallyEmittedExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -12242,23 +12304,23 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 199 /* TypeAssertionExpression */ - || kind === 217 /* AsExpression */; + return kind === 200 /* TypeAssertionExpression */ + || kind === 218 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; /* @internal */ function isPartiallyEmittedExpression(node) { - return node.kind === 326 /* PartiallyEmittedExpression */; + return node.kind === 327 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; /* @internal */ function isNotEmittedStatement(node) { - return node.kind === 325 /* NotEmittedStatement */; + return node.kind === 326 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; /* @internal */ function isSyntheticReference(node) { - return node.kind === 330 /* SyntheticReferenceExpression */; + return node.kind === 331 /* SyntheticReferenceExpression */; } ts.isSyntheticReference = isSyntheticReference; /* @internal */ @@ -12269,13 +12331,13 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return true; - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -12304,7 +12366,7 @@ var ts; ts.isExternalModuleIndicator = isExternalModuleIndicator; /* @internal */ function isForInOrOfStatement(node) { - return node.kind === 231 /* ForInStatement */ || node.kind === 232 /* ForOfStatement */; + return node.kind === 232 /* ForInStatement */ || node.kind === 233 /* ForOfStatement */; } ts.isForInOrOfStatement = isForInOrOfStatement; // Element @@ -12328,114 +12390,114 @@ var ts; /* @internal */ function isModuleBody(node) { var kind = node.kind; - return kind === 250 /* ModuleBlock */ - || kind === 249 /* ModuleDeclaration */ + return kind === 251 /* ModuleBlock */ + || kind === 250 /* ModuleDeclaration */ || kind === 75 /* Identifier */; } ts.isModuleBody = isModuleBody; /* @internal */ function isNamespaceBody(node) { var kind = node.kind; - return kind === 250 /* ModuleBlock */ - || kind === 249 /* ModuleDeclaration */; + return kind === 251 /* ModuleBlock */ + || kind === 250 /* ModuleDeclaration */; } ts.isNamespaceBody = isNamespaceBody; /* @internal */ function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 75 /* Identifier */ - || kind === 249 /* ModuleDeclaration */; + || kind === 250 /* ModuleDeclaration */; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; /* @internal */ function isNamedImportBindings(node) { var kind = node.kind; - return kind === 257 /* NamedImports */ - || kind === 256 /* NamespaceImport */; + return kind === 258 /* NamedImports */ + || kind === 257 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; /* @internal */ function isModuleOrEnumDeclaration(node) { - return node.kind === 249 /* ModuleDeclaration */ || node.kind === 248 /* EnumDeclaration */; + return node.kind === 250 /* ModuleDeclaration */ || node.kind === 249 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 202 /* ArrowFunction */ - || kind === 191 /* BindingElement */ - || kind === 245 /* ClassDeclaration */ - || kind === 214 /* ClassExpression */ - || kind === 162 /* Constructor */ - || kind === 248 /* EnumDeclaration */ - || kind === 284 /* EnumMember */ - || kind === 263 /* ExportSpecifier */ - || kind === 244 /* FunctionDeclaration */ - || kind === 201 /* FunctionExpression */ - || kind === 163 /* GetAccessor */ - || kind === 255 /* ImportClause */ - || kind === 253 /* ImportEqualsDeclaration */ - || kind === 258 /* ImportSpecifier */ - || kind === 246 /* InterfaceDeclaration */ - || kind === 273 /* JsxAttribute */ - || kind === 161 /* MethodDeclaration */ - || kind === 160 /* MethodSignature */ - || kind === 249 /* ModuleDeclaration */ - || kind === 252 /* NamespaceExportDeclaration */ - || kind === 256 /* NamespaceImport */ - || kind === 262 /* NamespaceExport */ - || kind === 156 /* Parameter */ - || kind === 281 /* PropertyAssignment */ - || kind === 159 /* PropertyDeclaration */ - || kind === 158 /* PropertySignature */ - || kind === 164 /* SetAccessor */ - || kind === 282 /* ShorthandPropertyAssignment */ - || kind === 247 /* TypeAliasDeclaration */ - || kind === 155 /* TypeParameter */ - || kind === 242 /* VariableDeclaration */ - || kind === 322 /* JSDocTypedefTag */ - || kind === 315 /* JSDocCallbackTag */ - || kind === 323 /* JSDocPropertyTag */; + return kind === 203 /* ArrowFunction */ + || kind === 192 /* BindingElement */ + || kind === 246 /* ClassDeclaration */ + || kind === 215 /* ClassExpression */ + || kind === 163 /* Constructor */ + || kind === 249 /* EnumDeclaration */ + || kind === 285 /* EnumMember */ + || kind === 264 /* ExportSpecifier */ + || kind === 245 /* FunctionDeclaration */ + || kind === 202 /* FunctionExpression */ + || kind === 164 /* GetAccessor */ + || kind === 256 /* ImportClause */ + || kind === 254 /* ImportEqualsDeclaration */ + || kind === 259 /* ImportSpecifier */ + || kind === 247 /* InterfaceDeclaration */ + || kind === 274 /* JsxAttribute */ + || kind === 162 /* MethodDeclaration */ + || kind === 161 /* MethodSignature */ + || kind === 250 /* ModuleDeclaration */ + || kind === 253 /* NamespaceExportDeclaration */ + || kind === 257 /* NamespaceImport */ + || kind === 263 /* NamespaceExport */ + || kind === 157 /* Parameter */ + || kind === 282 /* PropertyAssignment */ + || kind === 160 /* PropertyDeclaration */ + || kind === 159 /* PropertySignature */ + || kind === 165 /* SetAccessor */ + || kind === 283 /* ShorthandPropertyAssignment */ + || kind === 248 /* TypeAliasDeclaration */ + || kind === 156 /* TypeParameter */ + || kind === 243 /* VariableDeclaration */ + || kind === 323 /* JSDocTypedefTag */ + || kind === 316 /* JSDocCallbackTag */ + || kind === 324 /* JSDocPropertyTag */; } function isDeclarationStatementKind(kind) { - return kind === 244 /* FunctionDeclaration */ - || kind === 264 /* MissingDeclaration */ - || kind === 245 /* ClassDeclaration */ - || kind === 246 /* InterfaceDeclaration */ - || kind === 247 /* TypeAliasDeclaration */ - || kind === 248 /* EnumDeclaration */ - || kind === 249 /* ModuleDeclaration */ - || kind === 254 /* ImportDeclaration */ - || kind === 253 /* ImportEqualsDeclaration */ - || kind === 260 /* ExportDeclaration */ - || kind === 259 /* ExportAssignment */ - || kind === 252 /* NamespaceExportDeclaration */; + return kind === 245 /* FunctionDeclaration */ + || kind === 265 /* MissingDeclaration */ + || kind === 246 /* ClassDeclaration */ + || kind === 247 /* InterfaceDeclaration */ + || kind === 248 /* TypeAliasDeclaration */ + || kind === 249 /* EnumDeclaration */ + || kind === 250 /* ModuleDeclaration */ + || kind === 255 /* ImportDeclaration */ + || kind === 254 /* ImportEqualsDeclaration */ + || kind === 261 /* ExportDeclaration */ + || kind === 260 /* ExportAssignment */ + || kind === 253 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 234 /* BreakStatement */ - || kind === 233 /* ContinueStatement */ - || kind === 241 /* DebuggerStatement */ - || kind === 228 /* DoStatement */ - || kind === 226 /* ExpressionStatement */ - || kind === 224 /* EmptyStatement */ - || kind === 231 /* ForInStatement */ - || kind === 232 /* ForOfStatement */ - || kind === 230 /* ForStatement */ - || kind === 227 /* IfStatement */ - || kind === 238 /* LabeledStatement */ - || kind === 235 /* ReturnStatement */ - || kind === 237 /* SwitchStatement */ - || kind === 239 /* ThrowStatement */ - || kind === 240 /* TryStatement */ - || kind === 225 /* VariableStatement */ - || kind === 229 /* WhileStatement */ - || kind === 236 /* WithStatement */ - || kind === 325 /* NotEmittedStatement */ - || kind === 329 /* EndOfDeclarationMarker */ - || kind === 328 /* MergeDeclarationMarker */; + return kind === 235 /* BreakStatement */ + || kind === 234 /* ContinueStatement */ + || kind === 242 /* DebuggerStatement */ + || kind === 229 /* DoStatement */ + || kind === 227 /* ExpressionStatement */ + || kind === 225 /* EmptyStatement */ + || kind === 232 /* ForInStatement */ + || kind === 233 /* ForOfStatement */ + || kind === 231 /* ForStatement */ + || kind === 228 /* IfStatement */ + || kind === 239 /* LabeledStatement */ + || kind === 236 /* ReturnStatement */ + || kind === 238 /* SwitchStatement */ + || kind === 240 /* ThrowStatement */ + || kind === 241 /* TryStatement */ + || kind === 226 /* VariableStatement */ + || kind === 230 /* WhileStatement */ + || kind === 237 /* WithStatement */ + || kind === 326 /* NotEmittedStatement */ + || kind === 330 /* EndOfDeclarationMarker */ + || kind === 329 /* MergeDeclarationMarker */; } /* @internal */ function isDeclaration(node) { - if (node.kind === 155 /* TypeParameter */) { - return (node.parent && node.parent.kind !== 321 /* JSDocTemplateTag */) || ts.isInJSFile(node); + if (node.kind === 156 /* TypeParameter */) { + return (node.parent && node.parent.kind !== 322 /* JSDocTemplateTag */) || ts.isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -12462,10 +12524,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 223 /* Block */) + if (node.kind !== 224 /* Block */) return false; if (node.parent !== undefined) { - if (node.parent.kind === 240 /* TryStatement */ || node.parent.kind === 280 /* CatchClause */) { + if (node.parent.kind === 241 /* TryStatement */ || node.parent.kind === 281 /* CatchClause */) { return false; } } @@ -12475,8 +12537,8 @@ var ts; /* @internal */ function isModuleReference(node) { var kind = node.kind; - return kind === 265 /* ExternalModuleReference */ - || kind === 153 /* QualifiedName */ + return kind === 266 /* ExternalModuleReference */ + || kind === 154 /* QualifiedName */ || kind === 75 /* Identifier */; } ts.isModuleReference = isModuleReference; @@ -12486,70 +12548,70 @@ var ts; var kind = node.kind; return kind === 104 /* ThisKeyword */ || kind === 75 /* Identifier */ - || kind === 194 /* PropertyAccessExpression */; + || kind === 195 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; /* @internal */ function isJsxChild(node) { var kind = node.kind; - return kind === 266 /* JsxElement */ - || kind === 276 /* JsxExpression */ - || kind === 267 /* JsxSelfClosingElement */ + return kind === 267 /* JsxElement */ + || kind === 277 /* JsxExpression */ + || kind === 268 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ - || kind === 270 /* JsxFragment */; + || kind === 271 /* JsxFragment */; } ts.isJsxChild = isJsxChild; /* @internal */ function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 273 /* JsxAttribute */ - || kind === 275 /* JsxSpreadAttribute */; + return kind === 274 /* JsxAttribute */ + || kind === 276 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; /* @internal */ function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 10 /* StringLiteral */ - || kind === 276 /* JsxExpression */; + || kind === 277 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 268 /* JsxOpeningElement */ - || kind === 267 /* JsxSelfClosingElement */; + return kind === 269 /* JsxOpeningElement */ + || kind === 268 /* JsxSelfClosingElement */; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 277 /* CaseClause */ - || kind === 278 /* DefaultClause */; + return kind === 278 /* CaseClause */ + || kind === 279 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; // JSDoc /** True if node is of some JSDoc syntax kind. */ /* @internal */ function isJSDocNode(node) { - return node.kind >= 294 /* FirstJSDocNode */ && node.kind <= 323 /* LastJSDocNode */; + return node.kind >= 295 /* FirstJSDocNode */ && node.kind <= 324 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node) { - return node.kind === 303 /* JSDocComment */ || node.kind === 302 /* JSDocNamepathType */ || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); + return node.kind === 304 /* JSDocComment */ || node.kind === 303 /* JSDocNamepathType */ || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; // TODO: determine what this does before making it public. /* @internal */ function isJSDocTag(node) { - return node.kind >= 306 /* FirstJSDocTagNode */ && node.kind <= 323 /* LastJSDocTagNode */; + return node.kind >= 307 /* FirstJSDocTagNode */ && node.kind <= 324 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 164 /* SetAccessor */; + return node.kind === 165 /* SetAccessor */; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 163 /* GetAccessor */; + return node.kind === 164 /* GetAccessor */; } ts.isGetAccessor = isGetAccessor; /** True if has jsdoc nodes attached to it. */ @@ -12575,13 +12637,13 @@ var ts; /** True if has initializer node attached to it. */ function hasOnlyExpressionInitializer(node) { switch (node.kind) { - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 191 /* BindingElement */: - case 158 /* PropertySignature */: - case 159 /* PropertyDeclaration */: - case 281 /* PropertyAssignment */: - case 284 /* EnumMember */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 192 /* BindingElement */: + case 159 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 282 /* PropertyAssignment */: + case 285 /* EnumMember */: return true; default: return false; @@ -12589,12 +12651,12 @@ var ts; } ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; function isObjectLiteralElement(node) { - return node.kind === 273 /* JsxAttribute */ || node.kind === 275 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); + return node.kind === 274 /* JsxAttribute */ || node.kind === 276 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); } ts.isObjectLiteralElement = isObjectLiteralElement; /* @internal */ function isTypeReferenceType(node) { - return node.kind === 169 /* TypeReference */ || node.kind === 216 /* ExpressionWithTypeArguments */; + return node.kind === 170 /* TypeReference */ || node.kind === 217 /* ExpressionWithTypeArguments */; } ts.isTypeReferenceType = isTypeReferenceType; var MAX_SMI_X86 = 1073741823; @@ -12888,7 +12950,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 290 /* SourceFile */) { + while (node && node.kind !== 291 /* SourceFile */) { node = node.parent; } return node; @@ -12896,11 +12958,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 223 /* Block */: - case 251 /* CaseBlock */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 224 /* Block */: + case 252 /* CaseBlock */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: return true; } return false; @@ -13052,6 +13114,33 @@ var ts; text.charCodeAt(start + 2) === 33 /* exclamation */; } ts.isPinnedComment = isPinnedComment; + function createCommentDirectivesMap(sourceFile, commentDirectives) { + var directivesByLine = ts.createMapFromEntries(commentDirectives.map(function (commentDirective) { return ([ + "" + ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.pos).line, + commentDirective, + ]); })); + var usedLines = ts.createMap(); + return { getUnusedExpectations: getUnusedExpectations, markUsed: markUsed }; + function getUnusedExpectations() { + return ts.arrayFrom(directivesByLine.entries()) + .filter(function (_a) { + var line = _a[0], directive = _a[1]; + return directive.type === 0 /* ExpectError */ && !usedLines.get(line); + }) + .map(function (_a) { + var _ = _a[0], directive = _a[1]; + return directive; + }); + } + function markUsed(line) { + if (!directivesByLine.has("" + line)) { + return false; + } + usedLines.set("" + line, true); + return true; + } + } + ts.createCommentDirectivesMap = createCommentDirectivesMap; function getTokenPosOfNode(node, sourceFile, includeJsDoc) { // With nodes that have no width (i.e. 'Missing' nodes), we actually *don't* // want to skip trivia because this will launch us forward to the next token. @@ -13068,7 +13157,7 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 324 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 325 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -13193,7 +13282,7 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 242 /* VariableDeclaration */ && node.parent.kind === 280 /* CatchClause */; + return node.kind === 243 /* VariableDeclaration */ && node.parent.kind === 281 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { @@ -13225,11 +13314,11 @@ var ts; ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { // The only kind of module that can be missing a body is a shorthand ambient module. - return node && node.kind === 249 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 250 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 290 /* SourceFile */ || - node.kind === 249 /* ModuleDeclaration */ || + return node.kind === 291 /* SourceFile */ || + node.kind === 250 /* ModuleDeclaration */ || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -13246,9 +13335,9 @@ var ts; // - defined in the top level scope and source file is an external module // - defined inside ambient module declaration located in the top level scope and source file not an external module switch (node.parent.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: return ts.isExternalModule(node.parent); - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -13301,22 +13390,22 @@ var ts; ts.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile; function isBlockScope(node, parentNode) { switch (node.kind) { - case 290 /* SourceFile */: - case 251 /* CaseBlock */: - case 280 /* CatchClause */: - case 249 /* ModuleDeclaration */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 291 /* SourceFile */: + case 252 /* CaseBlock */: + case 281 /* CatchClause */: + case 250 /* ModuleDeclaration */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return true; - case 223 /* Block */: + case 224 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return !ts.isFunctionLike(parentNode); @@ -13326,9 +13415,9 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: - case 305 /* JSDocSignature */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: + case 306 /* JSDocSignature */: return true; default: ts.assertType(node); @@ -13338,25 +13427,25 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isDeclarationWithTypeParameterChildren(node) { switch (node.kind) { - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 160 /* MethodSignature */: - case 167 /* IndexSignature */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 300 /* JSDocFunctionType */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 321 /* JSDocTemplateTag */: - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 161 /* MethodSignature */: + case 168 /* IndexSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 301 /* JSDocFunctionType */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 322 /* JSDocTemplateTag */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return true; default: ts.assertType(node); @@ -13366,8 +13455,8 @@ var ts; ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren; function isAnyImportSyntax(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: return true; default: return false; @@ -13376,15 +13465,15 @@ var ts; ts.isAnyImportSyntax = isAnyImportSyntax; function isLateVisibilityPaintedStatement(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 225 /* VariableStatement */: - case 245 /* ClassDeclaration */: - case 244 /* FunctionDeclaration */: - case 249 /* ModuleDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 226 /* VariableStatement */: + case 246 /* ClassDeclaration */: + case 245 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: return true; default: return false; @@ -13421,7 +13510,7 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: if (isStringOrNumericLiteralLike(name.expression)) return ts.escapeLeadingUnderscores(name.expression.text); return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames"); @@ -13437,9 +13526,9 @@ var ts; case 76 /* PrivateIdentifier */: case 75 /* Identifier */: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: if (ts.isIdentifier(name.name) || ts.isPrivateIdentifier(name.name)) { return entityNameToString(name.expression) + "." + entityNameToString(name.name); } @@ -13480,6 +13569,17 @@ var ts; }; } ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; + function createDiagnosticForRange(sourceFile, range, message) { + return { + file: sourceFile, + start: range.pos, + length: range.end - range.pos, + code: message.code, + category: message.category, + messageText: message.message, + }; + } + ts.createDiagnosticForRange = createDiagnosticForRange; function getSpanOfTokenAtPosition(sourceFile, pos) { var scanner = ts.createScanner(sourceFile.languageVersion, /*skipTrivia*/ true, sourceFile.languageVariant, sourceFile.text, /*onError:*/ undefined, pos); scanner.scan(); @@ -13489,7 +13589,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 223 /* Block */) { + if (node.body && node.body.kind === 224 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -13503,7 +13603,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -13512,28 +13612,28 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 242 /* VariableDeclaration */: - case 191 /* BindingElement */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 247 /* TypeAliasDeclaration */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 243 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 248 /* TypeAliasDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: errorNode = node.name; break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: var start = ts.skipTrivia(sourceFile.text, node.pos); var end = node.statements.length > 0 ? node.statements[0].pos : node.end; return ts.createTextSpanFromBounds(start, end); @@ -13585,11 +13685,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 196 /* CallExpression */ && n.expression.kind === 102 /* SuperKeyword */; + return n.kind === 197 /* CallExpression */ && n.expression.kind === 102 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 196 /* CallExpression */ && n.expression.kind === 96 /* ImportKeyword */; + return n.kind === 197 /* CallExpression */ && n.expression.kind === 96 /* ImportKeyword */; } ts.isImportCall = isImportCall; function isImportMeta(n) { @@ -13603,7 +13703,7 @@ var ts; } ts.isLiteralImportTypeNode = isLiteralImportTypeNode; function isPrologueDirective(node) { - return node.kind === 226 /* ExpressionStatement */ + return node.kind === 227 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -13612,11 +13712,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 156 /* Parameter */ || - node.kind === 155 /* TypeParameter */ || - node.kind === 201 /* FunctionExpression */ || - node.kind === 202 /* ArrowFunction */ || - node.kind === 200 /* ParenthesizedExpression */) ? + var commentRanges = (node.kind === 157 /* Parameter */ || + node.kind === 156 /* TypeParameter */ || + node.kind === 202 /* FunctionExpression */ || + node.kind === 203 /* ArrowFunction */ || + node.kind === 201 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' @@ -13632,48 +13732,48 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (168 /* FirstTypeNode */ <= node.kind && node.kind <= 188 /* LastTypeNode */) { + if (169 /* FirstTypeNode */ <= node.kind && node.kind <= 189 /* LastTypeNode */) { return true; } switch (node.kind) { case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 143 /* StringKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: - case 141 /* ObjectKeyword */: - case 146 /* UndefinedKeyword */: - case 137 /* NeverKeyword */: + case 149 /* UnknownKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 144 /* StringKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: + case 142 /* ObjectKeyword */: + case 147 /* UndefinedKeyword */: + case 138 /* NeverKeyword */: return true; case 110 /* VoidKeyword */: - return node.parent.kind !== 205 /* VoidExpression */; - case 216 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 206 /* VoidExpression */; + case 217 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); - case 155 /* TypeParameter */: - return node.parent.kind === 186 /* MappedType */ || node.parent.kind === 181 /* InferType */; + case 156 /* TypeParameter */: + return node.parent.kind === 187 /* MappedType */ || node.parent.kind === 182 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 75 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 153 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 154 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 75 /* Identifier */ || node.kind === 153 /* QualifiedName */ || node.kind === 194 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + ts.Debug.assert(node.kind === 75 /* Identifier */ || node.kind === 154 /* QualifiedName */ || node.kind === 195 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 153 /* QualifiedName */: - case 194 /* PropertyAccessExpression */: + case 154 /* QualifiedName */: + case 195 /* PropertyAccessExpression */: case 104 /* ThisKeyword */: { var parent = node.parent; - if (parent.kind === 172 /* TypeQuery */) { + if (parent.kind === 173 /* TypeQuery */) { return false; } - if (parent.kind === 188 /* ImportType */) { + if (parent.kind === 189 /* ImportType */) { return !parent.isTypeOf; } // Do not recursively call isPartOfTypeNode on the parent. In the example: @@ -13682,40 +13782,40 @@ var ts; // // Calling isPartOfTypeNode would consider the qualified name A.B a type node. // Only C and A.B.C are type nodes. - if (168 /* FirstTypeNode */ <= parent.kind && parent.kind <= 188 /* LastTypeNode */) { + if (169 /* FirstTypeNode */ <= parent.kind && parent.kind <= 189 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return node === parent.constraint; - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return node === parent.constraint; - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 156 /* Parameter */: - case 242 /* VariableDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 157 /* Parameter */: + case 243 /* VariableDeclaration */: return node === parent.type; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return node === parent.type; - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: return node === parent.type; - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: return node === parent.type; - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: return ts.contains(parent.typeArguments, node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -13740,23 +13840,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitor(node); - case 251 /* CaseBlock */: - case 223 /* Block */: - case 227 /* IfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 236 /* WithStatement */: - case 237 /* SwitchStatement */: - case 277 /* CaseClause */: - case 278 /* DefaultClause */: - case 238 /* LabeledStatement */: - case 240 /* TryStatement */: - case 280 /* CatchClause */: + case 252 /* CaseBlock */: + case 224 /* Block */: + case 228 /* IfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 237 /* WithStatement */: + case 238 /* SwitchStatement */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: + case 239 /* LabeledStatement */: + case 241 /* TryStatement */: + case 281 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -13766,23 +13866,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 248 /* EnumDeclaration */: - case 246 /* InterfaceDeclaration */: - case 249 /* ModuleDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: + case 247 /* InterfaceDeclaration */: + case 250 /* ModuleDeclaration */: + case 248 /* TypeAliasDeclaration */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, skip them to avoid the work. return; default: if (ts.isFunctionLike(node)) { - if (node.name && node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 155 /* ComputedPropertyName */) { // Note that we will not include methods/accessors of a class because they would require // first descending into the class. This is by design. traverse(node.name.expression); @@ -13805,10 +13905,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 174 /* ArrayType */) { + if (node && node.kind === 175 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 169 /* TypeReference */) { + else if (node && node.kind === 170 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -13818,12 +13918,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 246 /* InterfaceDeclaration */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 173 /* TypeLiteral */: + case 247 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 174 /* TypeLiteral */: return node.members; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return node.properties; } } @@ -13831,14 +13931,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 191 /* BindingElement */: - case 284 /* EnumMember */: - case 156 /* Parameter */: - case 281 /* PropertyAssignment */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 282 /* ShorthandPropertyAssignment */: - case 242 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 285 /* EnumMember */: + case 157 /* Parameter */: + case 282 /* PropertyAssignment */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 283 /* ShorthandPropertyAssignment */: + case 243 /* VariableDeclaration */: return true; } } @@ -13850,8 +13950,8 @@ var ts; } ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 243 /* VariableDeclarationList */ - && node.parent.parent.kind === 225 /* VariableStatement */; + return node.parent.kind === 244 /* VariableDeclarationList */ + && node.parent.parent.kind === 226 /* VariableStatement */; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -13862,13 +13962,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return true; } return false; @@ -13879,7 +13979,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 238 /* LabeledStatement */) { + if (node.statement.kind !== 239 /* LabeledStatement */) { return node.statement; } node = node.statement; @@ -13887,17 +13987,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 223 /* Block */ && ts.isFunctionLike(node.parent); + return node && node.kind === 224 /* Block */ && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 161 /* MethodDeclaration */ && node.parent.kind === 193 /* ObjectLiteralExpression */; + return node && node.kind === 162 /* MethodDeclaration */ && node.parent.kind === 194 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 161 /* MethodDeclaration */ && - (node.parent.kind === 193 /* ObjectLiteralExpression */ || - node.parent.kind === 214 /* ClassExpression */); + return node.kind === 162 /* MethodDeclaration */ && + (node.parent.kind === 194 /* ObjectLiteralExpression */ || + node.parent.kind === 215 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -13910,7 +14010,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return objectLiteral.properties.filter(function (property) { - if (property.kind === 281 /* PropertyAssignment */) { + if (property.kind === 282 /* PropertyAssignment */) { var propName = getTextOfPropertyName(property.name); return key === propName || (!!key2 && key2 === propName); } @@ -13951,14 +14051,14 @@ var ts; } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { - ts.Debug.assert(node.kind !== 290 /* SourceFile */); + ts.Debug.assert(node.kind !== 291 /* SourceFile */); while (true) { node = node.parent; if (!node) { return ts.Debug.fail(); // If we never pass in a SourceFile, this should be unreachable, since we'll stop when we reach that. } switch (node.kind) { - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: // If the grandparent node is an object literal (as opposed to a class), // then the computed property is not a 'this' container. // A computed property name in a class needs to be a this container @@ -13973,9 +14073,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 157 /* Decorator */: + case 158 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 156 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 157 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -13986,26 +14086,26 @@ var ts; node = node.parent; } break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 249 /* ModuleDeclaration */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 248 /* EnumDeclaration */: - case 290 /* SourceFile */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 250 /* ModuleDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 249 /* EnumDeclaration */: + case 291 /* SourceFile */: return node; } } @@ -14015,9 +14115,9 @@ var ts; var container = getThisContainer(node, /*includeArrowFunctions*/ false); if (container) { switch (container.kind) { - case 162 /* Constructor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 163 /* Constructor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return container; } } @@ -14039,27 +14139,27 @@ var ts; return node; } switch (node.kind) { - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: node = node.parent; break; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return node; - case 157 /* Decorator */: + case 158 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 156 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 157 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -14075,14 +14175,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 201 /* FunctionExpression */ || func.kind === 202 /* ArrowFunction */) { + if (func.kind === 202 /* FunctionExpression */ || func.kind === 203 /* ArrowFunction */) { var prev = func; var parent = func.parent; - while (parent.kind === 200 /* ParenthesizedExpression */) { + while (parent.kind === 201 /* ParenthesizedExpression */) { prev = parent; parent = parent.parent; } - if (parent.kind === 196 /* CallExpression */ && parent.expression === prev) { + if (parent.kind === 197 /* CallExpression */ && parent.expression === prev) { return parent; } } @@ -14098,7 +14198,7 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 194 /* PropertyAccessExpression */ || kind === 195 /* ElementAccessExpression */) + return (kind === 195 /* PropertyAccessExpression */ || kind === 196 /* ElementAccessExpression */) && node.expression.kind === 102 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; @@ -14107,20 +14207,20 @@ var ts; */ function isThisProperty(node) { var kind = node.kind; - return (kind === 194 /* PropertyAccessExpression */ || kind === 195 /* ElementAccessExpression */) + return (kind === 195 /* PropertyAccessExpression */ || kind === 196 /* ElementAccessExpression */) && node.expression.kind === 104 /* ThisKeyword */; } ts.isThisProperty = isThisProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return node.typeName; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 75 /* Identifier */: - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return node; } return undefined; @@ -14128,10 +14228,10 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { switch (node.kind) { - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return node.tag; - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: return node.tagName; default: return node.expression; @@ -14144,25 +14244,25 @@ var ts; return false; } switch (node.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: // classes are valid targets return true; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return parent.kind === 245 /* ClassDeclaration */; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 161 /* MethodDeclaration */: + return parent.kind === 246 /* ClassDeclaration */; + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 162 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && parent.kind === 245 /* ClassDeclaration */; - case 156 /* Parameter */: + && parent.kind === 246 /* ClassDeclaration */; + case 157 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return parent.body !== undefined - && (parent.kind === 162 /* Constructor */ - || parent.kind === 161 /* MethodDeclaration */ - || parent.kind === 164 /* SetAccessor */) - && grandparent.kind === 245 /* ClassDeclaration */; + && (parent.kind === 163 /* Constructor */ + || parent.kind === 162 /* MethodDeclaration */ + || parent.kind === 165 /* SetAccessor */) + && grandparent.kind === 246 /* ClassDeclaration */; } return false; } @@ -14178,10 +14278,10 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); // TODO: GH#18217 - case 161 /* MethodDeclaration */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 165 /* SetAccessor */: return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); // TODO: GH#18217 default: return false; @@ -14190,9 +14290,9 @@ var ts; ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 268 /* JsxOpeningElement */ || - parent.kind === 267 /* JsxSelfClosingElement */ || - parent.kind === 269 /* JsxClosingElement */) { + if (parent.kind === 269 /* JsxOpeningElement */ || + parent.kind === 268 /* JsxSelfClosingElement */ || + parent.kind === 270 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -14205,44 +14305,44 @@ var ts; case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: case 13 /* RegularExpressionLiteral */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 198 /* TaggedTemplateExpression */: - case 217 /* AsExpression */: - case 199 /* TypeAssertionExpression */: - case 218 /* NonNullExpression */: - case 200 /* ParenthesizedExpression */: - case 201 /* FunctionExpression */: - case 214 /* ClassExpression */: - case 202 /* ArrowFunction */: - case 205 /* VoidExpression */: - case 203 /* DeleteExpression */: - case 204 /* TypeOfExpression */: - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: - case 209 /* BinaryExpression */: - case 210 /* ConditionalExpression */: - case 213 /* SpreadElement */: - case 211 /* TemplateExpression */: - case 215 /* OmittedExpression */: - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 270 /* JsxFragment */: - case 212 /* YieldExpression */: - case 206 /* AwaitExpression */: - case 219 /* MetaProperty */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 199 /* TaggedTemplateExpression */: + case 218 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 219 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: + case 202 /* FunctionExpression */: + case 215 /* ClassExpression */: + case 203 /* ArrowFunction */: + case 206 /* VoidExpression */: + case 204 /* DeleteExpression */: + case 205 /* TypeOfExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: + case 210 /* BinaryExpression */: + case 211 /* ConditionalExpression */: + case 214 /* SpreadElement */: + case 212 /* TemplateExpression */: + case 216 /* OmittedExpression */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 271 /* JsxFragment */: + case 213 /* YieldExpression */: + case 207 /* AwaitExpression */: + case 220 /* MetaProperty */: return true; - case 153 /* QualifiedName */: - while (node.parent.kind === 153 /* QualifiedName */) { + case 154 /* QualifiedName */: + while (node.parent.kind === 154 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 172 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 173 /* TypeQuery */ || isJSXTagName(node); case 75 /* Identifier */: - if (node.parent.kind === 172 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 173 /* TypeQuery */ || isJSXTagName(node)) { return true; } // falls through @@ -14260,49 +14360,49 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 284 /* EnumMember */: - case 281 /* PropertyAssignment */: - case 191 /* BindingElement */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 285 /* EnumMember */: + case 282 /* PropertyAssignment */: + case 192 /* BindingElement */: return parent.initializer === node; - case 226 /* ExpressionStatement */: - case 227 /* IfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 235 /* ReturnStatement */: - case 236 /* WithStatement */: - case 237 /* SwitchStatement */: - case 277 /* CaseClause */: - case 239 /* ThrowStatement */: + case 227 /* ExpressionStatement */: + case 228 /* IfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 236 /* ReturnStatement */: + case 237 /* WithStatement */: + case 238 /* SwitchStatement */: + case 278 /* CaseClause */: + case 240 /* ThrowStatement */: return parent.expression === node; - case 230 /* ForStatement */: + case 231 /* ForStatement */: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 243 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 244 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 243 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 244 /* VariableDeclarationList */) || forInStatement.expression === node; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: return node === parent.expression; - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return node === parent.expression; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return node === parent.expression; - case 157 /* Decorator */: - case 276 /* JsxExpression */: - case 275 /* JsxSpreadAttribute */: - case 283 /* SpreadAssignment */: + case 158 /* Decorator */: + case 277 /* JsxExpression */: + case 276 /* JsxSpreadAttribute */: + case 284 /* SpreadAssignment */: return true; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return parent.objectAssignmentInitializer === node; default: return isExpressionNode(parent); @@ -14310,14 +14410,14 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isPartOfTypeQuery(node) { - while (node.kind === 153 /* QualifiedName */ || node.kind === 75 /* Identifier */) { + while (node.kind === 154 /* QualifiedName */ || node.kind === 75 /* Identifier */) { node = node.parent; } - return node.kind === 172 /* TypeQuery */; + return node.kind === 173 /* TypeQuery */; } ts.isPartOfTypeQuery = isPartOfTypeQuery; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 265 /* ExternalModuleReference */; + return node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 266 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -14326,7 +14426,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 265 /* ExternalModuleReference */; + return node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 266 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJS(file) { @@ -14358,11 +14458,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 143 /* StringKeyword */ || node.typeArguments[0].kind === 140 /* NumberKeyword */); + (node.typeArguments[0].kind === 144 /* StringKeyword */ || node.typeArguments[0].kind === 141 /* NumberKeyword */); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, requireStringLiteralLikeArgument) { - if (callExpression.kind !== 196 /* CallExpression */) { + if (callExpression.kind !== 197 /* CallExpression */) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -14494,11 +14594,11 @@ var ts; function getExpandoInitializer(initializer, isPrototypeAssignment) { if (ts.isCallExpression(initializer)) { var e = skipParentheses(initializer.expression); - return e.kind === 201 /* FunctionExpression */ || e.kind === 202 /* ArrowFunction */ ? initializer : undefined; + return e.kind === 202 /* FunctionExpression */ || e.kind === 203 /* ArrowFunction */ ? initializer : undefined; } - if (initializer.kind === 201 /* FunctionExpression */ || - initializer.kind === 214 /* ClassExpression */ || - initializer.kind === 202 /* ArrowFunction */) { + if (initializer.kind === 202 /* FunctionExpression */ || + initializer.kind === 215 /* ClassExpression */ || + initializer.kind === 203 /* ArrowFunction */) { return initializer; } if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -14724,7 +14824,7 @@ var ts; // exports.name = expr OR module.exports.name = expr OR exports["name"] = expr ... return 1 /* ExportsProperty */; } - if (isBindableStaticNameExpression(lhs, /*excludeThisKeyword*/ true) || (ts.isElementAccessExpression(lhs) && isDynamicName(lhs) && lhs.expression.kind !== 104 /* ThisKeyword */)) { + if (isBindableStaticNameExpression(lhs, /*excludeThisKeyword*/ true) || (ts.isElementAccessExpression(lhs) && isDynamicName(lhs))) { // F.G...x = expr return 5 /* Property */; } @@ -14745,7 +14845,7 @@ var ts; ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment; function isSpecialPropertyDeclaration(expr) { return isInJSFile(expr) && - expr.parent && expr.parent.kind === 226 /* ExpressionStatement */ && + expr.parent && expr.parent.kind === 227 /* ExpressionStatement */ && (!ts.isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!ts.getJSDocTypeTag(expr.parent); } @@ -14755,7 +14855,7 @@ var ts; return false; } var decl = symbol.valueDeclaration; - return decl.kind === 244 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); + return decl.kind === 245 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); } ts.isFunctionSymbol = isFunctionSymbol; function importFromModuleSpecifier(node) { @@ -14764,14 +14864,14 @@ var ts; ts.importFromModuleSpecifier = importFromModuleSpecifier; function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: return node.parent; - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: return node.parent.parent; - case 196 /* CallExpression */: + case 197 /* CallExpression */: return isImportCall(node.parent) || isRequireCall(node.parent, /*checkArg*/ false) ? node.parent : undefined; - case 187 /* LiteralType */: + case 188 /* LiteralType */: ts.Debug.assert(ts.isStringLiteral(node)); return ts.tryCast(node.parent.parent, ts.isImportTypeNode); default: @@ -14781,12 +14881,12 @@ var ts; ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier; function getExternalModuleName(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: return node.moduleSpecifier; - case 253 /* ImportEqualsDeclaration */: - return node.moduleReference.kind === 265 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; - case 188 /* ImportType */: + case 254 /* ImportEqualsDeclaration */: + return node.moduleReference.kind === 266 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; + case 189 /* ImportType */: return isLiteralImportTypeNode(node) ? node.argument.literal : undefined; default: return ts.Debug.assertNever(node); @@ -14795,11 +14895,11 @@ var ts; ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return node; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return node.exportClause && ts.tryCast(node.exportClause, ts.isNamespaceExport); default: return ts.Debug.assertNever(node); @@ -14807,7 +14907,7 @@ var ts; } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 254 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; + return node.kind === 255 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function forEachImportClauseDeclaration(node, action) { @@ -14828,13 +14928,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 156 /* Parameter */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 282 /* ShorthandPropertyAssignment */: - case 281 /* PropertyAssignment */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 157 /* Parameter */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 283 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -14848,7 +14948,7 @@ var ts; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function isJSDocTypeAlias(node) { - return node.kind === 322 /* JSDocTypedefTag */ || node.kind === 315 /* JSDocCallbackTag */ || node.kind === 316 /* JSDocEnumTag */; + return node.kind === 323 /* JSDocTypedefTag */ || node.kind === 316 /* JSDocCallbackTag */ || node.kind === 317 /* JSDocEnumTag */; } ts.isJSDocTypeAlias = isJSDocTypeAlias; function isTypeAlias(node) { @@ -14873,12 +14973,12 @@ var ts; } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: var v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return node.initializer; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return node.initializer; } } @@ -14889,7 +14989,7 @@ var ts; function getNestedModuleDeclaration(node) { return ts.isModuleDeclaration(node) && node.body && - node.body.kind === 249 /* ModuleDeclaration */ + node.body.kind === 250 /* ModuleDeclaration */ ? node.body : undefined; } @@ -14904,11 +15004,11 @@ var ts; if (ts.hasJSDocNodes(node)) { result = ts.append(result, ts.last(node.jsDoc)); } - if (node.kind === 156 /* Parameter */) { + if (node.kind === 157 /* Parameter */) { result = ts.addRange(result, ts.getJSDocParameterTags(node)); break; } - if (node.kind === 155 /* TypeParameter */) { + if (node.kind === 156 /* TypeParameter */) { result = ts.addRange(result, ts.getJSDocTypeParameterTags(node)); break; } @@ -14919,10 +15019,10 @@ var ts; ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags; function getNextJSDocCommentLocation(node) { var parent = node.parent; - if (parent.kind === 281 /* PropertyAssignment */ || - parent.kind === 259 /* ExportAssignment */ || - parent.kind === 159 /* PropertyDeclaration */ || - parent.kind === 226 /* ExpressionStatement */ && node.kind === 194 /* PropertyAccessExpression */ || + if (parent.kind === 282 /* PropertyAssignment */ || + parent.kind === 260 /* ExportAssignment */ || + parent.kind === 160 /* PropertyDeclaration */ || + parent.kind === 227 /* ExpressionStatement */ && node.kind === 195 /* PropertyAccessExpression */ || getNestedModuleDeclaration(parent) || ts.isBinaryExpression(node) && node.operatorToken.kind === 62 /* EqualsToken */) { return parent; @@ -14996,7 +15096,7 @@ var ts; ts.hasRestParameter = hasRestParameter; function isRestParameter(node) { var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type; - return node.dotDotDotToken !== undefined || !!type && type.kind === 301 /* JSDocVariadicType */; + return node.dotDotDotToken !== undefined || !!type && type.kind === 302 /* JSDocVariadicType */; } ts.isRestParameter = isRestParameter; function hasTypeArguments(node) { @@ -15013,31 +15113,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 62 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 200 /* ParenthesizedExpression */: - case 192 /* ArrayLiteralExpression */: - case 213 /* SpreadElement */: - case 218 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: + case 193 /* ArrayLiteralExpression */: + case 214 /* SpreadElement */: + case 219 /* NonNullExpression */: node = parent; break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } node = parent.parent; break; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: if (parent.name === node) { return 0 /* None */; } @@ -15064,22 +15164,22 @@ var ts; */ function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 223 /* Block */: - case 225 /* VariableStatement */: - case 236 /* WithStatement */: - case 227 /* IfStatement */: - case 237 /* SwitchStatement */: - case 251 /* CaseBlock */: - case 277 /* CaseClause */: - case 278 /* DefaultClause */: - case 238 /* LabeledStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 240 /* TryStatement */: - case 280 /* CatchClause */: + case 224 /* Block */: + case 226 /* VariableStatement */: + case 237 /* WithStatement */: + case 228 /* IfStatement */: + case 238 /* SwitchStatement */: + case 252 /* CaseBlock */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: + case 239 /* LabeledStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 241 /* TryStatement */: + case 281 /* CatchClause */: return true; } return false; @@ -15096,33 +15196,33 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 182 /* ParenthesizedType */); + return walkUp(node, 183 /* ParenthesizedType */); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 200 /* ParenthesizedExpression */); + return walkUp(node, 201 /* ParenthesizedExpression */); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; function skipParentheses(node) { - while (node.kind === 200 /* ParenthesizedExpression */) { + while (node.kind === 201 /* ParenthesizedExpression */) { node = node.expression; } return node; } ts.skipParentheses = skipParentheses; function skipParenthesesUp(node) { - while (node.kind === 200 /* ParenthesizedExpression */) { + while (node.kind === 201 /* ParenthesizedExpression */) { node = node.parent; } return node; } // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped function isDeleteTarget(node) { - if (node.kind !== 194 /* PropertyAccessExpression */ && node.kind !== 195 /* ElementAccessExpression */) { + if (node.kind !== 195 /* PropertyAccessExpression */ && node.kind !== 196 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 203 /* DeleteExpression */; + return node && node.kind === 204 /* DeleteExpression */; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -15175,7 +15275,7 @@ var ts; ts.getDeclarationFromName = getDeclarationFromName; function isLiteralComputedPropertyDeclarationName(node) { return isStringOrNumericLiteralLike(node) && - node.parent.kind === 154 /* ComputedPropertyName */ && + node.parent.kind === 155 /* ComputedPropertyName */ && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -15183,32 +15283,32 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 284 /* EnumMember */: - case 281 /* PropertyAssignment */: - case 194 /* PropertyAccessExpression */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 285 /* EnumMember */: + case 282 /* PropertyAssignment */: + case 195 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: // Name on right hand side of dot in a type query or type reference if (parent.right === node) { - while (parent.kind === 153 /* QualifiedName */) { + while (parent.kind === 154 /* QualifiedName */) { parent = parent.parent; } - return parent.kind === 172 /* TypeQuery */ || parent.kind === 169 /* TypeReference */; + return parent.kind === 173 /* TypeQuery */ || parent.kind === 170 /* TypeReference */; } return false; - case 191 /* BindingElement */: - case 258 /* ImportSpecifier */: + case 192 /* BindingElement */: + case 259 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 263 /* ExportSpecifier */: - case 273 /* JsxAttribute */: + case 264 /* ExportSpecifier */: + case 274 /* JsxAttribute */: // Any name in an export specifier or JSX Attribute return true; } @@ -15228,33 +15328,33 @@ var ts; // {} // {name: } function isAliasSymbolDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */ || - node.kind === 252 /* NamespaceExportDeclaration */ || - node.kind === 255 /* ImportClause */ && !!node.name || - node.kind === 256 /* NamespaceImport */ || - node.kind === 262 /* NamespaceExport */ || - node.kind === 258 /* ImportSpecifier */ || - node.kind === 263 /* ExportSpecifier */ || - node.kind === 259 /* ExportAssignment */ && exportAssignmentIsAlias(node) || + return node.kind === 254 /* ImportEqualsDeclaration */ || + node.kind === 253 /* NamespaceExportDeclaration */ || + node.kind === 256 /* ImportClause */ && !!node.name || + node.kind === 257 /* NamespaceImport */ || + node.kind === 263 /* NamespaceExport */ || + node.kind === 259 /* ImportSpecifier */ || + node.kind === 264 /* ExportSpecifier */ || + node.kind === 260 /* ExportAssignment */ && exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableExpression(node.parent.right) || - node.kind === 282 /* ShorthandPropertyAssignment */ || - node.kind === 281 /* PropertyAssignment */ && isAliasableExpression(node.initializer); + node.kind === 283 /* ShorthandPropertyAssignment */ || + node.kind === 282 /* PropertyAssignment */ && isAliasableExpression(node.initializer); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getAliasDeclarationFromName(node) { switch (node.parent.kind) { - case 255 /* ImportClause */: - case 258 /* ImportSpecifier */: - case 256 /* NamespaceImport */: - case 263 /* ExportSpecifier */: - case 259 /* ExportAssignment */: - case 253 /* ImportEqualsDeclaration */: + case 256 /* ImportClause */: + case 259 /* ImportSpecifier */: + case 257 /* NamespaceImport */: + case 264 /* ExportSpecifier */: + case 260 /* ExportAssignment */: + case 254 /* ImportEqualsDeclaration */: return node.parent; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: do { node = node.parent; - } while (node.parent.kind === 153 /* QualifiedName */); + } while (node.parent.kind === 154 /* QualifiedName */); return getAliasDeclarationFromName(node); } } @@ -15273,7 +15373,7 @@ var ts; } ts.getExportAssignmentExpression = getExportAssignmentExpression; function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 282 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 281 /* PropertyAssignment */ ? node.initializer : + return node.kind === 283 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 282 /* PropertyAssignment */ ? node.initializer : node.parent.right; } ts.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression; @@ -15339,11 +15439,11 @@ var ts; } ts.getAncestor = getAncestor; function isKeyword(token) { - return 77 /* FirstKeyword */ <= token && token <= 152 /* LastKeyword */; + return 77 /* FirstKeyword */ <= token && token <= 153 /* LastKeyword */; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 122 /* FirstContextualKeyword */ <= token && token <= 152 /* LastContextualKeyword */; + return 122 /* FirstContextualKeyword */ <= token && token <= 153 /* LastContextualKeyword */; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -15387,14 +15487,14 @@ var ts; } var flags = 0 /* Normal */; switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } // falls through - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: if (hasModifier(node, 256 /* Async */)) { flags |= 2 /* Async */; } @@ -15408,10 +15508,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: return node.body !== undefined && node.asteriskToken === undefined && hasModifier(node, 256 /* Async */); @@ -15444,7 +15544,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - if (!(name.kind === 154 /* ComputedPropertyName */ || name.kind === 195 /* ElementAccessExpression */)) { + if (!(name.kind === 155 /* ComputedPropertyName */ || name.kind === 196 /* ElementAccessExpression */)) { return false; } var expr = ts.isElementAccessExpression(name) ? name.argumentExpression : name.expression; @@ -15470,7 +15570,7 @@ var ts; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -15533,11 +15633,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 156 /* Parameter */; + return root.kind === 157 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 191 /* BindingElement */) { + while (node.kind === 192 /* BindingElement */) { node = node.parent.parent; } return node; @@ -15545,15 +15645,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 162 /* Constructor */ - || kind === 201 /* FunctionExpression */ - || kind === 244 /* FunctionDeclaration */ - || kind === 202 /* ArrowFunction */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */ - || kind === 249 /* ModuleDeclaration */ - || kind === 290 /* SourceFile */; + return kind === 163 /* Constructor */ + || kind === 202 /* FunctionExpression */ + || kind === 245 /* FunctionDeclaration */ + || kind === 203 /* ArrowFunction */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */ + || kind === 250 /* ModuleDeclaration */ + || kind === 291 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -15572,23 +15672,23 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 197 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 198 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 197 /* NewExpression */: + case 198 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 207 /* PrefixUnaryExpression */: - case 204 /* TypeOfExpression */: - case 205 /* VoidExpression */: - case 203 /* DeleteExpression */: - case 206 /* AwaitExpression */: - case 210 /* ConditionalExpression */: - case 212 /* YieldExpression */: + case 208 /* PrefixUnaryExpression */: + case 205 /* TypeOfExpression */: + case 206 /* VoidExpression */: + case 204 /* DeleteExpression */: + case 207 /* AwaitExpression */: + case 211 /* ConditionalExpression */: + case 213 /* YieldExpression */: return 1 /* Right */; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (operator) { case 42 /* AsteriskAsteriskToken */: case 62 /* EqualsToken */: @@ -15612,15 +15712,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 197 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 198 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 209 /* BinaryExpression */) { + if (expression.kind === 210 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 207 /* PrefixUnaryExpression */ || expression.kind === 208 /* PostfixUnaryExpression */) { + else if (expression.kind === 208 /* PrefixUnaryExpression */ || expression.kind === 209 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -15630,15 +15730,15 @@ var ts; ts.getOperator = getOperator; function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: return 0; - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return 1; - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return 2; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return 4; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (operatorKind) { case 27 /* CommaToken */: return 0; @@ -15659,21 +15759,21 @@ var ts; default: return getBinaryOperatorPrecedence(operatorKind); } - case 207 /* PrefixUnaryExpression */: - case 204 /* TypeOfExpression */: - case 205 /* VoidExpression */: - case 203 /* DeleteExpression */: - case 206 /* AwaitExpression */: + case 208 /* PrefixUnaryExpression */: + case 205 /* TypeOfExpression */: + case 206 /* VoidExpression */: + case 204 /* DeleteExpression */: + case 207 /* AwaitExpression */: return 16; - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return 17; - case 196 /* CallExpression */: + case 197 /* CallExpression */: return 18; - case 197 /* NewExpression */: + case 198 /* NewExpression */: return hasArguments ? 19 : 18; - case 198 /* TaggedTemplateExpression */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 199 /* TaggedTemplateExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return 19; case 104 /* ThisKeyword */: case 102 /* SuperKeyword */: @@ -15684,19 +15784,19 @@ var ts; case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 214 /* ClassExpression */: - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 270 /* JsxFragment */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 215 /* ClassExpression */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 271 /* JsxFragment */: case 13 /* RegularExpressionLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 211 /* TemplateExpression */: - case 200 /* ParenthesizedExpression */: - case 215 /* OmittedExpression */: + case 212 /* TemplateExpression */: + case 201 /* ParenthesizedExpression */: + case 216 /* OmittedExpression */: return 20; default: return -1; @@ -16298,10 +16398,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 163 /* GetAccessor */) { + if (accessor.kind === 164 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 164 /* SetAccessor */) { + else if (accessor.kind === 165 /* SetAccessor */) { setAccessor = accessor; } else { @@ -16321,10 +16421,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 163 /* GetAccessor */ && !getAccessor) { + if (member.kind === 164 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 164 /* SetAccessor */ && !setAccessor) { + if (member.kind === 165 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -16373,7 +16473,7 @@ var ts; ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations; /** template tags are only available when a typedef isn't already using them */ function isNonTypeAliasTemplate(tag) { - return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 303 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); + return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 304 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); } /** * Gets the effective type annotation of the value parameter of a set accessor. If the node @@ -16597,7 +16697,7 @@ var ts; } ts.getSelectedModifierFlags = getSelectedModifierFlags; function getModifierFlags(node) { - if (node.kind >= 0 /* FirstToken */ && node.kind <= 152 /* LastToken */) { + if (node.kind >= 0 /* FirstToken */ && node.kind <= 153 /* LastToken */) { return 0 /* None */; } if (node.modifierFlagsCache & 536870912 /* HasComputedFlags */) { @@ -16639,11 +16739,11 @@ var ts; case 117 /* PrivateKeyword */: return 8 /* Private */; case 122 /* AbstractKeyword */: return 128 /* Abstract */; case 89 /* ExportKeyword */: return 1 /* Export */; - case 130 /* DeclareKeyword */: return 2 /* Ambient */; + case 131 /* DeclareKeyword */: return 2 /* Ambient */; case 81 /* ConstKeyword */: return 2048 /* Const */; case 84 /* DefaultKeyword */: return 512 /* Default */; case 126 /* AsyncKeyword */: return 256 /* Async */; - case 138 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 139 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } @@ -16683,8 +16783,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 193 /* ObjectLiteralExpression */ - || kind === 192 /* ArrayLiteralExpression */; + return kind === 194 /* ObjectLiteralExpression */ + || kind === 193 /* ArrayLiteralExpression */; } return false; } @@ -16701,12 +16801,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: do { node = node.left; } while (node.kind !== 75 /* Identifier */); return node; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 75 /* Identifier */); @@ -16716,14 +16816,19 @@ var ts; ts.getFirstIdentifier = getFirstIdentifier; function isDottedName(node) { return node.kind === 75 /* Identifier */ || node.kind === 104 /* ThisKeyword */ || node.kind === 102 /* SuperKeyword */ || - node.kind === 194 /* PropertyAccessExpression */ && isDottedName(node.expression) || - node.kind === 200 /* ParenthesizedExpression */ && isDottedName(node.expression); + node.kind === 195 /* PropertyAccessExpression */ && isDottedName(node.expression) || + node.kind === 201 /* ParenthesizedExpression */ && isDottedName(node.expression); } ts.isDottedName = isDottedName; function isPropertyAccessEntityNameExpression(node) { return ts.isPropertyAccessExpression(node) && isEntityNameExpression(node.expression); } ts.isPropertyAccessEntityNameExpression = isPropertyAccessEntityNameExpression; + function isConstructorAccessExpression(expr) { + return (ts.isPropertyAccessExpression(expr) && ts.idText(expr.name) === "constructor" || + ts.isElementAccessExpression(expr) && ts.isStringLiteralLike(expr.argumentExpression) && expr.argumentExpression.text === "constructor"); + } + ts.isConstructorAccessExpression = isConstructorAccessExpression; function tryGetPropertyAccessOrIdentifierToString(expr) { if (ts.isPropertyAccessExpression(expr)) { var baseStr = tryGetPropertyAccessOrIdentifierToString(expr.expression); @@ -16742,17 +16847,17 @@ var ts; } ts.isPrototypeAccess = isPrototypeAccess; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 153 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 154 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 193 /* ObjectLiteralExpression */ && + return expression.kind === 194 /* ObjectLiteralExpression */ && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 192 /* ArrayLiteralExpression */ && + return expression.kind === 193 /* ArrayLiteralExpression */ && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -17050,8 +17155,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 248 /* EnumDeclaration */: - case 249 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 250 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -17128,35 +17233,35 @@ var ts; if (!parent) return 0 /* Read */; switch (parent.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return accessKind(parent); - case 208 /* PostfixUnaryExpression */: - case 207 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: var operator = parent.operator; return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 62 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return parent.name !== node ? 0 /* Read */ : accessKind(parent); - case 281 /* PropertyAssignment */: { + case 282 /* PropertyAssignment */: { var parentAccess = accessKind(parent.parent); // In `({ x: varname }) = { x: 1 }`, the left `x` is a read, the right `x` is a write. return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess; } - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: // Assume it's the local variable being accessed, since we don't check public properties for --noUnusedLocals. return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return accessKind(parent); default: return 0 /* Read */; } function writeOrReadWrite() { // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect. - return parent.parent && skipParenthesesUp(parent.parent).kind === 226 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; + return parent.parent && skipParenthesesUp(parent.parent).kind === 227 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; } } function reverseAccessKind(a) { @@ -17305,39 +17410,39 @@ var ts; } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; function isTypeNodeKind(kind) { - return (kind >= 168 /* FirstTypeNode */ && kind <= 188 /* LastTypeNode */) + return (kind >= 169 /* FirstTypeNode */ && kind <= 189 /* LastTypeNode */) || kind === 125 /* AnyKeyword */ - || kind === 148 /* UnknownKeyword */ - || kind === 140 /* NumberKeyword */ - || kind === 151 /* BigIntKeyword */ - || kind === 141 /* ObjectKeyword */ - || kind === 128 /* BooleanKeyword */ - || kind === 143 /* StringKeyword */ - || kind === 144 /* SymbolKeyword */ + || kind === 149 /* UnknownKeyword */ + || kind === 141 /* NumberKeyword */ + || kind === 152 /* BigIntKeyword */ + || kind === 142 /* ObjectKeyword */ + || kind === 129 /* BooleanKeyword */ + || kind === 144 /* StringKeyword */ + || kind === 145 /* SymbolKeyword */ || kind === 104 /* ThisKeyword */ || kind === 110 /* VoidKeyword */ - || kind === 146 /* UndefinedKeyword */ + || kind === 147 /* UndefinedKeyword */ || kind === 100 /* NullKeyword */ - || kind === 137 /* NeverKeyword */ - || kind === 216 /* ExpressionWithTypeArguments */ - || kind === 295 /* JSDocAllType */ - || kind === 296 /* JSDocUnknownType */ - || kind === 297 /* JSDocNullableType */ - || kind === 298 /* JSDocNonNullableType */ - || kind === 299 /* JSDocOptionalType */ - || kind === 300 /* JSDocFunctionType */ - || kind === 301 /* JSDocVariadicType */; + || kind === 138 /* NeverKeyword */ + || kind === 217 /* ExpressionWithTypeArguments */ + || kind === 296 /* JSDocAllType */ + || kind === 297 /* JSDocUnknownType */ + || kind === 298 /* JSDocNullableType */ + || kind === 299 /* JSDocNonNullableType */ + || kind === 300 /* JSDocOptionalType */ + || kind === 301 /* JSDocFunctionType */ + || kind === 302 /* JSDocVariadicType */; } ts.isTypeNodeKind = isTypeNodeKind; function isAccessExpression(node) { - return node.kind === 194 /* PropertyAccessExpression */ || node.kind === 195 /* ElementAccessExpression */; + return node.kind === 195 /* PropertyAccessExpression */ || node.kind === 196 /* ElementAccessExpression */; } ts.isAccessExpression = isAccessExpression; function getNameOfAccessExpression(node) { - if (node.kind === 194 /* PropertyAccessExpression */) { + if (node.kind === 195 /* PropertyAccessExpression */) { return node.name; } - ts.Debug.assert(node.kind === 195 /* ElementAccessExpression */); + ts.Debug.assert(node.kind === 196 /* ElementAccessExpression */); return node.argumentExpression; } ts.getNameOfAccessExpression = getNameOfAccessExpression; @@ -17351,12 +17456,8 @@ var ts; } } ts.isBundleFileTextLike = isBundleFileTextLike; - function getDotOrQuestionDotToken(node) { - return node.questionDotToken || ts.createNode(24 /* DotToken */, node.expression.end, node.name.pos); - } - ts.getDotOrQuestionDotToken = getDotOrQuestionDotToken; function isNamedImportsOrExports(node) { - return node.kind === 257 /* NamedImports */ || node.kind === 261 /* NamedExports */; + return node.kind === 258 /* NamedImports */ || node.kind === 262 /* NamedExports */; } ts.isNamedImportsOrExports = isNamedImportsOrExports; function Symbol(flags, name) { @@ -18434,34 +18535,44 @@ var ts; function isValidTypeOnlyAliasUseSite(useSite) { return !!(useSite.flags & 8388608 /* Ambient */) || isPartOfTypeQuery(useSite) - || isFirstIdentifierOfNonEmittingHeritageClause(useSite) + || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !isExpressionNode(useSite); } ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite; function typeOnlyDeclarationIsExport(typeOnlyDeclaration) { - return typeOnlyDeclaration.kind === 263 /* ExportSpecifier */; + return typeOnlyDeclaration.kind === 264 /* ExportSpecifier */; } ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport; function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { - while (node.kind === 75 /* Identifier */ || node.kind === 194 /* PropertyAccessExpression */) { + while (node.kind === 75 /* Identifier */ || node.kind === 195 /* PropertyAccessExpression */) { node = node.parent; } - if (node.kind !== 154 /* ComputedPropertyName */) { + if (node.kind !== 155 /* ComputedPropertyName */) { return false; } if (hasModifier(node.parent, 128 /* Abstract */)) { return true; } var containerKind = node.parent.parent.kind; - return containerKind === 246 /* InterfaceDeclaration */ || containerKind === 173 /* TypeLiteral */; + return containerKind === 247 /* InterfaceDeclaration */ || containerKind === 174 /* TypeLiteral */; } - /** Returns true for the first identifier of 1) an `implements` clause, and 2) an `extends` clause of an interface. */ - function isFirstIdentifierOfNonEmittingHeritageClause(node) { - var _a, _b; - // Number of parents to climb from identifier is 2 for `implements I`, 3 for `implements x.I` - var heritageClause = (_a = ts.tryCast(node.parent.parent, ts.isHeritageClause)) !== null && _a !== void 0 ? _a : ts.tryCast((_b = node.parent.parent) === null || _b === void 0 ? void 0 : _b.parent, ts.isHeritageClause); - return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 246 /* InterfaceDeclaration */; + /** Returns true for an identifier in 1) an `implements` clause, and 2) an `extends` clause of an interface. */ + function isIdentifierInNonEmittingHeritageClause(node) { + if (node.kind !== 75 /* Identifier */) + return false; + var heritageClause = findAncestor(node.parent, function (parent) { + switch (parent.kind) { + case 280 /* HeritageClause */: + return true; + case 195 /* PropertyAccessExpression */: + case 217 /* ExpressionWithTypeArguments */: + return false; + default: + return "quit"; + } + }); + return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 247 /* InterfaceDeclaration */; } })(ts || (ts = {})); var ts; @@ -18481,7 +18592,7 @@ var ts; var PrivateIdentifierConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 290 /* SourceFile */) { + if (kind === 291 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 75 /* Identifier */) { @@ -18536,19 +18647,19 @@ var ts; * that they appear in the source code. The language service depends on this property to locate nodes by position. */ function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 152 /* LastToken */) { + if (!node || node.kind <= 153 /* LastToken */) { return; } switch (node.kind) { - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -18556,9 +18667,9 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 156 /* Parameter */: + case 157 /* Parameter */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || @@ -18566,7 +18677,7 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -18574,51 +18685,51 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.initializer); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -18630,359 +18741,359 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return visitNode(cbNode, node.assertsModifier) || visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return visitNodes(cbNode, cbNodes, node.members); - case 174 /* ArrayType */: + case 175 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 175 /* TupleType */: + case 176 /* TupleType */: return visitNodes(cbNode, cbNodes, node.elementTypes); - case 178 /* UnionType */: - case 179 /* IntersectionType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: return visitNodes(cbNode, cbNodes, node.types); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return visitNode(cbNode, node.checkType) || visitNode(cbNode, node.extendsType) || visitNode(cbNode, node.trueType) || visitNode(cbNode, node.falseType); - case 181 /* InferType */: + case 182 /* InferType */: return visitNode(cbNode, node.typeParameter); - case 188 /* ImportType */: + case 189 /* ImportType */: return visitNode(cbNode, node.argument) || visitNode(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 182 /* ParenthesizedType */: - case 184 /* TypeOperator */: + case 183 /* ParenthesizedType */: + case 185 /* TypeOperator */: return visitNode(cbNode, node.type); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 186 /* MappedType */: + case 187 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 187 /* LiteralType */: + case 188 /* LiteralType */: return visitNode(cbNode, node.literal); - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: return visitNodes(cbNode, cbNodes, node.elements); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return visitNodes(cbNode, cbNodes, node.properties); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.name); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.argumentExpression); - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.template); - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 217 /* AsExpression */: + case 218 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return visitNode(cbNode, node.name); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 223 /* Block */: - case 250 /* ModuleBlock */: + case 224 /* Block */: + case 251 /* ModuleBlock */: return visitNodes(cbNode, cbNodes, node.statements); - case 290 /* SourceFile */: + case 291 /* SourceFile */: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return visitNodes(cbNode, cbNodes, node.declarations); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 233 /* ContinueStatement */: - case 234 /* BreakStatement */: + case 234 /* ContinueStatement */: + case 235 /* BreakStatement */: return visitNode(cbNode, node.label); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return visitNodes(cbNode, cbNodes, node.clauses); - case 277 /* CaseClause */: + case 278 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: return visitNodes(cbNode, cbNodes, node.statements); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 157 /* Decorator */: + case 158 /* Decorator */: return visitNode(cbNode, node.expression); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 284 /* EnumMember */: + case 285 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: return visitNode(cbNode, node.name); - case 257 /* NamedImports */: - case 261 /* NamedExports */: + case 258 /* NamedImports */: + case 262 /* NamedExports */: return visitNodes(cbNode, cbNodes, node.elements); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: return visitNodes(cbNode, cbNodes, node.types); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 264 /* MissingDeclaration */: + case 265 /* MissingDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators); - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 266 /* JsxElement */: + case 267 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.attributes); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return visitNodes(cbNode, cbNodes, node.properties); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 275 /* JsxSpreadAttribute */: + case 276 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 176 /* OptionalType */: - case 177 /* RestType */: - case 294 /* JSDocTypeExpression */: - case 298 /* JSDocNonNullableType */: - case 297 /* JSDocNullableType */: - case 299 /* JSDocOptionalType */: - case 301 /* JSDocVariadicType */: + case 177 /* OptionalType */: + case 178 /* RestType */: + case 295 /* JSDocTypeExpression */: + case 299 /* JSDocNonNullableType */: + case 298 /* JSDocNullableType */: + case 300 /* JSDocOptionalType */: + case 302 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 303 /* JSDocComment */: + case 304 /* JSDocComment */: return visitNodes(cbNode, cbNodes, node.tags); - case 317 /* JSDocParameterTag */: - case 323 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: + case 324 /* JSDocPropertyTag */: return visitNode(cbNode, node.tagName) || (node.isNameFirst ? visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression) : visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name)); - case 309 /* JSDocAuthorTag */: + case 310 /* JSDocAuthorTag */: return visitNode(cbNode, node.tagName); - case 308 /* JSDocImplementsTag */: + case 309 /* JSDocImplementsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 307 /* JSDocAugmentsTag */: + case 308 /* JSDocAugmentsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); - case 322 /* JSDocTypedefTag */: + case 323 /* JSDocTypedefTag */: return visitNode(cbNode, node.tagName) || (node.typeExpression && - node.typeExpression.kind === 294 /* JSDocTypeExpression */ + node.typeExpression.kind === 295 /* JSDocTypeExpression */ ? visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) : visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression)); - case 315 /* JSDocCallbackTag */: + case 316 /* JSDocCallbackTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); - case 318 /* JSDocReturnTag */: - case 320 /* JSDocTypeTag */: - case 319 /* JSDocThisTag */: - case 316 /* JSDocEnumTag */: + case 319 /* JSDocReturnTag */: + case 321 /* JSDocTypeTag */: + case 320 /* JSDocThisTag */: + case 317 /* JSDocEnumTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.typeExpression); - case 305 /* JSDocSignature */: + case 306 /* JSDocSignature */: return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); - case 304 /* JSDocTypeLiteral */: + case 305 /* JSDocTypeLiteral */: return ts.forEach(node.jsDocPropertyTags, cbNode); - case 306 /* JSDocTag */: - case 310 /* JSDocClassTag */: - case 311 /* JSDocPublicTag */: - case 312 /* JSDocPrivateTag */: - case 313 /* JSDocProtectedTag */: - case 314 /* JSDocReadonlyTag */: + case 307 /* JSDocTag */: + case 311 /* JSDocClassTag */: + case 312 /* JSDocPublicTag */: + case 313 /* JSDocPrivateTag */: + case 314 /* JSDocProtectedTag */: + case 315 /* JSDocReadonlyTag */: return visitNode(cbNode, node.tagName); - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } } @@ -19271,7 +19382,7 @@ var ts; sourceFile.endOfFileToken = parseTokenNode(); } else { - var statement = createNode(226 /* ExpressionStatement */); + var statement = createNode(227 /* ExpressionStatement */); switch (token()) { case 22 /* OpenBracketToken */: statement.expression = parseArrayLiteralExpression(); @@ -19355,6 +19466,7 @@ var ts; } function clearState() { // Clear out the text the scanner is pointing at, so it doesn't keep anything alive unnecessarily. + scanner.clearCommentDirectives(); scanner.setText(""); scanner.setOnError(undefined); // Clear any data. We don't want to accidentally hold onto it for too long. @@ -19381,6 +19493,7 @@ var ts; ts.Debug.assert(token() === 1 /* EndOfFileToken */); sourceFile.endOfFileToken = addJSDocComment(parseTokenNode()); setExternalModuleIndicator(sourceFile); + sourceFile.commentDirectives = scanner.getCommentDirectives(); sourceFile.nodeCount = nodeCount; sourceFile.identifierCount = identifierCount; sourceFile.identifiers = identifiers; @@ -19421,7 +19534,7 @@ var ts; function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(290 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(291 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -19753,7 +19866,7 @@ var ts; } function createNodeWithJSDoc(kind, pos) { var node = createNode(kind, pos); - if (scanner.getTokenFlags() & 2 /* PrecedingJSDocComment */) { + if (scanner.getTokenFlags() & 2 /* PrecedingJSDocComment */ && (kind !== 227 /* ExpressionStatement */ || token() !== 20 /* OpenParenToken */)) { addJSDocComment(node); } return node; @@ -19865,7 +19978,7 @@ var ts; // PropertyName [Yield]: // LiteralPropertyName // ComputedPropertyName[?Yield] - var node = createNode(154 /* ComputedPropertyName */); + var node = createNode(155 /* ComputedPropertyName */); parseExpected(22 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -19907,15 +20020,15 @@ var ts; if (token() === 84 /* DefaultKeyword */) { return lookAhead(nextTokenCanFollowDefaultKeyword); } - if (token() === 145 /* TypeKeyword */) { + if (token() === 146 /* TypeKeyword */) { return lookAhead(nextTokenCanFollowExportModifier); } return canFollowExportModifier(); case 84 /* DefaultKeyword */: return nextTokenCanFollowDefaultKeyword(); case 120 /* StaticKeyword */: - case 131 /* GetKeyword */: - case 142 /* SetKeyword */: + case 132 /* GetKeyword */: + case 143 /* SetKeyword */: nextToken(); return canFollowModifier(); default: @@ -20325,20 +20438,20 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 162 /* Constructor */: - case 167 /* IndexSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 159 /* PropertyDeclaration */: - case 222 /* SemicolonClassElement */: + case 163 /* Constructor */: + case 168 /* IndexSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 223 /* SemicolonClassElement */: return true; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: // Method declarations are not necessarily reusable. An object-literal // may have a method calls "constructor(...)" and we must reparse that // into an actual .ConstructorDeclaration. var methodDeclaration = node; var nameIsConstructor = methodDeclaration.name.kind === 75 /* Identifier */ && - methodDeclaration.name.originalKeywordKind === 129 /* ConstructorKeyword */; + methodDeclaration.name.originalKeywordKind === 130 /* ConstructorKeyword */; return !nameIsConstructor; } } @@ -20347,8 +20460,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: return true; } } @@ -20357,58 +20470,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 225 /* VariableStatement */: - case 223 /* Block */: - case 227 /* IfStatement */: - case 226 /* ExpressionStatement */: - case 239 /* ThrowStatement */: - case 235 /* ReturnStatement */: - case 237 /* SwitchStatement */: - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 230 /* ForStatement */: - case 229 /* WhileStatement */: - case 236 /* WithStatement */: - case 224 /* EmptyStatement */: - case 240 /* TryStatement */: - case 238 /* LabeledStatement */: - case 228 /* DoStatement */: - case 241 /* DebuggerStatement */: - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 260 /* ExportDeclaration */: - case 259 /* ExportAssignment */: - case 249 /* ModuleDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 245 /* FunctionDeclaration */: + case 226 /* VariableStatement */: + case 224 /* Block */: + case 228 /* IfStatement */: + case 227 /* ExpressionStatement */: + case 240 /* ThrowStatement */: + case 236 /* ReturnStatement */: + case 238 /* SwitchStatement */: + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 231 /* ForStatement */: + case 230 /* WhileStatement */: + case 237 /* WithStatement */: + case 225 /* EmptyStatement */: + case 241 /* TryStatement */: + case 239 /* LabeledStatement */: + case 229 /* DoStatement */: + case 242 /* DebuggerStatement */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 261 /* ExportDeclaration */: + case 260 /* ExportAssignment */: + case 250 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 284 /* EnumMember */; + return node.kind === 285 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 166 /* ConstructSignature */: - case 160 /* MethodSignature */: - case 167 /* IndexSignature */: - case 158 /* PropertySignature */: - case 165 /* CallSignature */: + case 167 /* ConstructSignature */: + case 161 /* MethodSignature */: + case 168 /* IndexSignature */: + case 159 /* PropertySignature */: + case 166 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 242 /* VariableDeclaration */) { + if (node.kind !== 243 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -20429,7 +20542,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 156 /* Parameter */) { + if (node.kind !== 157 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -20568,7 +20681,7 @@ var ts; return entity; } function createQualifiedName(entity, name) { - var node = createNode(153 /* QualifiedName */, entity.pos); + var node = createNode(154 /* QualifiedName */, entity.pos); node.left = entity; node.right = name; return finishNode(node); @@ -20609,7 +20722,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression(isTaggedTemplate) { - var template = createNode(211 /* TemplateExpression */); + var template = createNode(212 /* TemplateExpression */); template.head = parseTemplateHead(isTaggedTemplate); ts.Debug.assert(template.head.kind === 15 /* TemplateHead */, "Template head has wrong token kind"); var list = []; @@ -20621,7 +20734,7 @@ var ts; return finishNode(template); } function parseTemplateSpan(isTaggedTemplate) { - var span = createNode(221 /* TemplateSpan */); + var span = createNode(222 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token() === 19 /* CloseBraceToken */) { @@ -20687,7 +20800,7 @@ var ts; } // TYPES function parseTypeReference() { - var node = createNode(169 /* TypeReference */); + var node = createNode(170 /* TypeReference */); node.typeName = parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29 /* LessThanToken */) { node.typeArguments = parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */); @@ -20697,14 +20810,14 @@ var ts; // If true, we should abort parsing an error function. function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return ts.nodeIsMissing(node.typeName); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: { + case 171 /* FunctionType */: + case 172 /* ConstructorType */: { var _a = node, parameters = _a.parameters, type = _a.type; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -20712,20 +20825,20 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(168 /* TypePredicate */, lhs.pos); + var node = createNode(169 /* TypePredicate */, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(183 /* ThisType */); + var node = createNode(184 /* ThisType */); nextToken(); return finishNode(node); } function parseJSDocAllType(postFixEquals) { - var result = createNode(295 /* JSDocAllType */); + var result = createNode(296 /* JSDocAllType */); if (postFixEquals) { - return createPostfixType(299 /* JSDocOptionalType */, result); + return createPostfixType(300 /* JSDocOptionalType */, result); } else { nextToken(); @@ -20733,7 +20846,7 @@ var ts; return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(298 /* JSDocNonNullableType */); + var result = createNode(299 /* JSDocNonNullableType */); nextToken(); result.type = parseNonArrayType(); return finishNode(result); @@ -20757,28 +20870,28 @@ var ts; token() === 31 /* GreaterThanToken */ || token() === 62 /* EqualsToken */ || token() === 51 /* BarToken */) { - var result = createNode(296 /* JSDocUnknownType */, pos); + var result = createNode(297 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(297 /* JSDocNullableType */, pos); + var result = createNode(298 /* JSDocNullableType */, pos); result.type = parseType(); return finishNode(result); } } function parseJSDocFunctionType() { if (lookAhead(nextTokenIsOpenParen)) { - var result = createNodeWithJSDoc(300 /* JSDocFunctionType */); + var result = createNodeWithJSDoc(301 /* JSDocFunctionType */); nextToken(); fillSignature(58 /* ColonToken */, 4 /* Type */ | 32 /* JSDoc */, result); return finishNode(result); } - var node = createNode(169 /* TypeReference */); + var node = createNode(170 /* TypeReference */); node.typeName = parseIdentifierName(); return finishNode(node); } function parseJSDocParameter() { - var parameter = createNode(156 /* Parameter */); + var parameter = createNode(157 /* Parameter */); if (token() === 104 /* ThisKeyword */ || token() === 99 /* NewKeyword */) { parameter.name = parseIdentifierName(); parseExpected(58 /* ColonToken */); @@ -20788,9 +20901,9 @@ var ts; } function parseJSDocType() { scanner.setInJSDocType(true); - var moduleSpecifier = parseOptionalToken(135 /* ModuleKeyword */); + var moduleSpecifier = parseOptionalToken(136 /* ModuleKeyword */); if (moduleSpecifier) { - var moduleTag = createNode(302 /* JSDocNamepathType */, moduleSpecifier.pos); + var moduleTag = createNode(303 /* JSDocNamepathType */, moduleSpecifier.pos); terminate: while (true) { switch (token()) { case 19 /* CloseBraceToken */: @@ -20809,23 +20922,23 @@ var ts; var type = parseTypeOrTypePredicate(); scanner.setInJSDocType(false); if (dotdotdot) { - var variadic = createNode(301 /* JSDocVariadicType */, dotdotdot.pos); + var variadic = createNode(302 /* JSDocVariadicType */, dotdotdot.pos); variadic.type = type; type = finishNode(variadic); } if (token() === 62 /* EqualsToken */) { - return createPostfixType(299 /* JSDocOptionalType */, type); + return createPostfixType(300 /* JSDocOptionalType */, type); } return type; } function parseTypeQuery() { - var node = createNode(172 /* TypeQuery */); + var node = createNode(173 /* TypeQuery */); parseExpected(108 /* TypeOfKeyword */); node.exprName = parseEntityName(/*allowReservedWords*/ true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(155 /* TypeParameter */); + var node = createNode(156 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(90 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the @@ -20870,7 +20983,7 @@ var ts; isStartOfType(/*inStartOfParameter*/ !isJSDocParameter); } function parseParameter() { - var node = createNodeWithJSDoc(156 /* Parameter */); + var node = createNodeWithJSDoc(157 /* Parameter */); if (token() === 104 /* ThisKeyword */) { node.name = createIdentifier(/*isIdentifier*/ true); node.type = parseParameterType(); @@ -20971,7 +21084,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 166 /* ConstructSignature */) { + if (kind === 167 /* ConstructSignature */) { parseExpected(99 /* NewKeyword */); } fillSignature(58 /* ColonToken */, 4 /* Type */, node); @@ -21032,7 +21145,7 @@ var ts; return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(node) { - node.kind = 167 /* IndexSignature */; + node.kind = 168 /* IndexSignature */; node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -21042,13 +21155,13 @@ var ts; node.name = parsePropertyName(); node.questionToken = parseOptionalToken(57 /* QuestionToken */); if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - node.kind = 160 /* MethodSignature */; + node.kind = 161 /* MethodSignature */; // Method signatures don't exist in expression contexts. So they have neither // [Yield] nor [Await] fillSignature(58 /* ColonToken */, 4 /* Type */, node); } else { - node.kind = 158 /* PropertySignature */; + node.kind = 159 /* PropertySignature */; node.type = parseTypeAnnotation(); if (token() === 62 /* EqualsToken */) { // Although type literal properties cannot not have initializers, we attempt @@ -21094,10 +21207,10 @@ var ts; } function parseTypeMember() { if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - return parseSignatureMember(165 /* CallSignature */); + return parseSignatureMember(166 /* CallSignature */); } if (token() === 99 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(166 /* ConstructSignature */); + return parseSignatureMember(167 /* ConstructSignature */); } var node = createNodeWithJSDoc(0 /* Unknown */); node.modifiers = parseModifiers(); @@ -21123,7 +21236,7 @@ var ts; return false; } function parseTypeLiteral() { - var node = createNode(173 /* TypeLiteral */); + var node = createNode(174 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -21141,27 +21254,27 @@ var ts; function isStartOfMappedType() { nextToken(); if (token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { - return nextToken() === 138 /* ReadonlyKeyword */; + return nextToken() === 139 /* ReadonlyKeyword */; } - if (token() === 138 /* ReadonlyKeyword */) { + if (token() === 139 /* ReadonlyKeyword */) { nextToken(); } return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 97 /* InKeyword */; } function parseMappedTypeParameter() { - var node = createNode(155 /* TypeParameter */); + var node = createNode(156 /* TypeParameter */); node.name = parseIdentifier(); parseExpected(97 /* InKeyword */); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(186 /* MappedType */); + var node = createNode(187 /* MappedType */); parseExpected(18 /* OpenBraceToken */); - if (token() === 138 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { + if (token() === 139 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { node.readonlyToken = parseTokenNode(); - if (node.readonlyToken.kind !== 138 /* ReadonlyKeyword */) { - parseExpectedToken(138 /* ReadonlyKeyword */); + if (node.readonlyToken.kind !== 139 /* ReadonlyKeyword */) { + parseExpectedToken(139 /* ReadonlyKeyword */); } } parseExpected(22 /* OpenBracketToken */); @@ -21181,23 +21294,23 @@ var ts; function parseTupleElementType() { var pos = getNodePos(); if (parseOptional(25 /* DotDotDotToken */)) { - var node = createNode(177 /* RestType */, pos); + var node = createNode(178 /* RestType */, pos); node.type = parseType(); return finishNode(node); } var type = parseType(); - if (!(contextFlags & 4194304 /* JSDoc */) && type.kind === 297 /* JSDocNullableType */ && type.pos === type.type.pos) { - type.kind = 176 /* OptionalType */; + if (!(contextFlags & 4194304 /* JSDoc */) && type.kind === 298 /* JSDocNullableType */ && type.pos === type.type.pos) { + type.kind = 177 /* OptionalType */; } return type; } function parseTupleType() { - var node = createNode(175 /* TupleType */); + var node = createNode(176 /* TupleType */); node.elementTypes = parseBracketedList(21 /* TupleElementTypes */, parseTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(182 /* ParenthesizedType */); + var node = createNode(183 /* ParenthesizedType */); parseExpected(20 /* OpenParenToken */); node.type = parseType(); parseExpected(21 /* CloseParenToken */); @@ -21205,7 +21318,7 @@ var ts; } function parseFunctionOrConstructorType() { var pos = getNodePos(); - var kind = parseOptional(99 /* NewKeyword */) ? 171 /* ConstructorType */ : 170 /* FunctionType */; + var kind = parseOptional(99 /* NewKeyword */) ? 172 /* ConstructorType */ : 171 /* FunctionType */; var node = createNodeWithJSDoc(kind, pos); fillSignature(38 /* EqualsGreaterThanToken */, 4 /* Type */, node); return finishNode(node); @@ -21215,10 +21328,10 @@ var ts; return token() === 24 /* DotToken */ ? undefined : node; } function parseLiteralTypeNode(negative) { - var node = createNode(187 /* LiteralType */); + var node = createNode(188 /* LiteralType */); var unaryMinusExpression; if (negative) { - unaryMinusExpression = createNode(207 /* PrefixUnaryExpression */); + unaryMinusExpression = createNode(208 /* PrefixUnaryExpression */); unaryMinusExpression.operator = 40 /* MinusToken */; nextToken(); } @@ -21239,7 +21352,7 @@ var ts; } function parseImportType() { sourceFile.flags |= 1048576 /* PossiblyContainsDynamicImport */; - var node = createNode(188 /* ImportType */); + var node = createNode(189 /* ImportType */); if (parseOptional(108 /* TypeOfKeyword */)) { node.isTypeOf = true; } @@ -21262,15 +21375,15 @@ var ts; function parseNonArrayType() { switch (token()) { case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 144 /* SymbolKeyword */: - case 128 /* BooleanKeyword */: - case 146 /* UndefinedKeyword */: - case 137 /* NeverKeyword */: - case 141 /* ObjectKeyword */: + case 149 /* UnknownKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 145 /* SymbolKeyword */: + case 129 /* BooleanKeyword */: + case 147 /* UndefinedKeyword */: + case 138 /* NeverKeyword */: + case 142 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 41 /* AsteriskToken */: @@ -21301,7 +21414,7 @@ var ts; return parseTokenNode(); case 104 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 133 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 134 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -21327,20 +21440,20 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 128 /* BooleanKeyword */: - case 138 /* ReadonlyKeyword */: - case 144 /* SymbolKeyword */: - case 147 /* UniqueKeyword */: + case 149 /* UnknownKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 129 /* BooleanKeyword */: + case 139 /* ReadonlyKeyword */: + case 145 /* SymbolKeyword */: + case 148 /* UniqueKeyword */: case 110 /* VoidKeyword */: - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: case 100 /* NullKeyword */: case 104 /* ThisKeyword */: case 108 /* TypeOfKeyword */: - case 137 /* NeverKeyword */: + case 138 /* NeverKeyword */: case 18 /* OpenBraceToken */: case 22 /* OpenBracketToken */: case 29 /* LessThanToken */: @@ -21352,12 +21465,12 @@ var ts; case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: - case 141 /* ObjectKeyword */: + case 142 /* ObjectKeyword */: case 41 /* AsteriskToken */: case 57 /* QuestionToken */: case 53 /* ExclamationToken */: case 25 /* DotDotDotToken */: - case 132 /* InferKeyword */: + case 133 /* InferKeyword */: case 96 /* ImportKeyword */: case 124 /* AssertsKeyword */: return true; @@ -21382,26 +21495,26 @@ var ts; while (!scanner.hasPrecedingLineBreak()) { switch (token()) { case 53 /* ExclamationToken */: - type = createPostfixType(298 /* JSDocNonNullableType */, type); + type = createPostfixType(299 /* JSDocNonNullableType */, type); break; case 57 /* QuestionToken */: // If not in JSDoc and next token is start of a type we have a conditional type if (!(contextFlags & 4194304 /* JSDoc */) && lookAhead(nextTokenIsStartOfType)) { return type; } - type = createPostfixType(297 /* JSDocNullableType */, type); + type = createPostfixType(298 /* JSDocNullableType */, type); break; case 22 /* OpenBracketToken */: parseExpected(22 /* OpenBracketToken */); if (isStartOfType()) { - var node = createNode(185 /* IndexedAccessType */, type.pos); + var node = createNode(186 /* IndexedAccessType */, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(23 /* CloseBracketToken */); type = finishNode(node); } else { - var node = createNode(174 /* ArrayType */, type.pos); + var node = createNode(175 /* ArrayType */, type.pos); node.elementType = type; parseExpected(23 /* CloseBracketToken */); type = finishNode(node); @@ -21420,16 +21533,16 @@ var ts; return finishNode(postfix); } function parseTypeOperator(operator) { - var node = createNode(184 /* TypeOperator */); + var node = createNode(185 /* TypeOperator */); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); return finishNode(node); } function parseInferType() { - var node = createNode(181 /* InferType */); - parseExpected(132 /* InferKeyword */); - var typeParameter = createNode(155 /* TypeParameter */); + var node = createNode(182 /* InferType */); + parseExpected(133 /* InferKeyword */); + var typeParameter = createNode(156 /* TypeParameter */); typeParameter.name = parseIdentifier(); node.typeParameter = finishNode(typeParameter); return finishNode(node); @@ -21437,11 +21550,12 @@ var ts; function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 134 /* KeyOfKeyword */: - case 147 /* UniqueKeyword */: - case 138 /* ReadonlyKeyword */: + case 135 /* KeyOfKeyword */: + case 148 /* UniqueKeyword */: + case 139 /* ReadonlyKeyword */: + case 128 /* AwaitedKeyword */: return parseTypeOperator(operator); - case 132 /* InferKeyword */: + case 133 /* InferKeyword */: return parseInferType(); } return parsePostfixTypeOrHigher(); @@ -21462,10 +21576,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(179 /* IntersectionType */, parseTypeOperatorOrHigher, 50 /* AmpersandToken */); + return parseUnionOrIntersectionType(180 /* IntersectionType */, parseTypeOperatorOrHigher, 50 /* AmpersandToken */); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(178 /* UnionType */, parseIntersectionTypeOrHigher, 51 /* BarToken */); + return parseUnionOrIntersectionType(179 /* UnionType */, parseIntersectionTypeOrHigher, 51 /* BarToken */); } function isStartOfFunctionType() { if (token() === 29 /* LessThanToken */) { @@ -21522,7 +21636,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(168 /* TypePredicate */, typePredicateVariable.pos); + var node = createNode(169 /* TypePredicate */, typePredicateVariable.pos); node.assertsModifier = undefined; node.parameterName = typePredicateVariable; node.type = type; @@ -21534,16 +21648,16 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 133 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 134 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } } function parseAssertsTypePredicate() { - var node = createNode(168 /* TypePredicate */); + var node = createNode(169 /* TypePredicate */); node.assertsModifier = parseExpectedToken(124 /* AssertsKeyword */); node.parameterName = token() === 104 /* ThisKeyword */ ? parseThisTypeNode() : parseIdentifier(); - node.type = parseOptional(133 /* IsKeyword */) ? parseType() : undefined; + node.type = parseOptional(134 /* IsKeyword */) ? parseType() : undefined; return finishNode(node); } function parseType() { @@ -21557,7 +21671,7 @@ var ts; } var type = parseUnionTypeOrHigher(); if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(90 /* ExtendsKeyword */)) { - var node = createNode(180 /* ConditionalType */, type.pos); + var node = createNode(181 /* ConditionalType */, type.pos); node.checkType = type; // The type following 'extends' is not permitted to be another conditional type node.extendsType = parseTypeWorker(/*noConditionalTypes*/ true); @@ -21752,7 +21866,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(212 /* YieldExpression */); + var node = createNode(213 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -21774,13 +21888,13 @@ var ts; ts.Debug.assert(token() === 38 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(202 /* ArrowFunction */, asyncModifier.pos); + node = createNode(203 /* ArrowFunction */, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(202 /* ArrowFunction */, identifier.pos); + node = createNode(203 /* ArrowFunction */, identifier.pos); } - var parameter = createNode(156 /* Parameter */, identifier.pos); + var parameter = createNode(157 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); @@ -21985,7 +22099,7 @@ var ts; return 0 /* False */; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNodeWithJSDoc(202 /* ArrowFunction */); + var node = createNodeWithJSDoc(203 /* ArrowFunction */); node.modifiers = parseModifiersForArrowFunction(); var isAsync = hasModifierOfKind(node, 126 /* AsyncKeyword */) ? 2 /* Await */ : 0 /* None */; // Arrow functions are never generators. @@ -22051,7 +22165,7 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(210 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(211 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -22066,7 +22180,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 97 /* InKeyword */ || t === 152 /* OfKeyword */; + return t === 97 /* InKeyword */ || t === 153 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -22131,39 +22245,39 @@ var ts; return ts.getBinaryOperatorPrecedence(token()) > 0; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(209 /* BinaryExpression */, left.pos); + var node = createNode(210 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(217 /* AsExpression */, left.pos); + var node = createNode(218 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(207 /* PrefixUnaryExpression */); + var node = createNode(208 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(203 /* DeleteExpression */); + var node = createNode(204 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(204 /* TypeOfExpression */); + var node = createNode(205 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(205 /* VoidExpression */); + var node = createNode(206 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -22179,7 +22293,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(206 /* AwaitExpression */); + var node = createNode(207 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -22223,7 +22337,7 @@ var ts; if (token() === 42 /* AsteriskAsteriskToken */) { var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); var end = simpleUnaryExpression.end; - if (simpleUnaryExpression.kind === 199 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 200 /* TypeAssertionExpression */) { parseErrorAt(pos, end, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -22320,7 +22434,7 @@ var ts; */ function parseUpdateExpression() { if (token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) { - var node = createNode(207 /* PrefixUnaryExpression */); + var node = createNode(208 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -22333,7 +22447,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(208 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(209 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -22389,7 +22503,7 @@ var ts; var fullStart = scanner.getStartPos(); nextToken(); // advance past the 'import' nextToken(); // advance past the dot - var node = createNode(219 /* MetaProperty */, fullStart); + var node = createNode(220 /* MetaProperty */, fullStart); node.keywordToken = 96 /* ImportKeyword */; node.name = parseIdentifierName(); expression = finishNode(node); @@ -22472,7 +22586,7 @@ var ts; } // If we have seen "super" it must be followed by '(' or '.'. // If it wasn't then just try to parse out a '.' and report an error. - var node = createNode(194 /* PropertyAccessExpression */, expression.pos); + var node = createNode(195 /* PropertyAccessExpression */, expression.pos); node.expression = expression; parseExpectedToken(24 /* DotToken */, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); // private names will never work with `super` (`super.#foo`), but that's a semantic error, not syntactic @@ -22482,8 +22596,8 @@ var ts; function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 268 /* JsxOpeningElement */) { - var node = createNode(266 /* JsxElement */, opening.pos); + if (opening.kind === 269 /* JsxOpeningElement */) { + var node = createNode(267 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -22492,15 +22606,15 @@ var ts; } result = finishNode(node); } - else if (opening.kind === 271 /* JsxOpeningFragment */) { - var node = createNode(270 /* JsxFragment */, opening.pos); + else if (opening.kind === 272 /* JsxOpeningFragment */) { + var node = createNode(271 /* JsxFragment */, opening.pos); node.openingFragment = opening; node.children = parseJsxChildren(node.openingFragment); node.closingFragment = parseJsxClosingFragment(inExpressionContext); result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 267 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 268 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -22515,7 +22629,7 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(209 /* BinaryExpression */, result.pos); + var badNode = createNode(210 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -22574,7 +22688,7 @@ var ts; return createNodeArray(list, listPos); } function parseJsxAttributes() { - var jsxAttributes = createNode(274 /* JsxAttributes */); + var jsxAttributes = createNode(275 /* JsxAttributes */); jsxAttributes.properties = parseList(13 /* JsxAttributes */, parseJsxAttribute); return finishNode(jsxAttributes); } @@ -22583,7 +22697,7 @@ var ts; parseExpected(29 /* LessThanToken */); if (token() === 31 /* GreaterThanToken */) { // See below for explanation of scanJsxText - var node_1 = createNode(271 /* JsxOpeningFragment */, fullStart); + var node_1 = createNode(272 /* JsxOpeningFragment */, fullStart); scanJsxText(); return finishNode(node_1); } @@ -22595,7 +22709,7 @@ var ts; // Closing tag, so scan the immediately-following text with the JSX scanning instead // of regular scanning to avoid treating illegal characters (e.g. '#') as immediate // scanning errors - node = createNode(268 /* JsxOpeningElement */, fullStart); + node = createNode(269 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -22607,7 +22721,7 @@ var ts; parseExpected(31 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(267 /* JsxSelfClosingElement */, fullStart); + node = createNode(268 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.typeArguments = typeArguments; @@ -22624,7 +22738,7 @@ var ts; var expression = token() === 104 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ false); expression = finishNode(propertyAccess); @@ -22632,7 +22746,7 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(276 /* JsxExpression */); + var node = createNode(277 /* JsxExpression */); if (!parseExpected(18 /* OpenBraceToken */)) { return undefined; } @@ -22658,7 +22772,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(273 /* JsxAttribute */); + var node = createNode(274 /* JsxAttribute */); node.name = parseIdentifierName(); if (token() === 62 /* EqualsToken */) { switch (scanJsxAttributeValue()) { @@ -22673,7 +22787,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(275 /* JsxSpreadAttribute */); + var node = createNode(276 /* JsxSpreadAttribute */); parseExpected(18 /* OpenBraceToken */); parseExpected(25 /* DotDotDotToken */); node.expression = parseExpression(); @@ -22681,7 +22795,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(269 /* JsxClosingElement */); + var node = createNode(270 /* JsxClosingElement */); parseExpected(30 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -22694,7 +22808,7 @@ var ts; return finishNode(node); } function parseJsxClosingFragment(inExpressionContext) { - var node = createNode(272 /* JsxClosingFragment */); + var node = createNode(273 /* JsxClosingFragment */); parseExpected(30 /* LessThanSlashToken */); if (ts.tokenIsIdentifierOrKeyword(token())) { parseErrorAtRange(parseJsxElementName(), ts.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment); @@ -22709,7 +22823,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(199 /* TypeAssertionExpression */); + var node = createNode(200 /* TypeAssertionExpression */); parseExpected(29 /* LessThanToken */); node.type = parseType(); parseExpected(31 /* GreaterThanToken */); @@ -22727,7 +22841,7 @@ var ts; && lookAhead(nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate); } function parsePropertyAccessExpressionRest(expression, questionDotToken) { - var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ true); @@ -22740,7 +22854,7 @@ var ts; return finishNode(propertyAccess); } function parseElementAccessExpressionRest(expression, questionDotToken) { - var indexedAccess = createNode(195 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(196 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; indexedAccess.questionDotToken = questionDotToken; if (token() === 23 /* CloseBracketToken */) { @@ -22776,7 +22890,7 @@ var ts; } if (!questionDotToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(218 /* NonNullExpression */, expression.pos); + var nonNullExpression = createNode(219 /* NonNullExpression */, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; @@ -22797,7 +22911,7 @@ var ts; return token() === 14 /* NoSubstitutionTemplateLiteral */ || token() === 15 /* TemplateHead */; } function parseTaggedTemplateRest(tag, questionDotToken, typeArguments) { - var tagExpression = createNode(198 /* TaggedTemplateExpression */, tag.pos); + var tagExpression = createNode(199 /* TaggedTemplateExpression */, tag.pos); tagExpression.tag = tag; tagExpression.questionDotToken = questionDotToken; tagExpression.typeArguments = typeArguments; @@ -22825,7 +22939,7 @@ var ts; expression = parseTaggedTemplateRest(expression, questionDotToken, typeArguments); continue; } - var callExpr = createNode(196 /* CallExpression */, expression.pos); + var callExpr = createNode(197 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.typeArguments = typeArguments; @@ -22838,7 +22952,7 @@ var ts; } } else if (token() === 20 /* OpenParenToken */) { - var callExpr = createNode(196 /* CallExpression */, expression.pos); + var callExpr = createNode(197 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.arguments = parseArgumentList(); @@ -22850,7 +22964,7 @@ var ts; } if (questionDotToken) { // We failed to parse anything, so report a missing identifier here. - var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = createMissingNode(75 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.Identifier_expected); @@ -22969,28 +23083,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNodeWithJSDoc(200 /* ParenthesizedExpression */); + var node = createNodeWithJSDoc(201 /* ParenthesizedExpression */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(213 /* SpreadElement */); + var node = createNode(214 /* SpreadElement */); parseExpected(25 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 25 /* DotDotDotToken */ ? parseSpreadElement() : - token() === 27 /* CommaToken */ ? createNode(215 /* OmittedExpression */) : + token() === 27 /* CommaToken */ ? createNode(216 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(192 /* ArrayLiteralExpression */); + var node = createNode(193 /* ArrayLiteralExpression */); parseExpected(22 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -23002,17 +23116,17 @@ var ts; function parseObjectLiteralElement() { var node = createNodeWithJSDoc(0 /* Unknown */); if (parseOptionalToken(25 /* DotDotDotToken */)) { - node.kind = 283 /* SpreadAssignment */; + node.kind = 284 /* SpreadAssignment */; node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); - if (parseContextualModifier(131 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 163 /* GetAccessor */); + if (parseContextualModifier(132 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 164 /* GetAccessor */); } - if (parseContextualModifier(142 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 164 /* SetAccessor */); + if (parseContextualModifier(143 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 165 /* SetAccessor */); } var asteriskToken = parseOptionalToken(41 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); @@ -23030,7 +23144,7 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 58 /* ColonToken */); if (isShorthandPropertyAssignment) { - node.kind = 282 /* ShorthandPropertyAssignment */; + node.kind = 283 /* ShorthandPropertyAssignment */; var equalsToken = parseOptionalToken(62 /* EqualsToken */); if (equalsToken) { node.equalsToken = equalsToken; @@ -23038,20 +23152,26 @@ var ts; } } else { - node.kind = 281 /* PropertyAssignment */; + node.kind = 282 /* PropertyAssignment */; parseExpected(58 /* ColonToken */); node.initializer = allowInAnd(parseAssignmentExpressionOrHigher); } return finishNode(node); } function parseObjectLiteralExpression() { - var node = createNode(193 /* ObjectLiteralExpression */); + var node = createNode(194 /* ObjectLiteralExpression */); + var openBracePosition = scanner.getTokenPos(); parseExpected(18 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; } node.properties = parseDelimitedList(12 /* ObjectLiteralMembers */, parseObjectLiteralElement, /*considerSemicolonAsDelimiter*/ true); - parseExpected(19 /* CloseBraceToken */); + if (!parseExpected(19 /* CloseBraceToken */)) { + var lastError = ts.lastOrUndefined(parseDiagnostics); + if (lastError && lastError.code === ts.Diagnostics._0_expected.code) { + ts.addRelatedInfo(lastError, ts.createFileDiagnostic(sourceFile, openBracePosition, 1, ts.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here)); + } + } return finishNode(node); } function parseFunctionExpression() { @@ -23064,7 +23184,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(/*val*/ false); } - var node = createNodeWithJSDoc(201 /* FunctionExpression */); + var node = createNodeWithJSDoc(202 /* FunctionExpression */); node.modifiers = parseModifiers(); parseExpected(94 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(41 /* AsteriskToken */); @@ -23089,7 +23209,7 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(99 /* NewKeyword */); if (parseOptional(24 /* DotToken */)) { - var node_2 = createNode(219 /* MetaProperty */, fullStart); + var node_2 = createNode(220 /* MetaProperty */, fullStart); node_2.keywordToken = 99 /* NewKeyword */; node_2.name = parseIdentifierName(); return finishNode(node_2); @@ -23106,7 +23226,7 @@ var ts; } break; } - var node = createNode(197 /* NewExpression */, fullStart); + var node = createNode(198 /* NewExpression */, fullStart); node.expression = expression; node.typeArguments = typeArguments; if (node.typeArguments || token() === 20 /* OpenParenToken */) { @@ -23116,7 +23236,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(223 /* Block */); + var node = createNode(224 /* Block */); var openBracePosition = scanner.getTokenPos(); if (parseExpected(18 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { @@ -23155,12 +23275,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(224 /* EmptyStatement */); + var node = createNode(225 /* EmptyStatement */); parseExpected(26 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(227 /* IfStatement */); + var node = createNode(228 /* IfStatement */); parseExpected(95 /* IfKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23170,7 +23290,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(228 /* DoStatement */); + var node = createNode(229 /* DoStatement */); parseExpected(86 /* DoKeyword */); node.statement = parseStatement(); parseExpected(111 /* WhileKeyword */); @@ -23185,7 +23305,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(229 /* WhileStatement */); + var node = createNode(230 /* WhileStatement */); parseExpected(111 /* WhileKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23208,8 +23328,8 @@ var ts; } } var forOrForInOrForOfStatement; - if (awaitToken ? parseExpected(152 /* OfKeyword */) : parseOptional(152 /* OfKeyword */)) { - var forOfStatement = createNode(232 /* ForOfStatement */, pos); + if (awaitToken ? parseExpected(153 /* OfKeyword */) : parseOptional(153 /* OfKeyword */)) { + var forOfStatement = createNode(233 /* ForOfStatement */, pos); forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); @@ -23217,14 +23337,14 @@ var ts; forOrForInOrForOfStatement = forOfStatement; } else if (parseOptional(97 /* InKeyword */)) { - var forInStatement = createNode(231 /* ForInStatement */, pos); + var forInStatement = createNode(232 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } else { - var forStatement = createNode(230 /* ForStatement */, pos); + var forStatement = createNode(231 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(26 /* SemicolonToken */); if (token() !== 26 /* SemicolonToken */ && token() !== 21 /* CloseParenToken */) { @@ -23242,7 +23362,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 234 /* BreakStatement */ ? 77 /* BreakKeyword */ : 82 /* ContinueKeyword */); + parseExpected(kind === 235 /* BreakStatement */ ? 77 /* BreakKeyword */ : 82 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -23250,7 +23370,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(235 /* ReturnStatement */); + var node = createNode(236 /* ReturnStatement */); parseExpected(101 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -23259,7 +23379,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(236 /* WithStatement */); + var node = createNode(237 /* WithStatement */); parseExpected(112 /* WithKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23268,7 +23388,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(277 /* CaseClause */); + var node = createNode(278 /* CaseClause */); parseExpected(78 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(58 /* ColonToken */); @@ -23276,7 +23396,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(278 /* DefaultClause */); + var node = createNode(279 /* DefaultClause */); parseExpected(84 /* DefaultKeyword */); parseExpected(58 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); @@ -23286,12 +23406,12 @@ var ts; return token() === 78 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(237 /* SwitchStatement */); + var node = createNode(238 /* SwitchStatement */); parseExpected(103 /* SwitchKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); - var caseBlock = createNode(251 /* CaseBlock */); + var caseBlock = createNode(252 /* CaseBlock */); parseExpected(18 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(19 /* CloseBraceToken */); @@ -23306,7 +23426,7 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(239 /* ThrowStatement */); + var node = createNode(240 /* ThrowStatement */); parseExpected(105 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -23314,7 +23434,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(240 /* TryStatement */); + var node = createNode(241 /* TryStatement */); parseExpected(107 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); node.catchClause = token() === 79 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -23327,7 +23447,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(280 /* CatchClause */); + var result = createNode(281 /* CatchClause */); parseExpected(79 /* CatchKeyword */); if (parseOptional(20 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -23341,7 +23461,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(241 /* DebuggerStatement */); + var node = createNode(242 /* DebuggerStatement */); parseExpected(83 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -23350,15 +23470,15 @@ var ts; // Avoiding having to do the lookahead for a labeled statement by just trying to parse // out an expression, seeing if it is identifier and then seeing if it is followed by // a colon. - var node = createNodeWithJSDoc(0 /* Unknown */); + var node = createNodeWithJSDoc(token() === 75 /* Identifier */ ? 0 /* Unknown */ : 227 /* ExpressionStatement */); var expression = allowInAnd(parseExpression); if (expression.kind === 75 /* Identifier */ && parseOptional(58 /* ColonToken */)) { - node.kind = 238 /* LabeledStatement */; + node.kind = 239 /* LabeledStatement */; node.label = expression; node.statement = parseStatement(); } else { - node.kind = 226 /* ExpressionStatement */; + node.kind = 227 /* ExpressionStatement */; node.expression = expression; parseSemicolon(); } @@ -23412,25 +23532,25 @@ var ts; // // could be legal, it would add complexity for very little gain. case 114 /* InterfaceKeyword */: - case 145 /* TypeKeyword */: + case 146 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 122 /* AbstractKeyword */: case 126 /* AsyncKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 119 /* PublicKeyword */: - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 150 /* GlobalKeyword */: + case 151 /* GlobalKeyword */: nextToken(); return token() === 18 /* OpenBraceToken */ || token() === 75 /* Identifier */ || token() === 89 /* ExportKeyword */; case 96 /* ImportKeyword */: @@ -23439,7 +23559,7 @@ var ts; token() === 18 /* OpenBraceToken */ || ts.tokenIsIdentifierOrKeyword(token()); case 89 /* ExportKeyword */: var currentToken_1 = nextToken(); - if (currentToken_1 === 145 /* TypeKeyword */) { + if (currentToken_1 === 146 /* TypeKeyword */) { currentToken_1 = lookAhead(nextToken); } if (currentToken_1 === 62 /* EqualsToken */ || currentToken_1 === 41 /* AsteriskToken */ || @@ -23493,19 +23613,19 @@ var ts; case 89 /* ExportKeyword */: return isStartOfDeclaration(); case 126 /* AsyncKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 114 /* InterfaceKeyword */: - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: - case 145 /* TypeKeyword */: - case 150 /* GlobalKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: + case 146 /* TypeKeyword */: + case 151 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 120 /* StaticKeyword */: - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: // When these don't start a declaration, they may be the start of a class member if an identifier // immediately follows. Otherwise they're an identifier in an expression statement. return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); @@ -23529,16 +23649,16 @@ var ts; case 18 /* OpenBraceToken */: return parseBlock(/*ignoreMissingOpenBrace*/ false); case 109 /* VarKeyword */: - return parseVariableStatement(createNodeWithJSDoc(242 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(243 /* VariableDeclaration */)); case 115 /* LetKeyword */: if (isLetDeclaration()) { - return parseVariableStatement(createNodeWithJSDoc(242 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(243 /* VariableDeclaration */)); } break; case 94 /* FunctionKeyword */: - return parseFunctionDeclaration(createNodeWithJSDoc(244 /* FunctionDeclaration */)); + return parseFunctionDeclaration(createNodeWithJSDoc(245 /* FunctionDeclaration */)); case 80 /* ClassKeyword */: - return parseClassDeclaration(createNodeWithJSDoc(245 /* ClassDeclaration */)); + return parseClassDeclaration(createNodeWithJSDoc(246 /* ClassDeclaration */)); case 95 /* IfKeyword */: return parseIfStatement(); case 86 /* DoKeyword */: @@ -23548,9 +23668,9 @@ var ts; case 93 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 82 /* ContinueKeyword */: - return parseBreakOrContinueStatement(233 /* ContinueStatement */); + return parseBreakOrContinueStatement(234 /* ContinueStatement */); case 77 /* BreakKeyword */: - return parseBreakOrContinueStatement(234 /* BreakStatement */); + return parseBreakOrContinueStatement(235 /* BreakStatement */); case 101 /* ReturnKeyword */: return parseReturnStatement(); case 112 /* WithKeyword */: @@ -23571,10 +23691,10 @@ var ts; return parseDeclaration(); case 126 /* AsyncKeyword */: case 114 /* InterfaceKeyword */: - case 145 /* TypeKeyword */: - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: - case 130 /* DeclareKeyword */: + case 146 /* TypeKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: + case 131 /* DeclareKeyword */: case 81 /* ConstKeyword */: case 88 /* EnumKeyword */: case 89 /* ExportKeyword */: @@ -23584,8 +23704,8 @@ var ts; case 119 /* PublicKeyword */: case 122 /* AbstractKeyword */: case 120 /* StaticKeyword */: - case 138 /* ReadonlyKeyword */: - case 150 /* GlobalKeyword */: + case 139 /* ReadonlyKeyword */: + case 151 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -23594,7 +23714,7 @@ var ts; return parseExpressionOrLabeledStatement(); } function isDeclareModifier(modifier) { - return modifier.kind === 130 /* DeclareKeyword */; + return modifier.kind === 131 /* DeclareKeyword */; } function parseDeclaration() { var modifiers = lookAhead(function () { return (parseDecorators(), parseModifiers()); }); @@ -23642,13 +23762,13 @@ var ts; return parseClassDeclaration(node); case 114 /* InterfaceKeyword */: return parseInterfaceDeclaration(node); - case 145 /* TypeKeyword */: + case 146 /* TypeKeyword */: return parseTypeAliasDeclaration(node); case 88 /* EnumKeyword */: return parseEnumDeclaration(node); - case 150 /* GlobalKeyword */: - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: + case 151 /* GlobalKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: return parseModuleDeclaration(node); case 96 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(node); @@ -23667,7 +23787,7 @@ var ts; if (node.decorators || node.modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var missing = createMissingNode(264 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(265 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; @@ -23690,16 +23810,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token() === 27 /* CommaToken */) { - return createNode(215 /* OmittedExpression */); + return createNode(216 /* OmittedExpression */); } - var node = createNode(191 /* BindingElement */); + var node = createNode(192 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(191 /* BindingElement */); + var node = createNode(192 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -23715,14 +23835,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(189 /* ObjectBindingPattern */); + var node = createNode(190 /* ObjectBindingPattern */); parseExpected(18 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(19 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(190 /* ArrayBindingPattern */); + var node = createNode(191 /* ArrayBindingPattern */); parseExpected(22 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(23 /* CloseBracketToken */); @@ -23747,7 +23867,7 @@ var ts; return parseVariableDeclaration(/*allowExclamation*/ true); } function parseVariableDeclaration(allowExclamation) { - var node = createNode(242 /* VariableDeclaration */); + var node = createNode(243 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(ts.Diagnostics.Private_identifiers_are_not_allowed_in_variable_declarations); if (allowExclamation && node.name.kind === 75 /* Identifier */ && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { @@ -23760,7 +23880,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(243 /* VariableDeclarationList */); + var node = createNode(244 /* VariableDeclarationList */); switch (token()) { case 109 /* VarKeyword */: break; @@ -23783,7 +23903,7 @@ var ts; // So we need to look ahead to determine if 'of' should be treated as a keyword in // this context. // The checker will then give an error that there is an empty declaration list. - if (token() === 152 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 153 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -23798,13 +23918,13 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; } function parseVariableStatement(node) { - node.kind = 225 /* VariableStatement */; + node.kind = 226 /* VariableStatement */; node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(node) { - node.kind = 244 /* FunctionDeclaration */; + node.kind = 245 /* FunctionDeclaration */; parseExpected(94 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(41 /* AsteriskToken */); node.name = hasModifierOfKind(node, 84 /* DefaultKeyword */) ? parseOptionalIdentifier() : parseIdentifier(); @@ -23815,8 +23935,8 @@ var ts; return finishNode(node); } function parseConstructorName() { - if (token() === 129 /* ConstructorKeyword */) { - return parseExpected(129 /* ConstructorKeyword */); + if (token() === 130 /* ConstructorKeyword */) { + return parseExpected(130 /* ConstructorKeyword */); } if (token() === 10 /* StringLiteral */ && lookAhead(nextToken) === 20 /* OpenParenToken */) { return tryParse(function () { @@ -23828,7 +23948,7 @@ var ts; function tryParseConstructorDeclaration(node) { return tryParse(function () { if (parseConstructorName()) { - node.kind = 162 /* Constructor */; + node.kind = 163 /* Constructor */; fillSignature(58 /* ColonToken */, 0 /* None */, node); node.body = parseFunctionBlockOrSemicolon(0 /* None */, ts.Diagnostics.or_expected); return finishNode(node); @@ -23836,7 +23956,7 @@ var ts; }); } function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) { - node.kind = 161 /* MethodDeclaration */; + node.kind = 162 /* MethodDeclaration */; node.asteriskToken = asteriskToken; var isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; var isAsync = hasModifierOfKind(node, 126 /* AsyncKeyword */) ? 2 /* Await */ : 0 /* None */; @@ -23845,7 +23965,7 @@ var ts; return finishNode(node); } function parsePropertyDeclaration(node) { - node.kind = 159 /* PropertyDeclaration */; + node.kind = 160 /* PropertyDeclaration */; if (!node.questionToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -23907,7 +24027,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 142 /* SetKeyword */ || idToken === 131 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 143 /* SetKeyword */ || idToken === 132 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -23939,7 +24059,7 @@ var ts; if (!parseOptional(59 /* AtToken */)) { break; } - var decorator = createNode(157 /* Decorator */, decoratorStart); + var decorator = createNode(158 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); (list || (list = [])).push(decorator); @@ -23989,20 +24109,20 @@ var ts; } function parseClassElement() { if (token() === 26 /* SemicolonToken */) { - var result = createNode(222 /* SemicolonClassElement */); + var result = createNode(223 /* SemicolonClassElement */); nextToken(); return finishNode(result); } var node = createNodeWithJSDoc(0 /* Unknown */); node.decorators = parseDecorators(); node.modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); - if (parseContextualModifier(131 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 163 /* GetAccessor */); + if (parseContextualModifier(132 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 164 /* GetAccessor */); } - if (parseContextualModifier(142 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 164 /* SetAccessor */); + if (parseContextualModifier(143 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 165 /* SetAccessor */); } - if (token() === 129 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { + if (token() === 130 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { var constructorDeclaration = tryParseConstructorDeclaration(node); if (constructorDeclaration) { return constructorDeclaration; @@ -24039,10 +24159,10 @@ var ts; return ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 214 /* ClassExpression */); + return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 215 /* ClassExpression */); } function parseClassDeclaration(node) { - return parseClassDeclarationOrExpression(node, 245 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(node, 246 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(node, kind) { node.kind = kind; @@ -24085,14 +24205,14 @@ var ts; function parseHeritageClause() { var tok = token(); ts.Debug.assert(tok === 90 /* ExtendsKeyword */ || tok === 113 /* ImplementsKeyword */); // isListElement() should ensure this. - var node = createNode(279 /* HeritageClause */); + var node = createNode(280 /* HeritageClause */); node.token = tok; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); return finishNode(node); } function parseExpressionWithTypeArguments() { - var node = createNode(216 /* ExpressionWithTypeArguments */); + var node = createNode(217 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); node.typeArguments = tryParseTypeArguments(); return finishNode(node); @@ -24108,7 +24228,7 @@ var ts; return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(node) { - node.kind = 246 /* InterfaceDeclaration */; + node.kind = 247 /* InterfaceDeclaration */; parseExpected(114 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); @@ -24117,8 +24237,8 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(node) { - node.kind = 247 /* TypeAliasDeclaration */; - parseExpected(145 /* TypeKeyword */); + node.kind = 248 /* TypeAliasDeclaration */; + parseExpected(146 /* TypeKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(62 /* EqualsToken */); @@ -24131,13 +24251,13 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNodeWithJSDoc(284 /* EnumMember */); + var node = createNodeWithJSDoc(285 /* EnumMember */); node.name = parsePropertyName(); node.initializer = allowInAnd(parseInitializer); return finishNode(node); } function parseEnumDeclaration(node) { - node.kind = 248 /* EnumDeclaration */; + node.kind = 249 /* EnumDeclaration */; parseExpected(88 /* EnumKeyword */); node.name = parseIdentifier(); if (parseExpected(18 /* OpenBraceToken */)) { @@ -24150,7 +24270,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(250 /* ModuleBlock */); + var node = createNode(251 /* ModuleBlock */); if (parseExpected(18 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(19 /* CloseBraceToken */); @@ -24161,7 +24281,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(node, flags) { - node.kind = 249 /* ModuleDeclaration */; + node.kind = 250 /* ModuleDeclaration */; // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 16 /* Namespace */; @@ -24173,8 +24293,8 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(node) { - node.kind = 249 /* ModuleDeclaration */; - if (token() === 150 /* GlobalKeyword */) { + node.kind = 250 /* ModuleDeclaration */; + if (token() === 151 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation node.name = parseIdentifier(); node.flags |= 1024 /* GlobalAugmentation */; @@ -24193,15 +24313,15 @@ var ts; } function parseModuleDeclaration(node) { var flags = 0; - if (token() === 150 /* GlobalKeyword */) { + if (token() === 151 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(node); } - else if (parseOptional(136 /* NamespaceKeyword */)) { + else if (parseOptional(137 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(135 /* ModuleKeyword */); + parseExpected(136 /* ModuleKeyword */); if (token() === 10 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(node); } @@ -24209,7 +24329,7 @@ var ts; return parseModuleOrNamespaceDeclaration(node, flags); } function isExternalModuleReference() { - return token() === 139 /* RequireKeyword */ && + return token() === 140 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -24219,9 +24339,9 @@ var ts; return nextToken() === 43 /* SlashToken */; } function parseNamespaceExportDeclaration(node) { - node.kind = 252 /* NamespaceExportDeclaration */; + node.kind = 253 /* NamespaceExportDeclaration */; parseExpected(123 /* AsKeyword */); - parseExpected(136 /* NamespaceKeyword */); + parseExpected(137 /* NamespaceKeyword */); node.name = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -24234,7 +24354,7 @@ var ts; identifier = parseIdentifier(); } var isTypeOnly = false; - if (token() !== 149 /* FromKeyword */ && + if (token() !== 150 /* FromKeyword */ && (identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) === "type" && (isIdentifier() || tokenAfterImportDefinitelyProducesImportDeclaration())) { isTypeOnly = true; @@ -24244,7 +24364,7 @@ var ts; return parseImportEqualsDeclaration(node, identifier, isTypeOnly); } // Import statement - node.kind = 254 /* ImportDeclaration */; + node.kind = 255 /* ImportDeclaration */; // ImportDeclaration: // import ImportClause from ModuleSpecifier ; // import ModuleSpecifier; @@ -24253,7 +24373,7 @@ var ts; token() === 18 /* OpenBraceToken */ // import { ) { node.importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); - parseExpected(149 /* FromKeyword */); + parseExpected(150 /* FromKeyword */); } node.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -24265,10 +24385,10 @@ var ts; function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { // In `import id ___`, the current token decides whether to produce // an ImportDeclaration or ImportEqualsDeclaration. - return token() === 27 /* CommaToken */ || token() === 149 /* FromKeyword */; + return token() === 27 /* CommaToken */ || token() === 150 /* FromKeyword */; } function parseImportEqualsDeclaration(node, identifier, isTypeOnly) { - node.kind = 253 /* ImportEqualsDeclaration */; + node.kind = 254 /* ImportEqualsDeclaration */; node.name = identifier; parseExpected(62 /* EqualsToken */); node.moduleReference = parseModuleReference(); @@ -24286,7 +24406,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(255 /* ImportClause */, fullStart); + var importClause = createNode(256 /* ImportClause */, fullStart); importClause.isTypeOnly = isTypeOnly; if (identifier) { // ImportedDefaultBinding: @@ -24297,7 +24417,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(27 /* CommaToken */)) { - importClause.namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(257 /* NamedImports */); + importClause.namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(258 /* NamedImports */); } return finishNode(importClause); } @@ -24307,8 +24427,8 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(265 /* ExternalModuleReference */); - parseExpected(139 /* RequireKeyword */); + var node = createNode(266 /* ExternalModuleReference */); + parseExpected(140 /* RequireKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = parseModuleSpecifier(); parseExpected(21 /* CloseParenToken */); @@ -24330,7 +24450,7 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(256 /* NamespaceImport */); + var namespaceImport = createNode(257 /* NamespaceImport */); parseExpected(41 /* AsteriskToken */); parseExpected(123 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -24345,14 +24465,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 257 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); + node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 258 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(263 /* ExportSpecifier */); + return parseImportOrExportSpecifier(264 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(258 /* ImportSpecifier */); + return parseImportOrExportSpecifier(259 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -24377,34 +24497,34 @@ var ts; else { node.name = identifierName; } - if (kind === 258 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 259 /* ImportSpecifier */ && checkIdentifierIsKeyword) { parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseNamespaceExport(pos) { - var node = createNode(262 /* NamespaceExport */, pos); + var node = createNode(263 /* NamespaceExport */, pos); node.name = parseIdentifier(); return finishNode(node); } function parseExportDeclaration(node) { - node.kind = 260 /* ExportDeclaration */; - node.isTypeOnly = parseOptional(145 /* TypeKeyword */); + node.kind = 261 /* ExportDeclaration */; + node.isTypeOnly = parseOptional(146 /* TypeKeyword */); var namespaceExportPos = scanner.getStartPos(); if (parseOptional(41 /* AsteriskToken */)) { if (parseOptional(123 /* AsKeyword */)) { node.exportClause = parseNamespaceExport(namespaceExportPos); } - parseExpected(149 /* FromKeyword */); + parseExpected(150 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(261 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(262 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 149 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(149 /* FromKeyword */); + if (token() === 150 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(150 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -24412,7 +24532,7 @@ var ts; return finishNode(node); } function parseExportAssignment(node) { - node.kind = 259 /* ExportAssignment */; + node.kind = 260 /* ExportAssignment */; if (parseOptional(62 /* EqualsToken */)) { node.isExportEquals = true; } @@ -24432,10 +24552,10 @@ var ts; } function isAnExternalModuleIndicatorNode(node) { return hasModifierOfKind(node, 89 /* ExportKeyword */) - || node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 265 /* ExternalModuleReference */ - || node.kind === 254 /* ImportDeclaration */ - || node.kind === 259 /* ExportAssignment */ - || node.kind === 260 /* ExportDeclaration */ ? node : undefined; + || node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 266 /* ExternalModuleReference */ + || node.kind === 255 /* ImportDeclaration */ + || node.kind === 260 /* ExportAssignment */ + || node.kind === 261 /* ExportDeclaration */ ? node : undefined; } function getImportMetaIfNecessary(sourceFile) { return sourceFile.flags & 2097152 /* PossiblyContainsImportMeta */ ? @@ -24501,7 +24621,7 @@ var ts; JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; // Parses out a JSDoc type expression. function parseJSDocTypeExpression(mayOmitBraces) { - var result = createNode(294 /* JSDocTypeExpression */); + var result = createNode(295 /* JSDocTypeExpression */); var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(18 /* OpenBraceToken */); result.type = doInsideOfContext(4194304 /* JSDoc */, parseJSDocType); if (!mayOmitBraces || hasBrace) { @@ -24664,7 +24784,7 @@ var ts; } } function createJSDocComment() { - var result = createNode(303 /* JSDocComment */, start); + var result = createNode(304 /* JSDocComment */, start); result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd); result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -24734,19 +24854,19 @@ var ts; break; case "class": case "constructor": - tag = parseSimpleTag(start, 310 /* JSDocClassTag */, tagName); + tag = parseSimpleTag(start, 311 /* JSDocClassTag */, tagName); break; case "public": - tag = parseSimpleTag(start, 311 /* JSDocPublicTag */, tagName); + tag = parseSimpleTag(start, 312 /* JSDocPublicTag */, tagName); break; case "private": - tag = parseSimpleTag(start, 312 /* JSDocPrivateTag */, tagName); + tag = parseSimpleTag(start, 313 /* JSDocPrivateTag */, tagName); break; case "protected": - tag = parseSimpleTag(start, 313 /* JSDocProtectedTag */, tagName); + tag = parseSimpleTag(start, 314 /* JSDocProtectedTag */, tagName); break; case "readonly": - tag = parseSimpleTag(start, 314 /* JSDocReadonlyTag */, tagName); + tag = parseSimpleTag(start, 315 /* JSDocReadonlyTag */, tagName); break; case "this": tag = parseThisTag(start, tagName); @@ -24881,7 +25001,7 @@ var ts; return comments.length === 0 ? undefined : comments.join(""); } function parseUnknownTag(start, tagName) { - var result = createNode(306 /* JSDocTag */, start); + var result = createNode(307 /* JSDocTag */, start); result.tagName = tagName; return finishNode(result); } @@ -24926,9 +25046,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 141 /* ObjectKeyword */: + case 142 /* ObjectKeyword */: return true; - case 174 /* ArrayType */: + case 175 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; @@ -24944,8 +25064,8 @@ var ts; typeExpression = tryParseTypeExpression(); } var result = target === 1 /* Property */ ? - createNode(323 /* JSDocPropertyTag */, start) : - createNode(317 /* JSDocParameterTag */, start); + createNode(324 /* JSDocPropertyTag */, start) : + createNode(318 /* JSDocParameterTag */, start); var comment = parseTagComments(indent + scanner.getStartPos() - start); var nestedTypeLiteral = target !== 4 /* CallbackParameter */ && parseNestedTypeLiteral(typeExpression, name, target, indent); if (nestedTypeLiteral) { @@ -24962,20 +25082,20 @@ var ts; } function parseNestedTypeLiteral(typeExpression, name, target, indent) { if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { - var typeLiteralExpression = createNode(294 /* JSDocTypeExpression */, scanner.getTokenPos()); + var typeLiteralExpression = createNode(295 /* JSDocTypeExpression */, scanner.getTokenPos()); var child = void 0; var jsdocTypeLiteral = void 0; var start_3 = scanner.getStartPos(); var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) { - if (child.kind === 317 /* JSDocParameterTag */ || child.kind === 323 /* JSDocPropertyTag */) { + if (child.kind === 318 /* JSDocParameterTag */ || child.kind === 324 /* JSDocPropertyTag */) { children = ts.append(children, child); } } if (children) { - jsdocTypeLiteral = createNode(304 /* JSDocTypeLiteral */, start_3); + jsdocTypeLiteral = createNode(305 /* JSDocTypeLiteral */, start_3); jsdocTypeLiteral.jsDocPropertyTags = children; - if (typeExpression.type.kind === 174 /* ArrayType */) { + if (typeExpression.type.kind === 175 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typeLiteralExpression.type = finishNode(jsdocTypeLiteral); @@ -24987,7 +25107,7 @@ var ts; if (ts.some(tags, ts.isJSDocReturnTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(318 /* JSDocReturnTag */, start); + var result = createNode(319 /* JSDocReturnTag */, start); result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); @@ -24996,13 +25116,13 @@ var ts; if (ts.some(tags, ts.isJSDocTypeTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(320 /* JSDocTypeTag */, start); + var result = createNode(321 /* JSDocTypeTag */, start); result.tagName = tagName; result.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); return finishNode(result); } function parseAuthorTag(start, tagName, indent) { - var result = createNode(309 /* JSDocAuthorTag */, start); + var result = createNode(310 /* JSDocAuthorTag */, start); result.tagName = tagName; var authorInfoWithEmail = tryParse(function () { return tryParseAuthorNameAndEmail(); }); if (!authorInfoWithEmail) { @@ -25056,20 +25176,20 @@ var ts; } } function parseImplementsTag(start, tagName) { - var result = createNode(308 /* JSDocImplementsTag */, start); + var result = createNode(309 /* JSDocImplementsTag */, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseAugmentsTag(start, tagName) { - var result = createNode(307 /* JSDocAugmentsTag */, start); + var result = createNode(308 /* JSDocAugmentsTag */, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseExpressionWithTypeArgumentsForAugments() { var usedBrace = parseOptional(18 /* OpenBraceToken */); - var node = createNode(216 /* ExpressionWithTypeArguments */); + var node = createNode(217 /* ExpressionWithTypeArguments */); node.expression = parsePropertyAccessEntityNameExpression(); node.typeArguments = tryParseTypeArguments(); var res = finishNode(node); @@ -25081,7 +25201,7 @@ var ts; function parsePropertyAccessEntityNameExpression() { var node = parseJSDocIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var prop = createNode(194 /* PropertyAccessExpression */, node.pos); + var prop = createNode(195 /* PropertyAccessExpression */, node.pos); prop.expression = node; prop.name = parseJSDocIdentifierName(); node = finishNode(prop); @@ -25094,14 +25214,14 @@ var ts; return finishNode(tag); } function parseThisTag(start, tagName) { - var tag = createNode(319 /* JSDocThisTag */, start); + var tag = createNode(320 /* JSDocThisTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); return finishNode(tag); } function parseEnumTag(start, tagName) { - var tag = createNode(316 /* JSDocEnumTag */, start); + var tag = createNode(317 /* JSDocEnumTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); @@ -25110,7 +25230,7 @@ var ts; function parseTypedefTag(start, tagName, indent) { var typeExpression = tryParseTypeExpression(); skipWhitespaceOrAsterisk(); - var typedefTag = createNode(322 /* JSDocTypedefTag */, start); + var typedefTag = createNode(323 /* JSDocTypedefTag */, start); typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(); typedefTag.name = getJSDocTypeAliasName(typedefTag.fullName); @@ -25124,9 +25244,9 @@ var ts; var childTypeTag = void 0; while (child = tryParse(function () { return parseChildPropertyTag(indent); })) { if (!jsdocTypeLiteral) { - jsdocTypeLiteral = createNode(304 /* JSDocTypeLiteral */, start); + jsdocTypeLiteral = createNode(305 /* JSDocTypeLiteral */, start); } - if (child.kind === 320 /* JSDocTypeTag */) { + if (child.kind === 321 /* JSDocTypeTag */) { if (childTypeTag) { break; } @@ -25139,7 +25259,7 @@ var ts; } } if (jsdocTypeLiteral) { - if (typeExpression && typeExpression.type.kind === 174 /* ArrayType */) { + if (typeExpression && typeExpression.type.kind === 175 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? @@ -25158,7 +25278,7 @@ var ts; } var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (parseOptional(24 /* DotToken */)) { - var jsDocNamespaceNode = createNode(249 /* ModuleDeclaration */, pos); + var jsDocNamespaceNode = createNode(250 /* ModuleDeclaration */, pos); if (nested) { jsDocNamespaceNode.flags |= 4 /* NestedNamespace */; } @@ -25172,14 +25292,14 @@ var ts; return typeNameOrNamespaceName; } function parseCallbackTag(start, tagName, indent) { - var callbackTag = createNode(315 /* JSDocCallbackTag */, start); + var callbackTag = createNode(316 /* JSDocCallbackTag */, start); callbackTag.tagName = tagName; callbackTag.fullName = parseJSDocTypeNameWithNamespace(); callbackTag.name = getJSDocTypeAliasName(callbackTag.fullName); skipWhitespace(); callbackTag.comment = parseTagComments(indent); var child; - var jsdocSignature = createNode(305 /* JSDocSignature */, start); + var jsdocSignature = createNode(306 /* JSDocSignature */, start); jsdocSignature.parameters = []; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent); })) { jsdocSignature.parameters = ts.append(jsdocSignature.parameters, child); @@ -25187,7 +25307,7 @@ var ts; var returnTag = tryParse(function () { if (parseOptionalJsdoc(59 /* AtToken */)) { var tag = parseTag(indent); - if (tag && tag.kind === 318 /* JSDocReturnTag */) { + if (tag && tag.kind === 319 /* JSDocReturnTag */) { return tag; } } @@ -25232,7 +25352,7 @@ var ts; case 59 /* AtToken */: if (canParseTag) { var child = tryParseChildTag(target, indent); - if (child && (child.kind === 317 /* JSDocParameterTag */ || child.kind === 323 /* JSDocPropertyTag */) && + if (child && (child.kind === 318 /* JSDocParameterTag */ || child.kind === 324 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; @@ -25296,13 +25416,13 @@ var ts; var typeParametersPos = getNodePos(); do { skipWhitespace(); - var typeParameter = createNode(155 /* TypeParameter */); + var typeParameter = createNode(156 /* TypeParameter */); typeParameter.name = parseJSDocIdentifierName(ts.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces); finishNode(typeParameter); skipWhitespaceOrAsterisk(); typeParameters.push(typeParameter); } while (parseOptionalJsdoc(27 /* CommaToken */)); - var result = createNode(321 /* JSDocTemplateTag */, start); + var result = createNode(322 /* JSDocTemplateTag */, start); result.tagName = tagName; result.constraint = constraint; result.typeParameters = createNodeArray(typeParameters, typeParametersPos); @@ -26109,7 +26229,9 @@ var ts; ["esnext.symbol", "lib.es2019.symbol.d.ts"], ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"], ["esnext.intl", "lib.esnext.intl.d.ts"], - ["esnext.bigint", "lib.es2020.bigint.d.ts"] + ["esnext.bigint", "lib.es2020.bigint.d.ts"], + ["esnext.string", "lib.esnext.string.d.ts"], + ["esnext.promise", "lib.esnext.promise.d.ts"] ]; /** * An array of supported "lib" reference file names used to determine the order for inclusion @@ -27609,7 +27731,7 @@ var ts; function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) { var result = returnValue ? {} : undefined; var _loop_3 = function (element) { - if (element.kind !== 281 /* PropertyAssignment */) { + if (element.kind !== 282 /* PropertyAssignment */) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); return "continue"; } @@ -27700,13 +27822,13 @@ var ts; case 8 /* NumericLiteral */: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { break; // not valid JSON syntax } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; // Currently having element option declaration in the tsconfig with type "object" @@ -27723,7 +27845,7 @@ var ts; return convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined); } - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -28908,7 +29030,12 @@ var ts; ts.Debug.assert(ts.extensionIsTS(resolved.extension)); return { fileName: resolved.path, packageId: resolved.packageId }; } - function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations) { + function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, resultFromCache) { + var _a; + if (resultFromCache) { + (_a = resultFromCache.failedLookupLocations).push.apply(_a, failedLookupLocations); + return resultFromCache; + } return { resolvedModule: resolved && { resolvedFileName: resolved.path, originalPath: resolved.originalPath === true ? undefined : resolved.originalPath, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, failedLookupLocations: failedLookupLocations @@ -29600,15 +29727,12 @@ var ts; } ts.nodeModuleNameResolver = nodeModuleNameResolver; function nodeModuleNameResolverWorker(moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference) { + var _a, _b; var traceEnabled = isTraceEnabled(compilerOptions, host); var failedLookupLocations = []; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations }; var result = ts.forEach(extensions, function (ext) { return tryResolve(ext); }); - if (result && result.value) { - var _a = result.value, resolved = _a.resolved, isExternalLibraryImport = _a.isExternalLibraryImport; - return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations); - } - return { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; + return createResolvedModuleWithFailedLookupLocations((_a = result === null || result === void 0 ? void 0 : result.value) === null || _a === void 0 ? void 0 : _a.resolved, (_b = result === null || result === void 0 ? void 0 : result.value) === null || _b === void 0 ? void 0 : _b.isExternalLibraryImport, failedLookupLocations, state.resultFromCache); function tryResolve(extensions) { var loader = function (extensions, candidate, onlyRecordFailures, state) { return nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, /*considerPackageJson*/ true); }; var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, state); @@ -30045,13 +30169,12 @@ var ts; } ts.unmangleScopedPackageName = unmangleScopedPackageName; function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, state) { - var _a; var result = cache && cache.get(containingDirectory); if (result) { if (state.traceEnabled) { trace(state.host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory); } - (_a = state.failedLookupLocations).push.apply(_a, result.failedLookupLocations); + state.resultFromCache = result; return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, originalPath: result.resolvedModule.originalPath || true, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId } }; } } @@ -30062,7 +30185,7 @@ var ts; var containingDirectory = ts.getDirectoryPath(containingFile); var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); // No originalPath because classic resolution doesn't resolve realPath - return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations); + return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations, state.resultFromCache); function tryResolve(extensions) { var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state); if (resolvedUsingSettings) { @@ -30107,7 +30230,7 @@ var ts; var failedLookupLocations = []; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations }; var resolved = loadModuleFromImmediateNodeModulesDirectory(Extensions.DtsOnly, moduleName, globalCache, state, /*typesScopeOnly*/ false); - return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations); + return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations, state.resultFromCache); } ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache; /** @@ -30150,26 +30273,26 @@ var ts; // A module is uninstantiated if it contains only switch (node.kind) { // 1. interface declarations, type alias declarations - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: if (ts.isEnumConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: if (!(ts.hasModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } break; // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: var exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 261 /* NamedExports */) { + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 262 /* NamedExports */) { var state = 0 /* NonInstantiated */; for (var _i = 0, _a = exportDeclaration.exportClause.elements; _i < _a.length; _i++) { var specifier = _a[_i]; @@ -30185,7 +30308,7 @@ var ts; } break; // 5. other uninstantiated module declarations. - case 250 /* ModuleBlock */: { + case 251 /* ModuleBlock */: { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateCached(n, visited); @@ -30207,7 +30330,7 @@ var ts; }); return state_1; } - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 75 /* Identifier */: // Only jsdoc typedef definition can exist in jsdoc namespace, and it should @@ -30415,7 +30538,7 @@ var ts; // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { - if (node.kind === 259 /* ExportAssignment */) { + if (node.kind === 260 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } var name = ts.getNameOfDeclaration(node); @@ -30424,7 +30547,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 154 /* ComputedPropertyName */) { + if (name.kind === 155 /* ComputedPropertyName */) { var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteralLike(nameExpression)) { @@ -30452,36 +30575,36 @@ var ts; return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: return "__constructor" /* Constructor */; - case 170 /* FunctionType */: - case 165 /* CallSignature */: - case 305 /* JSDocSignature */: + case 171 /* FunctionType */: + case 166 /* CallSignature */: + case 306 /* JSDocSignature */: return "__call" /* Call */; - case 171 /* ConstructorType */: - case 166 /* ConstructSignature */: + case 172 /* ConstructorType */: + case 167 /* ConstructSignature */: return "__new" /* New */; - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: return "__index" /* Index */; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 290 /* SourceFile */: + case 291 /* SourceFile */: // json file should behave as // module.exports = ... return "export=" /* ExportEquals */; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) { // module.exports = ... return "export=" /* ExportEquals */; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */); - case 156 /* Parameter */: + case 157 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 300 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); + ts.Debug.assert(node.parent.kind === 301 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); var functionType = node.parent; var index = functionType.parameters.indexOf(node); return "arg" + index; @@ -30581,7 +30704,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (node.kind === 259 /* ExportAssignment */ && !node.isExportEquals)) { + (node.kind === 260 /* ExportAssignment */ && !node.isExportEquals)) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName_1 = false; multipleDefaultExports_1 = true; @@ -30620,7 +30743,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 263 /* ExportSpecifier */ || (node.kind === 253 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 264 /* ExportSpecifier */ || (node.kind === 254 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -30687,7 +30810,7 @@ var ts; // for it. We must clear this so we don't accidentally move any stale data forward from // a previous compilation. if (containerFlags & 1 /* IsContainer */) { - if (node.kind !== 202 /* ArrowFunction */) { + if (node.kind !== 203 /* ArrowFunction */) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -30720,7 +30843,7 @@ var ts; } // We create a return control flow graph for IIFEs and constructors. For constructors // we use the return control flow graph in strict property initialization checks. - currentReturnTarget = isIIFE || node.kind === 162 /* Constructor */ ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 163 /* Constructor */ ? createBranchLabel() : undefined; currentExceptionTarget = undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; @@ -30735,13 +30858,13 @@ var ts; node.flags |= 512 /* HasExplicitReturn */; node.endFlowNode = currentFlow; } - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 162 /* Constructor */) { + if (node.kind === 163 /* Constructor */) { node.returnFlowNode = currentFlow; } } @@ -30785,8 +30908,8 @@ var ts; } } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, function (n) { return n.kind === 244 /* FunctionDeclaration */ ? bind(n) : undefined; }); - bindEach(nodes, function (n) { return n.kind !== 244 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind === 245 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind !== 245 /* FunctionDeclaration */ ? bind(n) : undefined; }); } function bindEach(nodes, bindFunction) { if (bindFunction === void 0) { bindFunction = bind; } @@ -30818,90 +30941,90 @@ var ts; bindJSDoc(node); return; } - if (node.kind >= 225 /* FirstStatement */ && node.kind <= 241 /* LastStatement */ && !options.allowUnreachableCode) { + if (node.kind >= 226 /* FirstStatement */ && node.kind <= 242 /* LastStatement */ && !options.allowUnreachableCode) { node.flowNode = currentFlow; } switch (node.kind) { - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: bindWhileStatement(node); break; - case 228 /* DoStatement */: + case 229 /* DoStatement */: bindDoStatement(node); break; - case 230 /* ForStatement */: + case 231 /* ForStatement */: bindForStatement(node); break; - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 227 /* IfStatement */: + case 228 /* IfStatement */: bindIfStatement(node); break; - case 235 /* ReturnStatement */: - case 239 /* ThrowStatement */: + case 236 /* ReturnStatement */: + case 240 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 240 /* TryStatement */: + case 241 /* TryStatement */: bindTryStatement(node); break; - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: bindSwitchStatement(node); break; - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: bindCaseBlock(node); break; - case 277 /* CaseClause */: + case 278 /* CaseClause */: bindCaseClause(node); break; - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: bindExpressionStatement(node); break; - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: bindLabeledStatement(node); break; - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: bindAccessExpressionFlow(node); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: bindCallExpressionFlow(node); break; - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: bindJSDocTypeAlias(node); break; // In source files and blocks, bind functions first to match hoisting that occurs at runtime - case 290 /* SourceFile */: { + case 291 /* SourceFile */: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 223 /* Block */: - case 250 /* ModuleBlock */: + case 224 /* Block */: + case 251 /* ModuleBlock */: bindEachFunctionsFirst(node.statements); break; default: @@ -30914,18 +31037,18 @@ var ts; switch (expr.kind) { case 75 /* Identifier */: case 104 /* ThisKeyword */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return containsNarrowableReference(expr); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return hasNarrowableArgument(expr); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return isNarrowingExpression(expr.expression); } return false; @@ -30947,7 +31070,7 @@ var ts; } } } - if (expr.expression.kind === 194 /* PropertyAccessExpression */ && + if (expr.expression.kind === 195 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { return true; } @@ -30980,9 +31103,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 62 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -31058,26 +31181,26 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 227 /* IfStatement */: - case 229 /* WhileStatement */: - case 228 /* DoStatement */: + case 228 /* IfStatement */: + case 230 /* WhileStatement */: + case 229 /* DoStatement */: return parent.expression === node; - case 230 /* ForStatement */: - case 210 /* ConditionalExpression */: + case 231 /* ForStatement */: + case 211 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 200 /* ParenthesizedExpression */) { + if (node.kind === 201 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 207 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { + else if (node.kind === 208 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 209 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || + return node.kind === 210 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */); } @@ -31119,7 +31242,7 @@ var ts; } function setContinueTarget(node, target) { var label = activeLabelList; - while (label && node.parent.kind === 238 /* LabeledStatement */) { + while (label && node.parent.kind === 239 /* LabeledStatement */) { label.continueTarget = target; label = label.next; node = node.parent; @@ -31170,12 +31293,12 @@ var ts; bind(node.expression); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 232 /* ForOfStatement */) { + if (node.kind === 233 /* ForOfStatement */) { bind(node.awaitModifier); } addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 243 /* VariableDeclarationList */) { + if (node.initializer.kind !== 244 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -31197,7 +31320,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 235 /* ReturnStatement */) { + if (node.kind === 236 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -31214,7 +31337,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 234 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 235 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -31314,7 +31437,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 278 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 279 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). Note, we no longer need // this property in control flow analysis, it's there only for backwards compatibility. @@ -31363,7 +31486,7 @@ var ts; bind(node.expression); // A top level call expression with a dotted function name and at least one argument // is potentially an assertion and is therefore included in the control flow. - if (node.expression.kind === 196 /* CallExpression */) { + if (node.expression.kind === 197 /* CallExpression */) { var call = node.expression; if (ts.isDottedName(call.expression)) { currentFlow = createFlowCall(currentFlow, call); @@ -31389,7 +31512,7 @@ var ts; currentFlow = finishFlowLabel(postStatementLabel); } function bindDestructuringTargetFlow(node) { - if (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { + if (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -31400,10 +31523,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); } - else if (node.kind === 192 /* ArrayLiteralExpression */) { + else if (node.kind === 193 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 213 /* SpreadElement */) { + if (e.kind === 214 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -31411,16 +31534,16 @@ var ts; } } } - else if (node.kind === 193 /* ObjectLiteralExpression */) { + else if (node.kind === 194 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 281 /* PropertyAssignment */) { + if (p.kind === 282 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 282 /* ShorthandPropertyAssignment */) { + else if (p.kind === 283 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 283 /* SpreadAssignment */) { + else if (p.kind === 284 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -31542,7 +31665,7 @@ var ts; var operator = node.operatorToken.kind; if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 62 /* EqualsToken */ && node.left.kind === 195 /* ElementAccessExpression */) { + if (operator === 62 /* EqualsToken */ && node.left.kind === 196 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -31604,7 +31727,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 194 /* PropertyAccessExpression */) { + if (node.expression.kind === 195 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -31643,14 +31766,14 @@ var ts; } function bindJSDocTypeAlias(node) { node.tagName.parent = node; - if (node.kind !== 316 /* JSDocEnumTag */ && node.fullName) { + if (node.kind !== 317 /* JSDocEnumTag */ && node.fullName) { setParentPointers(node, node.fullName); } } function bindJSDocClassTag(node) { bindEachChild(node); var host = ts.getHostSignatureFromJSDoc(node); - if (host && host.kind !== 161 /* MethodDeclaration */) { + if (host && host.kind !== 162 /* MethodDeclaration */) { addDeclarationToSymbol(host.symbol, host, 32 /* Class */); } } @@ -31664,13 +31787,13 @@ var ts; function bindOptionalChainRest(node) { bind(node.questionDotToken); switch (node.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: bind(node.name); break; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: bind(node.argumentExpression); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: bindEach(node.typeArguments); bindEach(node.arguments); break; @@ -31726,7 +31849,7 @@ var ts; // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = ts.skipParentheses(node.expression); - if (expr.kind === 201 /* FunctionExpression */ || expr.kind === 202 /* ArrowFunction */) { + if (expr.kind === 202 /* FunctionExpression */ || expr.kind === 203 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -31735,7 +31858,7 @@ var ts; bindEachChild(node); } } - if (node.expression.kind === 194 /* PropertyAccessExpression */) { + if (node.expression.kind === 195 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (ts.isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -31744,54 +31867,54 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 193 /* ObjectLiteralExpression */: - case 173 /* TypeLiteral */: - case 304 /* JSDocTypeLiteral */: - case 274 /* JsxAttributes */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 194 /* ObjectLiteralExpression */: + case 174 /* TypeLiteral */: + case 305 /* JSDocTypeLiteral */: + case 275 /* JsxAttributes */: return 1 /* IsContainer */; - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 249 /* ModuleDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 186 /* MappedType */: + case 250 /* ModuleDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 187 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 290 /* SourceFile */: + case 291 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } // falls through - case 162 /* Constructor */: - case 244 /* FunctionDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 165 /* CallSignature */: - case 305 /* JSDocSignature */: - case 300 /* JSDocFunctionType */: - case 170 /* FunctionType */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 171 /* ConstructorType */: + case 163 /* Constructor */: + case 245 /* FunctionDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 166 /* CallSignature */: + case 306 /* JSDocSignature */: + case 301 /* JSDocFunctionType */: + case 171 /* FunctionType */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 172 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 280 /* CatchClause */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 251 /* CaseBlock */: + case 281 /* CatchClause */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 252 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 223 /* Block */: + case 224 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -31824,45 +31947,45 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 290 /* SourceFile */: + case 291 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 173 /* TypeLiteral */: - case 304 /* JSDocTypeLiteral */: - case 193 /* ObjectLiteralExpression */: - case 246 /* InterfaceDeclaration */: - case 274 /* JsxAttributes */: + case 174 /* TypeLiteral */: + case 305 /* JSDocTypeLiteral */: + case 194 /* ObjectLiteralExpression */: + case 247 /* InterfaceDeclaration */: + case 275 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 305 /* JSDocSignature */: - case 167 /* IndexSignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 300 /* JSDocFunctionType */: - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 247 /* TypeAliasDeclaration */: - case 186 /* MappedType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 306 /* JSDocSignature */: + case 168 /* IndexSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 301 /* JSDocFunctionType */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 248 /* TypeAliasDeclaration */: + case 187 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -31963,7 +32086,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 283 /* SpreadAssignment */ || prop.name.kind !== 75 /* Identifier */) { + if (prop.kind === 284 /* SpreadAssignment */ || prop.name.kind !== 75 /* Identifier */) { continue; } var identifier = prop.name; @@ -31975,7 +32098,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 281 /* PropertyAssignment */ || prop.kind === 282 /* ShorthandPropertyAssignment */ || prop.kind === 161 /* MethodDeclaration */ + var currentKind = prop.kind === 282 /* PropertyAssignment */ || prop.kind === 283 /* ShorthandPropertyAssignment */ || prop.kind === 162 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen.get(identifier.escapedText); @@ -32007,10 +32130,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (ts.isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -32196,8 +32319,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 290 /* SourceFile */ && - blockScopeContainer.kind !== 249 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 291 /* SourceFile */ && + blockScopeContainer.kind !== 250 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -32292,7 +32415,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 152 /* LastToken */) { + if (node.kind > 153 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -32368,14 +32491,14 @@ var ts; } // falls through case 104 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 282 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 283 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); case 76 /* PrivateIdentifier */: return checkPrivateIdentifier(node); - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: var expr = node; if (currentFlow && isNarrowableReference(expr)) { expr.flowNode = currentFlow; @@ -32390,7 +32513,7 @@ var ts; declareSymbol(file.locals, /*parent*/ undefined, expr.expression, 1 /* FunctionScopedVariable */ | 134217728 /* ModuleExports */, 111550 /* FunctionScopedVariableExcludes */); } break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var specialKind = ts.getAssignmentDeclarationKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -32418,78 +32541,78 @@ var ts; ts.Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return checkStrictModeCatchClause(node); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return checkStrictModeWithStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return checkStrictModeLabeledStatement(node); - case 183 /* ThisType */: + case 184 /* ThisType */: seenThisKeyword = true; return; - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: break; // Binding the children will handle everything - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return bindTypeParameter(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return bindParameter(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 191 /* BindingElement */: + case 192 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return bindPropertyWorker(node); - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 284 /* EnumMember */: + case 285 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */); - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */); - case 170 /* FunctionType */: - case 300 /* JSDocFunctionType */: - case 305 /* JSDocSignature */: - case 171 /* ConstructorType */: + case 171 /* FunctionType */: + case 301 /* JSDocFunctionType */: + case 306 /* JSDocSignature */: + case 172 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 173 /* TypeLiteral */: - case 304 /* JSDocTypeLiteral */: - case 186 /* MappedType */: + case 174 /* TypeLiteral */: + case 305 /* JSDocTypeLiteral */: + case 187 /* MappedType */: return bindAnonymousTypeWorker(node); - case 310 /* JSDocClassTag */: + case 311 /* JSDocClassTag */: return bindJSDocClassTag(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return bindFunctionExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: var assignmentKind = ts.getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7 /* ObjectDefinePropertyValue */: @@ -32508,65 +32631,65 @@ var ts; } break; // Members of classes, interfaces, and modules - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return bindJsxAttributes(node); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 253 /* ImportEqualsDeclaration */: - case 256 /* NamespaceImport */: - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 254 /* ImportEqualsDeclaration */: + case 257 /* NamespaceImport */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return bindImportClause(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return bindExportDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return bindExportAssignment(node); - case 290 /* SourceFile */: + case 291 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 223 /* Block */: + case 224 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } // falls through - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 317 /* JSDocParameterTag */: - if (node.parent.kind === 305 /* JSDocSignature */) { + case 318 /* JSDocParameterTag */: + if (node.parent.kind === 306 /* JSDocSignature */) { return bindParameter(node); } - if (node.parent.kind !== 304 /* JSDocTypeLiteral */) { + if (node.parent.kind !== 305 /* JSDocTypeLiteral */) { break; } // falls through - case 323 /* JSDocPropertyTag */: + case 324 /* JSDocPropertyTag */: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 299 /* JSDocOptionalType */ ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 300 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); } } @@ -32722,8 +32845,8 @@ var ts; } var thisContainer = ts.getThisContainer(node, /*includeArrowFunctions*/ false); switch (thisContainer.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: var constructorSymbol = thisContainer.symbol; // For `f.prototype.m = function() { this.x = 0; }`, `this.x = 0` should modify `f`'s members, not the function expression. if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -32745,11 +32868,11 @@ var ts; addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */); } break; - case 162 /* Constructor */: - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 163 /* Constructor */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // this.foo assignment in a JavaScript class // Bind this property to the containing class var containingClass = thisContainer.parent; @@ -32761,7 +32884,7 @@ var ts; declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, /*isReplaceableByMethod*/ true); } break; - case 290 /* SourceFile */: + case 291 /* SourceFile */: // this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script if (ts.hasDynamicName(node)) { break; @@ -32791,7 +32914,7 @@ var ts; if (node.expression.kind === 104 /* ThisKeyword */) { bindThisPropertyAssignment(node); } - else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 290 /* SourceFile */) { + else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 291 /* SourceFile */) { if (ts.isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } @@ -32831,7 +32954,7 @@ var ts; } function bindObjectDefinePropertyAssignment(node) { var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - var isToplevel = node.parent.parent.kind === 290 /* SourceFile */; + var isToplevel = node.parent.parent.kind === 291 /* SourceFile */; namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, /*isPrototypeProperty*/ false, /*containerIsClass*/ false); bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, /*isPrototypeProperty*/ false); } @@ -32933,8 +33056,8 @@ var ts; } function isTopLevelNamespaceAssignment(propertyAccess) { return ts.isBinaryExpression(propertyAccess.parent) - ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 290 /* SourceFile */ - : propertyAccess.parent.parent.kind === 290 /* SourceFile */; + ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 291 /* SourceFile */ + : propertyAccess.parent.parent.kind === 291 /* SourceFile */; } function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { var namespaceSymbol = lookupSymbolForPropertyAccess(name); @@ -33013,7 +33136,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 245 /* ClassDeclaration */) { + if (node.kind === 246 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */); } else { @@ -33076,7 +33199,7 @@ var ts; } } function bindParameter(node) { - if (node.kind === 317 /* JSDocParameterTag */ && container.kind !== 305 /* JSDocSignature */) { + if (node.kind === 318 /* JSDocParameterTag */ && container.kind !== 306 /* JSDocSignature */) { return; } if (inStrictMode && !(node.flags & 8388608 /* Ambient */)) { @@ -33153,7 +33276,7 @@ var ts; declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); } } - else if (node.parent.kind === 181 /* InferType */) { + else if (node.parent.kind === 182 /* InferType */) { var container_2 = getInferTypeContainer(node.parent); if (container_2) { if (!container_2.locals) { @@ -33181,11 +33304,11 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 224 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 225 /* EmptyStatement */) || // report error on class declarations - node.kind === 245 /* ClassDeclaration */ || + node.kind === 246 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 249 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); + (node.kind === 250 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); if (reportError) { currentFlow = reportedUnreachableFlow; if (!options.allowUnreachableCode) { @@ -33229,12 +33352,12 @@ var ts; } function isPurelyTypeDeclaration(s) { switch (s.kind) { - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: return true; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return getModuleInstanceState(s) !== 1 /* Instantiated */; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return ts.hasModifier(s, 2048 /* Const */); default: return false; @@ -33283,58 +33406,58 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 196 /* CallExpression */: + case 197 /* CallExpression */: return computeCallExpression(node, subtreeFlags); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return computeNewExpression(node, subtreeFlags); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return computeModuleDeclaration(node, subtreeFlags); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return computeParenthesizedExpression(node, subtreeFlags); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return computeBinaryExpression(node, subtreeFlags); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return computeExpressionStatement(node, subtreeFlags); - case 156 /* Parameter */: + case 157 /* Parameter */: return computeParameter(node, subtreeFlags); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return computeArrowFunction(node, subtreeFlags); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return computeFunctionExpression(node, subtreeFlags); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return computeFunctionDeclaration(node, subtreeFlags); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return computeVariableDeclaration(node, subtreeFlags); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return computeVariableDeclarationList(node, subtreeFlags); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return computeVariableStatement(node, subtreeFlags); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return computeLabeledStatement(node, subtreeFlags); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return computeClassDeclaration(node, subtreeFlags); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return computeClassExpression(node, subtreeFlags); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: return computeHeritageClause(node, subtreeFlags); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return computeCatchClause(node, subtreeFlags); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 162 /* Constructor */: + case 163 /* Constructor */: return computeConstructor(node, subtreeFlags); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return computePropertyDeclaration(node, subtreeFlags); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return computeMethod(node, subtreeFlags); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return computeAccessor(node, subtreeFlags); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return computeImportEquals(node, subtreeFlags); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return computePropertyAccess(node, subtreeFlags); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return computeElementAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); @@ -33385,12 +33508,12 @@ var ts; if (operatorTokenKind === 60 /* QuestionQuestionToken */) { transformFlags |= 8 /* AssertES2020 */; } - else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 193 /* ObjectLiteralExpression */) { + else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 194 /* ObjectLiteralExpression */) { // Destructuring object assignments with are ES2015 syntax // and possibly ES2018 if they contain rest transformFlags |= 32 /* AssertES2018 */ | 256 /* AssertES2015 */ | 1024 /* AssertDestructuringAssignment */; } - else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 192 /* ArrayLiteralExpression */) { + else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 193 /* ArrayLiteralExpression */) { // Destructuring assignments are ES2015 syntax. transformFlags |= 256 /* AssertES2015 */ | 1024 /* AssertDestructuringAssignment */; } @@ -33438,8 +33561,8 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (expressionKind === 217 /* AsExpression */ - || expressionKind === 199 /* TypeAssertionExpression */) { + if (expressionKind === 218 /* AsExpression */ + || expressionKind === 200 /* TypeAssertionExpression */) { transformFlags |= 1 /* AssertTypeScript */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; @@ -33787,13 +33910,13 @@ var ts; // async is ES2017 syntax, but may be ES2018 syntax (for async generators) transformFlags |= 32 /* AssertES2018 */ | 64 /* AssertES2017 */; break; - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: // await is ES2017 syntax, but may be ES2018 syntax (for async generators) transformFlags |= 32 /* AssertES2018 */ | 64 /* AssertES2017 */ | 524288 /* ContainsAwait */; break; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: - case 326 /* PartiallyEmittedExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: + case 327 /* PartiallyEmittedExpression */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; excludeFlags = 536870912 /* OuterExpressionExcludes */; @@ -33802,27 +33925,27 @@ var ts; case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 122 /* AbstractKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 81 /* ConstKeyword */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 218 /* NonNullExpression */: - case 138 /* ReadonlyKeyword */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 219 /* NonNullExpression */: + case 139 /* ReadonlyKeyword */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; break; - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: case 11 /* JsxText */: - case 269 /* JsxClosingElement */: - case 270 /* JsxFragment */: - case 271 /* JsxOpeningFragment */: - case 272 /* JsxClosingFragment */: - case 273 /* JsxAttribute */: - case 274 /* JsxAttributes */: - case 275 /* JsxSpreadAttribute */: - case 276 /* JsxExpression */: + case 270 /* JsxClosingElement */: + case 271 /* JsxFragment */: + case 272 /* JsxOpeningFragment */: + case 273 /* JsxClosingFragment */: + case 274 /* JsxAttribute */: + case 275 /* JsxAttributes */: + case 276 /* JsxSpreadAttribute */: + case 277 /* JsxExpression */: // These nodes are Jsx syntax. transformFlags |= 2 /* AssertJsx */; break; @@ -33835,16 +33958,16 @@ var ts; break; } // falls through - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: if (ts.hasInvalidEscape(node.template)) { transformFlags |= 32 /* AssertES2018 */; break; } // falls through - case 211 /* TemplateExpression */: - case 282 /* ShorthandPropertyAssignment */: + case 212 /* TemplateExpression */: + case 283 /* ShorthandPropertyAssignment */: case 120 /* StaticKeyword */: - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: // These nodes are ES6 syntax. transformFlags |= 256 /* AssertES2015 */; break; @@ -33861,70 +33984,70 @@ var ts; case 9 /* BigIntLiteral */: transformFlags |= 4 /* AssertESNext */; break; - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: // This node is either ES2015 syntax or ES2017 syntax (if it is a for-await-of). if (node.awaitModifier) { transformFlags |= 32 /* AssertES2018 */; } transformFlags |= 256 /* AssertES2015 */; break; - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: // This node is either ES2015 syntax (in a generator) or ES2017 syntax (in an async // generator). transformFlags |= 32 /* AssertES2018 */ | 256 /* AssertES2015 */ | 262144 /* ContainsYield */; break; case 125 /* AnyKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 137 /* NeverKeyword */: - case 141 /* ObjectKeyword */: - case 143 /* StringKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 138 /* NeverKeyword */: + case 142 /* ObjectKeyword */: + case 144 /* StringKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: case 110 /* VoidKeyword */: - case 155 /* TypeParameter */: - case 158 /* PropertySignature */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 168 /* TypePredicate */: - case 169 /* TypeReference */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 172 /* TypeQuery */: - case 173 /* TypeLiteral */: - case 174 /* ArrayType */: - case 175 /* TupleType */: - case 176 /* OptionalType */: - case 177 /* RestType */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 180 /* ConditionalType */: - case 181 /* InferType */: - case 182 /* ParenthesizedType */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 183 /* ThisType */: - case 184 /* TypeOperator */: - case 185 /* IndexedAccessType */: - case 186 /* MappedType */: - case 187 /* LiteralType */: - case 252 /* NamespaceExportDeclaration */: + case 156 /* TypeParameter */: + case 159 /* PropertySignature */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 169 /* TypePredicate */: + case 170 /* TypeReference */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 173 /* TypeQuery */: + case 174 /* TypeLiteral */: + case 175 /* ArrayType */: + case 176 /* TupleType */: + case 177 /* OptionalType */: + case 178 /* RestType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 181 /* ConditionalType */: + case 182 /* InferType */: + case 183 /* ParenthesizedType */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 184 /* ThisType */: + case 185 /* TypeOperator */: + case 186 /* IndexedAccessType */: + case 187 /* MappedType */: + case 188 /* LiteralType */: + case 253 /* NamespaceExportDeclaration */: // Types and signatures are TypeScript syntax, and exclude all other facts. transformFlags = 1 /* AssertTypeScript */; excludeFlags = -2 /* TypeExcludes */; break; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: // Even though computed property names are ES6, we don't treat them as such. // This is so that they can flow through PropertyName transforms unaffected. // Instead, we mark the container as ES6, so that it can properly handle the transform. transformFlags |= 32768 /* ContainsComputedPropertyName */; break; - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: transformFlags |= 256 /* AssertES2015 */ | 8192 /* ContainsRestOrSpread */; break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: transformFlags |= 32 /* AssertES2018 */ | 16384 /* ContainsObjectRestOrSpread */; break; case 102 /* SuperKeyword */: @@ -33936,28 +34059,28 @@ var ts; // Mark this node and its ancestors as containing a lexical `this` keyword. transformFlags |= 4096 /* ContainsLexicalThis */; break; - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: transformFlags |= 256 /* AssertES2015 */ | 131072 /* ContainsBindingPattern */; if (subtreeFlags & 8192 /* ContainsRestOrSpread */) { transformFlags |= 32 /* AssertES2018 */ | 16384 /* ContainsObjectRestOrSpread */; } excludeFlags = 536879104 /* BindingPatternExcludes */; break; - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: transformFlags |= 256 /* AssertES2015 */ | 131072 /* ContainsBindingPattern */; excludeFlags = 536879104 /* BindingPatternExcludes */; break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: transformFlags |= 256 /* AssertES2015 */; if (node.dotDotDotToken) { transformFlags |= 8192 /* ContainsRestOrSpread */; } break; - case 157 /* Decorator */: + case 158 /* Decorator */: // This node is TypeScript syntax, and marks its container as also being TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */ | 2048 /* ContainsTypeScriptClassSyntax */; break; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: excludeFlags = 536922112 /* ObjectLiteralExcludes */; if (subtreeFlags & 32768 /* ContainsComputedPropertyName */) { // If an ObjectLiteralExpression contains a ComputedPropertyName, then it @@ -33970,29 +34093,29 @@ var ts; transformFlags |= 32 /* AssertES2018 */; } break; - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: excludeFlags = 536879104 /* ArrayLiteralOrCallOrNewExcludes */; break; - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: // A loop containing a block scoped binding *may* need to be transformed from ES6. if (subtreeFlags & 65536 /* ContainsBlockScopedBinding */) { transformFlags |= 256 /* AssertES2015 */; } break; - case 290 /* SourceFile */: + case 291 /* SourceFile */: break; - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: transformFlags |= 4 /* AssertESNext */; break; - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: // Return statements may require an `await` in ES2018. transformFlags |= 1048576 /* ContainsHoistedDeclarationOrCompletion */ | 32 /* AssertES2018 */; break; - case 233 /* ContinueStatement */: - case 234 /* BreakStatement */: + case 234 /* ContinueStatement */: + case 235 /* BreakStatement */: transformFlags |= 1048576 /* ContainsHoistedDeclarationOrCompletion */; break; case 76 /* PrivateIdentifier */: @@ -34013,67 +34136,67 @@ var ts; * than calling this function. */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 168 /* FirstTypeNode */ && kind <= 188 /* LastTypeNode */) { + if (kind >= 169 /* FirstTypeNode */ && kind <= 189 /* LastTypeNode */) { return -2 /* TypeExcludes */; } switch (kind) { - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 192 /* ArrayLiteralExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 193 /* ArrayLiteralExpression */: return 536879104 /* ArrayLiteralOrCallOrNewExcludes */; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return 537991168 /* ModuleExcludes */; - case 156 /* Parameter */: + case 157 /* Parameter */: return 536870912 /* ParameterExcludes */; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return 538920960 /* ArrowFunctionExcludes */; - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: return 538925056 /* FunctionExcludes */; - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return 537018368 /* VariableDeclarationListExcludes */; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return 536905728 /* ClassExcludes */; - case 162 /* Constructor */: + case 163 /* Constructor */: return 538923008 /* ConstructorExcludes */; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return 538923008 /* MethodOrAccessorExcludes */; case 125 /* AnyKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 137 /* NeverKeyword */: - case 143 /* StringKeyword */: - case 141 /* ObjectKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 138 /* NeverKeyword */: + case 144 /* StringKeyword */: + case 142 /* ObjectKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: case 110 /* VoidKeyword */: - case 155 /* TypeParameter */: - case 158 /* PropertySignature */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 156 /* TypeParameter */: + case 159 /* PropertySignature */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: return -2 /* TypeExcludes */; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return 536922112 /* ObjectLiteralExcludes */; - case 280 /* CatchClause */: + case 281 /* CatchClause */: return 536887296 /* CatchClauseExcludes */; - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: return 536879104 /* BindingPatternExcludes */; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: - case 326 /* PartiallyEmittedExpression */: - case 200 /* ParenthesizedExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: + case 327 /* PartiallyEmittedExpression */: + case 201 /* ParenthesizedExpression */: case 102 /* SuperKeyword */: return 536870912 /* OuterExpressionExcludes */; - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return 536870912 /* PropertyAccessExcludes */; default: return 536870912 /* NodeExcludes */; @@ -34248,7 +34371,7 @@ var ts; // (their type resolved directly to the member deeply referenced) // So to get the intervening symbols, we need to check if there's a type // query node on any of the symbol's declarations and get symbols there - if (d.type && d.type.kind === 172 /* TypeQuery */) { + if (d.type && d.type.kind === 173 /* TypeQuery */) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -34434,6 +34557,7 @@ var ts; IntersectionState[IntersectionState["None"] = 0] = "None"; IntersectionState[IntersectionState["Source"] = 1] = "Source"; IntersectionState[IntersectionState["Target"] = 2] = "Target"; + IntersectionState[IntersectionState["ExcessCheck"] = 4] = "ExcessCheck"; })(IntersectionState || (IntersectionState = {})); var MappedTypeModifiers; (function (MappedTypeModifiers) { @@ -34476,6 +34600,11 @@ var ts; DeclarationSpaces[DeclarationSpaces["ExportType"] = 2] = "ExportType"; DeclarationSpaces[DeclarationSpaces["ExportNamespace"] = 4] = "ExportNamespace"; })(DeclarationSpaces || (DeclarationSpaces = {})); + function SymbolLinks() { + } + function NodeLinks() { + this.flags = 0; + } function getNodeId(node) { if (!node.id) { node.id = nextNodeId; @@ -34535,7 +34664,6 @@ var ts; var constraintDepth = 0; var currentNode; var emptySymbols = ts.createSymbolTable(); - var identityMapper = ts.identity; var arrayVariances = [1 /* Covariant */]; var compilerOptions = host.getCompilerOptions(); var languageVersion = ts.getEmitScriptTarget(compilerOptions); @@ -34885,6 +35013,7 @@ var ts; var literalTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); var substitutionTypes = ts.createMap(); + var awaitedTypes = ts.createMap(); var evolvingArrayTypes = []; var undefinedProperties = ts.createMap(); var unknownSymbol = createSymbol(4 /* Property */, "unknown"); @@ -34932,6 +35061,8 @@ var ts; var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); var keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; var numberOrBigIntType = getUnionType([numberType, bigintType]); + var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t; }); + var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? wildcardType : t; }); var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var emptyJsxObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); emptyJsxObjectType.objectFlags |= 4096 /* JsxAttributes */; @@ -35441,14 +35572,14 @@ var ts; if (symbol.flags & 33554432 /* Transient */) return symbol; var id = getSymbolId(symbol); - return symbolLinks[id] || (symbolLinks[id] = {}); + return symbolLinks[id] || (symbolLinks[id] = new SymbolLinks()); } function getNodeLinks(node) { var nodeId = getNodeId(node); - return nodeLinks[nodeId] || (nodeLinks[nodeId] = { flags: 0 }); + return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); } function isGlobalSourceFile(node) { - return node.kind === 290 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 291 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -35506,17 +35637,17 @@ var ts; } if (declaration.pos <= usage.pos) { // declaration is before usage - if (declaration.kind === 191 /* BindingElement */) { + if (declaration.kind === 192 /* BindingElement */) { // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) - var errorBindingElement = ts.getAncestor(usage, 191 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 192 /* BindingElement */); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 242 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 243 /* VariableDeclaration */), usage); } - else if (declaration.kind === 242 /* VariableDeclaration */) { + else if (declaration.kind === 243 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } @@ -35547,12 +35678,12 @@ var ts; // or if usage is in a type context: // 1. inside a type query (typeof in type position) // 2. inside a jsdoc comment - if (usage.parent.kind === 263 /* ExportSpecifier */ || (usage.parent.kind === 259 /* ExportAssignment */ && usage.parent.isExportEquals)) { + if (usage.parent.kind === 264 /* ExportSpecifier */ || (usage.parent.kind === 260 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } // When resolving symbols for exports, the `usage` location passed in can be the export site directly - if (usage.kind === 259 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 260 /* ExportAssignment */ && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -35572,9 +35703,9 @@ var ts; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 225 /* VariableStatement */: - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: + case 226 /* VariableStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, container)) { @@ -35595,16 +35726,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 159 /* PropertyDeclaration */ && + current.parent.kind === 160 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasModifier(current.parent, 32 /* Static */)) { - if (declaration.kind === 161 /* MethodDeclaration */) { + if (declaration.kind === 162 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -35626,19 +35757,19 @@ var ts; return "quit"; } switch (node.kind) { - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return true; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // even when stopping at any property declaration, they need to come from the same class return stopAtAnyPropertyDeclaration && (ts.isPropertyDeclaration(declaration) && node.parent === declaration.parent || ts.isParameterPropertyDeclaration(declaration, declaration.parent) && node.parent === declaration.parent.parent) ? "quit" : true; - case 223 /* Block */: + case 224 /* Block */: switch (node.parent.kind) { - case 163 /* GetAccessor */: - case 161 /* MethodDeclaration */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 162 /* MethodDeclaration */: + case 165 /* SetAccessor */: return true; default: return false; @@ -35684,12 +35815,12 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 303 /* JSDocComment */) { + if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 304 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === location.type || - lastLocation.kind === 156 /* Parameter */ || - lastLocation.kind === 155 /* TypeParameter */ + lastLocation.kind === 157 /* Parameter */ || + lastLocation.kind === 156 /* TypeParameter */ // local types not visible outside the function body : false; } @@ -35706,13 +35837,13 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 156 /* Parameter */ || + lastLocation.kind === 157 /* Parameter */ || (lastLocation === location.type && !!ts.findAncestor(result.valueDeclaration, ts.isParameter)); } } } - else if (location.kind === 180 /* ConditionalType */) { + else if (location.kind === 181 /* ConditionalType */) { // A type parameter declared using 'infer T' in a conditional type is visible only in // the true branch of the conditional type. useResult = lastLocation === location.trueType; @@ -35727,14 +35858,14 @@ var ts; } withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; // falls through - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports || emptySymbols; - if (location.kind === 290 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { + if (location.kind === 291 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. if (result = moduleExports.get("default" /* Default */)) { @@ -35758,7 +35889,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && - (ts.getDeclarationOfKind(moduleExport, 263 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 262 /* NamespaceExport */))) { + (ts.getDeclarationOfKind(moduleExport, 264 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 263 /* NamespaceExport */))) { break; } } @@ -35772,12 +35903,12 @@ var ts; } } break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -35794,9 +35925,9 @@ var ts; } } break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: // The below is used to lookup type parameters within a class or interface, as they are added to the class/interface locals // These can never be latebound, so the symbol's raw members are sufficient. `getMembersOfNode` cannot be used, as it would // trigger resolving late-bound names, which we may already be in the process of doing while we're here! @@ -35815,7 +35946,7 @@ var ts; } break loop; } - if (location.kind === 214 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 215 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -35823,7 +35954,7 @@ var ts; } } break; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: // The type parameters of a class are not in scope in the base class expression. if (lastLocation === location.expression && location.parent.token === 90 /* ExtendsKeyword */) { var container = location.parent.parent; @@ -35843,9 +35974,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 246 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 247 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -35853,24 +35984,24 @@ var ts; } } break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: // when targeting ES6 or higher there is no 'arguments' in an arrow function // for lower compile targets the resolved symbol is used to emit an error if (compilerOptions.target >= 2 /* ES2015 */) { break; } // falls through - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -35883,7 +36014,7 @@ var ts; } } break; - case 157 /* Decorator */: + case 158 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -35892,7 +36023,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 156 /* Parameter */) { + if (location.parent && location.parent.kind === 157 /* Parameter */) { location = location.parent; } // @@ -35907,25 +36038,25 @@ var ts; // declare function y(x: T): any; // @param(1 as T) // <-- T should resolve to the type alias outside of class C // class C {} - if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 245 /* ClassDeclaration */)) { + if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 246 /* ClassDeclaration */)) { location = location.parent; } break; - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: // js type aliases do not resolve names from their host, so skip past it location = ts.getJSDocHost(location); break; - case 156 /* Parameter */: + case 157 /* Parameter */: if (lastLocation && lastLocation === location.initializer) { associatedDeclarationForContainingInitializer = location; } break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: if (lastLocation && lastLocation === location.initializer) { var root = ts.getRootDeclaration(location); - if (root.kind === 156 /* Parameter */) { + if (root.kind === 157 /* Parameter */) { associatedDeclarationForContainingInitializer = location; } } @@ -35945,7 +36076,7 @@ var ts; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 290 /* SourceFile */); + ts.Debug.assert(lastLocation.kind === 291 /* SourceFile */); if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) { return lastLocation.symbol; } @@ -36062,10 +36193,10 @@ var ts; } } function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 202 /* ArrowFunction */ && location.kind !== 201 /* FunctionExpression */) { + if (location.kind !== 203 /* ArrowFunction */ && location.kind !== 202 /* FunctionExpression */) { // initializers in instance property declaration of class like entities are executed in constructor and thus deferred return ts.isTypeQueryNode(location) || ((ts.isFunctionLikeDeclaration(location) || - (location.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred + (location.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred } if (lastLocation && lastLocation === location.name) { return false; @@ -36078,12 +36209,12 @@ var ts; } function isSelfReferenceLocation(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 249 /* ModuleDeclaration */: // For `namespace N { N; }` + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 250 /* ModuleDeclaration */: // For `namespace N { N; }` return true; default: return false; @@ -36095,7 +36226,7 @@ var ts; function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 155 /* TypeParameter */) { + if (decl.kind === 156 /* TypeParameter */) { var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent; if (parent === container) { return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias)); // TODO: GH#18217 @@ -36151,9 +36282,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 75 /* Identifier */: - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -36187,7 +36318,7 @@ var ts; if (meaning & (788968 /* Type */ & ~1920 /* Namespace */)) { var symbol = resolveSymbol(resolveName(errorLocation, name, ~788968 /* Type */ & 111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); if (symbol && !(symbol.flags & 1920 /* Namespace */)) { - error(errorLocation, ts.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here, ts.unescapeLeadingUnderscores(name)); + error(errorLocation, ts.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0, ts.unescapeLeadingUnderscores(name)); return true; } } @@ -36197,7 +36328,7 @@ var ts; return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; } function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 263 /* ExportSpecifier */) { + if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 264 /* ExportSpecifier */) { error(errorLocation, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); return true; } @@ -36256,7 +36387,7 @@ var ts; return; } // Block-scoped variables cannot be used before their definition - var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 248 /* EnumDeclaration */); }); + var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 249 /* EnumDeclaration */); }); if (declaration === undefined) return ts.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); if (!(declaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { @@ -36291,13 +36422,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return node; - case 255 /* ImportClause */: + case 256 /* ImportClause */: return node.parent; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return node.parent.parent; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return node.parent.parent.parent; default: return undefined; @@ -36321,28 +36452,28 @@ var ts; * {name: } */ function isAliasSymbolDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */ || - node.kind === 252 /* NamespaceExportDeclaration */ || - node.kind === 255 /* ImportClause */ && !!node.name || - node.kind === 256 /* NamespaceImport */ || - node.kind === 262 /* NamespaceExport */ || - node.kind === 258 /* ImportSpecifier */ || - node.kind === 263 /* ExportSpecifier */ || - node.kind === 259 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || + return node.kind === 254 /* ImportEqualsDeclaration */ || + node.kind === 253 /* NamespaceExportDeclaration */ || + node.kind === 256 /* ImportClause */ && !!node.name || + node.kind === 257 /* NamespaceImport */ || + node.kind === 263 /* NamespaceExport */ || + node.kind === 259 /* ImportSpecifier */ || + node.kind === 264 /* ExportSpecifier */ || + node.kind === 260 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || - node.kind === 282 /* ShorthandPropertyAssignment */ || - node.kind === 281 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); + node.kind === 283 /* ShorthandPropertyAssignment */ || + node.kind === 282 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); } function isAliasableOrJsExpression(e) { return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - if (node.moduleReference.kind === 265 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 266 /* ExternalModuleReference */) { var immediate = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var resolved_4 = resolveExternalModuleSymbol(immediate); markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved_4, /*overwriteEmpty*/ false); @@ -36643,28 +36774,28 @@ var ts; function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; } switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 259 /* ExportAssignment */: - case 209 /* BinaryExpression */: + case 260 /* ExportAssignment */: + case 210 /* BinaryExpression */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ true, dontRecursivelyResolve); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return getTargetOfPropertyAssignment(node, dontRecursivelyResolve); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve); default: return ts.Debug.fail(); @@ -36704,6 +36835,13 @@ var ts; } return links.target; } + function tryResolveAlias(symbol) { + var links = getSymbolLinks(symbol); + if (links.target !== resolvingSymbol) { + return resolveAlias(symbol); + } + return undefined; + } /** * Marks a symbol as type-only if its declaration is syntactically type-only. * If it is not itself marked type-only, but resolves to a type-only alias @@ -36809,13 +36947,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 75 /* Identifier */ || entityName.parent.kind === 153 /* QualifiedName */) { + if (entityName.kind === 75 /* Identifier */ || entityName.parent.kind === 154 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 253 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 254 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } @@ -36839,9 +36977,9 @@ var ts; return symbolFromJSPrototype; } } - else if (name.kind === 153 /* QualifiedName */ || name.kind === 194 /* PropertyAccessExpression */) { - var left = name.kind === 153 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 153 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 154 /* QualifiedName */ || name.kind === 195 /* PropertyAccessExpression */) { + var left = name.kind === 154 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 154 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -36876,7 +37014,7 @@ var ts; throw ts.Debug.assertNever(name, "Unknown entity name kind."); } ts.Debug.assert((ts.getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 259 /* ExportAssignment */)) { + if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 260 /* ExportAssignment */)) { markSymbolOfAliasDeclarationIfTypeOnly(ts.getAliasDeclarationFromName(name), symbol, /*finalTarget*/ undefined, /*overwriteEmpty*/ true); } return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); @@ -36955,7 +37093,7 @@ var ts; } } function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) { - return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : ts.Diagnostics.Cannot_find_module_0); + return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : ts.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations); } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } @@ -37098,7 +37236,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 290 /* SourceFile */)) { + if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 291 /* SourceFile */)) { var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; @@ -37385,7 +37523,7 @@ var ts; var members = node.members; for (var _i = 0, members_3 = members; _i < members_3.length; _i++) { var member = members_3[_i]; - if (member.kind === 162 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 163 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -37472,12 +37610,12 @@ var ts; } } switch (location.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } // falls through - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: var sym = getSymbolOfNode(location); // `sym` may not have exports if this module declaration is backed by the symbol for a `const` that's being rewritten // into a namespace - in such cases, it's best to just let the namespace appear empty (the const members couldn't have referred @@ -37486,9 +37624,9 @@ var ts; return { value: result }; } break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: // Type parameters are bound into `members` lists so they can merge across declarations // This is troublesome, since in all other respects, they behave like locals :cries: // TODO: the below is shared with similar code in `resolveName` - in fact, rephrasing all this symbol @@ -37571,7 +37709,7 @@ var ts; && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) // While exports are generally considered to be in scope, export-specifier declared symbols are _not_ // See similar comment in `resolveName` for details - && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 263 /* ExportSpecifier */))) { + && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 264 /* ExportSpecifier */))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); var candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); if (candidate) { @@ -37615,7 +37753,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 263 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 264 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -37630,10 +37768,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: continue; default: return false; @@ -37764,10 +37902,10 @@ var ts; return node && getSymbolOfNode(node); } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -37814,14 +37952,14 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 172 /* TypeQuery */ || + if (entityName.parent.kind === 173 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 154 /* ComputedPropertyName */) { + entityName.parent.kind === 155 /* ComputedPropertyName */) { // Typeof value meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 153 /* QualifiedName */ || entityName.kind === 194 /* PropertyAccessExpression */ || - entityName.parent.kind === 253 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 154 /* QualifiedName */ || entityName.kind === 195 /* PropertyAccessExpression */ || + entityName.parent.kind === 254 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -37870,10 +38008,10 @@ var ts; function signatureToStringWorker(writer) { var sigOutput; if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 171 /* ConstructorType */ : 170 /* FunctionType */; + sigOutput = kind === 1 /* Construct */ ? 172 /* ConstructorType */ : 171 /* FunctionType */; } else { - sigOutput = kind === 1 /* Construct */ ? 166 /* ConstructSignature */ : 165 /* CallSignature */; + sigOutput = kind === 1 /* Construct */ ? 167 /* ConstructSignature */ : 166 /* CallSignature */; } var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); @@ -37957,6 +38095,7 @@ var ts; getSourceFiles: function () { return host.getSourceFiles(); }, getCurrentDirectory: ts.maybeBind(host, host.getCurrentDirectory), getProbableSymlinks: ts.maybeBind(host, host.getProbableSymlinks), + useCaseSensitiveFileNames: ts.maybeBind(host, host.useCaseSensitiveFileNames) } : undefined }, encounteredError: false, visitedTypes: undefined, @@ -37988,23 +38127,23 @@ var ts; return ts.createKeywordTypeNode(125 /* AnyKeyword */); } if (type.flags & 2 /* Unknown */) { - return ts.createKeywordTypeNode(148 /* UnknownKeyword */); + return ts.createKeywordTypeNode(149 /* UnknownKeyword */); } if (type.flags & 4 /* String */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(143 /* StringKeyword */); + return ts.createKeywordTypeNode(144 /* StringKeyword */); } if (type.flags & 8 /* Number */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(140 /* NumberKeyword */); + return ts.createKeywordTypeNode(141 /* NumberKeyword */); } if (type.flags & 64 /* BigInt */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(151 /* BigIntKeyword */); + return ts.createKeywordTypeNode(152 /* BigIntKeyword */); } if (type.flags & 16 /* Boolean */) { context.approximateLength += 7; - return ts.createKeywordTypeNode(128 /* BooleanKeyword */); + return ts.createKeywordTypeNode(129 /* BooleanKeyword */); } if (type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */)) { var parentSymbol = getParentOfSymbol(type.symbol); @@ -38045,7 +38184,7 @@ var ts; } } context.approximateLength += 13; - return ts.createTypeOperatorNode(147 /* UniqueKeyword */, ts.createKeywordTypeNode(144 /* SymbolKeyword */)); + return ts.createTypeOperatorNode(148 /* UniqueKeyword */, ts.createKeywordTypeNode(145 /* SymbolKeyword */)); } if (type.flags & 16384 /* Void */) { context.approximateLength += 4; @@ -38053,7 +38192,7 @@ var ts; } if (type.flags & 32768 /* Undefined */) { context.approximateLength += 9; - return ts.createKeywordTypeNode(146 /* UndefinedKeyword */); + return ts.createKeywordTypeNode(147 /* UndefinedKeyword */); } if (type.flags & 65536 /* Null */) { context.approximateLength += 4; @@ -38061,15 +38200,15 @@ var ts; } if (type.flags & 131072 /* Never */) { context.approximateLength += 5; - return ts.createKeywordTypeNode(137 /* NeverKeyword */); + return ts.createKeywordTypeNode(138 /* NeverKeyword */); } if (type.flags & 4096 /* ESSymbol */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(144 /* SymbolKeyword */); + return ts.createKeywordTypeNode(145 /* SymbolKeyword */); } if (type.flags & 67108864 /* NonPrimitive */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(141 /* ObjectKeyword */); + return ts.createKeywordTypeNode(142 /* ObjectKeyword */); } if (isThisTypeParameter(type)) { if (context.flags & 4194304 /* InObjectTypeLiteral */) { @@ -38118,7 +38257,7 @@ var ts; } var typeNodes = mapToTypeNodes(types, context, /*isBareList*/ true); if (typeNodes && typeNodes.length > 0) { - var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 178 /* UnionType */ : 179 /* IntersectionType */, typeNodes); + var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 179 /* UnionType */ : 180 /* IntersectionType */, typeNodes); return unionOrIntersectionTypeNode; } else { @@ -38145,6 +38284,11 @@ var ts; context.approximateLength += 2; return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); } + if (type.flags & 134217728 /* Awaited */) { + var awaitedTypeNode = typeToTypeNodeHelper(type.awaitedType, context); + context.approximateLength += 9; + return ts.createTypeOperatorNode(128 /* AwaitedKeyword */, awaitedTypeNode); + } if (type.flags & 16777216 /* Conditional */) { var checkTypeNode = typeToTypeNodeHelper(type.checkType, context); var saveInferTypeParameters = context.inferTypeParameters; @@ -38157,7 +38301,7 @@ var ts; return ts.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode); } if (type.flags & 33554432 /* Substitution */) { - return typeToTypeNodeHelper(type.typeVariable, context); + return typeToTypeNodeHelper(type.baseType, context); } return ts.Debug.fail("Should be unreachable."); function createMappedTypeNodeFromType(type) { @@ -38189,7 +38333,7 @@ var ts; return symbolToTypeNode(symbol, context, isInstanceType); } // Always use 'typeof T' for type of class, enum, and module objects - else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 214 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || + else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 215 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { return symbolToTypeNode(symbol, context, 111551 /* Value */); @@ -38219,7 +38363,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 290 /* SourceFile */ || declaration.parent.kind === 250 /* ModuleBlock */; + return declaration.parent.kind === 291 /* SourceFile */ || declaration.parent.kind === 251 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -38270,12 +38414,12 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 170 /* FunctionType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 171 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 171 /* ConstructorType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 172 /* ConstructorType */, context); return signatureNode; } } @@ -38296,7 +38440,7 @@ var ts; } var elementType = typeToTypeNodeHelper(typeArguments[0], context); var arrayType = ts.createArrayTypeNode(elementType); - return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, arrayType); + return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, arrayType); } else if (type.target.objectFlags & 8 /* Tuple */) { if (typeArguments.length > 0) { @@ -38310,12 +38454,12 @@ var ts; ts.createOptionalTypeNode(tupleConstituentNodes[i]); } var tupleTypeNode = ts.createTupleTypeNode(tupleConstituentNodes); - return type.target.readonly ? ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } } if (context.encounteredError || (context.flags & 524288 /* AllowEmptyTuple */)) { var tupleTypeNode = ts.createTupleTypeNode([]); - return type.target.readonly ? ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } context.encounteredError = true; return undefined; // TODO: GH#18217 @@ -38410,11 +38554,11 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 165 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 166 /* CallSignature */, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 166 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 167 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { var indexSignature = void 0; @@ -38491,7 +38635,7 @@ var ts; var signatures = getSignaturesOfType(filterType(propertyType, function (t) { return !(t.flags & 32768 /* Undefined */); }), 0 /* Call */); for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) { var signature = signatures_1[_i]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 160 /* MethodSignature */, context); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 161 /* MethodSignature */, context); methodDeclaration.name = propertyName; methodDeclaration.questionToken = optionalToken; typeElements.push(preserveCommentsOn(methodDeclaration)); @@ -38508,7 +38652,7 @@ var ts; propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(125 /* AnyKeyword */); } context.flags = savedFlags; - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(138 /* ReadonlyKeyword */)] : undefined; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(139 /* ReadonlyKeyword */)] : undefined; if (modifiers) { context.approximateLength += 9; } @@ -38517,8 +38661,8 @@ var ts; typeElements.push(preserveCommentsOn(propertySignature)); } function preserveCommentsOn(node) { - if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 323 /* JSDocPropertyTag */; })) { - var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 323 /* JSDocPropertyTag */; }); + if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 324 /* JSDocPropertyTag */; })) { + var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 324 /* JSDocPropertyTag */; }); var commentText = d.comment; if (commentText) { ts.setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); @@ -38569,7 +38713,7 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 143 /* StringKeyword */ : 140 /* NumberKeyword */); + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 144 /* StringKeyword */ : 141 /* NumberKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -38582,7 +38726,7 @@ var ts; } context.approximateLength += (name.length + 4); return ts.createIndexSignature( - /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(138 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(139 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context) { var suppressAny = context.flags & 256 /* SuppressAnyReturnType */; @@ -38596,7 +38740,7 @@ var ts; else { typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); } - var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 162 /* Constructor */); }); + var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 163 /* Constructor */); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); @@ -38640,9 +38784,9 @@ var ts; return typeParameterToDeclarationWithConstraint(type, context, constraintNode); } function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 156 /* Parameter */); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 157 /* Parameter */); if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) { - parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 317 /* JSDocParameterTag */); + parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 318 /* JSDocParameterTag */); } var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { @@ -38654,7 +38798,7 @@ var ts; var dotDotDotToken = isRest ? ts.createToken(25 /* DotDotDotToken */) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 75 /* Identifier */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : - parameterDeclaration.name.kind === 153 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : + parameterDeclaration.name.kind === 154 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : ts.symbolName(parameterSymbol) : ts.symbolName(parameterSymbol); @@ -38673,7 +38817,7 @@ var ts; } var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags); var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited); - if (clone.kind === 191 /* BindingElement */) { + if (clone.kind === 192 /* BindingElement */) { clone.initializer = undefined; } return ts.setEmitFlags(clone, 1 /* SingleLine */ | 16777216 /* NoAsciiEscaping */); @@ -38793,10 +38937,10 @@ var ts; var typeParameterNodes; if (context.flags & 512 /* WriteTypeParametersInQualifiedName */ && index < (chain.length - 1)) { var parentSymbol = symbol; - var nextSymbol = chain[index + 1]; - if (ts.getCheckFlags(nextSymbol) & 1 /* Instantiated */) { + var nextSymbol_1 = chain[index + 1]; + if (ts.getCheckFlags(nextSymbol_1) & 1 /* Instantiated */) { var params = getTypeParametersOfClassOrInterface(parentSymbol.flags & 2097152 /* Alias */ ? resolveAlias(parentSymbol) : parentSymbol); - typeParameterNodes = mapToTypeNodes(ts.map(params, nextSymbol.mapper), context); + typeParameterNodes = mapToTypeNodes(ts.map(params, function (t) { return getMappedType(t, nextSymbol_1.mapper); }), context); } else { typeParameterNodes = typeParametersToTypeParameterDeclarations(symbol, context); @@ -38814,7 +38958,7 @@ var ts; return top; } function getSpecifierForModuleSymbol(symbol, context) { - var file = ts.getDeclarationOfKind(symbol, 290 /* SourceFile */); + var file = ts.getDeclarationOfKind(symbol, 291 /* SourceFile */); if (file && file.moduleName !== undefined) { // Use the amd name if it is available return file.moduleName; @@ -39120,8 +39264,8 @@ var ts; return initial; } function symbolTableToDeclarationStatements(symbolTable, context, bundled) { - var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 161 /* MethodDeclaration */, /*useAcessors*/ true); - var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 160 /* MethodSignature */, /*useAcessors*/ false); + var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 162 /* MethodDeclaration */, /*useAcessors*/ true); + var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 161 /* MethodSignature */, /*useAcessors*/ false); // TODO: Use `setOriginalNode` on original declaration names where possible so these declarations see some kind of // declaration mapping // We save the enclosing declaration off here so it's not adjusted by well-meaning declaration @@ -39460,8 +39604,8 @@ var ts; var baseTypes = getBaseTypes(interfaceType); var baseType = ts.length(baseTypes) ? getIntersectionType(baseTypes) : undefined; var members = ts.flatMap(getPropertiesOfType(interfaceType), function (p) { return serializePropertySymbolForInterface(p, baseType); }); - var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 165 /* CallSignature */); - var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 166 /* ConstructSignature */); + var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 166 /* CallSignature */); + var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 167 /* ConstructSignature */); var indexSignatures = serializeIndexSignatures(interfaceType, baseType); var heritageClauses = !ts.length(baseTypes) ? undefined : [ts.createHeritageClause(90 /* ExtendsKeyword */, ts.mapDefined(baseTypes, function (b) { return trySerializeAsTypeReference(b); }))]; addResult(ts.createInterfaceDeclaration( @@ -39576,7 +39720,7 @@ var ts; for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { var sig = signatures_2[_i]; // Each overload becomes a separate function declaration, in order - var decl = signatureToSignatureDeclarationHelper(sig, 244 /* FunctionDeclaration */, context); + var decl = signatureToSignatureDeclarationHelper(sig, 245 /* FunctionDeclaration */, context); decl.name = ts.createIdentifier(localName); addResult(ts.setTextRange(decl, sig.declaration), modifierFlags); } @@ -39669,7 +39813,7 @@ var ts; var staticMembers = symbol.flags & (16 /* Function */ | 512 /* ValueModule */) ? [] : ts.flatMap(ts.filter(getPropertiesOfType(staticType), function (p) { return !(p.flags & 4194304 /* Prototype */) && p.escapedName !== "prototype"; }), function (p) { return serializePropertySymbolForClass(p, /*isStatic*/ true, staticBaseType); }); - var constructors = serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 162 /* Constructor */); + var constructors = serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 163 /* Constructor */); for (var _i = 0, constructors_1 = constructors; _i < constructors_1.length; _i++) { var c = constructors_1[_i]; // A constructor's return type and type parameters are supposed to be controlled by the enclosing class declaration @@ -39701,7 +39845,7 @@ var ts; var targetName = getInternalSymbolName(target, verbatimTargetName); includePrivateSymbol(target); // the target may be within the same scope - attempt to serialize it first switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // Could be a local `import localName = ns.member` or // an external `import localName = require("whatever")` var isLocalImport = !(target.flags & 512 /* ValueModule */); @@ -39711,13 +39855,13 @@ var ts; ? symbolToName(target, context, 67108863 /* All */, /*expectsIdentifier*/ false) : ts.createExternalModuleReference(ts.createLiteral(getSpecifierForModuleSymbol(symbol, context)))), isLocalImport ? modifierFlags : 0 /* None */); break; - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: // export as namespace foo // TODO: Not part of a file's local or export symbol tables // Is bound into file.symbol.globalExports instead, which we don't currently traverse addResult(ts.createNamespaceExportDeclaration(ts.idText(node.name)), 0 /* None */); break; - case 255 /* ImportClause */: + case 256 /* ImportClause */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(ts.createIdentifier(localName), /*namedBindings*/ undefined), @@ -39726,24 +39870,24 @@ var ts; // In such cases, the `target` refers to the module itself already ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*importClause*/ undefined, ts.createNamespaceImport(ts.createIdentifier(localName))), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: addResult(ts.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createNamespaceExport(ts.createIdentifier(localName)), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*importClause*/ undefined, ts.createNamedImports([ ts.createImportSpecifier(localName !== verbatimTargetName ? ts.createIdentifier(verbatimTargetName) : undefined, ts.createIdentifier(localName)) ])), ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: // does not use localName because the symbol name in this case refers to the name in the exports table, // which we must exactly preserve var specifier = node.parent.parent.moduleSpecifier; @@ -39751,11 +39895,11 @@ var ts; // another file serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), specifier ? verbatimTargetName : targetName, specifier && ts.isStringLiteralLike(specifier) ? ts.createLiteral(specifier.text) : undefined); break; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: serializeMaybeAliasAssignment(symbol); break; - case 209 /* BinaryExpression */: - case 194 /* PropertyAccessExpression */: + case 210 /* BinaryExpression */: + case 195 /* PropertyAccessExpression */: // Could be best encoded as though an export specifier or as though an export assignment // If name is default or export=, do an export assignment // Otherwise do an export specifier @@ -39975,17 +40119,18 @@ var ts; context.flags = oldFlags; return result; function visitExistingNodeTreeSymbols(node) { - if (ts.isJSDocAllType(node)) { + // We don't _actually_ support jsdoc namepath types, emit `any` instead + if (ts.isJSDocAllType(node) || node.kind === 303 /* JSDocNamepathType */) { return ts.createKeywordTypeNode(125 /* AnyKeyword */); } if (ts.isJSDocUnknownType(node)) { - return ts.createKeywordTypeNode(148 /* UnknownKeyword */); + return ts.createKeywordTypeNode(149 /* UnknownKeyword */); } if (ts.isJSDocNullableType(node)) { return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(100 /* NullKeyword */)]); } if (ts.isJSDocOptionalType(node)) { - return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(146 /* UndefinedKeyword */)]); + return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(147 /* UndefinedKeyword */)]); } if (ts.isJSDocNonNullableType(node)) { return ts.visitNode(node.type, visitExistingNodeTreeSymbols); @@ -40254,8 +40399,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { - var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 182 /* ParenthesizedType */; }); - if (node.kind === 247 /* TypeAliasDeclaration */) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 183 /* ParenthesizedType */; }); + if (node.kind === 248 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -40263,11 +40408,11 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 250 /* ModuleBlock */ && + node.parent.kind === 251 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 290 /* SourceFile */ || ts.isAmbientModule(location); + return location.kind === 291 /* SourceFile */ || ts.isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { var nameType = getSymbolLinks(symbol).nameType; @@ -40326,17 +40471,17 @@ var ts; if (!declaration) { declaration = symbol.declarations[0]; // Declaration may be nameless, but we'll try anyway } - if (declaration.parent && declaration.parent.kind === 242 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 243 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 214 /* ClassExpression */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 215 /* ClassExpression */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } - return declaration.kind === 214 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 215 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; } } var name = getNameOfSymbolFromNameType(symbol, context); @@ -40353,28 +40498,28 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: - case 316 /* JSDocEnumTag */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: + case 317 /* JSDocEnumTag */: // Top-level jsdoc type aliases are considered exported // First parent is comment node, second is hosting declaration or token; we only care about those tokens or declarations whose parent is a source file return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent)); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // falls through - case 249 /* ModuleDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 244 /* FunctionDeclaration */: - case 248 /* EnumDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 250 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 245 /* FunctionDeclaration */: + case 249 /* EnumDeclaration */: + case 254 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; @@ -40382,54 +40527,54 @@ var ts; var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 253 /* ImportEqualsDeclaration */ && parent.kind !== 290 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { + !(node.kind !== 254 /* ImportEqualsDeclaration */ && parent.kind !== 291 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent); - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.hasModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 162 /* Constructor */: - case 166 /* ConstructSignature */: - case 165 /* CallSignature */: - case 167 /* IndexSignature */: - case 156 /* Parameter */: - case 250 /* ModuleBlock */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 173 /* TypeLiteral */: - case 169 /* TypeReference */: - case 174 /* ArrayType */: - case 175 /* TupleType */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 182 /* ParenthesizedType */: + case 163 /* Constructor */: + case 167 /* ConstructSignature */: + case 166 /* CallSignature */: + case 168 /* IndexSignature */: + case 157 /* Parameter */: + case 251 /* ModuleBlock */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 174 /* TypeLiteral */: + case 170 /* TypeReference */: + case 175 /* ArrayType */: + case 176 /* TupleType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 183 /* ParenthesizedType */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 255 /* ImportClause */: - case 256 /* NamespaceImport */: - case 258 /* ImportSpecifier */: + case 256 /* ImportClause */: + case 257 /* NamespaceImport */: + case 259 /* ImportSpecifier */: return false; // Type parameters are always visible - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: // Source file and namespace export are always visible // falls through - case 290 /* SourceFile */: - case 252 /* NamespaceExportDeclaration */: + case 291 /* SourceFile */: + case 253 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return false; default: return false; @@ -40438,10 +40583,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 259 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 260 /* ExportAssignment */) { exportSymbol = resolveName(node, node.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); } - else if (node.parent.kind === 263 /* ExportSpecifier */) { + else if (node.parent.kind === 264 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } var result; @@ -40544,12 +40689,12 @@ var ts; function getDeclarationContainer(node) { return ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 242 /* VariableDeclaration */: - case 243 /* VariableDeclarationList */: - case 258 /* ImportSpecifier */: - case 257 /* NamedImports */: - case 256 /* NamespaceImport */: - case 255 /* ImportClause */: + case 243 /* VariableDeclaration */: + case 244 /* VariableDeclarationList */: + case 259 /* ImportSpecifier */: + case 258 /* NamedImports */: + case 257 /* NamespaceImport */: + case 256 /* ImportClause */: return false; default: return true; @@ -40582,7 +40727,7 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false); } function isComputedNonLiteralName(name) { - return name.kind === 154 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); + return name.kind === 155 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); } function getRestType(source, properties, symbol) { source = filterType(source, function (t) { return !(t.flags & 98304 /* Nullable */); }); @@ -40636,7 +40781,7 @@ var ts; if (parentAccess && parentAccess.flowNode) { var propName = getDestructuringPropertyName(node); if (propName) { - var result = ts.createNode(195 /* ElementAccessExpression */, node.pos, node.end); + var result = ts.createNode(196 /* ElementAccessExpression */, node.pos, node.end); result.parent = node; result.expression = parentAccess; var literal = ts.createNode(10 /* StringLiteral */, node.pos, node.end); @@ -40651,23 +40796,23 @@ var ts; function getParentElementAccess(node) { var ancestor = node.parent.parent; switch (ancestor.kind) { - case 191 /* BindingElement */: - case 281 /* PropertyAssignment */: + case 192 /* BindingElement */: + case 282 /* PropertyAssignment */: return getSyntheticElementAccess(ancestor); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return getSyntheticElementAccess(node.parent); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ancestor.initializer; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return ancestor.right; } } function getDestructuringPropertyName(node) { var parent = node.parent; - if (node.kind === 191 /* BindingElement */ && parent.kind === 189 /* ObjectBindingPattern */) { + if (node.kind === 192 /* BindingElement */ && parent.kind === 190 /* ObjectBindingPattern */) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 281 /* PropertyAssignment */ || node.kind === 282 /* ShorthandPropertyAssignment */) { + if (node.kind === 282 /* PropertyAssignment */ || node.kind === 283 /* ShorthandPropertyAssignment */) { return getLiteralPropertyNameText(node.name); } return "" + parent.elements.indexOf(node); @@ -40688,8 +40833,12 @@ var ts; if (strictNullChecks && declaration.flags & 8388608 /* Ambient */ && ts.isParameterDeclaration(declaration)) { parentType = getNonNullableType(parentType); } + // Filter `undefined` from the type we check against if the parent has an initializer (which handles the `undefined` case implicitly) + else if (strictNullChecks && pattern.parent.initializer) { + parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */); + } var type; - if (pattern.kind === 189 /* ObjectBindingPattern */) { + if (pattern.kind === 190 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { parentType = getReducedType(parentType); if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) { @@ -40762,7 +40911,7 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 192 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 193 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } @@ -40772,11 +40921,11 @@ var ts; function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 231 /* ForInStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForInStatement */) { var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression))); return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType; } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 233 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -40795,7 +40944,7 @@ var ts; return addOptionality(declaredType, isOptional); } if ((noImplicitAny || ts.isInJSFile(declaration)) && - declaration.kind === 242 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && + declaration.kind === 243 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1 /* Export */) && !(declaration.flags & 8388608 /* Ambient */)) { // If --noImplicitAny is on or the declaration is in a Javascript file, // use control flow tracked 'any' type for non-ambient, non-exported var or let variables with no @@ -40809,11 +40958,11 @@ var ts; return autoArrayType; } } - if (declaration.kind === 156 /* Parameter */) { + if (declaration.kind === 157 /* Parameter */) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 164 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 163 /* GetAccessor */); + if (func.kind === 165 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 164 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -41028,9 +41177,9 @@ var ts; var thisContainer = ts.getThisContainer(expression, /*includeArrowFunctions*/ false); // Properties defined in a constructor (or base constructor, or javascript constructor function) don't get undefined added. // Function expressions that are assigned to the prototype count as methods. - return thisContainer.kind === 162 /* Constructor */ || - thisContainer.kind === 244 /* FunctionDeclaration */ || - (thisContainer.kind === 201 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); + return thisContainer.kind === 163 /* Constructor */ || + thisContainer.kind === 245 /* FunctionDeclaration */ || + (thisContainer.kind === 202 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { ts.Debug.assert(types.length === declarations.length); @@ -41114,7 +41263,7 @@ var ts; function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) { var elements = pattern.elements; var lastElement = ts.lastOrUndefined(elements); - var hasRestElement = !!(lastElement && lastElement.kind === 191 /* BindingElement */ && lastElement.dotDotDotToken); + var hasRestElement = !!(lastElement && lastElement.kind === 192 /* BindingElement */ && lastElement.dotDotDotToken); if (elements.length === 0 || elements.length === 1 && hasRestElement) { return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType; } @@ -41138,7 +41287,7 @@ var ts; function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { if (includePatternInType === void 0) { includePatternInType = false; } if (reportErrors === void 0) { reportErrors = false; } - return pattern.kind === 189 /* ObjectBindingPattern */ + return pattern.kind === 190 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -41177,7 +41326,7 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 156 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 157 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(declaration) { @@ -41235,7 +41384,7 @@ var ts; return reportCircularityError(symbol); } var type; - if (declaration.kind === 259 /* ExportAssignment */) { + if (declaration.kind === 260 /* ExportAssignment */) { type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration); } else if (ts.isBinaryExpression(declaration) || @@ -41306,7 +41455,7 @@ var ts; } function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { - if (accessor.kind === 163 /* GetAccessor */) { + if (accessor.kind === 164 /* GetAccessor */) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; } @@ -41340,15 +41489,15 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 163 /* GetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 164 /* GetAccessor */); error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } return type; } function resolveTypeOfAccessors(symbol) { - var getter = ts.getDeclarationOfKind(symbol, 163 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 164 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 164 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 165 /* SetAccessor */); if (getter && ts.isInJSFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -41416,9 +41565,9 @@ var ts; if (symbol.flags & 1536 /* Module */ && ts.isShorthandAmbientModuleSymbol(symbol)) { return anyType; } - else if (declaration.kind === 209 /* BinaryExpression */ || + else if (declaration.kind === 210 /* BinaryExpression */ || ts.isAccessExpression(declaration) && - declaration.parent.kind === 209 /* BinaryExpression */) { + declaration.parent.kind === 210 /* BinaryExpression */) { return getWidenedTypeForAssignmentDeclaration(symbol); } else if (symbol.flags & 512 /* ValueModule */ && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) { @@ -41485,7 +41634,7 @@ var ts; return errorType; } // Check if variable has initializer that circularly references the variable itself - if (noImplicitAny && (declaration.kind !== 156 /* Parameter */ || declaration.initializer)) { + if (noImplicitAny && (declaration.kind !== 157 /* Parameter */ || declaration.initializer)) { error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); } // Circularities could also result from parameters in function expressions that end up @@ -41584,36 +41733,36 @@ var ts; return undefined; } switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 160 /* MethodSignature */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 300 /* JSDocFunctionType */: - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 247 /* TypeAliasDeclaration */: - case 321 /* JSDocTemplateTag */: - case 322 /* JSDocTypedefTag */: - case 316 /* JSDocEnumTag */: - case 315 /* JSDocCallbackTag */: - case 186 /* MappedType */: - case 180 /* ConditionalType */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 161 /* MethodSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 301 /* JSDocFunctionType */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 248 /* TypeAliasDeclaration */: + case 322 /* JSDocTemplateTag */: + case 323 /* JSDocTypedefTag */: + case 317 /* JSDocEnumTag */: + case 316 /* JSDocCallbackTag */: + case 187 /* MappedType */: + case 181 /* ConditionalType */: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 186 /* MappedType */) { + if (node.kind === 187 /* MappedType */) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } - else if (node.kind === 180 /* ConditionalType */) { + else if (node.kind === 181 /* ConditionalType */) { return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node)); var thisType = includeThisTypes && - (node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */ || node.kind === 246 /* InterfaceDeclaration */ || isJSConstructor(node)) && + (node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */ || node.kind === 247 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } @@ -41621,7 +41770,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 246 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 247 /* InterfaceDeclaration */); ts.Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); } @@ -41631,9 +41780,9 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 246 /* InterfaceDeclaration */ || - node.kind === 245 /* ClassDeclaration */ || - node.kind === 214 /* ClassExpression */ || + if (node.kind === 247 /* InterfaceDeclaration */ || + node.kind === 246 /* ClassDeclaration */ || + node.kind === 215 /* ClassExpression */ || isJSConstructor(node) || ts.isTypeAlias(node)) { var declaration = node; @@ -41851,7 +42000,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 246 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 247 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getReducedType(getTypeFromTypeNode(node)); @@ -41887,7 +42036,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 246 /* InterfaceDeclaration */) { + if (declaration.kind === 247 /* InterfaceDeclaration */) { if (declaration.flags & 128 /* ContainsThis */) { return false; } @@ -41975,7 +42124,7 @@ var ts; if (ts.isStringLiteralLike(expr)) { return true; } - else if (expr.kind === 209 /* BinaryExpression */) { + else if (expr.kind === 210 /* BinaryExpression */) { return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right); } return false; @@ -41990,12 +42139,12 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return true; - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; case 75 /* Identifier */: return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return isStringConcatExpression(expr); default: return false; @@ -42009,7 +42158,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 248 /* EnumDeclaration */) { + if (declaration.kind === 249 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && ts.isStringLiteralLike(member.initializer)) { @@ -42036,7 +42185,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 248 /* EnumDeclaration */) { + if (declaration.kind === 249 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var value = getEnumMemberValue(member); @@ -42109,22 +42258,22 @@ var ts; function isThislessType(node) { switch (node.kind) { case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: - case 141 /* ObjectKeyword */: + case 149 /* UnknownKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: + case 142 /* ObjectKeyword */: case 110 /* VoidKeyword */: - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: case 100 /* NullKeyword */: - case 137 /* NeverKeyword */: - case 187 /* LiteralType */: + case 138 /* NeverKeyword */: + case 188 /* LiteralType */: return true; - case 174 /* ArrayType */: + case 175 /* ArrayType */: return isThislessType(node.elementType); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -42150,7 +42299,7 @@ var ts; function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - return (node.kind === 162 /* Constructor */ || (!!returnType && isThislessType(returnType))) && + return (node.kind === 163 /* Constructor */ || (!!returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } @@ -42166,14 +42315,14 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -42464,7 +42613,6 @@ var ts; var stringIndexInfo; var numberIndexInfo; if (ts.rangeEquals(typeParameters, typeArguments, 0, typeParameters.length)) { - mapper = identityMapper; members = source.symbol ? getMembersOfSymbol(source.symbol) : ts.createSymbolTable(source.declaredProperties); callSignatures = source.declaredCallSignatures; constructSignatures = source.declaredConstructSignatures; @@ -42968,8 +43116,7 @@ var ts; var checkType = type.checkType; var constraint = getLowerBoundOfKeyType(checkType); if (constraint !== checkType) { - var mapper = makeUnaryTypeMapper(type.root.checkType, constraint); - return getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); + return getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper)); } } return type; @@ -43018,7 +43165,7 @@ var ts; // Create a mapper from T to the current iteration type constituent. Then, if the // mapped type is itself an instantiated type, combine the iteration mapper with the // instantiation mapper. - var templateMapper = combineTypeMappers(type.mapper, createTypeMapper([typeParameter], [t])); + var templateMapper = appendTypeMapping(type.mapper, typeParameter, t); // If the current iteration type constituent is a string literal type, create a property. // Otherwise, for type string create a string index signature. if (isTypeUsableAsPropertyName(t)) { @@ -43068,6 +43215,7 @@ var ts; type = errorType; } symbol.type = type; + symbol.mapper = undefined; } return symbol.type; } @@ -43082,7 +43230,7 @@ var ts; function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? - instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), type.mapper || identityMapper) : + instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), type.mapper) : errorType); } function getConstraintDeclarationForMappedType(type) { @@ -43090,8 +43238,8 @@ var ts; } function isMappedTypeWithKeyofConstraintDeclaration(type) { var constraintDeclaration = getConstraintDeclarationForMappedType(type); // TODO: GH#18217 - return constraintDeclaration.kind === 184 /* TypeOperator */ && - constraintDeclaration.operator === 134 /* KeyOfKeyword */; + return constraintDeclaration.kind === 185 /* TypeOperator */ && + constraintDeclaration.operator === 135 /* KeyOfKeyword */; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { @@ -43099,7 +43247,7 @@ var ts; // If the constraint declaration is a 'keyof T' node, the modifiers type is T. We check // AST nodes here because, when T is a non-generic type, the logic below eagerly resolves // 'keyof T' to a literal union type and we can't recover T from that type. - type.modifiersType = instantiateType(getTypeFromTypeNode(getConstraintDeclarationForMappedType(type).type), type.mapper || identityMapper); + type.modifiersType = instantiateType(getTypeFromTypeNode(getConstraintDeclarationForMappedType(type).type), type.mapper); } else { // Otherwise, get the declared constraint type, and if the constraint type is a type parameter, @@ -43108,7 +43256,7 @@ var ts; var declaredType = getTypeFromMappedTypeNode(type.declaration); var constraint = getConstraintTypeFromMappedType(declaredType); var extendedConstraint = constraint && constraint.flags & 262144 /* TypeParameter */ ? getConstraintOfTypeParameter(constraint) : constraint; - type.modifiersType = extendedConstraint && extendedConstraint.flags & 4194304 /* Index */ ? instantiateType(extendedConstraint.type, type.mapper || identityMapper) : unknownType; + type.modifiersType = extendedConstraint && extendedConstraint.flags & 4194304 /* Index */ ? instantiateType(extendedConstraint.type, type.mapper) : unknownType; } } return type.modifiersType; @@ -43195,8 +43343,8 @@ var ts; } } // The properties of a union type are those that are present in all constituent types, so - // we only need to check the properties of the first type - if (type.flags & 1048576 /* Union */) { + // we only need to check the properties of the first type without index signature + if (type.flags & 1048576 /* Union */ && !getIndexInfoOfType(current, 0 /* String */) && !getIndexInfoOfType(current, 1 /* Number */)) { break; } } @@ -43297,8 +43445,7 @@ var ts; var simplified = getSimplifiedType(type.checkType, /*writing*/ false); var constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified; if (constraint && constraint !== type.checkType) { - var mapper = makeUnaryTypeMapper(type.root.checkType, constraint); - var instantiated = getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); + var instantiated = getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper)); if (!(instantiated.flags & 131072 /* Never */)) { return instantiated; } @@ -43317,7 +43464,7 @@ var ts; var hasDisjointDomainType = false; for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { var t = types_4[_i]; - if (t.flags & 63176704 /* Instantiable */) { + if (t.flags & 197394432 /* Instantiable */) { // We keep following constraints as long as we have an instantiable type that is known // not to be circular or infinite (hence we stop on index access types). var constraint = getConstraintOfType(t); @@ -43353,7 +43500,7 @@ var ts; return undefined; } function getBaseConstraintOfType(type) { - if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { + if (type.flags & (193200128 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { var constraint = getResolvedBaseConstraint(type); return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined; } @@ -43455,6 +43602,10 @@ var ts; constraintDepth--; return result; } + if (t.flags & 134217728 /* Awaited */) { + var basePromiseType = getBaseConstraint(t.awaitedType); + return basePromiseType ? getAwaitedType(basePromiseType) : undefined; + } if (t.flags & 33554432 /* Substitution */) { return getBaseConstraint(t.substitute); } @@ -43515,8 +43666,7 @@ var ts; if (typeVariable) { var constraint = getConstraintOfTypeParameter(typeVariable); if (constraint && (isArrayType(constraint) || isTupleType(constraint))) { - var mapper = makeUnaryTypeMapper(typeVariable, constraint); - return instantiateType(type, combineTypeMappers(mapper, type.mapper)); + return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper)); } } return type; @@ -43527,7 +43677,7 @@ var ts; * type itself. */ function getApparentType(type) { - var t = type.flags & 63176704 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; + var t = type.flags & 197394432 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; return ts.getObjectFlags(t) & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) : t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : t.flags & 132 /* StringLike */ ? globalStringType : @@ -43788,7 +43938,7 @@ var ts; ts.append(propTypes, getIndexTypeOfType(type, 1 /* Number */)); } if (propTypes.length) { - return getUnionType(propTypes, 2 /* Subtype */); + return getUnionType(propTypes); } } return undefined; @@ -43815,10 +43965,10 @@ var ts; function isJSDocOptionalParameter(node) { return ts.isInJSFile(node) && ( // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType - node.type && node.type.kind === 299 /* JSDocOptionalType */ + node.type && node.type.kind === 300 /* JSDocOptionalType */ || ts.getJSDocParameterTags(node).some(function (_a) { var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 299 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 300 /* JSDocOptionalType */; })); } function tryFindAmbientModule(moduleName, withAugmentations) { @@ -43837,7 +43987,7 @@ var ts; var signature = getSignatureFromDeclaration(node.parent); var parameterIndex = node.parent.parameters.indexOf(node); ts.Debug.assert(parameterIndex >= 0); - return parameterIndex >= getMinArgumentCount(signature); + return parameterIndex >= getMinArgumentCount(signature, /*strongArityForUntypedJS*/ true); } var iife = ts.getImmediatelyInvokedFunctionExpression(node.parent); if (iife) { @@ -43852,7 +44002,7 @@ var ts; return false; } var isBracketed = node.isBracketed, typeExpression = node.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 299 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 300 /* JSDocOptionalType */; } function createTypePredicate(kind, parameterName, parameterIndex, type) { return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; @@ -43912,6 +44062,9 @@ var ts; ts.isValueSignatureDeclaration(declaration) && !ts.hasJSDocParameterTags(declaration) && !ts.getJSDocType(declaration); + if (isUntypedSignatureInJSFile) { + flags |= 16 /* IsUntypedSignatureInJSFile */; + } // If this is a JSDoc construct signature, then skip the first parameter in the // parameter list. The first parameter represents the return type of the construct // signature. @@ -43931,30 +44084,29 @@ var ts; else { parameters.push(paramSymbol); } - if (type && type.kind === 187 /* LiteralType */) { + if (type && type.kind === 188 /* LiteralType */) { flags |= 2 /* HasLiteralTypes */; } // Record a new minimum argument count if this is not an optional parameter var isOptionalParameter_1 = isOptionalJSDocParameterTag(param) || param.initializer || param.questionToken || param.dotDotDotToken || iife && parameters.length > iife.arguments.length && !type || - isUntypedSignatureInJSFile || isJSDocOptionalParameter(param); if (!isOptionalParameter_1) { minArgumentCount = parameters.length; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 163 /* GetAccessor */ || declaration.kind === 164 /* SetAccessor */) && + if ((declaration.kind === 164 /* GetAccessor */ || declaration.kind === 165 /* SetAccessor */) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; + var otherKind = declaration.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 162 /* Constructor */ ? + var classType = declaration.kind === 163 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); @@ -44016,11 +44168,11 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - return node.name.kind === 154 /* ComputedPropertyName */ + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + return node.name.kind === 155 /* ComputedPropertyName */ && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse); @@ -44092,7 +44244,7 @@ var ts; function createTypePredicateFromTypePredicateNode(node, signature) { var parameterName = node.parameterName; var type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 183 /* ThisType */ ? + return parameterName.kind === 184 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, /*parameterName*/ undefined, /*parameterIndex*/ undefined, type) : createTypePredicate(node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */, parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type); } @@ -44135,7 +44287,7 @@ var ts; return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 162 /* Constructor */) { + if (declaration.kind === 163 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } if (ts.isJSDocConstructSignature(declaration)) { @@ -44145,12 +44297,12 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 163 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { + if (declaration.kind === 164 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 164 /* SetAccessor */); + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 165 /* SetAccessor */); var setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -44240,7 +44392,7 @@ var ts; // will result in a different declaration kind. if (!signature.isolatedSignatureType) { var kind = signature.declaration ? signature.declaration.kind : 0 /* Unknown */; - var isConstructor = kind === 162 /* Constructor */ || kind === 166 /* ConstructSignature */ || kind === 171 /* ConstructorType */; + var isConstructor = kind === 163 /* Constructor */ || kind === 167 /* ConstructSignature */ || kind === 172 /* ConstructorType */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -44254,7 +44406,7 @@ var ts; return symbol.members.get("__index" /* Index */); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 140 /* NumberKeyword */ : 143 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 141 /* NumberKeyword */ : 144 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -44288,13 +44440,13 @@ var ts; if (typeParameter.symbol) { for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.parent.kind === 181 /* InferType */) { + if (declaration.parent.kind === 182 /* InferType */) { // When an 'infer T' declaration is immediately contained in a type reference node // (such as 'Foo'), T's constraint is inferred from the constraint of the // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are // present, we form an intersection of the inferred constraint types. var grandParent = declaration.parent.parent; - if (grandParent.kind === 169 /* TypeReference */) { + if (grandParent.kind === 170 /* TypeReference */) { var typeReference = grandParent; var typeParameters = getTypeParametersForTypeReference(typeReference); if (typeParameters) { @@ -44319,7 +44471,7 @@ var ts; } // When an 'infer T' declaration is immediately contained in a rest parameter // declaration, we infer an 'unknown[]' constraint. - else if (grandParent.kind === 156 /* Parameter */ && grandParent.dotDotDotToken) { + else if (grandParent.kind === 157 /* Parameter */ && grandParent.dotDotDotToken) { inferences = ts.append(inferences, createArrayType(unknownType)); } } @@ -44336,14 +44488,24 @@ var ts; } else { var constraintDeclaration = getConstraintDeclaration(typeParameter); - typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : - getInferredTypeParameterConstraint(typeParameter) || noConstraintType; + if (!constraintDeclaration) { + typeParameter.constraint = getInferredTypeParameterConstraint(typeParameter) || noConstraintType; + } + else { + var type = getTypeFromTypeNode(constraintDeclaration); + if (type.flags & 1 /* Any */ && type !== errorType) { // Allow errorType to propegate to keep downstream errors suppressed + // use keyofConstraintType as the base constraint for mapped type key constraints (unknown isn;t assignable to that, but `any` was), + // use unknown otherwise + type = constraintDeclaration.parent.parent.kind === 187 /* MappedType */ ? keyofConstraintType : unknownType; + } + typeParameter.constraint = type; + } } } return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - var tp = ts.getDeclarationOfKind(typeParameter.symbol, 155 /* TypeParameter */); + var tp = ts.getDeclarationOfKind(typeParameter.symbol, 156 /* TypeParameter */); var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent; return host && getSymbolOfNode(host); } @@ -44423,8 +44585,8 @@ var ts; } var node = type.node; var typeArguments = !node ? ts.emptyArray : - node.kind === 169 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : - node.kind === 174 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : + node.kind === 170 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : + node.kind === 175 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments; @@ -44468,7 +44630,7 @@ var ts; return errorType; } } - if (node.kind === 169 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { + if (node.kind === 170 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { return createDeferredTypeReference(type, node, /*mapper*/ undefined); } // In a type reference, the outer type parameters of the referenced class or interface are automatically @@ -44513,9 +44675,9 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return node.typeName; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -44546,9 +44708,7 @@ var ts; // Get type from reference to named type that cannot be generic (enum or type parameter) var res = tryGetDeclaredTypeOfSymbol(symbol); if (res) { - return checkNoTypeArguments(node, symbol) ? - res.flags & 262144 /* TypeParameter */ ? getConstrainedTypeVariable(res, node) : getRegularTypeOfLiteralType(res) : - errorType; + return checkNoTypeArguments(node, symbol) ? getRegularTypeOfLiteralType(res) : errorType; } if (symbol.flags & 111551 /* Value */ && isJSDocTypeReference(node)) { var jsdocType = getTypeFromJSDocValueReference(node, symbol); @@ -44584,7 +44744,7 @@ var ts; } isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, /*requireStringLiteralLikeArgument*/ true) && !!valueType.symbol; } - var isImportTypeWithQualifier = node.kind === 188 /* ImportType */ && node.qualifier; + var isImportTypeWithQualifier = node.kind === 189 /* ImportType */ && node.qualifier; // valueType might not have a symbol, eg, {import('./b').STRING_LITERAL} if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier)) { typeType = getTypeReferenceType(node, valueType.symbol); @@ -44594,45 +44754,45 @@ var ts; } return links.resolvedJSDocType; } - function getSubstitutionType(typeVariable, substitute) { - if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === typeVariable) { - return typeVariable; + function getSubstitutionType(baseType, substitute) { + if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === baseType) { + return baseType; } - var id = getTypeId(typeVariable) + ">" + getTypeId(substitute); + var id = getTypeId(baseType) + ">" + getTypeId(substitute); var cached = substitutionTypes.get(id); if (cached) { return cached; } var result = createType(33554432 /* Substitution */); - result.typeVariable = typeVariable; + result.baseType = baseType; result.substitute = substitute; substitutionTypes.set(id, result); return result; } function isUnaryTupleTypeNode(node) { - return node.kind === 175 /* TupleType */ && node.elementTypes.length === 1; + return node.kind === 176 /* TupleType */ && node.elementTypes.length === 1; } - function getImpliedConstraint(typeVariable, checkNode, extendsNode) { - return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(typeVariable, checkNode.elementTypes[0], extendsNode.elementTypes[0]) : - getActualTypeVariable(getTypeFromTypeNode(checkNode)) === typeVariable ? getTypeFromTypeNode(extendsNode) : + function getImpliedConstraint(type, checkNode, extendsNode) { + return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elementTypes[0], extendsNode.elementTypes[0]) : + getActualTypeVariable(getTypeFromTypeNode(checkNode)) === type ? getTypeFromTypeNode(extendsNode) : undefined; } - function getConstrainedTypeVariable(typeVariable, node) { + function getConditionalFlowTypeOfType(type, node) { var constraints; - while (node && !ts.isStatement(node) && node.kind !== 303 /* JSDocComment */) { + while (node && !ts.isStatement(node) && node.kind !== 304 /* JSDocComment */) { var parent = node.parent; - if (parent.kind === 180 /* ConditionalType */ && node === parent.trueType) { - var constraint = getImpliedConstraint(typeVariable, parent.checkType, parent.extendsType); + if (parent.kind === 181 /* ConditionalType */ && node === parent.trueType) { + var constraint = getImpliedConstraint(type, parent.checkType, parent.extendsType); if (constraint) { constraints = ts.append(constraints, constraint); } } node = parent; } - return constraints ? getSubstitutionType(typeVariable, getIntersectionType(ts.append(constraints, typeVariable))) : typeVariable; + return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type; } function isJSDocTypeReference(node) { - return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 169 /* TypeReference */ || node.kind === 188 /* ImportType */); + return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 170 /* TypeReference */ || node.kind === 189 /* ImportType */); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { @@ -44745,9 +44905,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: return declaration; } } @@ -44868,19 +45028,19 @@ var ts; } function getArrayOrTupleTargetType(node) { var readonly = isReadonlyTypeOperator(node.parent); - if (node.kind === 174 /* ArrayType */ || node.elementTypes.length === 1 && node.elementTypes[0].kind === 177 /* RestType */) { + if (node.kind === 175 /* ArrayType */ || node.elementTypes.length === 1 && node.elementTypes[0].kind === 178 /* RestType */) { return readonly ? globalReadonlyArrayType : globalArrayType; } var lastElement = ts.lastOrUndefined(node.elementTypes); - var restElement = lastElement && lastElement.kind === 177 /* RestType */ ? lastElement : undefined; - var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 176 /* OptionalType */ && n !== restElement; }) + 1; + var restElement = lastElement && lastElement.kind === 178 /* RestType */ ? lastElement : undefined; + var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 177 /* OptionalType */ && n !== restElement; }) + 1; return getTupleTypeOfArity(node.elementTypes.length, minLength, !!restElement, readonly, /*associatedNames*/ undefined); } // Return true if the given type reference node is directly aliased or if it needs to be deferred // because it is possibly contained in a circular chain of eagerly resolved types. function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { - return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 174 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : - node.kind === 175 /* TupleType */ ? ts.some(node.elementTypes, mayResolveTypeAlias) : + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 175 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : + node.kind === 176 /* TupleType */ ? ts.some(node.elementTypes, mayResolveTypeAlias) : hasDefaultTypeArguments || ts.some(node.typeArguments, mayResolveTypeAlias)); } // Return true when the given node is transitively contained in type constructs that eagerly @@ -44889,15 +45049,15 @@ var ts; function isResolvedByTypeAlias(node) { var parent = node.parent; switch (parent.kind) { - case 182 /* ParenthesizedType */: - case 169 /* TypeReference */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 185 /* IndexedAccessType */: - case 180 /* ConditionalType */: - case 184 /* TypeOperator */: + case 183 /* ParenthesizedType */: + case 170 /* TypeReference */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 186 /* IndexedAccessType */: + case 181 /* ConditionalType */: + case 185 /* TypeOperator */: return isResolvedByTypeAlias(parent); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return true; } return false; @@ -44906,27 +45066,27 @@ var ts; // of a type alias. function mayResolveTypeAlias(node) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node.typeName, 788968 /* Type */).flags & 524288 /* TypeAlias */); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return true; - case 184 /* TypeOperator */: - return node.operator !== 147 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); - case 182 /* ParenthesizedType */: - case 176 /* OptionalType */: - case 299 /* JSDocOptionalType */: - case 297 /* JSDocNullableType */: - case 298 /* JSDocNonNullableType */: - case 294 /* JSDocTypeExpression */: + case 185 /* TypeOperator */: + return node.operator !== 148 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); + case 183 /* ParenthesizedType */: + case 177 /* OptionalType */: + case 300 /* JSDocOptionalType */: + case 298 /* JSDocNullableType */: + case 299 /* JSDocNonNullableType */: + case 295 /* JSDocTypeExpression */: return mayResolveTypeAlias(node.type); - case 177 /* RestType */: - return node.type.kind !== 174 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); - case 178 /* UnionType */: - case 179 /* IntersectionType */: + case 178 /* RestType */: + return node.type.kind !== 175 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); + case 179 /* UnionType */: + case 180 /* IntersectionType */: return ts.some(node.types, mayResolveTypeAlias); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); } @@ -44940,18 +45100,18 @@ var ts; links.resolvedType = emptyObjectType; } else if (isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 175 /* TupleType */ && node.elementTypes.length === 0 ? target : + links.resolvedType = node.kind === 176 /* TupleType */ && node.elementTypes.length === 0 ? target : createDeferredTypeReference(target, node, /*mapper*/ undefined); } else { - var elementTypes = node.kind === 174 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); + var elementTypes = node.kind === 175 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); links.resolvedType = createTypeReference(target, elementTypes); } } return links.resolvedType; } function isReadonlyTypeOperator(node) { - return ts.isTypeOperatorNode(node) && node.operator === 138 /* ReadonlyKeyword */; + return ts.isTypeOperatorNode(node) && node.operator === 139 /* ReadonlyKeyword */; } // We represent tuple types as type references to synthesized generic interface types created by // this function. The types are of the form: @@ -45056,7 +45216,7 @@ var ts; // We ignore 'never' types in unions if (!(flags & 131072 /* Never */)) { includes |= flags & 71041023 /* IncludesMask */; - if (flags & 66846720 /* StructuredOrInstantiable */) + if (flags & 201064448 /* StructuredOrInstantiable */) includes |= 262144 /* IncludesStructuredOrInstantiable */; if (type === wildcardType) includes |= 8388608 /* IncludesWildcard */; @@ -45188,7 +45348,7 @@ var ts; neverType; } } - var objectFlags = (includes & 66994211 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | + var objectFlags = (includes & 201211939 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 268435456 /* ContainsIntersections */ : 0); return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments); } @@ -45542,7 +45702,7 @@ var ts; type = getReducedType(type); return type.flags & 1048576 /* Union */ ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : - maybeTypeOfKind(type, 58982400 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) : + maybeTypeOfKind(type, 193200128 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) : ts.getObjectFlags(type) & 32 /* Mapped */ ? filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); }) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : @@ -45564,20 +45724,24 @@ var ts; return indexType.flags & 131072 /* Never */ ? stringType : indexType; } function getTypeFromTypeOperatorNode(node) { + var _a; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 134 /* KeyOfKeyword */: + case 135 /* KeyOfKeyword */: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 147 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 144 /* SymbolKeyword */ + case 148 /* UniqueKeyword */: + links.resolvedType = node.type.kind === 145 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : errorType; break; - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: links.resolvedType = getTypeFromTypeNode(node.type); break; + case 128 /* AwaitedKeyword */: + links.resolvedType = (_a = getAwaitedType(getTypeFromTypeNode(node.type))) !== null && _a !== void 0 ? _a : unknownType; + break; default: throw ts.Debug.assertNever(node.operator); } @@ -45612,13 +45776,13 @@ var ts; if (type.flags & 2097152 /* Intersection */) { return ts.some(type.types, isJSLiteralType); } - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { return isJSLiteralType(getResolvedBaseConstraint(type)); } return false; } function getPropertyNameFromIndex(indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode : undefined; return isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? @@ -45629,7 +45793,7 @@ var ts; undefined; } function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags) { - var accessExpression = accessNode && accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode : undefined; var propName = accessNode && ts.isPrivateIdentifier(accessNode) ? undefined : getPropertyNameFromIndex(indexType, accessNode); if (propName !== undefined) { var prop = getPropertyOfType(objectType, propName); @@ -45766,9 +45930,9 @@ var ts; } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode.argumentExpression : - accessNode.kind === 185 /* IndexedAccessType */ ? accessNode.indexType : - accessNode.kind === 154 /* ComputedPropertyName */ ? accessNode.expression : + return accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode.argumentExpression : + accessNode.kind === 186 /* IndexedAccessType */ ? accessNode.indexType : + accessNode.kind === 155 /* ComputedPropertyName */ ? accessNode.expression : accessNode; } function isGenericObjectType(type) { @@ -45779,7 +45943,7 @@ var ts; } return !!(type.objectFlags & 8388608 /* IsGenericObjectType */); } - return !!(type.flags & 58982400 /* InstantiableNonPrimitive */) || isGenericMappedType(type); + return !!(type.flags & 193200128 /* InstantiableNonPrimitive */) || isGenericMappedType(type); } function isGenericIndexType(type) { if (type.flags & 3145728 /* UnionOrIntersection */) { @@ -45789,7 +45953,7 @@ var ts; } return !!(type.objectFlags & 33554432 /* IsGenericIndexType */); } - return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); + return !!(type.flags & (193200128 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); } function isThisTypeParameter(type) { return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType); @@ -45842,7 +46006,7 @@ var ts; return type[cache] = distributedOverIndex; } // Only do the inner distributions if the index can no longer be instantiated to cause index distribution again - if (!(indexType.flags & 63176704 /* Instantiable */)) { + if (!(indexType.flags & 197394432 /* Instantiable */)) { // (T | U)[K] -> T[K] | U[K] (reading) // (T | U)[K] -> T[K] & U[K] (writing) // (T & U)[K] -> T[K] & U[K] @@ -45914,7 +46078,7 @@ var ts; // object type. Note that for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in // an expression. This is to preserve backwards compatibility. For example, an element access 'this["foo"]' // has always been resolved eagerly using the constraint type of 'this' at the given location. - if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 185 /* IndexedAccessType */) && isGenericObjectType(objectType)) { + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 186 /* IndexedAccessType */) && isGenericObjectType(objectType)) { if (objectType.flags & 3 /* AnyOrUnknown */) { return objectType; } @@ -45964,7 +46128,7 @@ var ts; links.resolvedType = resolved.flags & 8388608 /* IndexedAccess */ && resolved.objectType === objectType && resolved.indexType === indexType ? - getConstrainedTypeVariable(resolved, node) : resolved; + getConditionalFlowTypeOfType(resolved, node) : resolved; } return links.resolvedType; } @@ -45984,7 +46148,7 @@ var ts; } function getActualTypeVariable(type) { if (type.flags & 33554432 /* Substitution */) { - return type.typeVariable; + return type.baseType; } if (type.flags & 8388608 /* IndexedAccess */ && (type.objectType.flags & 33554432 /* Substitution */ || type.indexType.flags & 33554432 /* Substitution */)) { @@ -46012,7 +46176,7 @@ var ts; // types rules (i.e. proper contravariance) for inferences. inferTypes(context.inferences, checkType, extendsType, 128 /* NoConstraints */ | 256 /* AlwaysStrict */); } - combinedMapper = combineTypeMappers(mapper, context.mapper); + combinedMapper = mergeTypeMappers(mapper, context.mapper); } // Instantiate the extends type including inferences for 'infer T' type parameters var inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType; @@ -46203,7 +46367,7 @@ var ts; } function getAliasSymbolForTypeNode(node) { var host = node.parent; - while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 138 /* ReadonlyKeyword */) { + while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 139 /* ReadonlyKeyword */) { host = host.parent; } return ts.isTypeAlias(host) ? getSymbolOfNode(host) : undefined; @@ -46265,7 +46429,7 @@ var ts; * this function should be called in a left folding style, with left = previous result of getSpreadType * and right = the new element to be spread. */ - function getSpreadType(left, right, symbol, objectFlags, readonly, isParentTypeNullable) { + function getSpreadType(left, right, symbol, objectFlags, readonly) { if (left.flags & 1 /* Any */ || right.flags & 1 /* Any */) { return anyType; } @@ -46281,16 +46445,16 @@ var ts; if (left.flags & 1048576 /* Union */) { var merged = tryMergeUnionOfObjectTypeAndEmptyObject(left, readonly); if (merged) { - return getSpreadType(merged, right, symbol, objectFlags, readonly, isParentTypeNullable); + return getSpreadType(merged, right, symbol, objectFlags, readonly); } - return mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly, isParentTypeNullable); }); + return mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly); }); } if (right.flags & 1048576 /* Union */) { var merged = tryMergeUnionOfObjectTypeAndEmptyObject(right, readonly); if (merged) { - return getSpreadType(left, merged, symbol, objectFlags, readonly, maybeTypeOfKind(right, 98304 /* Nullable */)); + return getSpreadType(left, merged, symbol, objectFlags, readonly); } - return mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly, maybeTypeOfKind(right, 98304 /* Nullable */)); }); + return mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly); }); } if (right.flags & (528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 132 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)) { return left; @@ -46352,14 +46516,6 @@ var ts; result.nameType = getSymbolLinks(leftProp).nameType; members.set(leftProp.escapedName, result); } - else if (strictNullChecks && - !isParentTypeNullable && - symbol && - !isFromSpreadAssignment(leftProp, symbol) && - isFromSpreadAssignment(rightProp, symbol) && - !maybeTypeOfKind(rightType, 98304 /* Nullable */)) { - error(leftProp.valueDeclaration, ts.Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, ts.unescapeLeadingUnderscores(leftProp.escapedName)); - } } else { members.set(leftProp.escapedName, getSpreadSymbol(leftProp, readonly)); @@ -46458,7 +46614,7 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 246 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 247 /* InterfaceDeclaration */)) { if (!ts.hasModifier(container, 32 /* Static */) && (!ts.isConstructorDeclaration(container) || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -46489,90 +46645,93 @@ var ts; return links.resolvedType; } function getTypeFromTypeNode(node) { + return getConditionalFlowTypeOfType(getTypeFromTypeNodeWorker(node), node); + } + function getTypeFromTypeNodeWorker(node) { switch (node.kind) { case 125 /* AnyKeyword */: - case 295 /* JSDocAllType */: - case 296 /* JSDocUnknownType */: + case 296 /* JSDocAllType */: + case 297 /* JSDocUnknownType */: return anyType; - case 148 /* UnknownKeyword */: + case 149 /* UnknownKeyword */: return unknownType; - case 143 /* StringKeyword */: + case 144 /* StringKeyword */: return stringType; - case 140 /* NumberKeyword */: + case 141 /* NumberKeyword */: return numberType; - case 151 /* BigIntKeyword */: + case 152 /* BigIntKeyword */: return bigintType; - case 128 /* BooleanKeyword */: + case 129 /* BooleanKeyword */: return booleanType; - case 144 /* SymbolKeyword */: + case 145 /* SymbolKeyword */: return esSymbolType; case 110 /* VoidKeyword */: return voidType; - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: return undefinedType; case 100 /* NullKeyword */: return nullType; - case 137 /* NeverKeyword */: + case 138 /* NeverKeyword */: return neverType; - case 141 /* ObjectKeyword */: + case 142 /* ObjectKeyword */: return node.flags & 131072 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType; - case 183 /* ThisType */: + case 184 /* ThisType */: case 104 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 187 /* LiteralType */: + case 188 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return getTypeFromTypeReference(node); - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return node.assertsModifier ? voidType : booleanType; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 174 /* ArrayType */: - case 175 /* TupleType */: + case 175 /* ArrayType */: + case 176 /* TupleType */: return getTypeFromArrayOrTupleTypeNode(node); - case 176 /* OptionalType */: + case 177 /* OptionalType */: return getTypeFromOptionalTypeNode(node); - case 178 /* UnionType */: + case 179 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 179 /* IntersectionType */: + case 180 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 297 /* JSDocNullableType */: + case 298 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 299 /* JSDocOptionalType */: + case 300 /* JSDocOptionalType */: return addOptionality(getTypeFromTypeNode(node.type)); - case 182 /* ParenthesizedType */: - case 298 /* JSDocNonNullableType */: - case 294 /* JSDocTypeExpression */: + case 183 /* ParenthesizedType */: + case 299 /* JSDocNonNullableType */: + case 295 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 177 /* RestType */: + case 178 /* RestType */: return getElementTypeOfArrayType(getTypeFromTypeNode(node.type)) || errorType; - case 301 /* JSDocVariadicType */: + case 302 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 173 /* TypeLiteral */: - case 304 /* JSDocTypeLiteral */: - case 300 /* JSDocFunctionType */: - case 305 /* JSDocSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 174 /* TypeLiteral */: + case 305 /* JSDocTypeLiteral */: + case 301 /* JSDocFunctionType */: + case 306 /* JSDocSignature */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 184 /* TypeOperator */: + case 185 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 186 /* MappedType */: + case 187 /* MappedType */: return getTypeFromMappedTypeNode(node); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return getTypeFromConditionalTypeNode(node); - case 181 /* InferType */: + case 182 /* InferType */: return getTypeFromInferTypeNode(node); - case 188 /* ImportType */: + case 189 /* ImportType */: return getTypeFromImportTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode case 75 /* Identifier */: - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: var symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -46602,27 +46761,41 @@ var ts; function instantiateSignatures(signatures, mapper) { return instantiateList(signatures, mapper, instantiateSignature); } - function makeUnaryTypeMapper(source, target) { - return function (t) { return t === source ? target : t; }; + function createTypeMapper(sources, targets) { + return sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : makeArrayTypeMapper(sources, targets); } - function makeBinaryTypeMapper(source1, target1, source2, target2) { - return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; }; + function getMappedType(type, mapper) { + switch (mapper.kind) { + case 0 /* Simple */: + return type === mapper.source ? mapper.target : type; + case 1 /* Array */: + var sources = mapper.sources; + var targets = mapper.targets; + for (var i = 0; i < sources.length; i++) { + if (type === sources[i]) { + return targets ? targets[i] : anyType; + } + } + return type; + case 2 /* Function */: + return mapper.func(type); + case 3 /* Composite */: + case 4 /* Merged */: + var t1 = getMappedType(type, mapper.mapper1); + return t1 !== type && mapper.kind === 3 /* Composite */ ? instantiateType(t1, mapper.mapper2) : getMappedType(t1, mapper.mapper2); + } + } + function makeUnaryTypeMapper(source, target) { + return { kind: 0 /* Simple */, source: source, target: target }; } function makeArrayTypeMapper(sources, targets) { - return function (t) { - for (var i = 0; i < sources.length; i++) { - if (t === sources[i]) { - return targets ? targets[i] : anyType; - } - } - return t; - }; + return { kind: 1 /* Array */, sources: sources, targets: targets }; } - function createTypeMapper(sources, targets) { - ts.Debug.assert(targets === undefined || sources.length === targets.length); - return sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : - sources.length === 2 ? makeBinaryTypeMapper(sources[0], targets ? targets[0] : anyType, sources[1], targets ? targets[1] : anyType) : - makeArrayTypeMapper(sources, targets); + function makeFunctionTypeMapper(func) { + return { kind: 2 /* Function */, func: func }; + } + function makeCompositeTypeMapper(kind, mapper1, mapper2) { + return { kind: kind, mapper1: mapper1, mapper2: mapper2 }; } function createTypeEraser(sources) { return createTypeMapper(sources, /*targets*/ undefined); @@ -46632,29 +46805,25 @@ var ts; * This is used during inference when instantiating type parameter defaults. */ function createBackreferenceMapper(context, index) { - return function (t) { return ts.findIndex(context.inferences, function (info) { return info.typeParameter === t; }) >= index ? unknownType : t; }; + return makeFunctionTypeMapper(function (t) { return ts.findIndex(context.inferences, function (info) { return info.typeParameter === t; }) >= index ? unknownType : t; }); } function combineTypeMappers(mapper1, mapper2) { - if (!mapper1) - return mapper2; - if (!mapper2) - return mapper1; - return function (t) { return instantiateType(mapper1(t), mapper2); }; + return mapper1 ? makeCompositeTypeMapper(3 /* Composite */, mapper1, mapper2) : mapper2; } - function createReplacementMapper(source, target, baseMapper) { - return function (t) { return t === source ? target : baseMapper(t); }; + function mergeTypeMappers(mapper1, mapper2) { + return mapper1 ? makeCompositeTypeMapper(4 /* Merged */, mapper1, mapper2) : mapper2; } - function permissiveMapper(type) { - return type.flags & 262144 /* TypeParameter */ ? wildcardType : type; + function prependTypeMapping(source, target, mapper) { + return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(4 /* Merged */, makeUnaryTypeMapper(source, target), mapper); + } + function appendTypeMapping(mapper, source, target) { + return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(4 /* Merged */, mapper, makeUnaryTypeMapper(source, target)); } function getRestrictiveTypeParameter(tp) { return tp.constraint === unknownType ? tp : tp.restrictiveInstantiation || (tp.restrictiveInstantiation = createTypeParameter(tp.symbol), tp.restrictiveInstantiation.constraint = unknownType, tp.restrictiveInstantiation); } - function restrictiveMapper(type) { - return type.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(type) : type; - } function cloneTypeParameter(typeParameter) { var result = createTypeParameter(typeParameter.symbol); result.target = typeParameter; @@ -46688,7 +46857,7 @@ var ts; } function instantiateSymbol(symbol, mapper) { var links = getSymbolLinks(symbol); - if (links.type && !maybeTypeOfKind(links.type, 524288 /* Object */ | 63176704 /* Instantiable */)) { + if (links.type && !couldContainTypeVariables(links.type)) { // If the type of the symbol is already resolved, and if that type could not possibly // be affected by instantiation, simply return the symbol itself. return symbol; @@ -46754,7 +46923,8 @@ var ts; // We are instantiating an anonymous type that has one or more type parameters in scope. Apply the // mapper to the type parameters to produce the effective list of type arguments, and compute the // instantiation cache key from the type IDs of the type arguments. - var typeArguments = ts.map(typeParameters, combineTypeMappers(type.mapper, mapper)); + var combinedMapper_1 = combineTypeMappers(type.mapper, mapper); + var typeArguments = ts.map(typeParameters, function (t) { return getMappedType(t, combinedMapper_1); }); var id = getTypeListId(typeArguments); var result = links.instantiations.get(id); if (!result) { @@ -46769,9 +46939,9 @@ var ts; return type; } function maybeTypeParameterReference(node) { - return !(node.kind === 153 /* QualifiedName */ || - node.parent.kind === 169 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || - node.parent.kind === 188 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); + return !(node.kind === 154 /* QualifiedName */ || + node.parent.kind === 170 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || + node.parent.kind === 189 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); } function isTypeParameterPossiblyReferenced(tp, node) { // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks @@ -46780,7 +46950,7 @@ var ts; if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container = tp.symbol.declarations[0].parent; for (var n = node; n !== container; n = n.parent) { - if (!n || n.kind === 223 /* Block */ || n.kind === 180 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { + if (!n || n.kind === 224 /* Block */ || n.kind === 181 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { return true; } } @@ -46789,12 +46959,12 @@ var ts; return true; function containsReference(node) { switch (node.kind) { - case 183 /* ThisType */: + case 184 /* ThisType */: return !!tp.isThisType; case 75 /* Identifier */: return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) && - getTypeFromTypeNode(node) === tp; - case 172 /* TypeQuery */: + getTypeFromTypeNodeWorker(node) === tp; // use worker because we're looking for === equality + case 173 /* TypeQuery */: return true; } return !!ts.forEachChild(node, containsReference); @@ -46826,8 +46996,8 @@ var ts; var mappedTypeVariable = instantiateType(typeVariable, mapper); if (typeVariable !== mappedTypeVariable) { return mapType(getReducedType(mappedTypeVariable), function (t) { - if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { - var replacementMapper = createReplacementMapper(typeVariable, t, mapper); + if (t.flags & (3 /* AnyOrUnknown */ | 193200128 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { + var replacementMapper = prependTypeMapping(typeVariable, t, mapper); return isArrayType(t) ? instantiateMappedArrayType(t, type, replacementMapper) : isTupleType(t) ? instantiateMappedTupleType(t, type, replacementMapper) : instantiateAnonymousType(type, replacementMapper); @@ -46860,7 +47030,7 @@ var ts; createTupleType(elementTypes, newMinLength, tupleType.target.hasRestElement, newReadonly, tupleType.target.associatedNames); } function instantiateMappedTypeTemplate(type, key, isOptional, mapper) { - var templateMapper = combineTypeMappers(mapper, createTypeMapper([getTypeParameterFromMappedType(type)], [key])); + var templateMapper = appendTypeMapping(mapper, getTypeParameterFromMappedType(type), key); var propType = instantiateType(getTemplateTypeFromMappedType(type.target || type), templateMapper); var modifiers = getMappedTypeModifiers(type); return strictNullChecks && modifiers & 4 /* IncludeOptional */ && !maybeTypeOfKind(propType, 32768 /* Undefined */ | 16384 /* Void */) ? getOptionalType(propType) : @@ -46890,7 +47060,7 @@ var ts; // We are instantiating a conditional type that has one or more type parameters in scope. Apply the // mapper to the type parameters to produce the effective list of type arguments, and compute the // instantiation cache key from the type IDs of the type arguments. - var typeArguments = ts.map(root.outerTypeParameters, mapper); + var typeArguments = ts.map(root.outerTypeParameters, function (t) { return getMappedType(t, mapper); }); var id = getTypeListId(typeArguments); var result = root.instantiations.get(id); if (!result) { @@ -46908,15 +47078,15 @@ var ts; // type A | B, we produce (A extends U ? X : Y) | (B extends U ? X : Y). if (root.isDistributive) { var checkType_1 = root.checkType; - var instantiatedType = mapper(checkType_1); + var instantiatedType = getMappedType(checkType_1, mapper); if (checkType_1 !== instantiatedType && instantiatedType.flags & (1048576 /* Union */ | 131072 /* Never */)) { - return mapType(instantiatedType, function (t) { return getConditionalType(root, createReplacementMapper(checkType_1, t, mapper)); }); + return mapType(instantiatedType, function (t) { return getConditionalType(root, prependTypeMapping(checkType_1, t, mapper)); }); } } return getConditionalType(root, mapper); } function instantiateType(type, mapper) { - if (!type || !mapper || mapper === identityMapper) { + if (!type || !mapper) { return type; } if (instantiationDepth === 50 || instantiationCount >= 5000000) { @@ -46934,9 +47104,10 @@ var ts; return result; } function instantiateTypeWorker(type, mapper) { + var _a; var flags = type.flags; if (flags & 262144 /* TypeParameter */) { - return mapper(type); + return getMappedType(type, mapper); } if (flags & 524288 /* Object */) { var objectFlags = type.objectFlags; @@ -46981,8 +47152,11 @@ var ts; if (flags & 16777216 /* Conditional */) { return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper)); } + if (flags & 134217728 /* Awaited */) { + return (_a = getAwaitedType(instantiateType(type.awaitedType, mapper))) !== null && _a !== void 0 ? _a : unknownType; + } if (flags & 33554432 /* Substitution */) { - var maybeVariable = instantiateType(type.typeVariable, mapper); + var maybeVariable = instantiateType(type.baseType, mapper); if (maybeVariable.flags & 8650752 /* TypeVariable */) { return getSubstitutionType(maybeVariable, instantiateType(type.substitute, mapper)); } @@ -47022,35 +47196,35 @@ var ts; // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 244 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type return isContextSensitiveFunctionLikeDeclaration(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return ts.some(node.properties, isContextSensitive); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return ts.some(node.elements, isContextSensitive); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive); - case 273 /* JsxAttribute */: { + case 274 /* JsxAttribute */: { // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. var initializer = node.initializer; return !!initializer && isContextSensitive(initializer); } - case 276 /* JsxExpression */: { + case 277 /* JsxExpression */: { // It is possible to that node.expression is undefined (e.g
) var expression = node.expression; return !!expression && isContextSensitive(expression); @@ -47069,7 +47243,7 @@ var ts; if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 202 /* ArrowFunction */) { + if (node.kind !== 203 /* ArrowFunction */) { // If the first parameter is not an explicit 'this' parameter, then the function has // an implicit 'this' parameter which is subject to contextual typing. var parameter = ts.firstOrUndefined(node.parameters); @@ -47082,7 +47256,7 @@ var ts; } function hasContextSensitiveReturnExpression(node) { // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 223 /* Block */ && isContextSensitive(node.body); + return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 224 /* Block */ && isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && @@ -47135,7 +47309,7 @@ var ts; function isTypeDerivedFrom(source, target) { return source.flags & 1048576 /* Union */ ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) : target.flags & 1048576 /* Union */ ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) : - source.flags & 58982400 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : + source.flags & 193200128 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : target === globalObjectType ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) : target === globalFunctionType ? !!(source.flags & 524288 /* Object */) && isFunctionObjectType(source) : hasBaseType(source, getTargetType(target)); @@ -47185,23 +47359,23 @@ var ts; return true; } switch (node.kind) { - case 276 /* JsxExpression */: - case 200 /* ParenthesizedExpression */: + case 277 /* JsxExpression */: + case 201 /* ParenthesizedExpression */: return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: case 27 /* CommaToken */: return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); } return false; @@ -47392,7 +47566,7 @@ var ts; } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: // child is of the type of the expression return { errorNode: child, innerExpression: child.expression, nameType: nameType }; case 11 /* JsxText */: @@ -47401,9 +47575,9 @@ var ts; } // child is a string return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() }; - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 270 /* JsxFragment */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 271 /* JsxFragment */: // child is of type JSX.Element return { errorNode: child, innerExpression: child, nameType: nameType }; default: @@ -47554,11 +47728,11 @@ var ts; } _b = prop.kind; switch (_b) { - case 164 /* SetAccessor */: return [3 /*break*/, 2]; - case 163 /* GetAccessor */: return [3 /*break*/, 2]; - case 161 /* MethodDeclaration */: return [3 /*break*/, 2]; - case 282 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; - case 281 /* PropertyAssignment */: return [3 /*break*/, 4]; + case 165 /* SetAccessor */: return [3 /*break*/, 2]; + case 164 /* GetAccessor */: return [3 /*break*/, 2]; + case 162 /* MethodDeclaration */: return [3 /*break*/, 2]; + case 283 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; + case 282 /* PropertyAssignment */: return [3 /*break*/, 4]; } return [3 /*break*/, 6]; case 2: return [4 /*yield*/, { errorNode: prop.name, innerExpression: undefined, nameType: type }]; @@ -47635,8 +47809,8 @@ var ts; return 0 /* False */; } var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 161 /* MethodDeclaration */ && - kind !== 160 /* MethodSignature */ && kind !== 162 /* Constructor */; + var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 162 /* MethodDeclaration */ && + kind !== 161 /* MethodSignature */ && kind !== 163 /* Constructor */; var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -47897,7 +48071,7 @@ var ts; return !!(related & 1 /* Succeeded */); } } - if (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */) { + if (source.flags & 201064448 /* StructuredOrInstantiable */ || target.flags & 201064448 /* StructuredOrInstantiable */) { return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; @@ -47910,7 +48084,7 @@ var ts; var t = isFreshLiteralType(type) ? type.regularType : ts.getObjectFlags(type) & 4 /* Reference */ && type.node ? createTypeReference(type.target, getTypeArguments(type)) : type.flags & 3145728 /* UnionOrIntersection */ ? getReducedType(type) : - type.flags & 33554432 /* Substitution */ ? writing ? type.typeVariable : type.substitute : + type.flags & 33554432 /* Substitution */ ? writing ? type.baseType : type.substitute : type.flags & 25165824 /* Simplifiable */ ? getSimplifiedType(type, writing) : type; if (t === type) @@ -48130,8 +48304,15 @@ var ts; if (incompatibleStack.length) reportIncompatibleStack(); var _a = getTypeNamesForErrorDisplay(source, target), sourceType = _a[0], targetType = _a[1]; - if (target.flags & 262144 /* TypeParameter */ && target.immediateBaseConstraint !== undefined && isTypeAssignableTo(source, target.immediateBaseConstraint)) { - reportError(ts.Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2, sourceType, targetType, typeToString(target.immediateBaseConstraint)); + if (target.flags & 262144 /* TypeParameter */) { + var constraint = getBaseConstraintOfType(target); + var constraintElab = constraint && isTypeAssignableTo(source, constraint); + if (constraintElab) { + reportError(ts.Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2, sourceType, targetType, typeToString(constraint)); + } + else { + reportError(ts.Diagnostics._0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1, targetType, sourceType); + } } if (!message) { if (relation === comparableRelation) { @@ -48267,7 +48448,7 @@ var ts; if (source.flags & 1048576 /* Union */) { result = relation === comparableRelation ? someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState) : - eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */)); + eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState & 4 /* ExcessCheck */); } else { if (target.flags & 1048576 /* Union */) { @@ -48275,9 +48456,9 @@ var ts; } else if (target.flags & 2097152 /* Intersection */) { result = typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2 /* Target */); - if (result && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks)) { + if (result && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) && !(intersectionState & 4 /* ExcessCheck */)) { // Validate against excess props using the original `source` - if (!propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 0 /* None */)) { + if (!propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 4 /* ExcessCheck */)) { return 0 /* False */; } } @@ -48296,9 +48477,11 @@ var ts; // // - For a primitive type or type parameter (such as 'number = A & B') there is no point in // breaking the intersection apart. - result = someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */); + if (!isNonGenericObjectType(target) || !ts.every(source.types, function (t) { return isNonGenericObjectType(t) && !(ts.getObjectFlags(t) & 2097152 /* NonInferrableType */); })) { + result = someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */); + } } - if (!result && (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */)) { + if (!result && (source.flags & 201064448 /* StructuredOrInstantiable */ || target.flags & 201064448 /* StructuredOrInstantiable */)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) { resetErrorInfo(saveErrorInfo); } @@ -48528,12 +48711,12 @@ var ts; } return 0 /* False */; } - function eachTypeRelatedToType(source, target, reportErrors) { + function eachTypeRelatedToType(source, target, reportErrors, intersectionState) { var result = -1 /* True */; var sourceTypes = source.types; for (var _i = 0, sourceTypes_2 = sourceTypes; _i < sourceTypes_2.length; _i++) { var sourceType = sourceTypes_2[_i]; - var related = isRelatedTo(sourceType, target, reportErrors); + var related = isRelatedTo(sourceType, target, reportErrors, /*headMessage*/ undefined, intersectionState); if (!related) { return 0 /* False */; } @@ -48621,10 +48804,10 @@ var ts; // We're in the middle of variance checking - integrate any unmeasurable/unreliable flags from this cached component var saved = entry & 24 /* ReportsMask */; if (saved & 8 /* ReportsUnmeasurable */) { - instantiateType(source, reportUnmeasurableMarkers); + instantiateType(source, makeFunctionTypeMapper(reportUnmeasurableMarkers)); } if (saved & 16 /* ReportsUnreliable */) { - instantiateType(source, reportUnreliableMarkers); + instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers)); } } return entry & 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */; @@ -48663,7 +48846,8 @@ var ts; if (outofbandVarianceMarkerHandler) { originalHandler = outofbandVarianceMarkerHandler; outofbandVarianceMarkerHandler = function (onlyUnreliable) { - propagatingVarianceFlags |= onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */; + propagatingVarianceFlags |= + onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */; return originalHandler(onlyUnreliable); }; } @@ -48790,6 +48974,17 @@ var ts; } } } + else if (target.flags & 134217728 /* Awaited */ && source.flags & 134217728 /* Awaited */) { + var targetType = target.awaitedType; + var sourceType = instantiateType(source.awaitedType, makeFunctionTypeMapper(reportUnreliableMarkers)); + // An `awaited S` is related to an `awaited T` if `S` is related to `T`: + // + // S <: T ⇒ awaited S <: awaited T + // + if (result = isRelatedTo(sourceType, targetType, reportErrors)) { + return result; + } + } else if (isGenericMappedType(target)) { // A source type T is related to a target type { [P in X]: T[P] } var template = getTemplateTypeFromMappedType(target); @@ -48903,6 +49098,21 @@ var ts; } } } + else if (source.flags & 134217728 /* Awaited */) { + // An `awaited S` is related to `T` if `awaited C` is related to `T`, where `C` is the + // constraint of `S`: + // + // S <: C ^ awaited C <: T ⇒ awaited S <: T + // + // For example `awaited Promise` is assignable to `number`. + var constraint = getConstraintOfType(source.awaitedType); + var awaitedConstraint = constraint && getAwaitedType(constraint); + if (awaitedConstraint) { + if (result = isRelatedTo(awaitedConstraint, target, reportErrors)) { + return result; + } + } + } else { // An empty object type is related to any mapped type that includes a '?' modifier. if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target) && isEmptyObjectType(source)) { @@ -49062,7 +49272,7 @@ var ts; if (modifiersRelated) { var result_6; var targetConstraint = getConstraintTypeFromMappedType(target); - var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers); + var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers)); if (result_6 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) { var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); return result_6 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); @@ -49530,7 +49740,7 @@ var ts; * See signatureAssignableTo, compareSignaturesIdentical */ function signatureRelatedTo(source, target, erase, reportErrors, incompatibleReporter) { - return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0, reportErrors, reportError, incompatibleReporter, isRelatedTo, reportUnreliableMarkers); + return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0, reportErrors, reportError, incompatibleReporter, isRelatedTo, makeFunctionTypeMapper(reportUnreliableMarkers)); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -49681,10 +49891,6 @@ var ts; // make sure exactly 1 matches before returning it return match === -1 || discriminable.indexOf(/*searchElement*/ true, match + 1) !== -1 ? defaultValue : target.types[match]; } - function isFromSpreadAssignment(prop, container) { - var _a; - return ((_a = prop.valueDeclaration) === null || _a === void 0 ? void 0 : _a.parent) !== container.valueDeclaration; - } /** * A type is 'weak' if it is an object type with at least one optional property * and no required properties, call/construct signatures or index signatures @@ -49758,13 +49964,11 @@ var ts; variance = 4 /* Independent */; } outofbandVarianceMarkerHandler = oldHandler; - if (unmeasurable || unreliable) { - if (unmeasurable) { - variance |= 8 /* Unmeasurable */; - } - if (unreliable) { - variance |= 16 /* Unreliable */; - } + if (unmeasurable) { + variance |= 8 /* Unmeasurable */; + } + if (unreliable) { + variance |= 16 /* Unreliable */; } variances.push(variance); }; @@ -50537,12 +50741,12 @@ var ts; } var diagnostic; switch (declaration.kind) { - case 209 /* BinaryExpression */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 210 /* BinaryExpression */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 156 /* Parameter */: + case 157 /* Parameter */: var param = declaration; if (ts.isIdentifier(param.name) && (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && @@ -50557,23 +50761,23 @@ var ts; noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; if (!noImplicitAny) { // Don't issue a suggestion for binding elements since the codefix doesn't yet support them. return; } break; - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: if (noImplicitAny && !declaration.name) { if (wideningKind === 1 /* GeneratorYield */) { error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); @@ -50587,7 +50791,7 @@ var ts; wideningKind === 1 /* GeneratorYield */ ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 186 /* MappedType */: + case 187 /* MappedType */: if (noImplicitAny) { error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } @@ -50649,8 +50853,8 @@ var ts; signature: signature, flags: flags, compareTypes: compareTypes, - mapper: function (t) { return mapToInferredType(context, t, /*fix*/ true); }, - nonFixingMapper: function (t) { return mapToInferredType(context, t, /*fix*/ false); }, + mapper: makeFunctionTypeMapper(function (t) { return mapToInferredType(context, t, /*fix*/ true); }), + nonFixingMapper: makeFunctionTypeMapper(function (t) { return mapToInferredType(context, t, /*fix*/ false); }), }; return context; } @@ -50715,7 +50919,7 @@ var ts; if (objectFlags & 67108864 /* CouldContainTypeVariablesComputed */) { return !!(objectFlags & 134217728 /* CouldContainTypeVariables */); } - var result = !!(type.flags & 63176704 /* Instantiable */ || + var result = !!(type.flags & 197394432 /* Instantiable */ || objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 131072 /* ObjectRestType */) || @@ -51011,7 +51215,7 @@ var ts; var indexType = getSimplifiedType(target.indexType, /*writing*/ false); // Generally simplifications of instantiable indexes are avoided to keep relationship checking correct, however if our target is an access, we can consider // that key of that access to be "instantiated", since we're looking to find the infernce goal in any way we can. - if (indexType.flags & 63176704 /* Instantiable */) { + if (indexType.flags & 197394432 /* Instantiable */) { var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, /*writing*/ false), indexType, /*writing*/ false); if (simplified_1 && simplified_1 !== target) { invokeOnce(source, simplified_1, inferFromTypes); @@ -51046,6 +51250,9 @@ var ts; inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } + else if (source.flags & 134217728 /* Awaited */ && target.flags & 134217728 /* Awaited */) { + inferFromTypes(source.awaitedType, target.awaitedType); + } else if (target.flags & 16777216 /* Conditional */) { var savePriority = priority; priority |= contravariant ? 16 /* ContravariantConditional */ : 0; @@ -51053,6 +51260,10 @@ var ts; inferToMultipleTypes(source, targetTypes, target.flags); priority = savePriority; } + else if (target.flags & 134217728 /* Awaited */) { + var targetTypes = [target.awaitedType, createPromiseLikeType(target.awaitedType)]; + inferToMultipleTypes(source, targetTypes, target.flags); + } else if (target.flags & 3145728 /* UnionOrIntersection */) { inferToMultipleTypes(source, target.types, target.flags); } @@ -51066,7 +51277,7 @@ var ts; } else { source = getReducedType(source); - if (!(priority & 128 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 63176704 /* Instantiable */))) { + if (!(priority & 128 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 197394432 /* Instantiable */))) { var apparentSource = getApparentType(source); // getApparentType can return _any_ type, since an indexed access or conditional may simplify to any other type. // If that occurs and it doesn't simplify to an object or intersection, we'll need to restart `inferFromTypes` @@ -51348,6 +51559,32 @@ var ts; } // Infer from the members of source and target only if the two types are possibly related if (!typesDefinitelyUnrelated(source, target)) { + if (isArrayType(source) || isTupleType(source)) { + if (isTupleType(target)) { + var sourceLength = isTupleType(source) ? getLengthOfTupleType(source) : 0; + var targetLength = getLengthOfTupleType(target); + var sourceRestType = isTupleType(source) ? getRestTypeOfTupleType(source) : getElementTypeOfArrayType(source); + var targetRestType = getRestTypeOfTupleType(target); + var fixedLength = targetLength < sourceLength || sourceRestType ? targetLength : sourceLength; + for (var i = 0; i < fixedLength; i++) { + inferFromTypes(i < sourceLength ? getTypeArguments(source)[i] : sourceRestType, getTypeArguments(target)[i]); + } + if (targetRestType) { + var types = fixedLength < sourceLength ? getTypeArguments(source).slice(fixedLength, sourceLength) : []; + if (sourceRestType) { + types.push(sourceRestType); + } + if (types.length) { + inferFromTypes(getUnionType(types), targetRestType); + } + } + return; + } + if (isArrayType(target)) { + inferFromIndexTypes(source, target); + return; + } + } inferFromProperties(source, target); inferFromSignatures(source, target, 0 /* Call */); inferFromSignatures(source, target, 1 /* Construct */); @@ -51355,32 +51592,6 @@ var ts; } } function inferFromProperties(source, target) { - if (isArrayType(source) || isTupleType(source)) { - if (isTupleType(target)) { - var sourceLength = isTupleType(source) ? getLengthOfTupleType(source) : 0; - var targetLength = getLengthOfTupleType(target); - var sourceRestType = isTupleType(source) ? getRestTypeOfTupleType(source) : getElementTypeOfArrayType(source); - var targetRestType = getRestTypeOfTupleType(target); - var fixedLength = targetLength < sourceLength || sourceRestType ? targetLength : sourceLength; - for (var i = 0; i < fixedLength; i++) { - inferFromTypes(i < sourceLength ? getTypeArguments(source)[i] : sourceRestType, getTypeArguments(target)[i]); - } - if (targetRestType) { - var types = fixedLength < sourceLength ? getTypeArguments(source).slice(fixedLength, sourceLength) : []; - if (sourceRestType) { - types.push(sourceRestType); - } - if (types.length) { - inferFromTypes(getUnionType(types), targetRestType); - } - } - return; - } - if (isArrayType(target)) { - inferFromIndexTypes(source, target); - return; - } - } var properties = getPropertiesOfObjectType(target); for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { var targetProp = properties_3[_i]; @@ -51398,7 +51609,7 @@ var ts; var len = sourceLen < targetLen ? sourceLen : targetLen; var skipParameters = !!(ts.getObjectFlags(source) & 2097152 /* NonInferrableType */); for (var i = 0; i < len; i++) { - inferFromSignature(getBaseSignature(sourceSignatures[sourceLen - len + i]), getBaseSignature(targetSignatures[targetLen - len + i]), skipParameters); + inferFromSignature(getBaseSignature(sourceSignatures[sourceLen - len + i]), getErasedSignature(targetSignatures[targetLen - len + i]), skipParameters); } } function inferFromSignature(source, target, skipParameters) { @@ -51406,7 +51617,7 @@ var ts; var saveBivariant = bivariant; var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; // Once we descend into a bivariant signature we remain bivariant for all nested inferences - bivariant = bivariant || kind === 161 /* MethodDeclaration */ || kind === 160 /* MethodSignature */ || kind === 162 /* Constructor */; + bivariant = bivariant || kind === 162 /* MethodDeclaration */ || kind === 161 /* MethodSignature */ || kind === 163 /* Constructor */; applyToParameterTypes(source, target, inferFromContravariantTypes); bivariant = saveBivariant; } @@ -51514,7 +51725,7 @@ var ts; if (defaultType) { // Instantiate the default type. Any forward reference to a type // parameter should be instantiated to the empty object type. - inferredType = instantiateType(defaultType, combineTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper)); + inferredType = instantiateType(defaultType, mergeTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper)); } } } @@ -51576,7 +51787,7 @@ var ts; case "AsyncIterator": return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later; default: - if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; } else { @@ -51597,7 +51808,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - return !!ts.findAncestor(node, function (n) { return n.kind === 172 /* TypeQuery */ ? true : n.kind === 75 /* Identifier */ || n.kind === 153 /* QualifiedName */ ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 173 /* TypeQuery */ ? true : n.kind === 75 /* Identifier */ || n.kind === 154 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -51612,11 +51823,11 @@ var ts; return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; case 104 /* ThisKeyword */: return "0"; - case 218 /* NonNullExpression */: - case 200 /* ParenthesizedExpression */: + case 219 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: var propName = getAccessedPropertyName(node); if (propName !== undefined) { var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); @@ -51627,24 +51838,24 @@ var ts; } function isMatchingReference(source, target) { switch (target.kind) { - case 200 /* ParenthesizedExpression */: - case 218 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: + case 219 /* NonNullExpression */: return isMatchingReference(source, target.expression); } switch (source.kind) { case 75 /* Identifier */: return target.kind === 75 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 242 /* VariableDeclaration */ || target.kind === 191 /* BindingElement */) && + (target.kind === 243 /* VariableDeclaration */ || target.kind === 192 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 104 /* ThisKeyword */: return target.kind === 104 /* ThisKeyword */; case 102 /* SuperKeyword */: return target.kind === 102 /* SuperKeyword */; - case 218 /* NonNullExpression */: - case 200 /* ParenthesizedExpression */: + case 219 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: return isMatchingReference(source.expression, target); - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return ts.isAccessExpression(target) && getAccessedPropertyName(source) === getAccessedPropertyName(target) && isMatchingReference(source.expression, target.expression); @@ -51652,7 +51863,7 @@ var ts; return false; } function getAccessedPropertyName(access) { - return access.kind === 194 /* PropertyAccessExpression */ ? access.name.escapedText : + return access.kind === 195 /* PropertyAccessExpression */ ? access.name.escapedText : ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } @@ -51681,7 +51892,7 @@ var ts; if (prop.isDiscriminantProperty === undefined) { prop.isDiscriminantProperty = (prop.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && - !maybeTypeOfKind(getTypeOfSymbol(prop), 63176704 /* Instantiable */); + !maybeTypeOfKind(getTypeOfSymbol(prop), 197394432 /* Instantiable */); } return !!prop.isDiscriminantProperty; } @@ -51714,7 +51925,7 @@ var ts; } } } - if (callExpression.expression.kind === 194 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 195 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -51832,7 +52043,7 @@ var ts; if (flags & 67108864 /* NonPrimitive */) { return strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */; } - if (flags & 63176704 /* Instantiable */) { + if (flags & 197394432 /* Instantiable */) { return getTypeFacts(getBaseConstraintOfType(type) || unknownType); } if (flags & 3145728 /* UnionOrIntersection */) { @@ -51869,15 +52080,15 @@ var ts; return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 192 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 281 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 193 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 282 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 209 /* BinaryExpression */ && parent.parent.left === parent || - parent.parent.kind === 232 /* ForOfStatement */ && parent.parent.initializer === parent; + return parent.parent.kind === 210 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 233 /* ForOfStatement */ && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -51894,21 +52105,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return stringType; - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || errorType; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return undefinedType; - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return errorType; @@ -51916,7 +52127,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 189 /* ObjectBindingPattern */ ? + var type = pattern.kind === 190 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : @@ -51934,30 +52145,30 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 231 /* ForInStatement */) { + if (node.parent.parent.kind === 232 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 232 /* ForOfStatement */) { + if (node.parent.parent.kind === 233 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 242 /* VariableDeclaration */ ? + return node.kind === 243 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function isEmptyArrayAssignment(node) { - return node.kind === 242 /* VariableDeclaration */ && node.initializer && + return node.kind === 243 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 191 /* BindingElement */ && node.parent.kind === 209 /* BinaryExpression */ && + node.kind !== 192 /* BindingElement */ && node.parent.kind === 210 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: return getReferenceCandidate(node.left); @@ -51969,13 +52180,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 200 /* ParenthesizedExpression */ || - parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || - parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? + return parent.kind === 201 /* ParenthesizedExpression */ || + parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || + parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 277 /* CaseClause */) { + if (clause.kind === 278 /* CaseClause */) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -51991,20 +52202,19 @@ var ts; } return links.switchTypes; } - // Get the types from all cases in a switch on `typeof`. An - // `undefined` element denotes an explicit `default` clause. - function getSwitchClauseTypeOfWitnesses(switchStatement) { + function getSwitchClauseTypeOfWitnesses(switchStatement, retainDefault) { var witnesses = []; for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) { var clause = _a[_i]; - if (clause.kind === 277 /* CaseClause */) { + if (clause.kind === 278 /* CaseClause */) { if (ts.isStringLiteralLike(clause.expression)) { witnesses.push(clause.expression.text); continue; } return ts.emptyArray; } - witnesses.push(/*explicitDefaultStatement*/ undefined); + if (retainDefault) + witnesses.push(/*explicitDefaultStatement*/ undefined); } return witnesses; } @@ -52158,12 +52368,12 @@ var ts; var root = getReferenceRoot(node); var parent = root.parent; var isLengthPushOrUnshift = ts.isPropertyAccessExpression(parent) && (parent.name.escapedText === "length" || - parent.parent.kind === 196 /* CallExpression */ + parent.parent.kind === 197 /* CallExpression */ && ts.isIdentifier(parent.name) && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 195 /* ElementAccessExpression */ && + var isElementAssignment = parent.kind === 196 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 209 /* BinaryExpression */ && + parent.parent.kind === 210 /* BinaryExpression */ && parent.parent.operatorToken.kind === 62 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -52171,8 +52381,8 @@ var ts; return isLengthPushOrUnshift || isElementAssignment; } function isDeclarationWithExplicitTypeAnnotation(declaration) { - return !!(declaration && (declaration.kind === 242 /* VariableDeclaration */ || declaration.kind === 156 /* Parameter */ || - declaration.kind === 159 /* PropertyDeclaration */ || declaration.kind === 158 /* PropertySignature */) && + return !!(declaration && (declaration.kind === 243 /* VariableDeclaration */ || declaration.kind === 157 /* Parameter */ || + declaration.kind === 160 /* PropertyDeclaration */ || declaration.kind === 159 /* PropertySignature */) && ts.getEffectiveTypeAnnotationNode(declaration)); } function getExplicitTypeOfSymbol(symbol, diagnostic) { @@ -52202,11 +52412,11 @@ var ts; return getExplicitThisType(node); case 102 /* SuperKeyword */: return checkSuperExpression(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: var type = getTypeOfDottedName(node.expression, diagnostic); var prop = type && getPropertyOfType(type, node.name.escapedText); return prop && getExplicitTypeOfSymbol(prop, diagnostic); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return getTypeOfDottedName(node.expression, diagnostic); } } @@ -52220,7 +52430,7 @@ var ts; // circularities in control flow analysis, we use getTypeOfDottedName when resolving the call // target expression of an assertion. var funcType = void 0; - if (node.parent.kind === 226 /* ExpressionStatement */) { + if (node.parent.kind === 227 /* ExpressionStatement */) { funcType = getTypeOfDottedName(node.expression, /*diagnostic*/ undefined); } else if (node.expression.kind !== 102 /* SuperKeyword */) { @@ -52264,7 +52474,7 @@ var ts; } function isFalseExpression(expr) { var node = ts.skipParentheses(expr); - return node.kind === 91 /* FalseKeyword */ || node.kind === 209 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || + return node.kind === 91 /* FalseKeyword */ || node.kind === 210 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right)); } function isReachableFlowNodeWorker(flow, noCacheCheck) { @@ -52339,7 +52549,7 @@ var ts; if (flowAnalysisDisabled) { return errorType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 133970943 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 268188671 /* Narrowable */)) { return declaredType; } flowInvocationCount++; @@ -52351,7 +52561,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); - if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 218 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 219 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { return declaredType; } return resultType; @@ -52432,8 +52642,8 @@ var ts; // Check if we should continue with the control flow of the containing function. var container = flow.node; if (container && container !== flowContainer && - reference.kind !== 194 /* PropertyAccessExpression */ && - reference.kind !== 195 /* ElementAccessExpression */ && + reference.kind !== 195 /* PropertyAccessExpression */ && + reference.kind !== 196 /* ElementAccessExpression */ && reference.kind !== 104 /* ThisKeyword */) { flow = container.flowNode; continue; @@ -52458,7 +52668,7 @@ var ts; } function getInitialOrAssignedType(flow) { var node = flow.node; - return getConstraintForLocation(node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */ ? + return getConstraintForLocation(node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference); } @@ -52498,14 +52708,14 @@ var ts; // in which case we continue control flow analysis back to the function's declaration if (ts.isVariableDeclaration(node) && (ts.isInJSFile(node) || ts.isVarConst(node))) { var init = ts.getDeclaredExpandoInitializer(node); - if (init && (init.kind === 201 /* FunctionExpression */ || init.kind === 202 /* ArrowFunction */)) { + if (init && (init.kind === 202 /* FunctionExpression */ || init.kind === 203 /* ArrowFunction */)) { return getTypeAtFlowNode(flow.antecedent); } } return declaredType; } // for (const _ in ref) acts as a nonnull on ref - if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 231 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { + if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 232 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))); } // Assignment doesn't affect reference @@ -52516,7 +52726,7 @@ var ts; if (node.kind === 91 /* FalseKeyword */) { return unreachableNeverType; } - if (node.kind === 209 /* BinaryExpression */) { + if (node.kind === 210 /* BinaryExpression */) { if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) { return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); } @@ -52547,7 +52757,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 196 /* CallExpression */ ? + var expr = node.kind === 197 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -52555,7 +52765,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 196 /* CallExpression */) { + if (node.kind === 197 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -52605,7 +52815,7 @@ var ts; if (isMatchingReference(reference, expr)) { type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } - else if (expr.kind === 204 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { + else if (expr.kind === 205 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } else { @@ -52613,7 +52823,7 @@ var ts; if (optionalChainContainsReference(expr, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & (32768 /* Undefined */ | 131072 /* Never */)); }); } - else if (expr.kind === 204 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { + else if (expr.kind === 205 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined"); }); } } @@ -52825,12 +53035,18 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 204 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { + if (left_1.kind === 205 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 204 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { + if (right_1.kind === 205 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } + if (ts.isConstructorAccessExpression(left_1)) { + return narrowTypeByConstructor(type, left_1, operator_1, right_1, assumeTrue); + } + if (ts.isConstructorAccessExpression(right_1)) { + return narrowTypeByConstructor(type, right_1, operator_1, left_1, assumeTrue); + } if (isMatchingReference(reference, left_1)) { return narrowTypeByEquality(type, operator_1, right_1, assumeTrue); } @@ -52962,7 +53178,7 @@ var ts; if (isTypeSubtypeOf(targetType, type)) { return targetType; } - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(targetType, constraint)) { return getIntersectionType([type, targetType]); @@ -53032,7 +53248,7 @@ var ts; if (isTypeSubtypeOf(candidate, type)) { return candidate; } - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(candidate, constraint)) { return getIntersectionType([type, candidate]); @@ -53042,7 +53258,7 @@ var ts; }; } function narrowBySwitchOnTypeOf(type, switchStatement, clauseStart, clauseEnd) { - var switchWitnesses = getSwitchClauseTypeOfWitnesses(switchStatement); + var switchWitnesses = getSwitchClauseTypeOfWitnesses(switchStatement, /*retainDefault*/ true); if (!switchWitnesses.length) { return type; } @@ -53105,6 +53321,50 @@ var ts; } return getTypeWithFacts(mapType(type, narrowTypeForTypeofSwitch(impliedType)), switchFacts); } + function narrowTypeByConstructor(type, constructorAccessExpr, operator, identifier, assumeTrue) { + // Do not narrow when checking inequality. + if (assumeTrue ? (operator !== 34 /* EqualsEqualsToken */ && operator !== 36 /* EqualsEqualsEqualsToken */) : (operator !== 35 /* ExclamationEqualsToken */ && operator !== 37 /* ExclamationEqualsEqualsToken */)) { + return type; + } + // In the case of `x.y`, a `x.constructor === T` type guard resets the narrowed type of `y` to its declared type. + if (!isMatchingReference(reference, constructorAccessExpr.expression)) { + return declaredType; + } + // Get the type of the constructor identifier expression, if it is not a function then do not narrow. + var identifierType = getTypeOfExpression(identifier); + if (!isFunctionType(identifierType) && !isConstructorType(identifierType)) { + return type; + } + // Get the prototype property of the type identifier so we can find out its type. + var prototypeProperty = getPropertyOfType(identifierType, "prototype"); + if (!prototypeProperty) { + return type; + } + // Get the type of the prototype, if it is undefined, or the global `Object` or `Function` types then do not narrow. + var prototypeType = getTypeOfSymbol(prototypeProperty); + var candidate = !isTypeAny(prototypeType) ? prototypeType : undefined; + if (!candidate || candidate === globalObjectType || candidate === globalFunctionType) { + return type; + } + // If the type that is being narrowed is `any` then just return the `candidate` type since every type is a subtype of `any`. + if (isTypeAny(type)) { + return candidate; + } + // Filter out types that are not considered to be "constructed by" the `candidate` type. + return filterType(type, function (t) { return isConstructedBy(t, candidate); }); + function isConstructedBy(source, target) { + // If either the source or target type are a class type then we need to check that they are the same exact type. + // This is because you may have a class `A` that defines some set of properties, and another class `B` + // that defines the same set of properties as class `A`, in that case they are structurally the same + // type, but when you do something like `instanceOfA.constructor === B` it will return false. + if (source.flags & 524288 /* Object */ && ts.getObjectFlags(source) & 1 /* Class */ || + target.flags & 524288 /* Object */ && ts.getObjectFlags(target) & 1 /* Class */) { + return source.symbol === target.symbol; + } + // For all other types just check that the `source` type is a subtype of the `target` type. + return isTypeSubtypeOf(source, target); + } + } function narrowTypeByInstanceof(type, expr, assumeTrue) { var left = getReferenceCandidate(expr.left); if (!isMatchingReference(reference, left)) { @@ -53199,16 +53459,16 @@ var ts; case 75 /* Identifier */: case 104 /* ThisKeyword */: case 102 /* SuperKeyword */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return narrowTypeByCallExpression(type, expr, assumeTrue); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: if (expr.operator === 53 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -53253,9 +53513,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 250 /* ModuleBlock */ || - node.kind === 290 /* SourceFile */ || - node.kind === 159 /* PropertyDeclaration */; + node.kind === 251 /* ModuleBlock */ || + node.kind === 291 /* SourceFile */ || + node.kind === 160 /* PropertyDeclaration */; }); } // Check if a parameter is assigned anywhere within its declaring function. @@ -53277,7 +53537,7 @@ var ts; if (node.kind === 75 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 156 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 157 /* Parameter */) { symbol.isAssigned = true; } } @@ -53293,7 +53553,7 @@ var ts; function removeOptionalityFromDeclaredType(declaredType, declaration) { if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 156 /* Parameter */ && + declaration.kind === 157 /* Parameter */ && declaration.initializer && getFalsyFlags(declaredType) & 32768 /* Undefined */ && !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768 /* Undefined */); @@ -53307,13 +53567,13 @@ var ts; } function isConstraintPosition(node) { var parent = node.parent; - return parent.kind === 194 /* PropertyAccessExpression */ || - parent.kind === 196 /* CallExpression */ && parent.expression === node || - parent.kind === 195 /* ElementAccessExpression */ && parent.expression === node || - parent.kind === 191 /* BindingElement */ && parent.name === node && !!parent.initializer; + return parent.kind === 195 /* PropertyAccessExpression */ || + parent.kind === 197 /* CallExpression */ && parent.expression === node || + parent.kind === 196 /* ElementAccessExpression */ && parent.expression === node || + parent.kind === 192 /* BindingElement */ && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { - return type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); + return type.flags & 193200128 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); } function getConstraintForLocation(type, node) { // When a node is the left hand expression of a property access, element access, or call expression, @@ -53352,7 +53612,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 202 /* ArrowFunction */) { + if (container.kind === 203 /* ArrowFunction */) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasModifier(container, 256 /* Async */)) { @@ -53373,7 +53633,7 @@ var ts; // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration.kind === 245 /* ClassDeclaration */ + if (declaration.kind === 246 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -53385,14 +53645,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 214 /* ClassExpression */) { + else if (declaration.kind === 215 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); - while (container.kind !== 290 /* SourceFile */) { + while (container.kind !== 291 /* SourceFile */) { if (container.parent === declaration) { - if (container.kind === 159 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { + if (container.kind === 160 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 33554432 /* ConstructorReferenceInClass */; } @@ -53441,7 +53701,7 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 156 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 157 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; @@ -53450,8 +53710,8 @@ var ts; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 201 /* FunctionExpression */ || - flowContainer.kind === 202 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 202 /* FunctionExpression */ || + flowContainer.kind === 203 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } @@ -53460,9 +53720,9 @@ var ts; // declaration container are the same). var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || - isInTypeQuery(node) || node.parent.kind === 263 /* ExportSpecifier */) || - node.parent.kind === 218 /* NonNullExpression */ || - declaration.kind === 242 /* VariableDeclaration */ && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 264 /* ExportSpecifier */) || + node.parent.kind === 219 /* NonNullExpression */ || + declaration.kind === 243 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 8388608 /* Ambient */; var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : @@ -53497,7 +53757,7 @@ var ts; if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || ts.isSourceFile(symbol.valueDeclaration) || - symbol.valueDeclaration.parent.kind === 280 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 281 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -53520,7 +53780,7 @@ var ts; // mark iteration statement as containing block-scoped binding captured in some function var capturesBlockScopeBindingInLoopBody = true; if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container) { var part = getPartOfForStatementContainingNode(node.parent, container); if (part) { @@ -53541,7 +53801,7 @@ var ts; // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */; } @@ -53560,7 +53820,7 @@ var ts; function isAssignedInBodyOfForStatement(node, container) { // skip parenthesized nodes var current = node; - while (current.parent.kind === 200 /* ParenthesizedExpression */) { + while (current.parent.kind === 201 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -53568,7 +53828,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 207 /* PrefixUnaryExpression */ || current.parent.kind === 208 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 208 /* PrefixUnaryExpression */ || current.parent.kind === 209 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; } @@ -53581,7 +53841,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 159 /* PropertyDeclaration */ || container.kind === 162 /* Constructor */) { + if (container.kind === 160 /* PropertyDeclaration */ || container.kind === 163 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -53649,37 +53909,37 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var capturedByArrowFunction = false; - if (container.kind === 162 /* Constructor */) { + if (container.kind === 163 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 202 /* ArrowFunction */) { + if (container.kind === 203 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); capturedByArrowFunction = true; } switch (container.kind) { - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 162 /* Constructor */: + case 163 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: if (ts.hasModifier(container, 32 /* Static */) && !(compilerOptions.target === 99 /* ESNext */ && compilerOptions.useDefineForClassFields)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -53719,7 +53979,9 @@ var ts; var classSymbol = checkExpression(className).symbol; if (classSymbol && classSymbol.members && (classSymbol.flags & 16 /* Function */)) { var classType = getDeclaredTypeOfSymbol(classSymbol).thisType; - return getFlowTypeOfReference(node, classType); + if (classType) { + return getFlowTypeOfReference(node, classType); + } } } // Check if it's a constructor definition, can be either a variable decl or function decl @@ -53727,7 +53989,7 @@ var ts; // * /** @constructor */ function [name]() { ... } // * /** @constructor */ var x = function() { ... } else if (isInJS && - (container.kind === 201 /* FunctionExpression */ || container.kind === 244 /* FunctionDeclaration */) && + (container.kind === 202 /* FunctionExpression */ || container.kind === 245 /* FunctionDeclaration */) && ts.getJSDocClassTag(container)) { var classType = getDeclaredTypeOfSymbol(getMergedSymbol(container.symbol)).thisType; return getFlowTypeOfReference(node, classType); @@ -53774,7 +54036,7 @@ var ts; } function getClassNameFromPrototypeMethod(container) { // Check if it's the RHS of a x.prototype.y = function [name]() { .... } - if (container.kind === 201 /* FunctionExpression */ && + if (container.kind === 202 /* FunctionExpression */ && ts.isBinaryExpression(container.parent) && ts.getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = container' @@ -53784,16 +54046,16 @@ var ts; .expression; // x } // x.prototype = { method() { } } - else if (container.kind === 161 /* MethodDeclaration */ && - container.parent.kind === 193 /* ObjectLiteralExpression */ && + else if (container.kind === 162 /* MethodDeclaration */ && + container.parent.kind === 194 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { return container.parent.parent.left.expression; } // x.prototype = { method: function() { } } - else if (container.kind === 201 /* FunctionExpression */ && - container.parent.kind === 281 /* PropertyAssignment */ && - container.parent.parent.kind === 193 /* ObjectLiteralExpression */ && + else if (container.kind === 202 /* FunctionExpression */ && + container.parent.kind === 282 /* PropertyAssignment */ && + container.parent.parent.kind === 194 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { return container.parent.parent.parent.left.expression; @@ -53801,7 +54063,7 @@ var ts; // Object.defineProperty(x, "method", { value: function() { } }); // Object.defineProperty(x, "method", { set: (x: () => void) => void }); // Object.defineProperty(x, "method", { get: () => function() { }) }); - else if (container.kind === 201 /* FunctionExpression */ && + else if (container.kind === 202 /* FunctionExpression */ && ts.isPropertyAssignment(container.parent) && ts.isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && @@ -53826,7 +54088,7 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 300 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 301 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -53840,15 +54102,15 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 156 /* Parameter */ && n.parent === constructorDecl; }); + return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 157 /* Parameter */ && n.parent === constructorDecl; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 196 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 197 /* CallExpression */ && node.parent.expression === node; var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 202 /* ArrowFunction */) { + while (container && container.kind === 203 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -53861,14 +54123,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 154 /* ComputedPropertyName */; }); - if (current && current.kind === 154 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 155 /* ComputedPropertyName */; }); + if (current && current.kind === 155 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 193 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 194 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -53876,7 +54138,7 @@ var ts; } return errorType; } - if (!isCallExpression && container.kind === 162 /* Constructor */) { + if (!isCallExpression && container.kind === 163 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasModifier(container, 32 /* Static */) || isCallExpression) { @@ -53945,7 +54207,7 @@ var ts; // as a call expression cannot be used as the target of a destructuring assignment while a property access can. // // For element access expressions (`super[x]`), we emit a generic helper that forwards the element access in both situations. - if (container.kind === 161 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { + if (container.kind === 162 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -53959,7 +54221,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 193 /* ObjectLiteralExpression */) { + if (container.parent.kind === 194 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return errorType; @@ -53980,7 +54242,7 @@ var ts; if (!baseClassType) { return errorType; } - if (container.kind === 162 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 163 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return errorType; @@ -53995,7 +54257,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 162 /* Constructor */; + return container.kind === 163 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -54003,21 +54265,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 193 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 194 /* ObjectLiteralExpression */) { if (ts.hasModifier(container, 32 /* Static */)) { - return container.kind === 161 /* MethodDeclaration */ || - container.kind === 160 /* MethodSignature */ || - container.kind === 163 /* GetAccessor */ || - container.kind === 164 /* SetAccessor */; + return container.kind === 162 /* MethodDeclaration */ || + container.kind === 161 /* MethodSignature */ || + container.kind === 164 /* GetAccessor */ || + container.kind === 165 /* SetAccessor */; } else { - return container.kind === 161 /* MethodDeclaration */ || - container.kind === 160 /* MethodSignature */ || - container.kind === 163 /* GetAccessor */ || - container.kind === 164 /* SetAccessor */ || - container.kind === 159 /* PropertyDeclaration */ || - container.kind === 158 /* PropertySignature */ || - container.kind === 162 /* Constructor */; + return container.kind === 162 /* MethodDeclaration */ || + container.kind === 161 /* MethodSignature */ || + container.kind === 164 /* GetAccessor */ || + container.kind === 165 /* SetAccessor */ || + container.kind === 160 /* PropertyDeclaration */ || + container.kind === 159 /* PropertySignature */ || + container.kind === 163 /* Constructor */; } } } @@ -54025,10 +54287,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 161 /* MethodDeclaration */ || - func.kind === 163 /* GetAccessor */ || - func.kind === 164 /* SetAccessor */) && func.parent.kind === 193 /* ObjectLiteralExpression */ ? func.parent : - func.kind === 201 /* FunctionExpression */ && func.parent.kind === 281 /* PropertyAssignment */ ? func.parent.parent : + return (func.kind === 162 /* MethodDeclaration */ || + func.kind === 164 /* GetAccessor */ || + func.kind === 165 /* SetAccessor */) && func.parent.kind === 194 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 202 /* FunctionExpression */ && func.parent.kind === 282 /* PropertyAssignment */ ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -54040,7 +54302,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 202 /* ArrowFunction */) { + if (func.kind === 203 /* ArrowFunction */) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -54067,7 +54329,7 @@ var ts; if (thisType) { return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); } - if (literal.parent.kind !== 281 /* PropertyAssignment */) { + if (literal.parent.kind !== 282 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -54081,7 +54343,7 @@ var ts; // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. var parent = ts.walkUpParenthesizedExpressions(func.parent); - if (parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { + if (parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { var target = parent.left; if (ts.isAccessExpression(target)) { var expression = target.expression; @@ -54134,9 +54396,9 @@ var ts; return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 156 /* Parameter */: + case 157 /* Parameter */: return getContextuallyTypedParameterType(declaration); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return getContextualTypeForBindingElement(declaration); // By default, do nothing and return undefined - only parameters and binding elements have context implied by a parent } @@ -54145,7 +54407,7 @@ var ts; var parent = declaration.parent.parent; var name = declaration.propertyName || declaration.name; var parentType = getContextualTypeForVariableLikeDeclaration(parent) || - parent.kind !== 191 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); + parent.kind !== 192 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); if (parentType && !ts.isBindingPattern(name) && !isComputedNonLiteralName(name)) { var nameType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(nameType)) { @@ -54186,6 +54448,9 @@ var ts; if (contextualReturnType) { if (functionFlags & 2 /* Async */) { // Async function var contextualAwaitedType = getAwaitedTypeOfPromise(contextualReturnType); + if (contextualAwaitedType && contextualAwaitedType.flags & 134217728 /* Awaited */) { + contextualAwaitedType = contextualAwaitedType.awaitedType; + } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return contextualReturnType; // Regular function @@ -54197,6 +54462,9 @@ var ts; var contextualType = getContextualType(node); if (contextualType) { var contextualAwaitedType = getAwaitedType(contextualType); + if (contextualAwaitedType && contextualAwaitedType.flags & 134217728 /* Awaited */) { + contextualAwaitedType = contextualAwaitedType.awaitedType; + } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return undefined; @@ -54267,7 +54535,7 @@ var ts; return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 198 /* TaggedTemplateExpression */) { + if (template.parent.kind === 199 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -54503,21 +54771,21 @@ var ts; case 91 /* FalseKeyword */: case 100 /* NullKeyword */: case 75 /* Identifier */: - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: return true; - case 194 /* PropertyAccessExpression */: - case 200 /* ParenthesizedExpression */: + case 195 /* PropertyAccessExpression */: + case 201 /* ParenthesizedExpression */: return isPossiblyDiscriminantValue(node.expression); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return !node.expression || isPossiblyDiscriminantValue(node.expression); } return false; } function discriminateContextualTypeByObjectMembers(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 281 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 282 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } function discriminateContextualTypeByJSXAttributes(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 273 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 274 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. @@ -54542,7 +54810,7 @@ var ts; // If the given contextual type contains instantiable types and if a mapper representing // return type inferences is available, instantiate those types using that mapper. function instantiateContextualType(contextualType, node, contextFlags) { - if (contextualType && maybeTypeOfKind(contextualType, 63176704 /* Instantiable */)) { + if (contextualType && maybeTypeOfKind(contextualType, 197394432 /* Instantiable */)) { var inferenceContext = getInferenceContext(node); // If no inferences have been made, nothing is gained from instantiating as type parameters // would just be replaced with their defaults similar to the apparent type. @@ -54565,7 +54833,7 @@ var ts; // are classified as instantiable (i.e. it doesn't instantiate object types), and (b) it performs // no reductions on instantiated union types. function instantiateInstantiableTypes(type, mapper) { - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { return instantiateType(type, mapper); } if (type.flags & 1048576 /* Union */) { @@ -54603,58 +54871,58 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 191 /* BindingElement */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 192 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 202 /* ArrowFunction */: - case 235 /* ReturnStatement */: + case 203 /* ArrowFunction */: + case 236 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return getContextualTypeForAwaitOperand(parent); - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (parent.expression.kind === 96 /* ImportKeyword */) { return stringType; } /* falls through */ - case 197 /* NewExpression */: + case 198 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: return ts.isConstTypeReference(parent.type) ? undefined : getTypeFromTypeNode(parent.type); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node, contextFlags); - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent, contextFlags); - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: return getApparentTypeOfContextualType(parent.parent, contextFlags); - case 192 /* ArrayLiteralExpression */: { + case 193 /* ArrayLiteralExpression */: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); - case 221 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 211 /* TemplateExpression */); + case 222 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 212 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 200 /* ParenthesizedExpression */: { + case 201 /* ParenthesizedExpression */: { // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast. var tag = ts.isInJSFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent, contextFlags); } - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return getContextualTypeForJsxExpression(parent); - case 273 /* JsxAttribute */: - case 275 /* JsxSpreadAttribute */: + case 274 /* JsxAttribute */: + case 276 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: return getContextualJsxElementAttributesType(parent, contextFlags); } return undefined; @@ -54811,7 +55079,7 @@ var ts; return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 201 /* FunctionExpression */ || node.kind === 202 /* ArrowFunction */; + return node.kind === 202 /* FunctionExpression */ || node.kind === 203 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -54825,7 +55093,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; @@ -54870,8 +55138,8 @@ var ts; return checkIteratedTypeOrElementType(33 /* Spread */, arrayOrIterableType, undefinedType, node.expression); } function hasDefaultValue(node) { - return (node.kind === 191 /* BindingElement */ && !!node.initializer) || - (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); + return (node.kind === 192 /* BindingElement */ && !!node.initializer) || + (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); } function checkArrayLiteral(node, checkMode, forceTuple) { var elements = node.elements; @@ -54884,7 +55152,7 @@ var ts; var inConstContext = isConstContext(node); for (var i = 0; i < elementCount; i++) { var e = elements[i]; - var spread = e.kind === 213 /* SpreadElement */ && e.expression; + var spread = e.kind === 214 /* SpreadElement */ && e.expression; var spreadType = spread && checkExpression(spread, checkMode, forceTuple); if (spreadType && isTupleType(spreadType)) { elementTypes.push.apply(elementTypes, getTypeArguments(spreadType)); @@ -54970,7 +55238,7 @@ var ts; } function isNumericName(name) { switch (name.kind) { - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return isNumericComputedName(name); case 75 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -55056,11 +55324,12 @@ var ts; // Grammar checking checkGrammarObjectLiteralExpression(node, inDestructuringPattern); var propertiesTable; + var allPropertiesTable = ts.createSymbolTable(); var propertiesArray = []; var spread = emptyObjectType; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 189 /* ObjectBindingPattern */ || contextualType.pattern.kind === 193 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 190 /* ObjectBindingPattern */ || contextualType.pattern.kind === 194 /* ObjectLiteralExpression */); var inConstContext = isConstContext(node); var checkFlags = inConstContext ? 8 /* Readonly */ : 0; var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node); @@ -55075,13 +55344,13 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = getSymbolOfNode(memberDecl); - var computedNameType = memberDecl.name && memberDecl.name.kind === 154 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? + var computedNameType = memberDecl.name && memberDecl.name.kind === 155 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? checkComputedPropertyName(memberDecl.name) : undefined; - if (memberDecl.kind === 281 /* PropertyAssignment */ || - memberDecl.kind === 282 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 282 /* PropertyAssignment */ || + memberDecl.kind === 283 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { - var type = memberDecl.kind === 281 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : - memberDecl.kind === 282 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : + var type = memberDecl.kind === 282 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : + memberDecl.kind === 283 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode); if (isInJavascript) { var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -55104,8 +55373,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 281 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 282 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 282 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 283 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -55129,8 +55398,9 @@ var ts; prop.type = type; prop.target = member; member = prop; + allPropertiesTable.set(prop.escapedName, prop); } - else if (memberDecl.kind === 283 /* SpreadAssignment */) { + else if (memberDecl.kind === 284 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } @@ -55146,6 +55416,16 @@ var ts; error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); return errorType; } + for (var _i = 0, _a = getPropertiesOfType(type); _i < _a.length; _i++) { + var right = _a[_i]; + var rightType = getTypeOfSymbol(right); + var left = allPropertiesTable.get(right.escapedName); + if (strictNullChecks && + left && + !maybeTypeOfKind(rightType, 98304 /* Nullable */)) { + error(left.valueDeclaration, ts.Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, ts.unescapeLeadingUnderscores(left.escapedName)); + } + } spread = getSpreadType(spread, type, node.symbol, objectFlags, inConstContext); offset = i + 1; continue; @@ -55156,7 +55436,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 163 /* GetAccessor */ || memberDecl.kind === 164 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 164 /* GetAccessor */ || memberDecl.kind === 165 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) { @@ -55181,9 +55461,9 @@ var ts; // type with those properties for which the binding pattern specifies a default value. // If the object literal is spread into another object literal, skip this step and let the top-level object // literal handle it instead. - if (contextualTypeHasPattern && node.parent.kind !== 283 /* SpreadAssignment */) { - for (var _i = 0, _a = getPropertiesOfType(contextualType); _i < _a.length; _i++) { - var prop = _a[_i]; + if (contextualTypeHasPattern && node.parent.kind !== 284 /* SpreadAssignment */) { + for (var _b = 0, _c = getPropertiesOfType(contextualType); _b < _c.length; _b++) { + var prop = _c[_b]; if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) { if (!(prop.flags & 16777216 /* Optional */)) { error(prop.valueDeclaration || prop.bindingElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); @@ -55223,13 +55503,13 @@ var ts; } } function isValidSpreadType(type) { - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { var constraint = getBaseConstraintOfType(type); if (constraint !== undefined) { return isValidSpreadType(constraint); } } - return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */) || + return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 193200128 /* InstantiableNonPrimitive */) || getFalsyFlags(type) & 117632 /* DefinitelyFalsy */ && isValidSpreadType(removeDefinitelyFalsyTypes(type)) || type.flags & 3145728 /* UnionOrIntersection */ && ts.every(type.types, isValidSpreadType)); } @@ -55323,7 +55603,7 @@ var ts; } } else { - ts.Debug.assert(attributeDecl.kind === 275 /* JsxSpreadAttribute */); + ts.Debug.assert(attributeDecl.kind === 276 /* JsxSpreadAttribute */); if (attributesTable.size > 0) { spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, /*readonly*/ false); attributesTable = ts.createSymbolTable(); @@ -55346,7 +55626,7 @@ var ts; } } // Handle children attribute - var parent = openingLikeElement.parent.kind === 266 /* JsxElement */ ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 267 /* JsxElement */ ? openingLikeElement.parent : undefined; // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); @@ -55766,7 +56046,7 @@ var ts; */ function checkPropertyAccessibility(node, isSuper, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 153 /* QualifiedName */ ? node.right : node.kind === 188 /* ImportType */ ? node : node.name; + var errorNode = node.kind === 154 /* QualifiedName */ ? node.right : node.kind === 189 /* ImportType */ ? node : node.name; if (ts.getCheckFlags(prop) & 1024 /* ContainsPrivate */) { // Synthetic property with private constituent property error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type)); @@ -55925,7 +56205,7 @@ var ts; return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right); } function isMethodAccessForCall(node) { - while (node.parent.kind === 200 /* ParenthesizedExpression */) { + while (node.parent.kind === 201 /* ParenthesizedExpression */) { node = node.parent; } return ts.isCallOrNewExpression(node.parent) && node.parent.expression === node; @@ -56078,7 +56358,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 162 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { + if (flowContainer.kind === 163 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { assumeUninitialized = true; } } @@ -56110,8 +56390,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName); } - else if (valueDeclaration.kind === 245 /* ClassDeclaration */ && - node.parent.kind !== 169 /* TypeReference */ && + else if (valueDeclaration.kind === 246 /* ClassDeclaration */ && + node.parent.kind !== 170 /* TypeReference */ && !(valueDeclaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName); @@ -56123,22 +56403,22 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return true; - case 281 /* PropertyAssignment */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 283 /* SpreadAssignment */: - case 154 /* ComputedPropertyName */: - case 221 /* TemplateSpan */: - case 276 /* JsxExpression */: - case 273 /* JsxAttribute */: - case 274 /* JsxAttributes */: - case 275 /* JsxSpreadAttribute */: - case 268 /* JsxOpeningElement */: - case 216 /* ExpressionWithTypeArguments */: - case 279 /* HeritageClause */: + case 282 /* PropertyAssignment */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 284 /* SpreadAssignment */: + case 155 /* ComputedPropertyName */: + case 222 /* TemplateSpan */: + case 277 /* JsxExpression */: + case 274 /* JsxAttribute */: + case 275 /* JsxAttributes */: + case 276 /* JsxSpreadAttribute */: + case 269 /* JsxOpeningElement */: + case 217 /* ExpressionWithTypeArguments */: + case 280 /* HeritageClause */: return false; default: return ts.isExpressionNode(node) ? false : "quit"; @@ -56288,7 +56568,19 @@ var ts; return ts.getSpellingSuggestion(name, symbols, getCandidateName); function getCandidateName(candidate) { var candidateName = ts.symbolName(candidate); - return !ts.startsWith(candidateName, "\"") && candidate.flags & meaning ? candidateName : undefined; + if (ts.startsWith(candidateName, "\"")) { + return undefined; + } + if (candidate.flags & meaning) { + return candidateName; + } + if (candidate.flags & 2097152 /* Alias */) { + var alias = tryResolveAlias(candidate); + if (alias && alias.flags & meaning) { + return candidateName; + } + } + return undefined; } } function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isThisAccess) { @@ -56301,7 +56593,7 @@ var ts; if (!hasPrivateModifier && !hasPrivateIdentifier) { return; } - if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */))) { + if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */)) { return; } if (isThisAccess) { @@ -56315,16 +56607,16 @@ var ts; } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return isValidPropertyAccessWithType(node, node.expression.kind === 102 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression))); - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getWidenedType(checkExpression(node.left))); - case 188 /* ImportType */: + case 189 /* ImportType */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getTypeFromTypeNode(node)); } } function isValidPropertyAccessForCompletions(node, type, property) { - return isValidPropertyAccessWithType(node, node.kind === 194 /* PropertyAccessExpression */ && node.expression.kind === 102 /* SuperKeyword */, property.escapedName, type); + return isValidPropertyAccessWithType(node, node.kind === 195 /* PropertyAccessExpression */ && node.expression.kind === 102 /* SuperKeyword */, property.escapedName, type); // Previously we validated the 'this' type of methods but this adversely affected performance. See #31377 for more context. } function isValidPropertyAccessWithType(node, isSuper, propertyName, type) { @@ -56347,7 +56639,7 @@ var ts; */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 243 /* VariableDeclarationList */) { + if (initializer.kind === 244 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -56376,7 +56668,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 231 /* ForInStatement */ && + if (node.kind === 232 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -56460,13 +56752,13 @@ var ts; // This gets us diagnostics for the type arguments and marks them as referenced. ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 198 /* TaggedTemplateExpression */) { + if (node.kind === 199 /* TaggedTemplateExpression */) { checkExpression(node.template); } else if (ts.isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); } - else if (node.kind !== 157 /* Decorator */) { + else if (node.kind !== 158 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -56530,7 +56822,7 @@ var ts; } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 213 /* SpreadElement */ || arg.kind === 220 /* SyntheticExpression */ && arg.isSpread); + return !!arg && (arg.kind === 214 /* SpreadElement */ || arg.kind === 221 /* SyntheticExpression */ && arg.isSpread); } function getSpreadArgumentIndex(args) { return ts.findIndex(args, isSpreadArgument); @@ -56544,9 +56836,9 @@ var ts; var callIsIncomplete = false; // In incomplete call we want to be lenient when we have too few arguments var effectiveParameterCount = getParameterCount(signature); var effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 198 /* TaggedTemplateExpression */) { + if (node.kind === 199 /* TaggedTemplateExpression */) { argCount = args.length; - if (node.template.kind === 211 /* TemplateExpression */) { + if (node.template.kind === 212 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. var lastSpan = ts.last(node.template.templateSpans); // we should always have at least one span. @@ -56561,7 +56853,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 157 /* Decorator */) { + else if (node.kind === 158 /* Decorator */) { argCount = getDecoratorArgumentCount(node, signature); } else if (ts.isJsxOpeningLikeElement(node)) { @@ -56576,7 +56868,7 @@ var ts; else { if (!node.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(node.kind === 197 /* NewExpression */); + ts.Debug.assert(node.kind === 198 /* NewExpression */); return getMinArgumentCount(signature) === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; @@ -56669,7 +56961,7 @@ var ts; // example, given a 'function wrap(cb: (x: T) => U): (x: T) => U' and a call expression // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the // return type of 'wrap'. - if (node.kind !== 157 /* Decorator */) { + if (node.kind !== 158 /* Decorator */) { var contextualType = getContextualType(node); if (contextualType) { // We clone the inference context to avoid disturbing a resolution in progress for an @@ -56712,7 +57004,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 215 /* OmittedExpression */) { + if (arg.kind !== 216 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); inferTypes(context.inferences, argType, paramType); @@ -56726,7 +57018,7 @@ var ts; } function getArrayifiedType(type) { return type.flags & 1048576 /* Union */ ? mapType(type, getArrayifiedType) : - type.flags & (1 /* Any */ | 63176704 /* Instantiable */) || isMutableArrayOrTuple(type) ? type : + type.flags & (1 /* Any */ | 197394432 /* Instantiable */) || isMutableArrayOrTuple(type) ? type : isTupleType(type) ? createTupleType(getTypeArguments(type), type.target.minLength, type.target.hasRestElement, /*readonly*/ false, type.target.associatedNames) : createArrayType(getIndexedAccessType(type, numberType)); } @@ -56736,7 +57028,7 @@ var ts; if (isSpreadArgument(arg)) { // We are inferring from a spread expression in the last argument position, i.e. both the parameter // and the argument are ...x forms. - return arg.kind === 220 /* SyntheticExpression */ ? + return arg.kind === 221 /* SyntheticExpression */ ? createArrayType(arg.type) : getArrayifiedType(checkExpressionWithContextualType(arg.expression, restType, context, 0 /* Normal */)); } @@ -56891,7 +57183,7 @@ var ts; return undefined; } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 197 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 198 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -56921,7 +57213,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 215 /* OmittedExpression */) { + if (arg.kind !== 216 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, /*inferenceContext*/ undefined, checkMode); // If one or more arguments are still excluded (as indicated by CheckMode.SkipContextSensitive), @@ -56962,7 +57254,7 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 196 /* CallExpression */) { + if (node.kind === 197 /* CallExpression */) { var callee = ts.skipOuterExpressions(node.expression); if (ts.isAccessExpression(callee)) { return callee.expression; @@ -56970,7 +57262,7 @@ var ts; } } function createSyntheticExpression(parent, type, isSpread) { - var result = ts.createNode(220 /* SyntheticExpression */, parent.pos, parent.end); + var result = ts.createNode(221 /* SyntheticExpression */, parent.pos, parent.end); result.parent = parent; result.type = type; result.isSpread = isSpread || false; @@ -56980,17 +57272,17 @@ var ts; * Returns the effective arguments for an expression that works like a function invocation. */ function getEffectiveCallArguments(node) { - if (node.kind === 198 /* TaggedTemplateExpression */) { + if (node.kind === 199 /* TaggedTemplateExpression */) { var template = node.template; var args_3 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 211 /* TemplateExpression */) { + if (template.kind === 212 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args_3.push(span.expression); }); } return args_3; } - if (node.kind === 157 /* Decorator */) { + if (node.kind === 158 /* Decorator */) { return getEffectiveDecoratorArguments(node); } if (ts.isJsxOpeningLikeElement(node)) { @@ -57020,30 +57312,30 @@ var ts; var parent = node.parent; var expr = node.expression; switch (parent.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class). return [ createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent))) ]; - case 156 /* Parameter */: + case 157 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts). var func = parent.parent; return [ - createSyntheticExpression(expr, parent.parent.kind === 162 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), + createSyntheticExpression(expr, parent.parent.kind === 163 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), createSyntheticExpression(expr, anyType), createSyntheticExpression(expr, numberType) ]; - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts). If we are emitting decorators // for ES3, we will only pass two arguments. - var hasPropDesc = parent.kind !== 159 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; + var hasPropDesc = parent.kind !== 160 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; return [ createSyntheticExpression(expr, getParentTypeOfClassElement(parent)), createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)), @@ -57057,17 +57349,17 @@ var ts; */ function getDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return 1; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return 2; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // For ES3 or decorators with only two parameters we supply only two arguments return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3; - case 156 /* Parameter */: + case 157 /* Parameter */: return 3; default: return ts.Debug.fail(); @@ -57192,8 +57484,8 @@ var ts; return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { - var isTaggedTemplate = node.kind === 198 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 157 /* Decorator */; + var isTaggedTemplate = node.kind === 199 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 158 /* Decorator */; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var reportErrors = !candidatesOutArray; var typeArguments; @@ -57255,7 +57547,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 196 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 197 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -57771,7 +58063,7 @@ var ts; var declaration = signature.declaration; var modifiers = ts.getSelectedModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */); // (1) Public constructors and (2) constructor functions are always accessible. - if (!modifiers || declaration.kind !== 162 /* Constructor */) { + if (!modifiers || declaration.kind !== 163 /* Constructor */) { return true; } var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -57902,16 +58194,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 156 /* Parameter */: + case 157 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return ts.Debug.fail(); @@ -58002,16 +58294,16 @@ var ts; } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 196 /* CallExpression */: + case 197 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray, checkMode); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray, checkMode); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 157 /* Decorator */: + case 158 /* Decorator */: return resolveDecorator(node, candidatesOutArray, checkMode); - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); } throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -58100,7 +58392,7 @@ var ts; return false; } var parent = node.parent; - while (parent && parent.kind === 194 /* PropertyAccessExpression */) { + while (parent && parent.kind === 195 /* PropertyAccessExpression */) { parent = parent.parent; } if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -58125,12 +58417,12 @@ var ts; if (node.expression.kind === 102 /* SuperKeyword */) { return voidType; } - if (node.kind === 197 /* NewExpression */) { + if (node.kind === 198 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 162 /* Constructor */ && - declaration.kind !== 166 /* ConstructSignature */ && - declaration.kind !== 171 /* ConstructorType */ && + declaration.kind !== 163 /* Constructor */ && + declaration.kind !== 167 /* ConstructSignature */ && + declaration.kind !== 172 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any @@ -58150,7 +58442,7 @@ var ts; if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) { return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent)); } - if (node.kind === 196 /* CallExpression */ && node.parent.kind === 226 /* ExpressionStatement */ && + if (node.kind === 197 /* CallExpression */ && node.parent.kind === 227 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { if (!ts.isDottedName(node.expression)) { error(node.expression, ts.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); @@ -58257,9 +58549,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 244 /* FunctionDeclaration */ + ? 245 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 242 /* VariableDeclaration */ + ? 243 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -58287,18 +58579,18 @@ var ts; case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return true; - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isValidConstAssertionArgument(node.expression); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: var op = node.operator; var arg = node.operand; return op === 40 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) || op === 39 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */; - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: var expr = node.expression; if (ts.isIdentifier(expr)) { var symbol = getSymbolAtLocation(expr); @@ -58348,7 +58640,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return errorType; } - else if (container.kind === 162 /* Constructor */) { + else if (container.kind === 163 /* Constructor */) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -58441,7 +58733,7 @@ var ts; } return length; } - function getMinArgumentCount(signature) { + function getMinArgumentCount(signature, strongArityForUntypedJS) { if (signatureHasRestParameter(signature)) { var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); if (isTupleType(restType)) { @@ -58451,6 +58743,9 @@ var ts; } } } + if (!strongArityForUntypedJS && signature.flags & 16 /* IsUntypedSignatureInJSFile */) { + return 0; + } return signature.minArgumentCount; } function hasEffectiveRestParameter(signature) { @@ -58612,7 +58907,7 @@ var ts; var yieldType; var nextType; var fallbackReturnType = voidType; - if (func.body.kind !== 223 /* Block */) { // Async or normal arrow function + if (func.body.kind !== 224 /* Block */) { // Async or normal arrow function returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */); if (isAsync) { // From within an async function you can return either a non-promise value or a promise. Any @@ -58799,10 +59094,9 @@ var ts; return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node)); } function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 204 /* TypeOfExpression */) { + if (node.expression.kind === 205 /* TypeOfExpression */) { var operandType = getTypeOfExpression(node.expression.expression); - // This cast is safe because the switch is possibly exhaustive and does not contain a default case, so there can be no undefined. - var witnesses = getSwitchClauseTypeOfWitnesses(node); + var witnesses = getSwitchClauseTypeOfWitnesses(node, /*retainDefault*/ false); // notEqualFacts states that the type of the switched value is not equal to every type in the switch. var notEqualFacts_1 = getFactsFromTypeofSwitch(0, 0, witnesses, /*hasDefault*/ true); var type_3 = getBaseConstraintOfType(operandType) || operandType; @@ -58859,11 +59153,11 @@ var ts; } function mayReturnNever(func) { switch (func.kind) { - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return true; - case 161 /* MethodDeclaration */: - return func.parent.kind === 193 /* ObjectLiteralExpression */; + case 162 /* MethodDeclaration */: + return func.parent.kind === 194 /* ObjectLiteralExpression */; default: return false; } @@ -58889,7 +59183,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (func.kind === 160 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 223 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 161 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 224 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */; @@ -58922,7 +59216,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); checkNodeDeferred(node); // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode && checkMode & 4 /* SkipContextSensitive */ && isContextSensitive(node)) { @@ -58946,7 +59240,7 @@ var ts; } // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 201 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 202 /* FunctionExpression */) { checkGrammarForGenerator(node); } contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -58999,7 +59293,7 @@ var ts; type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnType = getReturnTypeFromAnnotation(node); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); @@ -59012,7 +59306,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 223 /* Block */) { + if (node.body.kind === 224 /* Block */) { checkSourceElement(node.body); } else { @@ -59102,7 +59396,7 @@ var ts; expr.expression.kind === 104 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var ctor = ts.getContainingFunction(expr); - if (!(ctor && ctor.kind === 162 /* Constructor */)) { + if (!(ctor && ctor.kind === 163 /* Constructor */)) { return true; } if (symbol.valueDeclaration) { @@ -59127,7 +59421,7 @@ var ts; var symbol_2 = getNodeLinks(node).resolvedSymbol; if (symbol_2.flags & 2097152 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol_2); - return !!declaration && declaration.kind === 256 /* NamespaceImport */; + return !!declaration && declaration.kind === 257 /* NamespaceImport */; } } } @@ -59153,7 +59447,7 @@ var ts; error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); return booleanType; } - if (expr.kind === 194 /* PropertyAccessExpression */ && ts.isPrivateIdentifier(expr.name)) { + if (expr.kind === 195 /* PropertyAccessExpression */ && ts.isPrivateIdentifier(expr.name)) { error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier); } var links = getNodeLinks(expr); @@ -59203,7 +59497,7 @@ var ts; var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos); var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); var func = ts.getContainingFunction(node); - if (func && func.kind !== 162 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { + if (func && func.kind !== 163 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); } @@ -59375,7 +59669,7 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 296 /* NumberLike */ | 12288 /* ESSymbolLike */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { + if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 193200128 /* InstantiableNonPrimitive */)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -59395,7 +59689,7 @@ var ts; if (rightIsThis === void 0) { rightIsThis = false; } var properties = node.properties; var property = properties[propertyIndex]; - if (property.kind === 281 /* PropertyAssignment */ || property.kind === 282 /* ShorthandPropertyAssignment */) { + if (property.kind === 282 /* PropertyAssignment */ || property.kind === 283 /* ShorthandPropertyAssignment */) { var name = property.name; var exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -59408,9 +59702,9 @@ var ts; } var elementType = getIndexedAccessType(objectLiteralType, exprType, name); var type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 282 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); + return checkDestructuringAssignment(property.kind === 283 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); } - else if (property.kind === 283 /* SpreadAssignment */) { + else if (property.kind === 284 /* SpreadAssignment */) { if (propertyIndex < properties.length - 1) { error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } @@ -59453,8 +59747,8 @@ var ts; function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 215 /* OmittedExpression */) { - if (element.kind !== 213 /* SpreadElement */) { + if (element.kind !== 216 /* OmittedExpression */) { + if (element.kind !== 214 /* SpreadElement */) { var indexType = getLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { // We create a synthetic expression so that getIndexedAccessType doesn't get confused @@ -59472,7 +59766,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 209 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { + if (restExpression.kind === 210 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -59488,7 +59782,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { var target; - if (exprOrAssignment.kind === 282 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 283 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -59504,24 +59798,24 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 209 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { + if (target.kind === 210 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 193 /* ObjectLiteralExpression */) { + if (target.kind === 194 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 192 /* ArrayLiteralExpression */) { + if (target.kind === 193 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 283 /* SpreadAssignment */ ? + var error = target.parent.kind === 284 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; - var optionalError = target.parent.kind === 283 /* SpreadAssignment */ ? + var optionalError = target.parent.kind === 284 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; if (checkReferenceExpression(target, error, optionalError)) { @@ -59546,36 +59840,36 @@ var ts; case 75 /* Identifier */: case 10 /* StringLiteral */: case 13 /* RegularExpressionLiteral */: - case 198 /* TaggedTemplateExpression */: - case 211 /* TemplateExpression */: + case 199 /* TaggedTemplateExpression */: + case 212 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: case 100 /* NullKeyword */: - case 146 /* UndefinedKeyword */: - case 201 /* FunctionExpression */: - case 214 /* ClassExpression */: - case 202 /* ArrowFunction */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: - case 204 /* TypeOfExpression */: - case 218 /* NonNullExpression */: - case 267 /* JsxSelfClosingElement */: - case 266 /* JsxElement */: + case 147 /* UndefinedKeyword */: + case 202 /* FunctionExpression */: + case 215 /* ClassExpression */: + case 203 /* ArrowFunction */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 205 /* TypeOfExpression */: + case 219 /* NonNullExpression */: + case 268 /* JsxSelfClosingElement */: + case 267 /* JsxElement */: return true; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -59587,9 +59881,9 @@ var ts; } return false; // Some forms listed here for clarity - case 205 /* VoidExpression */: // Explicit opt-out - case 199 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 217 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 206 /* VoidExpression */: // Explicit opt-out + case 200 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 218 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -59621,7 +59915,7 @@ var ts; } checkGrammarNullishCoalesceWithLogicalExpression(node); var operator = node.operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (node.left.kind === 193 /* ObjectLiteralExpression */ || node.left.kind === 192 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (node.left.kind === 194 /* ObjectLiteralExpression */ || node.left.kind === 193 /* ArrayLiteralExpression */)) { finishInvocation(checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 104 /* ThisKeyword */)); break; } @@ -59688,7 +59982,7 @@ var ts; // expression-wide checks and does not use a work stack to fold nested binary expressions into the same callstack frame function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (left.kind === 193 /* ObjectLiteralExpression */ || left.kind === 192 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (left.kind === 194 /* ObjectLiteralExpression */ || left.kind === 193 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 104 /* ThisKeyword */); } var leftType; @@ -60093,7 +60387,7 @@ var ts; return stringType; } function getContextNode(node) { - if (node.kind === 274 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { + if (node.kind === 275 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes) } return node; @@ -60142,13 +60436,13 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 199 /* TypeAssertionExpression */ || node.kind === 217 /* AsExpression */; + return node.kind === 200 /* TypeAssertionExpression */ || node.kind === 218 /* AsExpression */; } function checkDeclarationInitializer(declaration, contextualType) { var initializer = ts.getEffectiveInitializer(declaration); var type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, 0 /* Normal */) : checkExpressionCached(initializer)); - return ts.isParameter(declaration) && declaration.name.kind === 190 /* ArrayBindingPattern */ && + return ts.isParameter(declaration) && declaration.name.kind === 191 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type; } @@ -60158,7 +60452,7 @@ var ts; var elementTypes = arity ? getTypeArguments(type).slice() : []; for (var i = arity; i < patternElements.length; i++) { var e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === 191 /* BindingElement */ && e.dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === 192 /* BindingElement */ && e.dotDotDotToken)) { elementTypes.push(!ts.isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, /*includePatternInType*/ false, /*reportErrors*/ false) : anyType); if (!ts.isOmittedExpression(e) && !hasDefaultValue(e)) { reportImplicitAny(e, anyType); @@ -60187,7 +60481,7 @@ var ts; var types = contextualType.types; return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); }); } - if (contextualType.flags & 58982400 /* InstantiableNonPrimitive */) { + if (contextualType.flags & 193200128 /* InstantiableNonPrimitive */) { // If the contextual type is a type variable constrained to a primitive type, consider // this a literal context for literals of that primitive type. For example, given a // type parameter 'T extends string', infer string literal types for T. @@ -60224,7 +60518,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); @@ -60235,7 +60529,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -60469,11 +60763,11 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 195 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 75 /* Identifier */ || node.kind === 153 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || - (node.parent.kind === 172 /* TypeQuery */ && node.parent.exprName === node)) || - (node.parent.kind === 263 /* ExportSpecifier */); // We allow reexporting const enums + var ok = (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 196 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 75 /* Identifier */ || node.kind === 154 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 173 /* TypeQuery */ && node.parent.exprName === node)) || + (node.parent.kind === 264 /* ExportSpecifier */); // We allow reexporting const enums if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } @@ -60498,9 +60792,9 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 214 /* ClassExpression */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 215 /* ClassExpression */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -60526,78 +60820,78 @@ var ts; return trueType; case 91 /* FalseKeyword */: return falseType; - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: return checkTemplateExpression(node); case 13 /* RegularExpressionLiteral */: return globalRegExpType; - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode, forceTuple); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return checkQualifiedName(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (node.expression.kind === 96 /* ImportKeyword */) { return checkImportCallExpression(node); } // falls through - case 197 /* NewExpression */: + case 198 /* NewExpression */: return checkCallExpression(node, checkMode); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return checkClassExpression(node); - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: return checkAssertion(node); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: return checkNonNullAssertion(node); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return checkMetaProperty(node); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return checkDeleteExpression(node); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return checkVoidExpression(node); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return checkAwaitExpression(node); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 215 /* OmittedExpression */: + case 216 /* OmittedExpression */: return undefinedWideningType; - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return checkYieldExpression(node); - case 220 /* SyntheticExpression */: + case 221 /* SyntheticExpression */: return node.type; - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 266 /* JsxElement */: + case 267 /* JsxElement */: return checkJsxElement(node, checkMode); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node, checkMode); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return checkJsxFragment(node); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 268 /* JsxOpeningElement */: + case 269 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -60634,7 +60928,7 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { - if (!(func.kind === 162 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 163 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -60645,12 +60939,15 @@ var ts; if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 162 /* Constructor */ || func.kind === 166 /* ConstructSignature */ || func.kind === 171 /* ConstructorType */) { + if (func.kind === 163 /* Constructor */ || func.kind === 167 /* ConstructSignature */ || func.kind === 172 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 202 /* ArrowFunction */) { + if (func.kind === 203 /* ArrowFunction */) { error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } + if (func.kind === 164 /* GetAccessor */ || func.kind === 165 /* SetAccessor */) { + error(node, ts.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); + } } // Only check rest parameter type if it's not a binding pattern. Since binding patterns are // not allowed in a rest parameter, we already have an error from checkGrammarParameterList. @@ -60706,13 +61003,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 202 /* ArrowFunction */: - case 165 /* CallSignature */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 170 /* FunctionType */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 203 /* ArrowFunction */: + case 166 /* CallSignature */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 171 /* FunctionType */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: var parent = node.parent; if (node === parent.type) { return parent; @@ -60730,7 +61027,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 190 /* ArrayBindingPattern */ || name.kind === 189 /* ObjectBindingPattern */) { + else if (name.kind === 191 /* ArrayBindingPattern */ || name.kind === 190 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -60739,13 +61036,13 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 167 /* IndexSignature */) { + if (node.kind === 168 /* IndexSignature */) { checkGrammarIndexSignature(node); } // TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled - else if (node.kind === 170 /* FunctionType */ || node.kind === 244 /* FunctionDeclaration */ || node.kind === 171 /* ConstructorType */ || - node.kind === 165 /* CallSignature */ || node.kind === 162 /* Constructor */ || - node.kind === 166 /* ConstructSignature */) { + else if (node.kind === 171 /* FunctionType */ || node.kind === 245 /* FunctionDeclaration */ || node.kind === 172 /* ConstructorType */ || + node.kind === 166 /* CallSignature */ || node.kind === 163 /* Constructor */ || + node.kind === 167 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -60775,10 +61072,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 165 /* CallSignature */: + case 166 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -60808,7 +61105,7 @@ var ts; checkAsyncFunctionReturnType(node, returnTypeNode); } } - if (node.kind !== 167 /* IndexSignature */ && node.kind !== 300 /* JSDocFunctionType */) { + if (node.kind !== 168 /* IndexSignature */ && node.kind !== 301 /* JSDocFunctionType */) { registerForUnusedIdentifiersCheck(node); } } @@ -60820,7 +61117,7 @@ var ts; var privateIdentifiers = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 162 /* Constructor */) { + if (member.kind === 163 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param, member) && !ts.isBindingPattern(param.name)) { @@ -60840,16 +61137,16 @@ var ts; var memberName = name && ts.getPropertyNameForPropertyNameNode(name); if (memberName) { switch (member.kind) { - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: addName(names, name, memberName, 1 /* GetAccessor */); break; - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: addName(names, name, memberName, 2 /* SetAccessor */); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: addName(names, name, memberName, 3 /* GetOrSetAccessor */); break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: addName(names, name, memberName, 8 /* Method */); break; } @@ -60912,7 +61209,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 158 /* PropertySignature */) { + if (member.kind === 159 /* PropertySignature */) { var memberName = void 0; var name = member.name; switch (name.kind) { @@ -60937,7 +61234,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 246 /* InterfaceDeclaration */) { + if (node.kind === 247 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -60957,7 +61254,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 143 /* StringKeyword */: + case 144 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -60965,7 +61262,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 140 /* NumberKeyword */: + case 141 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -61007,7 +61304,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 161 /* MethodDeclaration */ && node.body) { + if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 162 /* MethodDeclaration */ && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -61035,7 +61332,7 @@ var ts; if (ts.isPrivateIdentifierPropertyDeclaration(n)) { return true; } - return n.kind === 159 /* PropertyDeclaration */ && + return n.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(n, 32 /* Static */) && !!n.initializer; } @@ -61065,7 +61362,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_3 = statements; _i < statements_3.length; _i++) { var statement = statements_3[_i]; - if (statement.kind === 226 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 227 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -61090,7 +61387,7 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 163 /* GetAccessor */) { + if (node.kind === 164 /* GetAccessor */) { if (!(node.flags & 8388608 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 256 /* HasImplicitReturn */)) { if (!(node.flags & 512 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -61100,7 +61397,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (ts.isPrivateIdentifier(node.name)) { @@ -61109,7 +61406,7 @@ var ts; if (!hasNonBindableDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; + var otherKind = node.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getModifierFlags(node); @@ -61127,7 +61424,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 163 /* GetAccessor */) { + if (node.kind === 164 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -61175,7 +61472,7 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 169 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 170 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } ts.forEach(node.typeArguments, checkSourceElement); @@ -61220,7 +61517,7 @@ var ts; var seenOptionalElement = false; for (var i = 0; i < elementTypes.length; i++) { var e = elementTypes[i]; - if (e.kind === 177 /* RestType */) { + if (e.kind === 178 /* RestType */) { if (i !== elementTypes.length - 1) { grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); break; @@ -61229,7 +61526,7 @@ var ts; error(e, ts.Diagnostics.A_rest_element_type_must_be_an_array_type); } } - else if (e.kind === 176 /* OptionalType */) { + else if (e.kind === 177 /* OptionalType */) { seenOptionalElement = true; } else if (seenOptionalElement) { @@ -61250,7 +61547,7 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType, /*stringsOnly*/ false))) { - if (accessNode.kind === 195 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && + if (accessNode.kind === 196 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } @@ -61301,7 +61598,7 @@ var ts; ts.forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 180 /* ConditionalType */ && n.parent.extendsType === n; })) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 181 /* ConditionalType */ && n.parent.extendsType === n; })) { grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); @@ -61318,9 +61615,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 246 /* InterfaceDeclaration */ && - n.parent.kind !== 245 /* ClassDeclaration */ && - n.parent.kind !== 214 /* ClassExpression */ && + if (n.parent.kind !== 247 /* InterfaceDeclaration */ && + n.parent.kind !== 246 /* ClassDeclaration */ && + n.parent.kind !== 215 /* ClassExpression */ && n.flags & 8388608 /* Ambient */) { if (!(flags & 2 /* Ambient */) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) { // It is nested in an ambient context, which means it is automatically exported @@ -61416,7 +61713,7 @@ var ts; // Both are literal property names that are the same. ts.isPropertyNameLiteral(node.name) && ts.isPropertyNameLiteral(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 161 /* MethodDeclaration */ || node.kind === 160 /* MethodSignature */) && + var reportError = (node.kind === 162 /* MethodDeclaration */ || node.kind === 161 /* MethodSignature */) && ts.hasModifier(node, 32 /* Static */) !== ts.hasModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -61456,7 +61753,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 8388608 /* Ambient */; - var inAmbientContextOrInterface = node.parent.kind === 246 /* InterfaceDeclaration */ || node.parent.kind === 173 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 247 /* InterfaceDeclaration */ || node.parent.kind === 174 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -61467,10 +61764,10 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if ((node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */) && !inAmbientContext) { + if ((node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */) && !inAmbientContext) { hasNonAmbientClass = true; } - if (node.kind === 244 /* FunctionDeclaration */ || node.kind === 161 /* MethodDeclaration */ || node.kind === 160 /* MethodSignature */ || node.kind === 162 /* Constructor */) { + if (node.kind === 245 /* FunctionDeclaration */ || node.kind === 162 /* MethodDeclaration */ || node.kind === 161 /* MethodSignature */ || node.kind === 163 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -61601,25 +61898,25 @@ var ts; function getDeclarationSpaces(decl) { var d = decl; switch (d.kind) { - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: // A jsdoc typedef and callback are, by definition, type aliases. // falls through - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: return 2 /* ExportType */; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: return 2 /* ExportType */ | 1 /* ExportValue */; - case 290 /* SourceFile */: + case 291 /* SourceFile */: return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: // Export assigned entity name expressions act as aliases and should fall through, otherwise they export values if (!ts.isEntityNameExpression(d.expression)) { return 1 /* ExportValue */; @@ -61627,17 +61924,17 @@ var ts; d = d.expression; // The below options all declare an Alias, which is allowed to merge with other values within the importing module. // falls through - case 253 /* ImportEqualsDeclaration */: - case 256 /* NamespaceImport */: - case 255 /* ImportClause */: + case 254 /* ImportEqualsDeclaration */: + case 257 /* NamespaceImport */: + case 256 /* ImportClause */: var result_8 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_8 |= getDeclarationSpaces(d); }); return result_8; - case 242 /* VariableDeclaration */: - case 191 /* BindingElement */: - case 244 /* FunctionDeclaration */: - case 258 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 + case 243 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 245 /* FunctionDeclaration */: + case 259 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 case 75 /* Identifier */: // https://github.com/microsoft/TypeScript/issues/36098 // Identifiers are used as declarations of assignment declarations whose parents may be // SyntaxKind.CallExpression - `Object.defineProperty(thing, "aField", {value: 42});` @@ -61660,9 +61957,9 @@ var ts; * @param type The type of the promise. * @remarks The "promised type" of a type is the type of the "value" parameter of the "onfulfilled" callback. */ - function getPromisedTypeOfPromise(promise, errorNode) { + function getPromisedTypeOfPromise(type, errorNode) { // - // { // promise + // { // type // then( // thenFunction // onfulfilled: ( // onfulfilledParameterType // value: T // valueParameterType @@ -61670,17 +61967,18 @@ var ts; // ): any; // } // - if (isTypeAny(promise)) { + if (isTypeAny(type)) { return undefined; } - var typeAsPromise = promise; + var typeAsPromise = type; if (typeAsPromise.promisedTypeOfPromise) { return typeAsPromise.promisedTypeOfPromise; } - if (isReferenceToType(promise, getGlobalPromiseType(/*reportErrors*/ false))) { - return typeAsPromise.promisedTypeOfPromise = getTypeArguments(promise)[0]; + if (isReferenceToType(type, getGlobalPromiseType(/*reportErrors*/ false)) || + isReferenceToType(type, getGlobalPromiseLikeType(/*reportErrors*/ false))) { + return typeAsPromise.promisedTypeOfPromise = getAwaitedType(getTypeArguments(type)[0], errorNode); } - var thenFunction = getTypeOfPropertyOfType(promise, "then"); // TODO: GH#18217 + var thenFunction = getTypeOfPropertyOfType(type, "then"); // TODO: GH#18217 if (isTypeAny(thenFunction)) { return undefined; } @@ -61715,28 +62013,127 @@ var ts; var awaitedType = getAwaitedType(type, errorNode, diagnosticMessage, arg0); return awaitedType || errorType; } + /** + * Gets or creates an `awaited T` type for a generic type. + * + * The "awaited type" of a generic type cannot be determined until it is instantiated. As + * a result, an `AwaitedType` for the generic type is created that can be instantiated + * or related later. + */ + function getAwaitedTypeForGenericType(type) { + var typeId = "" + type.id; + var awaitedType = awaitedTypes.get(typeId); + if (!awaitedType) { + awaitedType = createType(134217728 /* Awaited */); + awaitedType.awaitedType = type; + awaitedTypes.set(typeId, awaitedType); + } + return awaitedType; + } + function unwrapAwaitedType(type) { + return type.flags & 1048576 /* Union */ ? + mapType(type, unwrapAwaitedType) : + type.flags & 134217728 /* Awaited */ ? type.awaitedType : type; + } + /** + * Determines whether a type has a callable `then` member. + */ + function isThenableType(type) { + var thenFunction = getTypeOfPropertyOfType(type, "then"); + return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, 2097152 /* NEUndefinedOrNull */), 0 /* Call */).length > 0; + } + /** + * Determines whether a type is a generic type whose base constraint could possibly resolve to a different + * type when awaited. A type is a generic "thenable" type when all of the following conditions are met: + * - The type is a generic object type, + * - AND one of the following conditions are met + * - The type has no base constraint, + * - OR The base constraint of the type is `any`, `unknown`, `object`, or the empty object `{}`, + * - OR The base constraint has a callable `then` member. + */ + function isGenericAwaitableType(type) { + if (isGenericObjectType(type)) { + if (type.flags & 2097152 /* Intersection */) { + return ts.some(type.types, isGenericAwaitableType); + } + var baseConstraint = getBaseConstraintOfType(type); + return !baseConstraint || + !!(baseConstraint.flags & (3 /* AnyOrUnknown */ | 67108864 /* NonPrimitive */)) || + baseConstraint === emptyObjectType || + baseConstraint === emptyGenericType || + isThenableType(baseConstraint); + } + return false; + } + /** + * Gets the "awaited type" of a type. + * + * The "awaited type" of an expression is its "promised type" if the expression is a + * Promise-like type; otherwise, it is the type of the expression. If the "promised + * type" is itself a Promise-like, the "promised type" is recursively unwrapped until a + * non-promise type is found. + * + * This is used to reflect the runtime behavior of the `await` keyword and the `awaited T` + * type. + */ function getAwaitedType(type, errorNode, diagnosticMessage, arg0) { + if (isTypeAny(type)) { + return type; + } + // If the type is already an awaited type, return it. + // + // For example: + // + // awaited T -> awaited T + // + if (type.flags & 134217728 /* Awaited */) { + return type; + } var typeAsAwaitable = type; if (typeAsAwaitable.awaitedTypeOfType) { return typeAsAwaitable.awaitedTypeOfType; } - if (isTypeAny(type)) { - return typeAsAwaitable.awaitedTypeOfType = type; + // For a union, get a union of the awaited types of each constituent. + // + // For example: + // + // awaited (number | string) -> number | string + // awaited (number | Promise) -> number | string + // awaited (T | string) -> awaited T | string + // awaited (T | Promise) -> awaited T | string + // awaited (T | Promise) -> awaited T + // awaited (T | U) -> awaited T | awaited U + // + return typeAsAwaitable.awaitedTypeOfType = + mapType(type, errorNode ? function (constituentType) { return getAwaitedTypeWorker(constituentType, errorNode, diagnosticMessage, arg0); } : getAwaitedTypeWorker); + } + function getAwaitedTypeWorker(type, errorNode, diagnosticMessage, arg0) { + // If the type is already an awaited type, return it. + // + // For example: + // + // awaited T -> awaited T + // + if (type.flags & 134217728 /* Awaited */) { + return type; } - if (type.flags & 1048576 /* Union */) { - var types = void 0; - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var constituentType = _a[_i]; - types = ts.append(types, getAwaitedType(constituentType, errorNode, diagnosticMessage, arg0)); - } - if (!types) { - return undefined; - } - return typeAsAwaitable.awaitedTypeOfType = getUnionType(types); + // We cannot resolve the awaited type for a type variable until it is instantiated. As + // such, we create an `awaited T` type that can either be instantiated or related later. + // + // For example: + // + // T -> awaited T + // + if (isGenericAwaitableType(type)) { + return getAwaitedTypeForGenericType(type); + } + var typeAsAwaitable = type; + if (typeAsAwaitable.awaitedTypeOfType) { + return typeAsAwaitable.awaitedTypeOfType; } var promisedType = getPromisedTypeOfPromise(type); if (promisedType) { - if (type.id === promisedType.id || awaitedTypeStack.indexOf(promisedType.id) >= 0) { + if (type.id === promisedType.id || awaitedTypeStack.lastIndexOf(promisedType.id) >= 0) { // Verify that we don't have a bad actor in the form of a promise whose // promised type is the same as the promise type, or a mutually recursive // promise. If so, we return undefined as we cannot guess the shape. If this @@ -61750,6 +62147,7 @@ var ts; // onfulfilled: (value: BadPromise) => any, // onrejected: (error: any) => any): BadPromise; // } + // // The above interface will pass the PromiseLike check, and return a // promised type of `BadPromise`. Since this is a self reference, we // don't want to keep recursing ad infinitum. @@ -61786,8 +62184,8 @@ var ts; } // The type was not a promise, so it could not be unwrapped any further. // As long as the type does not have a callable "then" property, it is - // safe to return the type; otherwise, an error will be reported in - // the call to getNonThenableType and we will return undefined. + // safe to return the type; otherwise, an error is reported and we return + // undefined. // // An example of a non-promise "thenable" might be: // @@ -61799,8 +62197,7 @@ var ts; // of a runtime problem. If the user wants to return this value from an async // function, they would need to wrap it in some other value. If they want it to // be treated as a promise, they can cast to . - var thenFunction = getTypeOfPropertyOfType(type, "then"); - if (thenFunction && getSignaturesOfType(thenFunction, 0 /* Call */).length > 0) { + if (isThenableType(type)) { if (errorNode) { if (!diagnosticMessage) return ts.Debug.fail(); @@ -61913,24 +62310,24 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 156 /* Parameter */: + case 157 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -61977,14 +62374,14 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 179 /* IntersectionType */: - case 178 /* UnionType */: + case 180 /* IntersectionType */: + case 179 /* UnionType */: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return getEntityNameForDecoratorMetadata(node.type); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return node.typeName; } } @@ -61993,13 +62390,13 @@ var ts; var commonEntityName; for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { var typeNode = types_19[_i]; - while (typeNode.kind === 182 /* ParenthesizedType */) { + while (typeNode.kind === 183 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 137 /* NeverKeyword */) { + if (typeNode.kind === 138 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 146 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 147 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -62045,14 +62442,14 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 156 /* Parameter */) { + if (node.kind === 157 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -62061,23 +62458,23 @@ var ts; } } break; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - var otherKind = node.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + var otherKind = node.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 156 /* Parameter */: + case 157 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -62140,7 +62537,7 @@ var ts; else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && node.typeExpression && node.typeExpression.type && !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 153 /* QualifiedName */ ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 154 /* QualifiedName */ ? node.name.right : node.name)); } } } @@ -62181,7 +62578,7 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return node.name; default: return undefined; @@ -62194,7 +62591,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 155 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -62223,7 +62620,7 @@ var ts; } } } - var body = node.kind === 160 /* MethodSignature */ ? undefined : node.body; + var body = node.kind === 161 /* MethodSignature */ ? undefined : node.body; checkSourceElement(body); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); if (produceDiagnostics && !ts.getEffectiveReturnTypeNode(node)) { @@ -62265,42 +62662,42 @@ var ts; for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) { var node = potentiallyUnusedIdentifiers_1[_i]; switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 290 /* SourceFile */: - case 249 /* ModuleDeclaration */: - case 223 /* Block */: - case 251 /* CaseBlock */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 291 /* SourceFile */: + case 250 /* ModuleDeclaration */: + case 224 /* Block */: + case 252 /* CaseBlock */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 162 /* Constructor */: - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 163 /* Constructor */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; - case 181 /* InferType */: + case 182 /* InferType */: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -62320,11 +62717,11 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 161 /* MethodDeclaration */: - case 159 /* PropertyDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - if (member.kind === 164 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + case 162 /* MethodDeclaration */: + case 160 /* PropertyDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + if (member.kind === 165 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { // Already would have reported an error on the getter. break; } @@ -62335,7 +62732,7 @@ var ts; addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); } break; - case 162 /* Constructor */: + case 163 /* Constructor */: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { @@ -62343,8 +62740,8 @@ var ts; } } break; - case 167 /* IndexSignature */: - case 222 /* SemicolonClassElement */: + case 168 /* IndexSignature */: + case 223 /* SemicolonClassElement */: // Can't be private break; default: @@ -62371,7 +62768,7 @@ var ts; continue; var name = ts.idText(typeParameter.name); var parent = typeParameter.parent; - if (parent.kind !== 181 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { + if (parent.kind !== 182 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { if (seenParentsWithEveryUnused.tryAdd(parent)) { var range = ts.isJSDocTemplateTag(parent) // Whole @template tag @@ -62454,7 +62851,7 @@ var ts; var importDecl = importClause.parent; var nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? - (importClause.namedBindings.kind === 256 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) + (importClause.namedBindings.kind === 257 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) : 0); if (nDeclarations === unuseds.length) { addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 @@ -62472,7 +62869,7 @@ var ts; var bindingPattern = _a[0], bindingElements = _a[1]; var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */; if (bindingPattern.elements.length === bindingElements.length) { - if (bindingElements.length === 1 && bindingPattern.parent.kind === 242 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 243 /* VariableDeclarationList */) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 243 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 244 /* VariableDeclarationList */) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { @@ -62493,7 +62890,7 @@ var ts; if (declarationList.declarations.length === declarations.length) { addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? ts.createDiagnosticForNode(ts.first(declarations).name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(declarations).name)) - : ts.createDiagnosticForNode(declarationList.parent.kind === 225 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); + : ts.createDiagnosticForNode(declarationList.parent.kind === 226 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); } else { for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { @@ -62507,22 +62904,22 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return ts.idText(name); - case 190 /* ArrayBindingPattern */: - case 189 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name); default: return ts.Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 255 /* ImportClause */ || node.kind === 258 /* ImportSpecifier */ || node.kind === 256 /* NamespaceImport */; + return node.kind === 256 /* ImportClause */ || node.kind === 259 /* ImportSpecifier */ || node.kind === 257 /* NamespaceImport */; } function importClauseFromImported(decl) { - return decl.kind === 255 /* ImportClause */ ? decl : decl.kind === 256 /* NamespaceImport */ ? decl.parent : decl.parent.parent; + return decl.kind === 256 /* ImportClause */ ? decl : decl.kind === 257 /* NamespaceImport */ ? decl.parent : decl.parent.parent; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 223 /* Block */) { + if (node.kind === 224 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -62552,12 +62949,12 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 159 /* PropertyDeclaration */ || - node.kind === 158 /* PropertySignature */ || - node.kind === 161 /* MethodDeclaration */ || - node.kind === 160 /* MethodSignature */ || - node.kind === 163 /* GetAccessor */ || - node.kind === 164 /* SetAccessor */) { + if (node.kind === 160 /* PropertyDeclaration */ || + node.kind === 159 /* PropertySignature */ || + node.kind === 162 /* MethodDeclaration */ || + node.kind === 161 /* MethodSignature */ || + node.kind === 164 /* GetAccessor */ || + node.kind === 165 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -62566,7 +62963,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 156 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 157 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -62623,7 +63020,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -62638,7 +63035,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { + if (parent.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -62673,7 +63070,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 242 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 243 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -62685,17 +63082,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 243 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 225 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 244 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 226 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 223 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 250 /* ModuleBlock */ || - container.kind === 249 /* ModuleDeclaration */ || - container.kind === 290 /* SourceFile */); + (container.kind === 224 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 251 /* ModuleBlock */ || + container.kind === 250 /* ModuleDeclaration */ || + container.kind === 291 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -62725,18 +63122,18 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 191 /* BindingElement */) { - if (node.parent.kind === 189 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { + if (node.kind === 192 /* BindingElement */) { + if (node.parent.kind === 190 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 154 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access @@ -62757,19 +63154,19 @@ var ts; } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 190 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 191 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.getRootDeclaration(node).kind === 156 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 157 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { - var needCheckInitializer = node.initializer && node.parent.parent.kind !== 231 /* ForInStatement */; + var needCheckInitializer = node.initializer && node.parent.parent.kind !== 232 /* ForInStatement */; var needCheckWidenedType = node.name.elements.length === 0; if (needCheckInitializer || needCheckWidenedType) { // Don't validate for-in initializer as it is already an error @@ -62806,7 +63203,7 @@ var ts; ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) && ts.hasEntries(symbol.exports); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 231 /* ForInStatement */) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 232 /* ForInStatement */) { checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, /*headMessage*/ undefined); } } @@ -62832,10 +63229,10 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 159 /* PropertyDeclaration */ && node.kind !== 158 /* PropertySignature */) { + if (node.kind !== 160 /* PropertyDeclaration */ && node.kind !== 159 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { + if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -62847,7 +63244,7 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 159 /* PropertyDeclaration */ || nextDeclaration.kind === 158 /* PropertySignature */ + var message = nextDeclaration.kind === 160 /* PropertyDeclaration */ || nextDeclaration.kind === 159 /* PropertySignature */ ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; var declName = ts.declarationNameToString(nextDeclarationName); @@ -62857,8 +63254,8 @@ var ts; } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 156 /* Parameter */ && right.kind === 242 /* VariableDeclaration */) || - (left.kind === 242 /* VariableDeclaration */ && right.kind === 156 /* Parameter */)) { + if ((left.kind === 157 /* Parameter */ && right.kind === 243 /* VariableDeclaration */) || + (left.kind === 243 /* VariableDeclaration */ && right.kind === 157 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -62898,7 +63295,7 @@ var ts; var type = checkTruthinessExpression(node.expression); checkTestingKnownTruthyCallableType(node.expression, node.thenStatement, type); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 224 /* EmptyStatement */) { + if (node.thenStatement.kind === 225 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -62969,12 +63366,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 243 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 244 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 243 /* VariableDeclarationList */) { + if (node.initializer.kind === 244 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -63008,14 +63405,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 243 /* VariableDeclarationList */) { + if (node.initializer.kind === 244 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier); // There may be a destructuring assignment on the left side - if (varExpr.kind === 192 /* ArrayLiteralExpression */ || varExpr.kind === 193 /* ObjectLiteralExpression */) { + if (varExpr.kind === 193 /* ArrayLiteralExpression */ || varExpr.kind === 194 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -63047,7 +63444,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 243 /* VariableDeclarationList */) { + if (node.initializer.kind === 244 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -63061,7 +63458,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 192 /* ArrayLiteralExpression */ || varExpr.kind === 193 /* ObjectLiteralExpression */) { + if (varExpr.kind === 193 /* ArrayLiteralExpression */ || varExpr.kind === 194 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -63074,7 +63471,7 @@ var ts; } // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { + if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 193200128 /* InstantiableNonPrimitive */)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, typeToString(rightType)); } checkSourceElement(node.statement); @@ -63712,7 +64109,7 @@ var ts; var isGenerator = !!(functionFlags & 1 /* Generator */); var isAsync = !!(functionFlags & 2 /* Async */); return isGenerator ? getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, isAsync) || errorType : - isAsync ? getPromisedTypeOfPromise(returnType) || errorType : + isAsync ? unwrapAwaitedType(getAwaitedType(returnType) || errorType) : returnType; } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { @@ -63734,12 +64131,12 @@ var ts; var functionFlags = ts.getFunctionFlags(func); if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 164 /* SetAccessor */) { + if (func.kind === 165 /* SetAccessor */) { if (node.expression) { error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 162 /* Constructor */) { + else if (func.kind === 163 /* Constructor */) { if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -63747,7 +64144,7 @@ var ts; else if (getReturnTypeFromAnnotation(func)) { var unwrappedReturnType = unwrapReturnType(returnType, functionFlags); var unwrappedExprType = functionFlags & 2 /* Async */ - ? checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) + ? unwrapAwaitedType(checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)) : exprType; if (unwrappedReturnType) { // If the function has a return type, but promisedType is @@ -63757,7 +64154,7 @@ var ts; } } } - else if (func.kind !== 162 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 163 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { // The function has a return type, but the return statement doesn't have an expression. error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } @@ -63786,7 +64183,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 278 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 279 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -63795,7 +64192,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 277 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 278 /* CaseClause */) { // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable // to or from the type of the 'switch' expression. @@ -63827,7 +64224,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 238 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 239 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label)); return true; } @@ -63934,8 +64331,8 @@ var ts; // this allows us to rule out cases when both property and indexer are inherited from the base class var errorNode; if (propDeclaration && name && - (propDeclaration.kind === 209 /* BinaryExpression */ || - name.kind === 154 /* ComputedPropertyName */ || + (propDeclaration.kind === 210 /* BinaryExpression */ || + name.kind === 155 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -64012,7 +64409,7 @@ var ts; function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 169 /* TypeReference */) { + if (node.kind === 170 /* TypeReference */) { var type = getTypeFromTypeReference(node); if (type.flags & 262144 /* TypeParameter */) { for (var i = index; i < typeParameters.length; i++) { @@ -64258,7 +64655,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 245 /* ClassDeclaration */ || d.kind === 246 /* InterfaceDeclaration */; + return d.kind === 246 /* ClassDeclaration */ || d.kind === 247 /* InterfaceDeclaration */; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -64313,7 +64710,7 @@ var ts; continue basePropertyCheck; } } - if (derivedClassDecl.kind === 214 /* ClassExpression */) { + if (derivedClassDecl.kind === 215 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -64335,7 +64732,7 @@ var ts; // property/accessor is overridden with property/accessor if (!compilerOptions.useDefineForClassFields || baseDeclarationFlags & 128 /* Abstract */ && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer) - || base.valueDeclaration && base.valueDeclaration.parent.kind === 246 /* InterfaceDeclaration */ + || base.valueDeclaration && base.valueDeclaration.parent.kind === 247 /* InterfaceDeclaration */ || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) { // when the base property is abstract or from an interface, base/derived flags don't need to match // same when the derived property is from an assignment @@ -64350,7 +64747,7 @@ var ts; error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type)); } else { - var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 159 /* PropertyDeclaration */ && !d.initializer; }); + var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 160 /* PropertyDeclaration */ && !d.initializer; }); if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 128 /* Abstract */) @@ -64447,7 +64844,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 159 /* PropertyDeclaration */ && + return node.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(node, 32 /* Static */ | 128 /* Abstract */) && !node.exclamationToken && !node.initializer; @@ -64471,7 +64868,7 @@ var ts; var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 246 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 247 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -64577,7 +64974,7 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: var value_2 = evaluate(expr.operand); if (typeof value_2 === "number") { switch (expr.operator) { @@ -64587,7 +64984,7 @@ var ts; } } break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -64616,7 +65013,7 @@ var ts; case 8 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return evaluate(expr.expression); case 75 /* Identifier */: var identifier = expr; @@ -64624,14 +65021,14 @@ var ts; return +(identifier.escapedText); } return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText); - case 195 /* ElementAccessExpression */: - case 194 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384 /* Enum */) { var name = void 0; - if (ex.kind === 194 /* PropertyAccessExpression */) { + if (ex.kind === 195 /* PropertyAccessExpression */) { name = ex.name.escapedText; } else { @@ -64661,8 +65058,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 75 /* Identifier */ || - node.kind === 194 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || - node.kind === 195 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && + node.kind === 195 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || + node.kind === 196 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && ts.isStringLiteralLike(node.argumentExpression); } function checkEnumDeclaration(node) { @@ -64698,7 +65095,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 248 /* EnumDeclaration */) { + if (declaration.kind !== 249 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -64726,8 +65123,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { var declaration = declarations_8[_i]; - if ((declaration.kind === 245 /* ClassDeclaration */ || - (declaration.kind === 244 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 246 /* ClassDeclaration */ || + (declaration.kind === 245 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 8388608 /* Ambient */)) { return declaration; } @@ -64790,7 +65187,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 245 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 246 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -64840,23 +65237,23 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 259 /* ExportAssignment */: - case 260 /* ExportDeclaration */: + case 260 /* ExportAssignment */: + case 261 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 253 /* ImportEqualsDeclaration */: - case 254 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 191 /* BindingElement */: - case 242 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 243 /* VariableDeclaration */: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -64867,12 +65264,12 @@ var ts; break; } // falls through - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 244 /* FunctionDeclaration */: - case 246 /* InterfaceDeclaration */: - case 249 /* ModuleDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 245 /* FunctionDeclaration */: + case 247 /* InterfaceDeclaration */: + case 250 /* ModuleDeclaration */: + case 248 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -64895,12 +65292,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: do { node = node.left; } while (node.kind !== 75 /* Identifier */); return node; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: do { if (ts.isModuleExportsAccessExpression(node.expression) && !ts.isPrivateIdentifier(node.name)) { return node.name; @@ -64920,9 +65317,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 250 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 290 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 260 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 251 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 291 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 261 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -64957,14 +65354,14 @@ var ts; (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 263 /* ExportSpecifier */ ? + var message = node.kind === 264 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } // Don't allow to re-export something with no value side when `--isolatedModules` is set. if (compilerOptions.isolatedModules - && node.kind === 263 /* ExportSpecifier */ + && node.kind === 264 /* ExportSpecifier */ && !node.parent.parent.isTypeOnly && !(target.flags & 111551 /* Value */) && !(node.flags & 8388608 /* Ambient */)) { @@ -64992,7 +65389,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 256 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 257 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -65016,7 +65413,7 @@ var ts; if (ts.hasModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 265 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 266 /* ExternalModuleReference */) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 111551 /* Value */) { @@ -65061,10 +65458,10 @@ var ts; else if (!ts.isNamespaceExport(node.exportClause)) { checkImportBinding(node.exportClause); } - var inAmbientExternalModule = node.parent.kind === 250 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 250 /* ModuleBlock */ && + var inAmbientExternalModule = node.parent.kind === 251 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 251 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 8388608 /* Ambient */; - if (node.parent.kind !== 290 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 291 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -65082,14 +65479,14 @@ var ts; } function checkGrammarExportDeclaration(node) { var _a; - var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 261 /* NamedExports */; + var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 262 /* NamedExports */; if (isTypeOnlyExportStar) { grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type); } return !isTypeOnlyExportStar; } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 290 /* SourceFile */ || node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 249 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 291 /* SourceFile */ || node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 250 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -65145,8 +65542,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 290 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 249 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 291 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 250 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -65260,165 +65657,165 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 249 /* ModuleDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 244 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 245 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } - if (kind >= 225 /* FirstStatement */ && kind <= 241 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { + if (kind >= 226 /* FirstStatement */ && kind <= 242 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, ts.Diagnostics.Unreachable_code_detected); } switch (kind) { - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return checkTypeParameter(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return checkParameter(node); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return checkPropertyDeclaration(node); - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: return checkPropertySignature(node); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: return checkSignatureDeclaration(node); - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: return checkMethodDeclaration(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return checkConstructorDeclaration(node); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return checkAccessorDeclaration(node); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return checkTypeReferenceNode(node); - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return checkTypePredicate(node); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return checkTypeQuery(node); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return checkTypeLiteral(node); - case 174 /* ArrayType */: + case 175 /* ArrayType */: return checkArrayType(node); - case 175 /* TupleType */: + case 176 /* TupleType */: return checkTupleType(node); - case 178 /* UnionType */: - case 179 /* IntersectionType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 182 /* ParenthesizedType */: - case 176 /* OptionalType */: - case 177 /* RestType */: + case 183 /* ParenthesizedType */: + case 177 /* OptionalType */: + case 178 /* RestType */: return checkSourceElement(node.type); - case 183 /* ThisType */: + case 184 /* ThisType */: return checkThisType(node); - case 184 /* TypeOperator */: + case 185 /* TypeOperator */: return checkTypeOperator(node); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return checkConditionalType(node); - case 181 /* InferType */: + case 182 /* InferType */: return checkInferType(node); - case 188 /* ImportType */: + case 189 /* ImportType */: return checkImportType(node); - case 307 /* JSDocAugmentsTag */: + case 308 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 308 /* JSDocImplementsTag */: + case 309 /* JSDocImplementsTag */: return checkJSDocImplementsTag(node); - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: return checkJSDocTypeAliasTag(node); - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return checkJSDocTemplateTag(node); - case 320 /* JSDocTypeTag */: + case 321 /* JSDocTypeTag */: return checkJSDocTypeTag(node); - case 317 /* JSDocParameterTag */: + case 318 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: checkJSDocFunctionType(node); // falls through - case 298 /* JSDocNonNullableType */: - case 297 /* JSDocNullableType */: - case 295 /* JSDocAllType */: - case 296 /* JSDocUnknownType */: - case 304 /* JSDocTypeLiteral */: + case 299 /* JSDocNonNullableType */: + case 298 /* JSDocNullableType */: + case 296 /* JSDocAllType */: + case 297 /* JSDocUnknownType */: + case 305 /* JSDocTypeLiteral */: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 301 /* JSDocVariadicType */: + case 302 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 294 /* JSDocTypeExpression */: + case 295 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 186 /* MappedType */: + case 187 /* MappedType */: return checkMappedType(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 223 /* Block */: - case 250 /* ModuleBlock */: + case 224 /* Block */: + case 251 /* ModuleBlock */: return checkBlock(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return checkVariableStatement(node); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return checkExpressionStatement(node); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return checkIfStatement(node); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return checkDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return checkWhileStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return checkForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return checkForInStatement(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return checkForOfStatement(node); - case 233 /* ContinueStatement */: - case 234 /* BreakStatement */: + case 234 /* ContinueStatement */: + case 235 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return checkReturnStatement(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return checkWithStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return checkSwitchStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return checkLabeledStatement(node); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return checkThrowStatement(node); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return checkTryStatement(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return checkBindingElement(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return checkClassDeclaration(node); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return checkImportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return checkExportDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return checkExportAssignment(node); - case 224 /* EmptyStatement */: - case 241 /* DebuggerStatement */: + case 225 /* EmptyStatement */: + case 242 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 264 /* MissingDeclaration */: + case 265 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -65513,33 +65910,33 @@ var ts; currentNode = node; instantiationCount = 0; switch (node.kind) { - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 198 /* TaggedTemplateExpression */: - case 157 /* Decorator */: - case 268 /* JsxOpeningElement */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 199 /* TaggedTemplateExpression */: + case 158 /* Decorator */: + case 269 /* JsxOpeningElement */: // These node kinds are deferred checked when overload resolution fails // To save on work, we ensure the arguments are checked just once, in // a deferred way resolveUntypedCall(node); break; - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: checkClassExpressionDeferred(node); break; - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: checkJsxSelfClosingElementDeferred(node); break; - case 266 /* JsxElement */: + case 267 /* JsxElement */: checkJsxElementDeferred(node); break; } @@ -65682,17 +66079,17 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; // falls through - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -65700,8 +66097,8 @@ var ts; // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration. // falls through - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -65710,7 +66107,7 @@ var ts; copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968 /* Type */); } break; - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -65758,16 +66155,16 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 155 /* TypeParameter */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 248 /* EnumDeclaration */: + case 156 /* TypeParameter */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: return true; - case 255 /* ImportClause */: + case 256 /* ImportClause */: return node.isTypeOnly; - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; default: return false; @@ -65775,16 +66172,16 @@ var ts; } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 153 /* QualifiedName */) { + while (node.parent.kind === 154 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 169 /* TypeReference */; + return node.parent.kind === 170 /* TypeReference */; } function isHeritageClauseElementIdentifier(node) { - while (node.parent.kind === 194 /* PropertyAccessExpression */) { + while (node.parent.kind === 195 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent.kind === 216 /* ExpressionWithTypeArguments */; + return node.parent.kind === 217 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -65812,13 +66209,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 153 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 154 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 253 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 254 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } - if (nodeOnRightSide.parent.kind === 259 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 260 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } return undefined; @@ -65844,7 +66241,7 @@ var ts; node = parent; parent = parent.parent; } - if (parent && parent.kind === 188 /* ImportType */ && parent.qualifier === node) { + if (parent && parent.kind === 189 /* ImportType */ && parent.qualifier === node) { return parent; } return undefined; @@ -65854,7 +66251,7 @@ var ts; return getSymbolOfNode(name.parent); } if (ts.isInJSFile(name) && - name.parent.kind === 194 /* PropertyAccessExpression */ && + name.parent.kind === 195 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { // Check if this is a special property assignment if (!ts.isPrivateIdentifier(name)) { @@ -65864,7 +66261,7 @@ var ts; } } } - if (name.parent.kind === 259 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { + if (name.parent.kind === 260 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { // Even an entity name expression that doesn't resolve as an entityname may still typecheck as a property access expression var success = resolveEntityName(name, /*all meanings*/ 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*ignoreErrors*/ true); @@ -65874,7 +66271,7 @@ var ts; } else if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name) && isInRightSideOfImportOrExportAssignment(name)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(name, 253 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(name, 254 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(name, /*dontResolveAlias*/ true); } @@ -65892,7 +66289,7 @@ var ts; if (isHeritageClauseElementIdentifier(name)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (name.parent.kind === 216 /* ExpressionWithTypeArguments */) { + if (name.parent.kind === 217 /* ExpressionWithTypeArguments */) { meaning = 788968 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { @@ -65908,10 +66305,10 @@ var ts; return entityNameSymbol; } } - if (name.parent.kind === 317 /* JSDocParameterTag */) { + if (name.parent.kind === 318 /* JSDocParameterTag */) { return ts.getParameterSymbolFromJSDoc(name.parent); } - if (name.parent.kind === 155 /* TypeParameter */ && name.parent.parent.kind === 321 /* JSDocTemplateTag */) { + if (name.parent.kind === 156 /* TypeParameter */ && name.parent.parent.kind === 322 /* JSDocTemplateTag */) { ts.Debug.assert(!ts.isInJSFile(name)); // Otherwise `isDeclarationName` would have been true. var typeParameter = ts.getTypeParameterFromJsDoc(name.parent); return typeParameter && typeParameter.symbol; @@ -65928,12 +66325,12 @@ var ts; } return resolveEntityName(name, 111551 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (name.kind === 194 /* PropertyAccessExpression */ || name.kind === 153 /* QualifiedName */) { + else if (name.kind === 195 /* PropertyAccessExpression */ || name.kind === 154 /* QualifiedName */) { var links = getNodeLinks(name); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (name.kind === 194 /* PropertyAccessExpression */) { + if (name.kind === 195 /* PropertyAccessExpression */) { checkPropertyAccessExpression(name); } else { @@ -65943,17 +66340,17 @@ var ts; } } else if (isTypeReferenceIdentifier(name)) { - var meaning = name.parent.kind === 169 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; + var meaning = name.parent.kind === 170 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - if (name.parent.kind === 168 /* TypePredicate */) { + if (name.parent.kind === 169 /* TypePredicate */) { return resolveEntityName(name, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node, ignoreErrors) { - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } var parent = node.parent; @@ -65976,8 +66373,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); } - else if (parent.kind === 191 /* BindingElement */ && - grandParent.kind === 189 /* ObjectBindingPattern */ && + else if (parent.kind === 192 /* BindingElement */ && + grandParent.kind === 190 /* ObjectBindingPattern */ && node === parent.propertyName) { var typeOfPattern = getTypeOfNode(grandParent); var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); @@ -65989,8 +66386,8 @@ var ts; switch (node.kind) { case 75 /* Identifier */: case 76 /* PrivateIdentifier */: - case 194 /* PropertyAccessExpression */: - case 153 /* QualifiedName */: + case 195 /* PropertyAccessExpression */: + case 154 /* QualifiedName */: return getSymbolOfNameOrPropertyAccessExpression(node); case 104 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -66004,14 +66401,14 @@ var ts; return checkExpression(node).symbol; } // falls through - case 183 /* ThisType */: + case 184 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 102 /* SuperKeyword */: return checkExpression(node).symbol; - case 129 /* ConstructorKeyword */: + case 130 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 162 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 163 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -66022,7 +66419,7 @@ var ts; // 3). Dynamic import call or require in javascript // 4). type A = import("./f/*gotToDefinitionHere*/oo") if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 254 /* ImportDeclaration */ || node.parent.kind === 260 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 255 /* ImportDeclaration */ || node.parent.kind === 261 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || ((ts.isInJSFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteralLike*/ false)) || ts.isImportCall(node.parent)) || (ts.isLiteralTypeNode(node.parent) && ts.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent)) { return resolveExternalModuleName(node, node, ignoreErrors); @@ -66044,7 +66441,7 @@ var ts; case 38 /* EqualsGreaterThanToken */: case 80 /* ClassKeyword */: return getSymbolOfNode(node.parent); - case 188 /* ImportType */: + case 189 /* ImportType */: return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : undefined; case 89 /* ExportKeyword */: return ts.isExportAssignment(node.parent) ? ts.Debug.checkDefined(node.parent.symbol) : undefined; @@ -66053,7 +66450,7 @@ var ts; } } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 282 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 283 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */); } return undefined; @@ -66124,23 +66521,23 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfAssignmentPattern(expr) { - ts.Debug.assert(expr.kind === 193 /* ObjectLiteralExpression */ || expr.kind === 192 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 194 /* ObjectLiteralExpression */ || expr.kind === 193 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 232 /* ForOfStatement */) { + if (expr.parent.kind === 233 /* ForOfStatement */) { var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 209 /* BinaryExpression */) { + if (expr.parent.kind === 210 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 281 /* PropertyAssignment */) { + if (expr.parent.kind === 282 /* PropertyAssignment */) { var node_4 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression); var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_4) || errorType; var propertyIndex = ts.indexOfNode(node_4.properties, expr.parent); @@ -66188,7 +66585,7 @@ var ts; case 8 /* NumericLiteral */: case 10 /* StringLiteral */: return getLiteralType(name.text); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType; default: @@ -66244,7 +66641,7 @@ var ts; if (!ts.isGeneratedIdentifier(nodeIn)) { var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier); if (node) { - var isPropertyName_1 = node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node; + var isPropertyName_1 = node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node; return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } @@ -66300,7 +66697,7 @@ var ts; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 290 /* SourceFile */) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 291 /* SourceFile */) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. @@ -66328,7 +66725,7 @@ var ts; } function isSymbolOfDestructuredElementOfCatchBinding(symbol) { return ts.isBindingElement(symbol.valueDeclaration) - && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 280 /* CatchClause */; + && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 281 /* CatchClause */; } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 /* BlockScoped */ && !ts.isSourceFile(symbol.valueDeclaration)) { @@ -66359,7 +66756,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 524288 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 223 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 224 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -66400,19 +66797,19 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 255 /* ImportClause */: - case 256 /* NamespaceImport */: - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 256 /* ImportClause */: + case 257 /* NamespaceImport */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: var symbol = getSymbolOfNode(node) || unknownSymbol; return isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: var exportClause = node.exportClause; return !!exportClause && (ts.isNamespaceExport(exportClause) || ts.some(exportClause.elements, isValueAliasDeclaration)); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return node.expression && node.expression.kind === 75 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) : true; @@ -66421,7 +66818,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 290 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 291 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -66523,15 +66920,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 284 /* EnumMember */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 285 /* EnumMember */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return true; } return false; } function getConstantValue(node) { - if (node.kind === 284 /* EnumMember */) { + if (node.kind === 285 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -66710,9 +67107,11 @@ var ts; return; } var file = host.getSourceFile(resolvedDirective.resolvedFileName); - // Add the transitive closure of path references loaded by this file (as long as they are not) - // part of an existing type reference. - addReferencedFilesToTypeDirective(file, key); + if (file) { + // Add the transitive closure of path references loaded by this file (as long as they are not) + // part of an existing type reference. + addReferencedFilesToTypeDirective(file, key); + } }); } return { @@ -66770,12 +67169,12 @@ var ts; getJsxFactoryEntity: getJsxFactoryEntity, getAllAccessorDeclarations: function (accessor) { accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration); // TODO: GH#18217 - var otherKind = accessor.kind === 164 /* SetAccessor */ ? 163 /* GetAccessor */ : 164 /* SetAccessor */; + var otherKind = accessor.kind === 165 /* SetAccessor */ ? 164 /* GetAccessor */ : 165 /* SetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind); var firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor; var secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor; - var setAccessor = accessor.kind === 164 /* SetAccessor */ ? accessor : otherAccessor; - var getAccessor = accessor.kind === 163 /* GetAccessor */ ? accessor : otherAccessor; + var setAccessor = accessor.kind === 165 /* SetAccessor */ ? accessor : otherAccessor; + var getAccessor = accessor.kind === 164 /* GetAccessor */ ? accessor : otherAccessor; return { firstAccessor: firstAccessor, secondAccessor: secondAccessor, @@ -66791,7 +67190,7 @@ var ts; }, getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) { var n = ts.getParseTreeNode(node); - ts.Debug.assert(n && n.kind === 290 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + ts.Debug.assert(n && n.kind === 291 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); var sym = getSymbolOfNode(node); if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); @@ -66800,7 +67199,7 @@ var ts; } }; function isInHeritageClause(node) { - return node.parent && node.parent.kind === 216 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 279 /* HeritageClause */; + return node.parent && node.parent.kind === 217 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 280 /* HeritageClause */; } // defined here to avoid outer scope pollution function getTypeReferenceDirectivesForEntityName(node) { @@ -66812,7 +67211,7 @@ var ts; // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries var meaning = 788968 /* Type */ | 1920 /* Namespace */; - if ((node.kind === 75 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 194 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { + if ((node.kind === 75 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 195 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -66863,7 +67262,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 290 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 291 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -66891,12 +67290,12 @@ var ts; } } function getExternalModuleFileFromDeclaration(declaration) { - var specifier = declaration.kind === 249 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); + var specifier = declaration.kind === 250 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, /*moduleNotFoundError*/ undefined); // TODO: GH#18217 if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 290 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 291 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -67088,14 +67487,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 161 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 162 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 163 /* GetAccessor */ || node.kind === 164 /* SetAccessor */) { + else if (node.kind === 164 /* GetAccessor */ || node.kind === 165 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -67112,17 +67511,17 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 138 /* ReadonlyKeyword */) { - if (node.kind === 158 /* PropertySignature */ || node.kind === 160 /* MethodSignature */) { + if (modifier.kind !== 139 /* ReadonlyKeyword */) { + if (node.kind === 159 /* PropertySignature */ || node.kind === 161 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 167 /* IndexSignature */) { + if (node.kind === 168 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 81 /* ConstKeyword */: - if (node.kind !== 248 /* EnumDeclaration */) { + if (node.kind !== 249 /* EnumDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(81 /* ConstKeyword */)); } break; @@ -67142,7 +67541,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { + else if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -67168,10 +67567,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { + else if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 156 /* Parameter */) { + else if (node.kind === 157 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -67183,11 +67582,11 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 159 /* PropertyDeclaration */ && node.kind !== 158 /* PropertySignature */ && node.kind !== 167 /* IndexSignature */ && node.kind !== 156 /* Parameter */) { + else if (node.kind !== 160 /* PropertyDeclaration */ && node.kind !== 159 /* PropertySignature */ && node.kind !== 168 /* IndexSignature */ && node.kind !== 157 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -67210,19 +67609,19 @@ var ts; else if (ts.isClassLike(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 156 /* Parameter */) { + else if (node.kind === 157 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; case 84 /* DefaultKeyword */: - var container = node.parent.kind === 290 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 249 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 291 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 250 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512 /* Default */; break; - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: if (flags & 2 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } @@ -67232,10 +67631,10 @@ var ts; else if (ts.isClassLike(node.parent) && !ts.isPropertyDeclaration(node)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 156 /* Parameter */) { + else if (node.kind === 157 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 250 /* ModuleBlock */) { + else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 251 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } else if (ts.isPrivateIdentifierPropertyDeclaration(node)) { @@ -67248,14 +67647,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 245 /* ClassDeclaration */) { - if (node.kind !== 161 /* MethodDeclaration */ && - node.kind !== 159 /* PropertyDeclaration */ && - node.kind !== 163 /* GetAccessor */ && - node.kind !== 164 /* SetAccessor */) { + if (node.kind !== 246 /* ClassDeclaration */) { + if (node.kind !== 162 /* MethodDeclaration */ && + node.kind !== 160 /* PropertyDeclaration */ && + node.kind !== 164 /* GetAccessor */ && + node.kind !== 165 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 245 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { + if (!(node.parent.kind === 246 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -67277,7 +67676,7 @@ var ts; else if (flags & 2 /* Ambient */ || node.parent.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 156 /* Parameter */) { + else if (node.kind === 157 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256 /* Async */; @@ -67285,7 +67684,7 @@ var ts; break; } } - if (node.kind === 162 /* Constructor */) { + if (node.kind === 163 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -67300,13 +67699,13 @@ var ts; } return false; } - else if ((node.kind === 254 /* ImportDeclaration */ || node.kind === 253 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 255 /* ImportDeclaration */ || node.kind === 254 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 156 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 157 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 156 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 157 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -67327,37 +67726,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 162 /* Constructor */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 167 /* IndexSignature */: - case 249 /* ModuleDeclaration */: - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 260 /* ExportDeclaration */: - case 259 /* ExportAssignment */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 156 /* Parameter */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 163 /* Constructor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 168 /* IndexSignature */: + case 250 /* ModuleDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 261 /* ExportDeclaration */: + case 260 /* ExportAssignment */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 157 /* Parameter */: return false; default: - if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { + if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { return false; } switch (node.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 126 /* AsyncKeyword */); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 122 /* AbstractKeyword */); - case 246 /* InterfaceDeclaration */: - case 225 /* VariableStatement */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 226 /* VariableStatement */: + case 248 /* TypeAliasDeclaration */: return true; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 81 /* ConstKeyword */); default: ts.Debug.fail(); @@ -67370,10 +67769,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 161 /* MethodDeclaration */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -67488,7 +67887,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 143 /* StringKeyword */ && parameter.type.kind !== 140 /* NumberKeyword */) { + if (parameter.type.kind !== 144 /* StringKeyword */ && parameter.type.kind !== 141 /* NumberKeyword */) { var type = getTypeFromTypeNode(parameter.type); if (type.flags & 4 /* String */ || type.flags & 8 /* Number */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType)); @@ -67530,7 +67929,7 @@ var ts; if (args) { for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 215 /* OmittedExpression */) { + if (arg.kind === 216 /* OmittedExpression */) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -67607,20 +68006,20 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 154 /* ComputedPropertyName */) { + if (node.kind !== 155 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 209 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { + if (computedPropertyName.expression.kind === 210 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } return false; } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 244 /* FunctionDeclaration */ || - node.kind === 201 /* FunctionExpression */ || - node.kind === 161 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 245 /* FunctionDeclaration */ || + node.kind === 202 /* FunctionExpression */ || + node.kind === 162 /* MethodDeclaration */); if (node.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -67639,7 +68038,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 283 /* SpreadAssignment */) { + if (prop.kind === 284 /* SpreadAssignment */) { if (inDestructuring) { // a rest property cannot be destructured any further var expression = ts.skipParentheses(prop.expression); @@ -67650,11 +68049,11 @@ var ts; continue; } var name = prop.name; - if (name.kind === 154 /* ComputedPropertyName */) { + if (name.kind === 155 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name); } - if (prop.kind === 282 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 283 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); @@ -67667,7 +68066,7 @@ var ts; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { // TODO: GH#19955 var mod = _c[_b]; - if (mod.kind !== 126 /* AsyncKeyword */ || prop.kind !== 161 /* MethodDeclaration */) { + if (mod.kind !== 126 /* AsyncKeyword */ || prop.kind !== 162 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -67682,10 +68081,10 @@ var ts; // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; switch (prop.kind) { - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); // falls through - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8 /* NumericLiteral */) { @@ -67693,13 +68092,13 @@ var ts; } currentKind = 4 /* PropertyAssignment */; break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: currentKind = 8 /* Method */; break; - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: currentKind = 1 /* GetAccessor */; break; - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: currentKind = 2 /* SetAccessor */; break; default: @@ -67738,7 +68137,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 275 /* JsxSpreadAttribute */) { + if (attr.kind === 276 /* JsxSpreadAttribute */) { continue; } var name = attr.name, initializer = attr.initializer; @@ -67748,7 +68147,7 @@ var ts; else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 276 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 277 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -67762,14 +68161,14 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 232 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 233 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 32768 /* AwaitContext */) === 0 /* None */) { // use of 'for-await-of' in non-async function var sourceFile = ts.getSourceFileOfNode(forInOrOfStatement); if (!hasParseDiagnostics(sourceFile)) { var diagnostic = ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); var func = ts.getContainingFunction(forInOrOfStatement); - if (func && func.kind !== 162 /* Constructor */) { + if (func && func.kind !== 163 /* Constructor */) { ts.Debug.assert((ts.getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function."); var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); @@ -67780,7 +68179,7 @@ var ts; return false; } } - if (forInOrOfStatement.initializer.kind === 243 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 244 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -67795,20 +68194,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 232 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 232 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 232 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -67833,11 +68232,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, accessor.kind === 163 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, accessor.kind === 164 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - if (accessor.kind === 164 /* SetAccessor */) { + if (accessor.kind === 165 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -67859,21 +68258,21 @@ var ts; * A set accessor has one parameter or a `this` parameter and one more parameter. */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 163 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 164 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 163 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 164 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 147 /* UniqueKeyword */) { - if (node.type.kind !== 144 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(144 /* SymbolKeyword */)); + if (node.operator === 148 /* UniqueKeyword */) { + if (node.type.kind !== 145 /* SymbolKeyword */) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(145 /* SymbolKeyword */)); } var parent = ts.walkUpParenthesizedTypes(node.parent); switch (parent.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: var decl = parent; if (decl.name.kind !== 75 /* Identifier */) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -67885,13 +68284,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: if (!ts.hasModifier(parent, 32 /* Static */) || !ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: if (!ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -67900,9 +68299,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_not_allowed_here); } } - else if (node.operator === 138 /* ReadonlyKeyword */) { - if (node.type.kind !== 174 /* ArrayType */ && node.type.kind !== 175 /* TupleType */) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(144 /* SymbolKeyword */)); + else if (node.operator === 139 /* ReadonlyKeyword */) { + if (node.type.kind !== 175 /* ArrayType */ && node.type.kind !== 176 /* TupleType */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(145 /* SymbolKeyword */)); } } } @@ -67915,8 +68314,8 @@ var ts; if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 161 /* MethodDeclaration */) { - if (node.parent.kind === 193 /* ObjectLiteralExpression */) { + if (node.kind === 162 /* MethodDeclaration */) { + if (node.parent.kind === 194 /* ObjectLiteralExpression */) { // We only disallow modifier on a method declaration if it is a property of object-literal-expression if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 126 /* AsyncKeyword */)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -67944,14 +68343,14 @@ var ts; if (node.flags & 8388608 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.kind === 161 /* MethodDeclaration */ && !node.body) { + else if (node.kind === 162 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 246 /* InterfaceDeclaration */) { + else if (node.parent.kind === 247 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 173 /* TypeLiteral */) { + else if (node.parent.kind === 174 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -67962,11 +68361,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 233 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 234 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -67974,8 +68373,8 @@ var ts; return false; } break; - case 237 /* SwitchStatement */: - if (node.kind === 234 /* BreakStatement */ && !node.label) { + case 238 /* SwitchStatement */: + if (node.kind === 235 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -67990,13 +68389,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 234 /* BreakStatement */ + var message = node.kind === 235 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 234 /* BreakStatement */ + var message = node.kind === 235 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -68020,12 +68419,12 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return ts.isStringOrNumericLiteralLike(expr) || - expr.kind === 207 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 208 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function isBigIntLiteralExpression(expr) { return expr.kind === 9 /* BigIntLiteral */ || - expr.kind === 207 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 208 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */; } function isSimpleLiteralEnumReference(expr) { @@ -68056,7 +68455,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 231 /* ForInStatement */ && node.parent.parent.kind !== 232 /* ForOfStatement */) { + if (node.parent.parent.kind !== 232 /* ForInStatement */ && node.parent.parent.kind !== 233 /* ForOfStatement */) { if (node.flags & 8388608 /* Ambient */) { checkAmbientInitializer(node); } @@ -68069,7 +68468,7 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 225 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { + if (node.exclamationToken && (node.parent.parent.kind !== 226 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation); } var moduleKind = ts.getEmitModuleKind(compilerOptions); @@ -68132,15 +68531,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 227 /* IfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 236 /* WithStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 228 /* IfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 237 /* WithStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: return false; - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -68224,7 +68623,7 @@ var ts; return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } } - else if (node.parent.kind === 246 /* InterfaceDeclaration */) { + else if (node.parent.kind === 247 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -68232,7 +68631,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 173 /* TypeLiteral */) { + else if (node.parent.kind === 174 /* TypeLiteral */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -68261,13 +68660,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 246 /* InterfaceDeclaration */ || - node.kind === 247 /* TypeAliasDeclaration */ || - node.kind === 254 /* ImportDeclaration */ || - node.kind === 253 /* ImportEqualsDeclaration */ || - node.kind === 260 /* ExportDeclaration */ || - node.kind === 259 /* ExportAssignment */ || - node.kind === 252 /* NamespaceExportDeclaration */ || + if (node.kind === 247 /* InterfaceDeclaration */ || + node.kind === 248 /* TypeAliasDeclaration */ || + node.kind === 255 /* ImportDeclaration */ || + node.kind === 254 /* ImportEqualsDeclaration */ || + node.kind === 261 /* ExportDeclaration */ || + node.kind === 260 /* ExportAssignment */ || + node.kind === 253 /* NamespaceExportDeclaration */ || ts.hasModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -68276,7 +68675,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 225 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 226 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -68299,7 +68698,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 223 /* Block */ || node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { + if (node.parent.kind === 224 /* Block */ || node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { var links_2 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_2.hasReportedStatementInAmbientContext) { @@ -68321,10 +68720,10 @@ var ts; if (languageVersion >= 1 /* ES5 */) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 187 /* LiteralType */)) { + else if (ts.isChildOfNodeWithKind(node, 188 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 284 /* EnumMember */)) { + else if (ts.isChildOfNodeWithKind(node, 285 /* EnumMember */)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -68499,14 +68898,14 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 244 /* FunctionDeclaration */ && declaration.kind !== 161 /* MethodDeclaration */) || + return (declaration.kind !== 245 /* FunctionDeclaration */ && declaration.kind !== 162 /* MethodDeclaration */) || !!declaration.body; } /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */ function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return ts.isIdentifier(name); default: return ts.isDeclarationName(name); @@ -68514,14 +68913,14 @@ var ts; } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 255 /* ImportClause */: // For default import - case 253 /* ImportEqualsDeclaration */: - case 256 /* NamespaceImport */: - case 258 /* ImportSpecifier */: // For rename import `x as y` + case 256 /* ImportClause */: // For default import + case 254 /* ImportEqualsDeclaration */: + case 257 /* NamespaceImport */: + case 259 /* ImportSpecifier */: // For rename import `x as y` return true; case 75 /* Identifier */: // For regular import, `decl` is an Identifier under the ImportSpecifier. - return decl.parent.kind === 258 /* ImportSpecifier */; + return decl.parent.kind === 259 /* ImportSpecifier */; default: return false; } @@ -68784,7 +69183,7 @@ var ts; result.push(createModifier(89 /* ExportKeyword */)); } if (flags & 2 /* Ambient */) { - result.push(createModifier(130 /* DeclareKeyword */)); + result.push(createModifier(131 /* DeclareKeyword */)); } if (flags & 512 /* Default */) { result.push(createModifier(84 /* DefaultKeyword */)); @@ -68808,7 +69207,7 @@ var ts; result.push(createModifier(120 /* StaticKeyword */)); } if (flags & 64 /* Readonly */) { - result.push(createModifier(138 /* ReadonlyKeyword */)); + result.push(createModifier(139 /* ReadonlyKeyword */)); } if (flags & 256 /* Async */) { result.push(createModifier(126 /* AsyncKeyword */)); @@ -68818,7 +69217,7 @@ var ts; ts.createModifiersFromModifierFlags = createModifiersFromModifierFlags; // Names function createQualifiedName(left, right) { - var node = createSynthesizedNode(153 /* QualifiedName */); + var node = createSynthesizedNode(154 /* QualifiedName */); node.left = left; node.right = asName(right); return node; @@ -68837,7 +69236,7 @@ var ts; : expression; } function createComputedPropertyName(expression) { - var node = createSynthesizedNode(154 /* ComputedPropertyName */); + var node = createSynthesizedNode(155 /* ComputedPropertyName */); node.expression = parenthesizeForComputedName(expression); return node; } @@ -68850,7 +69249,7 @@ var ts; ts.updateComputedPropertyName = updateComputedPropertyName; // Signature elements function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createSynthesizedNode(155 /* TypeParameter */); + var node = createSynthesizedNode(156 /* TypeParameter */); node.name = asName(name); node.constraint = constraint; node.default = defaultType; @@ -68866,7 +69265,7 @@ var ts; } ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createSynthesizedNode(156 /* Parameter */); + var node = createSynthesizedNode(157 /* Parameter */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; @@ -68890,7 +69289,7 @@ var ts; } ts.updateParameter = updateParameter; function createDecorator(expression) { - var node = createSynthesizedNode(157 /* Decorator */); + var node = createSynthesizedNode(158 /* Decorator */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -68903,7 +69302,7 @@ var ts; ts.updateDecorator = updateDecorator; // Type Elements function createPropertySignature(modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(158 /* PropertySignature */); + var node = createSynthesizedNode(159 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -68923,7 +69322,7 @@ var ts; } ts.updatePropertySignature = updatePropertySignature; function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - var node = createSynthesizedNode(159 /* PropertyDeclaration */); + var node = createSynthesizedNode(160 /* PropertyDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -68947,7 +69346,7 @@ var ts; } ts.updateProperty = updateProperty; function createMethodSignature(typeParameters, parameters, type, name, questionToken) { - var node = createSignatureDeclaration(160 /* MethodSignature */, typeParameters, parameters, type); + var node = createSignatureDeclaration(161 /* MethodSignature */, typeParameters, parameters, type); node.name = asName(name); node.questionToken = questionToken; return node; @@ -68964,7 +69363,7 @@ var ts; } ts.updateMethodSignature = updateMethodSignature; function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(161 /* MethodDeclaration */); + var node = createSynthesizedNode(162 /* MethodDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -69024,7 +69423,7 @@ var ts; } ts.updateMethod = updateMethod; function createConstructor(decorators, modifiers, parameters, body) { - var node = createSynthesizedNode(162 /* Constructor */); + var node = createSynthesizedNode(163 /* Constructor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; @@ -69044,7 +69443,7 @@ var ts; } ts.updateConstructor = updateConstructor; function createGetAccessor(decorators, modifiers, name, parameters, type, body) { - var node = createSynthesizedNode(163 /* GetAccessor */); + var node = createSynthesizedNode(164 /* GetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69067,7 +69466,7 @@ var ts; } ts.updateGetAccessor = updateGetAccessor; function createSetAccessor(decorators, modifiers, name, parameters, body) { - var node = createSynthesizedNode(164 /* SetAccessor */); + var node = createSynthesizedNode(165 /* SetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69088,7 +69487,7 @@ var ts; } ts.updateSetAccessor = updateSetAccessor; function createCallSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(165 /* CallSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(166 /* CallSignature */, typeParameters, parameters, type); } ts.createCallSignature = createCallSignature; function updateCallSignature(node, typeParameters, parameters, type) { @@ -69096,7 +69495,7 @@ var ts; } ts.updateCallSignature = updateCallSignature; function createConstructSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(166 /* ConstructSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(167 /* ConstructSignature */, typeParameters, parameters, type); } ts.createConstructSignature = createConstructSignature; function updateConstructSignature(node, typeParameters, parameters, type) { @@ -69104,7 +69503,7 @@ var ts; } ts.updateConstructSignature = updateConstructSignature; function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createSynthesizedNode(167 /* IndexSignature */); + var node = createSynthesizedNode(168 /* IndexSignature */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); @@ -69148,7 +69547,7 @@ var ts; } ts.createTypePredicateNode = createTypePredicateNode; function createTypePredicateNodeWithModifier(assertsModifier, parameterName, type) { - var node = createSynthesizedNode(168 /* TypePredicate */); + var node = createSynthesizedNode(169 /* TypePredicate */); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); node.type = type; @@ -69168,7 +69567,7 @@ var ts; } ts.updateTypePredicateNodeWithModifier = updateTypePredicateNodeWithModifier; function createTypeReferenceNode(typeName, typeArguments) { - var node = createSynthesizedNode(169 /* TypeReference */); + var node = createSynthesizedNode(170 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments); return node; @@ -69182,7 +69581,7 @@ var ts; } ts.updateTypeReferenceNode = updateTypeReferenceNode; function createFunctionTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(170 /* FunctionType */, typeParameters, parameters, type); + return createSignatureDeclaration(171 /* FunctionType */, typeParameters, parameters, type); } ts.createFunctionTypeNode = createFunctionTypeNode; function updateFunctionTypeNode(node, typeParameters, parameters, type) { @@ -69190,7 +69589,7 @@ var ts; } ts.updateFunctionTypeNode = updateFunctionTypeNode; function createConstructorTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(171 /* ConstructorType */, typeParameters, parameters, type); + return createSignatureDeclaration(172 /* ConstructorType */, typeParameters, parameters, type); } ts.createConstructorTypeNode = createConstructorTypeNode; function updateConstructorTypeNode(node, typeParameters, parameters, type) { @@ -69198,7 +69597,7 @@ var ts; } ts.updateConstructorTypeNode = updateConstructorTypeNode; function createTypeQueryNode(exprName) { - var node = createSynthesizedNode(172 /* TypeQuery */); + var node = createSynthesizedNode(173 /* TypeQuery */); node.exprName = exprName; return node; } @@ -69210,7 +69609,7 @@ var ts; } ts.updateTypeQueryNode = updateTypeQueryNode; function createTypeLiteralNode(members) { - var node = createSynthesizedNode(173 /* TypeLiteral */); + var node = createSynthesizedNode(174 /* TypeLiteral */); node.members = createNodeArray(members); return node; } @@ -69222,7 +69621,7 @@ var ts; } ts.updateTypeLiteralNode = updateTypeLiteralNode; function createArrayTypeNode(elementType) { - var node = createSynthesizedNode(174 /* ArrayType */); + var node = createSynthesizedNode(175 /* ArrayType */); node.elementType = ts.parenthesizeArrayTypeMember(elementType); return node; } @@ -69234,7 +69633,7 @@ var ts; } ts.updateArrayTypeNode = updateArrayTypeNode; function createTupleTypeNode(elementTypes) { - var node = createSynthesizedNode(175 /* TupleType */); + var node = createSynthesizedNode(176 /* TupleType */); node.elementTypes = createNodeArray(elementTypes); return node; } @@ -69246,7 +69645,7 @@ var ts; } ts.updateTupleTypeNode = updateTupleTypeNode; function createOptionalTypeNode(type) { - var node = createSynthesizedNode(176 /* OptionalType */); + var node = createSynthesizedNode(177 /* OptionalType */); node.type = ts.parenthesizeArrayTypeMember(type); return node; } @@ -69258,7 +69657,7 @@ var ts; } ts.updateOptionalTypeNode = updateOptionalTypeNode; function createRestTypeNode(type) { - var node = createSynthesizedNode(177 /* RestType */); + var node = createSynthesizedNode(178 /* RestType */); node.type = type; return node; } @@ -69270,7 +69669,7 @@ var ts; } ts.updateRestTypeNode = updateRestTypeNode; function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(178 /* UnionType */, types); + return createUnionOrIntersectionTypeNode(179 /* UnionType */, types); } ts.createUnionTypeNode = createUnionTypeNode; function updateUnionTypeNode(node, types) { @@ -69278,7 +69677,7 @@ var ts; } ts.updateUnionTypeNode = updateUnionTypeNode; function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(179 /* IntersectionType */, types); + return createUnionOrIntersectionTypeNode(180 /* IntersectionType */, types); } ts.createIntersectionTypeNode = createIntersectionTypeNode; function updateIntersectionTypeNode(node, types) { @@ -69297,7 +69696,7 @@ var ts; : node; } function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - var node = createSynthesizedNode(180 /* ConditionalType */); + var node = createSynthesizedNode(181 /* ConditionalType */); node.checkType = ts.parenthesizeConditionalTypeMember(checkType); node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType); node.trueType = trueType; @@ -69315,7 +69714,7 @@ var ts; } ts.updateConditionalTypeNode = updateConditionalTypeNode; function createInferTypeNode(typeParameter) { - var node = createSynthesizedNode(181 /* InferType */); + var node = createSynthesizedNode(182 /* InferType */); node.typeParameter = typeParameter; return node; } @@ -69327,7 +69726,7 @@ var ts; } ts.updateInferTypeNode = updateInferTypeNode; function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) { - var node = createSynthesizedNode(188 /* ImportType */); + var node = createSynthesizedNode(189 /* ImportType */); node.argument = argument; node.qualifier = qualifier; node.typeArguments = ts.parenthesizeTypeParameters(typeArguments); @@ -69345,7 +69744,7 @@ var ts; } ts.updateImportTypeNode = updateImportTypeNode; function createParenthesizedType(type) { - var node = createSynthesizedNode(182 /* ParenthesizedType */); + var node = createSynthesizedNode(183 /* ParenthesizedType */); node.type = type; return node; } @@ -69357,12 +69756,12 @@ var ts; } ts.updateParenthesizedType = updateParenthesizedType; function createThisTypeNode() { - return createSynthesizedNode(183 /* ThisType */); + return createSynthesizedNode(184 /* ThisType */); } ts.createThisTypeNode = createThisTypeNode; function createTypeOperatorNode(operatorOrType, type) { - var node = createSynthesizedNode(184 /* TypeOperator */); - node.operator = typeof operatorOrType === "number" ? operatorOrType : 134 /* KeyOfKeyword */; + var node = createSynthesizedNode(185 /* TypeOperator */); + node.operator = typeof operatorOrType === "number" ? operatorOrType : 135 /* KeyOfKeyword */; node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); return node; } @@ -69372,7 +69771,7 @@ var ts; } ts.updateTypeOperatorNode = updateTypeOperatorNode; function createIndexedAccessTypeNode(objectType, indexType) { - var node = createSynthesizedNode(185 /* IndexedAccessType */); + var node = createSynthesizedNode(186 /* IndexedAccessType */); node.objectType = ts.parenthesizeElementTypeMember(objectType); node.indexType = indexType; return node; @@ -69386,7 +69785,7 @@ var ts; } ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { - var node = createSynthesizedNode(186 /* MappedType */); + var node = createSynthesizedNode(187 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.questionToken = questionToken; @@ -69404,7 +69803,7 @@ var ts; } ts.updateMappedTypeNode = updateMappedTypeNode; function createLiteralTypeNode(literal) { - var node = createSynthesizedNode(187 /* LiteralType */); + var node = createSynthesizedNode(188 /* LiteralType */); node.literal = literal; return node; } @@ -69417,7 +69816,7 @@ var ts; ts.updateLiteralTypeNode = updateLiteralTypeNode; // Binding Patterns function createObjectBindingPattern(elements) { - var node = createSynthesizedNode(189 /* ObjectBindingPattern */); + var node = createSynthesizedNode(190 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -69429,7 +69828,7 @@ var ts; } ts.updateObjectBindingPattern = updateObjectBindingPattern; function createArrayBindingPattern(elements) { - var node = createSynthesizedNode(190 /* ArrayBindingPattern */); + var node = createSynthesizedNode(191 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -69441,7 +69840,7 @@ var ts; } ts.updateArrayBindingPattern = updateArrayBindingPattern; function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createSynthesizedNode(191 /* BindingElement */); + var node = createSynthesizedNode(192 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -69460,7 +69859,7 @@ var ts; ts.updateBindingElement = updateBindingElement; // Expression function createArrayLiteral(elements, multiLine) { - var node = createSynthesizedNode(192 /* ArrayLiteralExpression */); + var node = createSynthesizedNode(193 /* ArrayLiteralExpression */); node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) node.multiLine = true; @@ -69474,7 +69873,7 @@ var ts; } ts.updateArrayLiteral = updateArrayLiteral; function createObjectLiteral(properties, multiLine) { - var node = createSynthesizedNode(193 /* ObjectLiteralExpression */); + var node = createSynthesizedNode(194 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); if (multiLine) node.multiLine = true; @@ -69488,7 +69887,7 @@ var ts; } ts.updateObjectLiteral = updateObjectLiteral; function createPropertyAccess(expression, name) { - var node = createSynthesizedNode(194 /* PropertyAccessExpression */); + var node = createSynthesizedNode(195 /* PropertyAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.name = asName(name); setEmitFlags(node, 131072 /* NoIndentation */); @@ -69510,7 +69909,7 @@ var ts; } ts.updatePropertyAccess = updatePropertyAccess; function createPropertyAccessChain(expression, questionDotToken, name) { - var node = createSynthesizedNode(194 /* PropertyAccessExpression */); + var node = createSynthesizedNode(195 /* PropertyAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -69531,7 +69930,7 @@ var ts; } ts.updatePropertyAccessChain = updatePropertyAccessChain; function createElementAccess(expression, index) { - var node = createSynthesizedNode(195 /* ElementAccessExpression */); + var node = createSynthesizedNode(196 /* ElementAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.argumentExpression = asExpression(index); return node; @@ -69548,7 +69947,7 @@ var ts; } ts.updateElementAccess = updateElementAccess; function createElementAccessChain(expression, questionDotToken, index) { - var node = createSynthesizedNode(195 /* ElementAccessExpression */); + var node = createSynthesizedNode(196 /* ElementAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -69566,7 +69965,7 @@ var ts; } ts.updateElementAccessChain = updateElementAccessChain; function createCall(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(196 /* CallExpression */); + var node = createSynthesizedNode(197 /* CallExpression */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); @@ -69585,7 +69984,7 @@ var ts; } ts.updateCall = updateCall; function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { - var node = createSynthesizedNode(196 /* CallExpression */); + var node = createSynthesizedNode(197 /* CallExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -69605,7 +70004,7 @@ var ts; } ts.updateCallChain = updateCallChain; function createNew(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(197 /* NewExpression */); + var node = createSynthesizedNode(198 /* NewExpression */); node.expression = ts.parenthesizeForNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; @@ -69621,7 +70020,7 @@ var ts; } ts.updateNew = updateNew; function createTaggedTemplate(tag, typeArgumentsOrTemplate, template) { - var node = createSynthesizedNode(198 /* TaggedTemplateExpression */); + var node = createSynthesizedNode(199 /* TaggedTemplateExpression */); node.tag = ts.parenthesizeForAccess(tag); if (template) { node.typeArguments = asNodeArray(typeArgumentsOrTemplate); @@ -69644,7 +70043,7 @@ var ts; } ts.updateTaggedTemplate = updateTaggedTemplate; function createTypeAssertion(type, expression) { - var node = createSynthesizedNode(199 /* TypeAssertionExpression */); + var node = createSynthesizedNode(200 /* TypeAssertionExpression */); node.type = type; node.expression = ts.parenthesizePrefixOperand(expression); return node; @@ -69658,7 +70057,7 @@ var ts; } ts.updateTypeAssertion = updateTypeAssertion; function createParen(expression) { - var node = createSynthesizedNode(200 /* ParenthesizedExpression */); + var node = createSynthesizedNode(201 /* ParenthesizedExpression */); node.expression = expression; return node; } @@ -69670,7 +70069,7 @@ var ts; } ts.updateParen = updateParen; function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(201 /* FunctionExpression */); + var node = createSynthesizedNode(202 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -69694,7 +70093,7 @@ var ts; } ts.updateFunctionExpression = updateFunctionExpression; function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createSynthesizedNode(202 /* ArrowFunction */); + var node = createSynthesizedNode(203 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -69716,7 +70115,7 @@ var ts; } ts.updateArrowFunction = updateArrowFunction; function createDelete(expression) { - var node = createSynthesizedNode(203 /* DeleteExpression */); + var node = createSynthesizedNode(204 /* DeleteExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -69728,7 +70127,7 @@ var ts; } ts.updateDelete = updateDelete; function createTypeOf(expression) { - var node = createSynthesizedNode(204 /* TypeOfExpression */); + var node = createSynthesizedNode(205 /* TypeOfExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -69740,7 +70139,7 @@ var ts; } ts.updateTypeOf = updateTypeOf; function createVoid(expression) { - var node = createSynthesizedNode(205 /* VoidExpression */); + var node = createSynthesizedNode(206 /* VoidExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -69752,7 +70151,7 @@ var ts; } ts.updateVoid = updateVoid; function createAwait(expression) { - var node = createSynthesizedNode(206 /* AwaitExpression */); + var node = createSynthesizedNode(207 /* AwaitExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -69764,7 +70163,7 @@ var ts; } ts.updateAwait = updateAwait; function createPrefix(operator, operand) { - var node = createSynthesizedNode(207 /* PrefixUnaryExpression */); + var node = createSynthesizedNode(208 /* PrefixUnaryExpression */); node.operator = operator; node.operand = ts.parenthesizePrefixOperand(operand); return node; @@ -69777,7 +70176,7 @@ var ts; } ts.updatePrefix = updatePrefix; function createPostfix(operand, operator) { - var node = createSynthesizedNode(208 /* PostfixUnaryExpression */); + var node = createSynthesizedNode(209 /* PostfixUnaryExpression */); node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; @@ -69790,7 +70189,7 @@ var ts; } ts.updatePostfix = updatePostfix; function createBinary(left, operator, right) { - var node = createSynthesizedNode(209 /* BinaryExpression */); + var node = createSynthesizedNode(210 /* BinaryExpression */); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = ts.parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); @@ -69807,7 +70206,7 @@ var ts; } ts.updateBinary = updateBinary; function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - var node = createSynthesizedNode(210 /* ConditionalExpression */); + var node = createSynthesizedNode(211 /* ConditionalExpression */); node.condition = ts.parenthesizeForConditionalHead(condition); node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(57 /* QuestionToken */); node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); @@ -69827,7 +70226,7 @@ var ts; } ts.updateConditional = updateConditional; function createTemplateExpression(head, templateSpans) { - var node = createSynthesizedNode(211 /* TemplateExpression */); + var node = createSynthesizedNode(212 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; @@ -69924,7 +70323,7 @@ var ts; } ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral; function createYield(asteriskTokenOrExpression, expression) { - var node = createSynthesizedNode(212 /* YieldExpression */); + var node = createSynthesizedNode(213 /* YieldExpression */); node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 41 /* AsteriskToken */ ? asteriskTokenOrExpression : undefined; node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 41 /* AsteriskToken */ ? asteriskTokenOrExpression : expression; return node; @@ -69938,7 +70337,7 @@ var ts; } ts.updateYield = updateYield; function createSpread(expression) { - var node = createSynthesizedNode(213 /* SpreadElement */); + var node = createSynthesizedNode(214 /* SpreadElement */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -69950,7 +70349,7 @@ var ts; } ts.updateSpread = updateSpread; function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(214 /* ClassExpression */); + var node = createSynthesizedNode(215 /* ClassExpression */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69971,11 +70370,11 @@ var ts; } ts.updateClassExpression = updateClassExpression; function createOmittedExpression() { - return createSynthesizedNode(215 /* OmittedExpression */); + return createSynthesizedNode(216 /* OmittedExpression */); } ts.createOmittedExpression = createOmittedExpression; function createExpressionWithTypeArguments(typeArguments, expression) { - var node = createSynthesizedNode(216 /* ExpressionWithTypeArguments */); + var node = createSynthesizedNode(217 /* ExpressionWithTypeArguments */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); return node; @@ -69989,7 +70388,7 @@ var ts; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; function createAsExpression(expression, type) { - var node = createSynthesizedNode(217 /* AsExpression */); + var node = createSynthesizedNode(218 /* AsExpression */); node.expression = expression; node.type = type; return node; @@ -70003,7 +70402,7 @@ var ts; } ts.updateAsExpression = updateAsExpression; function createNonNullExpression(expression) { - var node = createSynthesizedNode(218 /* NonNullExpression */); + var node = createSynthesizedNode(219 /* NonNullExpression */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -70015,7 +70414,7 @@ var ts; } ts.updateNonNullExpression = updateNonNullExpression; function createMetaProperty(keywordToken, name) { - var node = createSynthesizedNode(219 /* MetaProperty */); + var node = createSynthesizedNode(220 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; return node; @@ -70029,7 +70428,7 @@ var ts; ts.updateMetaProperty = updateMetaProperty; // Misc function createTemplateSpan(expression, literal) { - var node = createSynthesizedNode(221 /* TemplateSpan */); + var node = createSynthesizedNode(222 /* TemplateSpan */); node.expression = expression; node.literal = literal; return node; @@ -70043,12 +70442,12 @@ var ts; } ts.updateTemplateSpan = updateTemplateSpan; function createSemicolonClassElement() { - return createSynthesizedNode(222 /* SemicolonClassElement */); + return createSynthesizedNode(223 /* SemicolonClassElement */); } ts.createSemicolonClassElement = createSemicolonClassElement; // Element function createBlock(statements, multiLine) { - var block = createSynthesizedNode(223 /* Block */); + var block = createSynthesizedNode(224 /* Block */); block.statements = createNodeArray(statements); if (multiLine) block.multiLine = multiLine; @@ -70062,7 +70461,7 @@ var ts; } ts.updateBlock = updateBlock; function createVariableStatement(modifiers, declarationList) { - var node = createSynthesizedNode(225 /* VariableStatement */); + var node = createSynthesizedNode(226 /* VariableStatement */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; @@ -70077,11 +70476,11 @@ var ts; } ts.updateVariableStatement = updateVariableStatement; function createEmptyStatement() { - return createSynthesizedNode(224 /* EmptyStatement */); + return createSynthesizedNode(225 /* EmptyStatement */); } ts.createEmptyStatement = createEmptyStatement; function createExpressionStatement(expression) { - var node = createSynthesizedNode(226 /* ExpressionStatement */); + var node = createSynthesizedNode(227 /* ExpressionStatement */); node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } @@ -70097,7 +70496,7 @@ var ts; /** @deprecated Use `updateExpressionStatement` instead. */ ts.updateStatement = updateExpressionStatement; function createIf(expression, thenStatement, elseStatement) { - var node = createSynthesizedNode(227 /* IfStatement */); + var node = createSynthesizedNode(228 /* IfStatement */); node.expression = expression; node.thenStatement = asEmbeddedStatement(thenStatement); node.elseStatement = asEmbeddedStatement(elseStatement); @@ -70113,7 +70512,7 @@ var ts; } ts.updateIf = updateIf; function createDo(statement, expression) { - var node = createSynthesizedNode(228 /* DoStatement */); + var node = createSynthesizedNode(229 /* DoStatement */); node.statement = asEmbeddedStatement(statement); node.expression = expression; return node; @@ -70127,7 +70526,7 @@ var ts; } ts.updateDo = updateDo; function createWhile(expression, statement) { - var node = createSynthesizedNode(229 /* WhileStatement */); + var node = createSynthesizedNode(230 /* WhileStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -70141,7 +70540,7 @@ var ts; } ts.updateWhile = updateWhile; function createFor(initializer, condition, incrementor, statement) { - var node = createSynthesizedNode(230 /* ForStatement */); + var node = createSynthesizedNode(231 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -70159,7 +70558,7 @@ var ts; } ts.updateFor = updateFor; function createForIn(initializer, expression, statement) { - var node = createSynthesizedNode(231 /* ForInStatement */); + var node = createSynthesizedNode(232 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = asEmbeddedStatement(statement); @@ -70175,7 +70574,7 @@ var ts; } ts.updateForIn = updateForIn; function createForOf(awaitModifier, initializer, expression, statement) { - var node = createSynthesizedNode(232 /* ForOfStatement */); + var node = createSynthesizedNode(233 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = ts.isCommaSequence(expression) ? createParen(expression) : expression; @@ -70193,7 +70592,7 @@ var ts; } ts.updateForOf = updateForOf; function createContinue(label) { - var node = createSynthesizedNode(233 /* ContinueStatement */); + var node = createSynthesizedNode(234 /* ContinueStatement */); node.label = asName(label); return node; } @@ -70205,7 +70604,7 @@ var ts; } ts.updateContinue = updateContinue; function createBreak(label) { - var node = createSynthesizedNode(234 /* BreakStatement */); + var node = createSynthesizedNode(235 /* BreakStatement */); node.label = asName(label); return node; } @@ -70217,7 +70616,7 @@ var ts; } ts.updateBreak = updateBreak; function createReturn(expression) { - var node = createSynthesizedNode(235 /* ReturnStatement */); + var node = createSynthesizedNode(236 /* ReturnStatement */); node.expression = expression; return node; } @@ -70229,7 +70628,7 @@ var ts; } ts.updateReturn = updateReturn; function createWith(expression, statement) { - var node = createSynthesizedNode(236 /* WithStatement */); + var node = createSynthesizedNode(237 /* WithStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -70243,7 +70642,7 @@ var ts; } ts.updateWith = updateWith; function createSwitch(expression, caseBlock) { - var node = createSynthesizedNode(237 /* SwitchStatement */); + var node = createSynthesizedNode(238 /* SwitchStatement */); node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; @@ -70257,7 +70656,7 @@ var ts; } ts.updateSwitch = updateSwitch; function createLabel(label, statement) { - var node = createSynthesizedNode(238 /* LabeledStatement */); + var node = createSynthesizedNode(239 /* LabeledStatement */); node.label = asName(label); node.statement = asEmbeddedStatement(statement); return node; @@ -70271,7 +70670,7 @@ var ts; } ts.updateLabel = updateLabel; function createThrow(expression) { - var node = createSynthesizedNode(239 /* ThrowStatement */); + var node = createSynthesizedNode(240 /* ThrowStatement */); node.expression = expression; return node; } @@ -70283,7 +70682,7 @@ var ts; } ts.updateThrow = updateThrow; function createTry(tryBlock, catchClause, finallyBlock) { - var node = createSynthesizedNode(240 /* TryStatement */); + var node = createSynthesizedNode(241 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -70299,12 +70698,12 @@ var ts; } ts.updateTry = updateTry; function createDebuggerStatement() { - return createSynthesizedNode(241 /* DebuggerStatement */); + return createSynthesizedNode(242 /* DebuggerStatement */); } ts.createDebuggerStatement = createDebuggerStatement; function createVariableDeclaration(name, type, initializer) { /* Internally, one should probably use createTypeScriptVariableDeclaration instead and handle definite assignment assertions */ - var node = createSynthesizedNode(242 /* VariableDeclaration */); + var node = createSynthesizedNode(243 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -70322,7 +70721,7 @@ var ts; ts.updateVariableDeclaration = updateVariableDeclaration; /* @internal */ function createTypeScriptVariableDeclaration(name, exclaimationToken, type, initializer) { - var node = createSynthesizedNode(242 /* VariableDeclaration */); + var node = createSynthesizedNode(243 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -70342,7 +70741,7 @@ var ts; ts.updateTypeScriptVariableDeclaration = updateTypeScriptVariableDeclaration; function createVariableDeclarationList(declarations, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(243 /* VariableDeclarationList */); + var node = createSynthesizedNode(244 /* VariableDeclarationList */); node.flags |= flags & 3 /* BlockScoped */; node.declarations = createNodeArray(declarations); return node; @@ -70355,7 +70754,7 @@ var ts; } ts.updateVariableDeclarationList = updateVariableDeclarationList; function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(244 /* FunctionDeclaration */); + var node = createSynthesizedNode(245 /* FunctionDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -70381,7 +70780,7 @@ var ts; } ts.updateFunctionDeclaration = updateFunctionDeclaration; function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(245 /* ClassDeclaration */); + var node = createSynthesizedNode(246 /* ClassDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70403,7 +70802,7 @@ var ts; } ts.updateClassDeclaration = updateClassDeclaration; function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(246 /* InterfaceDeclaration */); + var node = createSynthesizedNode(247 /* InterfaceDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70425,7 +70824,7 @@ var ts; } ts.updateInterfaceDeclaration = updateInterfaceDeclaration; function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createSynthesizedNode(247 /* TypeAliasDeclaration */); + var node = createSynthesizedNode(248 /* TypeAliasDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70445,7 +70844,7 @@ var ts; } ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration; function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createSynthesizedNode(248 /* EnumDeclaration */); + var node = createSynthesizedNode(249 /* EnumDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70464,7 +70863,7 @@ var ts; ts.updateEnumDeclaration = updateEnumDeclaration; function createModuleDeclaration(decorators, modifiers, name, body, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(249 /* ModuleDeclaration */); + var node = createSynthesizedNode(250 /* ModuleDeclaration */); node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); @@ -70483,7 +70882,7 @@ var ts; } ts.updateModuleDeclaration = updateModuleDeclaration; function createModuleBlock(statements) { - var node = createSynthesizedNode(250 /* ModuleBlock */); + var node = createSynthesizedNode(251 /* ModuleBlock */); node.statements = createNodeArray(statements); return node; } @@ -70495,7 +70894,7 @@ var ts; } ts.updateModuleBlock = updateModuleBlock; function createCaseBlock(clauses) { - var node = createSynthesizedNode(251 /* CaseBlock */); + var node = createSynthesizedNode(252 /* CaseBlock */); node.clauses = createNodeArray(clauses); return node; } @@ -70507,7 +70906,7 @@ var ts; } ts.updateCaseBlock = updateCaseBlock; function createNamespaceExportDeclaration(name) { - var node = createSynthesizedNode(252 /* NamespaceExportDeclaration */); + var node = createSynthesizedNode(253 /* NamespaceExportDeclaration */); node.name = asName(name); return node; } @@ -70519,7 +70918,7 @@ var ts; } ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration; function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createSynthesizedNode(253 /* ImportEqualsDeclaration */); + var node = createSynthesizedNode(254 /* ImportEqualsDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70537,7 +70936,7 @@ var ts; } ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createSynthesizedNode(254 /* ImportDeclaration */); + var node = createSynthesizedNode(255 /* ImportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -70556,7 +70955,7 @@ var ts; ts.updateImportDeclaration = updateImportDeclaration; function createImportClause(name, namedBindings, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(255 /* ImportClause */); + var node = createSynthesizedNode(256 /* ImportClause */); node.name = name; node.namedBindings = namedBindings; node.isTypeOnly = isTypeOnly; @@ -70572,13 +70971,13 @@ var ts; } ts.updateImportClause = updateImportClause; function createNamespaceImport(name) { - var node = createSynthesizedNode(256 /* NamespaceImport */); + var node = createSynthesizedNode(257 /* NamespaceImport */); node.name = name; return node; } ts.createNamespaceImport = createNamespaceImport; function createNamespaceExport(name) { - var node = createSynthesizedNode(262 /* NamespaceExport */); + var node = createSynthesizedNode(263 /* NamespaceExport */); node.name = name; return node; } @@ -70596,7 +70995,7 @@ var ts; } ts.updateNamespaceExport = updateNamespaceExport; function createNamedImports(elements) { - var node = createSynthesizedNode(257 /* NamedImports */); + var node = createSynthesizedNode(258 /* NamedImports */); node.elements = createNodeArray(elements); return node; } @@ -70608,7 +71007,7 @@ var ts; } ts.updateNamedImports = updateNamedImports; function createImportSpecifier(propertyName, name) { - var node = createSynthesizedNode(258 /* ImportSpecifier */); + var node = createSynthesizedNode(259 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; return node; @@ -70622,7 +71021,7 @@ var ts; } ts.updateImportSpecifier = updateImportSpecifier; function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createSynthesizedNode(259 /* ExportAssignment */); + var node = createSynthesizedNode(260 /* ExportAssignment */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -70640,7 +71039,7 @@ var ts; ts.updateExportAssignment = updateExportAssignment; function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(260 /* ExportDeclaration */); + var node = createSynthesizedNode(261 /* ExportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isTypeOnly = isTypeOnly; @@ -70665,7 +71064,7 @@ var ts; } ts.createEmptyExports = createEmptyExports; function createNamedExports(elements) { - var node = createSynthesizedNode(261 /* NamedExports */); + var node = createSynthesizedNode(262 /* NamedExports */); node.elements = createNodeArray(elements); return node; } @@ -70677,7 +71076,7 @@ var ts; } ts.updateNamedExports = updateNamedExports; function createExportSpecifier(propertyName, name) { - var node = createSynthesizedNode(263 /* ExportSpecifier */); + var node = createSynthesizedNode(264 /* ExportSpecifier */); node.propertyName = asName(propertyName); node.name = asName(name); return node; @@ -70692,7 +71091,7 @@ var ts; ts.updateExportSpecifier = updateExportSpecifier; // Module references function createExternalModuleReference(expression) { - var node = createSynthesizedNode(265 /* ExternalModuleReference */); + var node = createSynthesizedNode(266 /* ExternalModuleReference */); node.expression = expression; return node; } @@ -70706,14 +71105,14 @@ var ts; // JSDoc /* @internal */ function createJSDocTypeExpression(type) { - var node = createSynthesizedNode(294 /* JSDocTypeExpression */); + var node = createSynthesizedNode(295 /* JSDocTypeExpression */); node.type = type; return node; } ts.createJSDocTypeExpression = createJSDocTypeExpression; /* @internal */ function createJSDocTypeTag(typeExpression, comment) { - var tag = createJSDocTag(320 /* JSDocTypeTag */, "type"); + var tag = createJSDocTag(321 /* JSDocTypeTag */, "type"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -70721,7 +71120,7 @@ var ts; ts.createJSDocTypeTag = createJSDocTypeTag; /* @internal */ function createJSDocReturnTag(typeExpression, comment) { - var tag = createJSDocTag(318 /* JSDocReturnTag */, "returns"); + var tag = createJSDocTag(319 /* JSDocReturnTag */, "returns"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -70729,14 +71128,14 @@ var ts; ts.createJSDocReturnTag = createJSDocReturnTag; /** @internal */ function createJSDocThisTag(typeExpression) { - var tag = createJSDocTag(319 /* JSDocThisTag */, "this"); + var tag = createJSDocTag(320 /* JSDocThisTag */, "this"); tag.typeExpression = typeExpression; return tag; } ts.createJSDocThisTag = createJSDocThisTag; /* @internal */ function createJSDocParamTag(name, isBracketed, typeExpression, comment) { - var tag = createJSDocTag(317 /* JSDocParameterTag */, "param"); + var tag = createJSDocTag(318 /* JSDocParameterTag */, "param"); tag.typeExpression = typeExpression; tag.name = name; tag.isBracketed = isBracketed; @@ -70746,7 +71145,7 @@ var ts; ts.createJSDocParamTag = createJSDocParamTag; /* @internal */ function createJSDocComment(comment, tags) { - var node = createSynthesizedNode(303 /* JSDocComment */); + var node = createSynthesizedNode(304 /* JSDocComment */); node.comment = comment; node.tags = tags; return node; @@ -70760,7 +71159,7 @@ var ts; } // JSX function createJsxElement(openingElement, children, closingElement) { - var node = createSynthesizedNode(266 /* JsxElement */); + var node = createSynthesizedNode(267 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -70776,7 +71175,7 @@ var ts; } ts.updateJsxElement = updateJsxElement; function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(267 /* JsxSelfClosingElement */); + var node = createSynthesizedNode(268 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -70792,7 +71191,7 @@ var ts; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; function createJsxOpeningElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(268 /* JsxOpeningElement */); + var node = createSynthesizedNode(269 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -70808,7 +71207,7 @@ var ts; } ts.updateJsxOpeningElement = updateJsxOpeningElement; function createJsxClosingElement(tagName) { - var node = createSynthesizedNode(269 /* JsxClosingElement */); + var node = createSynthesizedNode(270 /* JsxClosingElement */); node.tagName = tagName; return node; } @@ -70820,7 +71219,7 @@ var ts; } ts.updateJsxClosingElement = updateJsxClosingElement; function createJsxFragment(openingFragment, children, closingFragment) { - var node = createSynthesizedNode(270 /* JsxFragment */); + var node = createSynthesizedNode(271 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -70842,11 +71241,11 @@ var ts; } ts.updateJsxText = updateJsxText; function createJsxOpeningFragment() { - return createSynthesizedNode(271 /* JsxOpeningFragment */); + return createSynthesizedNode(272 /* JsxOpeningFragment */); } ts.createJsxOpeningFragment = createJsxOpeningFragment; function createJsxJsxClosingFragment() { - return createSynthesizedNode(272 /* JsxClosingFragment */); + return createSynthesizedNode(273 /* JsxClosingFragment */); } ts.createJsxJsxClosingFragment = createJsxJsxClosingFragment; function updateJsxFragment(node, openingFragment, children, closingFragment) { @@ -70858,7 +71257,7 @@ var ts; } ts.updateJsxFragment = updateJsxFragment; function createJsxAttribute(name, initializer) { - var node = createSynthesizedNode(273 /* JsxAttribute */); + var node = createSynthesizedNode(274 /* JsxAttribute */); node.name = name; node.initializer = initializer; return node; @@ -70872,7 +71271,7 @@ var ts; } ts.updateJsxAttribute = updateJsxAttribute; function createJsxAttributes(properties) { - var node = createSynthesizedNode(274 /* JsxAttributes */); + var node = createSynthesizedNode(275 /* JsxAttributes */); node.properties = createNodeArray(properties); return node; } @@ -70884,7 +71283,7 @@ var ts; } ts.updateJsxAttributes = updateJsxAttributes; function createJsxSpreadAttribute(expression) { - var node = createSynthesizedNode(275 /* JsxSpreadAttribute */); + var node = createSynthesizedNode(276 /* JsxSpreadAttribute */); node.expression = expression; return node; } @@ -70896,7 +71295,7 @@ var ts; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; function createJsxExpression(dotDotDotToken, expression) { - var node = createSynthesizedNode(276 /* JsxExpression */); + var node = createSynthesizedNode(277 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; @@ -70910,7 +71309,7 @@ var ts; ts.updateJsxExpression = updateJsxExpression; // Clauses function createCaseClause(expression, statements) { - var node = createSynthesizedNode(277 /* CaseClause */); + var node = createSynthesizedNode(278 /* CaseClause */); node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; @@ -70924,7 +71323,7 @@ var ts; } ts.updateCaseClause = updateCaseClause; function createDefaultClause(statements) { - var node = createSynthesizedNode(278 /* DefaultClause */); + var node = createSynthesizedNode(279 /* DefaultClause */); node.statements = createNodeArray(statements); return node; } @@ -70936,7 +71335,7 @@ var ts; } ts.updateDefaultClause = updateDefaultClause; function createHeritageClause(token, types) { - var node = createSynthesizedNode(279 /* HeritageClause */); + var node = createSynthesizedNode(280 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); return node; @@ -70949,7 +71348,7 @@ var ts; } ts.updateHeritageClause = updateHeritageClause; function createCatchClause(variableDeclaration, block) { - var node = createSynthesizedNode(280 /* CatchClause */); + var node = createSynthesizedNode(281 /* CatchClause */); node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -70964,7 +71363,7 @@ var ts; ts.updateCatchClause = updateCatchClause; // Property assignments function createPropertyAssignment(name, initializer) { - var node = createSynthesizedNode(281 /* PropertyAssignment */); + var node = createSynthesizedNode(282 /* PropertyAssignment */); node.name = asName(name); node.questionToken = undefined; node.initializer = ts.parenthesizeExpressionForList(initializer); @@ -70979,7 +71378,7 @@ var ts; } ts.updatePropertyAssignment = updatePropertyAssignment; function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createSynthesizedNode(282 /* ShorthandPropertyAssignment */); + var node = createSynthesizedNode(283 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; @@ -70993,7 +71392,7 @@ var ts; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; function createSpreadAssignment(expression) { - var node = createSynthesizedNode(283 /* SpreadAssignment */); + var node = createSynthesizedNode(284 /* SpreadAssignment */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -71006,7 +71405,7 @@ var ts; ts.updateSpreadAssignment = updateSpreadAssignment; // Enum function createEnumMember(name, initializer) { - var node = createSynthesizedNode(284 /* EnumMember */); + var node = createSynthesizedNode(285 /* EnumMember */); node.name = asName(name); node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); return node; @@ -71027,7 +71426,7 @@ var ts; (typeReferences !== undefined && node.typeReferenceDirectives !== typeReferences) || (libReferences !== undefined && node.libReferenceDirectives !== libReferences) || (hasNoDefaultLib !== undefined && node.hasNoDefaultLib !== hasNoDefaultLib)) { - var updated = createSynthesizedNode(290 /* SourceFile */); + var updated = createSynthesizedNode(291 /* SourceFile */); updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; @@ -71111,7 +71510,7 @@ var ts; * @param original The original statement. */ function createNotEmittedStatement(original) { - var node = createSynthesizedNode(325 /* NotEmittedStatement */); + var node = createSynthesizedNode(326 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; @@ -71123,7 +71522,7 @@ var ts; */ /* @internal */ function createEndOfDeclarationMarker(original) { - var node = createSynthesizedNode(329 /* EndOfDeclarationMarker */); + var node = createSynthesizedNode(330 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -71135,7 +71534,7 @@ var ts; */ /* @internal */ function createMergeDeclarationMarker(original) { - var node = createSynthesizedNode(328 /* MergeDeclarationMarker */); + var node = createSynthesizedNode(329 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -71150,7 +71549,7 @@ var ts; * @param location The location for the expression. Defaults to the positions from "original" if provided. */ function createPartiallyEmittedExpression(expression, original) { - var node = createSynthesizedNode(326 /* PartiallyEmittedExpression */); + var node = createSynthesizedNode(327 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; setTextRange(node, original); @@ -71166,7 +71565,7 @@ var ts; ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; function flattenCommaElements(node) { if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { - if (node.kind === 327 /* CommaListExpression */) { + if (node.kind === 328 /* CommaListExpression */) { return node.elements; } if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) { @@ -71176,7 +71575,7 @@ var ts; return node; } function createCommaList(elements) { - var node = createSynthesizedNode(327 /* CommaListExpression */); + var node = createSynthesizedNode(328 /* CommaListExpression */); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); return node; } @@ -71189,7 +71588,7 @@ var ts; ts.updateCommaList = updateCommaList; /* @internal */ function createSyntheticReferenceExpression(expression, thisArg) { - var node = createSynthesizedNode(330 /* SyntheticReferenceExpression */); + var node = createSynthesizedNode(331 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; return node; @@ -71205,7 +71604,7 @@ var ts; ts.updateSyntheticReferenceExpression = updateSyntheticReferenceExpression; function createBundle(sourceFiles, prepends) { if (prepends === void 0) { prepends = ts.emptyArray; } - var node = ts.createNode(291 /* Bundle */); + var node = ts.createNode(292 /* Bundle */); node.prepends = prepends; node.sourceFiles = sourceFiles; return node; @@ -71240,7 +71639,7 @@ var ts; ], function (helper) { return helper.name; })); } function createUnparsedSource() { - var node = ts.createNode(292 /* UnparsedSource */); + var node = ts.createNode(293 /* UnparsedSource */); node.prologues = ts.emptyArray; node.referencedFiles = ts.emptyArray; node.libReferenceDirectives = ts.emptyArray; @@ -71375,10 +71774,10 @@ var ts; } function mapBundleFileSectionKindToSyntaxKind(kind) { switch (kind) { - case "prologue" /* Prologue */: return 285 /* UnparsedPrologue */; - case "prepend" /* Prepend */: return 286 /* UnparsedPrepend */; - case "internal" /* Internal */: return 288 /* UnparsedInternalText */; - case "text" /* Text */: return 287 /* UnparsedText */; + case "prologue" /* Prologue */: return 286 /* UnparsedPrologue */; + case "prepend" /* Prepend */: return 287 /* UnparsedPrepend */; + case "internal" /* Internal */: return 289 /* UnparsedInternalText */; + case "text" /* Text */: return 288 /* UnparsedText */; case "emitHelpers" /* EmitHelpers */: case "no-default-lib" /* NoDefaultLib */: case "reference" /* Reference */: @@ -71396,14 +71795,14 @@ var ts; return node; } function createUnparsedSyntheticReference(section, parent) { - var node = ts.createNode(289 /* UnparsedSyntheticReference */, section.pos, section.end); + var node = ts.createNode(290 /* UnparsedSyntheticReference */, section.pos, section.end); node.parent = parent; node.data = section.data; node.section = section; return node; } function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapTextOrBuildInfoPath, javascriptPath, declarationPath, buildInfoPath, buildInfo, oldFileOfCurrentEmit) { - var node = ts.createNode(293 /* InputFiles */); + var node = ts.createNode(294 /* InputFiles */); if (!ts.isString(javascriptTextOrReadFileText)) { var cache_1 = ts.createMap(); var textGetter_1 = function (path) { @@ -71600,7 +71999,7 @@ var ts; // To avoid holding onto transformation artifacts, we keep track of any // parse tree node we are annotating. This allows us to clean them up after // all transformations have completed. - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node))); @@ -72141,7 +72540,7 @@ var ts; if (!outermostLabeledStatement) { return node; } - var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 238 /* LabeledStatement */ + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 239 /* LabeledStatement */ ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node); if (afterRestoreLabelCallback) { @@ -72160,13 +72559,13 @@ var ts; case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: return false; - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -72193,7 +72592,7 @@ var ts; } else { switch (callee.kind) { - case 194 /* PropertyAccessExpression */: { + case 195 /* PropertyAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a.b()` target is `(_a = a).b` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -72206,7 +72605,7 @@ var ts; } break; } - case 195 /* ElementAccessExpression */: { + case 196 /* ElementAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -72266,14 +72665,14 @@ var ts; ts.Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); } switch (property.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return createExpressionForAccessorDeclaration(node.properties, property, receiver, !!node.multiLine); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return createExpressionForPropertyAssignment(property, receiver); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return createExpressionForMethodDeclaration(property, receiver); } } @@ -72599,7 +72998,7 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 200 /* ParenthesizedExpression */) { + if (skipped.kind === 201 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -72633,10 +73032,10 @@ var ts; // // If `a ** d` is on the left of operator `**`, we need to parenthesize to preserve // the intended order of operations: `(a ** b) ** c` - var binaryOperatorPrecedence = ts.getOperatorPrecedence(209 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(209 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(210 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(210 /* BinaryExpression */, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 202 /* ArrowFunction */ && binaryOperatorPrecedence > 3) { + if (!isLeftSideOfBinary && operand.kind === 203 /* ArrowFunction */ && binaryOperatorPrecedence > 3) { // We need to parenthesize arrow functions on the right side to avoid it being // parsed as parenthesized expression: `a && (() => {})` return true; @@ -72648,7 +73047,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 212 /* YieldExpression */) { + && operand.kind === 213 /* YieldExpression */) { return false; } return true; @@ -72736,7 +73135,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { + if (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -72749,7 +73148,7 @@ var ts; return 0 /* Unknown */; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(210 /* ConditionalExpression */, 57 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(211 /* ConditionalExpression */, 57 /* QuestionToken */); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) { @@ -72784,8 +73183,8 @@ var ts; var needsParens = isCommaSequence(check); if (!needsParens) { switch (getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) { - case 214 /* ClassExpression */: - case 201 /* FunctionExpression */: + case 215 /* ClassExpression */: + case 202 /* FunctionExpression */: needsParens = true; } } @@ -72801,9 +73200,9 @@ var ts; function parenthesizeForNew(expression) { var leftmostExpr = getLeftmostExpression(expression, /*stopAtCallExpressions*/ true); switch (leftmostExpr.kind) { - case 196 /* CallExpression */: + case 197 /* CallExpression */: return ts.createParen(expression); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return !leftmostExpr.arguments ? ts.createParen(expression) : expression; @@ -72826,7 +73225,7 @@ var ts; // var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 197 /* NewExpression */ || emittedExpression.arguments)) { + && (emittedExpression.kind !== 198 /* NewExpression */ || emittedExpression.arguments)) { return expression; } return ts.setTextRange(ts.createParen(expression), expression); @@ -72864,7 +73263,7 @@ var ts; function parenthesizeExpressionForList(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(209 /* BinaryExpression */, 27 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(210 /* BinaryExpression */, 27 /* CommaToken */); return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(ts.createParen(expression), expression); @@ -72875,29 +73274,29 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 201 /* FunctionExpression */ || kind === 202 /* ArrowFunction */) { + if (kind === 202 /* FunctionExpression */ || kind === 203 /* ArrowFunction */) { var mutableCall = ts.getMutableClone(emittedExpression); mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); return recreateOuterExpressions(expression, mutableCall, 4 /* PartiallyEmittedExpressions */); } } var leftmostExpressionKind = getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind; - if (leftmostExpressionKind === 193 /* ObjectLiteralExpression */ || leftmostExpressionKind === 201 /* FunctionExpression */) { + if (leftmostExpressionKind === 194 /* ObjectLiteralExpression */ || leftmostExpressionKind === 202 /* FunctionExpression */) { return ts.setTextRange(ts.createParen(expression), expression); } return expression; } ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; function parenthesizeConditionalTypeMember(member) { - return member.kind === 180 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; + return member.kind === 181 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; } ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember; function parenthesizeElementTypeMember(member) { switch (member.kind) { - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: return ts.createParenthesizedType(member); } return parenthesizeConditionalTypeMember(member); @@ -72905,9 +73304,9 @@ var ts; ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember; function parenthesizeArrayTypeMember(member) { switch (member.kind) { - case 172 /* TypeQuery */: - case 184 /* TypeOperator */: - case 181 /* InferType */: + case 173 /* TypeQuery */: + case 185 /* TypeOperator */: + case 182 /* InferType */: return ts.createParenthesizedType(member); } return parenthesizeElementTypeMember(member); @@ -72933,28 +73332,28 @@ var ts; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: node = node.operand; continue; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: node = node.left; continue; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: node = node.condition; continue; - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: node = node.tag; continue; - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 217 /* AsExpression */: - case 195 /* ElementAccessExpression */: - case 194 /* PropertyAccessExpression */: - case 218 /* NonNullExpression */: - case 326 /* PartiallyEmittedExpression */: + case 218 /* AsExpression */: + case 196 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 219 /* NonNullExpression */: + case 327 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -72963,15 +73362,15 @@ var ts; } ts.getLeftmostExpression = getLeftmostExpression; function parenthesizeConciseBody(body) { - if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 193 /* ObjectLiteralExpression */)) { + if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 194 /* ObjectLiteralExpression */)) { return ts.setTextRange(ts.createParen(body), body); } return body; } ts.parenthesizeConciseBody = parenthesizeConciseBody; function isCommaSequence(node) { - return node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || - node.kind === 327 /* CommaListExpression */; + return node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || + node.kind === 328 /* CommaListExpression */; } ts.isCommaSequence = isCommaSequence; var OuterExpressionKinds; @@ -72984,13 +73383,13 @@ var ts; function isOuterExpression(node, kinds) { if (kinds === void 0) { kinds = 7 /* All */; } switch (node.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return (kinds & 1 /* Parentheses */) !== 0; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: - case 218 /* NonNullExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: + case 219 /* NonNullExpression */: return (kinds & 2 /* Assertions */) !== 0; - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: return (kinds & 4 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -73015,7 +73414,7 @@ var ts; } ts.skipOuterExpressions = skipOuterExpressions; function skipAssertions(node) { - while (ts.isAssertionExpression(node) || node.kind === 218 /* NonNullExpression */) { + while (ts.isAssertionExpression(node) || node.kind === 219 /* NonNullExpression */) { node = node.expression; } return node; @@ -73023,11 +73422,11 @@ var ts; ts.skipAssertions = skipAssertions; function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 200 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); - case 199 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 217 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); - case 218 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); - case 326 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); + case 201 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); + case 200 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 218 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); + case 219 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); + case 327 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); } } /** @@ -73045,7 +73444,7 @@ var ts; * the containing expression is created/updated. */ function isIgnorableParen(node) { - return node.kind === 200 /* ParenthesizedExpression */ + return node.kind === 201 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node) && ts.nodeIsSynthesized(ts.getSourceMapRange(node)) && ts.nodeIsSynthesized(ts.getCommentRange(node)) @@ -73163,10 +73562,10 @@ var ts; var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 254 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 255 /* ImportDeclaration */ && node.importClause) { return ts.getGeneratedNameForNode(node); } - if (node.kind === 260 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 261 /* ExportDeclaration */ && node.moduleSpecifier) { return ts.getGeneratedNameForNode(node); } return undefined; @@ -73285,7 +73684,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -73297,11 +73696,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -73333,12 +73732,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 156 /* Parameter */: - case 191 /* BindingElement */: + case 157 /* Parameter */: + case 192 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 213 /* SpreadElement */: - case 283 /* SpreadAssignment */: + case 214 /* SpreadElement */: + case 284 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -73356,7 +73755,7 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 191 /* BindingElement */: + case 192 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -73371,7 +73770,7 @@ var ts; : propertyName; } break; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -73386,7 +73785,7 @@ var ts; : propertyName; } break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` if (bindingElement.name && ts.isPrivateIdentifier(bindingElement.name)) { return ts.Debug.failBadSyntaxKind(bindingElement.name); @@ -73409,13 +73808,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: - case 192 /* ArrayLiteralExpression */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: + case 193 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -73455,11 +73854,11 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 190 /* ArrayBindingPattern */: - case 192 /* ArrayLiteralExpression */: + case 191 /* ArrayBindingPattern */: + case 193 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 189 /* ObjectBindingPattern */: - case 193 /* ObjectLiteralExpression */: + case 190 /* ObjectBindingPattern */: + case 194 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -73618,289 +74017,289 @@ var ts; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 152 /* LastToken */) || kind === 183 /* ThisType */) { + if ((kind > 0 /* FirstToken */ && kind <= 153 /* LastToken */) || kind === 184 /* ThisType */) { return node; } switch (kind) { // Names case 75 /* Identifier */: return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); // Signature elements - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); - case 156 /* Parameter */: + case 157 /* Parameter */: return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 157 /* Decorator */: + case 158 /* Decorator */: return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); // Type elements - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), // QuestionToken and ExclamationToken is uniqued in Property Declaration and the signature of 'updateProperty' is that too visitNode(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 160 /* MethodSignature */: + case 161 /* MethodSignature */: return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 162 /* Constructor */: + case 163 /* Constructor */: return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 165 /* CallSignature */: + case 166 /* CallSignature */: return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); // Types - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return ts.updateTypePredicateNodeWithModifier(node, visitNode(node.assertsModifier, visitor), visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 170 /* FunctionType */: + case 171 /* FunctionType */: return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 171 /* ConstructorType */: + case 172 /* ConstructorType */: return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 174 /* ArrayType */: + case 175 /* ArrayType */: return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); - case 175 /* TupleType */: + case 176 /* TupleType */: return ts.updateTupleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); - case 176 /* OptionalType */: + case 177 /* OptionalType */: return ts.updateOptionalTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 177 /* RestType */: + case 178 /* RestType */: return ts.updateRestTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 178 /* UnionType */: + case 179 /* UnionType */: return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 179 /* IntersectionType */: + case 180 /* IntersectionType */: return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode)); - case 181 /* InferType */: + case 182 /* InferType */: return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); - case 188 /* ImportType */: + case 189 /* ImportType */: return ts.updateImportTypeNode(node, visitNode(node.argument, visitor, ts.isTypeNode), visitNode(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf); - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 184 /* TypeOperator */: + case 185 /* TypeOperator */: return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); - case 186 /* MappedType */: + case 187 /* MappedType */: return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 187 /* LiteralType */: + case 188 /* LiteralType */: return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); // Binding patterns - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); // Expression - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: if (node.flags & 32 /* OptionalChain */) { - return ts.updatePropertyAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, visitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier)); + return ts.updatePropertyAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier)); } return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifierOrPrivateIdentifier)); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: if (node.flags & 32 /* OptionalChain */) { - return ts.updateElementAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, visitor, ts.isToken), visitNode(node.argumentExpression, visitor, ts.isExpression)); + return ts.updateElementAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.argumentExpression, visitor, ts.isExpression)); } return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { - return ts.updateCallChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, visitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + return ts.updateCallChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); } return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 202 /* ArrowFunction */: - return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, visitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); - case 203 /* DeleteExpression */: + case 203 /* ArrowFunction */: + return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, tokenVisitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); + case 204 /* DeleteExpression */: return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 209 /* BinaryExpression */: - return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, visitor, ts.isToken)); - case 210 /* ConditionalExpression */: - return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, visitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 211 /* TemplateExpression */: + case 210 /* BinaryExpression */: + return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, tokenVisitor, ts.isToken)); + case 211 /* ConditionalExpression */: + return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, tokenVisitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); + case 212 /* TemplateExpression */: return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 217 /* AsExpression */: + case 218 /* AsExpression */: return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); // Misc - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 223 /* Block */: + case 224 /* Block */: return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return ts.updateExpressionStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 232 /* ForOfStatement */: - return ts.updateForOf(node, visitNode(node.awaitModifier, visitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 233 /* ContinueStatement */: + case 233 /* ForOfStatement */: + return ts.updateForOf(node, visitNode(node.awaitModifier, tokenVisitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 234 /* ContinueStatement */: return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 234 /* BreakStatement */: + case 235 /* BreakStatement */: return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ts.updateTypeScriptVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings), node.isTypeOnly); - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: return ts.updateNamespaceExport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 257 /* NamedImports */: + case 258 /* NamedImports */: return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExportBindings), visitNode(node.moduleSpecifier, visitor, ts.isExpression), node.isTypeOnly); - case 261 /* NamedExports */: + case 262 /* NamedExports */: return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); // Module references - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); // JSX - case 266 /* JsxElement */: + case 267 /* JsxElement */: return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 268 /* JsxOpeningElement */: + case 269 /* JsxOpeningElement */: return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 275 /* JsxSpreadAttribute */: + case 276 /* JsxSpreadAttribute */: return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Clauses - case 277 /* CaseClause */: + case 278 /* CaseClause */: return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); // Property assignments - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); // Enum - case 284 /* EnumMember */: + case 285 /* EnumMember */: return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 290 /* SourceFile */: + case 291 /* SourceFile */: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: // No need to visit nodes with no children. @@ -73943,58 +74342,58 @@ var ts; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 152 /* LastToken */)) { + if ((kind > 0 /* FirstToken */ && kind <= 153 /* LastToken */)) { return initial; } // We do not yet support types. - if ((kind >= 168 /* TypePredicate */ && kind <= 187 /* LiteralType */)) { + if ((kind >= 169 /* TypePredicate */ && kind <= 188 /* LiteralType */)) { return initial; } var result = initial; switch (node.kind) { // Leaf nodes - case 222 /* SemicolonClassElement */: - case 224 /* EmptyStatement */: - case 215 /* OmittedExpression */: - case 241 /* DebuggerStatement */: - case 325 /* NotEmittedStatement */: + case 223 /* SemicolonClassElement */: + case 225 /* EmptyStatement */: + case 216 /* OmittedExpression */: + case 242 /* DebuggerStatement */: + case 326 /* NotEmittedStatement */: // No need to visit nodes with no children. break; // Names - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: result = reduceNode(node.expression, cbNode, result); break; // Signature elements - case 156 /* Parameter */: + case 157 /* Parameter */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 157 /* Decorator */: + case 158 /* Decorator */: result = reduceNode(node.expression, cbNode, result); break; // Type member - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.questionToken, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74003,12 +74402,12 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 162 /* Constructor */: + case 163 /* Constructor */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74016,7 +74415,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74024,50 +74423,50 @@ var ts; result = reduceNode(node.body, cbNode, result); break; // Binding patterns - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: result = reduceNodes(node.elements, cbNodes, result); break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Expression - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: result = reduceNodes(node.elements, cbNodes, result); break; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: result = reduceNodes(node.properties, cbNodes, result); break; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.argumentExpression, cbNode, result); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 197 /* NewExpression */: + case 198 /* NewExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: result = reduceNode(node.tag, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNode(node.template, cbNode, result); break; - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: result = reduceNode(node.type, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -74075,123 +74474,123 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 200 /* ParenthesizedExpression */: - case 203 /* DeleteExpression */: - case 204 /* TypeOfExpression */: - case 205 /* VoidExpression */: - case 206 /* AwaitExpression */: - case 212 /* YieldExpression */: - case 213 /* SpreadElement */: - case 218 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: + case 204 /* DeleteExpression */: + case 205 /* TypeOfExpression */: + case 206 /* VoidExpression */: + case 207 /* AwaitExpression */: + case 213 /* YieldExpression */: + case 214 /* SpreadElement */: + case 219 /* NonNullExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: result = reduceNode(node.operand, cbNode, result); break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; - case 217 /* AsExpression */: + case 218 /* AsExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.type, cbNode, result); break; // Misc - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; // Element - case 223 /* Block */: + case 224 /* Block */: result = reduceNodes(node.statements, cbNodes, result); break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 227 /* IfStatement */: + case 228 /* IfStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 228 /* DoStatement */: + case 229 /* DoStatement */: result = reduceNode(node.statement, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 229 /* WhileStatement */: - case 236 /* WithStatement */: + case 230 /* WhileStatement */: + case 237 /* WithStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 230 /* ForStatement */: + case 231 /* ForStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 235 /* ReturnStatement */: - case 239 /* ThrowStatement */: + case 236 /* ReturnStatement */: + case 240 /* ThrowStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 240 /* TryStatement */: + case 241 /* TryStatement */: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: result = reduceNodes(node.declarations, cbNodes, result); break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74200,7 +74599,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74208,143 +74607,143 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.members, cbNodes, result); break; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: result = reduceNodes(node.statements, cbNodes, result); break; - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: result = reduceNodes(node.clauses, cbNodes, result); break; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.moduleReference, cbNode, result); break; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 255 /* ImportClause */: + case 256 /* ImportClause */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: result = reduceNode(node.name, cbNode, result); break; - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: result = reduceNode(node.name, cbNode, result); break; - case 257 /* NamedImports */: - case 261 /* NamedExports */: + case 258 /* NamedImports */: + case 262 /* NamedExports */: result = reduceNodes(node.elements, cbNodes, result); break; - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; // Module references - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: result = reduceNode(node.expression, cbNode, result); break; // JSX - case 266 /* JsxElement */: + case 267 /* JsxElement */: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: result = reduceNode(node.openingFragment, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingFragment, cbNode, result); break; - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: result = reduceNode(node.tagName, cbNode, result); result = reduceNodes(node.typeArguments, cbNode, result); result = reduceNode(node.attributes, cbNode, result); break; - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: result = reduceNodes(node.properties, cbNodes, result); break; - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: result = reduceNode(node.tagName, cbNode, result); break; - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 275 /* JsxSpreadAttribute */: + case 276 /* JsxSpreadAttribute */: result = reduceNode(node.expression, cbNode, result); break; - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: result = reduceNode(node.expression, cbNode, result); break; // Clauses - case 277 /* CaseClause */: + case 278 /* CaseClause */: result = reduceNode(node.expression, cbNode, result); // falls through - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: result = reduceNodes(node.statements, cbNodes, result); break; - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: result = reduceNodes(node.types, cbNodes, result); break; - case 280 /* CatchClause */: + case 281 /* CatchClause */: result = reduceNode(node.variableDeclaration, cbNode, result); result = reduceNode(node.block, cbNode, result); break; // Property assignments - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: result = reduceNode(node.expression, cbNode, result); break; // Enum - case 284 /* EnumMember */: + case 285 /* EnumMember */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Top-level nodes - case 290 /* SourceFile */: + case 291 /* SourceFile */: result = reduceNodes(node.statements, cbNodes, result); break; // Transformation nodes - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: result = reduceNodes(node.elements, cbNodes, result); break; default: @@ -74417,7 +74816,7 @@ var ts; function aggregateTransformFlagsForSubtree(node) { // We do not transform ambient declarations or types, so there is no need to // recursively aggregate transform flags. - if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 216 /* ExpressionWithTypeArguments */)) { + if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 217 /* ExpressionWithTypeArguments */)) { return 0 /* None */; } // Aggregate the transform flags of each child. @@ -75091,7 +75490,7 @@ var ts; function chainBundle(transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 290 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 291 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return ts.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends); @@ -75142,7 +75541,7 @@ var ts; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" @@ -75155,13 +75554,13 @@ var ts; hasImportDefault = true; } break; - case 253 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 265 /* ExternalModuleReference */) { + case 254 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 266 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -75192,13 +75591,13 @@ var ts; } } break; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: if (ts.hasModifier(node, 1 /* Export */)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -75206,7 +75605,7 @@ var ts; } } break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default function() { } @@ -75226,7 +75625,7 @@ var ts; } } break; - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default class { } @@ -75405,7 +75804,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member) { - return member.kind === 159 /* PropertyDeclaration */ + return member.kind === 160 /* PropertyDeclaration */ && member.initializer !== undefined; } ts.isInitializedProperty = isInitializedProperty; @@ -76034,8 +76433,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(194 /* PropertyAccessExpression */); - context.enableSubstitution(195 /* ElementAccessExpression */); + context.enableSubstitution(195 /* PropertyAccessExpression */); + context.enableSubstitution(196 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -76061,14 +76460,14 @@ var ts; var applicableSubstitutions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 291 /* Bundle */) { + if (node.kind === 292 /* Bundle */) { return transformBundle(node); } return transformSourceFile(node); } function transformBundle(node) { return ts.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 293 /* InputFiles */) { + if (prepend.kind === 294 /* InputFiles */) { return ts.createUnparsedSourceFile(prepend, "js"); } return prepend; @@ -76119,16 +76518,16 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 290 /* SourceFile */: - case 251 /* CaseBlock */: - case 250 /* ModuleBlock */: - case 223 /* Block */: + case 291 /* SourceFile */: + case 252 /* CaseBlock */: + case 251 /* ModuleBlock */: + case 224 /* Block */: currentLexicalScope = node; currentNameScope = undefined; currentScopeFirstDeclarationsOfName = undefined; break; - case 245 /* ClassDeclaration */: - case 244 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 245 /* FunctionDeclaration */: if (ts.hasModifier(node, 2 /* Ambient */)) { break; } @@ -76140,7 +76539,7 @@ var ts; // These nodes should always have names unless they are default-exports; // however, class declaration parsing allows for undefined names, so syntactically invalid // programs may also have an undefined name. - ts.Debug.assert(node.kind === 245 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); + ts.Debug.assert(node.kind === 246 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); } if (ts.isClassDeclaration(node)) { // XXX: should probably also cover interfaces and type aliases that can have type variables? @@ -76183,10 +76582,10 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 259 /* ExportAssignment */: - case 260 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 260 /* ExportAssignment */: + case 261 /* ExportDeclaration */: return visitEllidableStatement(node); default: return visitorWorker(node); @@ -76207,13 +76606,13 @@ var ts; return node; } switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return visitImportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitExportAssignment(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -76233,11 +76632,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 260 /* ExportDeclaration */ || - node.kind === 254 /* ImportDeclaration */ || - node.kind === 255 /* ImportClause */ || - (node.kind === 253 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 265 /* ExternalModuleReference */)) { + if (node.kind === 261 /* ExportDeclaration */ || + node.kind === 255 /* ImportDeclaration */ || + node.kind === 256 /* ImportClause */ || + (node.kind === 254 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 266 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -76261,19 +76660,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: return visitConstructor(node); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // Property declarations are not TypeScript syntax, but they must be visited // for the decorator transformation. return visitPropertyDeclaration(node); - case 167 /* IndexSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 161 /* MethodDeclaration */: + case 168 /* IndexSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 162 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 222 /* SemicolonClassElement */: + case 223 /* SemicolonClassElement */: return node; default: return ts.Debug.failBadSyntaxKind(node); @@ -76309,62 +76708,62 @@ var ts; case 118 /* ProtectedKeyword */: case 122 /* AbstractKeyword */: case 81 /* ConstKeyword */: - case 130 /* DeclareKeyword */: - case 138 /* ReadonlyKeyword */: + case 131 /* DeclareKeyword */: + case 139 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided // falls through - case 174 /* ArrayType */: - case 175 /* TupleType */: - case 176 /* OptionalType */: - case 177 /* RestType */: - case 173 /* TypeLiteral */: - case 168 /* TypePredicate */: - case 155 /* TypeParameter */: + case 175 /* ArrayType */: + case 176 /* TupleType */: + case 177 /* OptionalType */: + case 178 /* RestType */: + case 174 /* TypeLiteral */: + case 169 /* TypePredicate */: + case 156 /* TypeParameter */: case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 128 /* BooleanKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 137 /* NeverKeyword */: + case 149 /* UnknownKeyword */: + case 129 /* BooleanKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 138 /* NeverKeyword */: case 110 /* VoidKeyword */: - case 144 /* SymbolKeyword */: - case 171 /* ConstructorType */: - case 170 /* FunctionType */: - case 172 /* TypeQuery */: - case 169 /* TypeReference */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 180 /* ConditionalType */: - case 182 /* ParenthesizedType */: - case 183 /* ThisType */: - case 184 /* TypeOperator */: - case 185 /* IndexedAccessType */: - case 186 /* MappedType */: - case 187 /* LiteralType */: + case 145 /* SymbolKeyword */: + case 172 /* ConstructorType */: + case 171 /* FunctionType */: + case 173 /* TypeQuery */: + case 170 /* TypeReference */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 181 /* ConditionalType */: + case 183 /* ParenthesizedType */: + case 184 /* ThisType */: + case 185 /* TypeOperator */: + case 186 /* IndexedAccessType */: + case 187 /* MappedType */: + case 188 /* LiteralType */: // TypeScript type nodes are elided. // falls through - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: // TypeScript index signatures are elided. // falls through - case 157 /* Decorator */: + case 158 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. // falls through - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. return undefined; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects return visitPropertyDeclaration(node); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: // TypeScript namespace export declarations are elided. return undefined; - case 162 /* Constructor */: + case 163 /* Constructor */: return visitConstructor(node); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return ts.createNotEmittedStatement(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: // This may be a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -76374,7 +76773,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: // This may be a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -76384,35 +76783,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: // This may be a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 156 /* Parameter */: + case 157 /* Parameter */: // This may be a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -76422,35 +76821,35 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return visitCallExpression(node); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return visitNewExpression(node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); default: @@ -76863,12 +77262,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -77021,7 +77420,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 159 /* PropertyDeclaration */ + ? member.kind === 160 /* PropertyDeclaration */ // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it // should not invoke `Object.getOwnPropertyDescriptor`. ? ts.createVoidZero() @@ -77144,10 +77543,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */ - || kind === 159 /* PropertyDeclaration */; + return kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */ + || kind === 160 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -77157,7 +77556,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 161 /* MethodDeclaration */; + return node.kind === 162 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -77168,12 +77567,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return true; } return false; @@ -77190,15 +77589,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 159 /* PropertyDeclaration */: - case 156 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 157 /* Parameter */: return serializeTypeNode(node.type); - case 164 /* SetAccessor */: - case 163 /* GetAccessor */: + case 165 /* SetAccessor */: + case 164 /* GetAccessor */: return serializeTypeNode(getAccessorTypeNode(node)); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 161 /* MethodDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 162 /* MethodDeclaration */: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); @@ -77235,7 +77634,7 @@ var ts; return ts.createArrayLiteral(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 163 /* GetAccessor */) { + if (container && node.kind === 164 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -77281,30 +77680,30 @@ var ts; } switch (node.kind) { case 110 /* VoidKeyword */: - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: case 100 /* NullKeyword */: - case 137 /* NeverKeyword */: + case 138 /* NeverKeyword */: return ts.createVoidZero(); - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: return ts.createIdentifier("Function"); - case 174 /* ArrayType */: - case 175 /* TupleType */: + case 175 /* ArrayType */: + case 176 /* TupleType */: return ts.createIdentifier("Array"); - case 168 /* TypePredicate */: - case 128 /* BooleanKeyword */: + case 169 /* TypePredicate */: + case 129 /* BooleanKeyword */: return ts.createIdentifier("Boolean"); - case 143 /* StringKeyword */: + case 144 /* StringKeyword */: return ts.createIdentifier("String"); - case 141 /* ObjectKeyword */: + case 142 /* ObjectKeyword */: return ts.createIdentifier("Object"); - case 187 /* LiteralType */: + case 188 /* LiteralType */: switch (node.literal.kind) { case 10 /* StringLiteral */: return ts.createIdentifier("String"); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: case 8 /* NumericLiteral */: return ts.createIdentifier("Number"); case 9 /* BigIntLiteral */: @@ -77315,34 +77714,34 @@ var ts; default: return ts.Debug.failBadSyntaxKind(node.literal); } - case 140 /* NumberKeyword */: + case 141 /* NumberKeyword */: return ts.createIdentifier("Number"); - case 151 /* BigIntKeyword */: + case 152 /* BigIntKeyword */: return getGlobalBigIntNameWithFallback(); - case 144 /* SymbolKeyword */: + case 145 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return serializeTypeReferenceNode(node); - case 179 /* IntersectionType */: - case 178 /* UnionType */: + case 180 /* IntersectionType */: + case 179 /* UnionType */: return serializeTypeList(node.types); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return serializeTypeList([node.trueType, node.falseType]); - case 184 /* TypeOperator */: - if (node.operator === 138 /* ReadonlyKeyword */) { + case 185 /* TypeOperator */: + if (node.operator === 139 /* ReadonlyKeyword */) { return serializeTypeNode(node.type); } break; - case 172 /* TypeQuery */: - case 185 /* IndexedAccessType */: - case 186 /* MappedType */: - case 173 /* TypeLiteral */: + case 173 /* TypeQuery */: + case 186 /* IndexedAccessType */: + case 187 /* MappedType */: + case 174 /* TypeLiteral */: case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 183 /* ThisType */: - case 188 /* ImportType */: + case 149 /* UnknownKeyword */: + case 184 /* ThisType */: + case 189 /* ImportType */: break; default: return ts.Debug.failBadSyntaxKind(node); @@ -77355,13 +77754,13 @@ var ts; var serializedUnion; for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { var typeNode = types_20[_i]; - while (typeNode.kind === 182 /* ParenthesizedType */) { + while (typeNode.kind === 183 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 137 /* NeverKeyword */) { + if (typeNode.kind === 138 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 146 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 147 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var serializedIndividual = serializeTypeNode(typeNode); @@ -77470,7 +77869,7 @@ var ts; name.original = undefined; name.parent = ts.getParseTreeNode(currentLexicalScope); // ensure the parent is set to a parse tree node. return name; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return serializeQualifiedNameAsExpression(node); } } @@ -78030,12 +78429,12 @@ var ts; // enums in any other scope are emitted as a `let` declaration. var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)) - ], currentLexicalScope.kind === 290 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); + ], currentLexicalScope.kind === 291 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 248 /* EnumDeclaration */) { + if (node.kind === 249 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -78160,7 +78559,7 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 250 /* ModuleBlock */) { + if (body.kind === 251 /* ModuleBlock */) { saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; @@ -78206,13 +78605,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (body.kind !== 250 /* ModuleBlock */) { + if (body.kind !== 251 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 249 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 250 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -78262,7 +78661,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 256 /* NamespaceImport */) { + if (node.kind === 257 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -78510,16 +78909,16 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(75 /* Identifier */); - context.enableSubstitution(282 /* ShorthandPropertyAssignment */); + context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(249 /* ModuleDeclaration */); + context.enableEmitNotification(250 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 249 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 250 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 248 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 249 /* EnumDeclaration */; } /** * Hook for node emit. @@ -78580,9 +78979,9 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -78620,9 +79019,9 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 290 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 249 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 248 /* EnumDeclaration */); + if (container && container.kind !== 291 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 250 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 249 /* EnumDeclaration */); if (substitute) { return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), /*location*/ node); @@ -78773,40 +79172,40 @@ var ts; if (!(node.transformFlags & 4194304 /* ContainsClassFields */)) return node; switch (node.kind) { - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: return visitClassLike(node); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return visitPropertyAccessExpression(node); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return visitPrefixUnaryExpression(node); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return visitPostfixUnaryExpression(node, /*valueIsDiscarded*/ false); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return visitCallExpression(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node); case 76 /* PrivateIdentifier */: return visitPrivateIdentifier(node); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return visitExpressionStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); } return ts.visitEachChild(node, visitor, context); } function visitorDestructuringTarget(node) { switch (node.kind) { - case 193 /* ObjectLiteralExpression */: - case 192 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return visitAssignmentPattern(node); default: return visitor(node); @@ -78829,20 +79228,20 @@ var ts; */ function classElementVisitor(node) { switch (node.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: // Constructors for classes using class fields are transformed in // `visitClassDeclaration` or `visitClassExpression`. return undefined; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 161 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 162 /* MethodDeclaration */: // Visit the name of the member (if it's a computed property name). return ts.visitEachChild(node, classElementVisitor, context); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 222 /* SemicolonClassElement */: + case 223 /* SemicolonClassElement */: return node; default: return visitor(node); @@ -79608,31 +80007,31 @@ var ts; case 126 /* AsyncKeyword */: // ES2017 async modifier should be elided for targets < ES2017 return undefined; - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return visitAwaitExpression(node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 102 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 162 /* Constructor */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 163 /* Constructor */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -79641,27 +80040,27 @@ var ts; function asyncBodyVisitor(node) { if (ts.isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatementInAsyncBody(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatementInAsyncBody(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatementInAsyncBody(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatementInAsyncBody(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClauseInAsyncBody(node); - case 223 /* Block */: - case 237 /* SwitchStatement */: - case 251 /* CaseBlock */: - case 277 /* CaseClause */: - case 278 /* DefaultClause */: - case 240 /* TryStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 227 /* IfStatement */: - case 236 /* WithStatement */: - case 238 /* LabeledStatement */: + case 224 /* Block */: + case 238 /* SwitchStatement */: + case 252 /* CaseBlock */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: + case 241 /* TryStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 228 /* IfStatement */: + case 237 /* WithStatement */: + case 239 /* LabeledStatement */: return ts.visitEachChild(node, asyncBodyVisitor, context); default: return ts.Debug.assertNever(node, "Unhandled node."); @@ -79866,7 +80265,7 @@ var ts; var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 202 /* ArrowFunction */; + var isArrowFunction = node.kind === 203 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current @@ -79957,17 +80356,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(196 /* CallExpression */); - context.enableSubstitution(194 /* PropertyAccessExpression */); - context.enableSubstitution(195 /* ElementAccessExpression */); + context.enableSubstitution(197 /* CallExpression */); + context.enableSubstitution(195 /* PropertyAccessExpression */); + context.enableSubstitution(196 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(245 /* ClassDeclaration */); - context.enableEmitNotification(161 /* MethodDeclaration */); - context.enableEmitNotification(163 /* GetAccessor */); - context.enableEmitNotification(164 /* SetAccessor */); - context.enableEmitNotification(162 /* Constructor */); + context.enableEmitNotification(246 /* ClassDeclaration */); + context.enableEmitNotification(162 /* MethodDeclaration */); + context.enableEmitNotification(164 /* GetAccessor */); + context.enableEmitNotification(165 /* SetAccessor */); + context.enableEmitNotification(163 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(225 /* VariableStatement */); + context.enableEmitNotification(226 /* VariableStatement */); } } /** @@ -80015,11 +80414,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -80051,11 +80450,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 245 /* ClassDeclaration */ - || kind === 162 /* Constructor */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */; + return kind === 246 /* ClassDeclaration */ + || kind === 163 /* Constructor */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -80223,64 +80622,64 @@ var ts; return node; } switch (node.kind) { - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return visitAwaitExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return visitYieldExpression(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitReturnStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitLabeledStatement(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node, noDestructuringValue); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClause(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return visitVoidExpression(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return doWithLexicalThis(visitConstructorDeclaration, node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return doWithLexicalThis(visitMethodDeclaration, node); - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: return doWithLexicalThis(visitGetAccessorDeclaration, node); - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: return doWithLexicalThis(visitSetAccessorDeclaration, node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return doWithLexicalThis(visitFunctionDeclaration, node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return doWithLexicalThis(visitFunctionExpression, node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return visitArrowFunction(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return visitParameter(node); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return visitExpressionStatement(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, noDestructuringValue); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 102 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return doWithLexicalThis(visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -80314,7 +80713,7 @@ var ts; function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2 /* Async */) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 232 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 233 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node); @@ -80326,7 +80725,7 @@ var ts; var objects = []; for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { var e = elements_4[_i]; - if (e.kind === 283 /* SpreadAssignment */) { + if (e.kind === 284 /* SpreadAssignment */) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -80335,7 +80734,7 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - chunkObject = ts.append(chunkObject, e.kind === 281 /* PropertyAssignment */ + chunkObject = ts.append(chunkObject, e.kind === 282 /* PropertyAssignment */ ? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } @@ -80369,7 +80768,7 @@ var ts; // If we translate the above to `__assign({}, k, l)`, the `l` will evaluate before `k` is spread and we // end up with `{ a: 1, b: 2, c: 3 }` var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 193 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 194 /* ObjectLiteralExpression */) { objects.unshift(ts.createObjectLiteral()); } var expression = objects[0]; @@ -80747,17 +81146,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(196 /* CallExpression */); - context.enableSubstitution(194 /* PropertyAccessExpression */); - context.enableSubstitution(195 /* ElementAccessExpression */); + context.enableSubstitution(197 /* CallExpression */); + context.enableSubstitution(195 /* PropertyAccessExpression */); + context.enableSubstitution(196 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(245 /* ClassDeclaration */); - context.enableEmitNotification(161 /* MethodDeclaration */); - context.enableEmitNotification(163 /* GetAccessor */); - context.enableEmitNotification(164 /* SetAccessor */); - context.enableEmitNotification(162 /* Constructor */); + context.enableEmitNotification(246 /* ClassDeclaration */); + context.enableEmitNotification(162 /* MethodDeclaration */); + context.enableEmitNotification(164 /* GetAccessor */); + context.enableEmitNotification(165 /* SetAccessor */); + context.enableEmitNotification(163 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(225 /* VariableStatement */); + context.enableEmitNotification(226 /* VariableStatement */); } } /** @@ -80805,11 +81204,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -80841,11 +81240,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 245 /* ClassDeclaration */ - || kind === 162 /* Constructor */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */; + return kind === 246 /* ClassDeclaration */ + || kind === 163 /* Constructor */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -80943,7 +81342,7 @@ var ts; return node; } switch (node.kind) { - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -80975,21 +81374,21 @@ var ts; return node; } switch (node.kind) { - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: - case 196 /* CallExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: + case 197 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { var updated = visitOptionalExpression(node, /*captureThisArg*/ false, /*isDelete*/ false); ts.Debug.assertNotNode(updated, ts.isSyntheticReference); return updated; } return ts.visitEachChild(node, visitor, context); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (node.operatorToken.kind === 60 /* QuestionQuestionToken */) { return transformNullishCoalescingExpression(node); } return ts.visitEachChild(node, visitor, context); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return visitDeleteExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -81029,7 +81428,7 @@ var ts; thisArg = expression; } } - expression = node.kind === 194 /* PropertyAccessExpression */ + expression = node.kind === 195 /* PropertyAccessExpression */ ? ts.updatePropertyAccess(node, expression, ts.visitNode(node.name, visitor, ts.isIdentifier)) : ts.updateElementAccess(node, expression, ts.visitNode(node.argumentExpression, visitor, ts.isExpression)); return thisArg ? ts.createSyntheticReferenceExpression(expression, thisArg) : expression; @@ -81043,10 +81442,10 @@ var ts; } function visitNonOptionalExpression(node, captureThisArg, isDelete) { switch (node.kind) { - case 200 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 196 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); + case 201 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); + case 197 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); default: return ts.visitNode(node, visitor, ts.isExpression); } } @@ -81065,8 +81464,8 @@ var ts; for (var i = 0; i < chain.length; i++) { var segment = chain[i]; switch (segment.kind) { - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: if (i === chain.length - 1 && captureThisArg) { if (shouldCaptureInTempVariable(rightExpression)) { thisArg = ts.createTempVariable(hoistVariableDeclaration); @@ -81076,11 +81475,11 @@ var ts; thisArg = rightExpression; } } - rightExpression = segment.kind === 194 /* PropertyAccessExpression */ + rightExpression = segment.kind === 195 /* PropertyAccessExpression */ ? ts.createPropertyAccess(rightExpression, ts.visitNode(segment.name, visitor, ts.isIdentifier)) : ts.createElementAccess(rightExpression, ts.visitNode(segment.argumentExpression, visitor, ts.isExpression)); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (i === 0 && leftThisArg) { rightExpression = ts.createFunctionCall(rightExpression, leftThisArg.kind === 102 /* SuperKeyword */ ? ts.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression)); } @@ -81178,13 +81577,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 266 /* JsxElement */: + case 267 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ false); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -81194,13 +81593,13 @@ var ts; switch (node.kind) { case 11 /* JsxText */: return visitJsxText(node); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return visitJsxExpression(node); - case 266 /* JsxElement */: + case 267 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ true); default: return ts.Debug.failBadSyntaxKind(node); @@ -81275,7 +81674,7 @@ var ts; literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile); return ts.setTextRange(literal, node); } - else if (node.kind === 276 /* JsxExpression */) { + else if (node.kind === 277 /* JsxExpression */) { if (node.expression === undefined) { return ts.createTrue(); } @@ -81369,7 +81768,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 266 /* JsxElement */) { + if (node.kind === 267 /* JsxElement */) { return getTagName(node.openingElement); } else { @@ -81675,7 +82074,7 @@ var ts; return node; } switch (node.kind) { - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -81888,13 +82287,13 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 - && node.kind === 235 /* ReturnStatement */ + && node.kind === 236 /* ReturnStatement */ && !node.expression; } function shouldVisitNode(node) { return (node.transformFlags & 256 /* ContainsES2015 */) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 223 /* Block */))) + || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 224 /* Block */))) || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatement(node)) || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0; } @@ -81916,63 +82315,63 @@ var ts; switch (node.kind) { case 120 /* StaticKeyword */: return undefined; // elide static keyword - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return visitClassDeclaration(node); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return visitClassExpression(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return visitParameter(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return visitArrowFunction(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return visitFunctionExpression(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return visitVariableDeclaration(node); case 75 /* Identifier */: return visitIdentifier(node); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return visitSwitchStatement(node); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return visitCaseBlock(node); - case 223 /* Block */: + case 224 /* Block */: return visitBlock(node, /*isFunctionBody*/ false); - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitLabeledStatement(node); - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node, /*outermostLabeledStatement*/ undefined); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return visitExpressionStatement(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClause(node); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return visitCallExpression(node); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return visitNewExpression(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 14 /* NoSubstitutionTemplateLiteral */: case 15 /* TemplateHead */: @@ -81983,28 +82382,28 @@ var ts; return visitStringLiteral(node); case 8 /* NumericLiteral */: return visitNumericLiteral(node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: return visitTemplateExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return visitYieldExpression(node); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return visitSpreadElement(node); case 102 /* SuperKeyword */: return visitSuperKeyword(/*isExpressionOfCall*/ false); case 104 /* ThisKeyword */: return visitThisKeyword(node); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return visitMetaProperty(node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return visitAccessorDeclaration(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitReturnStatement(node); default: return ts.visitEachChild(node, visitor, context); @@ -82095,14 +82494,14 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 234 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 235 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; var label = node.label; if (!label) { - if (node.kind === 234 /* BreakStatement */) { + if (node.kind === 235 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -82113,7 +82512,7 @@ var ts; } } else { - if (node.kind === 234 /* BreakStatement */) { + if (node.kind === 235 /* BreakStatement */) { labelMarker = "break-" + label.escapedText; setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker); } @@ -82509,11 +82908,11 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 235 /* ReturnStatement */) { + if (statement.kind === 236 /* ReturnStatement */) { return true; } // An if-statement with two covered branches is covered. - else if (statement.kind === 227 /* IfStatement */) { + else if (statement.kind === 228 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && @@ -82521,7 +82920,7 @@ var ts; } } // A block is covered if it has a last statement which is covered. - else if (statement.kind === 223 /* Block */) { + else if (statement.kind === 224 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -82719,7 +83118,7 @@ var ts; * @param node A node. */ function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 202 /* ArrowFunction */) { + if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 203 /* ArrowFunction */) { insertCaptureThisForNode(statements, node, ts.createThis()); return true; } @@ -82740,22 +83139,22 @@ var ts; if (hierarchyFacts & 16384 /* NewTarget */) { var newTarget = void 0; switch (node.kind) { - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return statements; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // Methods and accessors cannot be constructors, so 'new.target' will // always return 'undefined'. newTarget = ts.createVoidZero(); break; - case 162 /* Constructor */: + case 163 /* Constructor */: // Class constructors can only be called with `new`, so `this.constructor` // should be relatively safe to use. newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"); break; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: // Functions can be called or constructed, and may have a `this` due to // being a member or when calling an imported function via `other_1.f()`. newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), 98 /* InstanceOfKeyword */, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"), ts.createVoidZero()); @@ -82787,20 +83186,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 222 /* SemicolonClassElement */: + case 223 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 162 /* Constructor */: + case 163 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -83002,7 +83401,7 @@ var ts; : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 244 /* FunctionDeclaration */ || node.kind === 201 /* FunctionExpression */)) { + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 245 /* FunctionDeclaration */ || node.kind === 202 /* FunctionExpression */)) { name = ts.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */); @@ -83046,7 +83445,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 202 /* ArrowFunction */); + ts.Debug.assert(node.kind === 203 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -83114,9 +83513,9 @@ var ts; function visitExpressionStatement(node) { // If we are here it is most likely because our expression is a destructuring assignment. switch (node.expression.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return ts.updateExpressionStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return ts.updateExpressionStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } return ts.visitEachChild(node, visitor, context); @@ -83135,9 +83534,9 @@ var ts; // expression. If we are in a state where we do not need the destructuring value, // we pass that information along to the children that care about it. switch (node.expression.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return ts.updateParen(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return ts.updateParen(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } } @@ -83351,14 +83750,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -83546,7 +83945,7 @@ var ts; && i < numInitialPropertiesWithoutYield) { numInitialPropertiesWithoutYield = i; } - if (property.name.kind === 154 /* ComputedPropertyName */) { + if (property.name.kind === 155 /* ComputedPropertyName */) { numInitialProperties = i; break; } @@ -83667,11 +84066,11 @@ var ts; } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 230 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 231 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); - case 232 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); - case 228 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); - case 229 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); + case 231 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); + case 232 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); + case 233 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); + case 229 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); + case 230 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); default: return ts.Debug.failBadSyntaxKind(node, "IterationStatement expected"); } } @@ -83696,11 +84095,11 @@ var ts; function createConvertedLoopState(node) { var loopInitializer; switch (node.kind) { - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 243 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 244 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -84099,20 +84498,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -84219,7 +84618,7 @@ var ts; var updated; var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 163 /* GetAccessor */) { + if (node.kind === 164 /* GetAccessor */) { updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -84711,13 +85110,13 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(104 /* ThisKeyword */); - context.enableEmitNotification(162 /* Constructor */); - context.enableEmitNotification(161 /* MethodDeclaration */); - context.enableEmitNotification(163 /* GetAccessor */); - context.enableEmitNotification(164 /* SetAccessor */); - context.enableEmitNotification(202 /* ArrowFunction */); - context.enableEmitNotification(201 /* FunctionExpression */); - context.enableEmitNotification(244 /* FunctionDeclaration */); + context.enableEmitNotification(163 /* Constructor */); + context.enableEmitNotification(162 /* MethodDeclaration */); + context.enableEmitNotification(164 /* GetAccessor */); + context.enableEmitNotification(165 /* SetAccessor */); + context.enableEmitNotification(203 /* ArrowFunction */); + context.enableEmitNotification(202 /* FunctionExpression */); + context.enableEmitNotification(245 /* FunctionDeclaration */); } } /** @@ -84758,10 +85157,10 @@ var ts; */ function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 191 /* BindingElement */: - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 242 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 243 /* VariableDeclaration */: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } @@ -84843,11 +85242,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 226 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 227 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 196 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 197 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -84855,7 +85254,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 213 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 214 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -84895,15 +85294,15 @@ var ts; if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(268 /* JsxOpeningElement */); - context.enableEmitNotification(269 /* JsxClosingElement */); - context.enableEmitNotification(267 /* JsxSelfClosingElement */); + context.enableEmitNotification(269 /* JsxOpeningElement */); + context.enableEmitNotification(270 /* JsxClosingElement */); + context.enableEmitNotification(268 /* JsxSelfClosingElement */); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(194 /* PropertyAccessExpression */); - context.enableSubstitution(281 /* PropertyAssignment */); + context.enableSubstitution(195 /* PropertyAccessExpression */); + context.enableSubstitution(282 /* PropertyAssignment */); return ts.chainBundle(transformSourceFile); /** * Transforms an ES5 source file to ES3. @@ -84922,9 +85321,9 @@ var ts; */ function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 268 /* JsxOpeningElement */: - case 269 /* JsxClosingElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 270 /* JsxClosingElement */: + case 268 /* JsxSelfClosingElement */: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -85259,13 +85658,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 228 /* DoStatement */: + case 229 /* DoStatement */: return visitDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return visitWhileStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return visitSwitchStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -85278,24 +85677,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return visitFunctionExpression(node); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return visitAccessorDeclaration(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatement(node); - case 234 /* BreakStatement */: + case 235 /* BreakStatement */: return visitBreakStatement(node); - case 233 /* ContinueStatement */: + case 234 /* ContinueStatement */: return visitContinueStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 262144 /* ContainsYield */) { @@ -85316,21 +85715,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return visitConditionalExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return visitYieldExpression(node); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return visitCallExpression(node); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -85343,9 +85742,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return visitFunctionExpression(node); default: return ts.Debug.failBadSyntaxKind(node); @@ -85553,7 +85952,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -85565,7 +85964,7 @@ var ts; // _a.b = %sent%; target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -85941,35 +86340,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 223 /* Block */: + case 224 /* Block */: return transformAndEmitBlock(node); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return transformAndEmitIfStatement(node); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return transformAndEmitDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return transformAndEmitForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 233 /* ContinueStatement */: + case 234 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 234 /* BreakStatement */: + case 235 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return transformAndEmitWithStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -86399,7 +86798,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 278 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 279 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -86412,7 +86811,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 277 /* CaseClause */) { + if (clause.kind === 278 /* CaseClause */) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -87641,11 +88040,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(209 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(207 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(208 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(290 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(210 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(208 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(209 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(291 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var currentSourceFile; // The current file. @@ -87969,23 +88368,23 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return visitImportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return visitExportDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitExportAssignment(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return visitClassDeclaration(node); - case 328 /* MergeDeclarationMarker */: + case 329 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 329 /* EndOfDeclarationMarker */: + case 330 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, moduleExpressionElementVisitor, context); @@ -88012,24 +88411,24 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var elem = _a[_i]; switch (elem.kind) { - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return false; default: ts.Debug.assertNever(elem, "Unhandled object member kind"); } @@ -88529,7 +88928,7 @@ var ts; // // To balance the declaration, add the exports of the elided variable // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -88584,10 +88983,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 257 /* NamedImports */: + case 258 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding, /* liveBinding */ true); @@ -88800,7 +89199,7 @@ var ts; * @param emit A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -88864,10 +89263,10 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return substituteBinaryExpression(node); - case 208 /* PostfixUnaryExpression */: - case 207 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -88888,7 +89287,7 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 290 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 291 /* SourceFile */) { return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), /*location*/ node); } @@ -88963,7 +89362,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 208 /* PostfixUnaryExpression */ + var expression = node.kind === 209 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 45 /* PlusPlusToken */ ? 63 /* PlusEqualsToken */ : 64 /* MinusEqualsToken */), ts.createLiteral(1)), /*location*/ node) : node; @@ -89062,12 +89461,12 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols - context.enableSubstitution(209 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(207 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(208 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(219 /* MetaProperty */); // Substitutes 'import.meta' - context.enableEmitNotification(290 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols + context.enableSubstitution(210 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(208 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(209 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(220 /* MetaProperty */); // Substitutes 'import.meta' + context.enableEmitNotification(291 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var exportFunctionsMap = []; // The export function associated with a source file. @@ -89291,7 +89690,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 260 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 261 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -89316,7 +89715,7 @@ var ts; } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 260 /* ExportDeclaration */) { + if (externalImport.kind !== 261 /* ExportDeclaration */) { continue; } if (!externalImport.exportClause) { @@ -89399,19 +89798,19 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); // TODO: GH#18217 switch (entry.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // falls through - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(ts.createExpressionStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { if (ts.isNamedExports(entry.exportClause)) { @@ -89470,13 +89869,13 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return visitImportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return visitExportDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -89656,7 +90055,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 290 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 291 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -89720,7 +90119,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -89782,10 +90181,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 257 /* NamedImports */: + case 258 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -89965,43 +90364,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return visitClassDeclaration(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatement(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatement(node); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return visitDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return visitWhileStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitLabeledStatement(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return visitWithStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return visitSwitchStatement(node); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return visitCaseBlock(node); - case 277 /* CaseClause */: + case 278 /* CaseClause */: return visitCaseClause(node); - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: return visitDefaultClause(node); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return visitTryStatement(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClause(node); - case 223 /* Block */: + case 224 /* Block */: return visitBlock(node); - case 328 /* MergeDeclarationMarker */: + case 329 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 329 /* EndOfDeclarationMarker */: + case 330 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -90248,7 +90647,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 290 /* SourceFile */; + return container !== undefined && container.kind === 291 /* SourceFile */; } else { return false; @@ -90281,7 +90680,7 @@ var ts; * @param emitCallback A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -90331,7 +90730,7 @@ var ts; */ function substituteUnspecified(node) { switch (node.kind) { - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return substituteShorthandPropertyAssignment(node); } return node; @@ -90367,12 +90766,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return substituteBinaryExpression(node); - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return substituteMetaProperty(node); } return node; @@ -90465,14 +90864,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 208 /* PostfixUnaryExpression */ + var expression = node.kind === 209 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) { var exportName = exportedNames_5[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 208 /* PostfixUnaryExpression */) { + if (node.kind === 209 /* PostfixUnaryExpression */) { expression = node.operator === 45 /* PlusPlusToken */ ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -90500,7 +90899,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 290 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 291 /* SourceFile */) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -90539,7 +90938,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(290 /* SourceFile */); + context.enableEmitNotification(291 /* SourceFile */); context.enableSubstitution(75 /* Identifier */); var helperNameSubstitutions; return ts.chainBundle(transformSourceFile); @@ -90564,12 +90963,12 @@ var ts; } function visitor(node) { switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // Elide `import=` as it is not legal with --module ES6 return undefined; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitExportAssignment(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: var exportDecl = node; return visitExportDeclaration(exportDecl); } @@ -90700,7 +91099,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.kind === 246 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90729,7 +91128,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.kind === 246 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90776,7 +91175,7 @@ var ts; return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]); } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { + if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90785,8 +91184,8 @@ var ts; } // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit // The only exception here is if the constructor was marked as private. we are not emitting the constructor parameters at all. - else if (node.kind === 159 /* PropertyDeclaration */ || node.kind === 194 /* PropertyAccessExpression */ || node.kind === 158 /* PropertySignature */ || - (node.kind === 156 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { + else if (node.kind === 160 /* PropertyDeclaration */ || node.kind === 195 /* PropertyAccessExpression */ || node.kind === 159 /* PropertySignature */ || + (node.kind === 157 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -90795,7 +91194,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 245 /* ClassDeclaration */ || node.kind === 156 /* Parameter */) { + else if (node.parent.kind === 246 /* ClassDeclaration */ || node.kind === 157 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90820,7 +91219,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (node.kind === 164 /* SetAccessor */) { + if (node.kind === 165 /* SetAccessor */) { // Getters can infer the return type from the returned expression, but setters cannot, so the // "_from_external_module_1_but_cannot_be_named" case cannot occur. if (ts.hasModifier(node, 32 /* Static */)) { @@ -90859,26 +91258,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 165 /* CallSignature */: + case 166 /* CallSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.hasModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -90886,7 +91285,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.kind === 246 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -90900,7 +91299,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -90925,30 +91324,30 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 166 /* ConstructSignature */: - case 171 /* ConstructorType */: + case 167 /* ConstructSignature */: + case 172 /* ConstructorType */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 165 /* CallSignature */: + case 166 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -90956,7 +91355,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 246 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90969,15 +91368,15 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 244 /* FunctionDeclaration */: - case 170 /* FunctionType */: + case 245 /* FunctionDeclaration */: + case 171 /* FunctionType */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - case 164 /* SetAccessor */: - case 163 /* GetAccessor */: + case 165 /* SetAccessor */: + case 164 /* GetAccessor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90991,39 +91390,39 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 186 /* MappedType */: + case 187 /* MappedType */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 171 /* ConstructorType */: - case 166 /* ConstructSignature */: + case 172 /* ConstructorType */: + case 167 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 165 /* CallSignature */: + case 166 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 246 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 170 /* FunctionType */: - case 244 /* FunctionDeclaration */: + case 171 /* FunctionType */: + case 245 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -91038,7 +91437,7 @@ var ts; function getHeritageClauseVisibilityError() { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 245 /* ClassDeclaration */) { + if (node.parent.parent.kind === 246 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible diagnosticMessage = ts.isHeritageClause(node.parent) && node.parent.token === 113 /* ImplementsKeyword */ ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : @@ -91089,7 +91488,7 @@ var ts; } function isInternalDeclaration(node, currentSourceFile) { var parseTreeNode = ts.getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 156 /* Parameter */) { + if (parseTreeNode && parseTreeNode.kind === 157 /* Parameter */) { var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : undefined; var text = currentSourceFile.text; @@ -91248,10 +91647,10 @@ var ts; return result; } function transformRoot(node) { - if (node.kind === 290 /* SourceFile */ && node.isDeclarationFile) { + if (node.kind === 291 /* SourceFile */ && node.isDeclarationFile) { return node; } - if (node.kind === 291 /* Bundle */) { + if (node.kind === 292 /* Bundle */) { isBundledEmit = true; refs = ts.createMap(); libs = ts.createMap(); @@ -91274,14 +91673,14 @@ var ts; resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules) needsDeclare = false; var statements = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile, /*bundled*/ true)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); - var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(130 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); + var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(131 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); return newFile; } needsDeclare = true; var updated = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); return ts.updateSourceFileNode(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); }), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 293 /* InputFiles */) { + if (prepend.kind === 294 /* InputFiles */) { var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal); hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib; collectReferences(sourceFile, refs); @@ -91422,7 +91821,7 @@ var ts; return name; } else { - if (name.kind === 190 /* ArrayBindingPattern */) { + if (name.kind === 191 /* ArrayBindingPattern */) { return ts.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement)); } else { @@ -91430,7 +91829,7 @@ var ts; } } function visitBindingElement(elem) { - if (elem.kind === 215 /* OmittedExpression */) { + if (elem.kind === 216 /* OmittedExpression */) { return elem; } return ts.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined); @@ -91468,7 +91867,7 @@ var ts; // Literal const declarations will have an initializer ensured rather than a type return; } - var shouldUseResolverType = node.kind === 156 /* Parameter */ && + var shouldUseResolverType = node.kind === 157 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { @@ -91477,7 +91876,7 @@ var ts; if (!ts.getParseTreeNode(node)) { return type ? ts.visitNode(type, visitDeclarationSubtree) : ts.createKeywordTypeNode(125 /* AnyKeyword */); } - if (node.kind === 164 /* SetAccessor */) { + if (node.kind === 165 /* SetAccessor */) { // Set accessors with no associated type node (from it's param or get accessor return) are `any` since they are never contextually typed right now // (The inferred type here will be void, but the old declaration emitter printed `any`, so this replicates that) return ts.createKeywordTypeNode(125 /* AnyKeyword */); @@ -91488,12 +91887,12 @@ var ts; oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node); } - if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { + if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); } - if (node.kind === 156 /* Parameter */ - || node.kind === 159 /* PropertyDeclaration */ - || node.kind === 158 /* PropertySignature */) { + if (node.kind === 157 /* Parameter */ + || node.kind === 160 /* PropertyDeclaration */ + || node.kind === 159 /* PropertySignature */) { if (!node.initializer) return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType)); return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); @@ -91510,20 +91909,20 @@ var ts; function isDeclarationAndNotVisible(node) { node = ts.getParseTreeNode(node); switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 249 /* ModuleDeclaration */: - case 246 /* InterfaceDeclaration */: - case 245 /* ClassDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 248 /* EnumDeclaration */: + case 245 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 247 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: return !resolver.isDeclarationVisible(node); // The following should be doing their own visibility checks based on filtering their members - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return !getBindingNameVisible(node); - case 253 /* ImportEqualsDeclaration */: - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: - case 259 /* ExportAssignment */: + case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 260 /* ExportAssignment */: return false; } return false; @@ -91604,7 +92003,7 @@ var ts; function rewriteModuleSpecifier(parent, input) { if (!input) return undefined; // TODO: GH#18217 - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 249 /* ModuleDeclaration */ && parent.kind !== 188 /* ImportType */); + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 250 /* ModuleDeclaration */ && parent.kind !== 189 /* ImportType */); if (ts.isStringLiteralLike(input)) { if (isBundledEmit) { var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent); @@ -91624,7 +92023,7 @@ var ts; function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 265 /* ExternalModuleReference */) { + if (decl.moduleReference.kind === 266 /* ExternalModuleReference */) { // Rewrite external module names if necessary var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl); return ts.updateImportEqualsDeclaration(decl, @@ -91651,7 +92050,7 @@ var ts; return visibleDefaultBinding && ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, /*namedBindings*/ undefined, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)); } - if (decl.importClause.namedBindings.kind === 256 /* NamespaceImport */) { + if (decl.importClause.namedBindings.kind === 257 /* NamespaceImport */) { // Namespace import (optionally with visible default) var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : /*namedBindings*/ undefined; return visibleDefaultBinding || namedBindings ? ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, namedBindings, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined; @@ -91740,7 +92139,7 @@ var ts; // We'd see a TDZ violation at runtime var canProduceDiagnostic = ts.canProduceDiagnostics(input); var oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 173 /* TypeLiteral */ || input.kind === 186 /* MappedType */) && input.parent.kind !== 247 /* TypeAliasDeclaration */); + var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 174 /* TypeLiteral */ || input.kind === 187 /* MappedType */) && input.parent.kind !== 248 /* TypeAliasDeclaration */); // Emit methods which are private as properties with no type information if (ts.isMethodDeclaration(input) || ts.isMethodSignature(input)) { if (ts.hasModifier(input, 8 /* Private */)) { @@ -91761,38 +92160,38 @@ var ts; } if (isProcessedComponent(input)) { switch (input.kind) { - case 216 /* ExpressionWithTypeArguments */: { + case 217 /* ExpressionWithTypeArguments */: { if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateExpressionWithTypeArguments(node, ts.parenthesizeTypeParameters(node.typeArguments), node.expression)); } - case 169 /* TypeReference */: { + case 170 /* TypeReference */: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateTypeReferenceNode(node, node.typeName, ts.parenthesizeTypeParameters(node.typeArguments))); } - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: return cleanup(ts.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); - case 162 /* Constructor */: { + case 163 /* Constructor */: { // A constructor declaration may not have a type annotation - var ctor = ts.createSignatureDeclaration(162 /* Constructor */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0 /* None */), + var ctor = ts.createSignatureDeclaration(163 /* Constructor */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0 /* None */), /*type*/ undefined); ctor.modifiers = ts.createNodeArray(ensureModifiers(input)); return cleanup(ctor); } - case 161 /* MethodDeclaration */: { + case 162 /* MethodDeclaration */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } - var sig = ts.createSignatureDeclaration(160 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); + var sig = ts.createSignatureDeclaration(161 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); sig.name = input.name; sig.modifiers = ts.createNodeArray(ensureModifiers(input)); sig.questionToken = input.questionToken; return cleanup(sig); } - case 163 /* GetAccessor */: { + case 164 /* GetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -91801,7 +92200,7 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8 /* Private */)), ensureType(input, accessorType), /*body*/ undefined)); } - case 164 /* SetAccessor */: { + case 165 /* SetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -91809,31 +92208,31 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8 /* Private */)), /*body*/ undefined)); } - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updateProperty(input, /*decorators*/ undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 160 /* MethodSignature */: { + case 161 /* MethodSignature */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updateMethodSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), input.name, input.questionToken)); } - case 165 /* CallSignature */: { + case 166 /* CallSignature */: { return cleanup(ts.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 167 /* IndexSignature */: { + case 168 /* IndexSignature */: { return cleanup(ts.updateIndexSignature(input, /*decorators*/ undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || ts.createKeywordTypeNode(125 /* AnyKeyword */))); } - case 242 /* VariableDeclaration */: { + case 243 /* VariableDeclaration */: { if (ts.isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -91841,13 +92240,13 @@ var ts; suppressNewDiagnosticContexts = true; // Variable declaration types also suppress new diagnostic contexts, provided the contexts wouldn't be made for binding pattern types return cleanup(ts.updateTypeScriptVariableDeclaration(input, input.name, /*exclaimationToken*/ undefined, ensureType(input, input.type), ensureNoInitializer(input))); } - case 155 /* TypeParameter */: { + case 156 /* TypeParameter */: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(ts.updateTypeParameterDeclaration(input, input.name, /*constraint*/ undefined, /*defaultType*/ undefined)); } return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context)); } - case 180 /* ConditionalType */: { + case 181 /* ConditionalType */: { // We have to process conditional types in a special way because for visibility purposes we need to push a new enclosingDeclaration // just for the `infer` types in the true branch. It's an implicit declaration scope that only applies to _part_ of the type. var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree); @@ -91859,13 +92258,13 @@ var ts; var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree); return cleanup(ts.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 170 /* FunctionType */: { + case 171 /* FunctionType */: { return cleanup(ts.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 171 /* ConstructorType */: { + case 172 /* ConstructorType */: { return cleanup(ts.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 188 /* ImportType */: { + case 189 /* ImportType */: { if (!ts.isLiteralImportTypeNode(input)) return cleanup(input); return cleanup(ts.updateImportTypeNode(input, ts.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf)); @@ -91894,7 +92293,7 @@ var ts; } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 161 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); + return node.parent.kind === 162 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -91904,7 +92303,7 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 260 /* ExportDeclaration */: { + case 261 /* ExportDeclaration */: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -91914,7 +92313,7 @@ var ts; return ts.updateExportDeclaration(input, /*decorators*/ undefined, input.modifiers, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier), input.isTypeOnly); } - case 259 /* ExportAssignment */: { + case 260 /* ExportAssignment */: { // Always visible if the parent node isn't dropped for being not visible if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; @@ -91930,7 +92329,7 @@ var ts; errorNode: input }); }; var varDecl = ts.createVariableDeclaration(newId, resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); return [statement, ts.updateExportAssignment(input, input.decorators, input.modifiers, newId)]; } } @@ -91955,10 +92354,10 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 253 /* ImportEqualsDeclaration */: { + case 254 /* ImportEqualsDeclaration */: { return transformImportEqualsDeclaration(input); } - case 254 /* ImportDeclaration */: { + case 255 /* ImportDeclaration */: { return transformImportDeclaration(input); } } @@ -91979,14 +92378,14 @@ var ts; } var previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 247 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all + case 248 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all return cleanup(ts.updateTypeAliasDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode))); - case 246 /* InterfaceDeclaration */: { + case 247 /* InterfaceDeclaration */: { return cleanup(ts.updateInterfaceDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree))); } - case 244 /* FunctionDeclaration */: { + case 245 /* FunctionDeclaration */: { // Generators lose their generator-ness, excepting their return type var clean = cleanup(ts.updateFunctionDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), @@ -92034,10 +92433,10 @@ var ts; return clean; } } - case 249 /* ModuleDeclaration */: { + case 250 /* ModuleDeclaration */: { needsDeclare = false; var inner = input.body; - if (inner && inner.kind === 250 /* ModuleBlock */) { + if (inner && inner.kind === 251 /* ModuleBlock */) { var oldNeedsScopeFix = needsScopeFixMarker; var oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; @@ -92080,7 +92479,7 @@ var ts; /*decorators*/ undefined, mods, input.name, body)); } } - case 245 /* ClassDeclaration */: { + case 246 /* ClassDeclaration */: { var modifiers = ts.createNodeArray(ensureModifiers(input)); var typeParameters = ensureTypeParams(input, input.typeParameters); var ctor = ts.getFirstConstructorWithBody(input); @@ -92141,7 +92540,7 @@ var ts; typeName: input.name }); }; var varDecl = ts.createVariableDeclaration(newId_1, resolver.createTypeOfExpression(extendsClause_1.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); var heritageClauses = ts.createNodeArray(ts.map(input.heritageClauses, function (clause) { if (clause.token === 90 /* ExtendsKeyword */) { var oldDiag_2 = getSymbolAccessibilityDiagnostic; @@ -92161,10 +92560,10 @@ var ts; /*decorators*/ undefined, modifiers, input.name, typeParameters, heritageClauses, members)); } } - case 225 /* VariableStatement */: { + case 226 /* VariableStatement */: { return cleanup(transformVariableStatement(input)); } - case 248 /* EnumDeclaration */: { + case 249 /* EnumDeclaration */: { return cleanup(ts.updateEnumDeclaration(input, /*decorators*/ undefined, ts.createNodeArray(ensureModifiers(input)), input.name, ts.createNodeArray(ts.mapDefined(input.members, function (m) { if (shouldStripInternal(m)) return; @@ -92183,7 +92582,7 @@ var ts; if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 249 /* ModuleDeclaration */) { + if (input.kind === 250 /* ModuleDeclaration */) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -92204,7 +92603,7 @@ var ts; return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); })); } function recreateBindingElement(e) { - if (e.kind === 215 /* OmittedExpression */) { + if (e.kind === 216 /* OmittedExpression */) { return; } if (e.name) { @@ -92254,7 +92653,7 @@ var ts; function ensureModifierFlags(node) { var mask = 3071 /* All */ ^ (4 /* Public */ | 256 /* Async */); // No async modifiers in declaration files var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */; - var parentIsFile = node.parent.kind === 290 /* SourceFile */; + var parentIsFile = node.parent.kind === 291 /* SourceFile */; if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) { mask ^= 2 /* Ambient */; additions = 0 /* None */; @@ -92283,7 +92682,7 @@ var ts; } ts.transformDeclarations = transformDeclarations; function isAlwaysType(node) { - if (node.kind === 246 /* InterfaceDeclaration */) { + if (node.kind === 247 /* InterfaceDeclaration */) { return true; } return false; @@ -92308,7 +92707,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 163 /* GetAccessor */ + return accessor.kind === 164 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -92317,52 +92716,52 @@ var ts; } function canHaveLiteralInitializer(node) { switch (node.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return !ts.hasModifier(node, 8 /* Private */); - case 156 /* Parameter */: - case 242 /* VariableDeclaration */: + case 157 /* Parameter */: + case 243 /* VariableDeclaration */: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 249 /* ModuleDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 246 /* InterfaceDeclaration */: - case 245 /* ClassDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 248 /* EnumDeclaration */: - case 225 /* VariableStatement */: - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: - case 259 /* ExportAssignment */: + case 245 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 247 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: + case 226 /* VariableStatement */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 260 /* ExportAssignment */: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 166 /* ConstructSignature */: - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 167 /* IndexSignature */: - case 242 /* VariableDeclaration */: - case 155 /* TypeParameter */: - case 216 /* ExpressionWithTypeArguments */: - case 169 /* TypeReference */: - case 180 /* ConditionalType */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 188 /* ImportType */: + case 167 /* ConstructSignature */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 168 /* IndexSignature */: + case 243 /* VariableDeclaration */: + case 156 /* TypeParameter */: + case 217 /* ExpressionWithTypeArguments */: + case 170 /* TypeReference */: + case 181 /* ConditionalType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 189 /* ImportType */: return true; } return false; @@ -92495,7 +92894,7 @@ var ts; * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(331 /* Count */); + var enabledSyntaxKindFeatures = new Array(332 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -92859,7 +93258,7 @@ var ts; /*@internal*/ function getOutputPathsFor(sourceFile, host, forceDtsPaths) { var options = host.getCompilerOptions(); - if (sourceFile.kind === 291 /* Bundle */) { + if (sourceFile.kind === 292 /* Bundle */) { return getOutputPathsForBundle(options, forceDtsPaths); } else { @@ -93189,7 +93588,7 @@ var ts; mapRoot: compilerOptions.mapRoot, extendedDiagnostics: compilerOptions.extendedDiagnostics, }); - if (forceDtsEmit && declarationTransform.transformed[0].kind === 290 /* SourceFile */) { + if (forceDtsEmit && declarationTransform.transformed[0].kind === 291 /* SourceFile */) { var sourceFile = declarationTransform.transformed[0]; exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit; } @@ -93212,8 +93611,8 @@ var ts; ts.forEachChild(node, collectLinkedAliases); } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) { - var bundle = sourceFileOrBundle.kind === 291 /* Bundle */ ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 290 /* SourceFile */ ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 292 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 291 /* SourceFile */ ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; var sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -93254,7 +93653,7 @@ var ts; } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { return (mapOptions.sourceMap || mapOptions.inlineSourceMap) - && (sourceFileOrBundle.kind !== 290 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); + && (sourceFileOrBundle.kind !== 291 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); } function getSourceRoot(mapOptions) { // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the @@ -93365,7 +93764,7 @@ var ts; }; function createSourceFilesFromBundleBuildInfo(bundle, buildInfoDirectory, host) { var sourceFiles = bundle.sourceFiles.map(function (fileName) { - var sourceFile = ts.createNode(290 /* SourceFile */, 0, 0); + var sourceFile = ts.createNode(291 /* SourceFile */, 0, 0); sourceFile.fileName = ts.getRelativePathFromDirectory(host.getCurrentDirectory(), ts.getNormalizedAbsolutePath(fileName, buildInfoDirectory), !host.useCaseSensitiveFileNames()); sourceFile.text = ""; sourceFile.statements = ts.createNodeArray(); @@ -93377,7 +93776,7 @@ var ts; sourceFile.text = prologueInfo.text; sourceFile.end = prologueInfo.text.length; sourceFile.statements = ts.createNodeArray(prologueInfo.directives.map(function (directive) { - var statement = ts.createNode(226 /* ExpressionStatement */, directive.pos, directive.end); + var statement = ts.createNode(227 /* ExpressionStatement */, directive.pos, directive.end); statement.expression = ts.createNode(10 /* StringLiteral */, directive.expression.pos, directive.expression.end); statement.expression.text = directive.expression.text; return statement; @@ -93554,9 +93953,9 @@ var ts; break; } switch (node.kind) { - case 290 /* SourceFile */: return printFile(node); - case 291 /* Bundle */: return printBundle(node); - case 292 /* UnparsedSource */: return printUnparsedSource(node); + case 291 /* SourceFile */: return printFile(node); + case 292 /* Bundle */: return printBundle(node); + case 293 /* UnparsedSource */: return printUnparsedSource(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); @@ -93807,12 +94206,12 @@ var ts; } // falls through case 2 /* Comments */: - if (!commentsDisabled && node.kind !== 290 /* SourceFile */) { + if (!commentsDisabled && node.kind !== 291 /* SourceFile */) { return pipelineEmitWithComments; } // falls through case 3 /* SourceMaps */: - if (!sourceMapsDisabled && node.kind !== 290 /* SourceFile */ && !ts.isInJsonFile(node)) { + if (!sourceMapsDisabled && node.kind !== 291 /* SourceFile */ && !ts.isInJsonFile(node)) { return pipelineEmitWithSourceMap; } // falls through @@ -93854,15 +94253,15 @@ var ts; case 16 /* TemplateMiddle */: case 17 /* TemplateTail */: return emitLiteral(node, /*jsxAttributeEscape*/ false); - case 292 /* UnparsedSource */: - case 286 /* UnparsedPrepend */: + case 293 /* UnparsedSource */: + case 287 /* UnparsedPrepend */: return emitUnparsedSourceOrPrepend(node); - case 285 /* UnparsedPrologue */: + case 286 /* UnparsedPrologue */: return writeUnparsedNode(node); - case 287 /* UnparsedText */: - case 288 /* UnparsedInternalText */: + case 288 /* UnparsedText */: + case 289 /* UnparsedInternalText */: return emitUnparsedTextLike(node); - case 289 /* UnparsedSyntheticReference */: + case 290 /* UnparsedSyntheticReference */: return emitUnparsedSyntheticReference(node); // Identifiers case 75 /* Identifier */: @@ -93872,260 +94271,260 @@ var ts; return emitPrivateIdentifier(node); // Parse tree nodes // Names - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return emitQualifiedName(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return emitTypeParameter(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return emitParameter(node); - case 157 /* Decorator */: + case 158 /* Decorator */: return emitDecorator(node); // Type members - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: return emitPropertySignature(node); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 160 /* MethodSignature */: + case 161 /* MethodSignature */: return emitMethodSignature(node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return emitConstructor(node); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return emitAccessorDeclaration(node); - case 165 /* CallSignature */: + case 166 /* CallSignature */: return emitCallSignature(node); - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: return emitConstructSignature(node); - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: return emitIndexSignature(node); // Types - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return emitTypePredicate(node); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return emitTypeReference(node); - case 170 /* FunctionType */: + case 171 /* FunctionType */: return emitFunctionType(node); - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 171 /* ConstructorType */: + case 172 /* ConstructorType */: return emitConstructorType(node); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return emitTypeQuery(node); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return emitTypeLiteral(node); - case 174 /* ArrayType */: + case 175 /* ArrayType */: return emitArrayType(node); - case 175 /* TupleType */: + case 176 /* TupleType */: return emitTupleType(node); - case 176 /* OptionalType */: + case 177 /* OptionalType */: return emitOptionalType(node); - case 178 /* UnionType */: + case 179 /* UnionType */: return emitUnionType(node); - case 179 /* IntersectionType */: + case 180 /* IntersectionType */: return emitIntersectionType(node); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return emitConditionalType(node); - case 181 /* InferType */: + case 182 /* InferType */: return emitInferType(node); - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return emitParenthesizedType(node); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 183 /* ThisType */: + case 184 /* ThisType */: return emitThisType(); - case 184 /* TypeOperator */: + case 185 /* TypeOperator */: return emitTypeOperator(node); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 186 /* MappedType */: + case 187 /* MappedType */: return emitMappedType(node); - case 187 /* LiteralType */: + case 188 /* LiteralType */: return emitLiteralType(node); - case 188 /* ImportType */: + case 189 /* ImportType */: return emitImportTypeNode(node); - case 295 /* JSDocAllType */: + case 296 /* JSDocAllType */: writePunctuation("*"); return; - case 296 /* JSDocUnknownType */: + case 297 /* JSDocUnknownType */: writePunctuation("?"); return; - case 297 /* JSDocNullableType */: + case 298 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 298 /* JSDocNonNullableType */: + case 299 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 299 /* JSDocOptionalType */: + case 300 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 177 /* RestType */: - case 301 /* JSDocVariadicType */: + case 178 /* RestType */: + case 302 /* JSDocVariadicType */: return emitRestOrJSDocVariadicType(node); // Binding patterns - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return emitBindingElement(node); // Misc - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return emitTemplateSpan(node); - case 222 /* SemicolonClassElement */: + case 223 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 223 /* Block */: + case 224 /* Block */: return emitBlock(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return emitVariableStatement(node); - case 224 /* EmptyStatement */: + case 225 /* EmptyStatement */: return emitEmptyStatement(/*isEmbeddedStatement*/ false); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return emitExpressionStatement(node); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return emitIfStatement(node); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return emitDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return emitWhileStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return emitForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return emitForInStatement(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return emitForOfStatement(node); - case 233 /* ContinueStatement */: + case 234 /* ContinueStatement */: return emitContinueStatement(node); - case 234 /* BreakStatement */: + case 235 /* BreakStatement */: return emitBreakStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return emitReturnStatement(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return emitWithStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return emitSwitchStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return emitLabeledStatement(node); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return emitThrowStatement(node); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return emitTryStatement(node); - case 241 /* DebuggerStatement */: + case 242 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return emitClassDeclaration(node); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return emitModuleBlock(node); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return emitCaseBlock(node); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return emitImportDeclaration(node); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return emitImportClause(node); - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return emitNamespaceImport(node); - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: return emitNamespaceExport(node); - case 257 /* NamedImports */: + case 258 /* NamedImports */: return emitNamedImports(node); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return emitImportSpecifier(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return emitExportAssignment(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return emitExportDeclaration(node); - case 261 /* NamedExports */: + case 262 /* NamedExports */: return emitNamedExports(node); - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: return emitExportSpecifier(node); - case 264 /* MissingDeclaration */: + case 265 /* MissingDeclaration */: return; // Module references - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 11 /* JsxText */: return emitJsxText(node); - case 268 /* JsxOpeningElement */: - case 271 /* JsxOpeningFragment */: + case 269 /* JsxOpeningElement */: + case 272 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 269 /* JsxClosingElement */: - case 272 /* JsxClosingFragment */: + case 270 /* JsxClosingElement */: + case 273 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return emitJsxAttribute(node); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return emitJsxAttributes(node); - case 275 /* JsxSpreadAttribute */: + case 276 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 277 /* CaseClause */: + case 278 /* CaseClause */: return emitCaseClause(node); - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: return emitDefaultClause(node); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: return emitHeritageClause(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 284 /* EnumMember */: + case 285 /* EnumMember */: return emitEnumMember(node); // JSDoc nodes (only used in codefixes currently) - case 317 /* JSDocParameterTag */: - case 323 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: + case 324 /* JSDocPropertyTag */: return emitJSDocPropertyLikeTag(node); - case 318 /* JSDocReturnTag */: - case 320 /* JSDocTypeTag */: - case 319 /* JSDocThisTag */: - case 316 /* JSDocEnumTag */: + case 319 /* JSDocReturnTag */: + case 321 /* JSDocTypeTag */: + case 320 /* JSDocThisTag */: + case 317 /* JSDocEnumTag */: return emitJSDocSimpleTypedTag(node); - case 308 /* JSDocImplementsTag */: - case 307 /* JSDocAugmentsTag */: + case 309 /* JSDocImplementsTag */: + case 308 /* JSDocAugmentsTag */: return emitJSDocHeritageTag(node); - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); - case 322 /* JSDocTypedefTag */: + case 323 /* JSDocTypedefTag */: return emitJSDocTypedefTag(node); - case 315 /* JSDocCallbackTag */: + case 316 /* JSDocCallbackTag */: return emitJSDocCallbackTag(node); - case 305 /* JSDocSignature */: + case 306 /* JSDocSignature */: return emitJSDocSignature(node); - case 304 /* JSDocTypeLiteral */: + case 305 /* JSDocTypeLiteral */: return emitJSDocTypeLiteral(node); - case 310 /* JSDocClassTag */: - case 306 /* JSDocTag */: + case 311 /* JSDocClassTag */: + case 307 /* JSDocTag */: return emitJSDocSimpleTag(node); - case 303 /* JSDocComment */: + case 304 /* JSDocComment */: return emitJSDoc(node); // Transformation nodes (ignored) } @@ -94162,71 +94561,71 @@ var ts; writeTokenNode(node, writeKeyword); return; // Expressions - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return emitCallExpression(node); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return emitNewExpression(node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return emitFunctionExpression(node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return emitArrowFunction(node); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return emitDeleteExpression(node); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return emitVoidExpression(node); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return emitAwaitExpression(node); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return emitBinaryExpression(node); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return emitConditionalExpression(node); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: return emitTemplateExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return emitYieldExpression(node); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return emitSpreadExpression(node); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return emitClassExpression(node); - case 215 /* OmittedExpression */: + case 216 /* OmittedExpression */: return; - case 217 /* AsExpression */: + case 218 /* AsExpression */: return emitAsExpression(node); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: return emitNonNullExpression(node); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return emitMetaProperty(node); // JSX - case 266 /* JsxElement */: + case 267 /* JsxElement */: return emitJsxElement(node); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return emitJsxFragment(node); // Transformation nodes - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: return emitCommaList(node); } } @@ -94268,7 +94667,7 @@ var ts; } function emitHelpers(node) { var helpersEmitted = false; - var bundle = node.kind === 291 /* Bundle */ ? node : undefined; + var bundle = node.kind === 292 /* Bundle */ ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -94368,7 +94767,7 @@ var ts; var pos = getTextPosWithWriteLine(); writeUnparsedNode(unparsed); if (bundleFileInfo) { - updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 287 /* UnparsedText */ ? + updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 288 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */); } @@ -94441,7 +94840,7 @@ var ts; emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 300 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 301 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { @@ -94503,7 +94902,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - writeKeyword(node.kind === 163 /* GetAccessor */ ? "get" : "set"); + writeKeyword(node.kind === 164 /* GetAccessor */ ? "get" : "set"); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -94686,7 +95085,7 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - if (node.readonlyToken.kind !== 138 /* ReadonlyKeyword */) { + if (node.readonlyToken.kind !== 139 /* ReadonlyKeyword */) { writeKeyword("readonly"); } writeSpace(); @@ -94777,7 +95176,7 @@ var ts; } function emitPropertyAccessExpression(node) { var expression = ts.cast(emitExpression(node.expression), ts.isExpression); - var token = ts.getDotOrQuestionDotToken(node); + var token = node.questionDotToken || ts.createNode(24 /* DotToken */, node.expression.end, node.name.pos); var indentBeforeDot = needsIndentation(node, node.expression, token); var indentAfterDot = needsIndentation(node, token, node.name); increaseIndentIf(indentBeforeDot, /*writeSpaceIfNotIndenting*/ false); @@ -94788,7 +95187,12 @@ var ts; if (shouldEmitDotDot) { writePunctuation("."); } - emitTokenWithComment(token.kind, node.expression.end, writePunctuation, node); + if (node.questionDotToken) { + emit(token); + } + else { + emitTokenWithComment(token.kind, node.expression.end, writePunctuation, node); + } increaseIndentIf(indentAfterDot, /*writeSpaceIfNotIndenting*/ false); emit(node.name); decreaseIndentIf(indentBeforeDot, indentAfterDot); @@ -94906,7 +95310,7 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 207 /* PrefixUnaryExpression */ + return operand.kind === 208 /* PrefixUnaryExpression */ && ((node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */)) || (node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */))); } @@ -95094,7 +95498,7 @@ var ts; if (node.elseStatement) { writeLineOrSpace(node); emitTokenWithComment(87 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 227 /* IfStatement */) { + if (node.elseStatement.kind === 228 /* IfStatement */) { writeSpace(); emit(node.elseStatement); } @@ -95157,7 +95561,7 @@ var ts; emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - emitTokenWithComment(152 /* OfKeyword */, node.initializer.end, writeKeyword, node); + emitTokenWithComment(153 /* OfKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); @@ -95165,7 +95569,7 @@ var ts; } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 243 /* VariableDeclarationList */) { + if (node.kind === 244 /* VariableDeclarationList */) { emit(node); } else { @@ -95461,7 +95865,7 @@ var ts; var body = node.body; if (!body) return writeTrailingSemicolon(); - while (body.kind === 249 /* ModuleDeclaration */) { + while (body.kind === 250 /* ModuleDeclaration */) { writePunctuation("."); emit(body.name); body = body.body; @@ -95506,7 +95910,7 @@ var ts; if (node.importClause) { emit(node.importClause); writeSpace(); - emitTokenWithComment(149 /* FromKeyword */, node.importClause.end, writeKeyword, node); + emitTokenWithComment(150 /* FromKeyword */, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -95514,7 +95918,7 @@ var ts; } function emitImportClause(node) { if (node.isTypeOnly) { - emitTokenWithComment(145 /* TypeKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(146 /* TypeKeyword */, node.pos, writeKeyword, node); writeSpace(); } emit(node.name); @@ -95554,7 +95958,7 @@ var ts; var nextPos = emitTokenWithComment(89 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { - nextPos = emitTokenWithComment(145 /* TypeKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(146 /* TypeKeyword */, nextPos, writeKeyword, node); writeSpace(); } if (node.exportClause) { @@ -95566,7 +95970,7 @@ var ts; if (node.moduleSpecifier) { writeSpace(); var fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(149 /* FromKeyword */, fromPos, writeKeyword, node); + emitTokenWithComment(150 /* FromKeyword */, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } @@ -95577,7 +95981,7 @@ var ts; writeSpace(); nextPos = emitTokenWithComment(123 /* AsKeyword */, nextPos, writeKeyword, node); writeSpace(); - nextPos = emitTokenWithComment(136 /* NamespaceKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(137 /* NamespaceKeyword */, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeTrailingSemicolon(); @@ -95797,7 +96201,7 @@ var ts; } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 320 /* JSDocTypeTag */ && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 321 /* JSDocTypeTag */ && !node.comment) { writeSpace(); emit(node.tags[0]); } @@ -95831,7 +96235,7 @@ var ts; function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 294 /* JSDocTypeExpression */) { + if (tag.typeExpression.kind === 295 /* JSDocTypeExpression */) { emitJSDocTypeExpression(tag.typeExpression); } else { @@ -95850,7 +96254,7 @@ var ts; emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 304 /* JSDocTypeLiteral */) { + if (tag.typeExpression && tag.typeExpression.kind === 305 /* JSDocTypeLiteral */) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -96630,7 +97034,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 200 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 201 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -96695,84 +97099,84 @@ var ts; if (!node) return; switch (node.kind) { - case 223 /* Block */: + case 224 /* Block */: ts.forEach(node.statements, generateNames); break; - case 238 /* LabeledStatement */: - case 236 /* WithStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 239 /* LabeledStatement */: + case 237 /* WithStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: generateNames(node.statement); break; - case 227 /* IfStatement */: + case 228 /* IfStatement */: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: - case 231 /* ForInStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: + case 232 /* ForInStatement */: generateNames(node.initializer); generateNames(node.statement); break; - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: generateNames(node.caseBlock); break; - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: ts.forEach(node.clauses, generateNames); break; - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: ts.forEach(node.statements, generateNames); break; - case 240 /* TryStatement */: + case 241 /* TryStatement */: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 280 /* CatchClause */: + case 281 /* CatchClause */: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: generateNames(node.declarationList); break; - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: ts.forEach(node.declarations, generateNames); break; - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 191 /* BindingElement */: - case 245 /* ClassDeclaration */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 192 /* BindingElement */: + case 246 /* ClassDeclaration */: generateNameIfNeeded(node.name); break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: generateNameIfNeeded(node.name); if (ts.getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) { ts.forEach(node.parameters, generateNames); generateNames(node.body); } break; - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: ts.forEach(node.elements, generateNames); break; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: generateNames(node.importClause); break; - case 255 /* ImportClause */: + case 256 /* ImportClause */: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: generateNameIfNeeded(node.name); break; - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: generateNameIfNeeded(node.name); break; - case 257 /* NamedImports */: + case 258 /* NamedImports */: ts.forEach(node.elements, generateNames); break; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -96781,12 +97185,12 @@ var ts; if (!node) return; switch (node.kind) { - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: generateNameIfNeeded(node.name); break; } @@ -96968,23 +97372,23 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16 /* Optimistic */), !!(flags & 8 /* ReservedInNestedScopes */)); - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 259 /* ExportAssignment */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 260 /* ExportAssignment */: return generateNameForExportDefault(); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return generateNameForClassExpression(); - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return generateNameForMethodOrAccessor(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return makeTempVariableName(0 /* Auto */, /*reserveInNestedScopes*/ true); default: return makeTempVariableName(0 /* Auto */); @@ -97032,7 +97436,7 @@ var ts; hasWrittenComment = false; var emitFlags = ts.getEmitFlags(node); var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var isEmittedNode = node.kind !== 325 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 326 /* NotEmittedStatement */; // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is "preserve" we will not do any transformation. // It is expensive to walk entire tree just to set one kind of node to have no comments. var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 11 /* JsxText */; @@ -97056,7 +97460,7 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 243 /* VariableDeclarationList */) { + if (node.kind === 244 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -97315,7 +97719,7 @@ var ts; else { var _a = ts.getSourceMapRange(node), pos = _a.pos, end = _a.end, _b = _a.source, source = _b === void 0 ? sourceMapSource : _b; var emitFlags = ts.getEmitFlags(node); - if (node.kind !== 325 /* NotEmittedStatement */ + if (node.kind !== 326 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitSourcePos(source, skipSourceTrivia(source, pos)); @@ -97328,7 +97732,7 @@ var ts; else { pipelinePhase(hint, node); } - if (node.kind !== 325 /* NotEmittedStatement */ + if (node.kind !== 326 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitSourcePos(source, end); @@ -97788,7 +98192,6 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var ignoreDiagnosticCommentRegEx = /(^\s*$)|(^\s*\/\/\/?\s*(@ts-ignore)?)/; function findConfigFile(searchPath, fileExists, configName) { if (configName === void 0) { configName = "tsconfig.json"; } return ts.forEachAncestorDirectory(searchPath, function (ancestor) { @@ -98358,6 +98761,7 @@ var ts; }; } function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) { + var _a; var createProgramOptions = ts.isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions; // TODO: GH#18217 var rootNames = createProgramOptions.rootNames, options = createProgramOptions.options, configFileParsingDiagnostics = createProgramOptions.configFileParsingDiagnostics, projectReferences = createProgramOptions.projectReferences; var oldProgram = createProgramOptions.oldProgram; @@ -98454,7 +98858,16 @@ var ts; var projectReferenceRedirects; var mapFromFileToProjectReferenceRedirects; var mapFromToProjectReferenceRedirectSource; - var useSourceOfProjectReferenceRedirect = !!host.useSourceOfProjectReferenceRedirect && host.useSourceOfProjectReferenceRedirect(); + var useSourceOfProjectReferenceRedirect = !!((_a = host.useSourceOfProjectReferenceRedirect) === null || _a === void 0 ? void 0 : _a.call(host)) && + !options.disableSourceOfProjectReferenceRedirect; + var onProgramCreateComplete = updateHostForUseSourceOfProjectReferenceRedirect({ + compilerHost: host, + useSourceOfProjectReferenceRedirect: useSourceOfProjectReferenceRedirect, + toPath: toPath, + getResolvedProjectReferences: getResolvedProjectReferences, + getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, + forEachResolvedProjectReference: forEachResolvedProjectReference + }); var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); // We set `structuralIsReused` to `undefined` because `tryReuseStructureFromOldProgram` calls `tryReuseStructureFromOldProgram` which checks // `structuralIsReused`, which would be a TDZ violation if it was not set in advance to `undefined`. @@ -98467,12 +98880,6 @@ var ts; if (!resolvedProjectReferences) { resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); } - if (host.setResolvedProjectReferenceCallbacks) { - host.setResolvedProjectReferenceCallbacks({ - getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, - forEachResolvedProjectReference: forEachResolvedProjectReference - }); - } if (rootNames.length) { for (var _i = 0, resolvedProjectReferences_1 = resolvedProjectReferences; _i < resolvedProjectReferences_1.length; _i++) { var parsedRef = resolvedProjectReferences_1[_i]; @@ -98481,8 +98888,8 @@ var ts; var out = parsedRef.commandLine.options.outFile || parsedRef.commandLine.options.out; if (useSourceOfProjectReferenceRedirect) { if (out || ts.getEmitModuleKind(parsedRef.commandLine.options) === ts.ModuleKind.None) { - for (var _a = 0, _b = parsedRef.commandLine.fileNames; _a < _b.length; _a++) { - var fileName = _b[_a]; + for (var _b = 0, _c = parsedRef.commandLine.fileNames; _b < _c.length; _b++) { + var fileName = _c[_b]; processSourceFile(fileName, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined); } } @@ -98492,8 +98899,8 @@ var ts; processSourceFile(ts.changeExtension(out, ".d.ts"), /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined); } else if (ts.getEmitModuleKind(parsedRef.commandLine.options) === ts.ModuleKind.None) { - for (var _c = 0, _d = parsedRef.commandLine.fileNames; _c < _d.length; _c++) { - var fileName = _d[_c]; + for (var _d = 0, _e = parsedRef.commandLine.fileNames; _d < _e.length; _d++) { + var fileName = _e[_d]; if (!ts.fileExtensionIs(fileName, ".d.ts" /* Dts */) && !ts.fileExtensionIs(fileName, ".json" /* Json */)) { processSourceFile(ts.getOutputDeclarationFileName(fileName, parsedRef.commandLine, !host.useCaseSensitiveFileNames()), /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined); } @@ -98545,8 +98952,8 @@ var ts; // not part of the new program. if (oldProgram && host.onReleaseOldSourceFile) { var oldSourceFiles = oldProgram.getSourceFiles(); - for (var _e = 0, oldSourceFiles_1 = oldSourceFiles; _e < oldSourceFiles_1.length; _e++) { - var oldSourceFile = oldSourceFiles_1[_e]; + for (var _f = 0, oldSourceFiles_1 = oldSourceFiles; _f < oldSourceFiles_1.length; _f++) { + var oldSourceFile = oldSourceFiles_1[_f]; var newFile = getSourceFileByPath(oldSourceFile.resolvedPath); if (shouldCreateNewSourceFile || !newFile || // old file wasnt redirect but new file is @@ -98611,8 +99018,10 @@ var ts; forEachResolvedProjectReference: forEachResolvedProjectReference, isSourceOfProjectReferenceRedirect: isSourceOfProjectReferenceRedirect, emitBuildInfo: emitBuildInfo, - getProbableSymlinks: getProbableSymlinks + getProbableSymlinks: getProbableSymlinks, + useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); }, }; + onProgramCreateComplete(); verifyCompilerOptions(); ts.performance.mark("afterProgram"); ts.performance.measure("Program", "beforeProgram", "afterProgram"); @@ -98858,12 +99267,6 @@ var ts; } if (projectReferences) { resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); - if (host.setResolvedProjectReferenceCallbacks) { - host.setResolvedProjectReferenceCallbacks({ - getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, - forEachResolvedProjectReference: forEachResolvedProjectReference - }); - } } // check if program source files has changed in the way that can affect structure of the program var newSourceFiles = []; @@ -99187,19 +99590,19 @@ var ts; } var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName); var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName); - var diagnostics; - for (var _i = 0, _a = [fileProcessingDiagnosticsInFile, programDiagnosticsInFile]; _i < _a.length; _i++) { - var diags = _a[_i]; - if (diags) { - for (var _b = 0, diags_4 = diags; _b < diags_4.length; _b++) { - var diag = diags_4[_b]; - if (shouldReportDiagnostic(diag)) { - diagnostics = ts.append(diagnostics, diag); - } - } - } + return getMergedProgramDiagnostics(sourceFile, fileProcessingDiagnosticsInFile, programDiagnosticsInFile); + } + function getMergedProgramDiagnostics(sourceFile) { + var allDiagnostics = []; + for (var _i = 1; _i < arguments.length; _i++) { + allDiagnostics[_i - 1] = arguments[_i]; } - return diagnostics || ts.emptyArray; + var _a; + var flatDiagnostics = ts.flatten(allDiagnostics); + if (!((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { + return flatDiagnostics; + } + return getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics).diagnostics; } function getDeclarationDiagnostics(sourceFile, cancellationToken) { var options = program.getCompilerOptions(); @@ -99263,49 +99666,66 @@ var ts; sourceFile.scriptKind === 5 /* External */ || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */); var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray; var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray; - var diagnostics; - for (var _i = 0, _a = [bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined]; _i < _a.length; _i++) { - var diags = _a[_i]; - if (diags) { - for (var _b = 0, diags_5 = diags; _b < diags_5.length; _b++) { - var diag = diags_5[_b]; - if (shouldReportDiagnostic(diag)) { - diagnostics = ts.append(diagnostics, diag); - } - } - } - } - return diagnostics || ts.emptyArray; + return getMergedBindAndCheckDiagnostics(sourceFile, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined); }); } + function getMergedBindAndCheckDiagnostics(sourceFile) { + var allDiagnostics = []; + for (var _i = 1; _i < arguments.length; _i++) { + allDiagnostics[_i - 1] = arguments[_i]; + } + var _a; + var flatDiagnostics = ts.flatten(allDiagnostics); + if (!((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { + return flatDiagnostics; + } + var _b = getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics), diagnostics = _b.diagnostics, directives = _b.directives; + for (var _c = 0, _d = directives.getUnusedExpectations(); _c < _d.length; _c++) { + var errorExpectation = _d[_c]; + diagnostics.push(ts.createDiagnosticForRange(sourceFile, errorExpectation.range, ts.Diagnostics.Unused_ts_expect_error_directive)); + } + return diagnostics; + } + /** + * Creates a map of comment directives along with the diagnostics immediately preceded by one of them. + * Comments that match to any of those diagnostics are marked as used. + */ + function getDiagnosticsWithPrecedingDirectives(sourceFile, commentDirectives, flatDiagnostics) { + // Diagnostics are only reported if there is no comment directive preceding them + // This will modify the directives map by marking "used" ones with a corresponding diagnostic + var directives = ts.createCommentDirectivesMap(sourceFile, commentDirectives); + var diagnostics = flatDiagnostics.filter(function (diagnostic) { return markPrecedingCommentDirectiveLine(diagnostic, directives) === -1; }); + return { diagnostics: diagnostics, directives: directives }; + } function getSuggestionDiagnostics(sourceFile, cancellationToken) { return runWithCancellationToken(function () { return getDiagnosticsProducingTypeChecker().getSuggestionDiagnostics(sourceFile, cancellationToken); }); } /** - * Skip errors if previous line start with '// @ts-ignore' comment, not counting non-empty non-comment lines + * @returns The line index marked as preceding the diagnostic, or -1 if none was. */ - function shouldReportDiagnostic(diagnostic) { + function markPrecedingCommentDirectiveLine(diagnostic, directives) { var file = diagnostic.file, start = diagnostic.start; - if (file) { - var lineStarts = ts.getLineStarts(file); - var line = ts.computeLineAndCharacterOfPosition(lineStarts, start).line; // TODO: GH#18217 - while (line > 0) { - var previousLineText = file.text.slice(lineStarts[line - 1], lineStarts[line]); - var result = ignoreDiagnosticCommentRegEx.exec(previousLineText); - if (!result) { - // non-empty line - return true; - } - if (result[3]) { - // @ts-ignore - return false; - } - line--; + if (!file) { + return -1; + } + // Start out with the line just before the text + var lineStarts = ts.getLineStarts(file); + var line = ts.computeLineAndCharacterOfPosition(lineStarts, start).line - 1; // TODO: GH#18217 + while (line >= 0) { + // As soon as that line is known to have a comment directive, use that + if (directives.markUsed(line)) { + return line; + } + // Stop searching if the line is not empty and not a comment + var lineText = file.text.slice(lineStarts[line - 1], lineStarts[line]).trim(); + if (lineText !== "" && !/^(\s*)\/\/(.*)$/.test(lineText)) { + return -1; } + line--; } - return true; + return -1; } function getJSSyntacticDiagnosticsForFile(sourceFile) { return runWithCancellationToken(function () { @@ -99317,22 +99737,22 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 156 /* Parameter */: - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: + case 157 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); return "skip"; } // falls through - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: - case 242 /* VariableDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: + case 243 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); @@ -99340,58 +99760,58 @@ var ts; } } switch (node.kind) { - case 255 /* ImportClause */: + case 256 /* ImportClause */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node.parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); return "skip"; } break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); return "skip"; } break; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_TypeScript_files)); return "skip"; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 113 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: var interfaceKeyword = ts.tokenToString(114 /* InterfaceKeyword */); ts.Debug.assertIsDefined(interfaceKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); return "skip"; - case 249 /* ModuleDeclaration */: - var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(136 /* NamespaceKeyword */) : ts.tokenToString(135 /* ModuleKeyword */); + case 250 /* ModuleDeclaration */: + var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(137 /* NamespaceKeyword */) : ts.tokenToString(136 /* ModuleKeyword */); ts.Debug.assertIsDefined(moduleKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); return "skip"; - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); return "skip"; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: var enumKeyword = ts.Debug.checkDefined(ts.tokenToString(88 /* EnumKeyword */)); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); return "skip"; - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 217 /* AsExpression */: + case 218 /* AsExpression */: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } } @@ -99400,29 +99820,29 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); } switch (parent.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } // falls through - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - checkModifiers(parent.modifiers, parent.kind === 225 /* VariableStatement */); + checkModifiers(parent.modifiers, parent.kind === 226 /* VariableStatement */); return "skip"; } break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -99434,19 +99854,19 @@ var ts; return "skip"; } break; - case 156 /* Parameter */: + case 157 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 216 /* ExpressionWithTypeArguments */: - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: - case 198 /* TaggedTemplateExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 217 /* ExpressionWithTypeArguments */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 199 /* TaggedTemplateExpression */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); @@ -99468,8 +99888,8 @@ var ts; case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - case 138 /* ReadonlyKeyword */: - case 130 /* DeclareKeyword */: + case 139 /* ReadonlyKeyword */: + case 131 /* DeclareKeyword */: case 122 /* AbstractKeyword */: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind))); break; @@ -100711,6 +101131,155 @@ var ts; } } ts.createProgram = createProgram; + function updateHostForUseSourceOfProjectReferenceRedirect(host) { + var mapOfDeclarationDirectories; + var symlinkedDirectories; + var symlinkedFiles; + var originalFileExists = host.compilerHost.fileExists; + var originalDirectoryExists = host.compilerHost.directoryExists; + var originalGetDirectories = host.compilerHost.getDirectories; + var originalRealpath = host.compilerHost.realpath; + if (!host.useSourceOfProjectReferenceRedirect) + return ts.noop; + // This implementation of fileExists checks if the file being requested is + // .d.ts file for the referenced Project. + // If it is it returns true irrespective of whether that file exists on host + host.compilerHost.fileExists = function (file) { + if (originalFileExists.call(host.compilerHost, file)) + return true; + if (!host.getResolvedProjectReferences()) + return false; + if (!ts.isDeclarationFileName(file)) + return false; + // Project references go to source file instead of .d.ts file + return fileOrDirectoryExistsUsingSource(file, /*isFile*/ true); + }; + if (originalDirectoryExists) { + // This implementation of directoryExists checks if the directory being requested is + // directory of .d.ts file for the referenced Project. + // If it is it returns true irrespective of whether that directory exists on host + host.compilerHost.directoryExists = function (path) { + if (originalDirectoryExists.call(host.compilerHost, path)) { + handleDirectoryCouldBeSymlink(path); + return true; + } + if (!host.getResolvedProjectReferences()) + return false; + if (!mapOfDeclarationDirectories) { + mapOfDeclarationDirectories = ts.createMap(); + host.forEachResolvedProjectReference(function (ref) { + if (!ref) + return; + var out = ref.commandLine.options.outFile || ref.commandLine.options.out; + if (out) { + mapOfDeclarationDirectories.set(ts.getDirectoryPath(host.toPath(out)), true); + } + else { + // Set declaration's in different locations only, if they are next to source the directory present doesnt change + var declarationDir = ref.commandLine.options.declarationDir || ref.commandLine.options.outDir; + if (declarationDir) { + mapOfDeclarationDirectories.set(host.toPath(declarationDir), true); + } + } + }); + } + return fileOrDirectoryExistsUsingSource(path, /*isFile*/ false); + }; + } + if (originalGetDirectories) { + // Call getDirectories only if directory actually present on the host + // This is needed to ensure that we arent getting directories that we fake about presence for + host.compilerHost.getDirectories = function (path) { + return !host.getResolvedProjectReferences() || (originalDirectoryExists && originalDirectoryExists.call(host.compilerHost, path)) ? + originalGetDirectories.call(host.compilerHost, path) : + []; + }; + } + // This is something we keep for life time of the host + if (originalRealpath) { + host.compilerHost.realpath = function (s) { + return (symlinkedFiles === null || symlinkedFiles === void 0 ? void 0 : symlinkedFiles.get(host.toPath(s))) || + originalRealpath.call(host.compilerHost, s); + }; + } + return onProgramCreateComplete; + function onProgramCreateComplete() { + host.compilerHost.fileExists = originalFileExists; + host.compilerHost.directoryExists = originalDirectoryExists; + host.compilerHost.getDirectories = originalGetDirectories; + // DO not revert realpath as it could be used later + } + function fileExistsIfProjectReferenceDts(file) { + var source = host.getSourceOfProjectReferenceRedirect(file); + return source !== undefined ? + ts.isString(source) ? originalFileExists.call(host.compilerHost, source) : true : + undefined; + } + function directoryExistsIfProjectReferenceDeclDir(dir) { + var dirPath = host.toPath(dir); + var dirPathWithTrailingDirectorySeparator = "" + dirPath + ts.directorySeparator; + return ts.forEachKey(mapOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath || + // Any parent directory of declaration dir + ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) || + // Any directory inside declaration dir + ts.startsWith(dirPath, declDirPath + "/"); }); + } + function handleDirectoryCouldBeSymlink(directory) { + if (!host.getResolvedProjectReferences()) + return; + // Because we already watch node_modules, handle symlinks in there + if (!originalRealpath || !ts.stringContains(directory, ts.nodeModulesPathPart)) + return; + if (!symlinkedDirectories) + symlinkedDirectories = ts.createMap(); + var directoryPath = ts.ensureTrailingDirectorySeparator(host.toPath(directory)); + if (symlinkedDirectories.has(directoryPath)) + return; + var real = ts.normalizePath(originalRealpath.call(host.compilerHost, directory)); + var realPath; + if (real === directory || + (realPath = ts.ensureTrailingDirectorySeparator(host.toPath(real))) === directoryPath) { + // not symlinked + symlinkedDirectories.set(directoryPath, false); + return; + } + symlinkedDirectories.set(directoryPath, { + real: ts.ensureTrailingDirectorySeparator(real), + realPath: realPath + }); + } + function fileOrDirectoryExistsUsingSource(fileOrDirectory, isFile) { + var fileOrDirectoryExistsUsingSource = isFile ? + function (file) { return fileExistsIfProjectReferenceDts(file); } : + function (dir) { return directoryExistsIfProjectReferenceDeclDir(dir); }; + // Check current directory or file + var result = fileOrDirectoryExistsUsingSource(fileOrDirectory); + if (result !== undefined) + return result; + if (!symlinkedDirectories) + return false; + var fileOrDirectoryPath = host.toPath(fileOrDirectory); + if (!ts.stringContains(fileOrDirectoryPath, ts.nodeModulesPathPart)) + return false; + if (isFile && symlinkedFiles && symlinkedFiles.has(fileOrDirectoryPath)) + return true; + // If it contains node_modules check if its one of the symlinked path we know of + return ts.firstDefinedIterator(symlinkedDirectories.entries(), function (_a) { + var directoryPath = _a[0], symlinkedDirectory = _a[1]; + if (!symlinkedDirectory || !ts.startsWith(fileOrDirectoryPath, directoryPath)) + return undefined; + var result = fileOrDirectoryExistsUsingSource(fileOrDirectoryPath.replace(directoryPath, symlinkedDirectory.realPath)); + if (isFile && result) { + if (!symlinkedFiles) + symlinkedFiles = ts.createMap(); + // Store the real path for the file' + var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory()); + symlinkedFiles.set(fileOrDirectoryPath, "" + symlinkedDirectory.real + absolutePath.replace(new RegExp(directoryPath, "i"), "")); + } + return result; + }) || false; + } + } /*@internal*/ function handleNoEmitOptions(program, sourceFile, cancellationToken) { var options = program.getCompilerOptions(); @@ -101331,6 +101900,7 @@ var ts; state.affectedFilesPendingEmit = oldState.affectedFilesPendingEmit.slice(); state.affectedFilesPendingEmitKind = ts.cloneMapOrUndefined(oldState.affectedFilesPendingEmitKind); state.affectedFilesPendingEmitIndex = oldState.affectedFilesPendingEmitIndex; + state.seenAffectedFiles = ts.createMap(); } } // Update changed files and copy semantic diagnostics if we can @@ -101376,8 +101946,8 @@ var ts; if (oldCompilerOptions && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) { // Add all files to affectedFilesPendingEmit since emit changed newProgram.getSourceFiles().forEach(function (f) { return addToAffectedFilesPendingEmit(state, f.resolvedPath, 1 /* Full */); }); - ts.Debug.assert(state.seenAffectedFiles === undefined); - state.seenAffectedFiles = ts.createMap(); + ts.Debug.assert(!state.seenAffectedFiles || !state.seenAffectedFiles.size); + state.seenAffectedFiles = state.seenAffectedFiles || ts.createMap(); } state.emittedBuildInfo = !state.changedFilesSet.size && !state.affectedFilesPendingEmit; return state; @@ -102257,13 +102827,13 @@ var ts; return true; } ts.canWatchDirectory = canWatchDirectory; - ts.maxNumberOfFilesToIterateForInvalidation = 256; function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) { var filesWithChangedSetOfUnresolvedImports; var filesWithInvalidatedResolutions; var filesWithInvalidatedNonRelativeUnresolvedImports; - var allFilesHaveInvalidatedResolution = false; var nonRelativeExternalModuleResolutions = ts.createMultiMap(); + var resolutionsWithFailedLookups = []; + var resolvedFileToResolution = ts.createMultiMap(); var getCurrentDirectory = ts.memoize(function () { return resolutionHost.getCurrentDirectory(); }); // TODO: GH#18217 var cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost(); // The resolvedModuleNames and resolvedTypeReferenceDirectives are the cache of resolutions per file. @@ -102327,7 +102897,8 @@ var ts; closeTypeRootsWatch(); resolvedModuleNames.clear(); resolvedTypeReferenceDirectives.clear(); - allFilesHaveInvalidatedResolution = false; + resolvedFileToResolution.clear(); + resolutionsWithFailedLookups.length = 0; // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update // (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution) clearPerDirectoryResolutions(); @@ -102349,7 +102920,7 @@ var ts; return !!value && !!value.length; } function createHasInvalidatedResolution(forceAllFilesAsInvalidated) { - if (allFilesHaveInvalidatedResolution || forceAllFilesAsInvalidated) { + if (forceAllFilesAsInvalidated) { // Any file asked would have invalidated resolution filesWithInvalidatedResolutions = undefined; return ts.returnTrue; @@ -102367,7 +102938,6 @@ var ts; nonRelativeExternalModuleResolutions.clear(); } function finishCachingPerDirectoryResolution() { - allFilesHaveInvalidatedResolution = false; filesWithInvalidatedNonRelativeUnresolvedImports = undefined; clearPerDirectoryResolutions(); directoryWatchesOfFailedLookups.forEach(function (watcher, path) { @@ -102378,6 +102948,7 @@ var ts; }); } function resolveModuleName(moduleName, containingFile, compilerOptions, host, redirectedReference) { + var _a; var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference); // return result immediately only if global cache support is not enabled or if it is .ts, .tsx or .d.ts if (!resolutionHost.getGlobalCache) { @@ -102388,15 +102959,20 @@ var ts; if (globalCache !== undefined && !ts.isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && ts.extensionIsTS(primaryResult.resolvedModule.extension))) { // create different collection of failed lookup locations for second pass // if it will fail and we've already found something during the first pass - we don't want to pollute its results - var _a = ts.loadModuleFromGlobalCache(ts.Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName), resolutionHost.projectName, compilerOptions, host, globalCache), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations; + var _b = ts.loadModuleFromGlobalCache(ts.Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName), resolutionHost.projectName, compilerOptions, host, globalCache), resolvedModule = _b.resolvedModule, failedLookupLocations = _b.failedLookupLocations; if (resolvedModule) { - return { resolvedModule: resolvedModule, failedLookupLocations: ts.addRange(primaryResult.failedLookupLocations, failedLookupLocations) }; + // Modify existing resolution so its saved in the directory cache as well + primaryResult.resolvedModule = resolvedModule; + (_a = primaryResult.failedLookupLocations).push.apply(_a, failedLookupLocations); + return primaryResult; } } // Default return the result from the first pass return primaryResult; } - function resolveNamesWithLocalCache(names, containingFile, redirectedReference, cache, perDirectoryCacheWithRedirects, loader, getResolutionWithResolvedFileName, shouldRetryResolution, reusedNames, logChanges) { + function resolveNamesWithLocalCache(_a) { + var names = _a.names, containingFile = _a.containingFile, redirectedReference = _a.redirectedReference, cache = _a.cache, perDirectoryCacheWithRedirects = _a.perDirectoryCacheWithRedirects, loader = _a.loader, getResolutionWithResolvedFileName = _a.getResolutionWithResolvedFileName, shouldRetryResolution = _a.shouldRetryResolution, reusedNames = _a.reusedNames, logChanges = _a.logChanges; + var _b; var path = resolutionHost.toPath(containingFile); var resolutionsInFile = cache.get(path) || cache.set(path, ts.createMap()).get(path); var dirPath = ts.getDirectoryPath(path); @@ -102421,7 +102997,7 @@ var ts; var resolution = resolutionsInFile.get(name); // Resolution is valid if it is present and not invalidated if (!seenNamesInFile.has(name) && - allFilesHaveInvalidatedResolution || unmatchedRedirects || !resolution || resolution.isInvalidated || + unmatchedRedirects || !resolution || resolution.isInvalidated || // If the name is unresolved import that was invalidated, recalculate (hasInvalidatedNonRelativeUnresolvedImport && !ts.isExternalModuleNameRelative(name) && shouldRetryResolution(resolution))) { var existingResolution = resolution; @@ -102430,13 +103006,13 @@ var ts; resolution = resolutionInDirectory; } else { - resolution = loader(name, containingFile, compilerOptions, resolutionHost, redirectedReference); + resolution = loader(name, containingFile, compilerOptions, ((_b = resolutionHost.getCompilerHost) === null || _b === void 0 ? void 0 : _b.call(resolutionHost)) || resolutionHost, redirectedReference); perDirectoryResolution.set(name, resolution); } resolutionsInFile.set(name, resolution); - watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution); + watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName); if (existingResolution) { - stopWatchFailedLookupLocationOfResolution(existingResolution); + stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName); } if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) { filesWithChangedSetOfUnresolvedImports.push(path); @@ -102451,7 +103027,7 @@ var ts; // Stop watching and remove the unused name resolutionsInFile.forEach(function (resolution, name) { if (!seenNamesInFile.has(name) && !ts.contains(reusedNames, name)) { - stopWatchFailedLookupLocationOfResolution(resolution); + stopWatchFailedLookupLocationOfResolution(resolution, path, getResolutionWithResolvedFileName); resolutionsInFile.delete(name); } }); @@ -102475,21 +103051,35 @@ var ts; } } function resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference) { - return resolveNamesWithLocalCache(typeDirectiveNames, containingFile, redirectedReference, resolvedTypeReferenceDirectives, perDirectoryResolvedTypeReferenceDirectives, ts.resolveTypeReferenceDirective, getResolvedTypeReferenceDirective, - /*shouldRetryResolution*/ function (resolution) { return resolution.resolvedTypeReferenceDirective === undefined; }, - /*reusedNames*/ undefined, /*logChanges*/ false); + return resolveNamesWithLocalCache({ + names: typeDirectiveNames, + containingFile: containingFile, + redirectedReference: redirectedReference, + cache: resolvedTypeReferenceDirectives, + perDirectoryCacheWithRedirects: perDirectoryResolvedTypeReferenceDirectives, + loader: ts.resolveTypeReferenceDirective, + getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective, + shouldRetryResolution: function (resolution) { return resolution.resolvedTypeReferenceDirective === undefined; }, + }); } function resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference) { - return resolveNamesWithLocalCache(moduleNames, containingFile, redirectedReference, resolvedModuleNames, perDirectoryResolvedModuleNames, resolveModuleName, getResolvedModule, - /*shouldRetryResolution*/ function (resolution) { return !resolution.resolvedModule || !ts.resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension); }, reusedNames, logChangesWhenResolvingModule); + return resolveNamesWithLocalCache({ + names: moduleNames, + containingFile: containingFile, + redirectedReference: redirectedReference, + cache: resolvedModuleNames, + perDirectoryCacheWithRedirects: perDirectoryResolvedModuleNames, + loader: resolveModuleName, + getResolutionWithResolvedFileName: getResolvedModule, + shouldRetryResolution: function (resolution) { return !resolution.resolvedModule || !ts.resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension); }, + reusedNames: reusedNames, + logChanges: logChangesWhenResolvingModule + }); } function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName, containingFile) { var cache = resolvedModuleNames.get(resolutionHost.toPath(containingFile)); return cache && cache.get(moduleName); } - function isNodeModulesDirectory(dirPath) { - return ts.endsWith(dirPath, "/node_modules"); - } function isNodeModulesAtTypesDirectory(dirPath) { return ts.endsWith(dirPath, "/node_modules/@types"); } @@ -102525,7 +103115,7 @@ var ts; dirPath = ts.getDirectoryPath(dirPath); } // If the directory is node_modules use it to watch, always watch it recursively - if (isNodeModulesDirectory(dirPath)) { + if (ts.isNodeModulesDirectory(dirPath)) { return canWatchDirectory(ts.getDirectoryPath(dirPath)) ? { dir: dir, dirPath: dirPath } : undefined; } var nonRecursive = true; @@ -102549,26 +103139,33 @@ var ts; function isPathWithDefaultFailedLookupExtension(path) { return ts.fileExtensionIsOneOf(path, failedLookupDefaultExtensions); } - function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution) { - // No need to set the resolution refCount - if (resolution.failedLookupLocations && resolution.failedLookupLocations.length) { - if (resolution.refCount) { - resolution.refCount++; + function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName) { + if (resolution.refCount) { + resolution.refCount++; + ts.Debug.assertDefined(resolution.files); + } + else { + resolution.refCount = 1; + ts.Debug.assert(resolution.files === undefined); + if (ts.isExternalModuleNameRelative(name)) { + watchFailedLookupLocationOfResolution(resolution); } else { - resolution.refCount = 1; - if (ts.isExternalModuleNameRelative(name)) { - watchFailedLookupLocationOfResolution(resolution); - } - else { - nonRelativeExternalModuleResolutions.add(name, resolution); - } + nonRelativeExternalModuleResolutions.add(name, resolution); + } + var resolved = getResolutionWithResolvedFileName(resolution); + if (resolved && resolved.resolvedFileName) { + resolvedFileToResolution.add(resolutionHost.toPath(resolved.resolvedFileName), resolution); } } + (resolution.files || (resolution.files = [])).push(filePath); } function watchFailedLookupLocationOfResolution(resolution) { ts.Debug.assert(!!resolution.refCount); var failedLookupLocations = resolution.failedLookupLocations; + if (!failedLookupLocations.length) + return; + resolutionsWithFailedLookups.push(resolution); var setAtRoot = false; for (var _i = 0, failedLookupLocations_1 = failedLookupLocations; _i < failedLookupLocations_1.length; _i++) { var failedLookupLocation = failedLookupLocations_1[_i]; @@ -102596,14 +103193,11 @@ var ts; setDirectoryWatcher(rootDir, rootPath, /*nonRecursive*/ true); // TODO: GH#18217 } } - function setRefCountToUndefined(resolution) { - resolution.refCount = undefined; - } function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name) { var program = resolutionHost.getCurrentProgram(); - var updateResolution = program && program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name) ? - setRefCountToUndefined : watchFailedLookupLocationOfResolution; - resolutions.forEach(updateResolution); + if (!program || !program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name)) { + resolutions.forEach(watchFailedLookupLocationOfResolution); + } } function setDirectoryWatcher(dir, dirPath, nonRecursive) { var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); @@ -102615,14 +103209,20 @@ var ts; directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath, nonRecursive), refCount: 1, nonRecursive: nonRecursive }); } } - function stopWatchFailedLookupLocationOfResolution(resolution) { - if (!resolution.refCount) { - return; - } + function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName) { + ts.unorderedRemoveItem(ts.Debug.assertDefined(resolution.files), filePath); resolution.refCount--; if (resolution.refCount) { return; } + var resolved = getResolutionWithResolvedFileName(resolution); + if (resolved && resolved.resolvedFileName) { + resolvedFileToResolution.remove(resolutionHost.toPath(resolved.resolvedFileName), resolution); + } + if (!ts.unorderedRemoveItem(resolutionsWithFailedLookups, resolution)) { + // If not watching failed lookups, it wont be there in resolutionsWithFailedLookups + return; + } var failedLookupLocations = resolution.failedLookupLocations; var removeAtRoot = false; for (var _i = 0, failedLookupLocations_2 = failedLookupLocations; _i < failedLookupLocations_2.length; _i++) { @@ -102665,16 +103265,16 @@ var ts; // Since the file existence changed, update the sourceFiles cache cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); } - if (!allFilesHaveInvalidatedResolution && invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath)) { + if (invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath)) { resolutionHost.onInvalidatedResolution(); } }, nonRecursive ? 0 /* None */ : 1 /* Recursive */); } - function removeResolutionsOfFileFromCache(cache, filePath) { + function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName) { // Deleted file, stop watching failed lookups for all the resolutions in the file var resolutions = cache.get(filePath); if (resolutions) { - resolutions.forEach(stopWatchFailedLookupLocationOfResolution); + resolutions.forEach(function (resolution) { return stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName); }); cache.delete(filePath); } } @@ -102695,57 +103295,26 @@ var ts; resolvedProjectReference.commandLine.fileNames.forEach(function (f) { return removeResolutionsOfFile(resolutionHost.toPath(f)); }); } function removeResolutionsOfFile(filePath) { - removeResolutionsOfFileFromCache(resolvedModuleNames, filePath); - removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath); - } - function invalidateResolutionCache(cache, isInvalidatedResolution, getResolutionWithResolvedFileName) { - var seen = ts.createMap(); - cache.forEach(function (resolutions, containingFilePath) { - var dirPath = ts.getDirectoryPath(containingFilePath); - var seenInDir = seen.get(dirPath); - if (!seenInDir) { - seenInDir = ts.createMap(); - seen.set(dirPath, seenInDir); - } - resolutions.forEach(function (resolution, name) { - if (seenInDir.has(name)) { - return; - } - seenInDir.set(name, true); - if (!resolution.isInvalidated && isInvalidatedResolution(resolution, getResolutionWithResolvedFileName)) { - // Mark the file as needing re-evaluation of module resolution instead of using it blindly. - resolution.isInvalidated = true; - (filesWithInvalidatedResolutions || (filesWithInvalidatedResolutions = ts.createMap())).set(containingFilePath, true); - // When its a file with inferred types resolution, invalidate type reference directive resolution - if (ts.endsWith(containingFilePath, ts.inferredTypesContainingFile)) { - resolutionHost.onChangedAutomaticTypeDirectiveNames(); - } - } - }); - }); - } - function hasReachedResolutionIterationLimit() { - var maxSize = resolutionHost.maxNumberOfFilesToIterateForInvalidation || ts.maxNumberOfFilesToIterateForInvalidation; - return resolvedModuleNames.size > maxSize || resolvedTypeReferenceDirectives.size > maxSize; - } - function invalidateResolutions(isInvalidatedResolution) { - // If more than maxNumberOfFilesToIterateForInvalidation present, - // just invalidated all files and recalculate the resolutions for files instead - if (hasReachedResolutionIterationLimit()) { - allFilesHaveInvalidatedResolution = true; - return; + removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule); + removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective); + } + function invalidateResolution(resolution) { + resolution.isInvalidated = true; + var changedInAutoTypeReferenced = false; + for (var _i = 0, _a = ts.Debug.assertDefined(resolution.files); _i < _a.length; _i++) { + var containingFilePath = _a[_i]; + (filesWithInvalidatedResolutions || (filesWithInvalidatedResolutions = ts.createMap())).set(containingFilePath, true); + // When its a file with inferred types resolution, invalidate type reference directive resolution + changedInAutoTypeReferenced = changedInAutoTypeReferenced || containingFilePath.endsWith(ts.inferredTypesContainingFile); + } + if (changedInAutoTypeReferenced) { + resolutionHost.onChangedAutomaticTypeDirectiveNames(); } - invalidateResolutionCache(resolvedModuleNames, isInvalidatedResolution, getResolvedModule); - invalidateResolutionCache(resolvedTypeReferenceDirectives, isInvalidatedResolution, getResolvedTypeReferenceDirective); } function invalidateResolutionOfFile(filePath) { removeResolutionsOfFile(filePath); - invalidateResolutions( // Resolution is invalidated if the resulting file name is same as the deleted file path - function (resolution, getResolutionWithResolvedFileName) { - var result = getResolutionWithResolvedFileName(resolution); - return !!result && resolutionHost.toPath(result.resolvedFileName) === filePath; // TODO: GH#18217 - }); + ts.forEach(resolvedFileToResolution.get(filePath), invalidateResolution); } function setFilesWithInvalidatedNonRelativeUnresolvedImports(filesMap) { ts.Debug.assert(filesWithInvalidatedNonRelativeUnresolvedImports === filesMap || filesWithInvalidatedNonRelativeUnresolvedImports === undefined); @@ -102771,8 +103340,8 @@ var ts; // Some file or directory in the watching directory is created // Return early if it does not have any of the watching extension or not the custom failed lookup path var dirOfFileOrDirectory = ts.getDirectoryPath(fileOrDirectoryPath); - if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || isNodeModulesDirectory(fileOrDirectoryPath) || - isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || isNodeModulesDirectory(dirOfFileOrDirectory)) { + if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || ts.isNodeModulesDirectory(fileOrDirectoryPath) || + isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || ts.isNodeModulesDirectory(dirOfFileOrDirectory)) { // Invalidate any resolution from this directory isChangedFailedLookupLocation = function (location) { var locationPath = resolutionHost.toPath(location); @@ -102791,20 +103360,21 @@ var ts; isChangedFailedLookupLocation = function (location) { return resolutionHost.toPath(location) === fileOrDirectoryPath; }; } } - var hasChangedFailedLookupLocation = function (resolution) { return ts.some(resolution.failedLookupLocations, isChangedFailedLookupLocation); }; - var invalidatedFilesCount = filesWithInvalidatedResolutions && filesWithInvalidatedResolutions.size; - invalidateResolutions( + var invalidated = false; // Resolution is invalidated if the resulting file name is same as the deleted file path - hasChangedFailedLookupLocation); - return allFilesHaveInvalidatedResolution || filesWithInvalidatedResolutions && filesWithInvalidatedResolutions.size !== invalidatedFilesCount; + for (var _i = 0, resolutionsWithFailedLookups_1 = resolutionsWithFailedLookups; _i < resolutionsWithFailedLookups_1.length; _i++) { + var resolution = resolutionsWithFailedLookups_1[_i]; + if (resolution.failedLookupLocations.some(isChangedFailedLookupLocation)) { + invalidateResolution(resolution); + invalidated = true; + } + } + return invalidated; } function closeTypeRootsWatch() { ts.clearMap(typeRootsWatches, ts.closeFileWatcher); } function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath) { - if (allFilesHaveInvalidatedResolution) { - return undefined; - } if (isInDirectoryPath(rootPath, typeRootPath)) { return rootPath; } @@ -103003,38 +103573,52 @@ var ts; function comparePathsByNumberOfDirectorySeparators(a, b) { return ts.compareValues(numberOfDirectorySeparators(a), numberOfDirectorySeparators(b)); } - /** - * Looks for existing imports that use symlinks to this module. - * Symlinks will be returned first so they are preferred over the real path. - */ - function getAllModulePaths(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap) { + function forEachFileNameOfModule(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap, preferSymlinks, cb) { var redirects = redirectTargetsMap.get(importedFileName); var importedFileNames = redirects ? __spreadArrays(redirects, [importedFileName]) : [importedFileName]; var cwd = host.getCurrentDirectory ? host.getCurrentDirectory() : ""; var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); }); + if (!preferSymlinks) { + var result_10 = ts.forEach(targets, cb); + if (result_10) + return result_10; + } var links = host.getProbableSymlinks ? host.getProbableSymlinks(files) : ts.discoverProbableSymlinks(files, getCanonicalFileName, cwd); - var result = []; var compareStrings = (!host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames()) ? ts.compareStringsCaseSensitive : ts.compareStringsCaseInsensitive; - links.forEach(function (resolved, path) { + var result = ts.forEachEntry(links, function (resolved, path) { if (ts.startsWithDirectory(importingFileName, resolved, getCanonicalFileName)) { - return; // Don't want to a package to globally import from itself + return undefined; // Don't want to a package to globally import from itself } var target = ts.find(targets, function (t) { return compareStrings(t.slice(0, resolved.length + 1), resolved + "/") === 0 /* EqualTo */; }); if (target === undefined) - return; + return undefined; var relative = ts.getRelativePathFromDirectory(resolved, target, getCanonicalFileName); var option = ts.resolvePath(path, relative); if (!host.fileExists || host.fileExists(option)) { - result.push(option); + var result_11 = cb(option); + if (result_11) + return result_11; } }); - result.push.apply(result, targets); - if (result.length < 2) - return result; + return result || + (preferSymlinks ? ts.forEach(targets, cb) : undefined); + } + moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule; + /** + * Looks for existing imports that use symlinks to this module. + * Symlinks will be returned first so they are preferred over the real path. + */ + function getAllModulePaths(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap) { + var cwd = host.getCurrentDirectory ? host.getCurrentDirectory() : ""; + var allFileNames = ts.createMap(); + forEachFileNameOfModule(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap, + /*preferSymlinks*/ true, function (path) { + // dont return value, so we collect everything + allFileNames.set(path, getCanonicalFileName(path)); + }); // Sort by paths closest to importing file Name directory - var allFileNames = ts.arrayToMap(result, ts.identity, getCanonicalFileName); var sortedPaths = []; var _loop_18 = function (directory) { var directoryStart = ts.ensureTrailingDirectorySeparator(directory); @@ -103569,10 +104153,6 @@ var ts; */ function createProgramHost(system, createProgram) { var getDefaultLibLocation = ts.memoize(function () { return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath())); }); - var host = system; - // TODO: `host` is unused! - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - host; return { useCaseSensitiveFileNames: function () { return system.useCaseSensitiveFileNames; }, getNewLine: function () { return system.newLine; }, @@ -103589,7 +104169,6 @@ var ts; trace: function (s) { return system.write(s + system.newLine); }, createDirectory: function (path) { return system.createDirectory(path); }, writeFile: function (path, data, writeByteOrderMark) { return system.writeFile(path, data, writeByteOrderMark); }, - onCachedDirectoryStructureHostCreate: function (cacheHost) { return host = cacheHost || system; }, createHash: ts.maybeBind(system, system.createHash), createProgram: createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram }; @@ -103717,9 +104296,6 @@ var ts; var canConfigFileJsonReportNoInputFiles = false; var hasChangedConfigFileParsingErrors = false; var cachedDirectoryStructureHost = configFileName === undefined ? undefined : ts.createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames); - if (cachedDirectoryStructureHost && host.onCachedDirectoryStructureHostCreate) { - host.onCachedDirectoryStructureHostCreate(cachedDirectoryStructureHost); - } var directoryStructureHost = cachedDirectoryStructureHost || host; var parseConfigFileHost = ts.parseConfigHostFromCompilerHostLike(host, directoryStructureHost); // From tsc we want to get already parsed result and hence check for rootFileNames @@ -103760,6 +104336,7 @@ var ts; // Members for ResolutionCacheHost compilerHost.toPath = toPath; compilerHost.getCompilationSettings = function () { return compilerOptions; }; + compilerHost.useSourceOfProjectReferenceRedirect = ts.maybeBind(host, host.useSourceOfProjectReferenceRedirect); compilerHost.watchDirectoryOfFailedLookupLocation = function (dir, cb, flags) { return watchDirectory(host, dir, cb, flags, watchOptions, ts.WatchType.FailedLookupLocations); }; compilerHost.watchTypeRootsDirectory = function (dir, cb, flags) { return watchDirectory(host, dir, cb, flags, watchOptions, ts.WatchType.TypeRoots); }; compilerHost.getCachedDirectoryStructureHost = function () { return cachedDirectoryStructureHost; }; @@ -103769,7 +104346,6 @@ var ts; scheduleProgramUpdate(); }; compilerHost.fileIsOpen = ts.returnFalse; - compilerHost.maxNumberOfFilesToIterateForInvalidation = host.maxNumberOfFilesToIterateForInvalidation; compilerHost.getCurrentProgram = getCurrentProgram; compilerHost.writeLog = writeLog; // Cache for the module resolution @@ -103802,8 +104378,8 @@ var ts; // Update the wild card directory watch watchConfigFileWildCardDirectories(); return configFileName ? - { getCurrentProgram: getCurrentBuilderProgram, getProgram: synchronizeProgram, close: close } : - { getCurrentProgram: getCurrentBuilderProgram, getProgram: synchronizeProgram, updateRootFileNames: updateRootFileNames, close: close }; + { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close: close } : + { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames: updateRootFileNames, close: close }; function close() { resolutionCache.clear(); ts.clearMap(sourceFilesCache, function (value) { @@ -103851,7 +104427,7 @@ var ts; else { createNewProgram(hasInvalidatedResolution); } - if (host.afterProgramCreate) { + if (host.afterProgramCreate && program !== builderProgram) { host.afterProgramCreate(builderProgram); } return builderProgram; @@ -103867,6 +104443,7 @@ var ts; resolutionCache.startCachingPerDirectoryResolution(); compilerHost.hasInvalidatedResolution = hasInvalidatedResolution; compilerHost.hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames; + hasChangedAutomaticTypeDirectiveNames = false; builderProgram = createProgram(rootFileNames, compilerOptions, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences); resolutionCache.finishCachingPerDirectoryResolution(); // Update watches @@ -103911,7 +104488,7 @@ var ts; // If file is missing on host from cache, we can definitely say file doesnt exist // otherwise we need to ensure from the disk if (isFileMissingOnHost(sourceFilesCache.get(path))) { - return true; + return false; } return directoryStructureHost.fileExists(fileName); } @@ -104008,16 +104585,19 @@ var ts; host.clearTimeout(timerToUpdateProgram); } writeLog("Scheduling update"); - timerToUpdateProgram = host.setTimeout(updateProgram, 250); + timerToUpdateProgram = host.setTimeout(updateProgramWithWatchStatus, 250); } function scheduleProgramReload() { ts.Debug.assert(!!configFileName); reloadLevel = ts.ConfigFileProgramReloadLevel.Full; scheduleProgramUpdate(); } - function updateProgram() { + function updateProgramWithWatchStatus() { timerToUpdateProgram = undefined; reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation); + updateProgram(); + } + function updateProgram() { switch (reloadLevel) { case ts.ConfigFileProgramReloadLevel.Partial: ts.perfLogger.logStartUpdateProgram("PartialConfigReload"); @@ -104033,6 +104613,7 @@ var ts; break; } ts.perfLogger.logStopUpdateProgram("Done"); + return getCurrentBuilderProgram(); } function reloadFileNamesFromConfigFile() { writeLog("Reloading new file names and options"); @@ -105734,6 +106315,7 @@ var ts; placeOpenBraceOnNewLineForFunctions: false, placeOpenBraceOnNewLineForControlBlocks: false, semicolons: SemicolonPreference.Ignore, + trimTrailingWhitespace: true }; } ts.getDefaultFormatCodeSettings = getDefaultFormatCodeSettings; @@ -105964,37 +106546,37 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ts.isInJSFile(node) && ts.getJSDocEnumTag(node) ? 7 /* All */ : 1 /* Value */; - case 156 /* Parameter */: - case 191 /* BindingElement */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 280 /* CatchClause */: - case 273 /* JsxAttribute */: + case 157 /* Parameter */: + case 192 /* BindingElement */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 281 /* CatchClause */: + case 274 /* JsxAttribute */: return 1 /* Value */; - case 155 /* TypeParameter */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 173 /* TypeLiteral */: + case 156 /* TypeParameter */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 174 /* TypeLiteral */: return 2 /* Type */; - case 322 /* JSDocTypedefTag */: + case 323 /* JSDocTypedefTag */: // If it has no name node, it shares the name with the value declaration below it. return node.name === undefined ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */; - case 284 /* EnumMember */: - case 245 /* ClassDeclaration */: + case 285 /* EnumMember */: + case 246 /* ClassDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } @@ -106004,16 +106586,16 @@ var ts; else { return 4 /* Namespace */; } - case 248 /* EnumDeclaration */: - case 257 /* NamedImports */: - case 258 /* ImportSpecifier */: - case 253 /* ImportEqualsDeclaration */: - case 254 /* ImportDeclaration */: - case 259 /* ExportAssignment */: - case 260 /* ExportDeclaration */: + case 249 /* EnumDeclaration */: + case 258 /* NamedImports */: + case 259 /* ImportSpecifier */: + case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 260 /* ExportAssignment */: + case 261 /* ExportDeclaration */: return 7 /* All */; // An external module can be a Value - case 290 /* SourceFile */: + case 291 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 7 /* All */; @@ -106021,10 +106603,10 @@ var ts; ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { node = getAdjustedReferenceLocation(node); - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { return 1 /* Value */; } - else if (node.parent.kind === 259 /* ExportAssignment */ || node.parent.kind === 265 /* ExternalModuleReference */) { + else if (node.parent.kind === 260 /* ExportAssignment */ || node.parent.kind === 266 /* ExternalModuleReference */) { return 7 /* All */; } else if (isInRightSideOfInternalImportEqualsDeclaration(node)) { @@ -106056,11 +106638,11 @@ var ts; // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - var name = node.kind === 153 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; - return name && name.parent.kind === 253 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; + var name = node.kind === 154 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; + return name && name.parent.kind === 254 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 153 /* QualifiedName */) { + while (node.parent.kind === 154 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -106072,27 +106654,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 153 /* QualifiedName */) { - while (root.parent && root.parent.kind === 153 /* QualifiedName */) { + if (root.parent.kind === 154 /* QualifiedName */) { + while (root.parent && root.parent.kind === 154 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 169 /* TypeReference */ && !isLastClause; + return root.parent.kind === 170 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 194 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 194 /* PropertyAccessExpression */) { + if (root.parent.kind === 195 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 195 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 216 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 279 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 217 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 280 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 245 /* ClassDeclaration */ && root.parent.parent.token === 113 /* ImplementsKeyword */) || - (decl.kind === 246 /* InterfaceDeclaration */ && root.parent.parent.token === 90 /* ExtendsKeyword */); + return (decl.kind === 246 /* ClassDeclaration */ && root.parent.parent.token === 113 /* ImplementsKeyword */) || + (decl.kind === 247 /* InterfaceDeclaration */ && root.parent.parent.token === 90 /* ExtendsKeyword */); } return false; } @@ -106103,15 +106685,15 @@ var ts; switch (node.kind) { case 104 /* ThisKeyword */: return !ts.isExpressionNode(node); - case 183 /* ThisType */: + case 184 /* ThisType */: return true; } switch (node.parent.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return true; - case 188 /* ImportType */: + case 189 /* ImportType */: return !node.parent.isTypeOf; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent); } return false; @@ -106178,7 +106760,7 @@ var ts; ts.climbPastPropertyOrElementAccess = climbPastPropertyOrElementAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 238 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 239 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -106239,22 +106821,22 @@ var ts; ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 281 /* PropertyAssignment */: - case 284 /* EnumMember */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 249 /* ModuleDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 282 /* PropertyAssignment */: + case 285 /* EnumMember */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 250 /* ModuleDeclaration */: return ts.getNameOfDeclaration(node.parent) === node; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return true; - case 187 /* LiteralType */: - return node.parent.parent.kind === 185 /* IndexedAccessType */; + case 188 /* LiteralType */: + return node.parent.parent.kind === 186 /* IndexedAccessType */; default: return false; } @@ -106278,17 +106860,17 @@ var ts; return undefined; } switch (node.kind) { - case 290 /* SourceFile */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 249 /* ModuleDeclaration */: + case 291 /* SourceFile */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 250 /* ModuleDeclaration */: return node; } } @@ -106296,54 +106878,54 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: return ts.isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return "module" /* moduleElement */; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return "class" /* classElement */; - case 246 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; - case 247 /* TypeAliasDeclaration */: - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: + case 247 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; + case 248 /* TypeAliasDeclaration */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: return "type" /* typeElement */; - case 248 /* EnumDeclaration */: return "enum" /* enumElement */; - case 242 /* VariableDeclaration */: + case 249 /* EnumDeclaration */: return "enum" /* enumElement */; + case 243 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 202 /* ArrowFunction */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return "function" /* functionElement */; - case 163 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; - case 164 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 164 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; + case 165 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: return "method" /* memberFunctionElement */; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: var initializer = node.initializer; return ts.isFunctionLike(initializer) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */; - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 282 /* ShorthandPropertyAssignment */: - case 283 /* SpreadAssignment */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 283 /* ShorthandPropertyAssignment */: + case 284 /* SpreadAssignment */: return "property" /* memberVariableElement */; - case 167 /* IndexSignature */: return "index" /* indexSignatureElement */; - case 166 /* ConstructSignature */: return "construct" /* constructSignatureElement */; - case 165 /* CallSignature */: return "call" /* callSignatureElement */; - case 162 /* Constructor */: return "constructor" /* constructorImplementationElement */; - case 155 /* TypeParameter */: return "type parameter" /* typeParameterElement */; - case 284 /* EnumMember */: return "enum member" /* enumMemberElement */; - case 156 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 253 /* ImportEqualsDeclaration */: - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: - case 256 /* NamespaceImport */: - case 262 /* NamespaceExport */: + case 168 /* IndexSignature */: return "index" /* indexSignatureElement */; + case 167 /* ConstructSignature */: return "construct" /* constructSignatureElement */; + case 166 /* CallSignature */: return "call" /* callSignatureElement */; + case 163 /* Constructor */: return "constructor" /* constructorImplementationElement */; + case 156 /* TypeParameter */: return "type parameter" /* typeParameterElement */; + case 285 /* EnumMember */: return "enum member" /* enumMemberElement */; + case 157 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; + case 254 /* ImportEqualsDeclaration */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: + case 257 /* NamespaceImport */: + case 263 /* NamespaceExport */: return "alias" /* alias */; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var kind = ts.getAssignmentDeclarationKind(node); var right = node.right; switch (kind) { @@ -106372,7 +106954,7 @@ var ts; } case 75 /* Identifier */: return ts.isImportClause(node.parent) ? "alias" /* alias */ : "" /* unknown */; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: var scriptKind = getNodeKind(node.expression); // If the expression didn't come back with something (like it does for an identifiers) return scriptKind === "" /* unknown */ ? "const" /* constElement */ : scriptKind; @@ -106395,7 +106977,7 @@ var ts; return true; case 75 /* Identifier */: // 'this' as a parameter - return ts.identifierIsThisKeyword(node) && node.parent.kind === 156 /* Parameter */; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 157 /* Parameter */; default: return false; } @@ -106460,42 +107042,42 @@ var ts; return false; } switch (n.kind) { - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 193 /* ObjectLiteralExpression */: - case 189 /* ObjectBindingPattern */: - case 173 /* TypeLiteral */: - case 223 /* Block */: - case 250 /* ModuleBlock */: - case 251 /* CaseBlock */: - case 257 /* NamedImports */: - case 261 /* NamedExports */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 194 /* ObjectLiteralExpression */: + case 190 /* ObjectBindingPattern */: + case 174 /* TypeLiteral */: + case 224 /* Block */: + case 251 /* ModuleBlock */: + case 252 /* CaseBlock */: + case 258 /* NamedImports */: + case 262 /* NamedExports */: return nodeEndsWith(n, 19 /* CloseBraceToken */, sourceFile); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 197 /* NewExpression */: + case 198 /* NewExpression */: if (!n.arguments) { return true; } // falls through - case 196 /* CallExpression */: - case 200 /* ParenthesizedExpression */: - case 182 /* ParenthesizedType */: + case 197 /* CallExpression */: + case 201 /* ParenthesizedExpression */: + case 183 /* ParenthesizedType */: return nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 166 /* ConstructSignature */: - case 165 /* CallSignature */: - case 202 /* ArrowFunction */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 167 /* ConstructSignature */: + case 166 /* CallSignature */: + case 203 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -106505,65 +107087,65 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 21 /* CloseParenToken */, sourceFile); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return !!n.body && isCompletedNode(n.body, sourceFile); - case 227 /* IfStatement */: + case 228 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 26 /* SemicolonToken */, sourceFile); - case 192 /* ArrayLiteralExpression */: - case 190 /* ArrayBindingPattern */: - case 195 /* ElementAccessExpression */: - case 154 /* ComputedPropertyName */: - case 175 /* TupleType */: + case 193 /* ArrayLiteralExpression */: + case 191 /* ArrayBindingPattern */: + case 196 /* ElementAccessExpression */: + case 155 /* ComputedPropertyName */: + case 176 /* TupleType */: return nodeEndsWith(n, 23 /* CloseBracketToken */, sourceFile); - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 23 /* CloseBracketToken */, sourceFile); - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicity always consider them non-completed return false; - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 229 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 230 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 228 /* DoStatement */: + case 229 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; return hasChildOfKind(n, 111 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 204 /* TypeOfExpression */: - case 203 /* DeleteExpression */: - case 205 /* VoidExpression */: - case 212 /* YieldExpression */: - case 213 /* SpreadElement */: + case 205 /* TypeOfExpression */: + case 204 /* DeleteExpression */: + case 206 /* VoidExpression */: + case 213 /* YieldExpression */: + case 214 /* SpreadElement */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 260 /* ExportDeclaration */: - case 254 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: return ts.nodeIsPresent(n.moduleSpecifier); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -106670,11 +107252,11 @@ var ts; function getAdjustedLocationForDeclaration(node, forRename) { if (!forRename) { switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return getAdjustedLocationForClass(node); - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return getAdjustedLocationForFunction(node); } } @@ -106769,11 +107351,11 @@ var ts; node.kind === 94 /* FunctionKeyword */ ? ts.isFunctionDeclaration(parent) || ts.isFunctionExpression(node) : node.kind === 114 /* InterfaceKeyword */ ? ts.isInterfaceDeclaration(parent) : node.kind === 88 /* EnumKeyword */ ? ts.isEnumDeclaration(parent) : - node.kind === 145 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : - node.kind === 136 /* NamespaceKeyword */ || node.kind === 135 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : + node.kind === 146 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : + node.kind === 137 /* NamespaceKeyword */ || node.kind === 136 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : node.kind === 96 /* ImportKeyword */ ? ts.isImportEqualsDeclaration(parent) : - node.kind === 131 /* GetKeyword */ ? ts.isGetAccessorDeclaration(parent) : - node.kind === 142 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { + node.kind === 132 /* GetKeyword */ ? ts.isGetAccessorDeclaration(parent) : + node.kind === 143 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { var location = getAdjustedLocationForDeclaration(parent, forRename); if (location) { return location; @@ -106787,7 +107369,7 @@ var ts; return decl.name; } } - if (node.kind === 145 /* TypeKeyword */) { + if (node.kind === 146 /* TypeKeyword */) { // import /**/type [|name|] from ...; // import /**/type { [|name|] } from ...; // import /**/type { propertyName as [|name|] } from ...; @@ -106854,12 +107436,12 @@ var ts; } } // import name = /**/require("[|module|]"); - if (node.kind === 139 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { + if (node.kind === 140 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { return parent.expression; } // import ... /**/from "[|module|]"; // export ... /**/from "[|module|]"; - if (node.kind === 149 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { + if (node.kind === 150 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { return parent.moduleSpecifier; } // class ... /**/extends [|name|] ... @@ -106884,7 +107466,7 @@ var ts; } } // ... T extends /**/infer [|U|] ? ... - if (node.kind === 132 /* InferKeyword */ && ts.isInferTypeNode(parent)) { + if (node.kind === 133 /* InferKeyword */ && ts.isInferTypeNode(parent)) { return parent.typeParameter.name; } // { [ [|K|] /**/in keyof T]: ... } @@ -106892,12 +107474,12 @@ var ts; return parent.name; } // /**/keyof [|T|] - if (node.kind === 134 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 134 /* KeyOfKeyword */ && + if (node.kind === 135 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 135 /* KeyOfKeyword */ && ts.isTypeReferenceNode(parent.type)) { return parent.type.typeName; } // /**/readonly [|name|][] - if (node.kind === 138 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 138 /* ReadonlyKeyword */ && + if (node.kind === 139 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 139 /* ReadonlyKeyword */ && ts.isArrayTypeNode(parent.type) && ts.isTypeReferenceNode(parent.type.elementType)) { return parent.type.elementType.typeName; } @@ -106934,7 +107516,7 @@ var ts; // for (... /**/in [|name|]) // for (... /**/of [|name|]) if (node.kind === 97 /* InKeyword */ && ts.isForInStatement(parent) || - node.kind === 152 /* OfKeyword */ && ts.isForOfStatement(parent)) { + node.kind === 153 /* OfKeyword */ && ts.isForOfStatement(parent)) { return ts.skipOuterExpressions(parent.expression); } } @@ -107075,7 +107657,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 290 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); + ts.Debug.assert(startNode !== undefined || n.kind === 291 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. @@ -107145,17 +107727,17 @@ var ts; return true; } //
{ |
or
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 276 /* JsxExpression */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 277 /* JsxExpression */) { return true; } //
{ // | // } < /div> - if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 276 /* JsxExpression */) { + if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 277 /* JsxExpression */) { return true; } //
|
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 269 /* JsxClosingElement */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 270 /* JsxClosingElement */) { return true; } return false; @@ -107296,7 +107878,7 @@ var ts; // falls through case 108 /* TypeOfKeyword */: case 90 /* ExtendsKeyword */: - case 134 /* KeyOfKeyword */: + case 135 /* KeyOfKeyword */: case 24 /* DotToken */: case 51 /* BarToken */: case 57 /* QuestionToken */: @@ -107351,16 +107933,16 @@ var ts; result.push("export" /* exportedModifier */); if (node.flags & 8388608 /* Ambient */) result.push("declare" /* ambientModifier */); - if (node.kind === 259 /* ExportAssignment */) + if (node.kind === 260 /* ExportAssignment */) result.push("export" /* exportedModifier */); return result.length > 0 ? result.join(",") : "" /* none */; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 169 /* TypeReference */ || node.kind === 196 /* CallExpression */) { + if (node.kind === 170 /* TypeReference */ || node.kind === 197 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 245 /* ClassDeclaration */ || node.kind === 246 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 246 /* ClassDeclaration */ || node.kind === 247 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -107405,18 +107987,18 @@ var ts; } ts.cloneCompilerOptions = cloneCompilerOptions; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 192 /* ArrayLiteralExpression */ || - node.kind === 193 /* ObjectLiteralExpression */) { + if (node.kind === 193 /* ArrayLiteralExpression */ || + node.kind === 194 /* ObjectLiteralExpression */) { // [a,b,c] from: // [a, b, c] = someExpression; - if (node.parent.kind === 209 /* BinaryExpression */ && + if (node.parent.kind === 210 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */) { return true; } // [a, b, c] from: // for([a, b, c] of expression) - if (node.parent.kind === 232 /* ForOfStatement */ && + if (node.parent.kind === 233 /* ForOfStatement */ && node.parent.initializer === node) { return true; } @@ -107424,7 +108006,7 @@ var ts; // [x, [a, b, c] ] = someExpression // or // {x, a: {a, b, c} } = someExpression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 281 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 282 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -107470,29 +108052,29 @@ var ts; ts.typeKeywords = [ 125 /* AnyKeyword */, 124 /* AssertsKeyword */, - 151 /* BigIntKeyword */, - 128 /* BooleanKeyword */, + 152 /* BigIntKeyword */, + 129 /* BooleanKeyword */, 91 /* FalseKeyword */, - 134 /* KeyOfKeyword */, - 137 /* NeverKeyword */, + 135 /* KeyOfKeyword */, + 138 /* NeverKeyword */, 100 /* NullKeyword */, - 140 /* NumberKeyword */, - 141 /* ObjectKeyword */, - 138 /* ReadonlyKeyword */, - 143 /* StringKeyword */, - 144 /* SymbolKeyword */, + 141 /* NumberKeyword */, + 142 /* ObjectKeyword */, + 139 /* ReadonlyKeyword */, + 144 /* StringKeyword */, + 145 /* SymbolKeyword */, 106 /* TrueKeyword */, 110 /* VoidKeyword */, - 146 /* UndefinedKeyword */, - 147 /* UniqueKeyword */, - 148 /* UnknownKeyword */, + 147 /* UndefinedKeyword */, + 148 /* UniqueKeyword */, + 149 /* UnknownKeyword */, ]; function isTypeKeyword(kind) { return ts.contains(ts.typeKeywords, kind); } ts.isTypeKeyword = isTypeKeyword; function isTypeKeywordToken(node) { - return node.kind === 145 /* TypeKeyword */; + return node.kind === 146 /* TypeKeyword */; } ts.isTypeKeywordToken = isTypeKeywordToken; /** True if the symbol is for an external module, as opposed to a namespace. */ @@ -107525,7 +108107,7 @@ var ts; } ts.skipConstraint = skipConstraint; function getNameFromPropertyName(name) { - return name.kind === 154 /* ComputedPropertyName */ + return name.kind === 155 /* ComputedPropertyName */ // treat computed property names where expression is string/numeric literal as just string/numeric literal ? ts.isStringOrNumericLiteralLike(name.expression) ? name.expression.text : undefined : ts.isPrivateIdentifier(name) ? ts.idText(name) : ts.getTextOfIdentifierOrLiteral(name); @@ -107672,7 +108254,7 @@ var ts; } ts.findModifier = findModifier; function insertImport(changes, sourceFile, importDecl, blankLineBetween) { - var importKindPredicate = importDecl.kind === 225 /* VariableStatement */ ? ts.isRequireVariableDeclarationStatement : ts.isAnyImportSyntax; + var importKindPredicate = importDecl.kind === 226 /* VariableStatement */ ? ts.isRequireVariableDeclarationStatement : ts.isAnyImportSyntax; var lastImportDeclaration = ts.findLast(sourceFile.statements, function (statement) { return importKindPredicate(statement); }); if (lastImportDeclaration) { changes.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl); @@ -107718,7 +108300,7 @@ var ts; // Display-part writer helpers // #region function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 156 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 157 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -108015,14 +108597,14 @@ var ts; var symbol = checker.getSymbolAtLocation(node.name); var renameInfo = symbol && renameMap.get(String(ts.getSymbolId(symbol))); if (renameInfo && renameInfo.text !== (node.name || node.propertyName).getText()) { - clone = ts.createBindingElement(node.dotDotDotToken, node.propertyName || node.name, renameInfo, node.initializer); + clone = ts.setOriginalNode(ts.createBindingElement(node.dotDotDotToken, node.propertyName || node.name, renameInfo, node.initializer), node); } } else if (renameMap && checker && ts.isIdentifier(node)) { var symbol = checker.getSymbolAtLocation(node); var renameInfo = symbol && renameMap.get(String(ts.getSymbolId(symbol))); if (renameInfo) { - clone = ts.createIdentifier(renameInfo.text); + clone = ts.setOriginalNode(ts.createIdentifier(renameInfo.text), node); } } if (!clone) { @@ -108182,15 +108764,15 @@ var ts; function getContextualTypeFromParent(node, checker) { var parent = node.parent; switch (parent.kind) { - case 197 /* NewExpression */: + case 198 /* NewExpression */: return checker.getContextualType(parent); - case 209 /* BinaryExpression */: { + case 210 /* BinaryExpression */: { var _a = parent, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node); } - case 277 /* CaseClause */: + case 278 /* CaseClause */: return parent.expression === node ? getSwitchedType(parent, checker) : undefined; default: return checker.getContextualType(node); @@ -108229,8 +108811,8 @@ var ts; switch (node.kind) { case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 211 /* TemplateExpression */: - case 198 /* TaggedTemplateExpression */: + case 212 /* TemplateExpression */: + case 199 /* TaggedTemplateExpression */: return true; default: return false; @@ -108269,41 +108851,41 @@ var ts; } ts.getTypeNodeIfAccessible = getTypeNodeIfAccessible; function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) { - return kind === 165 /* CallSignature */ - || kind === 166 /* ConstructSignature */ - || kind === 167 /* IndexSignature */ - || kind === 158 /* PropertySignature */ - || kind === 160 /* MethodSignature */; + return kind === 166 /* CallSignature */ + || kind === 167 /* ConstructSignature */ + || kind === 168 /* IndexSignature */ + || kind === 159 /* PropertySignature */ + || kind === 161 /* MethodSignature */; } ts.syntaxRequiresTrailingCommaOrSemicolonOrASI = syntaxRequiresTrailingCommaOrSemicolonOrASI; function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) { - return kind === 244 /* FunctionDeclaration */ - || kind === 162 /* Constructor */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */; + return kind === 245 /* FunctionDeclaration */ + || kind === 163 /* Constructor */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */; } ts.syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI = syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI; function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) { - return kind === 249 /* ModuleDeclaration */; + return kind === 250 /* ModuleDeclaration */; } ts.syntaxRequiresTrailingModuleBlockOrSemicolonOrASI = syntaxRequiresTrailingModuleBlockOrSemicolonOrASI; function syntaxRequiresTrailingSemicolonOrASI(kind) { - return kind === 225 /* VariableStatement */ - || kind === 226 /* ExpressionStatement */ - || kind === 228 /* DoStatement */ - || kind === 233 /* ContinueStatement */ - || kind === 234 /* BreakStatement */ - || kind === 235 /* ReturnStatement */ - || kind === 239 /* ThrowStatement */ - || kind === 241 /* DebuggerStatement */ - || kind === 159 /* PropertyDeclaration */ - || kind === 247 /* TypeAliasDeclaration */ - || kind === 254 /* ImportDeclaration */ - || kind === 253 /* ImportEqualsDeclaration */ - || kind === 260 /* ExportDeclaration */ - || kind === 252 /* NamespaceExportDeclaration */ - || kind === 259 /* ExportAssignment */; + return kind === 226 /* VariableStatement */ + || kind === 227 /* ExpressionStatement */ + || kind === 229 /* DoStatement */ + || kind === 234 /* ContinueStatement */ + || kind === 235 /* BreakStatement */ + || kind === 236 /* ReturnStatement */ + || kind === 240 /* ThrowStatement */ + || kind === 242 /* DebuggerStatement */ + || kind === 160 /* PropertyDeclaration */ + || kind === 248 /* TypeAliasDeclaration */ + || kind === 255 /* ImportDeclaration */ + || kind === 254 /* ImportEqualsDeclaration */ + || kind === 261 /* ExportDeclaration */ + || kind === 253 /* NamespaceExportDeclaration */ + || kind === 260 /* ExportAssignment */; } ts.syntaxRequiresTrailingSemicolonOrASI = syntaxRequiresTrailingSemicolonOrASI; ts.syntaxMayBeASICandidate = ts.or(syntaxRequiresTrailingCommaOrSemicolonOrASI, syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI, syntaxRequiresTrailingModuleBlockOrSemicolonOrASI, syntaxRequiresTrailingSemicolonOrASI); @@ -108333,7 +108915,7 @@ var ts; return false; } // See comment in parser’s `parseDoStatement` - if (node.kind === 228 /* DoStatement */) { + if (node.kind === 229 /* DoStatement */) { return true; } var topNode = ts.findAncestor(node, function (ancestor) { return !ancestor.parent; }); @@ -108593,6 +109175,10 @@ var ts; return symbol.name; } ts.getNameForExportedSymbol = getNameForExportedSymbol; + function startsWithUnderscore(name) { + return name.charCodeAt(0) === 95 /* _ */; + } + ts.startsWithUnderscore = startsWithUnderscore; // #endregion })(ts || (ts = {})); var ts; @@ -108696,10 +109282,10 @@ var ts; } break; case 125 /* AnyKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: if (angleBracketStack > 0 && !syntacticClassifierAbsent) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, @@ -108888,9 +109474,9 @@ var ts; return true; } switch (keyword2) { - case 131 /* GetKeyword */: - case 142 /* SetKeyword */: - case 129 /* ConstructorKeyword */: + case 132 /* GetKeyword */: + case 143 /* SetKeyword */: + case 130 /* ConstructorKeyword */: case 120 /* StaticKeyword */: return true; // Allow things like "public get", "public constructor" and "public static". default: @@ -109031,10 +109617,10 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 249 /* ModuleDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 244 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 245 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -109254,18 +109840,18 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); // e.g. "param" pos = tag.tagName.end; switch (tag.kind) { - case 317 /* JSDocParameterTag */: + case 318 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); pos = tag.end; break; - case 320 /* JSDocTypeTag */: + case 321 /* JSDocTypeTag */: processElement(tag.typeExpression); pos = tag.end; break; - case 318 /* JSDocReturnTag */: + case 319 /* JSDocReturnTag */: processElement(tag.typeExpression); pos = tag.end; break; @@ -109416,22 +110002,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 268 /* JsxOpeningElement */: + case 269 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -109460,17 +110046,17 @@ var ts; var parent = token.parent; if (tokenKind === 62 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (parent.kind === 242 /* VariableDeclaration */ || - parent.kind === 159 /* PropertyDeclaration */ || - parent.kind === 156 /* Parameter */ || - parent.kind === 273 /* JsxAttribute */) { + if (parent.kind === 243 /* VariableDeclaration */ || + parent.kind === 160 /* PropertyDeclaration */ || + parent.kind === 157 /* Parameter */ || + parent.kind === 274 /* JsxAttribute */) { return 5 /* operator */; } } - if (parent.kind === 209 /* BinaryExpression */ || - parent.kind === 207 /* PrefixUnaryExpression */ || - parent.kind === 208 /* PostfixUnaryExpression */ || - parent.kind === 210 /* ConditionalExpression */) { + if (parent.kind === 210 /* BinaryExpression */ || + parent.kind === 208 /* PrefixUnaryExpression */ || + parent.kind === 209 /* PostfixUnaryExpression */ || + parent.kind === 211 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -109483,7 +110069,7 @@ var ts; return 25 /* bigintLiteral */; } else if (tokenKind === 10 /* StringLiteral */) { - return token && token.parent.kind === 273 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token && token.parent.kind === 274 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 13 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -109499,32 +110085,32 @@ var ts; else if (tokenKind === 75 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 156 /* Parameter */: + case 157 /* Parameter */: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -109648,11 +110234,11 @@ var ts; function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host) { var parent = node.parent; switch (parent.kind) { - case 187 /* LiteralType */: + case 188 /* LiteralType */: switch (parent.parent.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(parent)), isNewIdentifier: false }; - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: // Get all apparent property names // i.e. interface Foo { // foo: string; @@ -109660,9 +110246,9 @@ var ts; // } // let x: Foo["/*completion position*/"] return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(parent.parent.objectType)); - case 188 /* ImportType */: + case 189 /* ImportType */: return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) }; - case 178 /* UnionType */: { + case 179 /* UnionType */: { if (!ts.isTypeReferenceNode(parent.parent.parent)) return undefined; var alreadyUsedTypes_1 = getAlreadyUsedTypesInStringLiteralUnion(parent.parent, parent); @@ -109672,7 +110258,7 @@ var ts; default: return undefined; } - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: if (ts.isObjectLiteralExpression(parent.parent) && parent.name === node) { // Get quoted name of properties of the object literal expression // i.e. interface ConfigFiles { @@ -109689,7 +110275,7 @@ var ts; return stringLiteralCompletionsFromProperties(typeChecker.getContextualType(parent.parent)); } return fromContextualType(); - case 195 /* ElementAccessExpression */: { + case 196 /* ElementAccessExpression */: { var _a = parent, expression = _a.expression, argumentExpression = _a.argumentExpression; if (node === argumentExpression) { // Get all names of properties on the expression @@ -109702,8 +110288,8 @@ var ts; } return undefined; } - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: if (!ts.isRequireCall(parent, /*checkArgumentIsStringLiteralLike*/ false) && !ts.isImportCall(parent)) { var argumentInfo = ts.SignatureHelp.getArgumentInfoForCompletions(node, position, sourceFile); // Get string literal completions from specialized signatures of the target @@ -109712,9 +110298,9 @@ var ts; return argumentInfo ? getStringLiteralCompletionsFromSignature(argumentInfo, typeChecker) : fromContextualType(); } // falls through (is `require("")` or `import("")`) - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: - case 265 /* ExternalModuleReference */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 266 /* ExternalModuleReference */: // Get all known external module names or complete a path to a module // i.e. import * as ns from "/*completion position*/"; // var y = import("/*completion position*/"); @@ -110665,11 +111251,11 @@ var ts; return ts.getContextualTypeFromParent(previousToken, checker); case 62 /* EqualsToken */: switch (parent.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return checker.getContextualType(parent.initializer); // TODO: GH#18217 - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return checker.getTypeAtLocation(parent.left); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return checker.getContextualTypeForJsxAttribute(parent); default: return undefined; @@ -110679,7 +111265,7 @@ var ts; case 78 /* CaseKeyword */: return ts.getSwitchedType(ts.cast(parent, ts.isCaseClause), checker); case 18 /* OpenBraceToken */: - return ts.isJsxExpression(parent) && parent.parent.kind !== 266 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; + return ts.isJsxExpression(parent) && parent.parent.kind !== 267 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; default: var argInfo = ts.SignatureHelp.getArgumentInfoForCompletions(previousToken, position, sourceFile); return argInfo ? @@ -110698,7 +111284,7 @@ var ts; return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker)); } function isModuleSymbol(symbol) { - return symbol.declarations.some(function (d) { return d.kind === 290 /* SourceFile */; }); + return symbol.declarations.some(function (d) { return d.kind === 291 /* SourceFile */; }); } function getCompletionData(program, log, sourceFile, isUncheckedFile, position, preferences, detailsEntryId, host) { var typeChecker = program.getTypeChecker(); @@ -110749,11 +111335,11 @@ var ts; if (tag.tagName.pos <= position && position <= tag.tagName.end) { return { kind: 1 /* JsDocTagName */ }; } - if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 294 /* JSDocTypeExpression */) { + if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 295 /* JSDocTypeExpression */) { currentToken = ts.getTokenAtPosition(sourceFile, position); if (!currentToken || (!ts.isDeclarationName(currentToken) && - (currentToken.parent.kind !== 323 /* JSDocPropertyTag */ || + (currentToken.parent.kind !== 324 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken))) { // Use as type location if inside tag's type expression insideJsDocTagTypeExpression = isCurrentlyEditingNode(tag.typeExpression); @@ -110805,7 +111391,7 @@ var ts; isRightOfDot = contextToken.kind === 24 /* DotToken */; isRightOfQuestionDot = contextToken.kind === 28 /* QuestionDotToken */; switch (parent.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: propertyAccessToConvert = parent; node = propertyAccessToConvert.expression; if (node.end === contextToken.pos && @@ -110817,14 +111403,14 @@ var ts; return undefined; } break; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: node = parent.left; break; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: node = parent.name; break; - case 188 /* ImportType */: - case 219 /* MetaProperty */: + case 189 /* ImportType */: + case 220 /* MetaProperty */: node = parent; break; default: @@ -110837,7 +111423,7 @@ var ts; // // If the tagname is a property access expression, we will then walk up to the top most of property access expression. // Then, try to get a JSX container and its associated attributes type. - if (parent && parent.kind === 194 /* PropertyAccessExpression */) { + if (parent && parent.kind === 195 /* PropertyAccessExpression */) { contextToken = parent; parent = parent.parent; } @@ -110845,38 +111431,38 @@ var ts; if (currentToken.parent === location) { switch (currentToken.kind) { case 31 /* GreaterThanToken */: - if (currentToken.parent.kind === 266 /* JsxElement */ || currentToken.parent.kind === 268 /* JsxOpeningElement */) { + if (currentToken.parent.kind === 267 /* JsxElement */ || currentToken.parent.kind === 269 /* JsxOpeningElement */) { location = currentToken; } break; case 43 /* SlashToken */: - if (currentToken.parent.kind === 267 /* JsxSelfClosingElement */) { + if (currentToken.parent.kind === 268 /* JsxSelfClosingElement */) { location = currentToken; } break; } } switch (parent.kind) { - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: if (contextToken.kind === 43 /* SlashToken */) { isStartingCloseTag = true; location = contextToken; } break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (!binaryExpressionMayBeOpenTag(parent)) { break; } // falls through - case 267 /* JsxSelfClosingElement */: - case 266 /* JsxElement */: - case 268 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 267 /* JsxElement */: + case 269 /* JsxOpeningElement */: if (contextToken.kind === 29 /* LessThanToken */) { isRightOfOpenTag = true; location = contextToken; } break; - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: switch (previousToken.kind) { case 62 /* EqualsToken */: isJsxInitializer = true; @@ -110956,11 +111542,11 @@ var ts; }; function isTagWithTypeExpression(tag) { switch (tag.kind) { - case 317 /* JSDocParameterTag */: - case 323 /* JSDocPropertyTag */: - case 318 /* JSDocReturnTag */: - case 320 /* JSDocTypeTag */: - case 322 /* JSDocTypedefTag */: + case 318 /* JSDocParameterTag */: + case 324 /* JSDocPropertyTag */: + case 319 /* JSDocReturnTag */: + case 321 /* JSDocTypeTag */: + case 323 /* JSDocTypedefTag */: return true; default: return false; @@ -111005,7 +111591,7 @@ var ts; // If the module is merged with a value, we must get the type of the class and add its propertes (for inherited static methods). if (!isTypeLocation && symbol.declarations && - symbol.declarations.some(function (d) { return d.kind !== 290 /* SourceFile */ && d.kind !== 249 /* ModuleDeclaration */ && d.kind !== 248 /* EnumDeclaration */; })) { + symbol.declarations.some(function (d) { return d.kind !== 291 /* SourceFile */ && d.kind !== 250 /* ModuleDeclaration */ && d.kind !== 249 /* EnumDeclaration */; })) { var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType(); var insertQuestionDot = false; if (type.isNullableType()) { @@ -111052,7 +111638,7 @@ var ts; if (isRightOfQuestionDot && ts.some(type.getCallSignatures())) { isNewIdentifierLocation = true; } - var propertyAccess = node.kind === 188 /* ImportType */ ? node : node.parent; + var propertyAccess = node.kind === 189 /* ImportType */ ? node : node.parent; if (isUncheckedFile) { // In javascript files, for union types, we don't just get the members that // the individual types have in common, we also include all the members that @@ -111208,7 +111794,7 @@ var ts; } } // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` - if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 290 /* SourceFile */) { + if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 291 /* SourceFile */) { var thisType = typeChecker.tryGetThisTypeAt(scopeNode, /*includeGlobalThis*/ false); if (thisType) { for (var _a = 0, _b = getPropertiesForCompletion(thisType, typeChecker); _a < _b.length; _a++) { @@ -111258,10 +111844,10 @@ var ts; } function isSnippetScope(scopeNode) { switch (scopeNode.kind) { - case 290 /* SourceFile */: - case 211 /* TemplateExpression */: - case 276 /* JsxExpression */: - case 223 /* Block */: + case 291 /* SourceFile */: + case 212 /* TemplateExpression */: + case 277 /* JsxExpression */: + case 224 /* Block */: return true; default: return ts.isStatement(scopeNode); @@ -111307,27 +111893,27 @@ var ts; function isContextTokenValueLocation(contextToken) { return contextToken && contextToken.kind === 108 /* TypeOfKeyword */ && - (contextToken.parent.kind === 172 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); + (contextToken.parent.kind === 173 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); } function isContextTokenTypeLocation(contextToken) { if (contextToken) { var parentKind = contextToken.parent.kind; switch (contextToken.kind) { case 58 /* ColonToken */: - return parentKind === 159 /* PropertyDeclaration */ || - parentKind === 158 /* PropertySignature */ || - parentKind === 156 /* Parameter */ || - parentKind === 242 /* VariableDeclaration */ || + return parentKind === 160 /* PropertyDeclaration */ || + parentKind === 159 /* PropertySignature */ || + parentKind === 157 /* Parameter */ || + parentKind === 243 /* VariableDeclaration */ || ts.isFunctionLikeKind(parentKind); case 62 /* EqualsToken */: - return parentKind === 247 /* TypeAliasDeclaration */; + return parentKind === 248 /* TypeAliasDeclaration */; case 123 /* AsKeyword */: - return parentKind === 217 /* AsExpression */; + return parentKind === 218 /* AsExpression */; case 29 /* LessThanToken */: - return parentKind === 169 /* TypeReference */ || - parentKind === 199 /* TypeAssertionExpression */; + return parentKind === 170 /* TypeReference */ || + parentKind === 200 /* TypeAssertionExpression */; case 90 /* ExtendsKeyword */: - return parentKind === 155 /* TypeParameter */; + return parentKind === 156 /* TypeParameter */; } } return false; @@ -111538,7 +112124,7 @@ var ts; return true; } if (contextToken.kind === 31 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 268 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 269 /* JsxOpeningElement */) { // Two possibilities: // 1.
/**/ // - contextToken: GreaterThanToken (before cursor) @@ -111548,10 +112134,10 @@ var ts; // - contextToken: GreaterThanToken (before cursor) // - location: GreaterThanToken (after cursor) // - same parent (JSXOpeningElement) - return location.parent.kind !== 268 /* JsxOpeningElement */; + return location.parent.kind !== 269 /* JsxOpeningElement */; } - if (contextToken.parent.kind === 269 /* JsxClosingElement */ || contextToken.parent.kind === 267 /* JsxSelfClosingElement */) { - return !!contextToken.parent.parent && contextToken.parent.parent.kind === 266 /* JsxElement */; + if (contextToken.parent.kind === 270 /* JsxClosingElement */ || contextToken.parent.kind === 268 /* JsxSelfClosingElement */) { + return !!contextToken.parent.parent && contextToken.parent.parent.kind === 267 /* JsxElement */; } } return false; @@ -111562,40 +112148,40 @@ var ts; // Previous token may have been a keyword that was converted to an identifier. switch (keywordForNode(previousToken)) { case 27 /* CommaToken */: - return containingNodeKind === 196 /* CallExpression */ // func( a, | - || containingNodeKind === 162 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 197 /* NewExpression */ // new C(a, | - || containingNodeKind === 192 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 209 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 170 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 197 /* CallExpression */ // func( a, | + || containingNodeKind === 163 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 198 /* NewExpression */ // new C(a, | + || containingNodeKind === 193 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 210 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 171 /* FunctionType */; // var x: (s: string, list| case 20 /* OpenParenToken */: - return containingNodeKind === 196 /* CallExpression */ // func( | - || containingNodeKind === 162 /* Constructor */ // constructor( | - || containingNodeKind === 197 /* NewExpression */ // new C(a| - || containingNodeKind === 200 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 182 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 197 /* CallExpression */ // func( | + || containingNodeKind === 163 /* Constructor */ // constructor( | + || containingNodeKind === 198 /* NewExpression */ // new C(a| + || containingNodeKind === 201 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 183 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 22 /* OpenBracketToken */: - return containingNodeKind === 192 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 167 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 154 /* ComputedPropertyName */; // [ | /* this can become an index signature */ - case 135 /* ModuleKeyword */: // module | - case 136 /* NamespaceKeyword */: // namespace | + return containingNodeKind === 193 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 168 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 155 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + case 136 /* ModuleKeyword */: // module | + case 137 /* NamespaceKeyword */: // namespace | return true; case 24 /* DotToken */: - return containingNodeKind === 249 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 250 /* ModuleDeclaration */; // module A.| case 18 /* OpenBraceToken */: - return containingNodeKind === 245 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 246 /* ClassDeclaration */; // class A{ | case 62 /* EqualsToken */: - return containingNodeKind === 242 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 209 /* BinaryExpression */; // x = a| + return containingNodeKind === 243 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 210 /* BinaryExpression */; // x = a| case 15 /* TemplateHead */: - return containingNodeKind === 211 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 212 /* TemplateExpression */; // `aa ${| case 16 /* TemplateMiddle */: - return containingNodeKind === 221 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 222 /* TemplateSpan */; // `aa ${10} dd ${| case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - return containingNodeKind === 159 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 160 /* PropertyDeclaration */; // class A{ public | } } return false; @@ -111622,7 +112208,7 @@ var ts; completionKind = 0 /* ObjectPropertyDeclaration */; var typeMembers; var existingMembers; - if (objectLikeContainer.kind === 193 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 194 /* ObjectLiteralExpression */) { var instantiatedType = typeChecker.getContextualType(objectLikeContainer); var completionsType = instantiatedType && typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */); if (!instantiatedType || !completionsType) @@ -111632,7 +112218,7 @@ var ts; existingMembers = objectLikeContainer.properties; } else { - ts.Debug.assert(objectLikeContainer.kind === 189 /* ObjectBindingPattern */); + ts.Debug.assert(objectLikeContainer.kind === 190 /* ObjectBindingPattern */); // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -111643,12 +112229,12 @@ var ts; // through type declaration or inference. // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - // type of parameter will flow in from the contextual type of the function - var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 232 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 156 /* Parameter */) { + var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 233 /* ForOfStatement */; + if (!canGetType && rootDeclaration.kind === 157 /* Parameter */) { if (ts.isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); } - else if (rootDeclaration.parent.kind === 161 /* MethodDeclaration */ || rootDeclaration.parent.kind === 164 /* SetAccessor */) { + else if (rootDeclaration.parent.kind === 162 /* MethodDeclaration */ || rootDeclaration.parent.kind === 165 /* SetAccessor */) { canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -111698,7 +112284,7 @@ var ts; return 0 /* Continue */; // cursor is in an import clause // try to show exported member for imported module - var moduleSpecifier = (namedImportsOrExports.kind === 257 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; + var moduleSpecifier = (namedImportsOrExports.kind === 258 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); // TODO: GH#18217 if (!moduleSpecifierSymbol) return 2 /* Fail */; @@ -111820,11 +112406,11 @@ var ts; case 30 /* LessThanSlashToken */: case 43 /* SlashToken */: case 75 /* Identifier */: - case 194 /* PropertyAccessExpression */: - case 274 /* JsxAttributes */: - case 273 /* JsxAttribute */: - case 275 /* JsxSpreadAttribute */: - if (parent && (parent.kind === 267 /* JsxSelfClosingElement */ || parent.kind === 268 /* JsxOpeningElement */)) { + case 195 /* PropertyAccessExpression */: + case 275 /* JsxAttributes */: + case 274 /* JsxAttribute */: + case 276 /* JsxSpreadAttribute */: + if (parent && (parent.kind === 268 /* JsxSelfClosingElement */ || parent.kind === 269 /* JsxOpeningElement */)) { if (contextToken.kind === 31 /* GreaterThanToken */) { var precedingToken = ts.findPrecedingToken(contextToken.pos, sourceFile, /*startNode*/ undefined); if (!parent.typeArguments || (precedingToken && precedingToken.kind === 43 /* SlashToken */)) @@ -111832,7 +112418,7 @@ var ts; } return parent; } - else if (parent.kind === 273 /* JsxAttribute */) { + else if (parent.kind === 274 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -111844,7 +112430,7 @@ var ts; // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 10 /* StringLiteral */: - if (parent && ((parent.kind === 273 /* JsxAttribute */) || (parent.kind === 275 /* JsxSpreadAttribute */))) { + if (parent && ((parent.kind === 274 /* JsxAttribute */) || (parent.kind === 276 /* JsxSpreadAttribute */))) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -111854,8 +112440,8 @@ var ts; break; case 19 /* CloseBraceToken */: if (parent && - parent.kind === 276 /* JsxExpression */ && - parent.parent && parent.parent.kind === 273 /* JsxAttribute */) { + parent.kind === 277 /* JsxExpression */ && + parent.parent && parent.parent.kind === 274 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -111863,7 +112449,7 @@ var ts; // each JsxAttribute can have initializer as JsxExpression return parent.parent.parent.parent; } - if (parent && parent.kind === 275 /* JsxSpreadAttribute */) { + if (parent && parent.kind === 276 /* JsxSpreadAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -111883,51 +112469,51 @@ var ts; var containingNodeKind = parent.kind; switch (contextToken.kind) { case 27 /* CommaToken */: - return containingNodeKind === 242 /* VariableDeclaration */ || + return containingNodeKind === 243 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken) || - containingNodeKind === 225 /* VariableStatement */ || - containingNodeKind === 248 /* EnumDeclaration */ || // enum a { foo, | + containingNodeKind === 226 /* VariableStatement */ || + containingNodeKind === 249 /* EnumDeclaration */ || // enum a { foo, | isFunctionLikeButNotConstructor(containingNodeKind) || - containingNodeKind === 246 /* InterfaceDeclaration */ || // interface A= contextToken.pos); case 24 /* DotToken */: - return containingNodeKind === 190 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 191 /* ArrayBindingPattern */; // var [.| case 58 /* ColonToken */: - return containingNodeKind === 191 /* BindingElement */; // var {x :html| + return containingNodeKind === 192 /* BindingElement */; // var {x :html| case 22 /* OpenBracketToken */: - return containingNodeKind === 190 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 191 /* ArrayBindingPattern */; // var [x| case 20 /* OpenParenToken */: - return containingNodeKind === 280 /* CatchClause */ || + return containingNodeKind === 281 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); case 18 /* OpenBraceToken */: - return containingNodeKind === 248 /* EnumDeclaration */; // enum a { | + return containingNodeKind === 249 /* EnumDeclaration */; // enum a { | case 29 /* LessThanToken */: - return containingNodeKind === 245 /* ClassDeclaration */ || // class A< | - containingNodeKind === 214 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 246 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 247 /* TypeAliasDeclaration */ || // type List< | + return containingNodeKind === 246 /* ClassDeclaration */ || // class A< | + containingNodeKind === 215 /* ClassExpression */ || // var C = class D< | + containingNodeKind === 247 /* InterfaceDeclaration */ || // interface A< | + containingNodeKind === 248 /* TypeAliasDeclaration */ || // type List< | ts.isFunctionLikeKind(containingNodeKind); case 120 /* StaticKeyword */: - return containingNodeKind === 159 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); + return containingNodeKind === 160 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); case 25 /* DotDotDotToken */: - return containingNodeKind === 156 /* Parameter */ || - (!!parent.parent && parent.parent.kind === 190 /* ArrayBindingPattern */); // var [...z| + return containingNodeKind === 157 /* Parameter */ || + (!!parent.parent && parent.parent.kind === 191 /* ArrayBindingPattern */); // var [...z| case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - return containingNodeKind === 156 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); + return containingNodeKind === 157 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); case 123 /* AsKeyword */: - return containingNodeKind === 258 /* ImportSpecifier */ || - containingNodeKind === 263 /* ExportSpecifier */ || - containingNodeKind === 256 /* NamespaceImport */; - case 131 /* GetKeyword */: - case 142 /* SetKeyword */: + return containingNodeKind === 259 /* ImportSpecifier */ || + containingNodeKind === 264 /* ExportSpecifier */ || + containingNodeKind === 257 /* NamespaceImport */; + case 132 /* GetKeyword */: + case 143 /* SetKeyword */: return !isFromObjectTypeDeclaration(contextToken); case 80 /* ClassKeyword */: case 88 /* EnumKeyword */: @@ -111938,7 +112524,7 @@ var ts; case 115 /* LetKeyword */: case 81 /* ConstKeyword */: case 121 /* YieldKeyword */: - case 145 /* TypeKeyword */: // type htm| + case 146 /* TypeKeyword */: // type htm| return true; case 41 /* AsteriskToken */: return ts.isFunctionLike(contextToken.parent) && !ts.isMethodDeclaration(contextToken.parent); @@ -111964,7 +112550,7 @@ var ts; case 122 /* AbstractKeyword */: case 80 /* ClassKeyword */: case 81 /* ConstKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 88 /* EnumKeyword */: case 94 /* FunctionKeyword */: case 114 /* InterfaceKeyword */: @@ -111986,7 +112572,7 @@ var ts; && !(ts.isClassLike(contextToken.parent) && (contextToken !== previousToken || position > previousToken.end)); } function isFunctionLikeButNotConstructor(kind) { - return ts.isFunctionLikeKind(kind) && kind !== 162 /* Constructor */; + return ts.isFunctionLikeKind(kind) && kind !== 163 /* Constructor */; } function isDotOfNumericLiteral(contextToken) { if (contextToken.kind === 8 /* NumericLiteral */) { @@ -111996,7 +112582,7 @@ var ts; return false; } function isVariableDeclarationListButNotTypeArgument(node) { - return node.parent.kind === 243 /* VariableDeclarationList */ + return node.parent.kind === 244 /* VariableDeclarationList */ && !ts.isPossiblyTypeArgumentPosition(node, sourceFile, typeChecker); } /** @@ -112014,13 +112600,13 @@ var ts; for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 281 /* PropertyAssignment */ && - m.kind !== 282 /* ShorthandPropertyAssignment */ && - m.kind !== 191 /* BindingElement */ && - m.kind !== 161 /* MethodDeclaration */ && - m.kind !== 163 /* GetAccessor */ && - m.kind !== 164 /* SetAccessor */ && - m.kind !== 283 /* SpreadAssignment */) { + if (m.kind !== 282 /* PropertyAssignment */ && + m.kind !== 283 /* ShorthandPropertyAssignment */ && + m.kind !== 192 /* BindingElement */ && + m.kind !== 162 /* MethodDeclaration */ && + m.kind !== 164 /* GetAccessor */ && + m.kind !== 165 /* SetAccessor */ && + m.kind !== 284 /* SpreadAssignment */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -112091,10 +112677,10 @@ var ts; for (var _i = 0, existingMembers_2 = existingMembers; _i < existingMembers_2.length; _i++) { var m = existingMembers_2[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 159 /* PropertyDeclaration */ && - m.kind !== 161 /* MethodDeclaration */ && - m.kind !== 163 /* GetAccessor */ && - m.kind !== 164 /* SetAccessor */) { + if (m.kind !== 160 /* PropertyDeclaration */ && + m.kind !== 162 /* MethodDeclaration */ && + m.kind !== 164 /* GetAccessor */ && + m.kind !== 165 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -112135,7 +112721,7 @@ var ts; if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 273 /* JsxAttribute */) { + if (attr.kind === 274 /* JsxAttribute */) { seenNames.set(attr.name.escapedText, true); } else if (ts.isJsxSpreadAttribute(attr)) { @@ -112185,7 +112771,7 @@ var ts; var _keywordCompletions = []; var allKeywordsCompletions = ts.memoize(function () { var res = []; - for (var i = 77 /* FirstKeyword */; i <= 152 /* LastKeyword */; i++) { + for (var i = 77 /* FirstKeyword */; i <= 153 /* LastKeyword */; i++) { res.push({ name: ts.tokenToString(i), kind: "keyword" /* keyword */, @@ -112211,12 +112797,12 @@ var ts; return false; case 1 /* All */: return isFunctionLikeBodyKeyword(kind) - || kind === 130 /* DeclareKeyword */ - || kind === 135 /* ModuleKeyword */ - || kind === 145 /* TypeKeyword */ - || kind === 136 /* NamespaceKeyword */ + || kind === 131 /* DeclareKeyword */ + || kind === 136 /* ModuleKeyword */ + || kind === 146 /* TypeKeyword */ + || kind === 137 /* NamespaceKeyword */ || kind === 123 /* AsKeyword */ - || ts.isTypeKeyword(kind) && kind !== 146 /* UndefinedKeyword */; + || ts.isTypeKeyword(kind) && kind !== 147 /* UndefinedKeyword */; case 5 /* FunctionLikeBodyKeywords */: return isFunctionLikeBodyKeyword(kind); case 2 /* ClassElementKeywords */: @@ -112238,46 +112824,46 @@ var ts; switch (kind) { case 122 /* AbstractKeyword */: case 125 /* AnyKeyword */: - case 151 /* BigIntKeyword */: - case 128 /* BooleanKeyword */: - case 130 /* DeclareKeyword */: + case 152 /* BigIntKeyword */: + case 129 /* BooleanKeyword */: + case 131 /* DeclareKeyword */: case 88 /* EnumKeyword */: - case 150 /* GlobalKeyword */: + case 151 /* GlobalKeyword */: case 113 /* ImplementsKeyword */: - case 132 /* InferKeyword */: + case 133 /* InferKeyword */: case 114 /* InterfaceKeyword */: - case 133 /* IsKeyword */: - case 134 /* KeyOfKeyword */: - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: - case 137 /* NeverKeyword */: - case 140 /* NumberKeyword */: - case 141 /* ObjectKeyword */: + case 134 /* IsKeyword */: + case 135 /* KeyOfKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: + case 138 /* NeverKeyword */: + case 141 /* NumberKeyword */: + case 142 /* ObjectKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 119 /* PublicKeyword */: - case 138 /* ReadonlyKeyword */: - case 143 /* StringKeyword */: - case 144 /* SymbolKeyword */: - case 145 /* TypeKeyword */: - case 147 /* UniqueKeyword */: - case 148 /* UnknownKeyword */: + case 139 /* ReadonlyKeyword */: + case 144 /* StringKeyword */: + case 145 /* SymbolKeyword */: + case 146 /* TypeKeyword */: + case 148 /* UniqueKeyword */: + case 149 /* UnknownKeyword */: return true; default: return false; } } function isInterfaceOrTypeLiteralCompletionKeyword(kind) { - return kind === 138 /* ReadonlyKeyword */; + return kind === 139 /* ReadonlyKeyword */; } function isClassMemberCompletionKeyword(kind) { switch (kind) { case 122 /* AbstractKeyword */: - case 129 /* ConstructorKeyword */: - case 131 /* GetKeyword */: - case 142 /* SetKeyword */: + case 130 /* ConstructorKeyword */: + case 132 /* GetKeyword */: + case 143 /* SetKeyword */: case 126 /* AsyncKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: return true; default: return ts.isClassMemberModifier(kind); @@ -112336,7 +112922,7 @@ var ts; function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) { // class c { method() { } | method2() { } } switch (location.kind) { - case 324 /* SyntaxList */: + case 325 /* SyntaxList */: return ts.tryCast(location.parent, ts.isObjectTypeDeclaration); case 1 /* EndOfFileToken */: var cls = ts.tryCast(ts.lastOrUndefined(ts.cast(location.parent, ts.isSourceFile).statements), ts.isObjectTypeDeclaration); @@ -112504,11 +113090,11 @@ var ts; case 111 /* WhileKeyword */: case 86 /* DoKeyword */: return useParent(node.parent, function (n) { return ts.isIterationStatement(n, /*lookInLabeledStatements*/ true); }, getLoopBreakContinueOccurrences); - case 129 /* ConstructorKeyword */: - return getFromAllDeclarations(ts.isConstructorDeclaration, [129 /* ConstructorKeyword */]); - case 131 /* GetKeyword */: - case 142 /* SetKeyword */: - return getFromAllDeclarations(ts.isAccessor, [131 /* GetKeyword */, 142 /* SetKeyword */]); + case 130 /* ConstructorKeyword */: + return getFromAllDeclarations(ts.isConstructorDeclaration, [130 /* ConstructorKeyword */]); + case 132 /* GetKeyword */: + case 143 /* SetKeyword */: + return getFromAllDeclarations(ts.isAccessor, [132 /* GetKeyword */, 143 /* SetKeyword */]); case 127 /* AwaitKeyword */: return useParent(node.parent, ts.isAwaitExpression, getAsyncAndAwaitOccurrences); case 126 /* AsyncKeyword */: @@ -112556,7 +113142,7 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 290 /* SourceFile */) { + if (ts.isFunctionBlock(parent) || parent.kind === 291 /* SourceFile */) { return parent; } // A throw-statement is only owned by a try-statement if the try-statement has @@ -112588,16 +113174,16 @@ var ts; function getBreakOrContinueOwner(statement) { return ts.findAncestor(statement, function (node) { switch (node.kind) { - case 237 /* SwitchStatement */: - if (statement.kind === 233 /* ContinueStatement */) { + case 238 /* SwitchStatement */: + if (statement.kind === 234 /* ContinueStatement */) { return false; } // falls through - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 229 /* WhileStatement */: - case 228 /* DoStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 230 /* WhileStatement */: + case 229 /* DoStatement */: return !statement.label || isLabeledBy(node, statement.label.escapedText); default: // Don't cross function boundaries. @@ -112613,11 +113199,11 @@ var ts; // Types of node whose children might have modifiers. var container = declaration.parent; switch (container.kind) { - case 250 /* ModuleBlock */: - case 290 /* SourceFile */: - case 223 /* Block */: - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 251 /* ModuleBlock */: + case 291 /* SourceFile */: + case 224 /* Block */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: // Container is either a class declaration or the declaration is a classDeclaration if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) { return __spreadArrays(declaration.members, [declaration]); @@ -112625,14 +113211,14 @@ var ts; else { return container.statements; } - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 244 /* FunctionDeclaration */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: return __spreadArrays(container.parameters, (ts.isClassLike(container.parent) ? container.parent.members : [])); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 173 /* TypeLiteral */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 174 /* TypeLiteral */: var nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. @@ -112665,7 +113251,7 @@ var ts; var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 93 /* ForKeyword */, 111 /* WhileKeyword */, 86 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 228 /* DoStatement */) { + if (loopNode.kind === 229 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 111 /* WhileKeyword */)) { @@ -112685,13 +113271,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -113058,10 +113644,10 @@ var ts; if (cancellationToken) cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (!isAvailableThroughGlobal) { var parent = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent.kind === 242 /* VariableDeclaration */) { + if (exportKind === 2 /* ExportEquals */ && parent.kind === 243 /* VariableDeclaration */) { var name = parent.name; if (name.kind === 75 /* Identifier */) { directImports.push(name); @@ -113074,20 +113660,20 @@ var ts; break; case 75 /* Identifier */: // for 'const x = require("y"); break; // TODO: GH#23879 - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: handleNamespaceImport(direct, direct.name, ts.hasModifier(direct, 1 /* Export */), /*alreadyAddedDirect*/ false); break; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: directImports.push(direct); var namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 256 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 257 /* NamespaceImport */) { handleNamespaceImport(direct, namedBindings.name, /*isReExport*/ false, /*alreadyAddedDirect*/ true); } else if (!isAvailableThroughGlobal && ts.isDefaultImport(direct)) { addIndirectUser(getSourceFileLikeForImportDeclaration(direct)); // Add a check for indirect uses to handle synthetic default imports } break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: if (!direct.exportClause) { // This is `export * from "foo"`, so imports of this module may import the export too. handleDirectImports(getContainingModuleSymbol(direct, checker)); @@ -113097,7 +113683,7 @@ var ts; directImports.push(direct); } break; - case 188 /* ImportType */: + case 189 /* ImportType */: directImports.push(direct); break; default: @@ -113114,7 +113700,7 @@ var ts; } else if (!isAvailableThroughGlobal) { var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - ts.Debug.assert(sourceFileLike.kind === 290 /* SourceFile */ || sourceFileLike.kind === 249 /* ModuleDeclaration */); + ts.Debug.assert(sourceFileLike.kind === 291 /* SourceFile */ || sourceFileLike.kind === 250 /* ModuleDeclaration */); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUsers(sourceFileLike); } @@ -113171,7 +113757,7 @@ var ts; } return { importSearches: importSearches, singleReferences: singleReferences }; function handleImport(decl) { - if (decl.kind === 253 /* ImportEqualsDeclaration */) { + if (decl.kind === 254 /* ImportEqualsDeclaration */) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } @@ -113181,7 +113767,7 @@ var ts; handleNamespaceImportLike(decl); return; } - if (decl.kind === 188 /* ImportType */) { + if (decl.kind === 189 /* ImportType */) { if (decl.qualifier) { var firstIdentifier = ts.getFirstIdentifier(decl.qualifier); if (firstIdentifier.escapedText === ts.symbolName(exportSymbol)) { @@ -113197,7 +113783,7 @@ var ts; if (decl.moduleSpecifier.kind !== 10 /* StringLiteral */) { return; } - if (decl.kind === 260 /* ExportDeclaration */) { + if (decl.kind === 261 /* ExportDeclaration */) { if (decl.exportClause && ts.isNamedExports(decl.exportClause)) { searchForNamedImport(decl.exportClause); } @@ -113206,10 +113792,10 @@ var ts; var _a = decl.importClause || { name: undefined, namedBindings: undefined }, name = _a.name, namedBindings = _a.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: handleNamespaceImportLike(namedBindings.name); break; - case 257 /* NamedImports */: + case 258 /* NamedImports */: // 'default' might be accessed as a named import `{ default as foo }`. if (exportKind === 0 /* Named */ || exportKind === 1 /* Default */) { searchForNamedImport(namedBindings); @@ -113259,7 +113845,7 @@ var ts; } } else { - var localSymbol = element.kind === 263 /* ExportSpecifier */ && element.propertyName + var localSymbol = element.kind === 264 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol. : checker.getSymbolAtLocation(name); addSearch(name, localSymbol); @@ -113288,7 +113874,7 @@ var ts; for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { var referencingFile = sourceFiles_1[_i]; var searchSourceFile = searchModuleSymbol.valueDeclaration; - if (searchSourceFile.kind === 290 /* SourceFile */) { + if (searchSourceFile.kind === 291 /* SourceFile */) { for (var _a = 0, _b = referencingFile.referencedFiles; _a < _b.length; _a++) { var ref = _b[_a]; if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { @@ -113336,7 +113922,7 @@ var ts; } /** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */ function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return ts.forEach(sourceFileLike.kind === 290 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return ts.forEach(sourceFileLike.kind === 291 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); }); } @@ -113351,15 +113937,15 @@ var ts; else { forEachPossibleImportOrExportStatement(sourceFile, function (statement) { switch (statement.kind) { - case 260 /* ExportDeclaration */: - case 254 /* ImportDeclaration */: { + case 261 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: { var decl = statement; if (decl.moduleSpecifier && ts.isStringLiteral(decl.moduleSpecifier)) { action(decl, decl.moduleSpecifier); } break; } - case 253 /* ImportEqualsDeclaration */: { + case 254 /* ImportEqualsDeclaration */: { var decl = statement; if (isExternalModuleImportEquals(decl)) { action(decl, decl.moduleReference.expression); @@ -113383,7 +113969,7 @@ var ts; var parent = node.parent; var grandParent = parent.parent; if (symbol.exportSymbol) { - if (parent.kind === 194 /* PropertyAccessExpression */) { + if (parent.kind === 195 /* PropertyAccessExpression */) { // When accessing an export of a JS module, there's no alias. The symbol will still be flagged as an export even though we're at the use. // So check that we are at the declaration. return symbol.declarations.some(function (d) { return d === parent; }) && ts.isBinaryExpression(grandParent) @@ -113513,13 +114099,13 @@ var ts; function isNodeImport(node) { var parent = node.parent; switch (parent.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return parent.name === node && isExternalModuleImportEquals(parent); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. return !parent.propertyName; - case 255 /* ImportClause */: - case 256 /* NamespaceImport */: + case 256 /* ImportClause */: + case 257 /* NamespaceImport */: ts.Debug.assert(parent.name === node); return true; default: @@ -113552,21 +114138,21 @@ var ts; return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 196 /* CallExpression */) { + if (node.kind === 197 /* CallExpression */) { return node.getSourceFile(); } var parent = node.parent; - if (parent.kind === 290 /* SourceFile */) { + if (parent.kind === 291 /* SourceFile */) { return parent; } - ts.Debug.assert(parent.kind === 250 /* ModuleBlock */); + ts.Debug.assert(parent.kind === 251 /* ModuleBlock */); return ts.cast(parent.parent, isAmbientModuleDeclaration); } function isAmbientModuleDeclaration(node) { - return node.kind === 249 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; + return node.kind === 250 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; } function isExternalModuleImportEquals(eq) { - return eq.moduleReference.kind === 265 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; + return eq.moduleReference.kind === 266 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; } })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); @@ -113668,7 +114254,7 @@ var ts; if (!node) return undefined; switch (node.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return !ts.isVariableDeclarationList(node.parent) || node.parent.declarations.length !== 1 ? node : ts.isVariableStatement(node.parent.parent) ? @@ -113676,27 +114262,27 @@ var ts; ts.isForInOrOfStatement(node.parent.parent) ? getContextNode(node.parent.parent) : node.parent; - case 191 /* BindingElement */: + case 192 /* BindingElement */: return getContextNode(node.parent.parent); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return node.parent.parent.parent; - case 263 /* ExportSpecifier */: - case 256 /* NamespaceImport */: + case 264 /* ExportSpecifier */: + case 257 /* NamespaceImport */: return node.parent.parent; - case 255 /* ImportClause */: + case 256 /* ImportClause */: return node.parent; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return ts.isExpressionStatement(node.parent) ? node.parent : node; - case 232 /* ForOfStatement */: - case 231 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 232 /* ForInStatement */: return { start: node.initializer, end: node.expression }; - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(ts.findAncestor(node.parent, function (node) { return ts.isBinaryExpression(node) || ts.isForInOrOfStatement(node); @@ -113757,13 +114343,13 @@ var ts; } FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { return undefined; } var checker = program.getTypeChecker(); // If invoked directly on a shorthand property assignment, then return // the declaration of the symbol being assigned (not the symbol being assigned to). - if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { var result_1 = []; Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_1.push(nodeEntry(node)); }); return result_1; @@ -113913,13 +114499,13 @@ var ts; if (symbol) { return getDefinitionKindAndDisplayParts(symbol, checker, node); } - else if (node.kind === 193 /* ObjectLiteralExpression */) { + else if (node.kind === 194 /* ObjectLiteralExpression */) { return { kind: "interface" /* interfaceElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("object literal"), ts.punctuationPart(21 /* CloseParenToken */)] }; } - else if (node.kind === 214 /* ClassExpression */) { + else if (node.kind === 215 /* ClassExpression */) { return { kind: "local class" /* localClassElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("anonymous local class"), ts.punctuationPart(21 /* CloseParenToken */)] @@ -113969,7 +114555,7 @@ var ts; return node.kind === 84 /* DefaultKeyword */ || !!ts.getDeclarationFromName(node) || ts.isLiteralComputedPropertyDeclarationName(node) - || (node.kind === 129 /* ConstructorKeyword */ && ts.isConstructorDeclaration(node.parent)); + || (node.kind === 130 /* ConstructorKeyword */ && ts.isConstructorDeclaration(node.parent)); } /** * True if 'decl' provides a value, as in `function f() {}`; @@ -113980,47 +114566,47 @@ var ts; if (!!(decl.flags & 8388608 /* Ambient */)) return true; switch (decl.kind) { - case 209 /* BinaryExpression */: - case 191 /* BindingElement */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 210 /* BinaryExpression */: + case 192 /* BindingElement */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: case 84 /* DefaultKeyword */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 263 /* ExportSpecifier */: - case 255 /* ImportClause */: // default import - case 253 /* ImportEqualsDeclaration */: - case 258 /* ImportSpecifier */: - case 246 /* InterfaceDeclaration */: - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: - case 273 /* JsxAttribute */: - case 249 /* ModuleDeclaration */: - case 252 /* NamespaceExportDeclaration */: - case 256 /* NamespaceImport */: - case 262 /* NamespaceExport */: - case 156 /* Parameter */: - case 282 /* ShorthandPropertyAssignment */: - case 247 /* TypeAliasDeclaration */: - case 155 /* TypeParameter */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 264 /* ExportSpecifier */: + case 256 /* ImportClause */: // default import + case 254 /* ImportEqualsDeclaration */: + case 259 /* ImportSpecifier */: + case 247 /* InterfaceDeclaration */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: + case 274 /* JsxAttribute */: + case 250 /* ModuleDeclaration */: + case 253 /* NamespaceExportDeclaration */: + case 257 /* NamespaceImport */: + case 263 /* NamespaceExport */: + case 157 /* Parameter */: + case 283 /* ShorthandPropertyAssignment */: + case 248 /* TypeAliasDeclaration */: + case 156 /* TypeParameter */: return true; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // In `({ x: y } = 0);`, `x` is not a write access. (Won't call this function for `y`.) return !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent); - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return !!decl.body; - case 242 /* VariableDeclaration */: - case 159 /* PropertyDeclaration */: + case 243 /* VariableDeclaration */: + case 160 /* PropertyDeclaration */: return !!decl.initializer || ts.isCatchClause(decl.parent); - case 160 /* MethodSignature */: - case 158 /* PropertySignature */: - case 323 /* JSDocPropertyTag */: - case 317 /* JSDocParameterTag */: + case 161 /* MethodSignature */: + case 159 /* PropertySignature */: + case 324 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: return false; default: return ts.Debug.failBadSyntaxKind(decl); @@ -114181,10 +114767,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; switch (decl.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: // Don't include the source file itself. (This may not be ideal behavior, but awkward to include an entire file as a reference.) break; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: if (sourceFilesSet.has(decl.getSourceFile().fileName)) { references.push(nodeEntry(decl.name)); } @@ -114213,9 +114799,9 @@ var ts; } /** As in a `readonly prop: any` or `constructor(readonly prop: any)`, not a `readonly any[]`. */ function isReadonlyTypeOperator(node) { - return node.kind === 138 /* ReadonlyKeyword */ + return node.kind === 139 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(node.parent) - && node.parent.operator === 138 /* ReadonlyKeyword */; + && node.parent.operator === 139 /* ReadonlyKeyword */; } /** getReferencedSymbols for special node kinds. */ function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { @@ -114226,12 +114812,12 @@ var ts; } // A modifier readonly (like on a property declaration) is not special; // a readonly type keyword (like `readonly string[]`) is. - if (node.kind === 138 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { + if (node.kind === 139 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { return undefined; } // Likewise, when we *are* looking for a special keyword, make sure we // *don’t* include readonly member modifiers. - return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 138 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); + return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 139 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); } // Labels if (ts.isJumpStatementTarget(node)) { @@ -114292,7 +114878,7 @@ var ts; } function getSpecialSearchKind(node) { switch (node.kind) { - case 129 /* ConstructorKeyword */: + case 130 /* ConstructorKeyword */: return 1 /* Constructor */; case 75 /* Identifier */: if (ts.isClassLike(node.parent)) { @@ -114532,7 +115118,7 @@ var ts; // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 201 /* FunctionExpression */ || valueDeclaration.kind === 214 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 202 /* FunctionExpression */ || valueDeclaration.kind === 215 /* ClassExpression */)) { return valueDeclaration; } if (!declarations) { @@ -114542,7 +115128,7 @@ var ts; if (flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.find(declarations, function (d) { return ts.hasModifier(d, 8 /* Private */) || ts.isPrivateIdentifierPropertyDeclaration(d); }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 245 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 246 /* ClassDeclaration */); } // Else this is a public property and could be accessed from anywhere. return undefined; @@ -114571,7 +115157,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (!container || container.kind === 290 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 291 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { // This is a global variable and not an external module, any declaration defined // within this scope is visible outside the file return undefined; @@ -114940,15 +115526,15 @@ var ts; if (constructorSymbol && constructorSymbol.declarations) { for (var _i = 0, _a = constructorSymbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - var ctrKeyword = ts.findChildOfKind(decl, 129 /* ConstructorKeyword */, sourceFile); - ts.Debug.assert(decl.kind === 162 /* Constructor */ && !!ctrKeyword); + var ctrKeyword = ts.findChildOfKind(decl, 130 /* ConstructorKeyword */, sourceFile); + ts.Debug.assert(decl.kind === 163 /* Constructor */ && !!ctrKeyword); addNode(ctrKeyword); } } if (classSymbol.exports) { classSymbol.exports.forEach(function (member) { var decl = member.valueDeclaration; - if (decl && decl.kind === 161 /* MethodDeclaration */) { + if (decl && decl.kind === 162 /* MethodDeclaration */) { var body = decl.body; if (body) { forEachDescendantOfKind(body, 104 /* ThisKeyword */, function (thisKeyword) { @@ -114972,7 +115558,7 @@ var ts; } for (var _i = 0, _a = constructor.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - ts.Debug.assert(decl.kind === 162 /* Constructor */); + ts.Debug.assert(decl.kind === 163 /* Constructor */); var body = decl.body; if (body) { forEachDescendantOfKind(body, 102 /* SuperKeyword */, function (node) { @@ -115002,7 +115588,7 @@ var ts; if (refNode.kind !== 75 /* Identifier */) { return; } - if (refNode.parent.kind === 282 /* ShorthandPropertyAssignment */) { + if (refNode.parent.kind === 283 /* ShorthandPropertyAssignment */) { // Go ahead and dereference the shorthand assignment by going to its definition getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); } @@ -115022,7 +115608,7 @@ var ts; } else if (ts.isFunctionLike(typeHavingNode) && typeHavingNode.body) { var body = typeHavingNode.body; - if (body.kind === 223 /* Block */) { + if (body.kind === 224 /* Block */) { ts.forEachReturnStatement(body, function (returnStatement) { if (returnStatement.expression) addIfImplementation(returnStatement.expression); @@ -115050,13 +115636,13 @@ var ts; */ function isImplementationExpression(node) { switch (node.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isImplementationExpression(node.expression); - case 202 /* ArrowFunction */: - case 201 /* FunctionExpression */: - case 193 /* ObjectLiteralExpression */: - case 214 /* ClassExpression */: - case 192 /* ArrayLiteralExpression */: + case 203 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 194 /* ObjectLiteralExpression */: + case 215 /* ClassExpression */: + case 193 /* ArrayLiteralExpression */: return true; default: return false; @@ -115109,13 +115695,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -115136,41 +115722,41 @@ var ts; return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references: references }]; } function isParameterName(node) { - return node.kind === 75 /* Identifier */ && node.parent.kind === 156 /* Parameter */ && node.parent.name === node; + return node.kind === 75 /* Identifier */ && node.parent.kind === 157 /* Parameter */ && node.parent.name === node; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); // Whether 'this' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // falls through - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { return undefined; } // falls through - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. default: return undefined; } - var references = ts.flatMap(searchSpaceNode.kind === 290 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { + var references = ts.flatMap(searchSpaceNode.kind === 291 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { cancellationToken.throwIfCancellationRequested(); return getPossibleSymbolReferenceNodes(sourceFile, "this", ts.isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter(function (node) { if (!ts.isThis(node)) { @@ -115178,19 +115764,19 @@ var ts; } var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); switch (searchSpaceNode.kind) { - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: return searchSpaceNode.symbol === container.symbol; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: return ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol; - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: // Make sure the container belongs to the same class // and has the appropriate static modifier from the original container. return container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag; - case 290 /* SourceFile */: - return container.kind === 290 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); + case 291 /* SourceFile */: + return container.kind === 291 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); } }); }).map(function (n) { return nodeEntry(n); }); @@ -115273,7 +115859,7 @@ var ts; ts.Debug.assert(paramProps.length === 2 && !!(paramProps[0].flags & 1 /* FunctionScopedVariable */) && !!(paramProps[1].flags & 4 /* Property */)); // is [parameter, property] return fromRoot(symbol.flags & 1 /* FunctionScopedVariable */ ? paramProps[1] : paramProps[0]); } - var exportSpecifier = ts.getDeclarationOfKind(symbol, 263 /* ExportSpecifier */); + var exportSpecifier = ts.getDeclarationOfKind(symbol, 264 /* ExportSpecifier */); if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) { var localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); if (localSymbol) { @@ -115318,7 +115904,7 @@ var ts; }); } function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { - var bindingElement = ts.getDeclarationOfKind(symbol, 191 /* BindingElement */); + var bindingElement = ts.getDeclarationOfKind(symbol, 192 /* BindingElement */); if (bindingElement && ts.isObjectBindingElementWithoutPropertyName(bindingElement)) { return ts.getPropertySymbolFromBindingElement(checker, bindingElement); } @@ -115714,55 +116300,55 @@ var ts; } switch (node.kind) { case 75 /* Identifier */: - case 253 /* ImportEqualsDeclaration */: - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: // do not descend into nodes that cannot contain callable nodes return; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: // do not descend into the type side of an assertion collect(node.expression); return; - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: // do not descend into the type of a variable or parameter declaration collect(node.name); collect(node.initializer); return; - case 196 /* CallExpression */: + case 197 /* CallExpression */: // do not descend into the type arguments of a call expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 197 /* NewExpression */: + case 198 /* NewExpression */: // do not descend into the type arguments of a new expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: // do not descend into the type arguments of a tagged template expression recordCallSite(node); collect(node.tag); collect(node.template); return; - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: // do not descend into the type arguments of a JsxOpeningLikeElement recordCallSite(node); collect(node.tagName); collect(node.attributes); return; - case 157 /* Decorator */: + case 158 /* Decorator */: recordCallSite(node); collect(node.expression); return; - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: recordCallSite(node); ts.forEachChild(node, collect); break; @@ -115812,22 +116398,22 @@ var ts; var callSites = []; var collect = createCallSiteCollector(program, callSites); switch (node.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: collectCallSitesOfSourceFile(node, collect); break; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: collectCallSitesOfModuleDeclaration(node, collect); break; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect); break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: collectCallSitesOfClassLikeDeclaration(node, collect); break; default: @@ -116124,7 +116710,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { var shorthandSymbol_1 = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); return shorthandSymbol_1 ? shorthandSymbol_1.declarations.map(function (decl) { return createDefinitionInfo(decl, typeChecker, shorthandSymbol_1, node); }) : []; } @@ -116293,11 +116879,11 @@ var ts; return true; } switch (declaration.kind) { - case 255 /* ImportClause */: - case 253 /* ImportEqualsDeclaration */: + case 256 /* ImportClause */: + case 254 /* ImportEqualsDeclaration */: return true; - case 258 /* ImportSpecifier */: - return declaration.parent.kind === 257 /* NamedImports */; + case 259 /* ImportSpecifier */: + return declaration.parent.kind === 258 /* NamedImports */; default: return false; } @@ -116311,7 +116897,7 @@ var ts; function getConstructSignatureDefinition() { // Applicable only if we are in a new expression, or we are on a constructor declaration // and in either case the symbol has a construct signature definition, i.e. class - if (symbol.flags & 32 /* Class */ && !(symbol.flags & 16 /* Function */) && (ts.isNewExpressionTarget(node) || node.kind === 129 /* ConstructorKeyword */)) { + if (symbol.flags & 32 /* Class */ && !(symbol.flags & 16 /* Function */) && (ts.isNewExpressionTarget(node) || node.kind === 130 /* ConstructorKeyword */)) { var cls = ts.find(filteredDeclarations, ts.isClassLike) || ts.Debug.fail("Expected declaration to have at least one class-like declaration"); return getSignatureDefinition(cls.members, /*selectConstructors*/ true); } @@ -116384,9 +116970,9 @@ var ts; } function isConstructorLike(node) { switch (node.kind) { - case 162 /* Constructor */: - case 171 /* ConstructorType */: - case 166 /* ConstructSignature */: + case 163 /* Constructor */: + case 172 /* ConstructorType */: + case 167 /* ConstructSignature */: return true; default: return false; @@ -116504,11 +117090,11 @@ var ts; JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; function getCommentHavingNodes(declaration) { switch (declaration.kind) { - case 317 /* JSDocParameterTag */: - case 323 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: + case 324 /* JSDocPropertyTag */: return [declaration]; - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: return [declaration, declaration.parent]; default: return ts.getJSDocCommentsAndTags(declaration); @@ -116529,18 +117115,18 @@ var ts; function getCommentText(tag) { var comment = tag.comment; switch (tag.kind) { - case 308 /* JSDocImplementsTag */: + case 309 /* JSDocImplementsTag */: return withNode(tag.class); - case 307 /* JSDocAugmentsTag */: + case 308 /* JSDocAugmentsTag */: return withNode(tag.class); - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return withList(tag.typeParameters); - case 320 /* JSDocTypeTag */: + case 321 /* JSDocTypeTag */: return withNode(tag.typeExpression); - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 323 /* JSDocPropertyTag */: - case 317 /* JSDocParameterTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 324 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: var name = tag.name; return name ? withNode(name) : comment; default: @@ -116709,23 +117295,23 @@ var ts; } function getCommentOwnerInfoWorker(commentOwner) { switch (commentOwner.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 160 /* MethodSignature */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 161 /* MethodSignature */: var parameters = commentOwner.parameters; return { commentOwner: commentOwner, parameters: parameters }; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return getCommentOwnerInfoWorker(commentOwner.initializer); - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 158 /* PropertySignature */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 247 /* TypeAliasDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 159 /* PropertySignature */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 248 /* TypeAliasDeclaration */: return { commentOwner: commentOwner }; - case 225 /* VariableStatement */: { + case 226 /* VariableStatement */: { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; var parameters_1 = varDeclarations.length === 1 && varDeclarations[0].initializer @@ -116733,14 +117319,14 @@ var ts; : undefined; return { commentOwner: commentOwner, parameters: parameters_1 }; } - case 290 /* SourceFile */: + case 291 /* SourceFile */: return "quit"; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: // If in walking up the tree, we hit a a nested namespace declaration, // then we must be somewhere within a dotted namespace name; however we don't // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. - return commentOwner.parent.kind === 249 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; - case 209 /* BinaryExpression */: { + return commentOwner.parent.kind === 250 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; + case 210 /* BinaryExpression */: { var be = commentOwner; if (ts.getAssignmentDeclarationKind(be) === 0 /* None */) { return "quit"; @@ -116748,7 +117334,7 @@ var ts; var parameters_2 = ts.isFunctionLike(be.right) ? be.right.parameters : ts.emptyArray; return { commentOwner: commentOwner, parameters: parameters_2 }; } - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: var init = commentOwner.initializer; if (init && (ts.isFunctionExpression(init) || ts.isArrowFunction(init))) { return { commentOwner: commentOwner, parameters: init.parameters }; @@ -116764,14 +117350,14 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 200 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 201 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return rightHandSide.parameters; - case 214 /* ClassExpression */: { + case 215 /* ClassExpression */: { var ctr = ts.find(rightHandSide.members, ts.isConstructorDeclaration); return ctr ? ctr.parameters : ts.emptyArray; } @@ -116833,9 +117419,9 @@ var ts; } function shouldKeepItem(declaration, checker) { switch (declaration.kind) { - case 255 /* ImportClause */: - case 258 /* ImportSpecifier */: - case 253 /* ImportEqualsDeclaration */: + case 256 /* ImportClause */: + case 259 /* ImportSpecifier */: + case 254 /* ImportEqualsDeclaration */: var importer = checker.getSymbolAtLocation(declaration.name); // TODO: GH#18217 var imported = checker.getAliasedSymbol(importer); return importer.escapedName !== imported.escapedName; @@ -116845,7 +117431,7 @@ var ts; } function tryAddSingleDeclarationName(declaration, containers) { var name = ts.getNameOfDeclaration(declaration); - return !!name && (pushLiteral(name, containers) || name.kind === 154 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); + return !!name && (pushLiteral(name, containers) || name.kind === 155 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); } // Only added the names of computed properties if they're simple dotted expressions, like: // @@ -116862,7 +117448,7 @@ var ts; // First, if we started with a computed property name, then add all but the last // portion into the container array. var name = ts.getNameOfDeclaration(declaration); - if (name && name.kind === 154 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { + if (name && name.kind === 155 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { return ts.emptyArray; } // Don't include the last portion. @@ -117069,7 +117655,7 @@ var ts; return; } switch (node.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it. var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); @@ -117081,21 +117667,21 @@ var ts; } } break; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 161 /* MethodSignature */: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 255 /* ImportClause */: + case 256 /* ImportClause */: var importClause = node; // Handle default import case e.g.: // import d from "mod"; @@ -117107,7 +117693,7 @@ var ts; // import {a, b as B} from "mod"; var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 256 /* NamespaceImport */) { + if (namedBindings.kind === 257 /* NamespaceImport */) { addLeafNode(namedBindings); } else { @@ -117118,17 +117704,17 @@ var ts; } } break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: addNodeWithRecursiveChild(node, node.name); break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: var expression = node.expression; // Use the expression as the name of the SpreadAssignment, otherwise show as . ts.isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node); break; - case 191 /* BindingElement */: - case 281 /* PropertyAssignment */: - case 242 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 282 /* PropertyAssignment */: + case 243 /* VariableDeclaration */: var _e = node, name = _e.name, initializer = _e.initializer; if (ts.isBindingPattern(name)) { addChildrenRecursively(name); @@ -117143,7 +117729,7 @@ var ts; addNodeWithRecursiveChild(node, initializer); } break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: var nameNode = node.name; // If we see a function declaration track as a possible ES5 class if (nameNode && ts.isIdentifier(nameNode)) { @@ -117151,11 +117737,11 @@ var ts; } addNodeWithRecursiveChild(node, node.body); break; - case 202 /* ArrowFunction */: - case 201 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 202 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: startNode(node); for (var _f = 0, _g = node.members; _f < _g.length; _f++) { var member = _g[_f]; @@ -117165,9 +117751,9 @@ var ts; } endNode(); break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: startNode(node); for (var _h = 0, _j = node.members; _h < _j.length; _h++) { var member = _j[_h]; @@ -117175,20 +117761,20 @@ var ts; } endNode(); break; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 259 /* ExportAssignment */: - case 263 /* ExportSpecifier */: - case 253 /* ImportEqualsDeclaration */: - case 167 /* IndexSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 247 /* TypeAliasDeclaration */: + case 260 /* ExportAssignment */: + case 264 /* ExportSpecifier */: + case 254 /* ImportEqualsDeclaration */: + case 168 /* IndexSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 248 /* TypeAliasDeclaration */: addLeafNode(node); break; - case 196 /* CallExpression */: - case 209 /* BinaryExpression */: { + case 197 /* CallExpression */: + case 210 /* BinaryExpression */: { var special = ts.getAssignmentDeclarationKind(node); switch (special) { case 1 /* ExportsProperty */: @@ -117430,12 +118016,12 @@ var ts; return false; } switch (a.kind) { - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return ts.hasModifier(a, 32 /* Static */) === ts.hasModifier(b, 32 /* Static */); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return areSameModule(a, b); default: return true; @@ -117451,7 +118037,7 @@ var ts; // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'! function areSameModule(a, b) { // TODO: GH#18217 - return a.body.kind === b.body.kind && (a.body.kind !== 249 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 250 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); } /** Merge source into target. Source should be thrown away after this is called. */ function merge(target, source) { @@ -117481,7 +118067,7 @@ var ts; * So `new()` can still come before an `aardvark` method. */ function tryGetName(node) { - if (node.kind === 249 /* ModuleDeclaration */) { + if (node.kind === 250 /* ModuleDeclaration */) { return getModuleName(node); } var declName = ts.getNameOfDeclaration(node); @@ -117490,16 +118076,16 @@ var ts; return propertyName && ts.unescapeLeadingUnderscores(propertyName); } switch (node.kind) { - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 214 /* ClassExpression */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 215 /* ClassExpression */: return getFunctionOrClassName(node); default: return undefined; } } function getItemName(node, name) { - if (node.kind === 249 /* ModuleDeclaration */) { + if (node.kind === 250 /* ModuleDeclaration */) { return cleanText(getModuleName(node)); } if (name) { @@ -117511,18 +118097,18 @@ var ts; } } switch (node.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return ts.isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; - case 202 /* ArrowFunction */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 203 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: if (ts.getModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -117530,13 +118116,13 @@ var ts; // (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the // navigation bar. return getFunctionOrClassName(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return "constructor"; - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: return "new()"; - case 165 /* CallSignature */: + case 166 /* CallSignature */: return "()"; - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: return "[]"; default: return ""; @@ -117569,19 +118155,19 @@ var ts; } // Some nodes are otherwise important enough to always include in the primary navigation menu. switch (navigationBarNodeKind(item)) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 248 /* EnumDeclaration */: - case 246 /* InterfaceDeclaration */: - case 249 /* ModuleDeclaration */: - case 290 /* SourceFile */: - case 247 /* TypeAliasDeclaration */: - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 249 /* EnumDeclaration */: + case 247 /* InterfaceDeclaration */: + case 250 /* ModuleDeclaration */: + case 291 /* SourceFile */: + case 248 /* TypeAliasDeclaration */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: return true; - case 202 /* ArrowFunction */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -117591,10 +118177,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 250 /* ModuleBlock */: - case 290 /* SourceFile */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: + case 251 /* ModuleBlock */: + case 291 /* SourceFile */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: return true; default: return false; @@ -117654,7 +118240,7 @@ var ts; // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 249 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 250 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } @@ -117668,13 +118254,13 @@ var ts; return decl.body && ts.isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 154 /* ComputedPropertyName */; + return !member.name || member.name.kind === 155 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 290 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); + return node.kind === 291 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); } function getModifiers(node) { - if (node.parent && node.parent.kind === 242 /* VariableDeclaration */) { + if (node.parent && node.parent.kind === 243 /* VariableDeclaration */) { node = node.parent; } return ts.getNodeModifiers(node); @@ -117732,9 +118318,9 @@ var ts; } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 202 /* ArrowFunction */: - case 201 /* FunctionExpression */: - case 214 /* ClassExpression */: + case 203 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 215 /* ClassExpression */: return true; default: return false; @@ -118242,7 +118828,7 @@ var ts; } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 223 /* Block */: + case 224 /* Block */: if (ts.isFunctionLike(n.parent)) { return functionSpan(n.parent, n, sourceFile); } @@ -118250,16 +118836,16 @@ var ts; // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. switch (n.parent.kind) { - case 228 /* DoStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 230 /* ForStatement */: - case 227 /* IfStatement */: - case 229 /* WhileStatement */: - case 236 /* WithStatement */: - case 280 /* CatchClause */: + case 229 /* DoStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 231 /* ForStatement */: + case 228 /* IfStatement */: + case 230 /* WhileStatement */: + case 237 /* WithStatement */: + case 281 /* CatchClause */: return spanForNode(n.parent); - case 240 /* TryStatement */: + case 241 /* TryStatement */: // Could be the try-block, or the finally-block. var tryStatement = n.parent; if (tryStatement.tryBlock === n) { @@ -118276,26 +118862,29 @@ var ts; // the span of the block, independent of any parent span. return createOutliningSpan(ts.createTextSpanFromNode(n, sourceFile), "code" /* Code */); } - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return spanForNode(n.parent); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 251 /* CaseBlock */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 252 /* CaseBlock */: return spanForNode(n); - case 193 /* ObjectLiteralExpression */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: + return spanForNodeArray(n.statements); + case 194 /* ObjectLiteralExpression */: return spanForObjectOrArrayLiteral(n); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return spanForObjectOrArrayLiteral(n, 22 /* OpenBracketToken */); - case 266 /* JsxElement */: + case 267 /* JsxElement */: return spanForJSXElement(n); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return spanForJSXFragment(n); - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: return spanForJSXAttributes(n.attributes); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: return spanForTemplateLiteral(n); } @@ -118338,13 +118927,16 @@ var ts; var closeToken = ts.findChildOfKind(n, close, sourceFile); return openToken && closeToken && spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart); } + function spanForNodeArray(nodeArray) { + return nodeArray.length ? createOutliningSpan(ts.createTextSpanFromRange(nodeArray), "code" /* Code */) : undefined; + } } function functionSpan(node, body, sourceFile) { var openToken = ts.isNodeArrayMultiLine(node.parameters, sourceFile) ? ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile) : ts.findChildOfKind(body, 18 /* OpenBraceToken */, sourceFile); var closeToken = ts.findChildOfKind(body, 19 /* CloseBraceToken */, sourceFile); - return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 202 /* ArrowFunction */); + return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 203 /* ArrowFunction */); } function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart) { if (autoCollapse === void 0) { autoCollapse = false; } @@ -118879,10 +119471,10 @@ var ts; */ function tryConsumeDeclare() { var token = ts.scanner.getToken(); - if (token === 130 /* DeclareKeyword */) { + if (token === 131 /* DeclareKeyword */) { // declare module "mod" token = nextToken(); - if (token === 135 /* ModuleKeyword */) { + if (token === 136 /* ModuleKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { recordAmbientExternalModule(); @@ -118904,7 +119496,7 @@ var ts; token = nextToken(); if (token === 20 /* OpenParenToken */) { token = nextToken(); - if (token === 10 /* StringLiteral */) { + if (token === 10 /* StringLiteral */ || token === 14 /* NoSubstitutionTemplateLiteral */) { // import("mod"); recordModuleName(); return true; @@ -118918,7 +119510,7 @@ var ts; else { if (token === 75 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 149 /* FromKeyword */) { + if (token === 150 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import d from "mod"; @@ -118949,7 +119541,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 149 /* FromKeyword */) { + if (token === 150 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import {a as A} from "mod"; @@ -118965,7 +119557,7 @@ var ts; token = nextToken(); if (token === 75 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 149 /* FromKeyword */) { + if (token === 150 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import * as NS from "mod" @@ -118995,7 +119587,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 149 /* FromKeyword */) { + if (token === 150 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export {a as A} from "mod"; @@ -119007,7 +119599,7 @@ var ts; } else if (token === 41 /* AsteriskToken */) { token = nextToken(); - if (token === 149 /* FromKeyword */) { + if (token === 150 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export * from "mod" @@ -119030,13 +119622,15 @@ var ts; } return false; } - function tryConsumeRequireCall(skipCurrentToken) { + function tryConsumeRequireCall(skipCurrentToken, allowTemplateLiterals) { + if (allowTemplateLiterals === void 0) { allowTemplateLiterals = false; } var token = skipCurrentToken ? nextToken() : ts.scanner.getToken(); - if (token === 139 /* RequireKeyword */) { + if (token === 140 /* RequireKeyword */) { token = nextToken(); if (token === 20 /* OpenParenToken */) { token = nextToken(); - if (token === 10 /* StringLiteral */) { + if (token === 10 /* StringLiteral */ || + allowTemplateLiterals && token === 14 /* NoSubstitutionTemplateLiteral */) { // require("mod"); recordModuleName(); } @@ -119053,7 +119647,7 @@ var ts; return true; } token = nextToken(); - if (token === 10 /* StringLiteral */) { + if (token === 10 /* StringLiteral */ || token === 14 /* NoSubstitutionTemplateLiteral */) { // looks like define ("modname", ... - skip string literal and comma token = nextToken(); if (token === 27 /* CommaToken */) { @@ -119073,7 +119667,7 @@ var ts; // scan until ']' or EOF while (token !== 23 /* CloseBracketToken */ && token !== 1 /* EndOfFileToken */) { // record string literals as module names - if (token === 10 /* StringLiteral */) { + if (token === 10 /* StringLiteral */ || token === 14 /* NoSubstitutionTemplateLiteral */) { recordModuleName(); } token = nextToken(); @@ -119108,7 +119702,8 @@ var ts; if (tryConsumeDeclare() || tryConsumeImport() || tryConsumeExport() || - (detectJavaScriptImports && (tryConsumeRequireCall(/*skipCurrentToken*/ false) || tryConsumeDefine()))) { + (detectJavaScriptImports && (tryConsumeRequireCall(/*skipCurrentToken*/ false, /*allowTemplateLiterals*/ true) || + tryConsumeDefine()))) { continue; } else { @@ -119184,14 +119779,14 @@ var ts; return getRenameInfoError(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); } // Cannot rename `default` as in `import { default as foo } from "./someModule"; - if (ts.isIdentifier(node) && node.originalKeywordKind === 84 /* DefaultKeyword */ && symbol.parent.flags & 1536 /* Module */) { + if (ts.isIdentifier(node) && node.originalKeywordKind === 84 /* DefaultKeyword */ && symbol.parent && symbol.parent.flags & 1536 /* Module */) { return undefined; } if (ts.isStringLiteralLike(node) && ts.tryGetImportFromModuleSpecifier(node)) { return options && options.allowRenameOfImportPath ? getRenameInfoForModule(node, sourceFile, symbol) : undefined; } var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 154 /* ComputedPropertyName */) + var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 155 /* ComputedPropertyName */) ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node)) : undefined; var displayName = specifierName || typeChecker.symbolToString(symbol); @@ -119403,14 +119998,14 @@ var ts; ts.Debug.assertEqual(closeBraceToken.kind, 19 /* CloseBraceToken */); // Group `-/+readonly` and `-/+?` var groupedWithPlusMinusTokens = groupChildren(children, function (child) { - return child === node.readonlyToken || child.kind === 138 /* ReadonlyKeyword */ || + return child === node.readonlyToken || child.kind === 139 /* ReadonlyKeyword */ || child === node.questionToken || child.kind === 57 /* QuestionToken */; }); // Group type parameter with surrounding brackets var groupedWithBrackets = groupChildren(groupedWithPlusMinusTokens, function (_a) { var kind = _a.kind; return kind === 22 /* OpenBracketToken */ || - kind === 155 /* TypeParameter */ || + kind === 156 /* TypeParameter */ || kind === 23 /* CloseBracketToken */; }); return [ @@ -119517,7 +120112,7 @@ var ts; } function createSyntaxList(children) { ts.Debug.assertGreaterThanOrEqual(children.length, 1); - var syntaxList = ts.createNode(324 /* SyntaxList */, children[0].pos, ts.last(children).end); + var syntaxList = ts.createNode(325 /* SyntaxList */, children[0].pos, ts.last(children).end); syntaxList._children = children; return syntaxList; } @@ -119526,14 +120121,14 @@ var ts; return kind === 18 /* OpenBraceToken */ || kind === 22 /* OpenBracketToken */ || kind === 20 /* OpenParenToken */ - || kind === 268 /* JsxOpeningElement */; + || kind === 269 /* JsxOpeningElement */; } function isListCloser(token) { var kind = token && token.kind; return kind === 19 /* CloseBraceToken */ || kind === 23 /* CloseBracketToken */ || kind === 21 /* CloseParenToken */ - || kind === 269 /* JsxClosingElement */; + || kind === 270 /* JsxClosingElement */; } })(SmartSelectionRange = ts.SmartSelectionRange || (ts.SmartSelectionRange = {})); })(ts || (ts = {})); @@ -119738,10 +120333,10 @@ var ts; } return undefined; } - else if (ts.isTemplateHead(node) && parent.parent.kind === 198 /* TaggedTemplateExpression */) { + else if (ts.isTemplateHead(node) && parent.parent.kind === 199 /* TaggedTemplateExpression */) { var templateExpression = parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 211 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 212 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } @@ -119808,17 +120403,17 @@ var ts; return undefined; var parent = startingToken.parent; switch (parent.kind) { - case 200 /* ParenthesizedExpression */: - case 161 /* MethodDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 201 /* ParenthesizedExpression */: + case 162 /* MethodDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: var info = getArgumentOrParameterListInfo(startingToken, sourceFile); if (!info) return undefined; var argumentIndex = info.argumentIndex, argumentCount = info.argumentCount, argumentsSpan = info.argumentsSpan; var contextualType = ts.isMethodDeclaration(parent) ? checker.getContextualTypeForObjectLiteralElement(parent) : checker.getContextualType(parent); return contextualType && { contextualType: contextualType, argumentIndex: argumentIndex, argumentCount: argumentCount, argumentsSpan: argumentsSpan }; - case 209 /* BinaryExpression */: { + case 210 /* BinaryExpression */: { var highestBinary = getHighestBinary(parent); var contextualType_1 = checker.getContextualType(highestBinary); var argumentIndex_1 = startingToken.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent) - 1; @@ -119942,7 +120537,7 @@ var ts; // | | // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 211 /* TemplateExpression */) { + if (template.kind === 212 /* TemplateExpression */) { var lastSpan = ts.last(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -120289,11 +120884,11 @@ var ts; function containsTopLevelCommonjs(sourceFile) { return sourceFile.statements.some(function (statement) { switch (statement.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return statement.declarationList.declarations.some(function (decl) { return !!decl.initializer && ts.isRequireCall(propertyAccessLeftHandSide(decl.initializer), /*checkArgumentIsStringLiteralLike*/ true); }); - case 226 /* ExpressionStatement */: { + case 227 /* ExpressionStatement */: { var expression = statement.expression; if (!ts.isBinaryExpression(expression)) return ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true); @@ -120310,12 +120905,12 @@ var ts; } function importNameForConvertToDefaultImport(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: var importClause = node.importClause, moduleSpecifier = node.moduleSpecifier; - return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 256 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) + return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 257 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : undefined; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return node.name; default: return undefined; @@ -120373,9 +120968,9 @@ var ts; // should be kept up to date with getTransformationBody in convertToAsyncFunction.ts function isFixablePromiseArgument(arg) { switch (arg.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); // falls through case 100 /* NullKeyword */: @@ -120390,7 +120985,7 @@ var ts; } function canBeConvertedToClass(node) { var _a, _b, _c, _d; - if (node.kind === 201 /* FunctionExpression */) { + if (node.kind === 202 /* FunctionExpression */) { if (ts.isVariableDeclaration(node.parent) && ((_a = node.symbol.members) === null || _a === void 0 ? void 0 : _a.size)) { return true; } @@ -120398,7 +120993,7 @@ var ts; var symbol = decl === null || decl === void 0 ? void 0 : decl.symbol; return !!(symbol && (((_b = symbol.exports) === null || _b === void 0 ? void 0 : _b.size) || ((_c = symbol.members) === null || _c === void 0 ? void 0 : _c.size))); } - if (node.kind === 244 /* FunctionDeclaration */) { + if (node.kind === 245 /* FunctionDeclaration */) { return !!((_d = node.symbol.members) === null || _d === void 0 ? void 0 : _d.size); } return false; @@ -120417,7 +121012,7 @@ var ts; } var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32 /* Class */) { - return ts.getDeclarationOfKind(symbol, 214 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 215 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; } if (flags & 384 /* Enum */) @@ -120503,11 +121098,11 @@ var ts; // If we requested completions after `x.` at the top-level, we may be at a source file location. switch (location.parent && location.parent.kind) { // If we've typed a character of the attribute name, will be 'JsxAttribute', else will be 'JsxOpeningElement'. - case 268 /* JsxOpeningElement */: - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: return location.kind === 75 /* Identifier */ ? "property" /* memberVariableElement */ : "JSX attribute" /* jsxAttribute */; - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return "JSX attribute" /* jsxAttribute */; default: return "property" /* memberVariableElement */; @@ -120551,7 +121146,7 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (location.parent && location.parent.kind === 194 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 195 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -120571,7 +121166,7 @@ var ts; } if (callExpressionLike) { signature = typeChecker.getResolvedSignature(callExpressionLike); // TODO: GH#18217 - var useConstructSignatures = callExpressionLike.kind === 197 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 102 /* SuperKeyword */); + var useConstructSignatures = callExpressionLike.kind === 198 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 102 /* SuperKeyword */); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -120627,29 +121222,29 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || // name of function declaration - (location.kind === 129 /* ConstructorKeyword */ && location.parent.kind === 162 /* Constructor */)) { // At constructor keyword of constructor declaration + (location.kind === 130 /* ConstructorKeyword */ && location.parent.kind === 163 /* Constructor */)) { // At constructor keyword of constructor declaration // get the signature from the declaration and write it var functionDeclaration_1 = location.parent; // Use function declaration to write the signatures only if the symbol corresponding to this declaration var locationIsSymbolDeclaration = symbol.declarations && ts.find(symbol.declarations, function (declaration) { - return declaration === (location.kind === 129 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); + return declaration === (location.kind === 130 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); }); if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 162 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration_1.kind === 163 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); // TODO: GH#18217 } else { signature = allSignatures[0]; } - if (functionDeclaration_1.kind === 162 /* Constructor */) { + if (functionDeclaration_1.kind === 163 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = "constructor" /* constructorImplementationElement */; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 165 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 166 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -120660,7 +121255,7 @@ var ts; } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { addAliasPrefixIfNecessary(); - if (ts.getDeclarationOfKind(symbol, 214 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 215 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -120683,7 +121278,7 @@ var ts; } if ((symbolFlags & 524288 /* TypeAlias */) && (semanticMeaning & 2 /* Type */)) { prefixNextMeaning(); - displayParts.push(ts.keywordPart(145 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(146 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); @@ -120704,9 +121299,9 @@ var ts; } if (symbolFlags & 1536 /* Module */ && !isThisExpression) { prefixNextMeaning(); - var declaration = ts.getDeclarationOfKind(symbol, 249 /* ModuleDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 250 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 75 /* Identifier */; - displayParts.push(ts.keywordPart(isNamespace ? 136 /* NamespaceKeyword */ : 135 /* ModuleKeyword */)); + displayParts.push(ts.keywordPart(isNamespace ? 137 /* NamespaceKeyword */ : 136 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -120725,7 +121320,7 @@ var ts; } else { // Method/function type parameter - var decl = ts.getDeclarationOfKind(symbol, 155 /* TypeParameter */); + var decl = ts.getDeclarationOfKind(symbol, 156 /* TypeParameter */); if (decl === undefined) return ts.Debug.fail(); var declaration = decl.parent; @@ -120733,21 +121328,21 @@ var ts; if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); // TODO: GH#18217 - if (declaration.kind === 166 /* ConstructSignature */) { + if (declaration.kind === 167 /* ConstructSignature */) { displayParts.push(ts.keywordPart(99 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 165 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 166 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } - else if (declaration.kind === 247 /* TypeAliasDeclaration */) { + else if (declaration.kind === 248 /* TypeAliasDeclaration */) { // Type alias type parameter // For example // type list = T[]; // Both T will go through same code path addInPrefix(); - displayParts.push(ts.keywordPart(145 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(146 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -120759,7 +121354,7 @@ var ts; symbolKind = "enum member" /* enumMemberElement */; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 284 /* EnumMember */) { + if (declaration.kind === 285 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -120789,17 +121384,17 @@ var ts; } } switch (symbol.declarations[0].kind) { - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(136 /* NamespaceKeyword */)); + displayParts.push(ts.keywordPart(137 /* NamespaceKeyword */)); break; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 62 /* EqualsToken */ : 84 /* DefaultKeyword */)); break; - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); break; default: @@ -120808,13 +121403,13 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 253 /* ImportEqualsDeclaration */) { + if (declaration.kind === 254 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(62 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(139 /* RequireKeyword */)); + displayParts.push(ts.keywordPart(140 /* RequireKeyword */)); displayParts.push(ts.punctuationPart(20 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(21 /* CloseParenToken */)); @@ -120887,10 +121482,10 @@ var ts; // For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo` // there documentation comments might be attached to the right hand side symbol of their declarations. // The pattern of such special property access is that the parent symbol is the symbol of the file. - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 290 /* SourceFile */; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 291 /* SourceFile */; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 209 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 210 /* BinaryExpression */) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -121008,16 +121603,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 201 /* FunctionExpression */) { + if (declaration.kind === 202 /* FunctionExpression */) { return true; } - if (declaration.kind !== 242 /* VariableDeclaration */ && declaration.kind !== 244 /* FunctionDeclaration */) { + if (declaration.kind !== 243 /* VariableDeclaration */ && declaration.kind !== 245 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { // Reached source file or module block - if (parent.kind === 290 /* SourceFile */ || parent.kind === 250 /* ModuleBlock */) { + if (parent.kind === 291 /* SourceFile */ || parent.kind === 251 /* ModuleBlock */) { return false; } } @@ -121317,10 +121912,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 273 /* JsxAttribute */: - case 268 /* JsxOpeningElement */: - case 269 /* JsxClosingElement */: - case 267 /* JsxSelfClosingElement */: + case 274 /* JsxAttribute */: + case 269 /* JsxOpeningElement */: + case 270 /* JsxClosingElement */: + case 268 /* JsxSelfClosingElement */: // May parse an identifier like `module-layout`; that will be scanned as a keyword at first, but we should parse the whole thing to get an identifier. return ts.isKeyword(node.kind) || node.kind === 75 /* Identifier */; } @@ -121512,7 +122107,7 @@ var ts; (function (formatting) { function getAllRules() { var allTokens = []; - for (var token = 0 /* FirstToken */; token <= 152 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 153 /* LastToken */; token++) { if (token !== 1 /* EndOfFileToken */) { allTokens.push(token); } @@ -121527,9 +122122,9 @@ var ts; var anyToken = { tokens: allTokens, isSpecific: false }; var anyTokenIncludingMultilineComments = tokenRangeFrom(__spreadArrays(allTokens, [3 /* MultiLineCommentTrivia */])); var anyTokenIncludingEOF = tokenRangeFrom(__spreadArrays(allTokens, [1 /* EndOfFileToken */])); - var keywords = tokenRangeFromRange(77 /* FirstKeyword */, 152 /* LastKeyword */); + var keywords = tokenRangeFromRange(77 /* FirstKeyword */, 153 /* LastKeyword */); var binaryOperators = tokenRangeFromRange(29 /* FirstBinaryOperator */, 74 /* LastBinaryOperator */); - var binaryKeywordOperators = [97 /* InKeyword */, 98 /* InstanceOfKeyword */, 152 /* OfKeyword */, 123 /* AsKeyword */, 133 /* IsKeyword */]; + var binaryKeywordOperators = [97 /* InKeyword */, 98 /* InstanceOfKeyword */, 153 /* OfKeyword */, 123 /* AsKeyword */, 134 /* IsKeyword */]; var unaryPrefixOperators = [45 /* PlusPlusToken */, 46 /* MinusMinusToken */, 54 /* TildeToken */, 53 /* ExclamationToken */]; var unaryPrefixExpressions = [ 8 /* NumericLiteral */, 9 /* BigIntLiteral */, 75 /* Identifier */, 20 /* OpenParenToken */, @@ -121603,7 +122198,7 @@ var ts; // Though, we do extra check on the context to make sure we are dealing with get/set node. Example: // get x() {} // set x(val) {} - rule("SpaceAfterGetSetInMember", [131 /* GetKeyword */, 142 /* SetKeyword */], 75 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), + rule("SpaceAfterGetSetInMember", [132 /* GetKeyword */, 143 /* SetKeyword */], 75 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), rule("NoSpaceBetweenYieldKeywordAndStar", 121 /* YieldKeyword */, 41 /* AsteriskToken */, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 16 /* DeleteSpace */), rule("SpaceBetweenYieldOrYieldStarAndOperand", [121 /* YieldKeyword */, 41 /* AsteriskToken */], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 4 /* InsertSpace */), rule("NoSpaceBetweenReturnAndSemicolon", 101 /* ReturnKeyword */, 26 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), @@ -121627,34 +122222,34 @@ var ts; rule("NoSpaceAfterEqualInJsxAttribute", 62 /* EqualsToken */, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // TypeScript-specific rules // Use of module as a function call. e.g.: import m2 = module("m2"); - rule("NoSpaceAfterModuleImport", [135 /* ModuleKeyword */, 139 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("NoSpaceAfterModuleImport", [136 /* ModuleKeyword */, 140 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // Add a space around certain TypeScript keywords rule("SpaceAfterCertainTypeScriptKeywords", [ 122 /* AbstractKeyword */, 80 /* ClassKeyword */, - 130 /* DeclareKeyword */, + 131 /* DeclareKeyword */, 84 /* DefaultKeyword */, 88 /* EnumKeyword */, 89 /* ExportKeyword */, 90 /* ExtendsKeyword */, - 131 /* GetKeyword */, + 132 /* GetKeyword */, 113 /* ImplementsKeyword */, 96 /* ImportKeyword */, 114 /* InterfaceKeyword */, - 135 /* ModuleKeyword */, - 136 /* NamespaceKeyword */, + 136 /* ModuleKeyword */, + 137 /* NamespaceKeyword */, 117 /* PrivateKeyword */, 119 /* PublicKeyword */, 118 /* ProtectedKeyword */, - 138 /* ReadonlyKeyword */, - 142 /* SetKeyword */, + 139 /* ReadonlyKeyword */, + 143 /* SetKeyword */, 120 /* StaticKeyword */, - 145 /* TypeKeyword */, - 149 /* FromKeyword */, - 134 /* KeyOfKeyword */, - 132 /* InferKeyword */, + 146 /* TypeKeyword */, + 150 /* FromKeyword */, + 135 /* KeyOfKeyword */, + 133 /* InferKeyword */, ], anyToken, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [90 /* ExtendsKeyword */, 113 /* ImplementsKeyword */, 149 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), + rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [90 /* ExtendsKeyword */, 113 /* ImplementsKeyword */, 150 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { rule("SpaceAfterModuleName", 10 /* StringLiteral */, 18 /* OpenBraceToken */, [isModuleDeclContext], 4 /* InsertSpace */), // Lambda expressions @@ -121685,8 +122280,8 @@ var ts; 119 /* PublicKeyword */, 117 /* PrivateKeyword */, 118 /* ProtectedKeyword */, - 131 /* GetKeyword */, - 142 /* SetKeyword */, + 132 /* GetKeyword */, + 143 /* SetKeyword */, 22 /* OpenBracketToken */, 41 /* AsteriskToken */, ], [isEndOfDecoratorContextOnSameLine], 4 /* InsertSpace */), @@ -121697,8 +122292,8 @@ var ts; // These rules are applied after high priority var userConfigurableRules = [ // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses - rule("SpaceAfterConstructor", 129 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("NoSpaceAfterConstructor", 129 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("SpaceAfterConstructor", 130 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), + rule("NoSpaceAfterConstructor", 130 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), rule("SpaceAfterComma", 27 /* CommaToken */, anyToken, [isOptionEnabled("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNextTokenNotCloseBracket, isNextTokenNotCloseParen], 4 /* InsertSpace */), rule("NoSpaceAfterComma", 27 /* CommaToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext], 16 /* DeleteSpace */), // Insert space after function keyword for anonymous functions @@ -121726,6 +122321,9 @@ var ts; rule("NoSpaceBetweenEmptyBraceBrackets", 18 /* OpenBraceToken */, 19 /* CloseBraceToken */, [isNonJsxSameLineTokenContext, isObjectContext], 16 /* DeleteSpace */), rule("NoSpaceAfterOpenBrace", 18 /* OpenBraceToken */, anyToken, [isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), rule("NoSpaceBeforeCloseBrace", anyToken, 19 /* CloseBraceToken */, [isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + // Insert a space after opening and before closing empty brace brackets + rule("SpaceBetweenEmptyBraceBrackets", 18 /* OpenBraceToken */, 19 /* CloseBraceToken */, [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces")], 4 /* InsertSpace */), + rule("NoSpaceBetweenEmptyBraceBrackets", 18 /* OpenBraceToken */, 19 /* CloseBraceToken */, [isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // Insert space after opening and before closing template string braces rule("SpaceAfterTemplateHeadAndMiddle", [15 /* TemplateHead */, 16 /* TemplateMiddle */], anyToken, [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), rule("SpaceBeforeTemplateMiddleAndTail", anyToken, [16 /* TemplateMiddle */, 17 /* TemplateTail */], [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), @@ -121837,51 +122435,51 @@ var ts; return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; }; } function isForContext(context) { - return context.contextNode.kind === 230 /* ForStatement */; + return context.contextNode.kind === 231 /* ForStatement */; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return context.contextNode.operatorToken.kind !== 27 /* CommaToken */; - case 210 /* ConditionalExpression */: - case 180 /* ConditionalType */: - case 217 /* AsExpression */: - case 263 /* ExportSpecifier */: - case 258 /* ImportSpecifier */: - case 168 /* TypePredicate */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: + case 211 /* ConditionalExpression */: + case 181 /* ConditionalType */: + case 218 /* AsExpression */: + case 264 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 169 /* TypePredicate */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 191 /* BindingElement */: + case 192 /* BindingElement */: // equals in type X = ... // falls through - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: // equal in import a = module('a'); // falls through - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // equal in let a = 0 // falls through - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: // equal in p = 0 // falls through - case 156 /* Parameter */: - case 284 /* EnumMember */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 157 /* Parameter */: + case 285 /* EnumMember */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: // "in" keyword in [P in keyof T]: T[P] // falls through - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return context.currentTokenSpan.kind === 97 /* InKeyword */ || context.nextTokenSpan.kind === 97 /* InKeyword */ || context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 232 /* ForOfStatement */: - return context.currentTokenSpan.kind === 152 /* OfKeyword */ || context.nextTokenSpan.kind === 152 /* OfKeyword */; + case 233 /* ForOfStatement */: + return context.currentTokenSpan.kind === 153 /* OfKeyword */ || context.nextTokenSpan.kind === 153 /* OfKeyword */; } return false; } @@ -121893,22 +122491,22 @@ var ts; } function isTypeAnnotationContext(context) { var contextKind = context.contextNode.kind; - return contextKind === 159 /* PropertyDeclaration */ || - contextKind === 158 /* PropertySignature */ || - contextKind === 156 /* Parameter */ || - contextKind === 242 /* VariableDeclaration */ || + return contextKind === 160 /* PropertyDeclaration */ || + contextKind === 159 /* PropertySignature */ || + contextKind === 157 /* Parameter */ || + contextKind === 243 /* VariableDeclaration */ || ts.isFunctionLikeKind(contextKind); } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 210 /* ConditionalExpression */ || - context.contextNode.kind === 180 /* ConditionalType */; + return context.contextNode.kind === 211 /* ConditionalExpression */ || + context.contextNode.kind === 181 /* ConditionalType */; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 189 /* ObjectBindingPattern */ || - context.contextNode.kind === 186 /* MappedType */ || + return context.contextNode.kind === 190 /* ObjectBindingPattern */ || + context.contextNode.kind === 187 /* MappedType */ || isSingleLineBlockContext(context); } // This check is done before an open brace in a control construct, a function, or a typescript block declaration @@ -121934,34 +122532,34 @@ var ts; return true; } switch (node.kind) { - case 223 /* Block */: - case 251 /* CaseBlock */: - case 193 /* ObjectLiteralExpression */: - case 250 /* ModuleBlock */: + case 224 /* Block */: + case 252 /* CaseBlock */: + case 194 /* ObjectLiteralExpression */: + case 251 /* ModuleBlock */: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: // falls through - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // case SyntaxKind.MethodSignature: // falls through - case 165 /* CallSignature */: - case 201 /* FunctionExpression */: - case 162 /* Constructor */: - case 202 /* ArrowFunction */: + case 166 /* CallSignature */: + case 202 /* FunctionExpression */: + case 163 /* Constructor */: + case 203 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: // falls through - case 246 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one + case 247 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one return true; } return false; @@ -121970,40 +122568,40 @@ var ts; return !isFunctionDeclContext(context); } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 244 /* FunctionDeclaration */ || context.contextNode.kind === 201 /* FunctionExpression */; + return context.contextNode.kind === 245 /* FunctionDeclaration */ || context.contextNode.kind === 202 /* FunctionExpression */; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 173 /* TypeLiteral */: - case 249 /* ModuleDeclaration */: - case 260 /* ExportDeclaration */: - case 261 /* NamedExports */: - case 254 /* ImportDeclaration */: - case 257 /* NamedImports */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 174 /* TypeLiteral */: + case 250 /* ModuleDeclaration */: + case 261 /* ExportDeclaration */: + case 262 /* NamedExports */: + case 255 /* ImportDeclaration */: + case 258 /* NamedImports */: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 245 /* ClassDeclaration */: - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: - case 280 /* CatchClause */: - case 250 /* ModuleBlock */: - case 237 /* SwitchStatement */: + case 246 /* ClassDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 281 /* CatchClause */: + case 251 /* ModuleBlock */: + case 238 /* SwitchStatement */: return true; - case 223 /* Block */: { + case 224 /* Block */: { var blockParent = context.currentTokenParent.parent; // In a codefix scenario, we can't rely on parents being set. So just always return true. - if (!blockParent || blockParent.kind !== 202 /* ArrowFunction */ && blockParent.kind !== 201 /* FunctionExpression */) { + if (!blockParent || blockParent.kind !== 203 /* ArrowFunction */ && blockParent.kind !== 202 /* FunctionExpression */) { return true; } } @@ -122012,32 +122610,32 @@ var ts; } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 227 /* IfStatement */: - case 237 /* SwitchStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 229 /* WhileStatement */: - case 240 /* TryStatement */: - case 228 /* DoStatement */: - case 236 /* WithStatement */: + case 228 /* IfStatement */: + case 238 /* SwitchStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 230 /* WhileStatement */: + case 241 /* TryStatement */: + case 229 /* DoStatement */: + case 237 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: // falls through - case 280 /* CatchClause */: + case 281 /* CatchClause */: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 193 /* ObjectLiteralExpression */; + return context.contextNode.kind === 194 /* ObjectLiteralExpression */; } function isFunctionCallContext(context) { - return context.contextNode.kind === 196 /* CallExpression */; + return context.contextNode.kind === 197 /* CallExpression */; } function isNewContext(context) { - return context.contextNode.kind === 197 /* NewExpression */; + return context.contextNode.kind === 198 /* NewExpression */; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -122052,28 +122650,28 @@ var ts; return context.nextTokenSpan.kind !== 21 /* CloseParenToken */; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 202 /* ArrowFunction */; + return context.contextNode.kind === 203 /* ArrowFunction */; } function isImportTypeContext(context) { - return context.contextNode.kind === 188 /* ImportType */; + return context.contextNode.kind === 189 /* ImportType */; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 11 /* JsxText */; } function isNonJsxElementOrFragmentContext(context) { - return context.contextNode.kind !== 266 /* JsxElement */ && context.contextNode.kind !== 270 /* JsxFragment */; + return context.contextNode.kind !== 267 /* JsxElement */ && context.contextNode.kind !== 271 /* JsxFragment */; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 276 /* JsxExpression */ || context.contextNode.kind === 275 /* JsxSpreadAttribute */; + return context.contextNode.kind === 277 /* JsxExpression */ || context.contextNode.kind === 276 /* JsxSpreadAttribute */; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 273 /* JsxAttribute */; + return context.nextTokenParent.kind === 274 /* JsxAttribute */; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 273 /* JsxAttribute */; + return context.contextNode.kind === 274 /* JsxAttribute */; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 267 /* JsxSelfClosingElement */; + return context.contextNode.kind === 268 /* JsxSelfClosingElement */; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -122088,45 +122686,45 @@ var ts; while (ts.isExpressionNode(node)) { node = node.parent; } - return node.kind === 157 /* Decorator */; + return node.kind === 158 /* Decorator */; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 243 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 244 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; } function isModuleDeclContext(context) { - return context.contextNode.kind === 249 /* ModuleDeclaration */; + return context.contextNode.kind === 250 /* ModuleDeclaration */; } function isObjectTypeContext(context) { - return context.contextNode.kind === 173 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 174 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 166 /* ConstructSignature */; + return context.contextNode.kind === 167 /* ConstructSignature */; } function isTypeArgumentOrParameterOrAssertion(token, parent) { if (token.kind !== 29 /* LessThanToken */ && token.kind !== 31 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 169 /* TypeReference */: - case 199 /* TypeAssertionExpression */: - case 247 /* TypeAliasDeclaration */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 216 /* ExpressionWithTypeArguments */: + case 170 /* TypeReference */: + case 200 /* TypeAssertionExpression */: + case 248 /* TypeAliasDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 217 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -122137,28 +122735,28 @@ var ts; isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 199 /* TypeAssertionExpression */; + return context.contextNode.kind === 200 /* TypeAssertionExpression */; } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 110 /* VoidKeyword */ && context.currentTokenParent.kind === 205 /* VoidExpression */; + return context.currentTokenSpan.kind === 110 /* VoidKeyword */ && context.currentTokenParent.kind === 206 /* VoidExpression */; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 212 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 213 /* YieldExpression */ && context.contextNode.expression !== undefined; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 218 /* NonNullExpression */; + return context.contextNode.kind === 219 /* NonNullExpression */; } function isNotStatementConditionContext(context) { return !isStatementConditionContext(context); } function isStatementConditionContext(context) { switch (context.contextNode.kind) { - case 227 /* IfStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 228 /* IfStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return true; default: return false; @@ -122183,12 +122781,12 @@ var ts; return nextTokenKind === 19 /* CloseBraceToken */ || nextTokenKind === 1 /* EndOfFileToken */; } - if (nextTokenKind === 222 /* SemicolonClassElement */ || + if (nextTokenKind === 223 /* SemicolonClassElement */ || nextTokenKind === 26 /* SemicolonToken */) { return false; } - if (context.contextNode.kind === 246 /* InterfaceDeclaration */ || - context.contextNode.kind === 247 /* TypeAliasDeclaration */) { + if (context.contextNode.kind === 247 /* InterfaceDeclaration */ || + context.contextNode.kind === 248 /* TypeAliasDeclaration */) { // Can’t remove semicolon after `foo`; it would parse as a method declaration: // // interface I { @@ -122202,9 +122800,9 @@ var ts; if (ts.isPropertyDeclaration(context.currentTokenParent)) { return !context.currentTokenParent.initializer; } - return context.currentTokenParent.kind !== 230 /* ForStatement */ - && context.currentTokenParent.kind !== 224 /* EmptyStatement */ - && context.currentTokenParent.kind !== 222 /* SemicolonClassElement */ + return context.currentTokenParent.kind !== 231 /* ForStatement */ + && context.currentTokenParent.kind !== 225 /* EmptyStatement */ + && context.currentTokenParent.kind !== 223 /* SemicolonClassElement */ && nextTokenKind !== 22 /* OpenBracketToken */ && nextTokenKind !== 20 /* OpenParenToken */ && nextTokenKind !== 39 /* PlusToken */ @@ -122212,7 +122810,7 @@ var ts; && nextTokenKind !== 43 /* SlashToken */ && nextTokenKind !== 13 /* RegularExpressionLiteral */ && nextTokenKind !== 27 /* CommaToken */ - && nextTokenKind !== 211 /* TemplateExpression */ + && nextTokenKind !== 212 /* TemplateExpression */ && nextTokenKind !== 15 /* TemplateHead */ && nextTokenKind !== 14 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 24 /* DotToken */; @@ -122303,12 +122901,12 @@ var ts; return map; } function getRuleBucketIndex(row, column) { - ts.Debug.assert(row <= 152 /* LastKeyword */ && column <= 152 /* LastKeyword */, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 153 /* LastKeyword */ && column <= 153 /* LastKeyword */, "Must compute formatting context from tokens"); return (row * mapRowLength) + column; } var maskBitSize = 5; var mask = 31; // MaskBitSize bits - var mapRowLength = 152 /* LastToken */ + 1; + var mapRowLength = 153 /* LastToken */ + 1; var RulesPosition; (function (RulesPosition) { RulesPosition[RulesPosition["StopRulesSpecific"] = 0] = "StopRulesSpecific"; @@ -122496,17 +123094,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: var body = parent.body; - return !!body && body.kind === 250 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); - case 290 /* SourceFile */: - case 223 /* Block */: - case 250 /* ModuleBlock */: + return !!body && body.kind === 251 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); + case 291 /* SourceFile */: + case 224 /* Block */: + case 251 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -122663,7 +123261,9 @@ var ts; var leadingTrivia = formattingScanner.getCurrentLeadingTrivia(); if (leadingTrivia) { indentTriviaItems(leadingTrivia, initialIndentation, /*indentNextTokenOrTrivia*/ false, function (item) { return processRange(item, sourceFile.getLineAndCharacterOfPosition(item.pos), enclosingNode, enclosingNode, /*dynamicIndentation*/ undefined); }); - trimTrailingWhitespacesForRemainingRange(); + if (options.trimTrailingWhitespace !== false) { + trimTrailingWhitespacesForRemainingRange(); + } } } return edits; @@ -122731,19 +123331,19 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 245 /* ClassDeclaration */: return 80 /* ClassKeyword */; - case 246 /* InterfaceDeclaration */: return 114 /* InterfaceKeyword */; - case 244 /* FunctionDeclaration */: return 94 /* FunctionKeyword */; - case 248 /* EnumDeclaration */: return 248 /* EnumDeclaration */; - case 163 /* GetAccessor */: return 131 /* GetKeyword */; - case 164 /* SetAccessor */: return 142 /* SetKeyword */; - case 161 /* MethodDeclaration */: + case 246 /* ClassDeclaration */: return 80 /* ClassKeyword */; + case 247 /* InterfaceDeclaration */: return 114 /* InterfaceKeyword */; + case 245 /* FunctionDeclaration */: return 94 /* FunctionKeyword */; + case 249 /* EnumDeclaration */: return 249 /* EnumDeclaration */; + case 164 /* GetAccessor */: return 132 /* GetKeyword */; + case 165 /* SetAccessor */: return 143 /* SetKeyword */; + case 162 /* MethodDeclaration */: if (node.asteriskToken) { return 41 /* AsteriskToken */; } // falls through - case 159 /* PropertyDeclaration */: - case 156 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 157 /* Parameter */: var name = ts.getNameOfDeclaration(node); if (name) { return name.kind; @@ -122800,15 +123400,15 @@ var ts; case 43 /* SlashToken */: case 31 /* GreaterThanToken */: switch (container.kind) { - case 268 /* JsxOpeningElement */: - case 269 /* JsxClosingElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 270 /* JsxClosingElement */: + case 268 /* JsxSelfClosingElement */: return false; } break; case 22 /* OpenBracketToken */: case 23 /* CloseBracketToken */: - if (container.kind !== 186 /* MappedType */) { + if (container.kind !== 187 /* MappedType */) { return false; } break; @@ -122911,7 +123511,7 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 157 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 158 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); if (child.kind === 11 /* JsxText */) { @@ -122931,7 +123531,7 @@ var ts; } } childContextNode = node; - if (isFirstListItem && parent.kind === 192 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent.kind === 193 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -123103,7 +123703,7 @@ var ts; function processPair(currentItem, currentStartLine, currentParent, previousItem, previousStartLine, previousParent, contextNode, dynamicIndentation) { formattingContext.updateContext(previousItem, previousParent, currentItem, currentParent, contextNode); var rules = getRules(formattingContext); - var trimTrailingWhitespaces = false; + var trimTrailingWhitespaces = formattingContext.options.trimTrailingWhitespace !== false; var lineAction = 0 /* None */; if (rules) { // Apply rules in reverse order so that higher priority rules (which are first in the array) @@ -123130,11 +123730,11 @@ var ts; ts.Debug.assert(lineAction === 0 /* None */); } // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line - trimTrailingWhitespaces = !(rule.action & 16 /* DeleteSpace */) && rule.flags !== 1 /* CanDeleteNewLines */; + trimTrailingWhitespaces = trimTrailingWhitespaces && !(rule.action & 16 /* DeleteSpace */) && rule.flags !== 1 /* CanDeleteNewLines */; }); } else { - trimTrailingWhitespaces = currentItem.kind !== 1 /* EndOfFileToken */; + trimTrailingWhitespaces = trimTrailingWhitespaces && currentItem.kind !== 1 /* EndOfFileToken */; } if (currentStartLine !== previousStartLine && trimTrailingWhitespaces) { // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line @@ -123374,12 +123974,12 @@ var ts; formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { - case 162 /* Constructor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 202 /* ArrowFunction */: + case 163 /* Constructor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 203 /* ArrowFunction */: if (node.typeParameters === list) { return 29 /* LessThanToken */; } @@ -123387,8 +123987,8 @@ var ts; return 20 /* OpenParenToken */; } break; - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } @@ -123396,12 +123996,12 @@ var ts; return 20 /* OpenParenToken */; } break; - case 169 /* TypeReference */: + case 170 /* TypeReference */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } break; - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return 18 /* OpenBraceToken */; } return 0 /* Unknown */; @@ -123519,7 +124119,7 @@ var ts; if (options.indentStyle === ts.IndentStyle.Block) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 209 /* BinaryExpression */) { + if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 210 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -123673,7 +124273,7 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 290 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 291 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -123721,7 +124321,7 @@ var ts; } SmartIndenter.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 227 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 228 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 87 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -123759,40 +124359,40 @@ var ts; } function getListByRange(start, end, node, sourceFile) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return getList(node.typeArguments); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return getList(node.properties); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return getList(node.elements); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return getList(node.members); - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 162 /* Constructor */: - case 171 /* ConstructorType */: - case 166 /* ConstructSignature */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 163 /* Constructor */: + case 172 /* ConstructorType */: + case 167 /* ConstructSignature */: return getList(node.typeParameters) || getList(node.parameters); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 321 /* JSDocTemplateTag */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 322 /* JSDocTemplateTag */: return getList(node.typeParameters); - case 197 /* NewExpression */: - case 196 /* CallExpression */: + case 198 /* NewExpression */: + case 197 /* CallExpression */: return getList(node.typeArguments) || getList(node.arguments); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return getList(node.declarations); - case 257 /* NamedImports */: - case 261 /* NamedExports */: + case 258 /* NamedImports */: + case 262 /* NamedExports */: return getList(node.elements); - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: return getList(node.elements); } function getList(list) { @@ -123815,7 +124415,7 @@ var ts; return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options); } function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) { - if (node.parent && node.parent.kind === 243 /* VariableDeclarationList */) { + if (node.parent && node.parent.kind === 244 /* VariableDeclarationList */) { // VariableDeclarationList has no wrapping tokens return -1 /* Unknown */; } @@ -123888,87 +124488,87 @@ var ts; function nodeWillIndentChild(settings, parent, child, sourceFile, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 226 /* ExpressionStatement */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 192 /* ArrayLiteralExpression */: - case 223 /* Block */: - case 250 /* ModuleBlock */: - case 193 /* ObjectLiteralExpression */: - case 173 /* TypeLiteral */: - case 186 /* MappedType */: - case 175 /* TupleType */: - case 251 /* CaseBlock */: - case 278 /* DefaultClause */: - case 277 /* CaseClause */: - case 200 /* ParenthesizedExpression */: - case 194 /* PropertyAccessExpression */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 225 /* VariableStatement */: - case 259 /* ExportAssignment */: - case 235 /* ReturnStatement */: - case 210 /* ConditionalExpression */: - case 190 /* ArrayBindingPattern */: - case 189 /* ObjectBindingPattern */: - case 268 /* JsxOpeningElement */: - case 271 /* JsxOpeningFragment */: - case 267 /* JsxSelfClosingElement */: - case 276 /* JsxExpression */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 156 /* Parameter */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 182 /* ParenthesizedType */: - case 198 /* TaggedTemplateExpression */: - case 206 /* AwaitExpression */: - case 261 /* NamedExports */: - case 257 /* NamedImports */: - case 263 /* ExportSpecifier */: - case 258 /* ImportSpecifier */: - case 159 /* PropertyDeclaration */: + case 227 /* ExpressionStatement */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 193 /* ArrayLiteralExpression */: + case 224 /* Block */: + case 251 /* ModuleBlock */: + case 194 /* ObjectLiteralExpression */: + case 174 /* TypeLiteral */: + case 187 /* MappedType */: + case 176 /* TupleType */: + case 252 /* CaseBlock */: + case 279 /* DefaultClause */: + case 278 /* CaseClause */: + case 201 /* ParenthesizedExpression */: + case 195 /* PropertyAccessExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 226 /* VariableStatement */: + case 260 /* ExportAssignment */: + case 236 /* ReturnStatement */: + case 211 /* ConditionalExpression */: + case 191 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 269 /* JsxOpeningElement */: + case 272 /* JsxOpeningFragment */: + case 268 /* JsxSelfClosingElement */: + case 277 /* JsxExpression */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 157 /* Parameter */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 183 /* ParenthesizedType */: + case 199 /* TaggedTemplateExpression */: + case 207 /* AwaitExpression */: + case 262 /* NamedExports */: + case 258 /* NamedImports */: + case 264 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 160 /* PropertyDeclaration */: return true; - case 242 /* VariableDeclaration */: - case 281 /* PropertyAssignment */: - case 209 /* BinaryExpression */: - if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 193 /* ObjectLiteralExpression */) { // TODO: GH#18217 + case 243 /* VariableDeclaration */: + case 282 /* PropertyAssignment */: + case 210 /* BinaryExpression */: + if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 194 /* ObjectLiteralExpression */) { // TODO: GH#18217 return rangeIsOnOneLine(sourceFile, child); } - if (parent.kind !== 209 /* BinaryExpression */) { + if (parent.kind !== 210 /* BinaryExpression */) { return true; } break; - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 230 /* ForStatement */: - case 227 /* IfStatement */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 202 /* ArrowFunction */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - return childKind !== 223 /* Block */; - case 260 /* ExportDeclaration */: - return childKind !== 261 /* NamedExports */; - case 254 /* ImportDeclaration */: - return childKind !== 255 /* ImportClause */ || - (!!child.namedBindings && child.namedBindings.kind !== 257 /* NamedImports */); - case 266 /* JsxElement */: - return childKind !== 269 /* JsxClosingElement */; - case 270 /* JsxFragment */: - return childKind !== 272 /* JsxClosingFragment */; - case 179 /* IntersectionType */: - case 178 /* UnionType */: - if (childKind === 173 /* TypeLiteral */) { + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 231 /* ForStatement */: + case 228 /* IfStatement */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 203 /* ArrowFunction */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + return childKind !== 224 /* Block */; + case 261 /* ExportDeclaration */: + return childKind !== 262 /* NamedExports */; + case 255 /* ImportDeclaration */: + return childKind !== 256 /* ImportClause */ || + (!!child.namedBindings && child.namedBindings.kind !== 258 /* NamedImports */); + case 267 /* JsxElement */: + return childKind !== 270 /* JsxClosingElement */; + case 271 /* JsxFragment */: + return childKind !== 273 /* JsxClosingFragment */; + case 180 /* IntersectionType */: + case 179 /* UnionType */: + if (childKind === 174 /* TypeLiteral */) { return false; } // falls through @@ -123979,11 +124579,11 @@ var ts; SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent) { switch (kind) { - case 235 /* ReturnStatement */: - case 239 /* ThrowStatement */: - case 233 /* ContinueStatement */: - case 234 /* BreakStatement */: - return parent.kind !== 223 /* Block */; + case 236 /* ReturnStatement */: + case 240 /* ThrowStatement */: + case 234 /* ContinueStatement */: + case 235 /* BreakStatement */: + return parent.kind !== 224 /* Block */; default: return false; } @@ -124125,7 +124725,7 @@ var ts; * Checks if 'candidate' argument is a legal separator in the list that contains 'node' as an element */ function isSeparator(node, candidate) { - return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 193 /* ObjectLiteralExpression */)); + return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 194 /* ObjectLiteralExpression */)); } function spaces(count) { var s = ""; @@ -124302,7 +124902,7 @@ var ts; } } else { - endNode = node.kind !== 242 /* VariableDeclaration */ && node.questionToken ? node.questionToken : node.name; + endNode = node.kind !== 243 /* VariableDeclaration */ && node.questionToken ? node.questionToken : node.name; } this.insertNodeAt(sourceFile, endNode.end, type, { prefix: ": " }); return true; @@ -124456,18 +125056,18 @@ var ts; }; ChangeTracker.prototype.getInsertNodeAfterOptionsWorker = function (node) { switch (node.kind) { - case 245 /* ClassDeclaration */: - case 249 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 250 /* ModuleDeclaration */: return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: case 10 /* StringLiteral */: case 75 /* Identifier */: return { prefix: ", " }; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return { suffix: "," + this.newLineCharacter }; case 89 /* ExportKeyword */: return { prefix: " " }; - case 156 /* Parameter */: + case 157 /* Parameter */: return {}; default: ts.Debug.assert(ts.isStatement(node) || ts.isClassOrTypeElement(node)); // Else we haven't handled this kind of node yet -- add it @@ -124476,7 +125076,7 @@ var ts; }; ChangeTracker.prototype.insertName = function (sourceFile, node, name) { ts.Debug.assert(!node.name); - if (node.kind === 202 /* ArrowFunction */) { + if (node.kind === 203 /* ArrowFunction */) { var arrow = ts.findChildOfKind(node, 38 /* EqualsGreaterThanToken */, sourceFile); var lparen = ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile); if (lparen) { @@ -124490,14 +125090,14 @@ var ts; // Replacing full range of arrow to get rid of the leading space -- replace ` =>` with `)` this.replaceRange(sourceFile, arrow, ts.createToken(21 /* CloseParenToken */)); } - if (node.body.kind !== 223 /* Block */) { + if (node.body.kind !== 224 /* Block */) { // `() => 0` => `function f() { return 0; }` this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [ts.createToken(18 /* OpenBraceToken */), ts.createToken(101 /* ReturnKeyword */)], { joiner: " ", suffix: " " }); this.insertNodesAt(sourceFile, node.body.end, [ts.createToken(26 /* SemicolonToken */), ts.createToken(19 /* CloseBraceToken */)], { joiner: " " }); } } else { - var pos = ts.findChildOfKind(node, node.kind === 201 /* FunctionExpression */ ? 94 /* FunctionKeyword */ : 80 /* ClassKeyword */, sourceFile).end; + var pos = ts.findChildOfKind(node, node.kind === 202 /* FunctionExpression */ ? 94 /* FunctionKeyword */ : 80 /* ClassKeyword */, sourceFile).end; this.insertNodeAt(sourceFile, pos, ts.createIdentifier(name), { prefix: " " }); } }; @@ -124755,7 +125355,9 @@ var ts; : format(change.node); // strip initial indentation (spaces or tabs) if text will be inserted in the middle of the line var noIndent = (options.preserveLeadingWhitespace || options.indentation !== undefined || ts.getLineStartPositionForPosition(pos, sourceFile) === pos) ? text : text.replace(/^\s+/, ""); - return (options.prefix || "") + noIndent + (options.suffix || ""); + return (options.prefix || "") + noIndent + + ((!options.suffix || ts.endsWith(noIndent, options.suffix)) + ? "" : options.suffix); } function getFormatCodeSettingsForWriting(_a, sourceFile) { var options = _a.options; @@ -125060,14 +125662,14 @@ var ts; } textChanges_3.isValidLocationToAddComment = isValidLocationToAddComment; function needSemicolonBetween(a, b) { - return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 154 /* ComputedPropertyName */ + return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 155 /* ComputedPropertyName */ || ts.isStatementButNotDeclaration(a) && ts.isStatementButNotDeclaration(b); // TODO: only if b would start with a `(` or `[` } var deleteDeclaration; (function (deleteDeclaration_1) { function deleteDeclaration(changes, deletedNodesInLists, sourceFile, node) { switch (node.kind) { - case 156 /* Parameter */: { + case 157 /* Parameter */: { var oldFunction = node.parent; if (ts.isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && @@ -125082,15 +125684,15 @@ var ts; } break; } - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: var isFirstImport = sourceFile.imports.length && node === ts.first(sourceFile.imports).parent || node === ts.find(sourceFile.statements, ts.isImportDeclaration); deleteNode(changes, sourceFile, node, // For first import, leave header comment in place isFirstImport ? { leadingTriviaOption: LeadingTriviaOption.Exclude } : undefined); break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: var pattern = node.parent; - var preserveComma = pattern.kind === 190 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); + var preserveComma = pattern.kind === 191 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); if (preserveComma) { deleteNode(changes, sourceFile, node); } @@ -125098,13 +125700,13 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node); break; - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); break; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: var namedImports = node.parent; if (namedImports.elements.length === 1) { deleteImportBinding(changes, sourceFile, namedImports); @@ -125113,7 +125715,7 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: deleteImportBinding(changes, sourceFile, node); break; default: @@ -125160,13 +125762,13 @@ var ts; // Delete the entire import declaration // |import * as ns from './file'| // |import { a } from './file'| - var importDecl = ts.getAncestor(node, 254 /* ImportDeclaration */); + var importDecl = ts.getAncestor(node, 255 /* ImportDeclaration */); deleteNode(changes, sourceFile, importDecl); } } function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) { var parent = node.parent; - if (parent.kind === 280 /* CatchClause */) { + if (parent.kind === 281 /* CatchClause */) { // TODO: There's currently no unused diagnostic for this, could be a suggestion changes.deleteNodeRange(sourceFile, ts.findChildOfKind(parent, 20 /* OpenParenToken */, sourceFile), ts.findChildOfKind(parent, 21 /* CloseParenToken */, sourceFile)); return; @@ -125177,14 +125779,14 @@ var ts; } var gp = parent.parent; switch (gp.kind) { - case 232 /* ForOfStatement */: - case 231 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 232 /* ForInStatement */: changes.replaceNode(sourceFile, node, ts.createObjectLiteral()); break; - case 230 /* ForStatement */: + case 231 /* ForStatement */: deleteNode(changes, sourceFile, parent); break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: deleteNode(changes, sourceFile, gp); break; default: @@ -125363,8 +125965,8 @@ var ts; var token = ts.getTokenAtPosition(sourceFile, pos); var assertion = ts.Debug.checkDefined(ts.findAncestor(token, function (n) { return ts.isAsExpression(n) || ts.isTypeAssertion(n); }), "Expected to find an assertion expression"); var replacement = ts.isAsExpression(assertion) - ? ts.createAsExpression(assertion.expression, ts.createKeywordTypeNode(148 /* UnknownKeyword */)) - : ts.createTypeAssertion(ts.createKeywordTypeNode(148 /* UnknownKeyword */), assertion.expression); + ? ts.createAsExpression(assertion.expression, ts.createKeywordTypeNode(149 /* UnknownKeyword */)) + : ts.createTypeAssertion(ts.createKeywordTypeNode(149 /* UnknownKeyword */), assertion.expression); changeTracker.replaceNode(sourceFile, assertion.expression, replacement); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -125595,7 +126197,7 @@ var ts; } var declaration = ts.tryCast(symbol.valueDeclaration, ts.isVariableDeclaration); var variableName = declaration && ts.tryCast(declaration.name, ts.isIdentifier); - var variableStatement = ts.getAncestor(declaration, 225 /* VariableStatement */); + var variableStatement = ts.getAncestor(declaration, 226 /* VariableStatement */); if (!declaration || !variableStatement || declaration.type || !declaration.initializer || @@ -125673,10 +126275,10 @@ var ts; function isInsideAwaitableBody(node) { return node.kind & 32768 /* AwaitContext */ || !!ts.findAncestor(node, function (ancestor) { return ancestor.parent && ts.isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || - ts.isBlock(ancestor) && (ancestor.parent.kind === 244 /* FunctionDeclaration */ || - ancestor.parent.kind === 201 /* FunctionExpression */ || - ancestor.parent.kind === 202 /* ArrowFunction */ || - ancestor.parent.kind === 161 /* MethodDeclaration */); + ts.isBlock(ancestor) && (ancestor.parent.kind === 245 /* FunctionDeclaration */ || + ancestor.parent.kind === 202 /* FunctionExpression */ || + ancestor.parent.kind === 203 /* ArrowFunction */ || + ancestor.parent.kind === 162 /* MethodDeclaration */); }); } function makeChange(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) { @@ -125795,10 +126397,10 @@ var ts; function isPossiblyPartOfDestructuring(node) { switch (node.kind) { case 75 /* Identifier */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return true; default: return false; @@ -125813,7 +126415,7 @@ var ts; function isPossiblyPartOfCommaSeperatedInitializer(node) { switch (node.kind) { case 75 /* Identifier */: - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: case 27 /* CommaToken */: return true; default: @@ -125862,9 +126464,9 @@ var ts; return; } var declaration = token.parent; - if (declaration.kind === 159 /* PropertyDeclaration */ && + if (declaration.kind === 160 /* PropertyDeclaration */ && (!fixedNodes || fixedNodes.tryAdd(declaration))) { - changeTracker.insertModifierBefore(sourceFile, 130 /* DeclareKeyword */, declaration); + changeTracker.insertModifierBefore(sourceFile, 131 /* DeclareKeyword */, declaration); } } })(codefix = ts.codefix || (ts.codefix = {})); @@ -125999,26 +126601,26 @@ var ts; } function isDeclarationWithType(node) { return ts.isFunctionLikeDeclaration(node) || - node.kind === 242 /* VariableDeclaration */ || - node.kind === 158 /* PropertySignature */ || - node.kind === 159 /* PropertyDeclaration */; + node.kind === 243 /* VariableDeclaration */ || + node.kind === 159 /* PropertySignature */ || + node.kind === 160 /* PropertyDeclaration */; } function transformJSDocType(node) { switch (node.kind) { - case 295 /* JSDocAllType */: - case 296 /* JSDocUnknownType */: + case 296 /* JSDocAllType */: + case 297 /* JSDocUnknownType */: return ts.createTypeReferenceNode("any", ts.emptyArray); - case 299 /* JSDocOptionalType */: + case 300 /* JSDocOptionalType */: return transformJSDocOptionalType(node); - case 298 /* JSDocNonNullableType */: + case 299 /* JSDocNonNullableType */: return transformJSDocType(node.type); - case 297 /* JSDocNullableType */: + case 298 /* JSDocNullableType */: return transformJSDocNullableType(node); - case 301 /* JSDocVariadicType */: + case 302 /* JSDocVariadicType */: return transformJSDocVariadicType(node); - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: return transformJSDocFunctionType(node); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return transformJSDocTypeReference(node); default: var visited = ts.visitEachChild(node, transformJSDocType, /*context*/ undefined); // TODO: GH#18217 @@ -126040,7 +126642,7 @@ var ts; } function transformJSDocParameter(node) { var index = node.parent.parameters.indexOf(node); - var isRest = node.type.kind === 301 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 + var isRest = node.type.kind === 302 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 var name = node.name || (isRest ? "rest" : "arg" + index); var dotdotdot = isRest ? ts.createToken(25 /* DotDotDotToken */) : node.dotDotDotToken; return ts.createParameter(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer); @@ -126080,8 +126682,8 @@ var ts; var index = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, - /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 140 /* NumberKeyword */ ? "n" : "s", - /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 140 /* NumberKeyword */ ? "number" : "string", []), + /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 141 /* NumberKeyword */ ? "n" : "s", + /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 141 /* NumberKeyword */ ? "number" : "string", []), /*initializer*/ undefined); var indexSignature = ts.createTypeLiteralNode([ts.createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]); ts.setEmitFlags(indexSignature, 1 /* SingleLine */); @@ -126339,7 +126941,7 @@ var ts; function annotate(changes, importAdder, sourceFile, declaration, type, program, host) { var typeNode = ts.getTypeNodeIfAccessible(type, declaration, program, host); if (typeNode) { - if (ts.isInJSFile(sourceFile) && declaration.kind !== 158 /* PropertySignature */) { + if (ts.isInJSFile(sourceFile) && declaration.kind !== 159 /* PropertySignature */) { var parent = ts.isVariableDeclaration(declaration) ? ts.tryCast(declaration.parent.parent, ts.isVariableStatement) : declaration; if (!parent) { return; @@ -126388,13 +126990,13 @@ var ts; return !!merged; }); }); var tag = ts.createJSDocComment(comments.join("\n"), ts.createNodeArray(__spreadArrays((oldTags || ts.emptyArray), unmergedNewTags))); - var jsDocNode = parent.kind === 202 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; + var jsDocNode = parent.kind === 203 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; jsDocNode.jsDoc = parent.jsDoc; jsDocNode.jsDocCache = parent.jsDocCache; changes.insertJsdocCommentBefore(sourceFile, jsDocNode, tag); } function getJsDocNodeForArrowFunction(signature) { - if (signature.parent.kind === 159 /* PropertyDeclaration */) { + if (signature.parent.kind === 160 /* PropertyDeclaration */) { return signature.parent; } return signature.parent.parent; @@ -126404,14 +127006,14 @@ var ts; return undefined; } switch (oldTag.kind) { - case 317 /* JSDocParameterTag */: { + case 318 /* JSDocParameterTag */: { var oldParam = oldTag; var newParam = newTag; return ts.isIdentifier(oldParam.name) && ts.isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? ts.createJSDocParamTag(newParam.name, newParam.isBracketed, newParam.typeExpression, oldParam.comment) : undefined; } - case 318 /* JSDocReturnTag */: + case 319 /* JSDocReturnTag */: return ts.createJSDocReturnTag(newTag.typeExpression, oldTag.comment); } } @@ -126436,18 +127038,18 @@ var ts; function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) { var searchToken; switch (containingFunction.kind) { - case 162 /* Constructor */: - searchToken = ts.findChildOfKind(containingFunction, 129 /* ConstructorKeyword */, sourceFile); + case 163 /* Constructor */: + searchToken = ts.findChildOfKind(containingFunction, 130 /* ConstructorKeyword */, sourceFile); break; - case 202 /* ArrowFunction */: - case 201 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 202 /* FunctionExpression */: var parent = containingFunction.parent; searchToken = ts.isVariableDeclaration(parent) && ts.isIdentifier(parent.name) ? parent.name : containingFunction.name; break; - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: searchToken = containingFunction.name; break; } @@ -126589,24 +127191,24 @@ var ts; node = node.parent; } switch (node.parent.kind) { - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: addCandidateType(usage, checker.getVoidType()); break; - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: usage.isNumber = true; break; - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: inferTypeFromPrefixUnaryExpression(node.parent, usage); break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: inferTypeFromBinaryExpression(node, node.parent, usage); break; - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: inferTypeFromSwitchStatementLabel(node.parent, usage); break; - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: if (node.parent.expression === node) { inferTypeFromCallExpression(node.parent, usage); } @@ -126614,20 +127216,20 @@ var ts; inferTypeFromContextualType(node, usage); } break; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: inferTypeFromPropertyAccessExpression(node.parent, usage); break; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: inferTypeFromPropertyElementExpression(node.parent, node, usage); break; - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: inferTypeFromPropertyAssignment(node.parent, usage); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: inferTypeFromPropertyDeclaration(node.parent, usage); break; - case 242 /* VariableDeclaration */: { + case 243 /* VariableDeclaration */: { var _a = node.parent, name = _a.name, initializer = _a.initializer; if (node === name) { if (initializer) { // This can happen for `let x = null;` which still has an implicit-any error. @@ -126746,7 +127348,7 @@ var ts; case 56 /* BarBarToken */: case 60 /* QuestionQuestionToken */: if (node === parent.left && - (node.parent.parent.kind === 242 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { + (node.parent.parent.kind === 243 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { // var x = x || {}; // TODO: use getFalsyflagsOfType addCandidateType(usage, checker.getTypeAtLocation(parent.right)); @@ -126774,7 +127376,7 @@ var ts; } } calculateUsageOfNode(parent, call.return_); - if (parent.kind === 196 /* CallExpression */) { + if (parent.kind === 197 /* CallExpression */) { (usage.calls || (usage.calls = [])).push(call); } else { @@ -126990,6 +127592,9 @@ var ts; else if (genericType.flags & 3145728 /* UnionOrIntersection */) { return ts.flatMap(genericType.types, function (t) { return inferTypeParameters(t, usageType, typeParameter); }); } + else if (genericType.flags & 134217728 /* Awaited */) { + return inferTypeParameters(genericType.awaitedType, usageType, typeParameter); + } else if (ts.getObjectFlags(genericType) & 4 /* Reference */ && ts.getObjectFlags(usageType) & 4 /* Reference */) { // this is wrong because we need a reference to the targetType to, so we can check that it's also a reference var genericArgs = checker.getTypeArguments(genericType); @@ -127093,12 +127698,12 @@ var ts; var precedingNode; var newClassDeclaration; switch (ctorDeclaration.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: precedingNode = ctorDeclaration; changes.delete(sourceFile, ctorDeclaration); newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: precedingNode = ctorDeclaration.parent.parent; newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration); if (ctorDeclaration.parent.declarations.length === 1) { @@ -127153,7 +127758,7 @@ var ts; return; } // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 226 /* ExpressionStatement */ + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 227 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; changes.delete(sourceFile, nodeToDelete); if (!assignmentBinaryExpression.right) { @@ -127161,7 +127766,7 @@ var ts; /*type*/ undefined, /*initializer*/ undefined); } switch (assignmentBinaryExpression.right.kind) { - case 201 /* FunctionExpression */: { + case 202 /* FunctionExpression */: { var functionExpression = assignmentBinaryExpression.right; var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(functionExpression, 126 /* AsyncKeyword */)); var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, @@ -127169,12 +127774,12 @@ var ts; ts.copyLeadingComments(assignmentBinaryExpression, method, sourceFile); return method; } - case 202 /* ArrowFunction */: { + case 203 /* ArrowFunction */: { var arrowFunction = assignmentBinaryExpression.right; var arrowFunctionBody = arrowFunction.body; var bodyBlock = void 0; // case 1: () => { return [1,2,3] } - if (arrowFunctionBody.kind === 223 /* Block */) { + if (arrowFunctionBody.kind === 224 /* Block */) { bodyBlock = arrowFunctionBody; } // case 2: () => [1,2,3] @@ -127202,7 +127807,7 @@ var ts; } function createClassFromVariableDeclaration(node) { var initializer = node.initializer; - if (!initializer || initializer.kind !== 201 /* FunctionExpression */) { + if (!initializer || initializer.kind !== 202 /* FunctionExpression */) { return undefined; } if (node.name.kind !== 75 /* Identifier */) { @@ -127274,27 +127879,21 @@ var ts; return; } var synthNamesMap = ts.createMap(); - var originalTypeMap = ts.createMap(); - var allVarNames = []; var isInJavascript = ts.isInJSFile(functionToConvert); var setOfExpressionsToReturn = getAllPromiseExpressionsToReturn(functionToConvert, checker); - var functionToConvertRenamed = renameCollidingVarNames(functionToConvert, checker, synthNamesMap, context, setOfExpressionsToReturn, originalTypeMap, allVarNames); - var constIdentifiers = getConstIdentifiers(synthNamesMap); + var functionToConvertRenamed = renameCollidingVarNames(functionToConvert, checker, synthNamesMap, context.sourceFile); var returnStatements = functionToConvertRenamed.body && ts.isBlock(functionToConvertRenamed.body) ? getReturnStatementsWithPromiseHandlers(functionToConvertRenamed.body) : ts.emptyArray; - var transformer = { checker: checker, synthNamesMap: synthNamesMap, allVarNames: allVarNames, setOfExpressionsToReturn: setOfExpressionsToReturn, constIdentifiers: constIdentifiers, originalTypeMap: originalTypeMap, isInJSFile: isInJavascript }; + var transformer = { checker: checker, synthNamesMap: synthNamesMap, setOfExpressionsToReturn: setOfExpressionsToReturn, isInJSFile: isInJavascript }; if (!returnStatements.length) { return; } // add the async keyword changes.insertLastModifierBefore(sourceFile, 126 /* AsyncKeyword */, functionToConvert); - function startTransformation(node, nodeToReplace) { - var newNodes = transformExpression(node, transformer, node); - changes.replaceNodeWithNodes(sourceFile, nodeToReplace, newNodes); - } - var _loop_13 = function (statement) { - ts.forEachChild(statement, function visit(node) { + var _loop_13 = function (returnStatement) { + ts.forEachChild(returnStatement, function visit(node) { if (ts.isCallExpression(node)) { - startTransformation(node, statement); + var newNodes = transformExpression(node, transformer); + changes.replaceNodeWithNodes(sourceFile, returnStatement, newNodes); } else if (!ts.isFunctionLike(node)) { ts.forEachChild(node, visit); @@ -127302,8 +127901,8 @@ var ts; }); }; for (var _i = 0, returnStatements_1 = returnStatements; _i < returnStatements_1.length; _i++) { - var statement = returnStatements_1[_i]; - _loop_13(statement); + var returnStatement = returnStatements_1[_i]; + _loop_13(returnStatement); } } function getReturnStatementsWithPromiseHandlers(body) { @@ -127314,16 +127913,6 @@ var ts; }); return res; } - // Returns the identifiers that are never reassigned in the refactor - function getConstIdentifiers(synthNamesMap) { - var constIdentifiers = []; - synthNamesMap.forEach(function (val) { - if (val.numberOfAssignmentsOriginal === 0) { - constIdentifiers.push(val.identifier); - } - }); - return constIdentifiers; - } /* Finds all of the expressions of promise type that should not be saved in a variable during the refactor */ @@ -127333,16 +127922,16 @@ var ts; } var setOfExpressionsToReturn = ts.createMap(); ts.forEachChild(func.body, function visit(node) { - if (isPromiseReturningExpression(node, checker, "then")) { + if (isPromiseReturningCallExpression(node, checker, "then")) { setOfExpressionsToReturn.set(ts.getNodeId(node).toString(), true); ts.forEach(node.arguments, visit); } - else if (isPromiseReturningExpression(node, checker, "catch")) { + else if (isPromiseReturningCallExpression(node, checker, "catch")) { setOfExpressionsToReturn.set(ts.getNodeId(node).toString(), true); // if .catch() is the last call in the chain, move leftward in the chain until we hit something else that should be returned ts.forEachChild(node, visit); } - else if (isPromiseReturningExpression(node, checker)) { + else if (isPromiseTypedExpression(node, checker)) { setOfExpressionsToReturn.set(ts.getNodeId(node).toString(), true); // don't recurse here, since we won't refactor any children or arguments of the expression } @@ -127352,16 +127941,22 @@ var ts; }); return setOfExpressionsToReturn; } - /* - Returns true if node is a promise returning expression - If name is not undefined, node is a promise returning call of name - */ - function isPromiseReturningExpression(node, checker, name) { - var isNodeExpression = name ? ts.isCallExpression(node) : ts.isExpression(node); - var isExpressionOfName = isNodeExpression && (!name || ts.hasPropertyAccessExpressionWithName(node, name)); + function isPromiseReturningCallExpression(node, checker, name) { + if (!ts.isCallExpression(node)) + return false; + var isExpressionOfName = ts.hasPropertyAccessExpressionWithName(node, name); var nodeType = isExpressionOfName && checker.getTypeAtLocation(node); return !!(nodeType && checker.getPromisedTypeOfPromise(nodeType)); } + function isParameterOfPromiseCallback(node, checker) { + return ts.isParameter(node) && (isPromiseReturningCallExpression(node.parent.parent, checker, "then") || + isPromiseReturningCallExpression(node.parent.parent, checker, "catch")); + } + function isPromiseTypedExpression(node, checker) { + if (!ts.isExpression(node)) + return false; + return !!checker.getPromisedTypeOfPromise(checker.getTypeAtLocation(node)); + } function declaredInFile(symbol, sourceFile) { return symbol.valueDeclaration && symbol.valueDeclaration.getSourceFile() === sourceFile; } @@ -127370,31 +127965,36 @@ var ts; This function collects all existing identifier names and names of identifiers that will be created in the refactor. It then checks for any collisions and renames them through getSynthesizedDeepClone */ - function renameCollidingVarNames(nodeToRename, checker, synthNamesMap, context, setOfAllExpressionsToReturn, originalType, allVarNames) { + function renameCollidingVarNames(nodeToRename, checker, synthNamesMap, sourceFile) { + var variableNames = []; var identsToRenameMap = ts.createMap(); // key is the symbol id - var collidingSymbolMap = ts.createMap(); + var collidingSymbolMap = ts.createMultiMap(); ts.forEachChild(nodeToRename, function visit(node) { if (!ts.isIdentifier(node)) { ts.forEachChild(node, visit); return; } var symbol = checker.getSymbolAtLocation(node); - var isDefinedInFile = symbol && declaredInFile(symbol, context.sourceFile); + var isDefinedInFile = symbol && declaredInFile(symbol, sourceFile); if (symbol && isDefinedInFile) { var type = checker.getTypeAtLocation(node); + // Note - the choice of the last call signature is arbitrary var lastCallSignature = getLastCallSignature(type, checker); var symbolIdString = ts.getSymbolId(symbol).toString(); - // if the identifier refers to a function we want to add the new synthesized variable for the declaration (ex. blob in let blob = res(arg)) - // Note - the choice of the last call signature is arbitrary + // If the identifier refers to a function, we want to add the new synthesized variable for the declaration. Example: + // fetch('...').then(response => { ... }) + // will eventually become + // const response = await fetch('...') + // so we push an entry for 'response'. if (lastCallSignature && !ts.isFunctionLikeDeclaration(node.parent) && !synthNamesMap.has(symbolIdString)) { var firstParameter = ts.firstOrUndefined(lastCallSignature.parameters); var ident = firstParameter && ts.isParameter(firstParameter.valueDeclaration) && ts.tryCast(firstParameter.valueDeclaration.name, ts.isIdentifier) || ts.createOptimisticUniqueName("result"); var synthName = getNewNameIfConflict(ident, collidingSymbolMap); synthNamesMap.set(symbolIdString, synthName); - allVarNames.push({ identifier: synthName.identifier, symbol: symbol }); - addNameToFrequencyMap(collidingSymbolMap, ident.text, symbol); + variableNames.push({ identifier: synthName.identifier, symbol: symbol }); + collidingSymbolMap.add(ident.text, symbol); } - // we only care about identifiers that are parameters, declarations, or binding elements (don't care about other uses) + // We only care about identifiers that are parameters, variable declarations, or binding elements else if (node.parent && (ts.isParameter(node.parent) || ts.isVariableDeclaration(node.parent) || ts.isBindingElement(node.parent))) { var originalName = node.text; var collidingSymbols = collidingSymbolMap.get(originalName); @@ -127403,96 +128003,65 @@ var ts; var newName = getNewNameIfConflict(node, collidingSymbolMap); identsToRenameMap.set(symbolIdString, newName.identifier); synthNamesMap.set(symbolIdString, newName); - allVarNames.push({ identifier: newName.identifier, symbol: symbol }); - addNameToFrequencyMap(collidingSymbolMap, originalName, symbol); + variableNames.push({ identifier: newName.identifier, symbol: symbol }); + collidingSymbolMap.add(originalName, symbol); } else { var identifier = ts.getSynthesizedDeepClone(node); identsToRenameMap.set(symbolIdString, identifier); - synthNamesMap.set(symbolIdString, createSynthIdentifier(identifier, [], allVarNames.filter(function (elem) { return elem.identifier.text === node.text; }).length /*, numberOfAssignmentsSynthesized: 0*/)); - if ((ts.isParameter(node.parent) && isExpressionOrCallOnTypePromise(node.parent.parent)) || ts.isVariableDeclaration(node.parent)) { - allVarNames.push({ identifier: identifier, symbol: symbol }); - addNameToFrequencyMap(collidingSymbolMap, originalName, symbol); + synthNamesMap.set(symbolIdString, createSynthIdentifier(identifier)); + if (isParameterOfPromiseCallback(node.parent, checker) || ts.isVariableDeclaration(node.parent)) { + variableNames.push({ identifier: identifier, symbol: symbol }); + collidingSymbolMap.add(originalName, symbol); } } } } }); - return ts.getSynthesizedDeepCloneWithRenames(nodeToRename, /*includeTrivia*/ true, identsToRenameMap, checker, deepCloneCallback); - function isExpressionOrCallOnTypePromise(child) { - var node = child.parent; - if (ts.isCallExpression(node) || ts.isIdentifier(node) && !setOfAllExpressionsToReturn.get(ts.getNodeId(node).toString())) { - var nodeType = checker.getTypeAtLocation(node); - var isPromise = nodeType && checker.getPromisedTypeOfPromise(nodeType); - return !!isPromise; - } - return false; - } - function deepCloneCallback(node, clone) { - if (ts.isIdentifier(node)) { - var symbol = checker.getSymbolAtLocation(node); - var symboldIdString = symbol && ts.getSymbolId(symbol).toString(); - var renameInfo = symbol && synthNamesMap.get(symboldIdString); - if (renameInfo) { - var type = checker.getTypeAtLocation(node); - originalType.set(ts.getNodeId(clone).toString(), type); - } - } - var val = setOfAllExpressionsToReturn.get(ts.getNodeId(node).toString()); - if (val !== undefined) { - setOfAllExpressionsToReturn.delete(ts.getNodeId(node).toString()); - setOfAllExpressionsToReturn.set(ts.getNodeId(clone).toString(), val); - } - } - } - function addNameToFrequencyMap(renamedVarNameFrequencyMap, originalName, symbol) { - if (renamedVarNameFrequencyMap.has(originalName)) { - renamedVarNameFrequencyMap.get(originalName).push(symbol); - } - else { - renamedVarNameFrequencyMap.set(originalName, [symbol]); - } + return ts.getSynthesizedDeepCloneWithRenames(nodeToRename, /*includeTrivia*/ true, identsToRenameMap, checker); } function getNewNameIfConflict(name, originalNames) { var numVarsSameName = (originalNames.get(name.text) || ts.emptyArray).length; - var numberOfAssignmentsOriginal = 0; var identifier = numVarsSameName === 0 ? name : ts.createIdentifier(name.text + "_" + numVarsSameName); - return createSynthIdentifier(identifier, [], numberOfAssignmentsOriginal); + return createSynthIdentifier(identifier); + } + function silentFail() { + codeActionSucceeded = false; + return ts.emptyArray; } // dispatch function to recursively build the refactoring // should be kept up to date with isFixablePromiseHandler in suggestionDiagnostics.ts - function transformExpression(node, transformer, outermostParent, prevArgName) { - if (!node) { - return ts.emptyArray; - } - var originalType = ts.isIdentifier(node) && transformer.originalTypeMap.get(ts.getNodeId(node).toString()); - var nodeType = originalType || transformer.checker.getTypeAtLocation(node); - if (ts.isCallExpression(node) && ts.hasPropertyAccessExpressionWithName(node, "then") && nodeType && !!transformer.checker.getPromisedTypeOfPromise(nodeType)) { - return transformThen(node, transformer, outermostParent, prevArgName); - } - else if (ts.isCallExpression(node) && ts.hasPropertyAccessExpressionWithName(node, "catch") && nodeType && !!transformer.checker.getPromisedTypeOfPromise(nodeType)) { + function transformExpression(node, transformer, prevArgName) { + if (isPromiseReturningCallExpression(node, transformer.checker, "then")) { + if (node.arguments.length === 0) + return silentFail(); + return transformThen(node, transformer, prevArgName); + } + if (isPromiseReturningCallExpression(node, transformer.checker, "catch")) { + if (node.arguments.length === 0) + return silentFail(); return transformCatch(node, transformer, prevArgName); } - else if (ts.isPropertyAccessExpression(node)) { - return transformExpression(node.expression, transformer, outermostParent, prevArgName); + if (ts.isPropertyAccessExpression(node)) { + return transformExpression(node.expression, transformer, prevArgName); } - else if (nodeType && transformer.checker.getPromisedTypeOfPromise(nodeType)) { - return transformPromiseCall(node, transformer, prevArgName); + var nodeType = transformer.checker.getTypeAtLocation(node); + if (nodeType && transformer.checker.getPromisedTypeOfPromise(nodeType)) { + ts.Debug.assertNode(node.original.parent, ts.isPropertyAccessExpression); + return transformPromiseExpressionOfPropertyAccess(node, transformer, prevArgName); } - codeActionSucceeded = false; - return ts.emptyArray; + return silentFail(); } function transformCatch(node, transformer, prevArgName) { var func = node.arguments[0]; var argName = getArgBindingName(func, transformer); - var shouldReturn = transformer.setOfExpressionsToReturn.get(ts.getNodeId(node).toString()); var possibleNameForVarDecl; /* If there is another call in the chain after the .catch() we are transforming, we will need to save the result of both paths (try block and catch block) To do this, we will need to synthesize a variable that we were not aware of while we were adding identifiers to the synthNamesMap We will use the prevArgName and then update the synthNamesMap with a new variable name for the next transformation step */ - if (prevArgName && !shouldReturn) { + if (prevArgName && !shouldReturn(node, transformer)) { if (isSynthIdentifier(prevArgName)) { possibleNameForVarDecl = prevArgName; transformer.synthNamesMap.forEach(function (val, key) { @@ -127505,13 +128074,12 @@ var ts; else { possibleNameForVarDecl = createSynthIdentifier(ts.createOptimisticUniqueName("result"), prevArgName.types); } - possibleNameForVarDecl.numberOfAssignmentsOriginal = 2; // Try block and catch block - // update the constIdentifiers list - if (transformer.constIdentifiers.some(function (elem) { return elem.text === possibleNameForVarDecl.identifier.text; })) { - transformer.constIdentifiers.push(createUniqueSynthName(possibleNameForVarDecl).identifier); - } + // We are about to write a 'let' variable declaration, but `transformExpression` for both + // the try block and catch block will assign to this name. Setting this flag indicates + // that future assignments should be written as `name = value` instead of `const name = value`. + possibleNameForVarDecl.hasBeenDeclared = true; } - var tryBlock = ts.createBlock(transformExpression(node.expression, transformer, node, possibleNameForVarDecl)); + var tryBlock = ts.createBlock(transformExpression(node.expression, transformer, possibleNameForVarDecl)); var transformationBody = getTransformationBody(func, possibleNameForVarDecl, argName, node, transformer); var catchArg = argName ? isSynthIdentifier(argName) ? argName.identifier.text : argName.bindingPattern : "e"; var catchVariableDeclaration = ts.createVariableDeclaration(catchArg); @@ -127521,7 +128089,7 @@ var ts; */ var varDeclList; var varDeclIdentifier; - if (possibleNameForVarDecl && !shouldReturn) { + if (possibleNameForVarDecl && !shouldReturn(node, transformer)) { varDeclIdentifier = ts.getSynthesizedDeepClone(possibleNameForVarDecl.identifier); var typeArray = possibleNameForVarDecl.types; var unionType = transformer.checker.getUnionType(typeArray, 2 /* Subtype */); @@ -127534,68 +128102,53 @@ var ts; && ts.createVariableStatement(/* modifiers */ undefined, ts.createVariableDeclarationList([ts.createVariableDeclaration(ts.getSynthesizedDeepCloneWithRenames(prevArgName.bindingPattern), /* type */ undefined, varDeclIdentifier)], 2 /* Const */)); return ts.compact([varDeclList, tryStatement, destructuredResult]); } - function getIdentifierTextsFromBindingName(bindingName) { - if (ts.isIdentifier(bindingName)) - return [bindingName.text]; - return ts.flatMap(bindingName.elements, function (element) { - if (ts.isOmittedExpression(element)) - return []; - return getIdentifierTextsFromBindingName(element.name); - }); - } function createUniqueSynthName(prevArgName) { var renamedPrevArg = ts.createOptimisticUniqueName(prevArgName.identifier.text); return createSynthIdentifier(renamedPrevArg); } - function transformThen(node, transformer, outermostParent, prevArgName) { - var _a = node.arguments, res = _a[0], rej = _a[1]; - if (!res) { - return transformExpression(node.expression, transformer, outermostParent); - } - var argNameRes = getArgBindingName(res, transformer); - var transformationBody = getTransformationBody(res, prevArgName, argNameRes, node, transformer); - if (rej) { - var argNameRej = getArgBindingName(rej, transformer); - var tryBlock = ts.createBlock(transformExpression(node.expression, transformer, node, argNameRes).concat(transformationBody)); - var transformationBody2 = getTransformationBody(rej, prevArgName, argNameRej, node, transformer); - var catchArg = argNameRej ? isSynthIdentifier(argNameRej) ? argNameRej.identifier.text : argNameRej.bindingPattern : "e"; + function transformThen(node, transformer, prevArgName) { + var _a = node.arguments, onFulfilled = _a[0], onRejected = _a[1]; + var onFulfilledArgumentName = getArgBindingName(onFulfilled, transformer); + var transformationBody = getTransformationBody(onFulfilled, prevArgName, onFulfilledArgumentName, node, transformer); + if (onRejected) { + var onRejectedArgumentName = getArgBindingName(onRejected, transformer); + var tryBlock = ts.createBlock(transformExpression(node.expression, transformer, onFulfilledArgumentName).concat(transformationBody)); + var transformationBody2 = getTransformationBody(onRejected, prevArgName, onRejectedArgumentName, node, transformer); + var catchArg = onRejectedArgumentName ? isSynthIdentifier(onRejectedArgumentName) ? onRejectedArgumentName.identifier.text : onRejectedArgumentName.bindingPattern : "e"; var catchVariableDeclaration = ts.createVariableDeclaration(catchArg); var catchClause = ts.createCatchClause(catchVariableDeclaration, ts.createBlock(transformationBody2)); return [ts.createTry(tryBlock, catchClause, /* finallyBlock */ undefined)]; } - return transformExpression(node.expression, transformer, node, argNameRes).concat(transformationBody); - } - function getFlagOfBindingName(bindingName, constIdentifiers) { - var identifiers = getIdentifierTextsFromBindingName(getNode(bindingName)); - var inArr = constIdentifiers.some(function (elem) { return ts.contains(identifiers, elem.text); }); - return inArr ? 2 /* Const */ : 1 /* Let */; + return transformExpression(node.expression, transformer, onFulfilledArgumentName).concat(transformationBody); } - function transformPromiseCall(node, transformer, prevArgName) { - var shouldReturn = transformer.setOfExpressionsToReturn.get(ts.getNodeId(node).toString()); - // the identifier is empty when the handler (.then()) ignores the argument - In this situation we do not need to save the result of the promise returning call - var originalNodeParent = node.original ? node.original.parent : node.parent; - if (prevArgName && !shouldReturn && (!originalNodeParent || ts.isPropertyAccessExpression(originalNodeParent))) { - return createTransformedStatement(prevArgName, ts.createAwait(node), transformer); - } - else if (!prevArgName && !shouldReturn && (!originalNodeParent || ts.isPropertyAccessExpression(originalNodeParent))) { - return [ts.createStatement(ts.createAwait(node))]; + /** + * Transforms the 'x' part of `x.then(...)`, or the 'y()' part of `y.catch(...)`, where 'x' and 'y()' are Promises. + */ + function transformPromiseExpressionOfPropertyAccess(node, transformer, prevArgName) { + if (shouldReturn(node, transformer)) { + return [ts.createReturn(ts.getSynthesizedDeepClone(node))]; } - return [ts.createReturn(ts.getSynthesizedDeepClone(node))]; + return createVariableOrAssignmentOrExpressionStatement(prevArgName, ts.createAwait(node)); } - function createTransformedStatement(prevArgName, rightHandSide, transformer) { - if (!prevArgName || isEmpty(prevArgName)) { + function createVariableOrAssignmentOrExpressionStatement(variableName, rightHandSide) { + if (!variableName || isEmptyBindingName(variableName)) { // if there's no argName to assign to, there still might be side effects - return [ts.createStatement(rightHandSide)]; + return [ts.createExpressionStatement(rightHandSide)]; } - if (isSynthIdentifier(prevArgName) && prevArgName.types.length < prevArgName.numberOfAssignmentsOriginal) { + if (isSynthIdentifier(variableName) && variableName.hasBeenDeclared) { // if the variable has already been declared, we don't need "let" or "const" - return [ts.createStatement(ts.createAssignment(ts.getSynthesizedDeepClone(prevArgName.identifier), rightHandSide))]; + return [ts.createExpressionStatement(ts.createAssignment(ts.getSynthesizedDeepClone(variableName.identifier), rightHandSide))]; } - return [ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(ts.getSynthesizedDeepClone(getNode(prevArgName)), /*type*/ undefined, rightHandSide)], getFlagOfBindingName(prevArgName, transformer.constIdentifiers))))]; + return [ + ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration(ts.getSynthesizedDeepClone(getNode(variableName)), + /*type*/ undefined, rightHandSide) + ], 2 /* Const */)) + ]; } // should be kept up to date with isFixablePromiseArgument in suggestionDiagnostics.ts function getTransformationBody(func, prevArgName, argName, parent, transformer) { - var shouldReturn = transformer.setOfExpressionsToReturn.get(ts.getNodeId(parent).toString()); switch (func.kind) { case 100 /* NullKeyword */: // do not produce a transformed statement for a null argument @@ -127606,24 +128159,23 @@ var ts; break; } var synthCall = ts.createCall(ts.getSynthesizedDeepClone(func), /*typeArguments*/ undefined, isSynthIdentifier(argName) ? [argName.identifier] : []); - if (shouldReturn) { + if (shouldReturn(parent, transformer)) { return [ts.createReturn(synthCall)]; } - var type = transformer.originalTypeMap.get(ts.getNodeId(func).toString()) || transformer.checker.getTypeAtLocation(func); + var type = transformer.checker.getTypeAtLocation(func); var callSignatures = transformer.checker.getSignaturesOfType(type, 0 /* Call */); if (!callSignatures.length) { // if identifier in handler has no call signatures, it's invalid - codeActionSucceeded = false; - break; + return silentFail(); } var returnType = callSignatures[0].getReturnType(); - var varDeclOrAssignment = createTransformedStatement(prevArgName, ts.createAwait(synthCall), transformer); + var varDeclOrAssignment = createVariableOrAssignmentOrExpressionStatement(prevArgName, ts.createAwait(synthCall)); if (prevArgName) { prevArgName.types.push(returnType); } return varDeclOrAssignment; - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: { + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: { var funcBody = func.body; // Arrow functions with block bodies { } will enter this control flow if (ts.isBlock(funcBody)) { @@ -127641,8 +128193,9 @@ var ts; refactoredStmts.push(statement); } } - return shouldReturn ? refactoredStmts.map(function (s) { return ts.getSynthesizedDeepClone(s); }) : - removeReturns(refactoredStmts, prevArgName, transformer, seenReturnStatement); + return shouldReturn(parent, transformer) + ? refactoredStmts.map(function (s) { return ts.getSynthesizedDeepClone(s); }) + : removeReturns(refactoredStmts, prevArgName, transformer, seenReturnStatement); } else { var innerRetStmts = ts.isFixablePromiseHandler(funcBody) ? [ts.createReturn(funcBody)] : ts.emptyArray; @@ -127654,8 +128207,8 @@ var ts; var returnType_1 = getLastCallSignature(type_1, transformer.checker).getReturnType(); var rightHandSide = ts.getSynthesizedDeepClone(funcBody); var possiblyAwaitedRightHandSide = !!transformer.checker.getPromisedTypeOfPromise(returnType_1) ? ts.createAwait(rightHandSide) : rightHandSide; - if (!shouldReturn) { - var transformedStatement = createTransformedStatement(prevArgName, possiblyAwaitedRightHandSide, transformer); + if (!shouldReturn(parent, transformer)) { + var transformedStatement = createVariableOrAssignmentOrExpressionStatement(prevArgName, possiblyAwaitedRightHandSide); if (prevArgName) { prevArgName.types.push(returnType_1); } @@ -127668,8 +128221,7 @@ var ts; } default: // If no cases apply, we've found a transformation body we don't know how to handle, so the refactoring should no-op to avoid deleting code. - codeActionSucceeded = false; - break; + return silentFail(); } return ts.emptyArray; } @@ -127683,12 +128235,12 @@ var ts; var stmt = stmts_1[_i]; if (ts.isReturnStatement(stmt)) { if (stmt.expression) { - var possiblyAwaitedExpression = isPromiseReturningExpression(stmt.expression, transformer.checker) ? ts.createAwait(stmt.expression) : stmt.expression; + var possiblyAwaitedExpression = isPromiseTypedExpression(stmt.expression, transformer.checker) ? ts.createAwait(stmt.expression) : stmt.expression; if (prevArgName === undefined) { ret.push(ts.createExpressionStatement(possiblyAwaitedExpression)); } else { - ret.push(ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(getNode(prevArgName), /*type*/ undefined, possiblyAwaitedExpression)], getFlagOfBindingName(prevArgName, transformer.constIdentifiers))))); + ret.push(ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(getNode(prevArgName), /*type*/ undefined, possiblyAwaitedExpression)], 2 /* Const */)))); } } } @@ -127698,7 +128250,7 @@ var ts; } // if block has no return statement, need to define prevArgName as undefined to prevent undeclared variables if (!seenReturnStatement && prevArgName !== undefined) { - ret.push(ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(getNode(prevArgName), /*type*/ undefined, ts.createIdentifier("undefined"))], getFlagOfBindingName(prevArgName, transformer.constIdentifiers))))); + ret.push(ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(getNode(prevArgName), /*type*/ undefined, ts.createIdentifier("undefined"))], 2 /* Const */)))); } return ret; } @@ -127708,7 +128260,7 @@ var ts; var stmt = innerRetStmts_1[_i]; ts.forEachChild(stmt, function visit(node) { if (ts.isCallExpression(node)) { - var temp = transformExpression(node, transformer, node, prevArgName); + var temp = transformExpression(node, transformer, prevArgName); innerCbBody = innerCbBody.concat(temp); if (innerCbBody.length > 0) { return; @@ -127722,7 +128274,6 @@ var ts; return innerCbBody; } function getArgBindingName(funcNode, transformer) { - var numberOfAssignmentsOriginal = 0; var types = []; var name; if (ts.isFunctionLikeDeclaration(funcNode)) { @@ -127754,10 +128305,10 @@ var ts; var originalNode = getOriginalNode(identifier); var symbol = getSymbol(originalNode); if (!symbol) { - return createSynthIdentifier(identifier, types, numberOfAssignmentsOriginal); + return createSynthIdentifier(identifier, types); } var mapEntry = transformer.synthNamesMap.get(ts.getSymbolId(symbol).toString()); - return mapEntry || createSynthIdentifier(identifier, types, numberOfAssignmentsOriginal); + return mapEntry || createSynthIdentifier(identifier, types); } function getSymbol(node) { return node.symbol ? node.symbol : transformer.checker.getSymbolAtLocation(node); @@ -127766,22 +128317,21 @@ var ts; return node.original ? node.original : node; } } - function isEmpty(bindingName) { + function isEmptyBindingName(bindingName) { if (!bindingName) { return true; } if (isSynthIdentifier(bindingName)) { return !bindingName.identifier.text; } - return ts.every(bindingName.elements, isEmpty); + return ts.every(bindingName.elements, isEmptyBindingName); } function getNode(bindingName) { return isSynthIdentifier(bindingName) ? bindingName.identifier : bindingName.bindingPattern; } - function createSynthIdentifier(identifier, types, numberOfAssignmentsOriginal) { + function createSynthIdentifier(identifier, types) { if (types === void 0) { types = []; } - if (numberOfAssignmentsOriginal === void 0) { numberOfAssignmentsOriginal = 0; } - return { kind: 0 /* Identifier */, identifier: identifier, types: types, numberOfAssignmentsOriginal: numberOfAssignmentsOriginal }; + return { kind: 0 /* Identifier */, identifier: identifier, types: types, hasBeenDeclared: false }; } function createSynthBindingPattern(bindingPattern, elements, types) { if (elements === void 0) { elements = ts.emptyArray; } @@ -127794,6 +128344,9 @@ var ts; function isSynthBindingPattern(bindingName) { return bindingName.kind === 1 /* BindingPattern */; } + function shouldReturn(expression, transformer) { + return !!expression.original && transformer.setOfExpressionsToReturn.has(ts.getNodeId(expression.original).toString()); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -127827,10 +128380,10 @@ var ts; } var importNode = ts.importFromModuleSpecifier(moduleSpecifier); switch (importNode.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: changes.replaceNode(importingFile, importNode, ts.makeImport(importNode.name, /*namedImports*/ undefined, moduleSpecifier, quotePreference)); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (ts.isRequireCall(importNode, /*checkArgumentIsStringLiteralLike*/ false)) { changes.replaceNode(importingFile, importNode, ts.createPropertyAccess(ts.getSynthesizedDeepClone(importNode), "default")); } @@ -127883,20 +128436,20 @@ var ts; } function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, quotePreference) { switch (statement.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); return false; - case 226 /* ExpressionStatement */: { + case 227 /* ExpressionStatement */: { var expression = statement.expression; switch (expression.kind) { - case 196 /* CallExpression */: { + case 197 /* CallExpression */: { if (ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true)) { // For side-effecting require() call, just make a side-effecting import. changes.replaceNode(sourceFile, statement, ts.makeImport(/*name*/ undefined, /*namedImports*/ undefined, expression.arguments[0], quotePreference)); } return false; } - case 209 /* BinaryExpression */: { + case 210 /* BinaryExpression */: { var operatorToken = expression.operatorToken; return operatorToken.kind === 62 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports); } @@ -127938,8 +128491,8 @@ var ts; /** Converts `const name = require("moduleSpecifier").propertyName` */ function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, quotePreference) { switch (name.kind) { - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: { + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: { // `const [a, b] = require("c").d` --> `import { d } from "c"; const [a, b] = d;` var tmp = makeUniqueName(propertyName, identifiers); return [ @@ -127990,16 +128543,16 @@ var ts; function tryChangeModuleExportsObject(object) { var statements = ts.mapAllOrFail(object.properties, function (prop) { switch (prop.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. // falls through - case 282 /* ShorthandPropertyAssignment */: - case 283 /* SpreadAssignment */: + case 283 /* ShorthandPropertyAssignment */: + case 284 /* SpreadAssignment */: return undefined; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.createToken(89 /* ExportKeyword */)], prop); default: ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind " + prop.kind); @@ -128063,7 +128616,7 @@ var ts; function convertExportsDotXEquals_replaceNode(name, exported) { var modifiers = [ts.createToken(89 /* ExportKeyword */)]; switch (exported.kind) { - case 201 /* FunctionExpression */: { + case 202 /* FunctionExpression */: { var expressionName = exported.name; if (expressionName && expressionName.text !== name) { // `exports.f = function g() {}` -> `export const f = function g() {}` @@ -128071,10 +128624,10 @@ var ts; } } // falls through - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: // `exports.f = function() {}` --> `export function f() {}` return functionExpressionToDeclaration(name, modifiers, exported); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: // `exports.C = class {}` --> `export class C {}` return classExpressionToDeclaration(name, modifiers, exported); default: @@ -128092,7 +128645,7 @@ var ts; */ function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target, quotePreference) { switch (name.kind) { - case 189 /* ObjectBindingPattern */: { + case 190 /* ObjectBindingPattern */: { var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) { return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name) ? undefined @@ -128105,7 +128658,7 @@ var ts; } } // falls through -- object destructuring has an interesting pattern and must be a variable declaration - case 190 /* ArrayBindingPattern */: { + case 191 /* ArrayBindingPattern */: { /* import x from "x"; const [a, b, c] = x; @@ -128188,11 +128741,11 @@ var ts; function isFreeIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return parent.name !== node; - case 191 /* BindingElement */: + case 192 /* BindingElement */: return parent.propertyName !== node; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return parent.propertyName !== node; default: return true; @@ -128650,11 +129203,11 @@ var ts; function getTargetModuleFromNamespaceLikeImport(declaration, checker) { var _a; switch (declaration.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return checker.resolveExternalModuleName(declaration.initializer.arguments[0]); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return checker.getAliasedSymbol(declaration.symbol); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: var namespaceImport = ts.tryCast((_a = declaration.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings, ts.isNamespaceImport); return namespaceImport && checker.getAliasedSymbol(namespaceImport.symbol); default: @@ -128664,11 +129217,11 @@ var ts; function getNamespaceLikeImportText(declaration) { var _a, _b, _c; switch (declaration.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return (_a = ts.tryCast(declaration.name, ts.isIdentifier)) === null || _a === void 0 ? void 0 : _a.text; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return declaration.name.text; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return (_c = ts.tryCast((_b = declaration.importClause) === null || _b === void 0 ? void 0 : _b.namedBindings, ts.isNamespaceImport)) === null || _c === void 0 ? void 0 : _c.name.text; default: return ts.Debug.assertNever(declaration); @@ -128677,10 +129230,10 @@ var ts; function tryAddToExistingImport(existingImports, canUseTypeOnlyImport) { return ts.firstDefined(existingImports, function (_a) { var declaration = _a.declaration, importKind = _a.importKind; - if (declaration.kind === 253 /* ImportEqualsDeclaration */) + if (declaration.kind === 254 /* ImportEqualsDeclaration */) return undefined; - if (declaration.kind === 242 /* VariableDeclaration */) { - return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 189 /* ObjectBindingPattern */ + if (declaration.kind === 243 /* VariableDeclaration */) { + return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 190 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind: importKind, moduleSpecifier: declaration.initializer.arguments[0].text, canUseTypeOnlyImport: false } : undefined; } @@ -128688,7 +129241,7 @@ var ts; if (!importClause) return undefined; var name = importClause.name, namedBindings = importClause.namedBindings; - return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 257 /* NamedImports */) + return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 258 /* NamedImports */) ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: importClause, importKind: importKind, moduleSpecifier: declaration.moduleSpecifier.getText(), canUseTypeOnlyImport: canUseTypeOnlyImport } : undefined; }); @@ -128701,7 +129254,7 @@ var ts; if (ts.isRequireVariableDeclaration(i.parent, /*requireStringLiteralLikeArgument*/ true)) { return checker.resolveExternalModuleName(moduleSpecifier) === moduleSymbol ? { declaration: i.parent, importKind: importKind } : undefined; } - if (i.kind === 254 /* ImportDeclaration */ || i.kind === 253 /* ImportEqualsDeclaration */) { + if (i.kind === 255 /* ImportDeclaration */ || i.kind === 254 /* ImportEqualsDeclaration */) { return checker.getSymbolAtLocation(moduleSpecifier) === moduleSymbol ? { declaration: i, importKind: importKind } : undefined; } }); @@ -128744,9 +129297,9 @@ var ts; } function newImportInfoFromExistingSpecifier(_a, preferTypeOnlyImport, useRequire) { var declaration = _a.declaration, importKind = _a.importKind; - var moduleSpecifier = declaration.kind === 254 /* ImportDeclaration */ ? declaration.moduleSpecifier : - declaration.kind === 242 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : - declaration.moduleReference.kind === 265 /* ExternalModuleReference */ ? declaration.moduleReference.expression : + var moduleSpecifier = declaration.kind === 255 /* ImportDeclaration */ ? declaration.moduleSpecifier : + declaration.kind === 243 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : + declaration.moduleReference.kind === 266 /* ExternalModuleReference */ ? declaration.moduleReference.expression : undefined; return moduleSpecifier && ts.isStringLiteral(moduleSpecifier) ? { kind: 3 /* AddNew */, moduleSpecifier: moduleSpecifier.text, importKind: importKind, typeOnly: preferTypeOnlyImport, useRequire: useRequire } @@ -128957,7 +129510,7 @@ var ts; } } function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, canUseTypeOnlyImport) { - if (clause.kind === 189 /* ObjectBindingPattern */) { + if (clause.kind === 190 /* ObjectBindingPattern */) { if (defaultImport) { addElementToBindingPattern(clause, defaultImport, "default"); } @@ -129067,9 +129620,9 @@ var ts; } function forEachExternalModuleToImportFrom(program, host, from, filterByPackageJson, cb) { var filteredCount = 0; - var packageJson = filterByPackageJson && createAutoImportFilter(from, program, host); + var moduleSpecifierResolutionHost = createModuleSpecifierResolutionHost(program, host); + var packageJson = filterByPackageJson && createAutoImportFilter(from, program, host, moduleSpecifierResolutionHost); var allSourceFiles = program.getSourceFiles(); - var globalTypingsCache = host.getGlobalTypingsCacheLocation && host.getGlobalTypingsCacheLocation(); forEachExternalModule(program.getTypeChecker(), allSourceFiles, function (module, sourceFile) { if (sourceFile === undefined) { if (!packageJson || packageJson.allowsImportingAmbientModule(module, allSourceFiles)) { @@ -129081,7 +129634,7 @@ var ts; } else if (sourceFile && sourceFile !== from && - isImportablePath(from.fileName, sourceFile.fileName, ts.hostGetCanonicalFileName(host), globalTypingsCache)) { + isImportableFile(program, from, sourceFile, moduleSpecifierResolutionHost)) { if (!packageJson || packageJson.allowsImportingSourceFile(sourceFile, allSourceFiles)) { cb(module); } @@ -129107,6 +129660,19 @@ var ts; } } } + function isImportableFile(program, from, to, moduleSpecifierResolutionHost) { + var _a; + var getCanonicalFileName = ts.hostGetCanonicalFileName(moduleSpecifierResolutionHost); + var globalTypingsCache = (_a = moduleSpecifierResolutionHost.getGlobalTypingsCacheLocation) === null || _a === void 0 ? void 0 : _a.call(moduleSpecifierResolutionHost); + return !!ts.moduleSpecifiers.forEachFileNameOfModule(program.getSourceFiles(), from.fileName, to.fileName, ts.hostGetCanonicalFileName(moduleSpecifierResolutionHost), moduleSpecifierResolutionHost, program.redirectTargetsMap, + /*preferSymlinks*/ false, function (toPath) { + var toFile = program.getSourceFile(toPath); + // Determine to import using toPath only if toPath is what we were looking at + // or there doesnt exist the file in the program by the symlink + return (toFile === to || !toFile) && + isImportablePath(from.fileName, toPath, getCanonicalFileName, globalTypingsCache); + }); + } /** * Don't include something from a `node_modules` that isn't actually reachable by a global import. * A relative import to node_modules is usually a bad idea. @@ -129150,12 +129716,10 @@ var ts; return !ts.isStringANonContextualKeyword(res) ? res || "_" : "_" + res; } codefix.moduleSpecifierToValidIdentifier = moduleSpecifierToValidIdentifier; - function createAutoImportFilter(fromFile, program, host) { - var packageJsons = host.getPackageJsonsVisibleToFile && host.getPackageJsonsVisibleToFile(fromFile.fileName) || ts.getPackageJsonsVisibleToFile(fromFile.fileName, host); - var dependencyGroups = 1 /* Dependencies */ | 2 /* DevDependencies */ | 8 /* OptionalDependencies */; + function createModuleSpecifierResolutionHost(program, host) { // Mix in `getProbablySymlinks` from Program when host doesn't have it // in order for non-Project hosts to have a symlinks cache. - var moduleSpecifierResolutionHost = { + return { directoryExists: ts.maybeBind(host, host.directoryExists), fileExists: ts.maybeBind(host, host.fileExists), getCurrentDirectory: ts.maybeBind(host, host.getCurrentDirectory), @@ -129164,8 +129728,13 @@ var ts; getProbableSymlinks: ts.maybeBind(host, host.getProbableSymlinks) || program.getProbableSymlinks, getGlobalTypingsCacheLocation: ts.maybeBind(host, host.getGlobalTypingsCacheLocation), }; + } + function createAutoImportFilter(fromFile, program, host, moduleSpecifierResolutionHost) { + if (moduleSpecifierResolutionHost === void 0) { moduleSpecifierResolutionHost = createModuleSpecifierResolutionHost(program, host); } + var packageJsons = host.getPackageJsonsVisibleToFile && host.getPackageJsonsVisibleToFile(fromFile.fileName) || ts.getPackageJsonsVisibleToFile(fromFile.fileName, host); + var dependencyGroups = 1 /* Dependencies */ | 2 /* DevDependencies */ | 8 /* OptionalDependencies */; var usesNodeCoreModules; - return { allowsImportingAmbientModule: allowsImportingAmbientModule, allowsImportingSourceFile: allowsImportingSourceFile, allowsImportingSpecifier: allowsImportingSpecifier }; + return { allowsImportingAmbientModule: allowsImportingAmbientModule, allowsImportingSourceFile: allowsImportingSourceFile, allowsImportingSpecifier: allowsImportingSpecifier, moduleSpecifierResolutionHost: moduleSpecifierResolutionHost }; function moduleSpecifierIsCoveredByPackageJson(specifier) { var packageName = getNodeModuleRootSpecifier(specifier); for (var _i = 0, packageJsons_1 = packageJsons; _i < packageJsons_1.length; _i++) { @@ -129437,7 +130006,7 @@ var ts; } else { var typeNode = getTypeNode(program.getTypeChecker(), parentDeclaration, token); - addPropertyDeclaration(changes, declSourceFile, parentDeclaration, token.text, typeNode, makeStatic); + addPropertyDeclaration(changes, declSourceFile, parentDeclaration, token.text, typeNode, makeStatic ? 32 /* Static */ : 0); } } }; @@ -129517,7 +130086,7 @@ var ts; function addMissingMemberInJs(changeTracker, declSourceFile, classDeclaration, token, makeStatic) { var tokenName = token.text; if (makeStatic) { - if (classDeclaration.kind === 214 /* ClassExpression */) { + if (classDeclaration.kind === 215 /* ClassExpression */) { return; } var className = classDeclaration.name.getText(); @@ -129553,12 +130122,19 @@ var ts; } function getActionsForAddMissingMemberInTypeScriptFile(context, declSourceFile, classDeclaration, token, makeStatic) { var typeNode = getTypeNode(context.program.getTypeChecker(), classDeclaration, token); - var addProp = createAddPropertyDeclarationAction(context, declSourceFile, classDeclaration, makeStatic, token.text, typeNode); - return makeStatic || ts.isPrivateIdentifier(token) ? [addProp] : [addProp, createAddIndexSignatureAction(context, declSourceFile, classDeclaration, token.text, typeNode)]; + var actions = [createAddPropertyDeclarationAction(context, declSourceFile, classDeclaration, token.text, typeNode, makeStatic ? 32 /* Static */ : 0)]; + if (makeStatic || ts.isPrivateIdentifier(token)) { + return actions; + } + if (ts.startsWithUnderscore(token.text)) { + actions.unshift(createAddPropertyDeclarationAction(context, declSourceFile, classDeclaration, token.text, typeNode, 8 /* Private */)); + } + actions.push(createAddIndexSignatureAction(context, declSourceFile, classDeclaration, token.text, typeNode)); + return actions; } function getTypeNode(checker, classDeclaration, token) { var typeNode; - if (token.parent.parent.kind === 209 /* BinaryExpression */) { + if (token.parent.parent.kind === 210 /* BinaryExpression */) { var binaryExpression = token.parent.parent; var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); @@ -129570,14 +130146,17 @@ var ts; } return typeNode || ts.createKeywordTypeNode(125 /* AnyKeyword */); } - function createAddPropertyDeclarationAction(context, declSourceFile, classDeclaration, makeStatic, tokenName, typeNode) { - var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addPropertyDeclaration(t, declSourceFile, classDeclaration, tokenName, typeNode, makeStatic); }); - return codefix.createCodeFixAction(fixName, changes, [makeStatic ? ts.Diagnostics.Declare_static_property_0 : ts.Diagnostics.Declare_property_0, tokenName], fixId, ts.Diagnostics.Add_all_missing_members); + function createAddPropertyDeclarationAction(context, declSourceFile, classDeclaration, tokenName, typeNode, modifierFlags) { + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addPropertyDeclaration(t, declSourceFile, classDeclaration, tokenName, typeNode, modifierFlags); }); + if (modifierFlags & 8 /* Private */) { + return codefix.createCodeFixActionWithoutFixAll(fixName, changes, [ts.Diagnostics.Declare_private_property_0, tokenName]); + } + return codefix.createCodeFixAction(fixName, changes, [modifierFlags & 32 /* Static */ ? ts.Diagnostics.Declare_static_property_0 : ts.Diagnostics.Declare_property_0, tokenName], fixId, ts.Diagnostics.Add_all_missing_members); } - function addPropertyDeclaration(changeTracker, declSourceFile, classDeclaration, tokenName, typeNode, makeStatic) { + function addPropertyDeclaration(changeTracker, declSourceFile, classDeclaration, tokenName, typeNode, modifierFlags) { var property = ts.createProperty( /*decorators*/ undefined, - /*modifiers*/ makeStatic ? [ts.createToken(120 /* StaticKeyword */)] : undefined, tokenName, + /*modifiers*/ modifierFlags ? ts.createNodeArray(ts.createModifiersFromModifierFlags(modifierFlags)) : undefined, tokenName, /*questionToken*/ undefined, typeNode, /*initializer*/ undefined); var lastProp = getNodeToInsertPropertyAfter(classDeclaration); @@ -129601,7 +130180,7 @@ var ts; } function createAddIndexSignatureAction(context, declSourceFile, classDeclaration, tokenName, typeNode) { // Index signatures cannot have the static modifier. - var stringTypeNode = ts.createKeywordTypeNode(143 /* StringKeyword */); + var stringTypeNode = ts.createKeywordTypeNode(144 /* StringKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -129625,7 +130204,7 @@ var ts; } function addMethodDeclaration(context, changeTracker, declSourceFile, typeDecl, token, callExpression, makeStatic, inJs, preferences) { var methodDeclaration = codefix.createMethodFromCallExpression(context, callExpression, token.text, inJs, makeStatic, preferences, typeDecl); - var containingMethodDeclaration = ts.getAncestor(callExpression, 161 /* MethodDeclaration */); + var containingMethodDeclaration = ts.getAncestor(callExpression, 162 /* MethodDeclaration */); if (containingMethodDeclaration && containingMethodDeclaration.parent === typeDecl) { changeTracker.insertNodeAfter(declSourceFile, containingMethodDeclaration, methodDeclaration); } @@ -129644,7 +130223,10 @@ var ts; return !!(type && type.flags & 132 /* StringLike */); }); var enumMember = ts.createEnumMember(token, hasStringInitializer ? ts.createStringLiteral(token.text) : undefined); - changes.replaceNode(enumDeclaration.getSourceFile(), enumDeclaration, ts.updateEnumDeclaration(enumDeclaration, enumDeclaration.decorators, enumDeclaration.modifiers, enumDeclaration.name, ts.concatenate(enumDeclaration.members, ts.singleElementArray(enumMember)))); + changes.replaceNode(enumDeclaration.getSourceFile(), enumDeclaration, ts.updateEnumDeclaration(enumDeclaration, enumDeclaration.decorators, enumDeclaration.modifiers, enumDeclaration.name, ts.concatenate(enumDeclaration.members, ts.singleElementArray(enumMember))), { + leadingTriviaOption: ts.textChanges.LeadingTriviaOption.IncludeAll, + trailingTriviaOption: ts.textChanges.TrailingTriviaOption.Exclude + }); } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); @@ -129689,7 +130271,7 @@ var ts; (function (codefix) { var fixName = "fixCannotFindModule"; var fixIdInstallTypesPackage = "installTypesPackage"; - var errorCodeCannotFindModule = ts.Diagnostics.Cannot_find_module_0.code; + var errorCodeCannotFindModule = ts.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations.code; var errorCodes = [ errorCodeCannotFindModule, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code, @@ -130181,7 +130763,7 @@ var ts; return [createDeleteFix(delVar, ts.Diagnostics.Remove_variable_statement)]; } var result = []; - if (token.kind === 132 /* InferKeyword */) { + if (token.kind === 133 /* InferKeyword */) { var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return changeInferToUnknown(t, sourceFile, token); }); var name = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name.text; result.push(codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Replace_infer_0_with_unknown, name], fixIdInfer, ts.Diagnostics.Replace_all_unused_infer_with_unknown)); @@ -130213,7 +130795,7 @@ var ts; tryPrefixDeclaration(changes, diag.code, sourceFile, token); break; case fixIdDelete: { - if (token.kind === 132 /* InferKeyword */) + if (token.kind === 133 /* InferKeyword */) break; // Can't delete var importDecl = tryGetFullImport(token); if (importDecl) { @@ -130232,7 +130814,7 @@ var ts; break; } case fixIdInfer: - if (token.kind === 132 /* InferKeyword */) { + if (token.kind === 133 /* InferKeyword */) { changeInferToUnknown(changes, sourceFile, token); } break; @@ -130243,7 +130825,7 @@ var ts; }, }); function changeInferToUnknown(changes, sourceFile, token) { - changes.replaceNode(sourceFile, token.parent, ts.createKeywordTypeNode(148 /* UnknownKeyword */)); + changes.replaceNode(sourceFile, token.parent, ts.createKeywordTypeNode(149 /* UnknownKeyword */)); } function createDeleteFix(changes, diag) { return codefix.createCodeFixAction(fixName, changes, diag, fixIdDelete, ts.Diagnostics.Delete_all_unused_declarations); @@ -130259,7 +130841,7 @@ var ts; if (token.kind !== 18 /* OpenBraceToken */ || !ts.isObjectBindingPattern(token.parent)) return false; var decl = token.parent.parent; - if (decl.kind === 156 /* Parameter */) { + if (decl.kind === 157 /* Parameter */) { tryDeleteParameter(changes, sourceFile, decl, checker, sourceFiles, isFixAll); } else { @@ -130270,7 +130852,7 @@ var ts; function tryDeleteFullVariableStatement(sourceFile, token, changes) { var declarationList = ts.tryCast(token.parent, ts.isVariableDeclarationList); if (declarationList && declarationList.getChildren(sourceFile)[0] === token) { - changes.delete(sourceFile, declarationList.parent.kind === 225 /* VariableStatement */ ? declarationList.parent : declarationList); + changes.delete(sourceFile, declarationList.parent.kind === 226 /* VariableStatement */ ? declarationList.parent : declarationList); return true; } return false; @@ -130279,7 +130861,7 @@ var ts; // Don't offer to prefix a property. if (errorCode === ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code) return; - if (token.kind === 132 /* InferKeyword */) { + if (token.kind === 133 /* InferKeyword */) { token = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name; } if (ts.isIdentifier(token) && canPrefix(token)) { @@ -130288,14 +130870,14 @@ var ts; } function canPrefix(token) { switch (token.parent.kind) { - case 156 /* Parameter */: - case 155 /* TypeParameter */: + case 157 /* Parameter */: + case 156 /* TypeParameter */: return true; - case 242 /* VariableDeclaration */: { + case 243 /* VariableDeclaration */: { var varDecl = token.parent; switch (varDecl.parent.parent.kind) { - case 232 /* ForOfStatement */: - case 231 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 232 /* ForInStatement */: return true; } } @@ -130342,17 +130924,17 @@ var ts; function mayDeleteParameter(p, checker, isFixAll) { var parent = p.parent; switch (parent.kind) { - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: // Don't remove a parameter if this overrides something. var symbol = checker.getSymbolAtLocation(parent.name); if (ts.isMemberSymbolInBaseType(symbol, checker)) return false; // falls through - case 162 /* Constructor */: - case 244 /* FunctionDeclaration */: + case 163 /* Constructor */: + case 245 /* FunctionDeclaration */: return true; - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: { + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: { // Can't remove a non-last parameter in a callback. Can remove a parameter in code-fix-all if future parameters are also unused. var parameters = parent.parameters; var index = parameters.indexOf(p); @@ -130361,7 +130943,7 @@ var ts; ? parameters.slice(index + 1).every(function (p) { return p.name.kind === 75 /* Identifier */ && !p.symbol.isReferenced; }) : index === parameters.length - 1; } - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: // Setter must have a parameter return false; default: @@ -130410,7 +130992,7 @@ var ts; var container = (ts.isBlock(statement.parent) ? statement.parent : statement).parent; if (!ts.isBlock(statement.parent) || statement === ts.first(statement.parent.statements)) { switch (container.kind) { - case 227 /* IfStatement */: + case 228 /* IfStatement */: if (container.elseStatement) { if (ts.isBlock(statement.parent)) { break; @@ -130421,8 +131003,8 @@ var ts; return; } // falls through - case 229 /* WhileStatement */: - case 230 /* ForStatement */: + case 230 /* WhileStatement */: + case 231 /* ForStatement */: changes.delete(sourceFile, container); return; } @@ -130495,7 +131077,7 @@ var ts; var typeNode = info.typeNode, type = info.type; var original = typeNode.getText(sourceFile); var actions = [fix(type, fixIdPlain, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)]; - if (typeNode.kind === 297 /* JSDocNullableType */) { + if (typeNode.kind === 298 /* JSDocNullableType */) { // for nullable types, suggest the flow-compatible `T | null | undefined` // in addition to the jsdoc/closure-compatible `T | null` actions.push(fix(checker.getNullableType(type, 32768 /* Undefined */), fixIdNullable, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)); @@ -130515,7 +131097,7 @@ var ts; if (!info) return; var typeNode = info.typeNode, type = info.type; - var fixedType = typeNode.kind === 297 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; + var fixedType = typeNode.kind === 298 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; doChange(changes, sourceFile, typeNode, fixedType, checker); }); } @@ -130532,22 +131114,22 @@ var ts; // NOTE: Some locations are not handled yet: // MappedTypeNode.typeParameters and SignatureDeclaration.typeParameters, as well as CallExpression.typeArguments switch (node.kind) { - case 217 /* AsExpression */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 244 /* FunctionDeclaration */: - case 163 /* GetAccessor */: - case 167 /* IndexSignature */: - case 186 /* MappedType */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 156 /* Parameter */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 164 /* SetAccessor */: - case 247 /* TypeAliasDeclaration */: - case 199 /* TypeAssertionExpression */: - case 242 /* VariableDeclaration */: + case 218 /* AsExpression */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 245 /* FunctionDeclaration */: + case 164 /* GetAccessor */: + case 168 /* IndexSignature */: + case 187 /* MappedType */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 157 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 165 /* SetAccessor */: + case 248 /* TypeAliasDeclaration */: + case 200 /* TypeAssertionExpression */: + case 243 /* VariableDeclaration */: return true; default: return false; @@ -130557,6 +131139,51 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "fixMissingCallParentheses"; + var errorCodes = [ + ts.Diagnostics.This_condition_will_always_return_true_since_the_function_is_always_defined_Did_you_mean_to_call_it_instead.code, + ]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + fixIds: [fixId], + getCodeActions: function (context) { + var sourceFile = context.sourceFile, span = context.span; + var callName = getCallName(sourceFile, span.start); + if (!callName) + return; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, callName); }); + return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_missing_call_parentheses, fixId, ts.Diagnostics.Add_all_missing_call_parentheses)]; + }, + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var callName = getCallName(diag.file, diag.start); + if (callName) + doChange(changes, diag.file, callName); + }); } + }); + function doChange(changes, sourceFile, name) { + changes.replaceNodeWithText(sourceFile, name, name.text + "()"); + } + function getCallName(sourceFile, start) { + var token = ts.getTokenAtPosition(sourceFile, start); + if (ts.isPropertyAccessExpression(token.parent)) { + var current = token.parent; + while (ts.isPropertyAccessExpression(current.parent)) { + current = current.parent; + } + return current.name; + } + if (ts.isIdentifier(token)) { + return token; + } + return undefined; + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var codefix; (function (codefix) { @@ -130604,14 +131231,14 @@ var ts; } var insertBefore; switch (containingFunction.kind) { - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: insertBefore = containingFunction.name; break; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: insertBefore = ts.findChildOfKind(containingFunction, 94 /* FunctionKeyword */, sourceFile); break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: insertBefore = ts.findChildOfKind(containingFunction, 20 /* OpenParenToken */, sourceFile) || ts.first(containingFunction.parameters); break; default: @@ -130742,8 +131369,8 @@ var ts; var optional = !!(symbol.flags & 16777216 /* Optional */); var ambient = !!(enclosingDeclaration.flags & 8388608 /* Ambient */); switch (declaration.kind) { - case 158 /* PropertySignature */: - case 159 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 160 /* PropertyDeclaration */: var flags = preferences.quotePreference === "single" ? 268435456 /* UseSingleQuotesForStringLiteralType */ : undefined; var typeNode = checker.typeToTypeNode(type, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context)); if (importAdder) { @@ -130757,8 +131384,8 @@ var ts; /*decorators*/ undefined, modifiers, name, optional ? ts.createToken(57 /* QuestionToken */) : undefined, typeNode, /*initializer*/ undefined)); break; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: { + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: { var typeNode_1 = checker.typeToTypeNode(type, enclosingDeclaration, /*flags*/ undefined, getNoopSymbolTrackerWithResolver(context)); var allAccessors = ts.getAllAccessorDeclarations(declarations, declaration); var orderedAccessors = allAccessors.secondAccessor @@ -130787,8 +131414,8 @@ var ts; } break; } - case 160 /* MethodSignature */: - case 161 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 162 /* MethodDeclaration */: // The signature for the implementation appears as an entry in `signatures` iff // there is only one signature. // If there are overloads and an implementation signature, it appears as an @@ -130833,7 +131460,7 @@ var ts; var program = context.program; var checker = program.getTypeChecker(); var scriptTarget = ts.getEmitScriptTarget(program.getCompilerOptions()); - var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 161 /* MethodDeclaration */, enclosingDeclaration, 1 /* NoTruncation */ | 256 /* SuppressAnyReturnType */, getNoopSymbolTrackerWithResolver(context)); + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 162 /* MethodDeclaration */, enclosingDeclaration, 1 /* NoTruncation */ | 256 /* SuppressAnyReturnType */, getNoopSymbolTrackerWithResolver(context)); if (!signatureDeclaration) { return undefined; } @@ -131095,7 +131722,7 @@ var ts; }); function getActionsForUsageOfInvalidImport(context) { var sourceFile = context.sourceFile; - var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 196 /* CallExpression */ : 197 /* NewExpression */; + var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 197 /* CallExpression */ : 198 /* NewExpression */; var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start), function (a) { return a.kind === targetKind; }); if (!node) { return []; @@ -131214,7 +131841,7 @@ var ts; return codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Add_undefined_type_to_property_0, propertyDeclaration.name.getText()], fixIdAddUndefinedType, ts.Diagnostics.Add_undefined_type_to_all_uninitialized_properties); } function addUndefinedType(changeTracker, propertyDeclarationSourceFile, propertyDeclaration) { - var undefinedTypeNode = ts.createKeywordTypeNode(146 /* UndefinedKeyword */); + var undefinedTypeNode = ts.createKeywordTypeNode(147 /* UndefinedKeyword */); var type = propertyDeclaration.type; // TODO: GH#18217 var types = ts.isUnionTypeNode(type) ? type.types.concat(undefinedTypeNode) : [type, undefinedTypeNode]; changeTracker.replaceNode(propertyDeclarationSourceFile, type, ts.createUnionTypeNode(types)); @@ -131390,7 +132017,7 @@ var ts; function getImportTypeNode(sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos); ts.Debug.assert(token.kind === 96 /* ImportKeyword */, "This token should be an ImportKeyword"); - ts.Debug.assert(token.parent.kind === 188 /* ImportType */, "Token parent should be an ImportType"); + ts.Debug.assert(token.parent.kind === 189 /* ImportType */, "Token parent should be an ImportType"); return token.parent; } function doChange(changes, sourceFile, importType) { @@ -131442,7 +132069,7 @@ var ts; var otherMembers = members.filter(function (member) { return !ts.isIndexSignatureDeclaration(member); }); var parameter = ts.first(indexSignature.parameters); var mappedTypeParameter = ts.createTypeParameterDeclaration(ts.cast(parameter.name, ts.isIdentifier), parameter.type); - var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(138 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); + var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(139 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); var intersectionType = ts.createIntersectionTypeNode(__spreadArrays(ts.getAllSuperTypeNodes(container), [ mappedIntersectionType ], (otherMembers.length ? [ts.createTypeLiteralNode(otherMembers)] : ts.emptyArray))); @@ -131566,6 +132193,46 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "fixExpectedComma"; + var expectedErrorCode = ts.Diagnostics._0_expected.code; + var errorCodes = [expectedErrorCode]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var info = getInfo(sourceFile, context.span.start, context.errorCode); + if (!info) { + return undefined; + } + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, info); }); + return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Change_0_to_1, ";", ","], fixId, [ts.Diagnostics.Change_0_to_1, ";", ","])]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var info = getInfo(diag.file, diag.start, diag.code); + if (info) + doChange(changes, context.sourceFile, info); + }); }, + }); + function getInfo(sourceFile, pos, _) { + var node = ts.getTokenAtPosition(sourceFile, pos); + return (node.kind === 26 /* SemicolonToken */ && + node.parent && + (ts.isObjectLiteralExpression(node.parent) || + ts.isArrayLiteralExpression(node.parent))) ? { node: node } : undefined; + } + function doChange(changes, sourceFile, _a) { + var node = _a.node; + var newNode = ts.createNode(27 /* CommaToken */); + changes.replaceNode(sourceFile, node, newNode); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var refactor; (function (refactor) { @@ -131603,16 +132270,16 @@ var ts; return undefined; } switch (exportNode.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 249 /* ModuleDeclaration */: { + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 250 /* ModuleDeclaration */: { var node = exportNode; return node.name && ts.isIdentifier(node.name) ? { exportNode: node, exportName: node.name, wasDefault: wasDefault, exportingModuleSymbol: exportingModuleSymbol } : undefined; } - case 225 /* VariableStatement */: { + case 226 /* VariableStatement */: { var vs = exportNode; // Must be `export const x = something;`. if (!(vs.declarationList.flags & 2 /* Const */) || vs.declarationList.declarations.length !== 1) { @@ -131640,12 +132307,12 @@ var ts; else { var exportKeyword = ts.Debug.checkDefined(ts.findModifier(exportNode, 89 /* ExportKeyword */), "Should find an export keyword in modifier list"); switch (exportNode.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: changes.insertNodeAfter(exportingSourceFile, exportKeyword, ts.createToken(84 /* DefaultKeyword */)); break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // If 'x' isn't used in this file, `export const x = 0;` --> `export default 0;` if (!ts.FindAllReferences.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile)) { // We checked in `getInfo` that an initializer exists. @@ -131653,9 +132320,9 @@ var ts; break; } // falls through - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 249 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 250 /* ModuleDeclaration */: // `export type T = number;` -> `type T = number; export default T;` changes.deleteModifier(exportingSourceFile, exportKeyword); changes.insertNodeAfter(exportingSourceFile, exportNode, ts.createExportDefault(ts.createIdentifier(exportName.text))); @@ -131682,18 +132349,18 @@ var ts; function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) { var parent = ref.parent; switch (parent.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: // `a.default` --> `a.foo` changes.replaceNode(importingSourceFile, ref, ts.createIdentifier(exportName)); break; - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: { + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: { var spec = parent; // `default as foo` --> `foo`, `default as bar` --> `foo as bar` changes.replaceNode(importingSourceFile, spec, makeImportSpecifier(exportName, spec.name.text)); break; } - case 255 /* ImportClause */: { + case 256 /* ImportClause */: { var clause = parent; ts.Debug.assert(clause.name === ref, "Import clause name should match provided ref"); var spec = makeImportSpecifier(exportName, ref.text); @@ -131702,7 +132369,7 @@ var ts; // `import foo from "./a";` --> `import { foo } from "./a";` changes.replaceNode(importingSourceFile, ref, ts.createNamedImports([spec])); } - else if (namedBindings.kind === 256 /* NamespaceImport */) { + else if (namedBindings.kind === 257 /* NamespaceImport */) { // `import foo, * as a from "./a";` --> `import * as a from ".a/"; import { foo } from "./a";` changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) }); var quotePreference = ts.isStringLiteral(clause.parent.moduleSpecifier) ? ts.quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : 1 /* Double */; @@ -131723,11 +132390,11 @@ var ts; function changeNamedToDefaultImport(importingSourceFile, ref, changes) { var parent = ref.parent; switch (parent.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: // `a.foo` --> `a.default` changes.replaceNode(importingSourceFile, ref, ts.createIdentifier("default")); break; - case 258 /* ImportSpecifier */: { + case 259 /* ImportSpecifier */: { // `import { foo } from "./a";` --> `import foo from "./a";` // `import { foo as bar } from "./a";` --> `import bar from "./a";` var defaultImport = ts.createIdentifier(parent.name.text); @@ -131740,7 +132407,7 @@ var ts; } break; } - case 263 /* ExportSpecifier */: { + case 264 /* ExportSpecifier */: { // `export { foo } from "./a";` --> `export { default as foo } from "./a";` // `export { foo as bar } from "./a";` --> `export { default as bar } from "./a";` // `export { foo as default } from "./a";` --> `export { default } from "./a";` @@ -131773,8 +132440,8 @@ var ts; var i = getImportToConvert(context); if (!i) return ts.emptyArray; - var description = i.kind === 256 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; - var actionName = i.kind === 256 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; + var description = i.kind === 257 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; + var actionName = i.kind === 257 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; return [{ name: refactorName, description: description, actions: [{ name: actionName, description: description }] }]; }, getEditsForAction: function (context, actionName) { @@ -131796,7 +132463,7 @@ var ts; } function doChange(sourceFile, program, changes, toConvert) { var checker = program.getTypeChecker(); - if (toConvert.kind === 256 /* NamespaceImport */) { + if (toConvert.kind === 257 /* NamespaceImport */) { doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())); } else { @@ -132143,20 +132810,20 @@ var ts; function checkForStaticContext(nodeToCheck, containingClass) { var current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 159 /* PropertyDeclaration */) { + if (current.kind === 160 /* PropertyDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 156 /* Parameter */) { + else if (current.kind === 157 /* Parameter */) { var ctorOrMethod = ts.getContainingFunction(current); - if (ctorOrMethod.kind === 162 /* Constructor */) { + if (ctorOrMethod.kind === 163 /* Constructor */) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 161 /* MethodDeclaration */) { + else if (current.kind === 162 /* MethodDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } @@ -132199,7 +132866,7 @@ var ts; return true; } if (ts.isDeclaration(node)) { - var declaringNode = (node.kind === 242 /* VariableDeclaration */) ? node.parent.parent : node; + var declaringNode = (node.kind === 243 /* VariableDeclaration */) ? node.parent.parent : node; if (ts.hasModifier(declaringNode, 1 /* Export */)) { // TODO: GH#18217 Silly to use `errors ||` since it's definitely not defined (see top of `visit`) // Also, if we're only pushing one error, just use `let error: Diagnostic | undefined`! @@ -132211,13 +132878,13 @@ var ts; } // Some things can't be extracted in certain situations switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractImport)); return true; case 102 /* SuperKeyword */: // For a super *constructor call*, we have to be extracting the entire class, // but a super *method call* simply implies a 'this' reference - if (node.parent.kind === 196 /* CallExpression */) { + if (node.parent.kind === 197 /* CallExpression */) { // Super constructor call var containingClass_1 = ts.getContainingClass(node); // TODO:GH#18217 if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { @@ -132232,8 +132899,8 @@ var ts; } if (ts.isFunctionLikeDeclaration(node) || ts.isClassLike(node)) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: if (ts.isSourceFile(node.parent) && node.parent.externalModuleIndicator === undefined) { // You cannot extract global declarations (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); @@ -132245,21 +132912,21 @@ var ts; } var savedPermittedJumps = permittedJumps; switch (node.kind) { - case 227 /* IfStatement */: + case 228 /* IfStatement */: permittedJumps = 0 /* None */; break; - case 240 /* TryStatement */: + case 241 /* TryStatement */: // forbid all jumps inside try blocks permittedJumps = 0 /* None */; break; - case 223 /* Block */: - if (node.parent && node.parent.kind === 240 /* TryStatement */ && node.parent.finallyBlock === node) { + case 224 /* Block */: + if (node.parent && node.parent.kind === 241 /* TryStatement */ && node.parent.finallyBlock === node) { // allow unconditional returns from finally blocks permittedJumps = 4 /* Return */; } break; - case 278 /* DefaultClause */: - case 277 /* CaseClause */: + case 279 /* DefaultClause */: + case 278 /* CaseClause */: // allow unlabeled break inside case clauses permittedJumps |= 1 /* Break */; break; @@ -132271,19 +132938,19 @@ var ts; break; } switch (node.kind) { - case 183 /* ThisType */: + case 184 /* ThisType */: case 104 /* ThisKeyword */: rangeFacts |= RangeFacts.UsesThis; break; - case 238 /* LabeledStatement */: { + case 239 /* LabeledStatement */: { var label = node.label; (seenLabels || (seenLabels = [])).push(label.escapedText); ts.forEachChild(node, visit); seenLabels.pop(); break; } - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: { + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: { var label = node.label; if (label) { if (!ts.contains(seenLabels, label.escapedText)) { @@ -132292,20 +132959,20 @@ var ts; } } else { - if (!(permittedJumps & (node.kind === 234 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + if (!(permittedJumps & (node.kind === 235 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { // attempt to break or continue in a forbidden context (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: rangeFacts |= RangeFacts.IsAsyncFunction; break; - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: rangeFacts |= RangeFacts.IsGenerator; break; - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: if (permittedJumps & 4 /* Return */) { rangeFacts |= RangeFacts.HasReturn; } @@ -132359,7 +133026,7 @@ var ts; while (true) { current = current.parent; // A function parameter's initializer is actually in the outer scope, not the function declaration - if (current.kind === 156 /* Parameter */) { + if (current.kind === 157 /* Parameter */) { // Skip all the way to the outer scope of the function that declared this parameter current = ts.findAncestor(current, function (parent) { return ts.isFunctionLikeDeclaration(parent); }).parent; } @@ -132370,7 +133037,7 @@ var ts; // * Module/namespace or source file if (isScope(current)) { scopes.push(current); - if (current.kind === 290 /* SourceFile */) { + if (current.kind === 291 /* SourceFile */) { return scopes; } } @@ -132460,32 +133127,32 @@ var ts; } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: return "constructor"; - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: return scope.name ? "function '" + scope.name.text + "'" : "anonymous function"; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return "arrow function"; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return "method '" + scope.name.getText() + "'"; - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: return "'get " + scope.name.getText() + "'"; - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: return "'set " + scope.name.getText() + "'"; default: throw ts.Debug.assertNever(scope, "Unexpected scope kind " + scope.kind); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 245 /* ClassDeclaration */ + return scope.kind === 246 /* ClassDeclaration */ ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration" : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 250 /* ModuleBlock */ + return scope.kind === 251 /* ModuleBlock */ ? "namespace '" + scope.parent.name.getText() + "'" : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } @@ -132705,9 +133372,9 @@ var ts; while (ts.isParenthesizedTypeNode(withoutParens)) { withoutParens = withoutParens.type; } - return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 146 /* UndefinedKeyword */; }) + return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 147 /* UndefinedKeyword */; }) ? clone - : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(146 /* UndefinedKeyword */)]); + : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(147 /* UndefinedKeyword */)]); } } /** @@ -132736,7 +133403,7 @@ var ts; if (rangeFacts & RangeFacts.InStaticRegion) { modifiers.push(ts.createToken(120 /* StaticKeyword */)); } - modifiers.push(ts.createToken(138 /* ReadonlyKeyword */)); + modifiers.push(ts.createToken(139 /* ReadonlyKeyword */)); var newVariable = ts.createProperty( /*decorators*/ undefined, modifiers, localNameText, /*questionToken*/ undefined, variableType, initializer); @@ -132765,7 +133432,7 @@ var ts; var localReference = ts.createIdentifier(localNameText); changeTracker.replaceNode(context.file, node, localReference); } - else if (node.parent.kind === 226 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { + else if (node.parent.kind === 227 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { // If the parent is an expression statement and the target scope is the immediately enclosing one, // replace the statement with the declaration. var newVariableStatement = ts.createVariableStatement( @@ -132784,7 +133451,7 @@ var ts; changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false); } // Consume - if (node.parent.kind === 226 /* ExpressionStatement */) { + if (node.parent.kind === 227 /* ExpressionStatement */) { // If the parent is an expression statement, delete it. changeTracker.delete(context.file, node.parent); } @@ -132928,7 +133595,7 @@ var ts; return { body: ts.createBlock(statements, /*multiLine*/ true), returnValueProperty: undefined }; } function visitor(node) { - if (!ignoreReturns && node.kind === 235 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { + if (!ignoreReturns && node.kind === 236 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { var assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); if (node.expression) { if (!returnValueProperty) { @@ -133106,7 +133773,7 @@ var ts; var scope = scopes_1[_i]; usagesPerScope.push({ usages: ts.createMap(), typeParameterUsages: ts.createMap(), substitutions: ts.createMap() }); substitutionsPerScope.push(ts.createMap()); - functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 244 /* FunctionDeclaration */ + functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 245 /* FunctionDeclaration */ ? [ts.createDiagnosticForNode(scope, Messages.cannotExtractToOtherFunctionLike)] : []); var constantErrors = []; @@ -133422,30 +134089,30 @@ var ts; function isExtractableExpression(node) { var parent = node.parent; switch (parent.kind) { - case 284 /* EnumMember */: + case 285 /* EnumMember */: return false; } switch (node.kind) { case 10 /* StringLiteral */: - return parent.kind !== 254 /* ImportDeclaration */ && - parent.kind !== 258 /* ImportSpecifier */; - case 213 /* SpreadElement */: - case 189 /* ObjectBindingPattern */: - case 191 /* BindingElement */: + return parent.kind !== 255 /* ImportDeclaration */ && + parent.kind !== 259 /* ImportSpecifier */; + case 214 /* SpreadElement */: + case 190 /* ObjectBindingPattern */: + case 192 /* BindingElement */: return false; case 75 /* Identifier */: - return parent.kind !== 191 /* BindingElement */ && - parent.kind !== 258 /* ImportSpecifier */ && - parent.kind !== 263 /* ExportSpecifier */; + return parent.kind !== 192 /* BindingElement */ && + parent.kind !== 259 /* ImportSpecifier */ && + parent.kind !== 264 /* ExportSpecifier */; } return true; } function isBlockLike(node) { switch (node.kind) { - case 223 /* Block */: - case 290 /* SourceFile */: - case 250 /* ModuleBlock */: - case 277 /* CaseClause */: + case 224 /* Block */: + case 291 /* SourceFile */: + case 251 /* ModuleBlock */: + case 278 /* CaseClause */: return true; default: return false; @@ -133609,7 +134276,7 @@ var ts; } function doTypedefChange(changes, file, name, info) { var firstStatement = info.firstStatement, selection = info.selection, typeParameters = info.typeParameters; - var node = ts.createNode(322 /* JSDocTypedefTag */); + var node = ts.createNode(323 /* JSDocTypedefTag */); node.tagName = ts.createIdentifier("typedef"); // TODO: jsdoc factory https://github.com/Microsoft/TypeScript/pull/29539 node.fullName = ts.createIdentifier(name); node.name = node.fullName; @@ -133617,10 +134284,10 @@ var ts; var templates = []; ts.forEach(typeParameters, function (typeParameter) { var constraint = ts.getEffectiveConstraintOfTypeParameter(typeParameter); - var template = ts.createNode(321 /* JSDocTemplateTag */); + var template = ts.createNode(322 /* JSDocTemplateTag */); template.tagName = ts.createIdentifier("template"); template.constraint = constraint && ts.cast(constraint, ts.isJSDocTypeExpression); - var parameter = ts.createNode(155 /* TypeParameter */); + var parameter = ts.createNode(156 /* TypeParameter */); parameter.name = typeParameter.name; template.typeParameters = ts.createNodeArray([parameter]); templates.push(template); @@ -133714,9 +134381,6 @@ var ts; var modifiers = ts.append(!isJS ? [ts.createToken(accessModifier)] : undefined, isStatic ? ts.createToken(120 /* StaticKeyword */) : undefined); return modifiers && ts.createNodeArray(modifiers); } - function startsWithUnderscore(name) { - return name.charCodeAt(0) === 95 /* _ */; - } function getConvertibleFieldAtPosition(context) { var file = context.file, startPosition = context.startPosition, endPosition = context.endPosition; var node = ts.getTokenAtPosition(file, startPosition); @@ -133727,14 +134391,14 @@ var ts; || !isConvertibleName(declaration.name) || (ts.getModifierFlags(declaration) | meaning) !== meaning) return undefined; var name = declaration.name.text; - var startWithUnderscore = startsWithUnderscore(name); + var startWithUnderscore = ts.startsWithUnderscore(name); var fieldName = createPropertyName(startWithUnderscore ? name : ts.getUniqueName("_" + name, file), declaration.name); var accessorName = createPropertyName(startWithUnderscore ? ts.getUniqueName(name.substring(1), file) : name, declaration.name); return { isStatic: ts.hasStaticModifier(declaration), isReadonly: ts.hasReadonlyModifier(declaration), type: ts.getTypeAnnotationNode(declaration), - container: declaration.kind === 156 /* Parameter */ ? declaration.parent.parent : declaration.parent, + container: declaration.kind === 157 /* Parameter */ ? declaration.parent.parent : declaration.parent, originalName: declaration.name.text, declaration: declaration, fieldName: fieldName, @@ -133877,11 +134541,11 @@ var ts; } function isPureImport(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return true; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return !ts.hasModifier(node, 1 /* Export */); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return node.declarationList.declarations.every(function (d) { return !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ true); }); default: return false; @@ -133969,12 +134633,12 @@ var ts; } function getNamespaceLikeImport(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 256 /* NamespaceImport */ ? + case 255 /* ImportDeclaration */: + return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 257 /* NamespaceImport */ ? node.importClause.namedBindings.name : undefined; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return node.name; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ts.tryCast(node.name, ts.isIdentifier); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); @@ -134005,20 +134669,20 @@ var ts; var newNamespaceId = ts.createIdentifier(newNamespaceName); var newModuleString = ts.createLiteral(newModuleSpecifier); switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(newNamespaceId)), newModuleString); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return ts.createImportEqualsDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, newNamespaceId, ts.createExternalModuleReference(newModuleString)); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ts.createVariableDeclaration(newNamespaceId, /*type*/ undefined, createRequireCall(newModuleString)); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); } } function moduleSpecifierFromImport(i) { - return (i.kind === 254 /* ImportDeclaration */ ? i.moduleSpecifier - : i.kind === 253 /* ImportEqualsDeclaration */ ? i.moduleReference.expression + return (i.kind === 255 /* ImportDeclaration */ ? i.moduleSpecifier + : i.kind === 254 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0]); } function forEachImportInStatement(statement, cb) { @@ -134088,15 +134752,15 @@ var ts; } function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) { switch (importDecl.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused); break; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: if (isUnused(importDecl.name)) { changes.delete(sourceFile, importDecl); } break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused); break; default: @@ -134109,7 +134773,7 @@ var ts; var _a = importDecl.importClause, name = _a.name, namedBindings = _a.namedBindings; var defaultUnused = !name || isUnused(name); var namedBindingsUnused = !namedBindings || - (namedBindings.kind === 256 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); + (namedBindings.kind === 257 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); if (defaultUnused && namedBindingsUnused) { changes.delete(sourceFile, importDecl); } @@ -134121,7 +134785,7 @@ var ts; if (namedBindingsUnused) { changes.replaceNode(sourceFile, importDecl.importClause, ts.updateImportClause(importDecl.importClause, name, /*namedBindings*/ undefined, importDecl.importClause.isTypeOnly)); } - else if (namedBindings.kind === 257 /* NamedImports */) { + else if (namedBindings.kind === 258 /* NamedImports */) { for (var _i = 0, _b = namedBindings.elements; _i < _b.length; _i++) { var element = _b[_i]; if (isUnused(element.name)) @@ -134139,9 +134803,9 @@ var ts; changes.delete(sourceFile, name); } break; - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: break; - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: if (name.elements.every(function (e) { return ts.isIdentifier(e.name) && isUnused(e.name); })) { changes.delete(sourceFile, ts.isVariableDeclarationList(varDecl.parent) && varDecl.parent.declarations.length === 1 ? varDecl.parent.parent : varDecl); } @@ -134268,13 +134932,13 @@ var ts; // Below should all be utilities function isInImport(decl) { switch (decl.kind) { - case 253 /* ImportEqualsDeclaration */: - case 258 /* ImportSpecifier */: - case 255 /* ImportClause */: + case 254 /* ImportEqualsDeclaration */: + case 259 /* ImportSpecifier */: + case 256 /* ImportClause */: return true; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return isVariableDeclarationInImport(decl); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return ts.isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent); default: return false; @@ -134286,7 +134950,7 @@ var ts; } function filterImport(i, moduleSpecifier, keep) { switch (i.kind) { - case 254 /* ImportDeclaration */: { + case 255 /* ImportDeclaration */: { var clause = i.importClause; if (!clause) return undefined; @@ -134296,9 +134960,9 @@ var ts; ? ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(defaultImport, namedBindings), moduleSpecifier) : undefined; } - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return keep(i.name) ? i : undefined; - case 242 /* VariableDeclaration */: { + case 243 /* VariableDeclaration */: { var name = filterBindingName(i.name, keep); return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : undefined; } @@ -134307,7 +134971,7 @@ var ts; } } function filterNamedBindings(namedBindings, keep) { - if (namedBindings.kind === 256 /* NamespaceImport */) { + if (namedBindings.kind === 257 /* NamespaceImport */) { return keep(namedBindings.name) ? namedBindings : undefined; } else { @@ -134319,9 +134983,9 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return keep(name) ? name : undefined; - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: return name; - case 189 /* ObjectBindingPattern */: { + case 190 /* ObjectBindingPattern */: { // We can't handle nested destructurings or property names well here, so just copy them all. var newElements = name.elements.filter(function (prop) { return prop.propertyName || !ts.isIdentifier(prop.name) || keep(prop.name); }); return newElements.length ? ts.createObjectBindingPattern(newElements) : undefined; @@ -134378,13 +135042,13 @@ var ts; } function isNonVariableTopLevelDeclaration(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 254 /* ImportEqualsDeclaration */: return true; default: return false; @@ -134392,17 +135056,17 @@ var ts; } function forEachTopLevelDeclaration(statement, cb) { switch (statement.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 254 /* ImportEqualsDeclaration */: return cb(statement); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return ts.firstDefined(statement.declarationList.declarations, function (decl) { return forEachTopLevelDeclarationInBindingName(decl.name, cb); }); - case 226 /* ExpressionStatement */: { + case 227 /* ExpressionStatement */: { var expression = statement.expression; return ts.isBinaryExpression(expression) && ts.getAssignmentDeclarationKind(expression) === 1 /* ExportsProperty */ ? cb(statement) @@ -134414,8 +135078,8 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return cb(ts.cast(name.parent, function (x) { return ts.isVariableDeclaration(x) || ts.isBindingElement(x); })); - case 190 /* ArrayBindingPattern */: - case 189 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: return ts.firstDefined(name.elements, function (em) { return ts.isOmittedExpression(em) ? undefined : forEachTopLevelDeclarationInBindingName(em.name, cb); }); default: return ts.Debug.assertNever(name, "Unexpected name kind " + name.kind); @@ -134426,9 +135090,9 @@ var ts; } function getTopLevelDeclarationStatement(d) { switch (d.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return d.parent.parent; - case 191 /* BindingElement */: + case 192 /* BindingElement */: return getTopLevelDeclarationStatement(ts.cast(d.parent.parent, function (p) { return ts.isVariableDeclaration(p) || ts.isBindingElement(p); })); default: return d; @@ -134461,23 +135125,23 @@ var ts; function addEs6Export(d) { var modifiers = ts.concatenate([ts.createModifier(89 /* ExportKeyword */)], d.modifiers); switch (d.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(d, d.decorators, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return ts.updateClassDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return ts.updateVariableStatement(d, modifiers, d.declarationList); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return ts.updateModuleDeclaration(d, d.decorators, modifiers, d.name, d.body); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return ts.updateEnumDeclaration(d, d.decorators, modifiers, d.name, d.members); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.type); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(d, d.decorators, modifiers, d.name, d.moduleReference); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return ts.Debug.fail(); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(d, "Unexpected declaration kind " + d.kind); @@ -134488,18 +135152,18 @@ var ts; } function getNamesToExportInCommonJS(decl) { switch (decl.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: return [decl.name.text]; // TODO: GH#18217 - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return ts.mapDefined(decl.declarationList.declarations, function (d) { return ts.isIdentifier(d.name) ? d.name.text : undefined; }); - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 254 /* ImportEqualsDeclaration */: return ts.emptyArray; - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return ts.Debug.fail("Can't export an ExpressionStatement"); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(decl, "Unexpected decl kind " + decl.kind); @@ -134769,15 +135433,15 @@ var ts; var parent = functionReference.parent; switch (parent.kind) { // foo(...) or super(...) or new Foo(...) - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: var callOrNewExpression = ts.tryCast(parent, ts.isCallOrNewExpression); if (callOrNewExpression && callOrNewExpression.expression === functionReference) { return callOrNewExpression; } break; // x.foo(...) - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) { var callOrNewExpression_1 = ts.tryCast(propertyAccessExpression.parent, ts.isCallOrNewExpression); @@ -134787,7 +135451,7 @@ var ts; } break; // x["foo"](...) - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) { var callOrNewExpression_2 = ts.tryCast(elementAccessExpression.parent, ts.isCallOrNewExpression); @@ -134806,14 +135470,14 @@ var ts; var parent = reference.parent; switch (parent.kind) { // `C.foo` - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.expression === reference) { return propertyAccessExpression; } break; // `C["foo"]` - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.expression === reference) { return elementAccessExpression; @@ -134855,11 +135519,11 @@ var ts; if (!isValidParameterNodeArray(functionDeclaration.parameters, checker)) return false; switch (functionDeclaration.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return isSingleImplementation(functionDeclaration, checker); - case 162 /* Constructor */: + case 163 /* Constructor */: if (ts.isClassDeclaration(functionDeclaration.parent)) { return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker); } @@ -134867,8 +135531,8 @@ var ts; return isValidVariableDeclaration(functionDeclaration.parent.parent) && isSingleImplementation(functionDeclaration, checker); } - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return isValidVariableDeclaration(functionDeclaration.parent); } return false; @@ -135039,7 +135703,7 @@ var ts; } function getClassNames(constructorDeclaration) { switch (constructorDeclaration.parent.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: var classDeclaration = constructorDeclaration.parent; if (classDeclaration.name) return [classDeclaration.name]; @@ -135047,7 +135711,7 @@ var ts; // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(classDeclaration, 84 /* DefaultKeyword */), "Nameless class declaration should be a default export"); return [defaultModifier]; - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: var classExpression = constructorDeclaration.parent; var variableDeclaration = constructorDeclaration.parent.parent; var className = classExpression.name; @@ -135058,25 +135722,25 @@ var ts; } function getFunctionNames(functionDeclaration) { switch (functionDeclaration.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: if (functionDeclaration.name) return [functionDeclaration.name]; // If the function declaration doesn't have a name, it should have a default modifier. // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(functionDeclaration, 84 /* DefaultKeyword */), "Nameless function declaration should be a default export"); return [defaultModifier]; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return [functionDeclaration.name]; - case 162 /* Constructor */: - var ctrKeyword = ts.Debug.checkDefined(ts.findChildOfKind(functionDeclaration, 129 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); - if (functionDeclaration.parent.kind === 214 /* ClassExpression */) { + case 163 /* Constructor */: + var ctrKeyword = ts.Debug.checkDefined(ts.findChildOfKind(functionDeclaration, 130 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); + if (functionDeclaration.parent.kind === 215 /* ClassExpression */) { var variableDeclaration = functionDeclaration.parent.parent; return [variableDeclaration.name, ctrKeyword]; } return [ctrKeyword]; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return [functionDeclaration.parent.name]; - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: if (functionDeclaration.name) return [functionDeclaration.name, functionDeclaration.parent.name]; return [functionDeclaration.parent.name]; @@ -135327,8 +135991,8 @@ var ts; if (!children.length) { return undefined; } - var child = ts.find(children, function (kid) { return kid.kind < 294 /* FirstJSDocNode */ || kid.kind > 323 /* LastJSDocNode */; }); - return child.kind < 153 /* FirstNode */ ? + var child = ts.find(children, function (kid) { return kid.kind < 295 /* FirstJSDocNode */ || kid.kind > 324 /* LastJSDocNode */; }); + return child.kind < 154 /* FirstNode */ ? child : child.getFirstToken(sourceFile); }; @@ -135339,7 +136003,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 153 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 154 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { return ts.forEachChild(this, cbNode, cbNodeArray); @@ -135397,7 +136061,7 @@ var ts; } } function createSyntaxList(nodes, parent) { - var list = createNode(324 /* SyntaxList */, nodes.pos, nodes.end, parent); + var list = createNode(325 /* SyntaxList */, nodes.pos, nodes.end, parent); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { @@ -135711,7 +136375,7 @@ var ts; __extends(SourceFileObject, _super); function SourceFileObject(kind, pos, end) { var _this = _super.call(this, kind, pos, end) || this; - _this.kind = 290 /* SourceFile */; + _this.kind = 291 /* SourceFile */; return _this; } SourceFileObject.prototype.update = function (newText, textChangeRange) { @@ -135770,10 +136434,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -135793,31 +136457,31 @@ var ts; } ts.forEachChild(node, visit); break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 248 /* EnumDeclaration */: - case 249 /* ModuleDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 263 /* ExportSpecifier */: - case 258 /* ImportSpecifier */: - case 255 /* ImportClause */: - case 256 /* NamespaceImport */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 173 /* TypeLiteral */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: + case 250 /* ModuleDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 264 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 256 /* ImportClause */: + case 257 /* NamespaceImport */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 174 /* TypeLiteral */: addDeclaration(node); ts.forEachChild(node, visit); break; - case 156 /* Parameter */: + case 157 /* Parameter */: // Only consider parameter properties if (!ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { break; } // falls through - case 242 /* VariableDeclaration */: - case 191 /* BindingElement */: { + case 243 /* VariableDeclaration */: + case 192 /* BindingElement */: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -135828,12 +136492,12 @@ var ts; } } // falls through - case 284 /* EnumMember */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 285 /* EnumMember */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: addDeclaration(node); break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; var exportDeclaration = node; @@ -135846,7 +136510,7 @@ var ts; } } break; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -135858,7 +136522,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 256 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 257 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -135867,7 +136531,7 @@ var ts; } } break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) !== 0 /* None */) { addDeclaration(node); } @@ -136193,6 +136857,7 @@ var ts; return sourceFile; } function synchronizeHostData() { + var _a; ts.Debug.assert(!syntaxOnly); // perform fast check if host supports it if (host.getProjectVersion) { @@ -136274,12 +136939,10 @@ var ts; return host.resolveTypeReferenceDirectives.apply(host, args); }; } - if (host.setResolvedProjectReferenceCallbacks) { - compilerHost.setResolvedProjectReferenceCallbacks = function (callbacks) { return host.setResolvedProjectReferenceCallbacks(callbacks); }; - } if (host.useSourceOfProjectReferenceRedirect) { compilerHost.useSourceOfProjectReferenceRedirect = function () { return host.useSourceOfProjectReferenceRedirect(); }; } + (_a = host.setCompilerHost) === null || _a === void 0 ? void 0 : _a.call(host, compilerHost); var documentRegistryBucketKey = documentRegistry.getKeyForCompilationSettings(newSettings); var options = { rootNames: rootFileNames, @@ -136365,7 +137028,7 @@ var ts; // We do not support the scenario where a host can modify a registered // file's script kind, i.e. in one project some file is treated as ".ts" // and in another as ".js" - ts.Debug.assertEqual(hostFileInformation.scriptKind, oldSourceFile.scriptKind, "Registered script kind should match new script kind.", path); + ts.Debug.assertEqual(hostFileInformation.scriptKind, oldSourceFile.scriptKind, "Registered script kind should match new script kind."); return documentRegistry.updateDocumentWithKey(fileName, path, newSettings, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind); } // We didn't already have the file. Fall through and acquire it from the registry. @@ -136487,12 +137150,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return !ts.isLabelName(node) && !ts.isTagName(node); - case 194 /* PropertyAccessExpression */: - case 153 /* QualifiedName */: + case 195 /* PropertyAccessExpression */: + case 154 /* QualifiedName */: // Don't return quickInfo if inside the comment in `a/**/.b` return !ts.isInComment(sourceFile, position); case 104 /* ThisKeyword */: - case 183 /* ThisType */: + case 184 /* ThisType */: case 102 /* SuperKeyword */: return true; default: @@ -136594,15 +137257,15 @@ var ts; return undefined; } switch (node.kind) { - case 194 /* PropertyAccessExpression */: - case 153 /* QualifiedName */: + case 195 /* PropertyAccessExpression */: + case 154 /* QualifiedName */: case 10 /* StringLiteral */: case 91 /* FalseKeyword */: case 106 /* TrueKeyword */: case 100 /* NullKeyword */: case 102 /* SuperKeyword */: case 104 /* ThisKeyword */: - case 183 /* ThisType */: + case 184 /* ThisType */: case 75 /* Identifier */: break; // Cant create the text span @@ -136619,7 +137282,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 249 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 250 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -137096,7 +137759,7 @@ var ts; */ function literalIsName(node) { return ts.isDeclarationName(node) || - node.parent.kind === 265 /* ExternalModuleReference */ || + node.parent.kind === 266 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node); } @@ -137114,13 +137777,13 @@ var ts; case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: - if (node.parent.kind === 154 /* ComputedPropertyName */) { + if (node.parent.kind === 155 /* ComputedPropertyName */) { return ts.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; } // falls through case 75 /* Identifier */: return ts.isObjectLiteralElement(node.parent) && - (node.parent.parent.kind === 193 /* ObjectLiteralExpression */ || node.parent.parent.kind === 274 /* JsxAttributes */) && + (node.parent.parent.kind === 194 /* ObjectLiteralExpression */ || node.parent.parent.kind === 275 /* JsxAttributes */) && node.parent.name === node ? node.parent : undefined; } return undefined; @@ -137162,7 +137825,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 195 /* ElementAccessExpression */ && + node.parent.kind === 196 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /** @@ -137242,114 +137905,114 @@ var ts; if (node) { var parent = node.parent; switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 242 /* VariableDeclaration */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 243 /* VariableDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return spanInVariableDeclaration(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return spanInParameterDeclaration(node); - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 162 /* Constructor */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 163 /* Constructor */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 223 /* Block */: + case 224 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // falls through - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return spanInBlock(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return spanInBlock(node.block); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: // Span on while(...) return textSpanEndingAtNextToken(node, node.expression); - case 228 /* DoStatement */: + case 229 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 241 /* DebuggerStatement */: + case 242 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 227 /* IfStatement */: + case 228 /* IfStatement */: // set on if(..) span return textSpanEndingAtNextToken(node, node.expression); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return spanInForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: // span of for (a in ...) return textSpanEndingAtNextToken(node, node.expression); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: // span in initializer return spanInInitializerOfForLike(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: // span on switch(...) return textSpanEndingAtNextToken(node, node.expression); - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 240 /* TryStatement */: + case 241 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } // falls through - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 191 /* BindingElement */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 192 /* BindingElement */: // span on complete node return textSpan(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 157 /* Decorator */: + case 158 /* Decorator */: return spanInNodeArray(parent.decorators); - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: return undefined; // Tokens: case 26 /* SemicolonToken */: @@ -137379,7 +138042,7 @@ var ts; case 79 /* CatchKeyword */: case 92 /* FinallyKeyword */: return spanInNextNode(node); - case 152 /* OfKeyword */: + case 153 /* OfKeyword */: return spanInOfKeyword(node); default: // Destructuring pattern in destructuring assignment @@ -137392,13 +138055,13 @@ var ts; // `a` or `...c` or `d: x` from // `[a, b, ...c]` or `{ a, b }` or `{ d: x }` from destructuring pattern if ((node.kind === 75 /* Identifier */ || - node.kind === 213 /* SpreadElement */ || - node.kind === 281 /* PropertyAssignment */ || - node.kind === 282 /* ShorthandPropertyAssignment */) && + node.kind === 214 /* SpreadElement */ || + node.kind === 282 /* PropertyAssignment */ || + node.kind === 283 /* ShorthandPropertyAssignment */) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(parent)) { return textSpan(node); } - if (node.kind === 209 /* BinaryExpression */) { + if (node.kind === 210 /* BinaryExpression */) { var _a = node, left = _a.left, operatorToken = _a.operatorToken; // Set breakpoint in destructuring pattern if its destructuring assignment // [a, b, c] or {a, b, c} of @@ -137420,22 +138083,22 @@ var ts; } if (ts.isExpressionNode(node)) { switch (parent.kind) { - case 228 /* DoStatement */: + case 229 /* DoStatement */: // Set span as if on while keyword return spanInPreviousNode(node); - case 157 /* Decorator */: + case 158 /* Decorator */: // Set breakpoint on the decorator emit return spanInNode(node.parent); - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: return textSpan(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (node.parent.operatorToken.kind === 27 /* CommaToken */) { // If this is a comma expression, the breakpoint is possible in this expression return textSpan(node); } break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: if (node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); @@ -137444,21 +138107,21 @@ var ts; } } switch (node.parent.kind) { - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // If this is name of property assignment, set breakpoint in the initializer if (node.parent.name === node && !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } break; - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: // Breakpoint in type assertion goes to its operand if (node.parent.type === node) { return spanInNextNode(node.parent.type); } break; - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: { + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: { // initializer of variable/parameter declaration go to previous node var _b = node.parent, initializer = _b.initializer, type = _b.type; if (initializer === node || type === node || ts.isAssignmentOperator(node.kind)) { @@ -137466,7 +138129,7 @@ var ts; } break; } - case 209 /* BinaryExpression */: { + case 210 /* BinaryExpression */: { var left = node.parent.left; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { // If initializer of destructuring assignment move to previous token @@ -137496,7 +138159,7 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 231 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 232 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } var parent = variableDeclaration.parent; @@ -137508,7 +138171,7 @@ var ts; // or its declaration from 'for of' if (variableDeclaration.initializer || ts.hasModifier(variableDeclaration, 1 /* Export */) || - parent.parent.kind === 232 /* ForOfStatement */) { + parent.parent.kind === 233 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } if (ts.isVariableDeclarationList(variableDeclaration.parent) && @@ -137549,7 +138212,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasModifier(functionDeclaration, 1 /* Export */) || - (functionDeclaration.parent.kind === 245 /* ClassDeclaration */ && functionDeclaration.kind !== 162 /* Constructor */); + (functionDeclaration.parent.kind === 246 /* ClassDeclaration */ && functionDeclaration.kind !== 163 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -137572,26 +138235,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // Set on parent if on same line otherwise on first statement // falls through - case 229 /* WhileStatement */: - case 227 /* IfStatement */: - case 231 /* ForInStatement */: + case 230 /* WhileStatement */: + case 228 /* IfStatement */: + case 232 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 243 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 244 /* VariableDeclarationList */) { // Declaration list - set breakpoint in first declaration var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -137616,21 +138279,21 @@ var ts; } function spanInBindingPattern(bindingPattern) { // Set breakpoint in first binding element - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 215 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 216 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } // Empty binding pattern of binding element, set breakpoint on binding element - if (bindingPattern.parent.kind === 191 /* BindingElement */) { + if (bindingPattern.parent.kind === 192 /* BindingElement */) { return textSpan(bindingPattern.parent); } // Variable declaration is used as the span return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 190 /* ArrayBindingPattern */ && node.kind !== 189 /* ObjectBindingPattern */); - var elements = node.kind === 192 /* ArrayLiteralExpression */ ? node.elements : node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 215 /* OmittedExpression */ ? element : undefined; }); + ts.Debug.assert(node.kind !== 191 /* ArrayBindingPattern */ && node.kind !== 190 /* ObjectBindingPattern */); + var elements = node.kind === 193 /* ArrayLiteralExpression */ ? node.elements : node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 216 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } @@ -137638,18 +138301,18 @@ var ts; // just nested element in another destructuring assignment // set breakpoint on assignment when parent is destructuring assignment // Otherwise set breakpoint for this element - return textSpan(node.parent.kind === 209 /* BinaryExpression */ ? node.parent : node); + return textSpan(node.parent.kind === 210 /* BinaryExpression */ ? node.parent : node); } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -137657,25 +138320,25 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: // If this is not an instantiated module block, no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } // falls through - case 248 /* EnumDeclaration */: - case 245 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 246 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 223 /* Block */: + case 224 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // falls through - case 280 /* CatchClause */: + case 281 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -137683,7 +138346,7 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -137699,7 +138362,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -137714,12 +138377,12 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 228 /* DoStatement */ || // Go to while keyword and do action instead - node.parent.kind === 196 /* CallExpression */ || - node.parent.kind === 197 /* NewExpression */) { + if (node.parent.kind === 229 /* DoStatement */ || // Go to while keyword and do action instead + node.parent.kind === 197 /* CallExpression */ || + node.parent.kind === 198 /* NewExpression */) { return spanInPreviousNode(node); } - if (node.parent.kind === 200 /* ParenthesizedExpression */) { + if (node.parent.kind === 201 /* ParenthesizedExpression */) { return spanInNextNode(node); } // Default to parent node @@ -137728,21 +138391,21 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 162 /* Constructor */: - case 229 /* WhileStatement */: - case 228 /* DoStatement */: - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 200 /* ParenthesizedExpression */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 163 /* Constructor */: + case 230 /* WhileStatement */: + case 229 /* DoStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 201 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -137752,20 +138415,20 @@ var ts; function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration if (ts.isFunctionLike(node.parent) || - node.parent.kind === 281 /* PropertyAssignment */ || - node.parent.kind === 156 /* Parameter */) { + node.parent.kind === 282 /* PropertyAssignment */ || + node.parent.kind === 157 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 199 /* TypeAssertionExpression */) { + if (node.parent.kind === 200 /* TypeAssertionExpression */) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 228 /* DoStatement */) { + if (node.parent.kind === 229 /* DoStatement */) { // Set span on while expression return textSpanEndingAtNextToken(node, node.parent.expression); } @@ -137773,7 +138436,7 @@ var ts; return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 232 /* ForOfStatement */) { + if (node.parent.kind === 233 /* ForOfStatement */) { // Set using next token return spanInNextNode(node); } @@ -140172,7 +140835,7 @@ var ts; var Project = /** @class */ (function () { /*@internal*/ function Project( - /*@internal*/ projectName, projectKind, projectService, documentRegistry, hasExplicitListOfFiles, lastFileExceededProgramSize, compilerOptions, compileOnSaveEnabled, watchOptions, directoryStructureHost, currentDirectory, customRealpath) { + /*@internal*/ projectName, projectKind, projectService, documentRegistry, hasExplicitListOfFiles, lastFileExceededProgramSize, compilerOptions, compileOnSaveEnabled, watchOptions, directoryStructureHost, currentDirectory) { var _this = this; this.projectName = projectName; this.projectKind = projectKind; @@ -140242,9 +140905,7 @@ var ts; else if (host.trace) { this.trace = function (s) { return host.trace(s); }; } - if (host.realpath) { - this.realpath = customRealpath || (function (path) { return host.realpath(path); }); - } + this.realpath = ts.maybeBind(host, host.realpath); // Use the current directory as resolution root only if the project created using current directory string this.resolutionCache = ts.createResolutionCache(this, currentDirectory && this.currentDirectory, /*logChangesWhenResolvingModule*/ true); this.languageService = ts.createLanguageService(this, this.documentRegistry, projectService.syntaxOnly); @@ -140381,10 +141042,6 @@ var ts; return this.projectService.host.writeFile(fileName, content); }; Project.prototype.fileExists = function (file) { - return this.fileExistsWithCache(file); - }; - /* @internal */ - Project.prototype.fileExistsWithCache = function (file) { // As an optimization, don't hit the disks for files we already know don't exist // (because we're watching for their creation). var path = this.toPath(file); @@ -140961,7 +141618,7 @@ var ts; this.projectService.sendUpdateGraphPerformanceEvent(elapsed); this.writeLog("Finishing updateGraphWorker: Project: " + this.getProjectName() + " Version: " + this.getProjectVersion() + " structureChanged: " + hasNewProgram + " Elapsed: " + elapsed + "ms"); if (this.hasAddedorRemovedFiles) { - this.print(); + this.print(/*writeProjectFileNames*/ true); } else if (this.program !== oldProgram) { this.writeLog("Different program with same set of files:: oldProgram.structureIsReused:: " + (oldProgram && oldProgram.structureIsReused)); @@ -141118,9 +141775,9 @@ var ts; return strBuilder; }; /*@internal*/ - Project.prototype.print = function (counter) { - this.writeLog("Project '" + this.projectName + "' (" + ProjectKind[this.projectKind] + ") " + (counter === undefined ? "" : counter)); - this.writeLog(this.filesToString(this.projectService.logger.hasLevel(server.LogLevel.verbose))); + Project.prototype.print = function (writeProjectFileNames) { + this.writeLog("Project '" + this.projectName + "' (" + ProjectKind[this.projectKind] + ")"); + this.writeLog(this.filesToString(writeProjectFileNames && this.projectService.logger.hasLevel(server.LogLevel.verbose))); this.writeLog("-----------------------------------------------"); }; Project.prototype.setCompilerOptions = function (compilerOptions) { @@ -141536,7 +142193,7 @@ var ts; /*lastFileExceededProgramSize*/ undefined, /*compilerOptions*/ {}, /*compileOnSaveEnabled*/ false, - /*watchOptions*/ undefined, cachedDirectoryStructureHost, ts.getDirectoryPath(configFileName), projectService.host.realpath && (function (s) { return _this.getRealpath(s); })) || this; + /*watchOptions*/ undefined, cachedDirectoryStructureHost, ts.getDirectoryPath(configFileName)) || this; /* @internal */ _this.openFileWatchTriggered = ts.createMap(); /*@internal*/ @@ -141547,150 +142204,20 @@ var ts; _this.isInitialLoadPending = ts.returnTrue; /*@internal*/ _this.sendLoadingProjectFinish = false; - /* @internal */ - _this.useSourceOfProjectReferenceRedirect = function () { return !!_this.languageServiceEnabled && - !_this.getCompilerOptions().disableSourceOfProjectReferenceRedirect; }; _this.canonicalConfigFilePath = server.asNormalizedPath(projectService.toCanonicalFileName(configFileName)); return _this; } /* @internal */ - ConfiguredProject.prototype.setResolvedProjectReferenceCallbacks = function (projectReferenceCallbacks) { - this.projectReferenceCallbacks = projectReferenceCallbacks; - }; - ConfiguredProject.prototype.fileExistsIfProjectReferenceDts = function (file) { - var source = this.projectReferenceCallbacks.getSourceOfProjectReferenceRedirect(file); - return source !== undefined ? - ts.isString(source) ? _super.prototype.fileExists.call(this, source) : true : - undefined; - }; - /** - * This implementation of fileExists checks if the file being requested is - * .d.ts file for the referenced Project. - * If it is it returns true irrespective of whether that file exists on host - */ - ConfiguredProject.prototype.fileExists = function (file) { - if (_super.prototype.fileExists.call(this, file)) - return true; - if (!this.useSourceOfProjectReferenceRedirect() || !this.projectReferenceCallbacks) - return false; - if (!ts.isDeclarationFileName(file)) - return false; - // Project references go to source file instead of .d.ts file - return this.fileOrDirectoryExistsUsingSource(file, /*isFile*/ true); - }; - ConfiguredProject.prototype.directoryExistsIfProjectReferenceDeclDir = function (dir) { - var dirPath = this.toPath(dir); - var dirPathWithTrailingDirectorySeparator = "" + dirPath + ts.directorySeparator; - return ts.forEachKey(this.mapOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath || - // Any parent directory of declaration dir - ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) || - // Any directory inside declaration dir - ts.startsWith(dirPath, declDirPath + "/"); }); - }; - /** - * This implementation of directoryExists checks if the directory being requested is - * directory of .d.ts file for the referenced Project. - * If it is it returns true irrespective of whether that directory exists on host - */ - ConfiguredProject.prototype.directoryExists = function (path) { - var _this = this; - if (_super.prototype.directoryExists.call(this, path)) { - this.handleDirectoryCouldBeSymlink(path); - return true; - } - if (!this.useSourceOfProjectReferenceRedirect() || !this.projectReferenceCallbacks) - return false; - if (!this.mapOfDeclarationDirectories) { - this.mapOfDeclarationDirectories = ts.createMap(); - this.projectReferenceCallbacks.forEachResolvedProjectReference(function (ref) { - if (!ref) - return; - var out = ref.commandLine.options.outFile || ref.commandLine.options.out; - if (out) { - _this.mapOfDeclarationDirectories.set(ts.getDirectoryPath(_this.toPath(out)), true); - } - else { - // Set declaration's in different locations only, if they are next to source the directory present doesnt change - var declarationDir = ref.commandLine.options.declarationDir || ref.commandLine.options.outDir; - if (declarationDir) { - _this.mapOfDeclarationDirectories.set(_this.toPath(declarationDir), true); - } - } - }); - } - return this.fileOrDirectoryExistsUsingSource(path, /*isFile*/ false); + ConfiguredProject.prototype.setCompilerHost = function (host) { + this.compilerHost = host; }; - /** - * Call super.getDirectories only if directory actually present on the host - * This is needed to ensure that we arent getting directories that we fake about presence for - */ - ConfiguredProject.prototype.getDirectories = function (path) { - return !this.useSourceOfProjectReferenceRedirect() || !this.projectReferenceCallbacks || _super.prototype.directoryExists.call(this, path) ? - _super.prototype.getDirectories.call(this, path) : - []; - }; - ConfiguredProject.prototype.realpathIfSymlinkedProjectReferenceDts = function (s) { - return this.symlinkedFiles && this.symlinkedFiles.get(this.toPath(s)); - }; - ConfiguredProject.prototype.getRealpath = function (s) { - return this.realpathIfSymlinkedProjectReferenceDts(s) || - this.projectService.host.realpath(s); - }; - ConfiguredProject.prototype.handleDirectoryCouldBeSymlink = function (directory) { - if (!this.useSourceOfProjectReferenceRedirect() || !this.projectReferenceCallbacks) - return; - // Because we already watch node_modules, handle symlinks in there - if (!this.realpath || !ts.stringContains(directory, ts.nodeModulesPathPart)) - return; - if (!this.symlinkedDirectories) - this.symlinkedDirectories = ts.createMap(); - var directoryPath = ts.ensureTrailingDirectorySeparator(this.toPath(directory)); - if (this.symlinkedDirectories.has(directoryPath)) - return; - var real = ts.normalizePath(this.projectService.host.realpath(directory)); - var realPath; - if (real === directory || - (realPath = ts.ensureTrailingDirectorySeparator(this.toPath(real))) === directoryPath) { - // not symlinked - this.symlinkedDirectories.set(directoryPath, false); - return; - } - this.symlinkedDirectories.set(directoryPath, { - real: ts.ensureTrailingDirectorySeparator(real), - realPath: realPath - }); + /* @internal */ + ConfiguredProject.prototype.getCompilerHost = function () { + return this.compilerHost; }; - ConfiguredProject.prototype.fileOrDirectoryExistsUsingSource = function (fileOrDirectory, isFile) { - var _this = this; - var fileOrDirectoryExistsUsingSource = isFile ? - function (file) { return _this.fileExistsIfProjectReferenceDts(file); } : - function (dir) { return _this.directoryExistsIfProjectReferenceDeclDir(dir); }; - // Check current directory or file - var result = fileOrDirectoryExistsUsingSource(fileOrDirectory); - if (result !== undefined) - return result; - if (!this.symlinkedDirectories) - return false; - var fileOrDirectoryPath = this.toPath(fileOrDirectory); - if (!ts.stringContains(fileOrDirectoryPath, ts.nodeModulesPathPart)) - return false; - if (isFile && this.symlinkedFiles && this.symlinkedFiles.has(fileOrDirectoryPath)) - return true; - // If it contains node_modules check if its one of the symlinked path we know of - return ts.firstDefinedIterator(this.symlinkedDirectories.entries(), function (_a) { - var directoryPath = _a[0], symlinkedDirectory = _a[1]; - if (!symlinkedDirectory || !ts.startsWith(fileOrDirectoryPath, directoryPath)) - return undefined; - var result = fileOrDirectoryExistsUsingSource(fileOrDirectoryPath.replace(directoryPath, symlinkedDirectory.realPath)); - if (isFile && result) { - if (!_this.symlinkedFiles) - _this.symlinkedFiles = ts.createMap(); - // Store the real path for the file' - var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, _this.currentDirectory); - _this.symlinkedFiles.set(fileOrDirectoryPath, "" + symlinkedDirectory.real + absolutePath.replace(new RegExp(directoryPath, "i"), "")); - } - return result; - }) || false; + /* @internal */ + ConfiguredProject.prototype.useSourceOfProjectReferenceRedirect = function () { + return this.languageServiceEnabled; }; /* @internal */ ConfiguredProject.prototype.setWatchOptions = function (watchOptions) { @@ -141718,10 +142245,6 @@ var ts; this.isInitialLoadPending = ts.returnFalse; var reloadLevel = this.pendingReload; this.pendingReload = ts.ConfigFileProgramReloadLevel.None; - this.projectReferenceCallbacks = undefined; - this.mapOfDeclarationDirectories = undefined; - this.symlinkedDirectories = undefined; - this.symlinkedFiles = undefined; var result; switch (reloadLevel) { case ts.ConfigFileProgramReloadLevel.Partial: @@ -141738,6 +142261,7 @@ var ts; default: result = _super.prototype.updateGraph.call(this); } + this.compilerHost = undefined; this.projectService.sendProjectLoadingFinishEvent(this); this.projectService.sendProjectTelemetry(this); return result; @@ -141833,11 +142357,8 @@ var ts; this.stopWatchingWildCards(); this.projectErrors = undefined; this.configFileSpecs = undefined; - this.projectReferenceCallbacks = undefined; - this.mapOfDeclarationDirectories = undefined; - this.symlinkedDirectories = undefined; - this.symlinkedFiles = undefined; this.openFileWatchTriggered.clear(); + this.compilerHost = undefined; _super.prototype.close.call(this); }; /* @internal */ @@ -141848,6 +142369,19 @@ var ts; ConfiguredProject.prototype.deleteExternalProjectReference = function () { this.externalProjectRefCount--; }; + /* @internal */ + ConfiguredProject.prototype.isSolution = function () { + return this.getRootFilesMap().size === 0 && + !this.canConfigFileJsonReportNoInputFiles; + }; + /* @internal */ + /** Find the configured project from the project references in this solution which contains the info directly */ + ConfiguredProject.prototype.getDefaultChildProjectFromSolution = function (info) { + ts.Debug.assert(this.isSolution()); + return server.forEachResolvedProjectReferenceProject(this, function (child) { return server.projectContainsInfoDirectly(child, info) ? + child : + undefined; }, server.ProjectReferenceProjectLoadKind.Find); + }; /** Returns true if the project is needed by any of the open script info/external project */ /* @internal */ ConfiguredProject.prototype.hasOpenRef = function () { @@ -141866,10 +142400,13 @@ var ts; // In that case keep the project alive if there are open files impacted by this project return !!configFileExistenceInfo.openFilesImpactedByConfigFile.size; } + var isSolution = this.isSolution(); // If there is no pending update for this project, // We know exact set of open files that get impacted by this configured project as the files in the project // The project is referenced only if open files impacted by this project are present in this project - return ts.forEachEntry(configFileExistenceInfo.openFilesImpactedByConfigFile, function (_value, infoPath) { return _this.containsScriptInfo(_this.projectService.getScriptInfoForPath(infoPath)); }) || false; + return ts.forEachEntry(configFileExistenceInfo.openFilesImpactedByConfigFile, function (_value, infoPath) { return isSolution ? + !!_this.getDefaultChildProjectFromSolution(_this.projectService.getScriptInfoForPath(infoPath)) : + _this.containsScriptInfo(_this.projectService.getScriptInfoForPath(infoPath)); }) || false; }; /*@internal*/ ConfiguredProject.prototype.hasExternalProjectRef = function () { @@ -142128,10 +142665,37 @@ var ts; function isAncestorConfigFileInfo(infoOrFileNameOrConfig) { return !!infoOrFileNameOrConfig.configFileInfo; } + /*@internal*/ + /** Kind of operation to perform to get project reference project */ + var ProjectReferenceProjectLoadKind; + (function (ProjectReferenceProjectLoadKind) { + /** Find existing project for project reference */ + ProjectReferenceProjectLoadKind[ProjectReferenceProjectLoadKind["Find"] = 0] = "Find"; + /** Find existing project or create one for the project reference */ + ProjectReferenceProjectLoadKind[ProjectReferenceProjectLoadKind["FindCreate"] = 1] = "FindCreate"; + /** Find existing project or create and load it for the project reference */ + ProjectReferenceProjectLoadKind[ProjectReferenceProjectLoadKind["FindCreateLoad"] = 2] = "FindCreateLoad"; + })(ProjectReferenceProjectLoadKind = server.ProjectReferenceProjectLoadKind || (server.ProjectReferenceProjectLoadKind = {})); + function forEachResolvedProjectReferenceProject(project, cb, projectReferenceProjectLoadKind, reason) { + return forEachResolvedProjectReference(project, function (ref) { + if (!ref) + return undefined; + var configFileName = server.toNormalizedPath(ref.sourceFile.fileName); + var child = project.projectService.findConfiguredProjectByProjectName(configFileName) || (projectReferenceProjectLoadKind === ProjectReferenceProjectLoadKind.FindCreate ? + project.projectService.createConfiguredProject(configFileName) : + projectReferenceProjectLoadKind === ProjectReferenceProjectLoadKind.FindCreateLoad ? + project.projectService.createAndLoadConfiguredProject(configFileName, reason) : + undefined); + return child && cb(child, configFileName); + }); + } + server.forEachResolvedProjectReferenceProject = forEachResolvedProjectReferenceProject; + /*@internal*/ function forEachResolvedProjectReference(project, cb) { var program = project.getCurrentProgram(); return program && program.forEachResolvedProjectReference(cb); } + server.forEachResolvedProjectReference = forEachResolvedProjectReference; function forEachPotentialProjectReference(project, cb) { return project.potentialProjectReferences && ts.forEachKey(project.potentialProjectReferences, cb); @@ -142157,6 +142721,13 @@ var ts; return !info.isScriptOpen() && info.mTime !== undefined; } /*@internal*/ + /** true if script info is part of project and is not in project because it is referenced from project reference source */ + function projectContainsInfoDirectly(project, info) { + return project.containsScriptInfo(info) && + !project.isSourceOfProjectReferenceRedirect(info.path); + } + server.projectContainsInfoDirectly = projectContainsInfoDirectly; + /*@internal*/ function updateProjectIfDirty(project) { return project.dirty && project.updateGraph(); } @@ -142359,7 +142930,7 @@ var ts; ProjectService.prototype.delayEnsureProjectForOpenFiles = function () { var _this = this; this.pendingEnsureProjectForOpenFiles = true; - this.throttledOperations.schedule("*ensureProjectForOpenFiles*", /*delay*/ 250, function () { + this.throttledOperations.schedule("*ensureProjectForOpenFiles*", /*delay*/ 2500, function () { if (_this.pendingProjectUpdates.size !== 0) { _this.delayEnsureProjectForOpenFiles(); } @@ -142744,7 +143315,7 @@ var ts; ProjectService.prototype.removeProject = function (project) { var _this = this; this.logger.info("`remove Project::"); - project.print(); + project.print(/*writeProjectFileNames*/ true); project.close(); if (ts.Debug.shouldAssert(1 /* Normal */)) { this.filenameToScriptInfo.forEach(function (info) { return ts.Debug.assert(!info.isAttached(project), "Found script Info still attached to project", function () { return project.projectName + ": ScriptInfos still attached: " + JSON.stringify(ts.arrayFrom(ts.mapDefinedIterator(_this.filenameToScriptInfo.values(), function (info) { return info.isAttached(project) ? @@ -143135,6 +143706,12 @@ var ts; result = action(jsconfigFileName, ts.combinePaths(canonicalSearchPath, "jsconfig.json")); if (result) return jsconfigFileName; + // If we started within node_modules, don't look outside node_modules. + // Otherwise, we might pick up a very large project and pull in the world, + // causing an editor delay. + if (ts.isNodeModulesDirectory(canonicalSearchPath)) { + break; + } } var parentPath = server.asNormalizedPath(ts.getDirectoryPath(searchPath)); if (parentPath === searchPath) @@ -143149,8 +143726,11 @@ var ts; if (!info.isScriptOpen()) return undefined; var configFileName = this.getConfigFileNameForFile(info); - return configFileName && + var project = configFileName && this.findConfiguredProjectByProjectName(configFileName); + return (project === null || project === void 0 ? void 0 : project.isSolution()) ? + project.getDefaultChildProjectFromSolution(info) : + project; }; /** * This function tries to search for a tsconfig.json for the given file. @@ -143183,21 +143763,19 @@ var ts; if (!this.logger.hasLevel(server.LogLevel.normal)) { return; } - var writeProjectFileNames = this.logger.hasLevel(server.LogLevel.verbose); this.logger.startGroup(); - var counter = printProjectsWithCounter(this.externalProjects, 0); - counter = printProjectsWithCounter(ts.arrayFrom(this.configuredProjects.values()), counter); - printProjectsWithCounter(this.inferredProjects, counter); + this.externalProjects.forEach(printProjectWithoutFileNames); + this.configuredProjects.forEach(printProjectWithoutFileNames); + this.inferredProjects.forEach(printProjectWithoutFileNames); this.logger.info("Open files: "); this.openFiles.forEach(function (projectRootPath, path) { var info = _this.getScriptInfoForPath(path); _this.logger.info("\tFileName: " + info.fileName + " ProjectRootPath: " + projectRootPath); - if (writeProjectFileNames) { - _this.logger.info("\t\tProjects: " + info.containingProjects.map(function (p) { return p.getProjectName(); })); - } + _this.logger.info("\t\tProjects: " + info.containingProjects.map(function (p) { return p.getProjectName(); })); }); this.logger.endGroup(); }; + /*@internal*/ ProjectService.prototype.findConfiguredProjectByProjectName = function (configFileName) { // make sure that casing of config file name is consistent var canonicalConfigFilePath = server.asNormalizedPath(this.toCanonicalFileName(configFileName)); @@ -143305,6 +143883,7 @@ var ts; this.updateNonInferredProjectFiles(project, files, propertyReader); project.setTypeAcquisition(typeAcquisition); }; + /* @internal */ ProjectService.prototype.createConfiguredProject = function (configFileName) { var cachedDirectoryStructureHost = ts.createCachedDirectoryStructureHost(this.host, this.host.getCurrentDirectory(), this.host.useCaseSensitiveFileNames); // TODO: GH#18217 this.logger.info("Opened configuration file " + configFileName); @@ -143400,7 +143979,7 @@ var ts; var isDynamic = server.isDynamicFileName(fileName); var path = void 0; // Use the project's fileExists so that it can use caching instead of reaching to disk for the query - if (!isDynamic && !project.fileExistsWithCache(newRootFile)) { + if (!isDynamic && !project.fileExists(newRootFile)) { path = server.normalizedPathToPath(fileName, this.currentDirectory, this.toCanonicalFileName); var existingValue = projectRootFilesMap.get(path); if (existingValue) { @@ -143442,7 +144021,7 @@ var ts; projectRootFilesMap.forEach(function (value, path) { if (!newRootScriptInfoMap.has(path)) { if (value.info) { - project.removeFile(value.info, project.fileExistsWithCache(path), /*detachFromProject*/ true); + project.removeFile(value.info, project.fileExists(path), /*detachFromProject*/ true); } else { projectRootFilesMap.delete(path); @@ -144046,7 +144625,8 @@ var ts; var configFileName = _this.getConfigFileNameForFile(info); if (configFileName) { var project = _this.findConfiguredProjectByProjectName(configFileName) || _this.createConfiguredProject(configFileName); - if (!updatedProjects.has(configFileName)) { + if (!updatedProjects.has(project.canonicalConfigFilePath)) { + updatedProjects.set(project.canonicalConfigFilePath, true); if (delayReload) { project.pendingReload = ts.ConfigFileProgramReloadLevel.Full; project.pendingReloadReason = reason; @@ -144055,8 +144635,17 @@ var ts; else { // reload from the disk _this.reloadConfiguredProject(project, reason); + // If this is solution, reload the project till the reloaded project contains the script info directly + if (!project.containsScriptInfo(info) && project.isSolution()) { + forEachResolvedProjectReferenceProject(project, function (child) { + if (!updatedProjects.has(child.canonicalConfigFilePath)) { + updatedProjects.set(child.canonicalConfigFilePath, true); + _this.reloadConfiguredProject(child, reason); + } + return projectContainsInfoDirectly(child, info); + }, ProjectReferenceProjectLoadKind.FindCreate); + } } - updatedProjects.set(configFileName, true); } } }); @@ -144096,7 +144685,7 @@ var ts; */ ProjectService.prototype.ensureProjectForOpenFiles = function () { var _this = this; - this.logger.info("Structure before ensureProjectForOpenFiles:"); + this.logger.info("Before ensureProjectForOpenFiles:"); this.printProjects(); this.openFiles.forEach(function (projectRootPath, path) { var info = _this.getScriptInfoForPath(path); @@ -144111,7 +144700,7 @@ var ts; }); this.pendingEnsureProjectForOpenFiles = false; this.inferredProjects.forEach(updateProjectIfDirty); - this.logger.info("Structure after ensureProjectForOpenFiles:"); + this.logger.info("After ensureProjectForOpenFiles:"); this.printProjects(); }; /** @@ -144124,6 +144713,7 @@ var ts; }; /*@internal*/ ProjectService.prototype.getOriginalLocationEnsuringConfiguredProject = function (project, location) { + var _this = this; var originalLocation = project.isSourceOfProjectReferenceRedirect(location.fileName) ? location : project.getSourceMapper().tryGetSourcePosition(location); @@ -144138,9 +144728,19 @@ var ts; return undefined; var configuredProject = this.findConfiguredProjectByProjectName(configFileName) || this.createAndLoadConfiguredProject(configFileName, "Creating project for original file: " + originalFileInfo.fileName + (location !== originalLocation ? " for location: " + location.fileName : "")); - if (configuredProject === project) - return originalLocation; updateProjectIfDirty(configuredProject); + if (configuredProject.isSolution()) { + // Find the project that is referenced from this solution that contains the script info directly + configuredProject = forEachResolvedProjectReferenceProject(configuredProject, function (child) { + updateProjectIfDirty(child); + var info = _this.getScriptInfo(fileName); + return info && projectContainsInfoDirectly(child, info) ? child : undefined; + }, ProjectReferenceProjectLoadKind.FindCreateLoad, "Creating project referenced in solution " + configuredProject.projectName + " to find possible configured project for original file: " + originalFileInfo.fileName + (location !== originalLocation ? " for location: " + location.fileName : "")); + if (!configuredProject) + return undefined; + if (configuredProject === project) + return originalLocation; + } // Keep this configured project as referenced from project addOriginalConfiguredProject(configuredProject); var originalScriptInfo = this.getScriptInfo(fileName); @@ -144177,10 +144777,12 @@ var ts; return info; }; ProjectService.prototype.assignProjectToOpenedScriptInfo = function (info) { + var _this = this; var configFileName; var configFileErrors; var project = this.findExternalProjectContainingOpenScriptInfo(info); var defaultConfigProject; + var retainProjects; if (!project && !this.syntaxOnly) { // Checking syntaxOnly is an optimization configFileName = this.getConfigFileNameForFile(info); if (configFileName) { @@ -144202,8 +144804,32 @@ var ts; updateProjectIfDirty(project); } defaultConfigProject = project; - // Create ancestor configured project - this.createAncestorProjects(info, defaultConfigProject); + retainProjects = defaultConfigProject; + // If this configured project doesnt contain script info but + // it is solution with project references, try those project references + if (!project.containsScriptInfo(info) && project.isSolution()) { + forEachResolvedProjectReferenceProject(project, function (child, childConfigFileName) { + updateProjectIfDirty(child); + // Retain these projects + if (!ts.isArray(retainProjects)) { + retainProjects = [project, child]; + } + else { + retainProjects.push(child); + } + // If script info belongs to this child project, use this as default config project + if (projectContainsInfoDirectly(child, info)) { + configFileName = childConfigFileName; + configFileErrors = child.getAllProjectErrors(); + _this.sendConfigFileDiagEvent(child, info.fileName); + return child; + } + }, ProjectReferenceProjectLoadKind.FindCreateLoad, "Creating project referenced in solution " + project.projectName + " to find possible configured project for " + info.fileName + " to open"); + } + else { + // Create ancestor configured project + this.createAncestorProjects(info, defaultConfigProject || project); + } } } // Project we have at this point is going to be updated since its either found through @@ -144220,7 +144846,7 @@ var ts; this.assignOrphanScriptInfoToInferredProject(info, this.openFiles.get(info.path)); } ts.Debug.assert(!info.isOrphan()); - return { configFileName: configFileName, configFileErrors: configFileErrors, defaultConfigProject: defaultConfigProject }; + return { configFileName: configFileName, configFileErrors: configFileErrors, retainProjects: retainProjects }; }; ProjectService.prototype.createAncestorProjects = function (info, project) { // Skip if info is not part of default configured project @@ -144260,7 +144886,7 @@ var ts; var project = _a[_i]; // If this project has potential project reference for any of the project we are loading ancestor tree for // we need to load this project tree - if (forEachPotentialProjectReference(project, function (potentialRefPath) { return forProjects.has(potentialRefPath); })) { + if (forEachPotentialProjectReference(project, function (potentialRefPath) { return forProjects.has(potentialRefPath); }) || (project.isSolution() && forEachResolvedProjectReference(project, function (_ref, resolvedPath) { return forProjects.has(resolvedPath); }))) { // Load children this.ensureProjectChildren(project, seenProjects); } @@ -144273,14 +144899,7 @@ var ts; // Update the project updateProjectIfDirty(project); // Create tree because project is uptodate we only care of resolved references - forEachResolvedProjectReference(project, function (ref) { - if (!ref) - return; - var configFileName = server.toNormalizedPath(ref.sourceFile.fileName); - var child = _this.findConfiguredProjectByProjectName(configFileName) || - _this.createAndLoadConfiguredProject(configFileName, "Creating project for reference of project: " + project.projectName); - _this.ensureProjectChildren(child, seenProjects); - }); + forEachResolvedProjectReferenceProject(project, function (child) { return _this.ensureProjectChildren(child, seenProjects); }, ProjectReferenceProjectLoadKind.FindCreateLoad, "Creating project for reference of project: " + project.projectName); }; ProjectService.prototype.cleanupAfterOpeningFile = function (toRetainConfigProjects) { // This was postponed from closeOpenFile to after opening next file, @@ -144302,8 +144921,8 @@ var ts; }; ProjectService.prototype.openClientFileWithNormalizedPath = function (fileName, fileContent, scriptKind, hasMixedContent, projectRootPath) { var info = this.getOrCreateOpenScriptInfo(fileName, fileContent, scriptKind, hasMixedContent, projectRootPath); - var _a = this.assignProjectToOpenedScriptInfo(info), defaultConfigProject = _a.defaultConfigProject, result = __rest(_a, ["defaultConfigProject"]); - this.cleanupAfterOpeningFile(defaultConfigProject); + var _a = this.assignProjectToOpenedScriptInfo(info), retainProjects = _a.retainProjects, result = __rest(_a, ["retainProjects"]); + this.cleanupAfterOpeningFile(retainProjects); this.telemetryOnOpenFile(info); this.printProjects(); return result; @@ -144479,9 +145098,9 @@ var ts; } } // All the script infos now exist, so ok to go update projects for open files - var defaultConfigProjects; + var retainProjects; if (openScriptInfos) { - defaultConfigProjects = ts.mapDefined(openScriptInfos, function (info) { return _this.assignProjectToOpenedScriptInfo(info).defaultConfigProject; }); + retainProjects = ts.flatMap(openScriptInfos, function (info) { return _this.assignProjectToOpenedScriptInfo(info).retainProjects; }); } // While closing files there could be open files that needed assigning new inferred projects, do it now if (assignOrphanScriptInfosToInferredProject) { @@ -144489,7 +145108,7 @@ var ts; } if (openScriptInfos) { // Cleanup projects - this.cleanupAfterOpeningFile(defaultConfigProjects); + this.cleanupAfterOpeningFile(retainProjects); // Telemetry openScriptInfos.forEach(function (info) { return _this.telemetryOnOpenFile(info); }); this.printProjects(); @@ -144825,13 +145444,8 @@ var ts; return config.kind !== undefined; } server.isConfigFile = isConfigFile; - function printProjectsWithCounter(projects, counter) { - for (var _i = 0, projects_4 = projects; _i < projects_4.length; _i++) { - var project = projects_4[_i]; - project.print(counter); - counter++; - } - return counter; + function printProjectWithoutFileNames(project) { + project.print(/*writeProjectFileNames*/ false); } })(server = ts.server || (ts.server = {})); })(ts || (ts = {})); @@ -145185,11 +145799,17 @@ var ts; if (initialLocation) { var defaultDefinition_1 = getDefinitionLocation(defaultProject, initialLocation); if (defaultDefinition_1) { + var getGeneratedDefinition_1 = ts.memoize(function () { return defaultProject.isSourceOfProjectReferenceRedirect(defaultDefinition_1.fileName) ? + defaultDefinition_1 : + defaultProject.getLanguageService().getSourceMapper().tryGetGeneratedPosition(defaultDefinition_1); }); + var getSourceDefinition_1 = ts.memoize(function () { return defaultProject.isSourceOfProjectReferenceRedirect(defaultDefinition_1.fileName) ? + defaultDefinition_1 : + defaultProject.getLanguageService().getSourceMapper().tryGetSourcePosition(defaultDefinition_1); }); projectService.loadAncestorProjectTree(seenProjects); projectService.forEachEnabledProject(function (project) { if (!addToSeen(seenProjects, project)) return; - var definition = mapDefinitionInProject(defaultDefinition_1, defaultProject, project); + var definition = mapDefinitionInProject(defaultDefinition_1, project, getGeneratedDefinition_1, getSourceDefinition_1); if (definition) { toDo = callbackProjectAndLocation({ project: project, location: definition }, projectService, toDo, seenProjects, cb); } @@ -145200,17 +145820,17 @@ var ts; toDo = callbackProjectAndLocation(ts.Debug.checkDefined(toDo.pop()), projectService, toDo, seenProjects, cb); } } - function mapDefinitionInProject(definition, definingProject, project) { + function mapDefinitionInProject(definition, project, getGeneratedDefinition, getSourceDefinition) { // If the definition is actually from the project, definition is correct as is - if (!definition || - project.containsFile(server.toNormalizedPath(definition.fileName)) && - !isLocationProjectReferenceRedirect(project, definition)) { + if (project.containsFile(server.toNormalizedPath(definition.fileName)) && + !isLocationProjectReferenceRedirect(project, definition)) { return definition; } - var mappedDefinition = definingProject.isSourceOfProjectReferenceRedirect(definition.fileName) ? - definition : - definingProject.getLanguageService().getSourceMapper().tryGetGeneratedPosition(definition); - return mappedDefinition && project.containsFile(server.toNormalizedPath(mappedDefinition.fileName)) ? mappedDefinition : undefined; + var generatedDefinition = getGeneratedDefinition(); + if (generatedDefinition && project.containsFile(server.toNormalizedPath(generatedDefinition.fileName))) + return generatedDefinition; + var sourceDefinition = getSourceDefinition(); + return sourceDefinition && project.containsFile(server.toNormalizedPath(sourceDefinition.fileName)) ? sourceDefinition : undefined; } function isLocationProjectReferenceRedirect(project, location) { if (!location) @@ -145952,8 +146572,8 @@ var ts; return; } this.logger.info("cleaning " + caption); - for (var _i = 0, projects_5 = projects; _i < projects_5.length; _i++) { - var p = projects_5[_i]; + for (var _i = 0, projects_4 = projects; _i < projects_4.length; _i++) { + var p = projects_4[_i]; p.getLanguageService(/*ensureSynchronized*/ false).cleanupSemanticCache(); } }; @@ -147990,6 +148610,7 @@ var ts; } case "openbsd": case "freebsd": + case "netbsd": case "darwin": case "linux": case "android": { diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts index 0cb0c0fa0dc49..b54271da1ff26 100644 --- a/lib/tsserverlibrary.d.ts +++ b/lib/tsserverlibrary.d.ts @@ -71,7 +71,7 @@ declare namespace ts { end: number; } export type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind; - export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.OfKeyword; + export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.AwaitedKeyword | SyntaxKind.OfKeyword; export type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; export enum SyntaxKind { Unknown = 0, @@ -203,210 +203,211 @@ declare namespace ts { AnyKeyword = 125, AsyncKeyword = 126, AwaitKeyword = 127, - BooleanKeyword = 128, - ConstructorKeyword = 129, - DeclareKeyword = 130, - GetKeyword = 131, - InferKeyword = 132, - IsKeyword = 133, - KeyOfKeyword = 134, - ModuleKeyword = 135, - NamespaceKeyword = 136, - NeverKeyword = 137, - ReadonlyKeyword = 138, - RequireKeyword = 139, - NumberKeyword = 140, - ObjectKeyword = 141, - SetKeyword = 142, - StringKeyword = 143, - SymbolKeyword = 144, - TypeKeyword = 145, - UndefinedKeyword = 146, - UniqueKeyword = 147, - UnknownKeyword = 148, - FromKeyword = 149, - GlobalKeyword = 150, - BigIntKeyword = 151, - OfKeyword = 152, - QualifiedName = 153, - ComputedPropertyName = 154, - TypeParameter = 155, - Parameter = 156, - Decorator = 157, - PropertySignature = 158, - PropertyDeclaration = 159, - MethodSignature = 160, - MethodDeclaration = 161, - Constructor = 162, - GetAccessor = 163, - SetAccessor = 164, - CallSignature = 165, - ConstructSignature = 166, - IndexSignature = 167, - TypePredicate = 168, - TypeReference = 169, - FunctionType = 170, - ConstructorType = 171, - TypeQuery = 172, - TypeLiteral = 173, - ArrayType = 174, - TupleType = 175, - OptionalType = 176, - RestType = 177, - UnionType = 178, - IntersectionType = 179, - ConditionalType = 180, - InferType = 181, - ParenthesizedType = 182, - ThisType = 183, - TypeOperator = 184, - IndexedAccessType = 185, - MappedType = 186, - LiteralType = 187, - ImportType = 188, - ObjectBindingPattern = 189, - ArrayBindingPattern = 190, - BindingElement = 191, - ArrayLiteralExpression = 192, - ObjectLiteralExpression = 193, - PropertyAccessExpression = 194, - ElementAccessExpression = 195, - CallExpression = 196, - NewExpression = 197, - TaggedTemplateExpression = 198, - TypeAssertionExpression = 199, - ParenthesizedExpression = 200, - FunctionExpression = 201, - ArrowFunction = 202, - DeleteExpression = 203, - TypeOfExpression = 204, - VoidExpression = 205, - AwaitExpression = 206, - PrefixUnaryExpression = 207, - PostfixUnaryExpression = 208, - BinaryExpression = 209, - ConditionalExpression = 210, - TemplateExpression = 211, - YieldExpression = 212, - SpreadElement = 213, - ClassExpression = 214, - OmittedExpression = 215, - ExpressionWithTypeArguments = 216, - AsExpression = 217, - NonNullExpression = 218, - MetaProperty = 219, - SyntheticExpression = 220, - TemplateSpan = 221, - SemicolonClassElement = 222, - Block = 223, - EmptyStatement = 224, - VariableStatement = 225, - ExpressionStatement = 226, - IfStatement = 227, - DoStatement = 228, - WhileStatement = 229, - ForStatement = 230, - ForInStatement = 231, - ForOfStatement = 232, - ContinueStatement = 233, - BreakStatement = 234, - ReturnStatement = 235, - WithStatement = 236, - SwitchStatement = 237, - LabeledStatement = 238, - ThrowStatement = 239, - TryStatement = 240, - DebuggerStatement = 241, - VariableDeclaration = 242, - VariableDeclarationList = 243, - FunctionDeclaration = 244, - ClassDeclaration = 245, - InterfaceDeclaration = 246, - TypeAliasDeclaration = 247, - EnumDeclaration = 248, - ModuleDeclaration = 249, - ModuleBlock = 250, - CaseBlock = 251, - NamespaceExportDeclaration = 252, - ImportEqualsDeclaration = 253, - ImportDeclaration = 254, - ImportClause = 255, - NamespaceImport = 256, - NamedImports = 257, - ImportSpecifier = 258, - ExportAssignment = 259, - ExportDeclaration = 260, - NamedExports = 261, - NamespaceExport = 262, - ExportSpecifier = 263, - MissingDeclaration = 264, - ExternalModuleReference = 265, - JsxElement = 266, - JsxSelfClosingElement = 267, - JsxOpeningElement = 268, - JsxClosingElement = 269, - JsxFragment = 270, - JsxOpeningFragment = 271, - JsxClosingFragment = 272, - JsxAttribute = 273, - JsxAttributes = 274, - JsxSpreadAttribute = 275, - JsxExpression = 276, - CaseClause = 277, - DefaultClause = 278, - HeritageClause = 279, - CatchClause = 280, - PropertyAssignment = 281, - ShorthandPropertyAssignment = 282, - SpreadAssignment = 283, - EnumMember = 284, - UnparsedPrologue = 285, - UnparsedPrepend = 286, - UnparsedText = 287, - UnparsedInternalText = 288, - UnparsedSyntheticReference = 289, - SourceFile = 290, - Bundle = 291, - UnparsedSource = 292, - InputFiles = 293, - JSDocTypeExpression = 294, - JSDocAllType = 295, - JSDocUnknownType = 296, - JSDocNullableType = 297, - JSDocNonNullableType = 298, - JSDocOptionalType = 299, - JSDocFunctionType = 300, - JSDocVariadicType = 301, - JSDocNamepathType = 302, - JSDocComment = 303, - JSDocTypeLiteral = 304, - JSDocSignature = 305, - JSDocTag = 306, - JSDocAugmentsTag = 307, - JSDocImplementsTag = 308, - JSDocAuthorTag = 309, - JSDocClassTag = 310, - JSDocPublicTag = 311, - JSDocPrivateTag = 312, - JSDocProtectedTag = 313, - JSDocReadonlyTag = 314, - JSDocCallbackTag = 315, - JSDocEnumTag = 316, - JSDocParameterTag = 317, - JSDocReturnTag = 318, - JSDocThisTag = 319, - JSDocTypeTag = 320, - JSDocTemplateTag = 321, - JSDocTypedefTag = 322, - JSDocPropertyTag = 323, - SyntaxList = 324, - NotEmittedStatement = 325, - PartiallyEmittedExpression = 326, - CommaListExpression = 327, - MergeDeclarationMarker = 328, - EndOfDeclarationMarker = 329, - SyntheticReferenceExpression = 330, - Count = 331, + AwaitedKeyword = 128, + BooleanKeyword = 129, + ConstructorKeyword = 130, + DeclareKeyword = 131, + GetKeyword = 132, + InferKeyword = 133, + IsKeyword = 134, + KeyOfKeyword = 135, + ModuleKeyword = 136, + NamespaceKeyword = 137, + NeverKeyword = 138, + ReadonlyKeyword = 139, + RequireKeyword = 140, + NumberKeyword = 141, + ObjectKeyword = 142, + SetKeyword = 143, + StringKeyword = 144, + SymbolKeyword = 145, + TypeKeyword = 146, + UndefinedKeyword = 147, + UniqueKeyword = 148, + UnknownKeyword = 149, + FromKeyword = 150, + GlobalKeyword = 151, + BigIntKeyword = 152, + OfKeyword = 153, + QualifiedName = 154, + ComputedPropertyName = 155, + TypeParameter = 156, + Parameter = 157, + Decorator = 158, + PropertySignature = 159, + PropertyDeclaration = 160, + MethodSignature = 161, + MethodDeclaration = 162, + Constructor = 163, + GetAccessor = 164, + SetAccessor = 165, + CallSignature = 166, + ConstructSignature = 167, + IndexSignature = 168, + TypePredicate = 169, + TypeReference = 170, + FunctionType = 171, + ConstructorType = 172, + TypeQuery = 173, + TypeLiteral = 174, + ArrayType = 175, + TupleType = 176, + OptionalType = 177, + RestType = 178, + UnionType = 179, + IntersectionType = 180, + ConditionalType = 181, + InferType = 182, + ParenthesizedType = 183, + ThisType = 184, + TypeOperator = 185, + IndexedAccessType = 186, + MappedType = 187, + LiteralType = 188, + ImportType = 189, + ObjectBindingPattern = 190, + ArrayBindingPattern = 191, + BindingElement = 192, + ArrayLiteralExpression = 193, + ObjectLiteralExpression = 194, + PropertyAccessExpression = 195, + ElementAccessExpression = 196, + CallExpression = 197, + NewExpression = 198, + TaggedTemplateExpression = 199, + TypeAssertionExpression = 200, + ParenthesizedExpression = 201, + FunctionExpression = 202, + ArrowFunction = 203, + DeleteExpression = 204, + TypeOfExpression = 205, + VoidExpression = 206, + AwaitExpression = 207, + PrefixUnaryExpression = 208, + PostfixUnaryExpression = 209, + BinaryExpression = 210, + ConditionalExpression = 211, + TemplateExpression = 212, + YieldExpression = 213, + SpreadElement = 214, + ClassExpression = 215, + OmittedExpression = 216, + ExpressionWithTypeArguments = 217, + AsExpression = 218, + NonNullExpression = 219, + MetaProperty = 220, + SyntheticExpression = 221, + TemplateSpan = 222, + SemicolonClassElement = 223, + Block = 224, + EmptyStatement = 225, + VariableStatement = 226, + ExpressionStatement = 227, + IfStatement = 228, + DoStatement = 229, + WhileStatement = 230, + ForStatement = 231, + ForInStatement = 232, + ForOfStatement = 233, + ContinueStatement = 234, + BreakStatement = 235, + ReturnStatement = 236, + WithStatement = 237, + SwitchStatement = 238, + LabeledStatement = 239, + ThrowStatement = 240, + TryStatement = 241, + DebuggerStatement = 242, + VariableDeclaration = 243, + VariableDeclarationList = 244, + FunctionDeclaration = 245, + ClassDeclaration = 246, + InterfaceDeclaration = 247, + TypeAliasDeclaration = 248, + EnumDeclaration = 249, + ModuleDeclaration = 250, + ModuleBlock = 251, + CaseBlock = 252, + NamespaceExportDeclaration = 253, + ImportEqualsDeclaration = 254, + ImportDeclaration = 255, + ImportClause = 256, + NamespaceImport = 257, + NamedImports = 258, + ImportSpecifier = 259, + ExportAssignment = 260, + ExportDeclaration = 261, + NamedExports = 262, + NamespaceExport = 263, + ExportSpecifier = 264, + MissingDeclaration = 265, + ExternalModuleReference = 266, + JsxElement = 267, + JsxSelfClosingElement = 268, + JsxOpeningElement = 269, + JsxClosingElement = 270, + JsxFragment = 271, + JsxOpeningFragment = 272, + JsxClosingFragment = 273, + JsxAttribute = 274, + JsxAttributes = 275, + JsxSpreadAttribute = 276, + JsxExpression = 277, + CaseClause = 278, + DefaultClause = 279, + HeritageClause = 280, + CatchClause = 281, + PropertyAssignment = 282, + ShorthandPropertyAssignment = 283, + SpreadAssignment = 284, + EnumMember = 285, + UnparsedPrologue = 286, + UnparsedPrepend = 287, + UnparsedText = 288, + UnparsedInternalText = 289, + UnparsedSyntheticReference = 290, + SourceFile = 291, + Bundle = 292, + UnparsedSource = 293, + InputFiles = 294, + JSDocTypeExpression = 295, + JSDocAllType = 296, + JSDocUnknownType = 297, + JSDocNullableType = 298, + JSDocNonNullableType = 299, + JSDocOptionalType = 300, + JSDocFunctionType = 301, + JSDocVariadicType = 302, + JSDocNamepathType = 303, + JSDocComment = 304, + JSDocTypeLiteral = 305, + JSDocSignature = 306, + JSDocTag = 307, + JSDocAugmentsTag = 308, + JSDocImplementsTag = 309, + JSDocAuthorTag = 310, + JSDocClassTag = 311, + JSDocPublicTag = 312, + JSDocPrivateTag = 313, + JSDocProtectedTag = 314, + JSDocReadonlyTag = 315, + JSDocCallbackTag = 316, + JSDocEnumTag = 317, + JSDocParameterTag = 318, + JSDocReturnTag = 319, + JSDocThisTag = 320, + JSDocTypeTag = 321, + JSDocTemplateTag = 322, + JSDocTypedefTag = 323, + JSDocPropertyTag = 324, + SyntaxList = 325, + NotEmittedStatement = 326, + PartiallyEmittedExpression = 327, + CommaListExpression = 328, + MergeDeclarationMarker = 329, + EndOfDeclarationMarker = 330, + SyntheticReferenceExpression = 331, + Count = 332, FirstAssignment = 62, LastAssignment = 74, FirstCompoundAssignment = 63, @@ -414,15 +415,15 @@ declare namespace ts { FirstReservedWord = 77, LastReservedWord = 112, FirstKeyword = 77, - LastKeyword = 152, + LastKeyword = 153, FirstFutureReservedWord = 113, LastFutureReservedWord = 121, - FirstTypeNode = 168, - LastTypeNode = 188, + FirstTypeNode = 169, + LastTypeNode = 189, FirstPunctuation = 18, LastPunctuation = 74, FirstToken = 0, - LastToken = 152, + LastToken = 153, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -431,13 +432,13 @@ declare namespace ts { LastTemplateToken = 17, FirstBinaryOperator = 29, LastBinaryOperator = 74, - FirstStatement = 225, - LastStatement = 241, - FirstNode = 153, - FirstJSDocNode = 294, - LastJSDocNode = 323, - FirstJSDocTagNode = 306, - LastJSDocTagNode = 323, + FirstStatement = 226, + LastStatement = 242, + FirstNode = 154, + FirstJSDocNode = 295, + LastJSDocNode = 324, + FirstJSDocTagNode = 307, + LastJSDocTagNode = 324, } export enum NodeFlags { None = 0, @@ -844,7 +845,7 @@ declare namespace ts { } export interface TypeOperatorNode extends TypeNode { kind: SyntaxKind.TypeOperator; - operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword; + operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.AwaitedKeyword; type: TypeNode; } export interface IndexedAccessTypeNode extends TypeNode { @@ -1924,7 +1925,8 @@ declare namespace ts { /** @throws OperationCanceledException if isCancellationRequested is true */ throwIfCancellationRequested(): void; } - export interface Program extends ScriptReferenceHost { + export interface Program extends ScriptReferenceHost, ModuleSpecifierResolutionHost { + getCurrentDirectory(): string; /** * Get a list of root file names that were passed to a 'createProgram' */ @@ -2359,6 +2361,7 @@ declare namespace ts { Conditional = 16777216, Substitution = 33554432, NonPrimitive = 67108864, + Awaited = 134217728, Literal = 2944, Unit = 109440, StringOrNumberLiteral = 384, @@ -2373,11 +2376,11 @@ declare namespace ts { UnionOrIntersection = 3145728, StructuredType = 3670016, TypeVariable = 8650752, - InstantiableNonPrimitive = 58982400, + InstantiableNonPrimitive = 193200128, InstantiablePrimitive = 4194304, - Instantiable = 63176704, - StructuredOrInstantiable = 66846720, - Narrowable = 133970943, + Instantiable = 197394432, + StructuredOrInstantiable = 201064448, + Narrowable = 268188671, NotUnionOrUnit = 67637251, } export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; @@ -2522,9 +2525,12 @@ declare namespace ts { resolvedFalseType: Type; } export interface SubstitutionType extends InstantiableType { - typeVariable: TypeVariable; + baseType: Type; substitute: Type; } + export interface AwaitedType extends InstantiableType { + awaitedType: Type; + } export enum SignatureKind { Call = 0, Construct = 1 @@ -2917,7 +2923,7 @@ declare namespace ts { } export interface ResolvedTypeReferenceDirectiveWithFailedLookupLocations { readonly resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective | undefined; - readonly failedLookupLocations: readonly string[]; + readonly failedLookupLocations: string[]; } export interface CompilerHost extends ModuleResolutionHost { getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean): SourceFile | undefined; @@ -4070,7 +4076,7 @@ declare namespace ts { function updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode; function createThisTypeNode(): ThisTypeNode; function createTypeOperatorNode(type: TypeNode): TypeOperatorNode; - function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode; + function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.AwaitedKeyword, type: TypeNode): TypeOperatorNode; function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; function updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; @@ -4757,6 +4763,8 @@ declare namespace ts { resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[]; } interface WatchCompilerHost extends ProgramHost, WatchHost { + /** Instead of using output d.ts file from project reference, use its source file */ + useSourceOfProjectReferenceRedirect?(): boolean; /** If provided, callback to invoke after every new program creation */ afterProgramCreate?(program: T): void; } @@ -5136,25 +5144,88 @@ declare namespace ts { metadata?: unknown; }; interface LanguageService { + /** This is used as a part of restarting the language service. */ cleanupSemanticCache(): void; + /** + * Gets errors indicating invalid syntax in a file. + * + * In English, "this cdeo have, erorrs" is syntactically invalid because it has typos, + * grammatical errors, and misplaced punctuation. Likewise, examples of syntax + * errors in TypeScript are missing parentheses in an `if` statement, mismatched + * curly braces, and using a reserved keyword as a variable name. + * + * These diagnostics are inexpensive to compute and don't require knowledge of + * other files. Note that a non-empty result increases the likelihood of false positives + * from `getSemanticDiagnostics`. + * + * While these represent the majority of syntax-related diagnostics, there are some + * that require the type system, which will be present in `getSemanticDiagnostics`. + * + * @param fileName A path to the file you want syntactic diagnostics for + */ getSyntacticDiagnostics(fileName: string): DiagnosticWithLocation[]; - /** The first time this is called, it will return global diagnostics (no location). */ + /** + * Gets warnings or errors indicating type system issues in a given file. + * Requesting semantic diagnostics may start up the type system and + * run deferred work, so the first call may take longer than subsequent calls. + * + * Unlike the other get*Diagnostics functions, these diagnostics can potentially not + * include a reference to a source file. Specifically, the first time this is called, + * it will return global diagnostics with no associated location. + * + * To contrast the differences between semantic and syntactic diagnostics, consider the + * sentence: "The sun is green." is syntactically correct; those are real English words with + * correct sentence structure. However, it is semantically invalid, because it is not true. + * + * @param fileName A path to the file you want semantic diagnostics for + */ getSemanticDiagnostics(fileName: string): Diagnostic[]; - getSuggestionDiagnostics(fileName: string): DiagnosticWithLocation[]; - getCompilerOptionsDiagnostics(): Diagnostic[]; /** - * @deprecated Use getEncodedSyntacticClassifications instead. + * Gets suggestion diagnostics for a specific file. These diagnostics tend to + * proactively suggest refactors, as opposed to diagnostics that indicate + * potentially incorrect runtime behavior. + * + * @param fileName A path to the file you want semantic diagnostics for */ - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; + getSuggestionDiagnostics(fileName: string): DiagnosticWithLocation[]; /** - * @deprecated Use getEncodedSemanticClassifications instead. + * Gets global diagnostics related to the program configuration and compiler options. */ + getCompilerOptionsDiagnostics(): Diagnostic[]; + /** @deprecated Use getEncodedSyntacticClassifications instead. */ + getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; + /** @deprecated Use getEncodedSemanticClassifications instead. */ getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications; getEncodedSemanticClassifications(fileName: string, span: TextSpan): Classifications; + /** + * Gets completion entries at a particular position in a file. + * + * @param fileName The path to the file + * @param position A zero-based index of the character where you want the entries + * @param options An object describing how the request was triggered and what kinds + * of code actions can be returned with the completions. + */ getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined): WithMetadata | undefined; - getCompletionEntryDetails(fileName: string, position: number, name: string, formatOptions: FormatCodeOptions | FormatCodeSettings | undefined, source: string | undefined, preferences: UserPreferences | undefined): CompletionEntryDetails | undefined; + /** + * Gets the extended details for a completion entry retrieved from `getCompletionsAtPosition`. + * + * @param fileName The path to the file + * @param position A zero based index of the character where you want the entries + * @param entryName The name from an existing completion which came from `getCompletionsAtPosition` + * @param formatOptions How should code samples in the completions be formatted, can be undefined for backwards compatibility + * @param source Source code for the current file, can be undefined for backwards compatibility + * @param preferences User settings, can be undefined for backwards compatibility + */ + getCompletionEntryDetails(fileName: string, position: number, entryName: string, formatOptions: FormatCodeOptions | FormatCodeSettings | undefined, source: string | undefined, preferences: UserPreferences | undefined): CompletionEntryDetails | undefined; getCompletionEntrySymbol(fileName: string, position: number, name: string, source: string | undefined): Symbol | undefined; + /** + * Gets semantic information about the identifier at a particular position in a + * file. Quick info is what you typically see when you hover in an editor. + * + * @param fileName The path to the file + * @param position A zero-based index of the character where you want the quick info + */ getQuickInfoAtPosition(fileName: string, position: number): QuickInfo | undefined; getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan | undefined; getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan | undefined; @@ -5509,6 +5580,7 @@ declare namespace ts { newLineCharacter?: string; convertTabsToSpaces?: boolean; indentStyle?: IndentStyle; + trimTrailingWhitespace?: boolean; } interface FormatCodeOptions extends EditorOptions { InsertSpaceAfterCommaDelimiter: boolean; @@ -5538,6 +5610,7 @@ declare namespace ts { readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean; readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean; readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean; + readonly insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean; readonly insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean; readonly insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean; readonly insertSpaceAfterTypeAssertion?: boolean; @@ -8505,6 +8578,7 @@ declare namespace ts.server.protocol { newLineCharacter?: string; convertTabsToSpaces?: boolean; indentStyle?: IndentStyle | ts.IndentStyle; + trimTrailingWhitespace?: boolean; } interface FormatCodeSettings extends EditorSettings { insertSpaceAfterCommaDelimiter?: boolean; @@ -8921,37 +8995,10 @@ declare namespace ts.server { private typeAcquisition; private directoriesWatchedForWildcards; readonly canonicalConfigFilePath: NormalizedPath; - private projectReferenceCallbacks; - private mapOfDeclarationDirectories; - private symlinkedDirectories; - private symlinkedFiles; /** Ref count to the project when opened from external project */ private externalProjectRefCount; private projectErrors; private projectReferences; - private fileExistsIfProjectReferenceDts; - /** - * This implementation of fileExists checks if the file being requested is - * .d.ts file for the referenced Project. - * If it is it returns true irrespective of whether that file exists on host - */ - fileExists(file: string): boolean; - private directoryExistsIfProjectReferenceDeclDir; - /** - * This implementation of directoryExists checks if the directory being requested is - * directory of .d.ts file for the referenced Project. - * If it is it returns true irrespective of whether that directory exists on host - */ - directoryExists(path: string): boolean; - /** - * Call super.getDirectories only if directory actually present on the host - * This is needed to ensure that we arent getting directories that we fake about presence for - */ - getDirectories(path: string): string[]; - private realpathIfSymlinkedProjectReferenceDts; - private getRealpath; - private handleDirectoryCouldBeSymlink; - private fileOrDirectoryExistsUsingSource; /** * If the project has reload from disk pending, it reloads (and then updates graph as part of that) instead of just updating the graph * @returns: true if set of files in the project stays the same and false - otherwise. @@ -9309,14 +9356,12 @@ declare namespace ts.server { */ private getConfigFileNameForFile; private printProjects; - private findConfiguredProjectByProjectName; private getConfiguredProjectByCanonicalConfigFilePath; private findExternalProjectByProjectName; /** Get a filename if the language service exceeds the maximum allowed program size; otherwise returns undefined. */ private getFilenameForExceededTotalSizeLimitForNonTsFiles; private createExternalProject; private addFilesToNonInferredProject; - private createConfiguredProject; private updateNonInferredProjectFiles; private updateRootAndOptionsOfNonInferredProject; private sendConfigFileDiagEvent; diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index 852887766ede9..e693ffdb2f405 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -3203,233 +3203,234 @@ var ts; SyntaxKind[SyntaxKind["AnyKeyword"] = 125] = "AnyKeyword"; SyntaxKind[SyntaxKind["AsyncKeyword"] = 126] = "AsyncKeyword"; SyntaxKind[SyntaxKind["AwaitKeyword"] = 127] = "AwaitKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 128] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 129] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 130] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 131] = "GetKeyword"; - SyntaxKind[SyntaxKind["InferKeyword"] = 132] = "InferKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 133] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 134] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 135] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 136] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 137] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 138] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 139] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 140] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 141] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 142] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 143] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 144] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 145] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 146] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 147] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["UnknownKeyword"] = 148] = "UnknownKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 149] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 150] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["BigIntKeyword"] = 151] = "BigIntKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 152] = "OfKeyword"; + SyntaxKind[SyntaxKind["AwaitedKeyword"] = 128] = "AwaitedKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 129] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 130] = "ConstructorKeyword"; + SyntaxKind[SyntaxKind["DeclareKeyword"] = 131] = "DeclareKeyword"; + SyntaxKind[SyntaxKind["GetKeyword"] = 132] = "GetKeyword"; + SyntaxKind[SyntaxKind["InferKeyword"] = 133] = "InferKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 134] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 135] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 136] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 137] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 138] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 139] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 140] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 141] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 142] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 143] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 144] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 145] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 146] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 147] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 148] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["UnknownKeyword"] = 149] = "UnknownKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 150] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 151] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["BigIntKeyword"] = 152] = "BigIntKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 153] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 153] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 154] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 154] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 155] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 155] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 156] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 157] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 156] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 157] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 158] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 158] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 159] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 160] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 161] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 162] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 163] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 164] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 165] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 166] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 167] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 159] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 160] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 161] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 162] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 163] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 164] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 165] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 166] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 167] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 168] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 168] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 169] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 170] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 171] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 172] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 173] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 174] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 175] = "TupleType"; - SyntaxKind[SyntaxKind["OptionalType"] = 176] = "OptionalType"; - SyntaxKind[SyntaxKind["RestType"] = 177] = "RestType"; - SyntaxKind[SyntaxKind["UnionType"] = 178] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 179] = "IntersectionType"; - SyntaxKind[SyntaxKind["ConditionalType"] = 180] = "ConditionalType"; - SyntaxKind[SyntaxKind["InferType"] = 181] = "InferType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 182] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 183] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 184] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 185] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 186] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 187] = "LiteralType"; - SyntaxKind[SyntaxKind["ImportType"] = 188] = "ImportType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 169] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 170] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 171] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 172] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 173] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 174] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 175] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 176] = "TupleType"; + SyntaxKind[SyntaxKind["OptionalType"] = 177] = "OptionalType"; + SyntaxKind[SyntaxKind["RestType"] = 178] = "RestType"; + SyntaxKind[SyntaxKind["UnionType"] = 179] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 180] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 181] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 182] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 183] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 184] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 185] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 186] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 187] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 188] = "LiteralType"; + SyntaxKind[SyntaxKind["ImportType"] = 189] = "ImportType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 189] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 190] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 191] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 190] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 191] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 192] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 192] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 193] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 194] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 195] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 196] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 197] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 198] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 199] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 200] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 201] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 202] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 203] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 204] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 205] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 206] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 207] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 208] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 209] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 210] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 211] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 212] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 213] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 214] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 215] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 216] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 217] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 218] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 219] = "MetaProperty"; - SyntaxKind[SyntaxKind["SyntheticExpression"] = 220] = "SyntheticExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 193] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 194] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 195] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 196] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 197] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 198] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 199] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 200] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 201] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 202] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 203] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 204] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 205] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 206] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 207] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 208] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 209] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 210] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 211] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 212] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 213] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 214] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 215] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 216] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 217] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 218] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 219] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 220] = "MetaProperty"; + SyntaxKind[SyntaxKind["SyntheticExpression"] = 221] = "SyntheticExpression"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 221] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 222] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 222] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 223] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 223] = "Block"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 224] = "EmptyStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 225] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 226] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 227] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 228] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 229] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 230] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 231] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 232] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 233] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 234] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 235] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 236] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 237] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 238] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 239] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 240] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 241] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 242] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 243] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 244] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 245] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 246] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 247] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 248] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 249] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 250] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 251] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 252] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 253] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 254] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 255] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 256] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 257] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 258] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 259] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 260] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 261] = "NamedExports"; - SyntaxKind[SyntaxKind["NamespaceExport"] = 262] = "NamespaceExport"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 263] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 264] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 224] = "Block"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 225] = "EmptyStatement"; + SyntaxKind[SyntaxKind["VariableStatement"] = 226] = "VariableStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 227] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 228] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 229] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 230] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 231] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 232] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 233] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 234] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 235] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 236] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 237] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 238] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 239] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 240] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 241] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 242] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 243] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 244] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 245] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 246] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 247] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 248] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 249] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 250] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 251] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 252] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 253] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 254] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 255] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 256] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 257] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 258] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 259] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 260] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 261] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 262] = "NamedExports"; + SyntaxKind[SyntaxKind["NamespaceExport"] = 263] = "NamespaceExport"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 264] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 265] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 265] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 266] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 266] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 267] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 268] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 269] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 270] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 271] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 272] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 273] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 274] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 275] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 276] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 267] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 268] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 269] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 270] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 271] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 272] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 273] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 274] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 275] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 276] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 277] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 277] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 278] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 279] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 280] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 278] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 279] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 280] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 281] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 281] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 282] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 283] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 282] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 283] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 284] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 284] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 285] = "EnumMember"; // Unparsed - SyntaxKind[SyntaxKind["UnparsedPrologue"] = 285] = "UnparsedPrologue"; - SyntaxKind[SyntaxKind["UnparsedPrepend"] = 286] = "UnparsedPrepend"; - SyntaxKind[SyntaxKind["UnparsedText"] = 287] = "UnparsedText"; - SyntaxKind[SyntaxKind["UnparsedInternalText"] = 288] = "UnparsedInternalText"; - SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 289] = "UnparsedSyntheticReference"; + SyntaxKind[SyntaxKind["UnparsedPrologue"] = 286] = "UnparsedPrologue"; + SyntaxKind[SyntaxKind["UnparsedPrepend"] = 287] = "UnparsedPrepend"; + SyntaxKind[SyntaxKind["UnparsedText"] = 288] = "UnparsedText"; + SyntaxKind[SyntaxKind["UnparsedInternalText"] = 289] = "UnparsedInternalText"; + SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 290] = "UnparsedSyntheticReference"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 290] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 291] = "Bundle"; - SyntaxKind[SyntaxKind["UnparsedSource"] = 292] = "UnparsedSource"; - SyntaxKind[SyntaxKind["InputFiles"] = 293] = "InputFiles"; + SyntaxKind[SyntaxKind["SourceFile"] = 291] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 292] = "Bundle"; + SyntaxKind[SyntaxKind["UnparsedSource"] = 293] = "UnparsedSource"; + SyntaxKind[SyntaxKind["InputFiles"] = 294] = "InputFiles"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 294] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 295] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 295] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 296] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 296] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 297] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 298] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 299] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 300] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 301] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 297] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 298] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 299] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 300] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 301] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 302] = "JSDocVariadicType"; // https://jsdoc.app/about-namepaths.html - SyntaxKind[SyntaxKind["JSDocNamepathType"] = 302] = "JSDocNamepathType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 303] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 304] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocSignature"] = 305] = "JSDocSignature"; - SyntaxKind[SyntaxKind["JSDocTag"] = 306] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 307] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 308] = "JSDocImplementsTag"; - SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 309] = "JSDocAuthorTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 310] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocPublicTag"] = 311] = "JSDocPublicTag"; - SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 312] = "JSDocPrivateTag"; - SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 313] = "JSDocProtectedTag"; - SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 314] = "JSDocReadonlyTag"; - SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 315] = "JSDocCallbackTag"; - SyntaxKind[SyntaxKind["JSDocEnumTag"] = 316] = "JSDocEnumTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 317] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 318] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocThisTag"] = 319] = "JSDocThisTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 320] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 321] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 322] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 323] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocNamepathType"] = 303] = "JSDocNamepathType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 304] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 305] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocSignature"] = 306] = "JSDocSignature"; + SyntaxKind[SyntaxKind["JSDocTag"] = 307] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 308] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 309] = "JSDocImplementsTag"; + SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 310] = "JSDocAuthorTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 311] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocPublicTag"] = 312] = "JSDocPublicTag"; + SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 313] = "JSDocPrivateTag"; + SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 314] = "JSDocProtectedTag"; + SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 315] = "JSDocReadonlyTag"; + SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 316] = "JSDocCallbackTag"; + SyntaxKind[SyntaxKind["JSDocEnumTag"] = 317] = "JSDocEnumTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 318] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 319] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocThisTag"] = 320] = "JSDocThisTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 321] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 322] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 323] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 324] = "JSDocPropertyTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 324] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 325] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 325] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 326] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 327] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 328] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 329] = "EndOfDeclarationMarker"; - SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 330] = "SyntheticReferenceExpression"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 326] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 327] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 328] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 329] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 330] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 331] = "SyntheticReferenceExpression"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 331] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 332] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 62] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 74] = "LastAssignment"; @@ -3438,15 +3439,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 77] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 112] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 77] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 152] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 153] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 113] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 121] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 168] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 188] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 169] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 189] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 18] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 74] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 152] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 153] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -3455,15 +3456,15 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 17] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 29] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 74] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstStatement"] = 225] = "FirstStatement"; - SyntaxKind[SyntaxKind["LastStatement"] = 241] = "LastStatement"; - SyntaxKind[SyntaxKind["FirstNode"] = 153] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 294] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 323] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 306] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 323] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstStatement"] = 226] = "FirstStatement"; + SyntaxKind[SyntaxKind["LastStatement"] = 242] = "LastStatement"; + SyntaxKind[SyntaxKind["FirstNode"] = 154] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 295] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 324] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 307] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 324] = "LastJSDocTagNode"; /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 122] = "FirstContextualKeyword"; - /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 152] = "LastContextualKeyword"; + /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 153] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -3619,6 +3620,12 @@ var ts; FlowFlags[FlowFlags["Label"] = 12] = "Label"; FlowFlags[FlowFlags["Condition"] = 96] = "Condition"; })(FlowFlags = ts.FlowFlags || (ts.FlowFlags = {})); + /* @internal */ + var CommentDirectiveType; + (function (CommentDirectiveType) { + CommentDirectiveType[CommentDirectiveType["ExpectError"] = 0] = "ExpectError"; + CommentDirectiveType[CommentDirectiveType["Ignore"] = 1] = "Ignore"; + })(CommentDirectiveType = ts.CommentDirectiveType || (ts.CommentDirectiveType = {})); var OperationCanceledException = /** @class */ (function () { function OperationCanceledException() { } @@ -4003,6 +4010,7 @@ var ts; TypeFlags[TypeFlags["Conditional"] = 16777216] = "Conditional"; TypeFlags[TypeFlags["Substitution"] = 33554432] = "Substitution"; TypeFlags[TypeFlags["NonPrimitive"] = 67108864] = "NonPrimitive"; + TypeFlags[TypeFlags["Awaited"] = 134217728] = "Awaited"; /* @internal */ TypeFlags[TypeFlags["AnyOrUnknown"] = 3] = "AnyOrUnknown"; /* @internal */ @@ -4031,10 +4039,10 @@ var ts; TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType"; TypeFlags[TypeFlags["TypeVariable"] = 8650752] = "TypeVariable"; - TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 58982400] = "InstantiableNonPrimitive"; + TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 193200128] = "InstantiableNonPrimitive"; TypeFlags[TypeFlags["InstantiablePrimitive"] = 4194304] = "InstantiablePrimitive"; - TypeFlags[TypeFlags["Instantiable"] = 63176704] = "Instantiable"; - TypeFlags[TypeFlags["StructuredOrInstantiable"] = 66846720] = "StructuredOrInstantiable"; + TypeFlags[TypeFlags["Instantiable"] = 197394432] = "Instantiable"; + TypeFlags[TypeFlags["StructuredOrInstantiable"] = 201064448] = "StructuredOrInstantiable"; /* @internal */ TypeFlags[TypeFlags["ObjectFlagsType"] = 3899393] = "ObjectFlagsType"; /* @internal */ @@ -4043,10 +4051,10 @@ var ts; TypeFlags[TypeFlags["Substructure"] = 66584576] = "Substructure"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 133970943] = "Narrowable"; + TypeFlags[TypeFlags["Narrowable"] = 268188671] = "Narrowable"; TypeFlags[TypeFlags["NotUnionOrUnit"] = 67637251] = "NotUnionOrUnit"; /* @internal */ - TypeFlags[TypeFlags["NotPrimitiveUnion"] = 66994211] = "NotPrimitiveUnion"; + TypeFlags[TypeFlags["NotPrimitiveUnion"] = 201211939] = "NotPrimitiveUnion"; // The following flags are aggregated during union and intersection type construction /* @internal */ TypeFlags[TypeFlags["IncludesMask"] = 71041023] = "IncludesMask"; @@ -4145,6 +4153,7 @@ var ts; SignatureFlags[SignatureFlags["HasLiteralTypes"] = 2] = "HasLiteralTypes"; SignatureFlags[SignatureFlags["IsInnerCallChain"] = 4] = "IsInnerCallChain"; SignatureFlags[SignatureFlags["IsOuterCallChain"] = 8] = "IsOuterCallChain"; + SignatureFlags[SignatureFlags["IsUntypedSignatureInJSFile"] = 16] = "IsUntypedSignatureInJSFile"; // We do not propagate `IsInnerCallChain` to instantiated signatures, as that would result in us // attempting to add `| undefined` on each recursive call to `getReturnTypeOfSignature` when // instantiating the return type. @@ -4156,6 +4165,15 @@ var ts; IndexKind[IndexKind["String"] = 0] = "String"; IndexKind[IndexKind["Number"] = 1] = "Number"; })(IndexKind = ts.IndexKind || (ts.IndexKind = {})); + /* @internal */ + var TypeMapKind; + (function (TypeMapKind) { + TypeMapKind[TypeMapKind["Simple"] = 0] = "Simple"; + TypeMapKind[TypeMapKind["Array"] = 1] = "Array"; + TypeMapKind[TypeMapKind["Function"] = 2] = "Function"; + TypeMapKind[TypeMapKind["Composite"] = 3] = "Composite"; + TypeMapKind[TypeMapKind["Merged"] = 4] = "Merged"; + })(TypeMapKind = ts.TypeMapKind || (ts.TypeMapKind = {})); var InferencePriority; (function (InferencePriority) { InferencePriority[InferencePriority["NakedTypeVariable"] = 1] = "NakedTypeVariable"; @@ -6749,6 +6767,10 @@ var ts; } } ts.forEachAncestorDirectory = forEachAncestorDirectory; + function isNodeModulesDirectory(dirPath) { + return ts.endsWith(dirPath, "/node_modules"); + } + ts.isNodeModulesDirectory = isNodeModulesDirectory; })(ts || (ts = {})); // // generated from './diagnosticInformationMap.generated.ts' by 'src/compiler' @@ -7059,7 +7081,7 @@ var ts; Cannot_find_name_0: diag(2304, ts.DiagnosticCategory.Error, "Cannot_find_name_0_2304", "Cannot find name '{0}'."), Module_0_has_no_exported_member_1: diag(2305, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_2305", "Module '{0}' has no exported member '{1}'."), File_0_is_not_a_module: diag(2306, ts.DiagnosticCategory.Error, "File_0_is_not_a_module_2306", "File '{0}' is not a module."), - Cannot_find_module_0: diag(2307, ts.DiagnosticCategory.Error, "Cannot_find_module_0_2307", "Cannot find module '{0}'."), + Cannot_find_module_0_or_its_corresponding_type_declarations: diag(2307, ts.DiagnosticCategory.Error, "Cannot_find_module_0_or_its_corresponding_type_declarations_2307", "Cannot find module '{0}' or its corresponding type declarations."), Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: diag(2308, ts.DiagnosticCategory.Error, "Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308", "Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."), An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: diag(2309, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", "An export assignment cannot be used in a module with other exported elements."), Type_0_recursively_references_itself_as_a_base_type: diag(2310, ts.DiagnosticCategory.Error, "Type_0_recursively_references_itself_as_a_base_type_2310", "Type '{0}' recursively references itself as a base type."), @@ -7319,6 +7341,7 @@ var ts; No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments: diag(2575, ts.DiagnosticCategory.Error, "No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575", "No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."), Property_0_is_a_static_member_of_type_1: diag(2576, ts.DiagnosticCategory.Error, "Property_0_is_a_static_member_of_type_1_2576", "Property '{0}' is a static member of type '{1}'"), Return_type_annotation_circularly_references_itself: diag(2577, ts.DiagnosticCategory.Error, "Return_type_annotation_circularly_references_itself_2577", "Return type annotation circularly references itself."), + Unused_ts_expect_error_directive: diag(2578, ts.DiagnosticCategory.Error, "Unused_ts_expect_error_directive_2578", "Unused '@ts-expect-error' directive."), Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`."), Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`."), Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`."), @@ -7447,7 +7470,7 @@ var ts; This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided: diag(2746, ts.DiagnosticCategory.Error, "This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746", "This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."), _0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2: diag(2747, ts.DiagnosticCategory.Error, "_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747", "'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."), Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided: diag(2748, ts.DiagnosticCategory.Error, "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748", "Cannot access ambient const enums when the '--isolatedModules' flag is provided."), - _0_refers_to_a_value_but_is_being_used_as_a_type_here: diag(2749, ts.DiagnosticCategory.Error, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_2749", "'{0}' refers to a value, but is being used as a type here."), + _0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0: diag(2749, ts.DiagnosticCategory.Error, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749", "'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"), The_implementation_signature_is_declared_here: diag(2750, ts.DiagnosticCategory.Error, "The_implementation_signature_is_declared_here_2750", "The implementation signature is declared here."), Circularity_originates_in_type_at_this_location: diag(2751, ts.DiagnosticCategory.Error, "Circularity_originates_in_type_at_this_location_2751", "Circularity originates in type at this location."), The_first_export_default_is_here: diag(2752, ts.DiagnosticCategory.Error, "The_first_export_default_is_here_2752", "The first export default is here."), @@ -7482,6 +7505,7 @@ var ts; The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access: diag(2781, ts.DiagnosticCategory.Error, "The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781", "The left-hand side of a 'for...of' statement may not be an optional property access."), _0_needs_an_explicit_type_annotation: diag(2782, ts.DiagnosticCategory.Message, "_0_needs_an_explicit_type_annotation_2782", "'{0}' needs an explicit type annotation."), _0_is_specified_more_than_once_so_this_usage_will_be_overwritten: diag(2783, ts.DiagnosticCategory.Error, "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783", "'{0}' is specified more than once, so this usage will be overwritten."), + get_and_set_accessors_cannot_declare_this_parameters: diag(2784, ts.DiagnosticCategory.Error, "get_and_set_accessors_cannot_declare_this_parameters_2784", "'get' and 'set' accessors cannot declare 'this' parameters."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -7616,6 +7640,7 @@ var ts; Unknown_watch_option_0_Did_you_mean_1: diag(5079, ts.DiagnosticCategory.Error, "Unknown_watch_option_0_Did_you_mean_1_5079", "Unknown watch option '{0}'. Did you mean '{1}'?"), Watch_option_0_requires_a_value_of_type_1: diag(5080, ts.DiagnosticCategory.Error, "Watch_option_0_requires_a_value_of_type_1_5080", "Watch option '{0}' requires a value of type {1}."), Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0: diag(5081, ts.DiagnosticCategory.Error, "Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081", "Cannot find a tsconfig.json file at the current directory: {0}."), + _0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1: diag(5082, ts.DiagnosticCategory.Error, "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082", "'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6000, ts.DiagnosticCategory.Message, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, ts.DiagnosticCategory.Message, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, ts.DiagnosticCategory.Message, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -8028,6 +8053,7 @@ var ts; Import_default_0_from_module_1: diag(90032, ts.DiagnosticCategory.Message, "Import_default_0_from_module_1_90032", "Import default '{0}' from module \"{1}\""), Add_default_import_0_to_existing_import_declaration_from_1: diag(90033, ts.DiagnosticCategory.Message, "Add_default_import_0_to_existing_import_declaration_from_1_90033", "Add default import '{0}' to existing import declaration from \"{1}\""), Add_parameter_name: diag(90034, ts.DiagnosticCategory.Message, "Add_parameter_name_90034", "Add parameter name"), + Declare_private_property_0: diag(90035, ts.DiagnosticCategory.Message, "Declare_private_property_0_90035", "Declare private property '{0}'"), Declare_a_private_field_named_0: diag(90053, ts.DiagnosticCategory.Message, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), @@ -8093,6 +8119,8 @@ var ts; Add_all_missing_imports: diag(95064, ts.DiagnosticCategory.Message, "Add_all_missing_imports_95064", "Add all missing imports"), Convert_to_async_function: diag(95065, ts.DiagnosticCategory.Message, "Convert_to_async_function_95065", "Convert to async function"), Convert_all_to_async_functions: diag(95066, ts.DiagnosticCategory.Message, "Convert_all_to_async_functions_95066", "Convert all to async functions"), + Add_missing_call_parentheses: diag(95067, ts.DiagnosticCategory.Message, "Add_missing_call_parentheses_95067", "Add missing call parentheses"), + Add_all_missing_call_parentheses: diag(95068, ts.DiagnosticCategory.Message, "Add_all_missing_call_parentheses_95068", "Add all missing call parentheses"), Add_unknown_conversion_for_non_overlapping_types: diag(95069, ts.DiagnosticCategory.Message, "Add_unknown_conversion_for_non_overlapping_types_95069", "Add 'unknown' conversion for non-overlapping types"), Add_unknown_to_all_conversions_of_non_overlapping_types: diag(95070, ts.DiagnosticCategory.Message, "Add_unknown_to_all_conversions_of_non_overlapping_types_95070", "Add 'unknown' to all conversions of non-overlapping types"), Add_missing_new_operator_to_call: diag(95071, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_call_95071", "Add missing 'new' operator to call"), @@ -8168,8 +8196,8 @@ var ts; any: 125 /* AnyKeyword */, as: 123 /* AsKeyword */, asserts: 124 /* AssertsKeyword */, - bigint: 151 /* BigIntKeyword */, - boolean: 128 /* BooleanKeyword */, + bigint: 152 /* BigIntKeyword */, + boolean: 129 /* BooleanKeyword */, break: 77 /* BreakKeyword */, case: 78 /* CaseKeyword */, catch: 79 /* CatchKeyword */, @@ -8177,9 +8205,9 @@ var ts; continue: 82 /* ContinueKeyword */, const: 81 /* ConstKeyword */ }, - _a["" + "constructor"] = 129 /* ConstructorKeyword */, + _a["" + "constructor"] = 130 /* ConstructorKeyword */, _a.debugger = 83 /* DebuggerKeyword */, - _a.declare = 130 /* DeclareKeyword */, + _a.declare = 131 /* DeclareKeyword */, _a.default = 84 /* DefaultKeyword */, _a.delete = 85 /* DeleteKeyword */, _a.do = 86 /* DoKeyword */, @@ -8190,49 +8218,49 @@ var ts; _a.false = 91 /* FalseKeyword */, _a.finally = 92 /* FinallyKeyword */, _a.for = 93 /* ForKeyword */, - _a.from = 149 /* FromKeyword */, + _a.from = 150 /* FromKeyword */, _a.function = 94 /* FunctionKeyword */, - _a.get = 131 /* GetKeyword */, + _a.get = 132 /* GetKeyword */, _a.if = 95 /* IfKeyword */, _a.implements = 113 /* ImplementsKeyword */, _a.import = 96 /* ImportKeyword */, _a.in = 97 /* InKeyword */, - _a.infer = 132 /* InferKeyword */, + _a.infer = 133 /* InferKeyword */, _a.instanceof = 98 /* InstanceOfKeyword */, _a.interface = 114 /* InterfaceKeyword */, - _a.is = 133 /* IsKeyword */, - _a.keyof = 134 /* KeyOfKeyword */, + _a.is = 134 /* IsKeyword */, + _a.keyof = 135 /* KeyOfKeyword */, _a.let = 115 /* LetKeyword */, - _a.module = 135 /* ModuleKeyword */, - _a.namespace = 136 /* NamespaceKeyword */, - _a.never = 137 /* NeverKeyword */, + _a.module = 136 /* ModuleKeyword */, + _a.namespace = 137 /* NamespaceKeyword */, + _a.never = 138 /* NeverKeyword */, _a.new = 99 /* NewKeyword */, _a.null = 100 /* NullKeyword */, - _a.number = 140 /* NumberKeyword */, - _a.object = 141 /* ObjectKeyword */, + _a.number = 141 /* NumberKeyword */, + _a.object = 142 /* ObjectKeyword */, _a.package = 116 /* PackageKeyword */, _a.private = 117 /* PrivateKeyword */, _a.protected = 118 /* ProtectedKeyword */, _a.public = 119 /* PublicKeyword */, - _a.readonly = 138 /* ReadonlyKeyword */, - _a.require = 139 /* RequireKeyword */, - _a.global = 150 /* GlobalKeyword */, + _a.readonly = 139 /* ReadonlyKeyword */, + _a.require = 140 /* RequireKeyword */, + _a.global = 151 /* GlobalKeyword */, _a.return = 101 /* ReturnKeyword */, - _a.set = 142 /* SetKeyword */, + _a.set = 143 /* SetKeyword */, _a.static = 120 /* StaticKeyword */, - _a.string = 143 /* StringKeyword */, + _a.string = 144 /* StringKeyword */, _a.super = 102 /* SuperKeyword */, _a.switch = 103 /* SwitchKeyword */, - _a.symbol = 144 /* SymbolKeyword */, + _a.symbol = 145 /* SymbolKeyword */, _a.this = 104 /* ThisKeyword */, _a.throw = 105 /* ThrowKeyword */, _a.true = 106 /* TrueKeyword */, _a.try = 107 /* TryKeyword */, - _a.type = 145 /* TypeKeyword */, + _a.type = 146 /* TypeKeyword */, _a.typeof = 108 /* TypeOfKeyword */, - _a.undefined = 146 /* UndefinedKeyword */, - _a.unique = 147 /* UniqueKeyword */, - _a.unknown = 148 /* UnknownKeyword */, + _a.undefined = 147 /* UndefinedKeyword */, + _a.unique = 148 /* UniqueKeyword */, + _a.unknown = 149 /* UnknownKeyword */, _a.var = 109 /* VarKeyword */, _a.void = 110 /* VoidKeyword */, _a.while = 111 /* WhileKeyword */, @@ -8240,7 +8268,8 @@ var ts; _a.yield = 121 /* YieldKeyword */, _a.async = 126 /* AsyncKeyword */, _a.await = 127 /* AwaitKeyword */, - _a.of = 152 /* OfKeyword */, + _a.awaited = 128 /* AwaitedKeyword */, + _a.of = 153 /* OfKeyword */, _a); var textToKeyword = ts.createMapFromTemplate(textToKeywordObj); var textToToken = ts.createMapFromTemplate(__assign(__assign({}, textToKeywordObj), { "{": 18 /* OpenBraceToken */, "}": 19 /* CloseBraceToken */, "(": 20 /* OpenParenToken */, ")": 21 /* CloseParenToken */, "[": 22 /* OpenBracketToken */, "]": 23 /* CloseBracketToken */, ".": 24 /* DotToken */, "...": 25 /* DotDotDotToken */, ";": 26 /* SemicolonToken */, ",": 27 /* CommaToken */, "<": 29 /* LessThanToken */, ">": 31 /* GreaterThanToken */, "<=": 32 /* LessThanEqualsToken */, ">=": 33 /* GreaterThanEqualsToken */, "==": 34 /* EqualsEqualsToken */, "!=": 35 /* ExclamationEqualsToken */, "===": 36 /* EqualsEqualsEqualsToken */, "!==": 37 /* ExclamationEqualsEqualsToken */, "=>": 38 /* EqualsGreaterThanToken */, "+": 39 /* PlusToken */, "-": 40 /* MinusToken */, "**": 42 /* AsteriskAsteriskToken */, "*": 41 /* AsteriskToken */, "/": 43 /* SlashToken */, "%": 44 /* PercentToken */, "++": 45 /* PlusPlusToken */, "--": 46 /* MinusMinusToken */, "<<": 47 /* LessThanLessThanToken */, ">": 48 /* GreaterThanGreaterThanToken */, ">>>": 49 /* GreaterThanGreaterThanGreaterThanToken */, "&": 50 /* AmpersandToken */, "|": 51 /* BarToken */, "^": 52 /* CaretToken */, "!": 53 /* ExclamationToken */, "~": 54 /* TildeToken */, "&&": 55 /* AmpersandAmpersandToken */, "||": 56 /* BarBarToken */, "?": 57 /* QuestionToken */, "??": 60 /* QuestionQuestionToken */, "?.": 28 /* QuestionDotToken */, ":": 58 /* ColonToken */, "=": 62 /* EqualsToken */, "+=": 63 /* PlusEqualsToken */, "-=": 64 /* MinusEqualsToken */, "*=": 65 /* AsteriskEqualsToken */, "**=": 66 /* AsteriskAsteriskEqualsToken */, "/=": 67 /* SlashEqualsToken */, "%=": 68 /* PercentEqualsToken */, "<<=": 69 /* LessThanLessThanEqualsToken */, ">>=": 70 /* GreaterThanGreaterThanEqualsToken */, ">>>=": 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */, "&=": 72 /* AmpersandEqualsToken */, "|=": 73 /* BarEqualsToken */, "^=": 74 /* CaretEqualsToken */, "@": 59 /* AtToken */, "`": 61 /* BacktickToken */ })); @@ -8298,6 +8327,10 @@ var ts; */ var unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 895, 895, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1488, 1514, 1519, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2144, 2154, 2208, 2228, 2230, 2237, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2432, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2556, 2556, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2809, 2809, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3133, 3160, 3162, 3168, 3169, 3200, 3200, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3412, 3414, 3423, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6264, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6430, 6480, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7401, 7404, 7406, 7411, 7413, 7414, 7418, 7418, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12443, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42653, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43261, 43262, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43488, 43492, 43494, 43503, 43514, 43518, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43646, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66335, 66349, 66378, 66384, 66421, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68096, 68112, 68115, 68117, 68119, 68121, 68149, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68324, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68899, 69376, 69404, 69415, 69415, 69424, 69445, 69600, 69622, 69635, 69687, 69763, 69807, 69840, 69864, 69891, 69926, 69956, 69956, 69968, 70002, 70006, 70006, 70019, 70066, 70081, 70084, 70106, 70106, 70108, 70108, 70144, 70161, 70163, 70187, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70366, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70461, 70461, 70480, 70480, 70493, 70497, 70656, 70708, 70727, 70730, 70751, 70751, 70784, 70831, 70852, 70853, 70855, 70855, 71040, 71086, 71128, 71131, 71168, 71215, 71236, 71236, 71296, 71338, 71352, 71352, 71424, 71450, 71680, 71723, 71840, 71903, 71935, 71935, 72096, 72103, 72106, 72144, 72161, 72161, 72163, 72163, 72192, 72192, 72203, 72242, 72250, 72250, 72272, 72272, 72284, 72329, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72750, 72768, 72768, 72818, 72847, 72960, 72966, 72968, 72969, 72971, 73008, 73030, 73030, 73056, 73061, 73063, 73064, 73066, 73097, 73112, 73112, 73440, 73458, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92880, 92909, 92928, 92975, 92992, 92995, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94032, 94032, 94099, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 123136, 123180, 123191, 123197, 123214, 123214, 123584, 123627, 124928, 125124, 125184, 125251, 125259, 125259, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101]; var unicodeESNextIdentifierPart = [48, 57, 65, 90, 95, 95, 97, 122, 170, 170, 181, 181, 183, 183, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 895, 895, 902, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1519, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2045, 2045, 2048, 2093, 2112, 2139, 2144, 2154, 2208, 2228, 2230, 2237, 2259, 2273, 2275, 2403, 2406, 2415, 2417, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2556, 2556, 2558, 2558, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2809, 2815, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3072, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3168, 3171, 3174, 3183, 3200, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3328, 3331, 3333, 3340, 3342, 3344, 3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3558, 3567, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4969, 4977, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6264, 6272, 6314, 6320, 6389, 6400, 6430, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6832, 6845, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418, 7424, 7673, 7675, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42737, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43047, 43072, 43123, 43136, 43205, 43216, 43225, 43232, 43255, 43259, 43259, 43261, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43488, 43518, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65071, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66045, 66045, 66176, 66204, 66208, 66256, 66272, 66272, 66304, 66335, 66349, 66378, 66384, 66426, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68099, 68101, 68102, 68108, 68115, 68117, 68119, 68121, 68149, 68152, 68154, 68159, 68159, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68326, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68903, 68912, 68921, 69376, 69404, 69415, 69415, 69424, 69456, 69600, 69622, 69632, 69702, 69734, 69743, 69759, 69818, 69840, 69864, 69872, 69881, 69888, 69940, 69942, 69951, 69956, 69958, 69968, 70003, 70006, 70006, 70016, 70084, 70089, 70092, 70096, 70106, 70108, 70108, 70144, 70161, 70163, 70199, 70206, 70206, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70378, 70384, 70393, 70400, 70403, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70459, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70730, 70736, 70745, 70750, 70751, 70784, 70853, 70855, 70855, 70864, 70873, 71040, 71093, 71096, 71104, 71128, 71133, 71168, 71232, 71236, 71236, 71248, 71257, 71296, 71352, 71360, 71369, 71424, 71450, 71453, 71467, 71472, 71481, 71680, 71738, 71840, 71913, 71935, 71935, 72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263, 72263, 72272, 72345, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72758, 72760, 72768, 72784, 72793, 72818, 72847, 72850, 72871, 72873, 72886, 72960, 72966, 72968, 72969, 72971, 73014, 73018, 73018, 73020, 73021, 73023, 73031, 73040, 73049, 73056, 73061, 73063, 73064, 73066, 73102, 73104, 73105, 73107, 73112, 73120, 73129, 73440, 73462, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 92880, 92909, 92912, 92916, 92928, 92982, 92992, 92995, 93008, 93017, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94031, 94087, 94095, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113821, 113822, 119141, 119145, 119149, 119154, 119163, 119170, 119173, 119179, 119210, 119213, 119362, 119364, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 120782, 120831, 121344, 121398, 121403, 121452, 121461, 121461, 121476, 121476, 121499, 121503, 121505, 121519, 122880, 122886, 122888, 122904, 122907, 122913, 122915, 122916, 122918, 122922, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123214, 123584, 123641, 124928, 125124, 125136, 125142, 125184, 125259, 125264, 125273, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 917760, 917999]; + /** + * Test for whether a comment's text contains a `@ts-expect-error` or `@ts-ignore` directive. + */ + var commentDirectiveRegEx = /^\s*\/\/\/?\s*@(ts-expect-error|ts-ignore)/; function lookupInUnicodeMap(code, map) { // Bail out quickly if it couldn't possibly be in the map. if (code < map[0]) { @@ -8864,6 +8897,7 @@ var ts; var token; var tokenValue; var tokenFlags; + var commentDirectives; var inJSDocType = 0; setText(text, start, length); var scanner = { @@ -8879,6 +8913,7 @@ var ts; isIdentifier: function () { return token === 75 /* Identifier */ || token > 112 /* LastReservedWord */; }, isReservedWord: function () { return token >= 77 /* FirstReservedWord */ && token <= 112 /* LastReservedWord */; }, isUnterminated: function () { return (tokenFlags & 4 /* Unterminated */) !== 0; }, + getCommentDirectives: function () { return commentDirectives; }, getTokenFlags: function () { return tokenFlags; }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, @@ -8894,6 +8929,7 @@ var ts; scanJsDocToken: scanJsDocToken, scan: scan, getText: getText, + clearCommentDirectives: clearCommentDirectives, setText: setText, setScriptTarget: setScriptTarget, setLanguageVariant: setLanguageVariant, @@ -9623,6 +9659,13 @@ var ts; } pos++; } + var type = getDirectiveFromComment(text.slice(tokenPos, pos)); + if (type !== undefined) { + commentDirectives = ts.append(commentDirectives, { + range: { pos: tokenPos, end: pos }, + type: type, + }); + } if (skipTrivia) { continue; } @@ -9977,6 +10020,19 @@ var ts; } return token; } + function getDirectiveFromComment(text) { + var match = commentDirectiveRegEx.exec(text); + if (!match) { + return undefined; + } + switch (match[1]) { + case "ts-expect-error": + return 0 /* ExpectError */; + case "ts-ignore": + return 1 /* Ignore */; + } + return undefined; + } /** * Unconditionally back up and scan a template expression portion. */ @@ -10216,6 +10272,7 @@ var ts; var saveToken = token; var saveTokenValue = tokenValue; var saveTokenFlags = tokenFlags; + var saveErrorExpectations = commentDirectives; setText(text, start, length); var result = callback(); end = saveEnd; @@ -10225,6 +10282,7 @@ var ts; token = saveToken; tokenValue = saveTokenValue; tokenFlags = saveTokenFlags; + commentDirectives = saveErrorExpectations; return result; } function lookAhead(callback) { @@ -10236,6 +10294,9 @@ var ts; function getText() { return text; } + function clearCommentDirectives() { + commentDirectives = undefined; + } function setText(newText, start, length) { text = newText || ""; end = length === undefined ? text.length : start + length; @@ -10543,9 +10604,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 155 /* TypeParameter */) { + if (d && d.kind === 156 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 246 /* InterfaceDeclaration */) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 247 /* InterfaceDeclaration */) { return current; } } @@ -10553,7 +10614,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node, parent) { - return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 162 /* Constructor */; + return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 163 /* Constructor */; } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -10583,14 +10644,14 @@ var ts; node = walkUpBindingElementsAndPatterns(node); } var flags = getFlags(node); - if (node.kind === 242 /* VariableDeclaration */) { + if (node.kind === 243 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 243 /* VariableDeclarationList */) { + if (node && node.kind === 244 /* VariableDeclarationList */) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 225 /* VariableStatement */) { + if (node && node.kind === 226 /* VariableStatement */) { flags |= getFlags(node); } return flags; @@ -10739,30 +10800,30 @@ var ts; } // Covers remaining cases (returning undefined if none match). switch (hostNode.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: var expr = hostNode.expression; - if (expr.kind === 209 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { + if (expr.kind === 210 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { expr = expr.left; } switch (expr.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return expr.name; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: var arg = expr.argumentExpression; if (isIdentifier(arg)) { return arg; } } break; - case 200 /* ParenthesizedExpression */: { + case 201 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 238 /* LabeledStatement */: { + case 239 /* LabeledStatement */: { if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -10799,16 +10860,16 @@ var ts; switch (declaration.kind) { case 75 /* Identifier */: return declaration; - case 323 /* JSDocPropertyTag */: - case 317 /* JSDocParameterTag */: { + case 324 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: { var name = declaration.name; - if (name.kind === 153 /* QualifiedName */) { + if (name.kind === 154 /* QualifiedName */) { return name.right; } break; } - case 196 /* CallExpression */: - case 209 /* BinaryExpression */: { + case 197 /* CallExpression */: + case 210 /* BinaryExpression */: { var expr_1 = declaration; switch (ts.getAssignmentDeclarationKind(expr_1)) { case 1 /* ExportsProperty */: @@ -10824,15 +10885,15 @@ var ts; return undefined; } } - case 322 /* JSDocTypedefTag */: + case 323 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 316 /* JSDocEnumTag */: + case 317 /* JSDocEnumTag */: return nameForNamelessJSDocTypedef(declaration); - case 259 /* ExportAssignment */: { + case 260 /* ExportAssignment */: { var expression = declaration.expression; return isIdentifier(expression) ? expression : undefined; } - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: var expr = declaration; if (ts.isBindableStaticElementAccessExpression(expr)) { return expr.argumentExpression; @@ -11068,7 +11129,7 @@ var ts; return ts.emptyArray; } if (ts.isJSDocTypeAlias(node)) { - ts.Debug.assert(node.parent.kind === 303 /* JSDocComment */); + ts.Debug.assert(node.parent.kind === 304 /* JSDocComment */); return ts.flatMap(node.parent.tags, function (tag) { return isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; }); } if (node.typeParameters) { @@ -11139,11 +11200,11 @@ var ts; ts.isIdentifier = isIdentifier; // Names function isQualifiedName(node) { - return node.kind === 153 /* QualifiedName */; + return node.kind === 154 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 154 /* ComputedPropertyName */; + return node.kind === 155 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; function isPrivateIdentifier(node) { @@ -11156,164 +11217,164 @@ var ts; ts.isIdentifierOrPrivateIdentifier = isIdentifierOrPrivateIdentifier; // Signature elements function isTypeParameterDeclaration(node) { - return node.kind === 155 /* TypeParameter */; + return node.kind === 156 /* TypeParameter */; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 156 /* Parameter */; + return node.kind === 157 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 157 /* Decorator */; + return node.kind === 158 /* Decorator */; } ts.isDecorator = isDecorator; // TypeMember function isPropertySignature(node) { - return node.kind === 158 /* PropertySignature */; + return node.kind === 159 /* PropertySignature */; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 159 /* PropertyDeclaration */; + return node.kind === 160 /* PropertyDeclaration */; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 160 /* MethodSignature */; + return node.kind === 161 /* MethodSignature */; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 161 /* MethodDeclaration */; + return node.kind === 162 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 162 /* Constructor */; + return node.kind === 163 /* Constructor */; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 163 /* GetAccessor */; + return node.kind === 164 /* GetAccessor */; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 164 /* SetAccessor */; + return node.kind === 165 /* SetAccessor */; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 165 /* CallSignature */; + return node.kind === 166 /* CallSignature */; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 166 /* ConstructSignature */; + return node.kind === 167 /* ConstructSignature */; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 167 /* IndexSignature */; + return node.kind === 168 /* IndexSignature */; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; /* @internal */ function isGetOrSetAccessorDeclaration(node) { - return node.kind === 164 /* SetAccessor */ || node.kind === 163 /* GetAccessor */; + return node.kind === 165 /* SetAccessor */ || node.kind === 164 /* GetAccessor */; } ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration; // Type function isTypePredicateNode(node) { - return node.kind === 168 /* TypePredicate */; + return node.kind === 169 /* TypePredicate */; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 169 /* TypeReference */; + return node.kind === 170 /* TypeReference */; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 170 /* FunctionType */; + return node.kind === 171 /* FunctionType */; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 171 /* ConstructorType */; + return node.kind === 172 /* ConstructorType */; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 172 /* TypeQuery */; + return node.kind === 173 /* TypeQuery */; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 173 /* TypeLiteral */; + return node.kind === 174 /* TypeLiteral */; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 174 /* ArrayType */; + return node.kind === 175 /* ArrayType */; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 175 /* TupleType */; + return node.kind === 176 /* TupleType */; } ts.isTupleTypeNode = isTupleTypeNode; function isUnionTypeNode(node) { - return node.kind === 178 /* UnionType */; + return node.kind === 179 /* UnionType */; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 179 /* IntersectionType */; + return node.kind === 180 /* IntersectionType */; } ts.isIntersectionTypeNode = isIntersectionTypeNode; function isConditionalTypeNode(node) { - return node.kind === 180 /* ConditionalType */; + return node.kind === 181 /* ConditionalType */; } ts.isConditionalTypeNode = isConditionalTypeNode; function isInferTypeNode(node) { - return node.kind === 181 /* InferType */; + return node.kind === 182 /* InferType */; } ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 182 /* ParenthesizedType */; + return node.kind === 183 /* ParenthesizedType */; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 183 /* ThisType */; + return node.kind === 184 /* ThisType */; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 184 /* TypeOperator */; + return node.kind === 185 /* TypeOperator */; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 185 /* IndexedAccessType */; + return node.kind === 186 /* IndexedAccessType */; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 186 /* MappedType */; + return node.kind === 187 /* MappedType */; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 187 /* LiteralType */; + return node.kind === 188 /* LiteralType */; } ts.isLiteralTypeNode = isLiteralTypeNode; function isImportTypeNode(node) { - return node.kind === 188 /* ImportType */; + return node.kind === 189 /* ImportType */; } ts.isImportTypeNode = isImportTypeNode; // Binding patterns function isObjectBindingPattern(node) { - return node.kind === 189 /* ObjectBindingPattern */; + return node.kind === 190 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 190 /* ArrayBindingPattern */; + return node.kind === 191 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 191 /* BindingElement */; + return node.kind === 192 /* BindingElement */; } ts.isBindingElement = isBindingElement; // Expression function isArrayLiteralExpression(node) { - return node.kind === 192 /* ArrayLiteralExpression */; + return node.kind === 193 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 193 /* ObjectLiteralExpression */; + return node.kind === 194 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 194 /* PropertyAccessExpression */; + return node.kind === 195 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isPropertyAccessChain(node) { @@ -11321,7 +11382,7 @@ var ts; } ts.isPropertyAccessChain = isPropertyAccessChain; function isElementAccessExpression(node) { - return node.kind === 195 /* ElementAccessExpression */; + return node.kind === 196 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isElementAccessChain(node) { @@ -11329,7 +11390,7 @@ var ts; } ts.isElementAccessChain = isElementAccessChain; function isCallExpression(node) { - return node.kind === 196 /* CallExpression */; + return node.kind === 197 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isCallChain(node) { @@ -11339,9 +11400,9 @@ var ts; function isOptionalChain(node) { var kind = node.kind; return !!(node.flags & 32 /* OptionalChain */) && - (kind === 194 /* PropertyAccessExpression */ - || kind === 195 /* ElementAccessExpression */ - || kind === 196 /* CallExpression */); + (kind === 195 /* PropertyAccessExpression */ + || kind === 196 /* ElementAccessExpression */ + || kind === 197 /* CallExpression */); } ts.isOptionalChain = isOptionalChain; /* @internal */ @@ -11375,19 +11436,19 @@ var ts; } ts.isOutermostOptionalChain = isOutermostOptionalChain; function isNullishCoalesce(node) { - return node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; + return node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; } ts.isNullishCoalesce = isNullishCoalesce; function isNewExpression(node) { - return node.kind === 197 /* NewExpression */; + return node.kind === 198 /* NewExpression */; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 198 /* TaggedTemplateExpression */; + return node.kind === 199 /* TaggedTemplateExpression */; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertion(node) { - return node.kind === 199 /* TypeAssertionExpression */; + return node.kind === 200 /* TypeAssertionExpression */; } ts.isTypeAssertion = isTypeAssertion; function isConstTypeReference(node) { @@ -11396,384 +11457,384 @@ var ts; } ts.isConstTypeReference = isConstTypeReference; function isParenthesizedExpression(node) { - return node.kind === 200 /* ParenthesizedExpression */; + return node.kind === 201 /* ParenthesizedExpression */; } ts.isParenthesizedExpression = isParenthesizedExpression; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 326 /* PartiallyEmittedExpression */) { + while (node.kind === 327 /* PartiallyEmittedExpression */) { node = node.expression; } return node; } ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; function isFunctionExpression(node) { - return node.kind === 201 /* FunctionExpression */; + return node.kind === 202 /* FunctionExpression */; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 202 /* ArrowFunction */; + return node.kind === 203 /* ArrowFunction */; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 203 /* DeleteExpression */; + return node.kind === 204 /* DeleteExpression */; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 204 /* TypeOfExpression */; + return node.kind === 205 /* TypeOfExpression */; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 205 /* VoidExpression */; + return node.kind === 206 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 206 /* AwaitExpression */; + return node.kind === 207 /* AwaitExpression */; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 207 /* PrefixUnaryExpression */; + return node.kind === 208 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 208 /* PostfixUnaryExpression */; + return node.kind === 209 /* PostfixUnaryExpression */; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 209 /* BinaryExpression */; + return node.kind === 210 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 210 /* ConditionalExpression */; + return node.kind === 211 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 211 /* TemplateExpression */; + return node.kind === 212 /* TemplateExpression */; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 212 /* YieldExpression */; + return node.kind === 213 /* YieldExpression */; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 213 /* SpreadElement */; + return node.kind === 214 /* SpreadElement */; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 214 /* ClassExpression */; + return node.kind === 215 /* ClassExpression */; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 215 /* OmittedExpression */; + return node.kind === 216 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 216 /* ExpressionWithTypeArguments */; + return node.kind === 217 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 217 /* AsExpression */; + return node.kind === 218 /* AsExpression */; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 218 /* NonNullExpression */; + return node.kind === 219 /* NonNullExpression */; } ts.isNonNullExpression = isNonNullExpression; function isMetaProperty(node) { - return node.kind === 219 /* MetaProperty */; + return node.kind === 220 /* MetaProperty */; } ts.isMetaProperty = isMetaProperty; // Misc function isTemplateSpan(node) { - return node.kind === 221 /* TemplateSpan */; + return node.kind === 222 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 222 /* SemicolonClassElement */; + return node.kind === 223 /* SemicolonClassElement */; } ts.isSemicolonClassElement = isSemicolonClassElement; // Block function isBlock(node) { - return node.kind === 223 /* Block */; + return node.kind === 224 /* Block */; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 225 /* VariableStatement */; + return node.kind === 226 /* VariableStatement */; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 224 /* EmptyStatement */; + return node.kind === 225 /* EmptyStatement */; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 226 /* ExpressionStatement */; + return node.kind === 227 /* ExpressionStatement */; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 227 /* IfStatement */; + return node.kind === 228 /* IfStatement */; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 228 /* DoStatement */; + return node.kind === 229 /* DoStatement */; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 229 /* WhileStatement */; + return node.kind === 230 /* WhileStatement */; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 230 /* ForStatement */; + return node.kind === 231 /* ForStatement */; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 231 /* ForInStatement */; + return node.kind === 232 /* ForInStatement */; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 232 /* ForOfStatement */; + return node.kind === 233 /* ForOfStatement */; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 233 /* ContinueStatement */; + return node.kind === 234 /* ContinueStatement */; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 234 /* BreakStatement */; + return node.kind === 235 /* BreakStatement */; } ts.isBreakStatement = isBreakStatement; function isBreakOrContinueStatement(node) { - return node.kind === 234 /* BreakStatement */ || node.kind === 233 /* ContinueStatement */; + return node.kind === 235 /* BreakStatement */ || node.kind === 234 /* ContinueStatement */; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isReturnStatement(node) { - return node.kind === 235 /* ReturnStatement */; + return node.kind === 236 /* ReturnStatement */; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 236 /* WithStatement */; + return node.kind === 237 /* WithStatement */; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 237 /* SwitchStatement */; + return node.kind === 238 /* SwitchStatement */; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 238 /* LabeledStatement */; + return node.kind === 239 /* LabeledStatement */; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 239 /* ThrowStatement */; + return node.kind === 240 /* ThrowStatement */; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 240 /* TryStatement */; + return node.kind === 241 /* TryStatement */; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 241 /* DebuggerStatement */; + return node.kind === 242 /* DebuggerStatement */; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 242 /* VariableDeclaration */; + return node.kind === 243 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 243 /* VariableDeclarationList */; + return node.kind === 244 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 244 /* FunctionDeclaration */; + return node.kind === 245 /* FunctionDeclaration */; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 245 /* ClassDeclaration */; + return node.kind === 246 /* ClassDeclaration */; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 246 /* InterfaceDeclaration */; + return node.kind === 247 /* InterfaceDeclaration */; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 247 /* TypeAliasDeclaration */; + return node.kind === 248 /* TypeAliasDeclaration */; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 248 /* EnumDeclaration */; + return node.kind === 249 /* EnumDeclaration */; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 249 /* ModuleDeclaration */; + return node.kind === 250 /* ModuleDeclaration */; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 250 /* ModuleBlock */; + return node.kind === 251 /* ModuleBlock */; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 251 /* CaseBlock */; + return node.kind === 252 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 252 /* NamespaceExportDeclaration */; + return node.kind === 253 /* NamespaceExportDeclaration */; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */; + return node.kind === 254 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 254 /* ImportDeclaration */; + return node.kind === 255 /* ImportDeclaration */; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 255 /* ImportClause */; + return node.kind === 256 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 256 /* NamespaceImport */; + return node.kind === 257 /* NamespaceImport */; } ts.isNamespaceImport = isNamespaceImport; function isNamespaceExport(node) { - return node.kind === 262 /* NamespaceExport */; + return node.kind === 263 /* NamespaceExport */; } ts.isNamespaceExport = isNamespaceExport; function isNamedExportBindings(node) { - return node.kind === 262 /* NamespaceExport */ || node.kind === 261 /* NamedExports */; + return node.kind === 263 /* NamespaceExport */ || node.kind === 262 /* NamedExports */; } ts.isNamedExportBindings = isNamedExportBindings; function isNamedImports(node) { - return node.kind === 257 /* NamedImports */; + return node.kind === 258 /* NamedImports */; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 258 /* ImportSpecifier */; + return node.kind === 259 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 259 /* ExportAssignment */; + return node.kind === 260 /* ExportAssignment */; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 260 /* ExportDeclaration */; + return node.kind === 261 /* ExportDeclaration */; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 261 /* NamedExports */; + return node.kind === 262 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 263 /* ExportSpecifier */; + return node.kind === 264 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 264 /* MissingDeclaration */; + return node.kind === 265 /* MissingDeclaration */; } ts.isMissingDeclaration = isMissingDeclaration; // Module References function isExternalModuleReference(node) { - return node.kind === 265 /* ExternalModuleReference */; + return node.kind === 266 /* ExternalModuleReference */; } ts.isExternalModuleReference = isExternalModuleReference; // JSX function isJsxElement(node) { - return node.kind === 266 /* JsxElement */; + return node.kind === 267 /* JsxElement */; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 267 /* JsxSelfClosingElement */; + return node.kind === 268 /* JsxSelfClosingElement */; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 268 /* JsxOpeningElement */; + return node.kind === 269 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 269 /* JsxClosingElement */; + return node.kind === 270 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 270 /* JsxFragment */; + return node.kind === 271 /* JsxFragment */; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 271 /* JsxOpeningFragment */; + return node.kind === 272 /* JsxOpeningFragment */; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 272 /* JsxClosingFragment */; + return node.kind === 273 /* JsxClosingFragment */; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 273 /* JsxAttribute */; + return node.kind === 274 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 274 /* JsxAttributes */; + return node.kind === 275 /* JsxAttributes */; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 275 /* JsxSpreadAttribute */; + return node.kind === 276 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 276 /* JsxExpression */; + return node.kind === 277 /* JsxExpression */; } ts.isJsxExpression = isJsxExpression; // Clauses function isCaseClause(node) { - return node.kind === 277 /* CaseClause */; + return node.kind === 278 /* CaseClause */; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 278 /* DefaultClause */; + return node.kind === 279 /* DefaultClause */; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 279 /* HeritageClause */; + return node.kind === 280 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 280 /* CatchClause */; + return node.kind === 281 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 281 /* PropertyAssignment */; + return node.kind === 282 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 282 /* ShorthandPropertyAssignment */; + return node.kind === 283 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 283 /* SpreadAssignment */; + return node.kind === 284 /* SpreadAssignment */; } ts.isSpreadAssignment = isSpreadAssignment; // Enum function isEnumMember(node) { - return node.kind === 284 /* EnumMember */; + return node.kind === 285 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Top-level nodes function isSourceFile(node) { - return node.kind === 290 /* SourceFile */; + return node.kind === 291 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 291 /* Bundle */; + return node.kind === 292 /* Bundle */; } ts.isBundle = isBundle; function isUnparsedSource(node) { - return node.kind === 292 /* UnparsedSource */; + return node.kind === 293 /* UnparsedSource */; } ts.isUnparsedSource = isUnparsedSource; function isUnparsedPrepend(node) { - return node.kind === 286 /* UnparsedPrepend */; + return node.kind === 287 /* UnparsedPrepend */; } ts.isUnparsedPrepend = isUnparsedPrepend; function isUnparsedTextLike(node) { switch (node.kind) { - case 287 /* UnparsedText */: - case 288 /* UnparsedInternalText */: + case 288 /* UnparsedText */: + case 289 /* UnparsedInternalText */: return true; default: return false; @@ -11782,125 +11843,125 @@ var ts; ts.isUnparsedTextLike = isUnparsedTextLike; function isUnparsedNode(node) { return isUnparsedTextLike(node) || - node.kind === 285 /* UnparsedPrologue */ || - node.kind === 289 /* UnparsedSyntheticReference */; + node.kind === 286 /* UnparsedPrologue */ || + node.kind === 290 /* UnparsedSyntheticReference */; } ts.isUnparsedNode = isUnparsedNode; // JSDoc function isJSDocTypeExpression(node) { - return node.kind === 294 /* JSDocTypeExpression */; + return node.kind === 295 /* JSDocTypeExpression */; } ts.isJSDocTypeExpression = isJSDocTypeExpression; function isJSDocAllType(node) { - return node.kind === 295 /* JSDocAllType */; + return node.kind === 296 /* JSDocAllType */; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 296 /* JSDocUnknownType */; + return node.kind === 297 /* JSDocUnknownType */; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 297 /* JSDocNullableType */; + return node.kind === 298 /* JSDocNullableType */; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 298 /* JSDocNonNullableType */; + return node.kind === 299 /* JSDocNonNullableType */; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 299 /* JSDocOptionalType */; + return node.kind === 300 /* JSDocOptionalType */; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 300 /* JSDocFunctionType */; + return node.kind === 301 /* JSDocFunctionType */; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 301 /* JSDocVariadicType */; + return node.kind === 302 /* JSDocVariadicType */; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDoc(node) { - return node.kind === 303 /* JSDocComment */; + return node.kind === 304 /* JSDocComment */; } ts.isJSDoc = isJSDoc; function isJSDocAuthorTag(node) { - return node.kind === 309 /* JSDocAuthorTag */; + return node.kind === 310 /* JSDocAuthorTag */; } ts.isJSDocAuthorTag = isJSDocAuthorTag; function isJSDocAugmentsTag(node) { - return node.kind === 307 /* JSDocAugmentsTag */; + return node.kind === 308 /* JSDocAugmentsTag */; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocImplementsTag(node) { - return node.kind === 308 /* JSDocImplementsTag */; + return node.kind === 309 /* JSDocImplementsTag */; } ts.isJSDocImplementsTag = isJSDocImplementsTag; function isJSDocClassTag(node) { - return node.kind === 310 /* JSDocClassTag */; + return node.kind === 311 /* JSDocClassTag */; } ts.isJSDocClassTag = isJSDocClassTag; function isJSDocPublicTag(node) { - return node.kind === 311 /* JSDocPublicTag */; + return node.kind === 312 /* JSDocPublicTag */; } ts.isJSDocPublicTag = isJSDocPublicTag; function isJSDocPrivateTag(node) { - return node.kind === 312 /* JSDocPrivateTag */; + return node.kind === 313 /* JSDocPrivateTag */; } ts.isJSDocPrivateTag = isJSDocPrivateTag; function isJSDocProtectedTag(node) { - return node.kind === 313 /* JSDocProtectedTag */; + return node.kind === 314 /* JSDocProtectedTag */; } ts.isJSDocProtectedTag = isJSDocProtectedTag; function isJSDocReadonlyTag(node) { - return node.kind === 314 /* JSDocReadonlyTag */; + return node.kind === 315 /* JSDocReadonlyTag */; } ts.isJSDocReadonlyTag = isJSDocReadonlyTag; function isJSDocEnumTag(node) { - return node.kind === 316 /* JSDocEnumTag */; + return node.kind === 317 /* JSDocEnumTag */; } ts.isJSDocEnumTag = isJSDocEnumTag; function isJSDocThisTag(node) { - return node.kind === 319 /* JSDocThisTag */; + return node.kind === 320 /* JSDocThisTag */; } ts.isJSDocThisTag = isJSDocThisTag; function isJSDocParameterTag(node) { - return node.kind === 317 /* JSDocParameterTag */; + return node.kind === 318 /* JSDocParameterTag */; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 318 /* JSDocReturnTag */; + return node.kind === 319 /* JSDocReturnTag */; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocTypeTag(node) { - return node.kind === 320 /* JSDocTypeTag */; + return node.kind === 321 /* JSDocTypeTag */; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 321 /* JSDocTemplateTag */; + return node.kind === 322 /* JSDocTemplateTag */; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 322 /* JSDocTypedefTag */; + return node.kind === 323 /* JSDocTypedefTag */; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocPropertyTag(node) { - return node.kind === 323 /* JSDocPropertyTag */; + return node.kind === 324 /* JSDocPropertyTag */; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocPropertyLikeTag(node) { - return node.kind === 323 /* JSDocPropertyTag */ || node.kind === 317 /* JSDocParameterTag */; + return node.kind === 324 /* JSDocPropertyTag */ || node.kind === 318 /* JSDocParameterTag */; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isJSDocTypeLiteral(node) { - return node.kind === 304 /* JSDocTypeLiteral */; + return node.kind === 305 /* JSDocTypeLiteral */; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; function isJSDocCallbackTag(node) { - return node.kind === 315 /* JSDocCallbackTag */; + return node.kind === 316 /* JSDocCallbackTag */; } ts.isJSDocCallbackTag = isJSDocCallbackTag; function isJSDocSignature(node) { - return node.kind === 305 /* JSDocSignature */; + return node.kind === 306 /* JSDocSignature */; } ts.isJSDocSignature = isJSDocSignature; // #endregion @@ -11911,7 +11972,7 @@ var ts; // they may be used with transformations. /* @internal */ function isSyntaxList(n) { - return n.kind === 324 /* SyntaxList */; + return n.kind === 325 /* SyntaxList */; } ts.isSyntaxList = isSyntaxList; /* @internal */ @@ -11921,7 +11982,7 @@ var ts; ts.isNode = isNode; /* @internal */ function isNodeKind(kind) { - return kind >= 153 /* FirstNode */; + return kind >= 154 /* FirstNode */; } ts.isNodeKind = isNodeKind; /** @@ -11930,7 +11991,7 @@ var ts; * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 152 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 153 /* LastToken */; } ts.isToken = isToken; // Node Arrays @@ -11971,12 +12032,12 @@ var ts; ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isTypeOnlyImportOrExportDeclaration(node) { switch (node.kind) { - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return node.parent.isTypeOnly; - case 255 /* ImportClause */: + case 256 /* ImportClause */: return node.isTypeOnly; default: return false; @@ -12011,13 +12072,13 @@ var ts; case 122 /* AbstractKeyword */: case 126 /* AsyncKeyword */: case 81 /* ConstKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 84 /* DefaultKeyword */: case 89 /* ExportKeyword */: case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: case 120 /* StaticKeyword */: return true; } @@ -12040,23 +12101,24 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 153 /* QualifiedName */ + return kind === 154 /* QualifiedName */ || kind === 75 /* Identifier */; } ts.isEntityName = isEntityName; function isPropertyName(node) { var kind = node.kind; return kind === 75 /* Identifier */ + || kind === 76 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 154 /* ComputedPropertyName */; + || kind === 155 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 75 /* Identifier */ - || kind === 189 /* ObjectBindingPattern */ - || kind === 190 /* ArrayBindingPattern */; + || kind === 190 /* ObjectBindingPattern */ + || kind === 191 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Functions @@ -12071,13 +12133,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return true; default: return false; @@ -12086,14 +12148,14 @@ var ts; /* @internal */ function isFunctionLikeKind(kind) { switch (kind) { - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 305 /* JSDocSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 170 /* FunctionType */: - case 300 /* JSDocFunctionType */: - case 171 /* ConstructorType */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 306 /* JSDocSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 171 /* FunctionType */: + case 301 /* JSDocFunctionType */: + case 172 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -12108,29 +12170,29 @@ var ts; // Classes function isClassElement(node) { var kind = node.kind; - return kind === 162 /* Constructor */ - || kind === 159 /* PropertyDeclaration */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */ - || kind === 167 /* IndexSignature */ - || kind === 222 /* SemicolonClassElement */; + return kind === 163 /* Constructor */ + || kind === 160 /* PropertyDeclaration */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */ + || kind === 168 /* IndexSignature */ + || kind === 223 /* SemicolonClassElement */; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */); + return node && (node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 163 /* GetAccessor */ || node.kind === 164 /* SetAccessor */); + return node && (node.kind === 164 /* GetAccessor */ || node.kind === 165 /* SetAccessor */); } ts.isAccessor = isAccessor; /* @internal */ function isMethodOrAccessor(node) { switch (node.kind) { - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return true; default: return false; @@ -12140,11 +12202,11 @@ var ts; // Type members function isTypeElement(node) { var kind = node.kind; - return kind === 166 /* ConstructSignature */ - || kind === 165 /* CallSignature */ - || kind === 158 /* PropertySignature */ - || kind === 160 /* MethodSignature */ - || kind === 167 /* IndexSignature */; + return kind === 167 /* ConstructSignature */ + || kind === 166 /* CallSignature */ + || kind === 159 /* PropertySignature */ + || kind === 161 /* MethodSignature */ + || kind === 168 /* IndexSignature */; } ts.isTypeElement = isTypeElement; function isClassOrTypeElement(node) { @@ -12153,12 +12215,12 @@ var ts; ts.isClassOrTypeElement = isClassOrTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 281 /* PropertyAssignment */ - || kind === 282 /* ShorthandPropertyAssignment */ - || kind === 283 /* SpreadAssignment */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */; + return kind === 282 /* PropertyAssignment */ + || kind === 283 /* ShorthandPropertyAssignment */ + || kind === 284 /* SpreadAssignment */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type @@ -12173,8 +12235,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 170 /* FunctionType */: - case 171 /* ConstructorType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: return true; } return false; @@ -12185,8 +12247,8 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 190 /* ArrayBindingPattern */ - || kind === 189 /* ObjectBindingPattern */; + return kind === 191 /* ArrayBindingPattern */ + || kind === 190 /* ObjectBindingPattern */; } return false; } @@ -12194,15 +12256,15 @@ var ts; /* @internal */ function isAssignmentPattern(node) { var kind = node.kind; - return kind === 192 /* ArrayLiteralExpression */ - || kind === 193 /* ObjectLiteralExpression */; + return kind === 193 /* ArrayLiteralExpression */ + || kind === 194 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; /* @internal */ function isArrayBindingElement(node) { var kind = node.kind; - return kind === 191 /* BindingElement */ - || kind === 215 /* OmittedExpression */; + return kind === 192 /* BindingElement */ + || kind === 216 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -12211,9 +12273,9 @@ var ts; /* @internal */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 191 /* BindingElement */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 192 /* BindingElement */: return true; } return false; @@ -12234,8 +12296,8 @@ var ts; /* @internal */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 189 /* ObjectBindingPattern */: - case 193 /* ObjectLiteralExpression */: + case 190 /* ObjectBindingPattern */: + case 194 /* ObjectLiteralExpression */: return true; } return false; @@ -12247,8 +12309,8 @@ var ts; /* @internal */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 190 /* ArrayBindingPattern */: - case 192 /* ArrayLiteralExpression */: + case 191 /* ArrayBindingPattern */: + case 193 /* ArrayLiteralExpression */: return true; } return false; @@ -12257,26 +12319,26 @@ var ts; /* @internal */ function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { var kind = node.kind; - return kind === 194 /* PropertyAccessExpression */ - || kind === 153 /* QualifiedName */ - || kind === 188 /* ImportType */; + return kind === 195 /* PropertyAccessExpression */ + || kind === 154 /* QualifiedName */ + || kind === 189 /* ImportType */; } ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode; // Expression function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 194 /* PropertyAccessExpression */ - || kind === 153 /* QualifiedName */; + return kind === 195 /* PropertyAccessExpression */ + || kind === 154 /* QualifiedName */; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 198 /* TaggedTemplateExpression */: - case 157 /* Decorator */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 199 /* TaggedTemplateExpression */: + case 158 /* Decorator */: return true; default: return false; @@ -12284,12 +12346,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 196 /* CallExpression */ || node.kind === 197 /* NewExpression */; + return node.kind === 197 /* CallExpression */ || node.kind === 198 /* NewExpression */; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 211 /* TemplateExpression */ + return kind === 212 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; @@ -12300,33 +12362,33 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: - case 197 /* NewExpression */: - case 196 /* CallExpression */: - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 270 /* JsxFragment */: - case 198 /* TaggedTemplateExpression */: - case 192 /* ArrayLiteralExpression */: - case 200 /* ParenthesizedExpression */: - case 193 /* ObjectLiteralExpression */: - case 214 /* ClassExpression */: - case 201 /* FunctionExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: + case 198 /* NewExpression */: + case 197 /* CallExpression */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 271 /* JsxFragment */: + case 199 /* TaggedTemplateExpression */: + case 193 /* ArrayLiteralExpression */: + case 201 /* ParenthesizedExpression */: + case 194 /* ObjectLiteralExpression */: + case 215 /* ClassExpression */: + case 202 /* FunctionExpression */: case 75 /* Identifier */: case 13 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: case 91 /* FalseKeyword */: case 100 /* NullKeyword */: case 104 /* ThisKeyword */: case 106 /* TrueKeyword */: case 102 /* SuperKeyword */: - case 218 /* NonNullExpression */: - case 219 /* MetaProperty */: + case 219 /* NonNullExpression */: + case 220 /* MetaProperty */: case 96 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression return true; default: @@ -12340,13 +12402,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: - case 203 /* DeleteExpression */: - case 204 /* TypeOfExpression */: - case 205 /* VoidExpression */: - case 206 /* AwaitExpression */: - case 199 /* TypeAssertionExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: + case 204 /* DeleteExpression */: + case 205 /* TypeOfExpression */: + case 206 /* VoidExpression */: + case 207 /* AwaitExpression */: + case 200 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -12355,9 +12417,9 @@ var ts; /* @internal */ function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return true; - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; default: @@ -12376,15 +12438,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 210 /* ConditionalExpression */: - case 212 /* YieldExpression */: - case 202 /* ArrowFunction */: - case 209 /* BinaryExpression */: - case 213 /* SpreadElement */: - case 217 /* AsExpression */: - case 215 /* OmittedExpression */: - case 327 /* CommaListExpression */: - case 326 /* PartiallyEmittedExpression */: + case 211 /* ConditionalExpression */: + case 213 /* YieldExpression */: + case 203 /* ArrowFunction */: + case 210 /* BinaryExpression */: + case 214 /* SpreadElement */: + case 218 /* AsExpression */: + case 216 /* OmittedExpression */: + case 328 /* CommaListExpression */: + case 327 /* PartiallyEmittedExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -12392,23 +12454,23 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 199 /* TypeAssertionExpression */ - || kind === 217 /* AsExpression */; + return kind === 200 /* TypeAssertionExpression */ + || kind === 218 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; /* @internal */ function isPartiallyEmittedExpression(node) { - return node.kind === 326 /* PartiallyEmittedExpression */; + return node.kind === 327 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; /* @internal */ function isNotEmittedStatement(node) { - return node.kind === 325 /* NotEmittedStatement */; + return node.kind === 326 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; /* @internal */ function isSyntheticReference(node) { - return node.kind === 330 /* SyntheticReferenceExpression */; + return node.kind === 331 /* SyntheticReferenceExpression */; } ts.isSyntheticReference = isSyntheticReference; /* @internal */ @@ -12419,13 +12481,13 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return true; - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -12454,7 +12516,7 @@ var ts; ts.isExternalModuleIndicator = isExternalModuleIndicator; /* @internal */ function isForInOrOfStatement(node) { - return node.kind === 231 /* ForInStatement */ || node.kind === 232 /* ForOfStatement */; + return node.kind === 232 /* ForInStatement */ || node.kind === 233 /* ForOfStatement */; } ts.isForInOrOfStatement = isForInOrOfStatement; // Element @@ -12478,114 +12540,114 @@ var ts; /* @internal */ function isModuleBody(node) { var kind = node.kind; - return kind === 250 /* ModuleBlock */ - || kind === 249 /* ModuleDeclaration */ + return kind === 251 /* ModuleBlock */ + || kind === 250 /* ModuleDeclaration */ || kind === 75 /* Identifier */; } ts.isModuleBody = isModuleBody; /* @internal */ function isNamespaceBody(node) { var kind = node.kind; - return kind === 250 /* ModuleBlock */ - || kind === 249 /* ModuleDeclaration */; + return kind === 251 /* ModuleBlock */ + || kind === 250 /* ModuleDeclaration */; } ts.isNamespaceBody = isNamespaceBody; /* @internal */ function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 75 /* Identifier */ - || kind === 249 /* ModuleDeclaration */; + || kind === 250 /* ModuleDeclaration */; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; /* @internal */ function isNamedImportBindings(node) { var kind = node.kind; - return kind === 257 /* NamedImports */ - || kind === 256 /* NamespaceImport */; + return kind === 258 /* NamedImports */ + || kind === 257 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; /* @internal */ function isModuleOrEnumDeclaration(node) { - return node.kind === 249 /* ModuleDeclaration */ || node.kind === 248 /* EnumDeclaration */; + return node.kind === 250 /* ModuleDeclaration */ || node.kind === 249 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 202 /* ArrowFunction */ - || kind === 191 /* BindingElement */ - || kind === 245 /* ClassDeclaration */ - || kind === 214 /* ClassExpression */ - || kind === 162 /* Constructor */ - || kind === 248 /* EnumDeclaration */ - || kind === 284 /* EnumMember */ - || kind === 263 /* ExportSpecifier */ - || kind === 244 /* FunctionDeclaration */ - || kind === 201 /* FunctionExpression */ - || kind === 163 /* GetAccessor */ - || kind === 255 /* ImportClause */ - || kind === 253 /* ImportEqualsDeclaration */ - || kind === 258 /* ImportSpecifier */ - || kind === 246 /* InterfaceDeclaration */ - || kind === 273 /* JsxAttribute */ - || kind === 161 /* MethodDeclaration */ - || kind === 160 /* MethodSignature */ - || kind === 249 /* ModuleDeclaration */ - || kind === 252 /* NamespaceExportDeclaration */ - || kind === 256 /* NamespaceImport */ - || kind === 262 /* NamespaceExport */ - || kind === 156 /* Parameter */ - || kind === 281 /* PropertyAssignment */ - || kind === 159 /* PropertyDeclaration */ - || kind === 158 /* PropertySignature */ - || kind === 164 /* SetAccessor */ - || kind === 282 /* ShorthandPropertyAssignment */ - || kind === 247 /* TypeAliasDeclaration */ - || kind === 155 /* TypeParameter */ - || kind === 242 /* VariableDeclaration */ - || kind === 322 /* JSDocTypedefTag */ - || kind === 315 /* JSDocCallbackTag */ - || kind === 323 /* JSDocPropertyTag */; + return kind === 203 /* ArrowFunction */ + || kind === 192 /* BindingElement */ + || kind === 246 /* ClassDeclaration */ + || kind === 215 /* ClassExpression */ + || kind === 163 /* Constructor */ + || kind === 249 /* EnumDeclaration */ + || kind === 285 /* EnumMember */ + || kind === 264 /* ExportSpecifier */ + || kind === 245 /* FunctionDeclaration */ + || kind === 202 /* FunctionExpression */ + || kind === 164 /* GetAccessor */ + || kind === 256 /* ImportClause */ + || kind === 254 /* ImportEqualsDeclaration */ + || kind === 259 /* ImportSpecifier */ + || kind === 247 /* InterfaceDeclaration */ + || kind === 274 /* JsxAttribute */ + || kind === 162 /* MethodDeclaration */ + || kind === 161 /* MethodSignature */ + || kind === 250 /* ModuleDeclaration */ + || kind === 253 /* NamespaceExportDeclaration */ + || kind === 257 /* NamespaceImport */ + || kind === 263 /* NamespaceExport */ + || kind === 157 /* Parameter */ + || kind === 282 /* PropertyAssignment */ + || kind === 160 /* PropertyDeclaration */ + || kind === 159 /* PropertySignature */ + || kind === 165 /* SetAccessor */ + || kind === 283 /* ShorthandPropertyAssignment */ + || kind === 248 /* TypeAliasDeclaration */ + || kind === 156 /* TypeParameter */ + || kind === 243 /* VariableDeclaration */ + || kind === 323 /* JSDocTypedefTag */ + || kind === 316 /* JSDocCallbackTag */ + || kind === 324 /* JSDocPropertyTag */; } function isDeclarationStatementKind(kind) { - return kind === 244 /* FunctionDeclaration */ - || kind === 264 /* MissingDeclaration */ - || kind === 245 /* ClassDeclaration */ - || kind === 246 /* InterfaceDeclaration */ - || kind === 247 /* TypeAliasDeclaration */ - || kind === 248 /* EnumDeclaration */ - || kind === 249 /* ModuleDeclaration */ - || kind === 254 /* ImportDeclaration */ - || kind === 253 /* ImportEqualsDeclaration */ - || kind === 260 /* ExportDeclaration */ - || kind === 259 /* ExportAssignment */ - || kind === 252 /* NamespaceExportDeclaration */; + return kind === 245 /* FunctionDeclaration */ + || kind === 265 /* MissingDeclaration */ + || kind === 246 /* ClassDeclaration */ + || kind === 247 /* InterfaceDeclaration */ + || kind === 248 /* TypeAliasDeclaration */ + || kind === 249 /* EnumDeclaration */ + || kind === 250 /* ModuleDeclaration */ + || kind === 255 /* ImportDeclaration */ + || kind === 254 /* ImportEqualsDeclaration */ + || kind === 261 /* ExportDeclaration */ + || kind === 260 /* ExportAssignment */ + || kind === 253 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 234 /* BreakStatement */ - || kind === 233 /* ContinueStatement */ - || kind === 241 /* DebuggerStatement */ - || kind === 228 /* DoStatement */ - || kind === 226 /* ExpressionStatement */ - || kind === 224 /* EmptyStatement */ - || kind === 231 /* ForInStatement */ - || kind === 232 /* ForOfStatement */ - || kind === 230 /* ForStatement */ - || kind === 227 /* IfStatement */ - || kind === 238 /* LabeledStatement */ - || kind === 235 /* ReturnStatement */ - || kind === 237 /* SwitchStatement */ - || kind === 239 /* ThrowStatement */ - || kind === 240 /* TryStatement */ - || kind === 225 /* VariableStatement */ - || kind === 229 /* WhileStatement */ - || kind === 236 /* WithStatement */ - || kind === 325 /* NotEmittedStatement */ - || kind === 329 /* EndOfDeclarationMarker */ - || kind === 328 /* MergeDeclarationMarker */; + return kind === 235 /* BreakStatement */ + || kind === 234 /* ContinueStatement */ + || kind === 242 /* DebuggerStatement */ + || kind === 229 /* DoStatement */ + || kind === 227 /* ExpressionStatement */ + || kind === 225 /* EmptyStatement */ + || kind === 232 /* ForInStatement */ + || kind === 233 /* ForOfStatement */ + || kind === 231 /* ForStatement */ + || kind === 228 /* IfStatement */ + || kind === 239 /* LabeledStatement */ + || kind === 236 /* ReturnStatement */ + || kind === 238 /* SwitchStatement */ + || kind === 240 /* ThrowStatement */ + || kind === 241 /* TryStatement */ + || kind === 226 /* VariableStatement */ + || kind === 230 /* WhileStatement */ + || kind === 237 /* WithStatement */ + || kind === 326 /* NotEmittedStatement */ + || kind === 330 /* EndOfDeclarationMarker */ + || kind === 329 /* MergeDeclarationMarker */; } /* @internal */ function isDeclaration(node) { - if (node.kind === 155 /* TypeParameter */) { - return (node.parent && node.parent.kind !== 321 /* JSDocTemplateTag */) || ts.isInJSFile(node); + if (node.kind === 156 /* TypeParameter */) { + return (node.parent && node.parent.kind !== 322 /* JSDocTemplateTag */) || ts.isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -12612,10 +12674,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 223 /* Block */) + if (node.kind !== 224 /* Block */) return false; if (node.parent !== undefined) { - if (node.parent.kind === 240 /* TryStatement */ || node.parent.kind === 280 /* CatchClause */) { + if (node.parent.kind === 241 /* TryStatement */ || node.parent.kind === 281 /* CatchClause */) { return false; } } @@ -12625,8 +12687,8 @@ var ts; /* @internal */ function isModuleReference(node) { var kind = node.kind; - return kind === 265 /* ExternalModuleReference */ - || kind === 153 /* QualifiedName */ + return kind === 266 /* ExternalModuleReference */ + || kind === 154 /* QualifiedName */ || kind === 75 /* Identifier */; } ts.isModuleReference = isModuleReference; @@ -12636,70 +12698,70 @@ var ts; var kind = node.kind; return kind === 104 /* ThisKeyword */ || kind === 75 /* Identifier */ - || kind === 194 /* PropertyAccessExpression */; + || kind === 195 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; /* @internal */ function isJsxChild(node) { var kind = node.kind; - return kind === 266 /* JsxElement */ - || kind === 276 /* JsxExpression */ - || kind === 267 /* JsxSelfClosingElement */ + return kind === 267 /* JsxElement */ + || kind === 277 /* JsxExpression */ + || kind === 268 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ - || kind === 270 /* JsxFragment */; + || kind === 271 /* JsxFragment */; } ts.isJsxChild = isJsxChild; /* @internal */ function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 273 /* JsxAttribute */ - || kind === 275 /* JsxSpreadAttribute */; + return kind === 274 /* JsxAttribute */ + || kind === 276 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; /* @internal */ function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 10 /* StringLiteral */ - || kind === 276 /* JsxExpression */; + || kind === 277 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 268 /* JsxOpeningElement */ - || kind === 267 /* JsxSelfClosingElement */; + return kind === 269 /* JsxOpeningElement */ + || kind === 268 /* JsxSelfClosingElement */; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 277 /* CaseClause */ - || kind === 278 /* DefaultClause */; + return kind === 278 /* CaseClause */ + || kind === 279 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; // JSDoc /** True if node is of some JSDoc syntax kind. */ /* @internal */ function isJSDocNode(node) { - return node.kind >= 294 /* FirstJSDocNode */ && node.kind <= 323 /* LastJSDocNode */; + return node.kind >= 295 /* FirstJSDocNode */ && node.kind <= 324 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node) { - return node.kind === 303 /* JSDocComment */ || node.kind === 302 /* JSDocNamepathType */ || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); + return node.kind === 304 /* JSDocComment */ || node.kind === 303 /* JSDocNamepathType */ || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; // TODO: determine what this does before making it public. /* @internal */ function isJSDocTag(node) { - return node.kind >= 306 /* FirstJSDocTagNode */ && node.kind <= 323 /* LastJSDocTagNode */; + return node.kind >= 307 /* FirstJSDocTagNode */ && node.kind <= 324 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 164 /* SetAccessor */; + return node.kind === 165 /* SetAccessor */; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 163 /* GetAccessor */; + return node.kind === 164 /* GetAccessor */; } ts.isGetAccessor = isGetAccessor; /** True if has jsdoc nodes attached to it. */ @@ -12725,13 +12787,13 @@ var ts; /** True if has initializer node attached to it. */ function hasOnlyExpressionInitializer(node) { switch (node.kind) { - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 191 /* BindingElement */: - case 158 /* PropertySignature */: - case 159 /* PropertyDeclaration */: - case 281 /* PropertyAssignment */: - case 284 /* EnumMember */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 192 /* BindingElement */: + case 159 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 282 /* PropertyAssignment */: + case 285 /* EnumMember */: return true; default: return false; @@ -12739,12 +12801,12 @@ var ts; } ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; function isObjectLiteralElement(node) { - return node.kind === 273 /* JsxAttribute */ || node.kind === 275 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); + return node.kind === 274 /* JsxAttribute */ || node.kind === 276 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); } ts.isObjectLiteralElement = isObjectLiteralElement; /* @internal */ function isTypeReferenceType(node) { - return node.kind === 169 /* TypeReference */ || node.kind === 216 /* ExpressionWithTypeArguments */; + return node.kind === 170 /* TypeReference */ || node.kind === 217 /* ExpressionWithTypeArguments */; } ts.isTypeReferenceType = isTypeReferenceType; var MAX_SMI_X86 = 1073741823; @@ -13038,7 +13100,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 290 /* SourceFile */) { + while (node && node.kind !== 291 /* SourceFile */) { node = node.parent; } return node; @@ -13046,11 +13108,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 223 /* Block */: - case 251 /* CaseBlock */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 224 /* Block */: + case 252 /* CaseBlock */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: return true; } return false; @@ -13202,6 +13264,33 @@ var ts; text.charCodeAt(start + 2) === 33 /* exclamation */; } ts.isPinnedComment = isPinnedComment; + function createCommentDirectivesMap(sourceFile, commentDirectives) { + var directivesByLine = ts.createMapFromEntries(commentDirectives.map(function (commentDirective) { return ([ + "" + ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.pos).line, + commentDirective, + ]); })); + var usedLines = ts.createMap(); + return { getUnusedExpectations: getUnusedExpectations, markUsed: markUsed }; + function getUnusedExpectations() { + return ts.arrayFrom(directivesByLine.entries()) + .filter(function (_a) { + var line = _a[0], directive = _a[1]; + return directive.type === 0 /* ExpectError */ && !usedLines.get(line); + }) + .map(function (_a) { + var _ = _a[0], directive = _a[1]; + return directive; + }); + } + function markUsed(line) { + if (!directivesByLine.has("" + line)) { + return false; + } + usedLines.set("" + line, true); + return true; + } + } + ts.createCommentDirectivesMap = createCommentDirectivesMap; function getTokenPosOfNode(node, sourceFile, includeJsDoc) { // With nodes that have no width (i.e. 'Missing' nodes), we actually *don't* // want to skip trivia because this will launch us forward to the next token. @@ -13218,7 +13307,7 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 324 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 325 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -13343,7 +13432,7 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 242 /* VariableDeclaration */ && node.parent.kind === 280 /* CatchClause */; + return node.kind === 243 /* VariableDeclaration */ && node.parent.kind === 281 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { @@ -13375,11 +13464,11 @@ var ts; ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { // The only kind of module that can be missing a body is a shorthand ambient module. - return node && node.kind === 249 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 250 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 290 /* SourceFile */ || - node.kind === 249 /* ModuleDeclaration */ || + return node.kind === 291 /* SourceFile */ || + node.kind === 250 /* ModuleDeclaration */ || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -13396,9 +13485,9 @@ var ts; // - defined in the top level scope and source file is an external module // - defined inside ambient module declaration located in the top level scope and source file not an external module switch (node.parent.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: return ts.isExternalModule(node.parent); - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -13451,22 +13540,22 @@ var ts; ts.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile; function isBlockScope(node, parentNode) { switch (node.kind) { - case 290 /* SourceFile */: - case 251 /* CaseBlock */: - case 280 /* CatchClause */: - case 249 /* ModuleDeclaration */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 291 /* SourceFile */: + case 252 /* CaseBlock */: + case 281 /* CatchClause */: + case 250 /* ModuleDeclaration */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return true; - case 223 /* Block */: + case 224 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return !ts.isFunctionLike(parentNode); @@ -13476,9 +13565,9 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: - case 305 /* JSDocSignature */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: + case 306 /* JSDocSignature */: return true; default: ts.assertType(node); @@ -13488,25 +13577,25 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isDeclarationWithTypeParameterChildren(node) { switch (node.kind) { - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 160 /* MethodSignature */: - case 167 /* IndexSignature */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 300 /* JSDocFunctionType */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 321 /* JSDocTemplateTag */: - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 161 /* MethodSignature */: + case 168 /* IndexSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 301 /* JSDocFunctionType */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 322 /* JSDocTemplateTag */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return true; default: ts.assertType(node); @@ -13516,8 +13605,8 @@ var ts; ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren; function isAnyImportSyntax(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: return true; default: return false; @@ -13526,15 +13615,15 @@ var ts; ts.isAnyImportSyntax = isAnyImportSyntax; function isLateVisibilityPaintedStatement(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 225 /* VariableStatement */: - case 245 /* ClassDeclaration */: - case 244 /* FunctionDeclaration */: - case 249 /* ModuleDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 226 /* VariableStatement */: + case 246 /* ClassDeclaration */: + case 245 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: return true; default: return false; @@ -13571,7 +13660,7 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: if (isStringOrNumericLiteralLike(name.expression)) return ts.escapeLeadingUnderscores(name.expression.text); return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames"); @@ -13587,9 +13676,9 @@ var ts; case 76 /* PrivateIdentifier */: case 75 /* Identifier */: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: if (ts.isIdentifier(name.name) || ts.isPrivateIdentifier(name.name)) { return entityNameToString(name.expression) + "." + entityNameToString(name.name); } @@ -13630,6 +13719,17 @@ var ts; }; } ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; + function createDiagnosticForRange(sourceFile, range, message) { + return { + file: sourceFile, + start: range.pos, + length: range.end - range.pos, + code: message.code, + category: message.category, + messageText: message.message, + }; + } + ts.createDiagnosticForRange = createDiagnosticForRange; function getSpanOfTokenAtPosition(sourceFile, pos) { var scanner = ts.createScanner(sourceFile.languageVersion, /*skipTrivia*/ true, sourceFile.languageVariant, sourceFile.text, /*onError:*/ undefined, pos); scanner.scan(); @@ -13639,7 +13739,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 223 /* Block */) { + if (node.body && node.body.kind === 224 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -13653,7 +13753,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -13662,28 +13762,28 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 242 /* VariableDeclaration */: - case 191 /* BindingElement */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 247 /* TypeAliasDeclaration */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 243 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 248 /* TypeAliasDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: errorNode = node.name; break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: var start = ts.skipTrivia(sourceFile.text, node.pos); var end = node.statements.length > 0 ? node.statements[0].pos : node.end; return ts.createTextSpanFromBounds(start, end); @@ -13735,11 +13835,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 196 /* CallExpression */ && n.expression.kind === 102 /* SuperKeyword */; + return n.kind === 197 /* CallExpression */ && n.expression.kind === 102 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 196 /* CallExpression */ && n.expression.kind === 96 /* ImportKeyword */; + return n.kind === 197 /* CallExpression */ && n.expression.kind === 96 /* ImportKeyword */; } ts.isImportCall = isImportCall; function isImportMeta(n) { @@ -13753,7 +13853,7 @@ var ts; } ts.isLiteralImportTypeNode = isLiteralImportTypeNode; function isPrologueDirective(node) { - return node.kind === 226 /* ExpressionStatement */ + return node.kind === 227 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -13762,11 +13862,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 156 /* Parameter */ || - node.kind === 155 /* TypeParameter */ || - node.kind === 201 /* FunctionExpression */ || - node.kind === 202 /* ArrowFunction */ || - node.kind === 200 /* ParenthesizedExpression */) ? + var commentRanges = (node.kind === 157 /* Parameter */ || + node.kind === 156 /* TypeParameter */ || + node.kind === 202 /* FunctionExpression */ || + node.kind === 203 /* ArrowFunction */ || + node.kind === 201 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' @@ -13782,48 +13882,48 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (168 /* FirstTypeNode */ <= node.kind && node.kind <= 188 /* LastTypeNode */) { + if (169 /* FirstTypeNode */ <= node.kind && node.kind <= 189 /* LastTypeNode */) { return true; } switch (node.kind) { case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 143 /* StringKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: - case 141 /* ObjectKeyword */: - case 146 /* UndefinedKeyword */: - case 137 /* NeverKeyword */: + case 149 /* UnknownKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 144 /* StringKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: + case 142 /* ObjectKeyword */: + case 147 /* UndefinedKeyword */: + case 138 /* NeverKeyword */: return true; case 110 /* VoidKeyword */: - return node.parent.kind !== 205 /* VoidExpression */; - case 216 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 206 /* VoidExpression */; + case 217 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); - case 155 /* TypeParameter */: - return node.parent.kind === 186 /* MappedType */ || node.parent.kind === 181 /* InferType */; + case 156 /* TypeParameter */: + return node.parent.kind === 187 /* MappedType */ || node.parent.kind === 182 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 75 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 153 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 154 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 75 /* Identifier */ || node.kind === 153 /* QualifiedName */ || node.kind === 194 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + ts.Debug.assert(node.kind === 75 /* Identifier */ || node.kind === 154 /* QualifiedName */ || node.kind === 195 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 153 /* QualifiedName */: - case 194 /* PropertyAccessExpression */: + case 154 /* QualifiedName */: + case 195 /* PropertyAccessExpression */: case 104 /* ThisKeyword */: { var parent = node.parent; - if (parent.kind === 172 /* TypeQuery */) { + if (parent.kind === 173 /* TypeQuery */) { return false; } - if (parent.kind === 188 /* ImportType */) { + if (parent.kind === 189 /* ImportType */) { return !parent.isTypeOf; } // Do not recursively call isPartOfTypeNode on the parent. In the example: @@ -13832,40 +13932,40 @@ var ts; // // Calling isPartOfTypeNode would consider the qualified name A.B a type node. // Only C and A.B.C are type nodes. - if (168 /* FirstTypeNode */ <= parent.kind && parent.kind <= 188 /* LastTypeNode */) { + if (169 /* FirstTypeNode */ <= parent.kind && parent.kind <= 189 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return node === parent.constraint; - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return node === parent.constraint; - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 156 /* Parameter */: - case 242 /* VariableDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 157 /* Parameter */: + case 243 /* VariableDeclaration */: return node === parent.type; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return node === parent.type; - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: return node === parent.type; - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: return node === parent.type; - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: return ts.contains(parent.typeArguments, node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -13890,23 +13990,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitor(node); - case 251 /* CaseBlock */: - case 223 /* Block */: - case 227 /* IfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 236 /* WithStatement */: - case 237 /* SwitchStatement */: - case 277 /* CaseClause */: - case 278 /* DefaultClause */: - case 238 /* LabeledStatement */: - case 240 /* TryStatement */: - case 280 /* CatchClause */: + case 252 /* CaseBlock */: + case 224 /* Block */: + case 228 /* IfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 237 /* WithStatement */: + case 238 /* SwitchStatement */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: + case 239 /* LabeledStatement */: + case 241 /* TryStatement */: + case 281 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -13916,23 +14016,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 248 /* EnumDeclaration */: - case 246 /* InterfaceDeclaration */: - case 249 /* ModuleDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: + case 247 /* InterfaceDeclaration */: + case 250 /* ModuleDeclaration */: + case 248 /* TypeAliasDeclaration */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, skip them to avoid the work. return; default: if (ts.isFunctionLike(node)) { - if (node.name && node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 155 /* ComputedPropertyName */) { // Note that we will not include methods/accessors of a class because they would require // first descending into the class. This is by design. traverse(node.name.expression); @@ -13955,10 +14055,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 174 /* ArrayType */) { + if (node && node.kind === 175 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 169 /* TypeReference */) { + else if (node && node.kind === 170 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -13968,12 +14068,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 246 /* InterfaceDeclaration */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 173 /* TypeLiteral */: + case 247 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 174 /* TypeLiteral */: return node.members; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return node.properties; } } @@ -13981,14 +14081,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 191 /* BindingElement */: - case 284 /* EnumMember */: - case 156 /* Parameter */: - case 281 /* PropertyAssignment */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 282 /* ShorthandPropertyAssignment */: - case 242 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 285 /* EnumMember */: + case 157 /* Parameter */: + case 282 /* PropertyAssignment */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 283 /* ShorthandPropertyAssignment */: + case 243 /* VariableDeclaration */: return true; } } @@ -14000,8 +14100,8 @@ var ts; } ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 243 /* VariableDeclarationList */ - && node.parent.parent.kind === 225 /* VariableStatement */; + return node.parent.kind === 244 /* VariableDeclarationList */ + && node.parent.parent.kind === 226 /* VariableStatement */; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -14012,13 +14112,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return true; } return false; @@ -14029,7 +14129,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 238 /* LabeledStatement */) { + if (node.statement.kind !== 239 /* LabeledStatement */) { return node.statement; } node = node.statement; @@ -14037,17 +14137,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 223 /* Block */ && ts.isFunctionLike(node.parent); + return node && node.kind === 224 /* Block */ && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 161 /* MethodDeclaration */ && node.parent.kind === 193 /* ObjectLiteralExpression */; + return node && node.kind === 162 /* MethodDeclaration */ && node.parent.kind === 194 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 161 /* MethodDeclaration */ && - (node.parent.kind === 193 /* ObjectLiteralExpression */ || - node.parent.kind === 214 /* ClassExpression */); + return node.kind === 162 /* MethodDeclaration */ && + (node.parent.kind === 194 /* ObjectLiteralExpression */ || + node.parent.kind === 215 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -14060,7 +14160,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return objectLiteral.properties.filter(function (property) { - if (property.kind === 281 /* PropertyAssignment */) { + if (property.kind === 282 /* PropertyAssignment */) { var propName = getTextOfPropertyName(property.name); return key === propName || (!!key2 && key2 === propName); } @@ -14101,14 +14201,14 @@ var ts; } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { - ts.Debug.assert(node.kind !== 290 /* SourceFile */); + ts.Debug.assert(node.kind !== 291 /* SourceFile */); while (true) { node = node.parent; if (!node) { return ts.Debug.fail(); // If we never pass in a SourceFile, this should be unreachable, since we'll stop when we reach that. } switch (node.kind) { - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: // If the grandparent node is an object literal (as opposed to a class), // then the computed property is not a 'this' container. // A computed property name in a class needs to be a this container @@ -14123,9 +14223,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 157 /* Decorator */: + case 158 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 156 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 157 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -14136,26 +14236,26 @@ var ts; node = node.parent; } break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 249 /* ModuleDeclaration */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 248 /* EnumDeclaration */: - case 290 /* SourceFile */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 250 /* ModuleDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 249 /* EnumDeclaration */: + case 291 /* SourceFile */: return node; } } @@ -14165,9 +14265,9 @@ var ts; var container = getThisContainer(node, /*includeArrowFunctions*/ false); if (container) { switch (container.kind) { - case 162 /* Constructor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 163 /* Constructor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return container; } } @@ -14189,27 +14289,27 @@ var ts; return node; } switch (node.kind) { - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: node = node.parent; break; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return node; - case 157 /* Decorator */: + case 158 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 156 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 157 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -14225,14 +14325,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 201 /* FunctionExpression */ || func.kind === 202 /* ArrowFunction */) { + if (func.kind === 202 /* FunctionExpression */ || func.kind === 203 /* ArrowFunction */) { var prev = func; var parent = func.parent; - while (parent.kind === 200 /* ParenthesizedExpression */) { + while (parent.kind === 201 /* ParenthesizedExpression */) { prev = parent; parent = parent.parent; } - if (parent.kind === 196 /* CallExpression */ && parent.expression === prev) { + if (parent.kind === 197 /* CallExpression */ && parent.expression === prev) { return parent; } } @@ -14248,7 +14348,7 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 194 /* PropertyAccessExpression */ || kind === 195 /* ElementAccessExpression */) + return (kind === 195 /* PropertyAccessExpression */ || kind === 196 /* ElementAccessExpression */) && node.expression.kind === 102 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; @@ -14257,20 +14357,20 @@ var ts; */ function isThisProperty(node) { var kind = node.kind; - return (kind === 194 /* PropertyAccessExpression */ || kind === 195 /* ElementAccessExpression */) + return (kind === 195 /* PropertyAccessExpression */ || kind === 196 /* ElementAccessExpression */) && node.expression.kind === 104 /* ThisKeyword */; } ts.isThisProperty = isThisProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return node.typeName; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 75 /* Identifier */: - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return node; } return undefined; @@ -14278,10 +14378,10 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { switch (node.kind) { - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return node.tag; - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: return node.tagName; default: return node.expression; @@ -14294,25 +14394,25 @@ var ts; return false; } switch (node.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: // classes are valid targets return true; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return parent.kind === 245 /* ClassDeclaration */; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 161 /* MethodDeclaration */: + return parent.kind === 246 /* ClassDeclaration */; + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 162 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && parent.kind === 245 /* ClassDeclaration */; - case 156 /* Parameter */: + && parent.kind === 246 /* ClassDeclaration */; + case 157 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return parent.body !== undefined - && (parent.kind === 162 /* Constructor */ - || parent.kind === 161 /* MethodDeclaration */ - || parent.kind === 164 /* SetAccessor */) - && grandparent.kind === 245 /* ClassDeclaration */; + && (parent.kind === 163 /* Constructor */ + || parent.kind === 162 /* MethodDeclaration */ + || parent.kind === 165 /* SetAccessor */) + && grandparent.kind === 246 /* ClassDeclaration */; } return false; } @@ -14328,10 +14428,10 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); // TODO: GH#18217 - case 161 /* MethodDeclaration */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 165 /* SetAccessor */: return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); // TODO: GH#18217 default: return false; @@ -14340,9 +14440,9 @@ var ts; ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 268 /* JsxOpeningElement */ || - parent.kind === 267 /* JsxSelfClosingElement */ || - parent.kind === 269 /* JsxClosingElement */) { + if (parent.kind === 269 /* JsxOpeningElement */ || + parent.kind === 268 /* JsxSelfClosingElement */ || + parent.kind === 270 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -14355,44 +14455,44 @@ var ts; case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: case 13 /* RegularExpressionLiteral */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 198 /* TaggedTemplateExpression */: - case 217 /* AsExpression */: - case 199 /* TypeAssertionExpression */: - case 218 /* NonNullExpression */: - case 200 /* ParenthesizedExpression */: - case 201 /* FunctionExpression */: - case 214 /* ClassExpression */: - case 202 /* ArrowFunction */: - case 205 /* VoidExpression */: - case 203 /* DeleteExpression */: - case 204 /* TypeOfExpression */: - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: - case 209 /* BinaryExpression */: - case 210 /* ConditionalExpression */: - case 213 /* SpreadElement */: - case 211 /* TemplateExpression */: - case 215 /* OmittedExpression */: - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 270 /* JsxFragment */: - case 212 /* YieldExpression */: - case 206 /* AwaitExpression */: - case 219 /* MetaProperty */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 199 /* TaggedTemplateExpression */: + case 218 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 219 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: + case 202 /* FunctionExpression */: + case 215 /* ClassExpression */: + case 203 /* ArrowFunction */: + case 206 /* VoidExpression */: + case 204 /* DeleteExpression */: + case 205 /* TypeOfExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: + case 210 /* BinaryExpression */: + case 211 /* ConditionalExpression */: + case 214 /* SpreadElement */: + case 212 /* TemplateExpression */: + case 216 /* OmittedExpression */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 271 /* JsxFragment */: + case 213 /* YieldExpression */: + case 207 /* AwaitExpression */: + case 220 /* MetaProperty */: return true; - case 153 /* QualifiedName */: - while (node.parent.kind === 153 /* QualifiedName */) { + case 154 /* QualifiedName */: + while (node.parent.kind === 154 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 172 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 173 /* TypeQuery */ || isJSXTagName(node); case 75 /* Identifier */: - if (node.parent.kind === 172 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 173 /* TypeQuery */ || isJSXTagName(node)) { return true; } // falls through @@ -14410,49 +14510,49 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 284 /* EnumMember */: - case 281 /* PropertyAssignment */: - case 191 /* BindingElement */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 285 /* EnumMember */: + case 282 /* PropertyAssignment */: + case 192 /* BindingElement */: return parent.initializer === node; - case 226 /* ExpressionStatement */: - case 227 /* IfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 235 /* ReturnStatement */: - case 236 /* WithStatement */: - case 237 /* SwitchStatement */: - case 277 /* CaseClause */: - case 239 /* ThrowStatement */: + case 227 /* ExpressionStatement */: + case 228 /* IfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 236 /* ReturnStatement */: + case 237 /* WithStatement */: + case 238 /* SwitchStatement */: + case 278 /* CaseClause */: + case 240 /* ThrowStatement */: return parent.expression === node; - case 230 /* ForStatement */: + case 231 /* ForStatement */: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 243 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 244 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 243 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 244 /* VariableDeclarationList */) || forInStatement.expression === node; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: return node === parent.expression; - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return node === parent.expression; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return node === parent.expression; - case 157 /* Decorator */: - case 276 /* JsxExpression */: - case 275 /* JsxSpreadAttribute */: - case 283 /* SpreadAssignment */: + case 158 /* Decorator */: + case 277 /* JsxExpression */: + case 276 /* JsxSpreadAttribute */: + case 284 /* SpreadAssignment */: return true; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return parent.objectAssignmentInitializer === node; default: return isExpressionNode(parent); @@ -14460,14 +14560,14 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isPartOfTypeQuery(node) { - while (node.kind === 153 /* QualifiedName */ || node.kind === 75 /* Identifier */) { + while (node.kind === 154 /* QualifiedName */ || node.kind === 75 /* Identifier */) { node = node.parent; } - return node.kind === 172 /* TypeQuery */; + return node.kind === 173 /* TypeQuery */; } ts.isPartOfTypeQuery = isPartOfTypeQuery; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 265 /* ExternalModuleReference */; + return node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 266 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -14476,7 +14576,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 265 /* ExternalModuleReference */; + return node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 266 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJS(file) { @@ -14508,11 +14608,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 143 /* StringKeyword */ || node.typeArguments[0].kind === 140 /* NumberKeyword */); + (node.typeArguments[0].kind === 144 /* StringKeyword */ || node.typeArguments[0].kind === 141 /* NumberKeyword */); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, requireStringLiteralLikeArgument) { - if (callExpression.kind !== 196 /* CallExpression */) { + if (callExpression.kind !== 197 /* CallExpression */) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -14644,11 +14744,11 @@ var ts; function getExpandoInitializer(initializer, isPrototypeAssignment) { if (ts.isCallExpression(initializer)) { var e = skipParentheses(initializer.expression); - return e.kind === 201 /* FunctionExpression */ || e.kind === 202 /* ArrowFunction */ ? initializer : undefined; + return e.kind === 202 /* FunctionExpression */ || e.kind === 203 /* ArrowFunction */ ? initializer : undefined; } - if (initializer.kind === 201 /* FunctionExpression */ || - initializer.kind === 214 /* ClassExpression */ || - initializer.kind === 202 /* ArrowFunction */) { + if (initializer.kind === 202 /* FunctionExpression */ || + initializer.kind === 215 /* ClassExpression */ || + initializer.kind === 203 /* ArrowFunction */) { return initializer; } if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -14874,7 +14974,7 @@ var ts; // exports.name = expr OR module.exports.name = expr OR exports["name"] = expr ... return 1 /* ExportsProperty */; } - if (isBindableStaticNameExpression(lhs, /*excludeThisKeyword*/ true) || (ts.isElementAccessExpression(lhs) && isDynamicName(lhs) && lhs.expression.kind !== 104 /* ThisKeyword */)) { + if (isBindableStaticNameExpression(lhs, /*excludeThisKeyword*/ true) || (ts.isElementAccessExpression(lhs) && isDynamicName(lhs))) { // F.G...x = expr return 5 /* Property */; } @@ -14895,7 +14995,7 @@ var ts; ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment; function isSpecialPropertyDeclaration(expr) { return isInJSFile(expr) && - expr.parent && expr.parent.kind === 226 /* ExpressionStatement */ && + expr.parent && expr.parent.kind === 227 /* ExpressionStatement */ && (!ts.isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!ts.getJSDocTypeTag(expr.parent); } @@ -14905,7 +15005,7 @@ var ts; return false; } var decl = symbol.valueDeclaration; - return decl.kind === 244 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); + return decl.kind === 245 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); } ts.isFunctionSymbol = isFunctionSymbol; function importFromModuleSpecifier(node) { @@ -14914,14 +15014,14 @@ var ts; ts.importFromModuleSpecifier = importFromModuleSpecifier; function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: return node.parent; - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: return node.parent.parent; - case 196 /* CallExpression */: + case 197 /* CallExpression */: return isImportCall(node.parent) || isRequireCall(node.parent, /*checkArg*/ false) ? node.parent : undefined; - case 187 /* LiteralType */: + case 188 /* LiteralType */: ts.Debug.assert(ts.isStringLiteral(node)); return ts.tryCast(node.parent.parent, ts.isImportTypeNode); default: @@ -14931,12 +15031,12 @@ var ts; ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier; function getExternalModuleName(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: return node.moduleSpecifier; - case 253 /* ImportEqualsDeclaration */: - return node.moduleReference.kind === 265 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; - case 188 /* ImportType */: + case 254 /* ImportEqualsDeclaration */: + return node.moduleReference.kind === 266 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; + case 189 /* ImportType */: return isLiteralImportTypeNode(node) ? node.argument.literal : undefined; default: return ts.Debug.assertNever(node); @@ -14945,11 +15045,11 @@ var ts; ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return node; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return node.exportClause && ts.tryCast(node.exportClause, ts.isNamespaceExport); default: return ts.Debug.assertNever(node); @@ -14957,7 +15057,7 @@ var ts; } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 254 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; + return node.kind === 255 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function forEachImportClauseDeclaration(node, action) { @@ -14978,13 +15078,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 156 /* Parameter */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 282 /* ShorthandPropertyAssignment */: - case 281 /* PropertyAssignment */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 157 /* Parameter */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 283 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -14998,7 +15098,7 @@ var ts; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function isJSDocTypeAlias(node) { - return node.kind === 322 /* JSDocTypedefTag */ || node.kind === 315 /* JSDocCallbackTag */ || node.kind === 316 /* JSDocEnumTag */; + return node.kind === 323 /* JSDocTypedefTag */ || node.kind === 316 /* JSDocCallbackTag */ || node.kind === 317 /* JSDocEnumTag */; } ts.isJSDocTypeAlias = isJSDocTypeAlias; function isTypeAlias(node) { @@ -15023,12 +15123,12 @@ var ts; } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: var v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return node.initializer; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return node.initializer; } } @@ -15039,7 +15139,7 @@ var ts; function getNestedModuleDeclaration(node) { return ts.isModuleDeclaration(node) && node.body && - node.body.kind === 249 /* ModuleDeclaration */ + node.body.kind === 250 /* ModuleDeclaration */ ? node.body : undefined; } @@ -15054,11 +15154,11 @@ var ts; if (ts.hasJSDocNodes(node)) { result = ts.append(result, ts.last(node.jsDoc)); } - if (node.kind === 156 /* Parameter */) { + if (node.kind === 157 /* Parameter */) { result = ts.addRange(result, ts.getJSDocParameterTags(node)); break; } - if (node.kind === 155 /* TypeParameter */) { + if (node.kind === 156 /* TypeParameter */) { result = ts.addRange(result, ts.getJSDocTypeParameterTags(node)); break; } @@ -15069,10 +15169,10 @@ var ts; ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags; function getNextJSDocCommentLocation(node) { var parent = node.parent; - if (parent.kind === 281 /* PropertyAssignment */ || - parent.kind === 259 /* ExportAssignment */ || - parent.kind === 159 /* PropertyDeclaration */ || - parent.kind === 226 /* ExpressionStatement */ && node.kind === 194 /* PropertyAccessExpression */ || + if (parent.kind === 282 /* PropertyAssignment */ || + parent.kind === 260 /* ExportAssignment */ || + parent.kind === 160 /* PropertyDeclaration */ || + parent.kind === 227 /* ExpressionStatement */ && node.kind === 195 /* PropertyAccessExpression */ || getNestedModuleDeclaration(parent) || ts.isBinaryExpression(node) && node.operatorToken.kind === 62 /* EqualsToken */) { return parent; @@ -15146,7 +15246,7 @@ var ts; ts.hasRestParameter = hasRestParameter; function isRestParameter(node) { var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type; - return node.dotDotDotToken !== undefined || !!type && type.kind === 301 /* JSDocVariadicType */; + return node.dotDotDotToken !== undefined || !!type && type.kind === 302 /* JSDocVariadicType */; } ts.isRestParameter = isRestParameter; function hasTypeArguments(node) { @@ -15163,31 +15263,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 62 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 200 /* ParenthesizedExpression */: - case 192 /* ArrayLiteralExpression */: - case 213 /* SpreadElement */: - case 218 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: + case 193 /* ArrayLiteralExpression */: + case 214 /* SpreadElement */: + case 219 /* NonNullExpression */: node = parent; break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } node = parent.parent; break; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: if (parent.name === node) { return 0 /* None */; } @@ -15214,22 +15314,22 @@ var ts; */ function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 223 /* Block */: - case 225 /* VariableStatement */: - case 236 /* WithStatement */: - case 227 /* IfStatement */: - case 237 /* SwitchStatement */: - case 251 /* CaseBlock */: - case 277 /* CaseClause */: - case 278 /* DefaultClause */: - case 238 /* LabeledStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 240 /* TryStatement */: - case 280 /* CatchClause */: + case 224 /* Block */: + case 226 /* VariableStatement */: + case 237 /* WithStatement */: + case 228 /* IfStatement */: + case 238 /* SwitchStatement */: + case 252 /* CaseBlock */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: + case 239 /* LabeledStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 241 /* TryStatement */: + case 281 /* CatchClause */: return true; } return false; @@ -15246,33 +15346,33 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 182 /* ParenthesizedType */); + return walkUp(node, 183 /* ParenthesizedType */); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 200 /* ParenthesizedExpression */); + return walkUp(node, 201 /* ParenthesizedExpression */); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; function skipParentheses(node) { - while (node.kind === 200 /* ParenthesizedExpression */) { + while (node.kind === 201 /* ParenthesizedExpression */) { node = node.expression; } return node; } ts.skipParentheses = skipParentheses; function skipParenthesesUp(node) { - while (node.kind === 200 /* ParenthesizedExpression */) { + while (node.kind === 201 /* ParenthesizedExpression */) { node = node.parent; } return node; } // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped function isDeleteTarget(node) { - if (node.kind !== 194 /* PropertyAccessExpression */ && node.kind !== 195 /* ElementAccessExpression */) { + if (node.kind !== 195 /* PropertyAccessExpression */ && node.kind !== 196 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 203 /* DeleteExpression */; + return node && node.kind === 204 /* DeleteExpression */; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -15325,7 +15425,7 @@ var ts; ts.getDeclarationFromName = getDeclarationFromName; function isLiteralComputedPropertyDeclarationName(node) { return isStringOrNumericLiteralLike(node) && - node.parent.kind === 154 /* ComputedPropertyName */ && + node.parent.kind === 155 /* ComputedPropertyName */ && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -15333,32 +15433,32 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 284 /* EnumMember */: - case 281 /* PropertyAssignment */: - case 194 /* PropertyAccessExpression */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 285 /* EnumMember */: + case 282 /* PropertyAssignment */: + case 195 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: // Name on right hand side of dot in a type query or type reference if (parent.right === node) { - while (parent.kind === 153 /* QualifiedName */) { + while (parent.kind === 154 /* QualifiedName */) { parent = parent.parent; } - return parent.kind === 172 /* TypeQuery */ || parent.kind === 169 /* TypeReference */; + return parent.kind === 173 /* TypeQuery */ || parent.kind === 170 /* TypeReference */; } return false; - case 191 /* BindingElement */: - case 258 /* ImportSpecifier */: + case 192 /* BindingElement */: + case 259 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 263 /* ExportSpecifier */: - case 273 /* JsxAttribute */: + case 264 /* ExportSpecifier */: + case 274 /* JsxAttribute */: // Any name in an export specifier or JSX Attribute return true; } @@ -15378,33 +15478,33 @@ var ts; // {} // {name: } function isAliasSymbolDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */ || - node.kind === 252 /* NamespaceExportDeclaration */ || - node.kind === 255 /* ImportClause */ && !!node.name || - node.kind === 256 /* NamespaceImport */ || - node.kind === 262 /* NamespaceExport */ || - node.kind === 258 /* ImportSpecifier */ || - node.kind === 263 /* ExportSpecifier */ || - node.kind === 259 /* ExportAssignment */ && exportAssignmentIsAlias(node) || + return node.kind === 254 /* ImportEqualsDeclaration */ || + node.kind === 253 /* NamespaceExportDeclaration */ || + node.kind === 256 /* ImportClause */ && !!node.name || + node.kind === 257 /* NamespaceImport */ || + node.kind === 263 /* NamespaceExport */ || + node.kind === 259 /* ImportSpecifier */ || + node.kind === 264 /* ExportSpecifier */ || + node.kind === 260 /* ExportAssignment */ && exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableExpression(node.parent.right) || - node.kind === 282 /* ShorthandPropertyAssignment */ || - node.kind === 281 /* PropertyAssignment */ && isAliasableExpression(node.initializer); + node.kind === 283 /* ShorthandPropertyAssignment */ || + node.kind === 282 /* PropertyAssignment */ && isAliasableExpression(node.initializer); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getAliasDeclarationFromName(node) { switch (node.parent.kind) { - case 255 /* ImportClause */: - case 258 /* ImportSpecifier */: - case 256 /* NamespaceImport */: - case 263 /* ExportSpecifier */: - case 259 /* ExportAssignment */: - case 253 /* ImportEqualsDeclaration */: + case 256 /* ImportClause */: + case 259 /* ImportSpecifier */: + case 257 /* NamespaceImport */: + case 264 /* ExportSpecifier */: + case 260 /* ExportAssignment */: + case 254 /* ImportEqualsDeclaration */: return node.parent; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: do { node = node.parent; - } while (node.parent.kind === 153 /* QualifiedName */); + } while (node.parent.kind === 154 /* QualifiedName */); return getAliasDeclarationFromName(node); } } @@ -15423,7 +15523,7 @@ var ts; } ts.getExportAssignmentExpression = getExportAssignmentExpression; function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 282 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 281 /* PropertyAssignment */ ? node.initializer : + return node.kind === 283 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 282 /* PropertyAssignment */ ? node.initializer : node.parent.right; } ts.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression; @@ -15489,11 +15589,11 @@ var ts; } ts.getAncestor = getAncestor; function isKeyword(token) { - return 77 /* FirstKeyword */ <= token && token <= 152 /* LastKeyword */; + return 77 /* FirstKeyword */ <= token && token <= 153 /* LastKeyword */; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 122 /* FirstContextualKeyword */ <= token && token <= 152 /* LastContextualKeyword */; + return 122 /* FirstContextualKeyword */ <= token && token <= 153 /* LastContextualKeyword */; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -15537,14 +15637,14 @@ var ts; } var flags = 0 /* Normal */; switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } // falls through - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: if (hasModifier(node, 256 /* Async */)) { flags |= 2 /* Async */; } @@ -15558,10 +15658,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: return node.body !== undefined && node.asteriskToken === undefined && hasModifier(node, 256 /* Async */); @@ -15594,7 +15694,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - if (!(name.kind === 154 /* ComputedPropertyName */ || name.kind === 195 /* ElementAccessExpression */)) { + if (!(name.kind === 155 /* ComputedPropertyName */ || name.kind === 196 /* ElementAccessExpression */)) { return false; } var expr = ts.isElementAccessExpression(name) ? name.argumentExpression : name.expression; @@ -15620,7 +15720,7 @@ var ts; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -15683,11 +15783,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 156 /* Parameter */; + return root.kind === 157 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 191 /* BindingElement */) { + while (node.kind === 192 /* BindingElement */) { node = node.parent.parent; } return node; @@ -15695,15 +15795,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 162 /* Constructor */ - || kind === 201 /* FunctionExpression */ - || kind === 244 /* FunctionDeclaration */ - || kind === 202 /* ArrowFunction */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */ - || kind === 249 /* ModuleDeclaration */ - || kind === 290 /* SourceFile */; + return kind === 163 /* Constructor */ + || kind === 202 /* FunctionExpression */ + || kind === 245 /* FunctionDeclaration */ + || kind === 203 /* ArrowFunction */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */ + || kind === 250 /* ModuleDeclaration */ + || kind === 291 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -15722,23 +15822,23 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 197 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 198 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 197 /* NewExpression */: + case 198 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 207 /* PrefixUnaryExpression */: - case 204 /* TypeOfExpression */: - case 205 /* VoidExpression */: - case 203 /* DeleteExpression */: - case 206 /* AwaitExpression */: - case 210 /* ConditionalExpression */: - case 212 /* YieldExpression */: + case 208 /* PrefixUnaryExpression */: + case 205 /* TypeOfExpression */: + case 206 /* VoidExpression */: + case 204 /* DeleteExpression */: + case 207 /* AwaitExpression */: + case 211 /* ConditionalExpression */: + case 213 /* YieldExpression */: return 1 /* Right */; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (operator) { case 42 /* AsteriskAsteriskToken */: case 62 /* EqualsToken */: @@ -15762,15 +15862,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 197 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 198 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 209 /* BinaryExpression */) { + if (expression.kind === 210 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 207 /* PrefixUnaryExpression */ || expression.kind === 208 /* PostfixUnaryExpression */) { + else if (expression.kind === 208 /* PrefixUnaryExpression */ || expression.kind === 209 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -15780,15 +15880,15 @@ var ts; ts.getOperator = getOperator; function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: return 0; - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return 1; - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return 2; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return 4; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (operatorKind) { case 27 /* CommaToken */: return 0; @@ -15809,21 +15909,21 @@ var ts; default: return getBinaryOperatorPrecedence(operatorKind); } - case 207 /* PrefixUnaryExpression */: - case 204 /* TypeOfExpression */: - case 205 /* VoidExpression */: - case 203 /* DeleteExpression */: - case 206 /* AwaitExpression */: + case 208 /* PrefixUnaryExpression */: + case 205 /* TypeOfExpression */: + case 206 /* VoidExpression */: + case 204 /* DeleteExpression */: + case 207 /* AwaitExpression */: return 16; - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return 17; - case 196 /* CallExpression */: + case 197 /* CallExpression */: return 18; - case 197 /* NewExpression */: + case 198 /* NewExpression */: return hasArguments ? 19 : 18; - case 198 /* TaggedTemplateExpression */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 199 /* TaggedTemplateExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return 19; case 104 /* ThisKeyword */: case 102 /* SuperKeyword */: @@ -15834,19 +15934,19 @@ var ts; case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 214 /* ClassExpression */: - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 270 /* JsxFragment */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 215 /* ClassExpression */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 271 /* JsxFragment */: case 13 /* RegularExpressionLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 211 /* TemplateExpression */: - case 200 /* ParenthesizedExpression */: - case 215 /* OmittedExpression */: + case 212 /* TemplateExpression */: + case 201 /* ParenthesizedExpression */: + case 216 /* OmittedExpression */: return 20; default: return -1; @@ -16448,10 +16548,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 163 /* GetAccessor */) { + if (accessor.kind === 164 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 164 /* SetAccessor */) { + else if (accessor.kind === 165 /* SetAccessor */) { setAccessor = accessor; } else { @@ -16471,10 +16571,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 163 /* GetAccessor */ && !getAccessor) { + if (member.kind === 164 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 164 /* SetAccessor */ && !setAccessor) { + if (member.kind === 165 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -16523,7 +16623,7 @@ var ts; ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations; /** template tags are only available when a typedef isn't already using them */ function isNonTypeAliasTemplate(tag) { - return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 303 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); + return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 304 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); } /** * Gets the effective type annotation of the value parameter of a set accessor. If the node @@ -16747,7 +16847,7 @@ var ts; } ts.getSelectedModifierFlags = getSelectedModifierFlags; function getModifierFlags(node) { - if (node.kind >= 0 /* FirstToken */ && node.kind <= 152 /* LastToken */) { + if (node.kind >= 0 /* FirstToken */ && node.kind <= 153 /* LastToken */) { return 0 /* None */; } if (node.modifierFlagsCache & 536870912 /* HasComputedFlags */) { @@ -16789,11 +16889,11 @@ var ts; case 117 /* PrivateKeyword */: return 8 /* Private */; case 122 /* AbstractKeyword */: return 128 /* Abstract */; case 89 /* ExportKeyword */: return 1 /* Export */; - case 130 /* DeclareKeyword */: return 2 /* Ambient */; + case 131 /* DeclareKeyword */: return 2 /* Ambient */; case 81 /* ConstKeyword */: return 2048 /* Const */; case 84 /* DefaultKeyword */: return 512 /* Default */; case 126 /* AsyncKeyword */: return 256 /* Async */; - case 138 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 139 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } @@ -16833,8 +16933,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 193 /* ObjectLiteralExpression */ - || kind === 192 /* ArrayLiteralExpression */; + return kind === 194 /* ObjectLiteralExpression */ + || kind === 193 /* ArrayLiteralExpression */; } return false; } @@ -16851,12 +16951,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: do { node = node.left; } while (node.kind !== 75 /* Identifier */); return node; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 75 /* Identifier */); @@ -16866,14 +16966,19 @@ var ts; ts.getFirstIdentifier = getFirstIdentifier; function isDottedName(node) { return node.kind === 75 /* Identifier */ || node.kind === 104 /* ThisKeyword */ || node.kind === 102 /* SuperKeyword */ || - node.kind === 194 /* PropertyAccessExpression */ && isDottedName(node.expression) || - node.kind === 200 /* ParenthesizedExpression */ && isDottedName(node.expression); + node.kind === 195 /* PropertyAccessExpression */ && isDottedName(node.expression) || + node.kind === 201 /* ParenthesizedExpression */ && isDottedName(node.expression); } ts.isDottedName = isDottedName; function isPropertyAccessEntityNameExpression(node) { return ts.isPropertyAccessExpression(node) && isEntityNameExpression(node.expression); } ts.isPropertyAccessEntityNameExpression = isPropertyAccessEntityNameExpression; + function isConstructorAccessExpression(expr) { + return (ts.isPropertyAccessExpression(expr) && ts.idText(expr.name) === "constructor" || + ts.isElementAccessExpression(expr) && ts.isStringLiteralLike(expr.argumentExpression) && expr.argumentExpression.text === "constructor"); + } + ts.isConstructorAccessExpression = isConstructorAccessExpression; function tryGetPropertyAccessOrIdentifierToString(expr) { if (ts.isPropertyAccessExpression(expr)) { var baseStr = tryGetPropertyAccessOrIdentifierToString(expr.expression); @@ -16892,17 +16997,17 @@ var ts; } ts.isPrototypeAccess = isPrototypeAccess; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 153 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 154 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 193 /* ObjectLiteralExpression */ && + return expression.kind === 194 /* ObjectLiteralExpression */ && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 192 /* ArrayLiteralExpression */ && + return expression.kind === 193 /* ArrayLiteralExpression */ && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -17200,8 +17305,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 248 /* EnumDeclaration */: - case 249 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 250 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -17278,35 +17383,35 @@ var ts; if (!parent) return 0 /* Read */; switch (parent.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return accessKind(parent); - case 208 /* PostfixUnaryExpression */: - case 207 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: var operator = parent.operator; return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 62 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return parent.name !== node ? 0 /* Read */ : accessKind(parent); - case 281 /* PropertyAssignment */: { + case 282 /* PropertyAssignment */: { var parentAccess = accessKind(parent.parent); // In `({ x: varname }) = { x: 1 }`, the left `x` is a read, the right `x` is a write. return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess; } - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: // Assume it's the local variable being accessed, since we don't check public properties for --noUnusedLocals. return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return accessKind(parent); default: return 0 /* Read */; } function writeOrReadWrite() { // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect. - return parent.parent && skipParenthesesUp(parent.parent).kind === 226 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; + return parent.parent && skipParenthesesUp(parent.parent).kind === 227 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; } } function reverseAccessKind(a) { @@ -17455,39 +17560,39 @@ var ts; } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; function isTypeNodeKind(kind) { - return (kind >= 168 /* FirstTypeNode */ && kind <= 188 /* LastTypeNode */) + return (kind >= 169 /* FirstTypeNode */ && kind <= 189 /* LastTypeNode */) || kind === 125 /* AnyKeyword */ - || kind === 148 /* UnknownKeyword */ - || kind === 140 /* NumberKeyword */ - || kind === 151 /* BigIntKeyword */ - || kind === 141 /* ObjectKeyword */ - || kind === 128 /* BooleanKeyword */ - || kind === 143 /* StringKeyword */ - || kind === 144 /* SymbolKeyword */ + || kind === 149 /* UnknownKeyword */ + || kind === 141 /* NumberKeyword */ + || kind === 152 /* BigIntKeyword */ + || kind === 142 /* ObjectKeyword */ + || kind === 129 /* BooleanKeyword */ + || kind === 144 /* StringKeyword */ + || kind === 145 /* SymbolKeyword */ || kind === 104 /* ThisKeyword */ || kind === 110 /* VoidKeyword */ - || kind === 146 /* UndefinedKeyword */ + || kind === 147 /* UndefinedKeyword */ || kind === 100 /* NullKeyword */ - || kind === 137 /* NeverKeyword */ - || kind === 216 /* ExpressionWithTypeArguments */ - || kind === 295 /* JSDocAllType */ - || kind === 296 /* JSDocUnknownType */ - || kind === 297 /* JSDocNullableType */ - || kind === 298 /* JSDocNonNullableType */ - || kind === 299 /* JSDocOptionalType */ - || kind === 300 /* JSDocFunctionType */ - || kind === 301 /* JSDocVariadicType */; + || kind === 138 /* NeverKeyword */ + || kind === 217 /* ExpressionWithTypeArguments */ + || kind === 296 /* JSDocAllType */ + || kind === 297 /* JSDocUnknownType */ + || kind === 298 /* JSDocNullableType */ + || kind === 299 /* JSDocNonNullableType */ + || kind === 300 /* JSDocOptionalType */ + || kind === 301 /* JSDocFunctionType */ + || kind === 302 /* JSDocVariadicType */; } ts.isTypeNodeKind = isTypeNodeKind; function isAccessExpression(node) { - return node.kind === 194 /* PropertyAccessExpression */ || node.kind === 195 /* ElementAccessExpression */; + return node.kind === 195 /* PropertyAccessExpression */ || node.kind === 196 /* ElementAccessExpression */; } ts.isAccessExpression = isAccessExpression; function getNameOfAccessExpression(node) { - if (node.kind === 194 /* PropertyAccessExpression */) { + if (node.kind === 195 /* PropertyAccessExpression */) { return node.name; } - ts.Debug.assert(node.kind === 195 /* ElementAccessExpression */); + ts.Debug.assert(node.kind === 196 /* ElementAccessExpression */); return node.argumentExpression; } ts.getNameOfAccessExpression = getNameOfAccessExpression; @@ -17501,12 +17606,8 @@ var ts; } } ts.isBundleFileTextLike = isBundleFileTextLike; - function getDotOrQuestionDotToken(node) { - return node.questionDotToken || ts.createNode(24 /* DotToken */, node.expression.end, node.name.pos); - } - ts.getDotOrQuestionDotToken = getDotOrQuestionDotToken; function isNamedImportsOrExports(node) { - return node.kind === 257 /* NamedImports */ || node.kind === 261 /* NamedExports */; + return node.kind === 258 /* NamedImports */ || node.kind === 262 /* NamedExports */; } ts.isNamedImportsOrExports = isNamedImportsOrExports; function Symbol(flags, name) { @@ -18584,34 +18685,44 @@ var ts; function isValidTypeOnlyAliasUseSite(useSite) { return !!(useSite.flags & 8388608 /* Ambient */) || isPartOfTypeQuery(useSite) - || isFirstIdentifierOfNonEmittingHeritageClause(useSite) + || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !isExpressionNode(useSite); } ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite; function typeOnlyDeclarationIsExport(typeOnlyDeclaration) { - return typeOnlyDeclaration.kind === 263 /* ExportSpecifier */; + return typeOnlyDeclaration.kind === 264 /* ExportSpecifier */; } ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport; function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { - while (node.kind === 75 /* Identifier */ || node.kind === 194 /* PropertyAccessExpression */) { + while (node.kind === 75 /* Identifier */ || node.kind === 195 /* PropertyAccessExpression */) { node = node.parent; } - if (node.kind !== 154 /* ComputedPropertyName */) { + if (node.kind !== 155 /* ComputedPropertyName */) { return false; } if (hasModifier(node.parent, 128 /* Abstract */)) { return true; } var containerKind = node.parent.parent.kind; - return containerKind === 246 /* InterfaceDeclaration */ || containerKind === 173 /* TypeLiteral */; + return containerKind === 247 /* InterfaceDeclaration */ || containerKind === 174 /* TypeLiteral */; } - /** Returns true for the first identifier of 1) an `implements` clause, and 2) an `extends` clause of an interface. */ - function isFirstIdentifierOfNonEmittingHeritageClause(node) { - var _a, _b; - // Number of parents to climb from identifier is 2 for `implements I`, 3 for `implements x.I` - var heritageClause = (_a = ts.tryCast(node.parent.parent, ts.isHeritageClause)) !== null && _a !== void 0 ? _a : ts.tryCast((_b = node.parent.parent) === null || _b === void 0 ? void 0 : _b.parent, ts.isHeritageClause); - return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 246 /* InterfaceDeclaration */; + /** Returns true for an identifier in 1) an `implements` clause, and 2) an `extends` clause of an interface. */ + function isIdentifierInNonEmittingHeritageClause(node) { + if (node.kind !== 75 /* Identifier */) + return false; + var heritageClause = findAncestor(node.parent, function (parent) { + switch (parent.kind) { + case 280 /* HeritageClause */: + return true; + case 195 /* PropertyAccessExpression */: + case 217 /* ExpressionWithTypeArguments */: + return false; + default: + return "quit"; + } + }); + return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 247 /* InterfaceDeclaration */; } })(ts || (ts = {})); var ts; @@ -18631,7 +18742,7 @@ var ts; var PrivateIdentifierConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 290 /* SourceFile */) { + if (kind === 291 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 75 /* Identifier */) { @@ -18686,19 +18797,19 @@ var ts; * that they appear in the source code. The language service depends on this property to locate nodes by position. */ function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 152 /* LastToken */) { + if (!node || node.kind <= 153 /* LastToken */) { return; } switch (node.kind) { - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -18706,9 +18817,9 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 156 /* Parameter */: + case 157 /* Parameter */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || @@ -18716,7 +18827,7 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -18724,51 +18835,51 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.initializer); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -18780,359 +18891,359 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return visitNode(cbNode, node.assertsModifier) || visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return visitNodes(cbNode, cbNodes, node.members); - case 174 /* ArrayType */: + case 175 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 175 /* TupleType */: + case 176 /* TupleType */: return visitNodes(cbNode, cbNodes, node.elementTypes); - case 178 /* UnionType */: - case 179 /* IntersectionType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: return visitNodes(cbNode, cbNodes, node.types); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return visitNode(cbNode, node.checkType) || visitNode(cbNode, node.extendsType) || visitNode(cbNode, node.trueType) || visitNode(cbNode, node.falseType); - case 181 /* InferType */: + case 182 /* InferType */: return visitNode(cbNode, node.typeParameter); - case 188 /* ImportType */: + case 189 /* ImportType */: return visitNode(cbNode, node.argument) || visitNode(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 182 /* ParenthesizedType */: - case 184 /* TypeOperator */: + case 183 /* ParenthesizedType */: + case 185 /* TypeOperator */: return visitNode(cbNode, node.type); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 186 /* MappedType */: + case 187 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 187 /* LiteralType */: + case 188 /* LiteralType */: return visitNode(cbNode, node.literal); - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: return visitNodes(cbNode, cbNodes, node.elements); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return visitNodes(cbNode, cbNodes, node.properties); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.name); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.argumentExpression); - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.template); - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 217 /* AsExpression */: + case 218 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return visitNode(cbNode, node.name); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 223 /* Block */: - case 250 /* ModuleBlock */: + case 224 /* Block */: + case 251 /* ModuleBlock */: return visitNodes(cbNode, cbNodes, node.statements); - case 290 /* SourceFile */: + case 291 /* SourceFile */: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return visitNodes(cbNode, cbNodes, node.declarations); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 233 /* ContinueStatement */: - case 234 /* BreakStatement */: + case 234 /* ContinueStatement */: + case 235 /* BreakStatement */: return visitNode(cbNode, node.label); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return visitNodes(cbNode, cbNodes, node.clauses); - case 277 /* CaseClause */: + case 278 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: return visitNodes(cbNode, cbNodes, node.statements); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 157 /* Decorator */: + case 158 /* Decorator */: return visitNode(cbNode, node.expression); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 284 /* EnumMember */: + case 285 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: return visitNode(cbNode, node.name); - case 257 /* NamedImports */: - case 261 /* NamedExports */: + case 258 /* NamedImports */: + case 262 /* NamedExports */: return visitNodes(cbNode, cbNodes, node.elements); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: return visitNodes(cbNode, cbNodes, node.types); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 264 /* MissingDeclaration */: + case 265 /* MissingDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators); - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 266 /* JsxElement */: + case 267 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.attributes); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return visitNodes(cbNode, cbNodes, node.properties); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 275 /* JsxSpreadAttribute */: + case 276 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 176 /* OptionalType */: - case 177 /* RestType */: - case 294 /* JSDocTypeExpression */: - case 298 /* JSDocNonNullableType */: - case 297 /* JSDocNullableType */: - case 299 /* JSDocOptionalType */: - case 301 /* JSDocVariadicType */: + case 177 /* OptionalType */: + case 178 /* RestType */: + case 295 /* JSDocTypeExpression */: + case 299 /* JSDocNonNullableType */: + case 298 /* JSDocNullableType */: + case 300 /* JSDocOptionalType */: + case 302 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 303 /* JSDocComment */: + case 304 /* JSDocComment */: return visitNodes(cbNode, cbNodes, node.tags); - case 317 /* JSDocParameterTag */: - case 323 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: + case 324 /* JSDocPropertyTag */: return visitNode(cbNode, node.tagName) || (node.isNameFirst ? visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression) : visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name)); - case 309 /* JSDocAuthorTag */: + case 310 /* JSDocAuthorTag */: return visitNode(cbNode, node.tagName); - case 308 /* JSDocImplementsTag */: + case 309 /* JSDocImplementsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 307 /* JSDocAugmentsTag */: + case 308 /* JSDocAugmentsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); - case 322 /* JSDocTypedefTag */: + case 323 /* JSDocTypedefTag */: return visitNode(cbNode, node.tagName) || (node.typeExpression && - node.typeExpression.kind === 294 /* JSDocTypeExpression */ + node.typeExpression.kind === 295 /* JSDocTypeExpression */ ? visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) : visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression)); - case 315 /* JSDocCallbackTag */: + case 316 /* JSDocCallbackTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); - case 318 /* JSDocReturnTag */: - case 320 /* JSDocTypeTag */: - case 319 /* JSDocThisTag */: - case 316 /* JSDocEnumTag */: + case 319 /* JSDocReturnTag */: + case 321 /* JSDocTypeTag */: + case 320 /* JSDocThisTag */: + case 317 /* JSDocEnumTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.typeExpression); - case 305 /* JSDocSignature */: + case 306 /* JSDocSignature */: return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); - case 304 /* JSDocTypeLiteral */: + case 305 /* JSDocTypeLiteral */: return ts.forEach(node.jsDocPropertyTags, cbNode); - case 306 /* JSDocTag */: - case 310 /* JSDocClassTag */: - case 311 /* JSDocPublicTag */: - case 312 /* JSDocPrivateTag */: - case 313 /* JSDocProtectedTag */: - case 314 /* JSDocReadonlyTag */: + case 307 /* JSDocTag */: + case 311 /* JSDocClassTag */: + case 312 /* JSDocPublicTag */: + case 313 /* JSDocPrivateTag */: + case 314 /* JSDocProtectedTag */: + case 315 /* JSDocReadonlyTag */: return visitNode(cbNode, node.tagName); - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } } @@ -19421,7 +19532,7 @@ var ts; sourceFile.endOfFileToken = parseTokenNode(); } else { - var statement = createNode(226 /* ExpressionStatement */); + var statement = createNode(227 /* ExpressionStatement */); switch (token()) { case 22 /* OpenBracketToken */: statement.expression = parseArrayLiteralExpression(); @@ -19505,6 +19616,7 @@ var ts; } function clearState() { // Clear out the text the scanner is pointing at, so it doesn't keep anything alive unnecessarily. + scanner.clearCommentDirectives(); scanner.setText(""); scanner.setOnError(undefined); // Clear any data. We don't want to accidentally hold onto it for too long. @@ -19531,6 +19643,7 @@ var ts; ts.Debug.assert(token() === 1 /* EndOfFileToken */); sourceFile.endOfFileToken = addJSDocComment(parseTokenNode()); setExternalModuleIndicator(sourceFile); + sourceFile.commentDirectives = scanner.getCommentDirectives(); sourceFile.nodeCount = nodeCount; sourceFile.identifierCount = identifierCount; sourceFile.identifiers = identifiers; @@ -19571,7 +19684,7 @@ var ts; function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(290 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(291 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -19903,7 +20016,7 @@ var ts; } function createNodeWithJSDoc(kind, pos) { var node = createNode(kind, pos); - if (scanner.getTokenFlags() & 2 /* PrecedingJSDocComment */) { + if (scanner.getTokenFlags() & 2 /* PrecedingJSDocComment */ && (kind !== 227 /* ExpressionStatement */ || token() !== 20 /* OpenParenToken */)) { addJSDocComment(node); } return node; @@ -20015,7 +20128,7 @@ var ts; // PropertyName [Yield]: // LiteralPropertyName // ComputedPropertyName[?Yield] - var node = createNode(154 /* ComputedPropertyName */); + var node = createNode(155 /* ComputedPropertyName */); parseExpected(22 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -20057,15 +20170,15 @@ var ts; if (token() === 84 /* DefaultKeyword */) { return lookAhead(nextTokenCanFollowDefaultKeyword); } - if (token() === 145 /* TypeKeyword */) { + if (token() === 146 /* TypeKeyword */) { return lookAhead(nextTokenCanFollowExportModifier); } return canFollowExportModifier(); case 84 /* DefaultKeyword */: return nextTokenCanFollowDefaultKeyword(); case 120 /* StaticKeyword */: - case 131 /* GetKeyword */: - case 142 /* SetKeyword */: + case 132 /* GetKeyword */: + case 143 /* SetKeyword */: nextToken(); return canFollowModifier(); default: @@ -20475,20 +20588,20 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 162 /* Constructor */: - case 167 /* IndexSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 159 /* PropertyDeclaration */: - case 222 /* SemicolonClassElement */: + case 163 /* Constructor */: + case 168 /* IndexSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 223 /* SemicolonClassElement */: return true; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: // Method declarations are not necessarily reusable. An object-literal // may have a method calls "constructor(...)" and we must reparse that // into an actual .ConstructorDeclaration. var methodDeclaration = node; var nameIsConstructor = methodDeclaration.name.kind === 75 /* Identifier */ && - methodDeclaration.name.originalKeywordKind === 129 /* ConstructorKeyword */; + methodDeclaration.name.originalKeywordKind === 130 /* ConstructorKeyword */; return !nameIsConstructor; } } @@ -20497,8 +20610,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: return true; } } @@ -20507,58 +20620,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 225 /* VariableStatement */: - case 223 /* Block */: - case 227 /* IfStatement */: - case 226 /* ExpressionStatement */: - case 239 /* ThrowStatement */: - case 235 /* ReturnStatement */: - case 237 /* SwitchStatement */: - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 230 /* ForStatement */: - case 229 /* WhileStatement */: - case 236 /* WithStatement */: - case 224 /* EmptyStatement */: - case 240 /* TryStatement */: - case 238 /* LabeledStatement */: - case 228 /* DoStatement */: - case 241 /* DebuggerStatement */: - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 260 /* ExportDeclaration */: - case 259 /* ExportAssignment */: - case 249 /* ModuleDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 245 /* FunctionDeclaration */: + case 226 /* VariableStatement */: + case 224 /* Block */: + case 228 /* IfStatement */: + case 227 /* ExpressionStatement */: + case 240 /* ThrowStatement */: + case 236 /* ReturnStatement */: + case 238 /* SwitchStatement */: + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 231 /* ForStatement */: + case 230 /* WhileStatement */: + case 237 /* WithStatement */: + case 225 /* EmptyStatement */: + case 241 /* TryStatement */: + case 239 /* LabeledStatement */: + case 229 /* DoStatement */: + case 242 /* DebuggerStatement */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 261 /* ExportDeclaration */: + case 260 /* ExportAssignment */: + case 250 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 284 /* EnumMember */; + return node.kind === 285 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 166 /* ConstructSignature */: - case 160 /* MethodSignature */: - case 167 /* IndexSignature */: - case 158 /* PropertySignature */: - case 165 /* CallSignature */: + case 167 /* ConstructSignature */: + case 161 /* MethodSignature */: + case 168 /* IndexSignature */: + case 159 /* PropertySignature */: + case 166 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 242 /* VariableDeclaration */) { + if (node.kind !== 243 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -20579,7 +20692,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 156 /* Parameter */) { + if (node.kind !== 157 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -20718,7 +20831,7 @@ var ts; return entity; } function createQualifiedName(entity, name) { - var node = createNode(153 /* QualifiedName */, entity.pos); + var node = createNode(154 /* QualifiedName */, entity.pos); node.left = entity; node.right = name; return finishNode(node); @@ -20759,7 +20872,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression(isTaggedTemplate) { - var template = createNode(211 /* TemplateExpression */); + var template = createNode(212 /* TemplateExpression */); template.head = parseTemplateHead(isTaggedTemplate); ts.Debug.assert(template.head.kind === 15 /* TemplateHead */, "Template head has wrong token kind"); var list = []; @@ -20771,7 +20884,7 @@ var ts; return finishNode(template); } function parseTemplateSpan(isTaggedTemplate) { - var span = createNode(221 /* TemplateSpan */); + var span = createNode(222 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token() === 19 /* CloseBraceToken */) { @@ -20837,7 +20950,7 @@ var ts; } // TYPES function parseTypeReference() { - var node = createNode(169 /* TypeReference */); + var node = createNode(170 /* TypeReference */); node.typeName = parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29 /* LessThanToken */) { node.typeArguments = parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */); @@ -20847,14 +20960,14 @@ var ts; // If true, we should abort parsing an error function. function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return ts.nodeIsMissing(node.typeName); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: { + case 171 /* FunctionType */: + case 172 /* ConstructorType */: { var _a = node, parameters = _a.parameters, type = _a.type; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -20862,20 +20975,20 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(168 /* TypePredicate */, lhs.pos); + var node = createNode(169 /* TypePredicate */, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(183 /* ThisType */); + var node = createNode(184 /* ThisType */); nextToken(); return finishNode(node); } function parseJSDocAllType(postFixEquals) { - var result = createNode(295 /* JSDocAllType */); + var result = createNode(296 /* JSDocAllType */); if (postFixEquals) { - return createPostfixType(299 /* JSDocOptionalType */, result); + return createPostfixType(300 /* JSDocOptionalType */, result); } else { nextToken(); @@ -20883,7 +20996,7 @@ var ts; return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(298 /* JSDocNonNullableType */); + var result = createNode(299 /* JSDocNonNullableType */); nextToken(); result.type = parseNonArrayType(); return finishNode(result); @@ -20907,28 +21020,28 @@ var ts; token() === 31 /* GreaterThanToken */ || token() === 62 /* EqualsToken */ || token() === 51 /* BarToken */) { - var result = createNode(296 /* JSDocUnknownType */, pos); + var result = createNode(297 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(297 /* JSDocNullableType */, pos); + var result = createNode(298 /* JSDocNullableType */, pos); result.type = parseType(); return finishNode(result); } } function parseJSDocFunctionType() { if (lookAhead(nextTokenIsOpenParen)) { - var result = createNodeWithJSDoc(300 /* JSDocFunctionType */); + var result = createNodeWithJSDoc(301 /* JSDocFunctionType */); nextToken(); fillSignature(58 /* ColonToken */, 4 /* Type */ | 32 /* JSDoc */, result); return finishNode(result); } - var node = createNode(169 /* TypeReference */); + var node = createNode(170 /* TypeReference */); node.typeName = parseIdentifierName(); return finishNode(node); } function parseJSDocParameter() { - var parameter = createNode(156 /* Parameter */); + var parameter = createNode(157 /* Parameter */); if (token() === 104 /* ThisKeyword */ || token() === 99 /* NewKeyword */) { parameter.name = parseIdentifierName(); parseExpected(58 /* ColonToken */); @@ -20938,9 +21051,9 @@ var ts; } function parseJSDocType() { scanner.setInJSDocType(true); - var moduleSpecifier = parseOptionalToken(135 /* ModuleKeyword */); + var moduleSpecifier = parseOptionalToken(136 /* ModuleKeyword */); if (moduleSpecifier) { - var moduleTag = createNode(302 /* JSDocNamepathType */, moduleSpecifier.pos); + var moduleTag = createNode(303 /* JSDocNamepathType */, moduleSpecifier.pos); terminate: while (true) { switch (token()) { case 19 /* CloseBraceToken */: @@ -20959,23 +21072,23 @@ var ts; var type = parseTypeOrTypePredicate(); scanner.setInJSDocType(false); if (dotdotdot) { - var variadic = createNode(301 /* JSDocVariadicType */, dotdotdot.pos); + var variadic = createNode(302 /* JSDocVariadicType */, dotdotdot.pos); variadic.type = type; type = finishNode(variadic); } if (token() === 62 /* EqualsToken */) { - return createPostfixType(299 /* JSDocOptionalType */, type); + return createPostfixType(300 /* JSDocOptionalType */, type); } return type; } function parseTypeQuery() { - var node = createNode(172 /* TypeQuery */); + var node = createNode(173 /* TypeQuery */); parseExpected(108 /* TypeOfKeyword */); node.exprName = parseEntityName(/*allowReservedWords*/ true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(155 /* TypeParameter */); + var node = createNode(156 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(90 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the @@ -21020,7 +21133,7 @@ var ts; isStartOfType(/*inStartOfParameter*/ !isJSDocParameter); } function parseParameter() { - var node = createNodeWithJSDoc(156 /* Parameter */); + var node = createNodeWithJSDoc(157 /* Parameter */); if (token() === 104 /* ThisKeyword */) { node.name = createIdentifier(/*isIdentifier*/ true); node.type = parseParameterType(); @@ -21121,7 +21234,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 166 /* ConstructSignature */) { + if (kind === 167 /* ConstructSignature */) { parseExpected(99 /* NewKeyword */); } fillSignature(58 /* ColonToken */, 4 /* Type */, node); @@ -21182,7 +21295,7 @@ var ts; return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(node) { - node.kind = 167 /* IndexSignature */; + node.kind = 168 /* IndexSignature */; node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -21192,13 +21305,13 @@ var ts; node.name = parsePropertyName(); node.questionToken = parseOptionalToken(57 /* QuestionToken */); if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - node.kind = 160 /* MethodSignature */; + node.kind = 161 /* MethodSignature */; // Method signatures don't exist in expression contexts. So they have neither // [Yield] nor [Await] fillSignature(58 /* ColonToken */, 4 /* Type */, node); } else { - node.kind = 158 /* PropertySignature */; + node.kind = 159 /* PropertySignature */; node.type = parseTypeAnnotation(); if (token() === 62 /* EqualsToken */) { // Although type literal properties cannot not have initializers, we attempt @@ -21244,10 +21357,10 @@ var ts; } function parseTypeMember() { if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - return parseSignatureMember(165 /* CallSignature */); + return parseSignatureMember(166 /* CallSignature */); } if (token() === 99 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(166 /* ConstructSignature */); + return parseSignatureMember(167 /* ConstructSignature */); } var node = createNodeWithJSDoc(0 /* Unknown */); node.modifiers = parseModifiers(); @@ -21273,7 +21386,7 @@ var ts; return false; } function parseTypeLiteral() { - var node = createNode(173 /* TypeLiteral */); + var node = createNode(174 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -21291,27 +21404,27 @@ var ts; function isStartOfMappedType() { nextToken(); if (token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { - return nextToken() === 138 /* ReadonlyKeyword */; + return nextToken() === 139 /* ReadonlyKeyword */; } - if (token() === 138 /* ReadonlyKeyword */) { + if (token() === 139 /* ReadonlyKeyword */) { nextToken(); } return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 97 /* InKeyword */; } function parseMappedTypeParameter() { - var node = createNode(155 /* TypeParameter */); + var node = createNode(156 /* TypeParameter */); node.name = parseIdentifier(); parseExpected(97 /* InKeyword */); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(186 /* MappedType */); + var node = createNode(187 /* MappedType */); parseExpected(18 /* OpenBraceToken */); - if (token() === 138 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { + if (token() === 139 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { node.readonlyToken = parseTokenNode(); - if (node.readonlyToken.kind !== 138 /* ReadonlyKeyword */) { - parseExpectedToken(138 /* ReadonlyKeyword */); + if (node.readonlyToken.kind !== 139 /* ReadonlyKeyword */) { + parseExpectedToken(139 /* ReadonlyKeyword */); } } parseExpected(22 /* OpenBracketToken */); @@ -21331,23 +21444,23 @@ var ts; function parseTupleElementType() { var pos = getNodePos(); if (parseOptional(25 /* DotDotDotToken */)) { - var node = createNode(177 /* RestType */, pos); + var node = createNode(178 /* RestType */, pos); node.type = parseType(); return finishNode(node); } var type = parseType(); - if (!(contextFlags & 4194304 /* JSDoc */) && type.kind === 297 /* JSDocNullableType */ && type.pos === type.type.pos) { - type.kind = 176 /* OptionalType */; + if (!(contextFlags & 4194304 /* JSDoc */) && type.kind === 298 /* JSDocNullableType */ && type.pos === type.type.pos) { + type.kind = 177 /* OptionalType */; } return type; } function parseTupleType() { - var node = createNode(175 /* TupleType */); + var node = createNode(176 /* TupleType */); node.elementTypes = parseBracketedList(21 /* TupleElementTypes */, parseTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(182 /* ParenthesizedType */); + var node = createNode(183 /* ParenthesizedType */); parseExpected(20 /* OpenParenToken */); node.type = parseType(); parseExpected(21 /* CloseParenToken */); @@ -21355,7 +21468,7 @@ var ts; } function parseFunctionOrConstructorType() { var pos = getNodePos(); - var kind = parseOptional(99 /* NewKeyword */) ? 171 /* ConstructorType */ : 170 /* FunctionType */; + var kind = parseOptional(99 /* NewKeyword */) ? 172 /* ConstructorType */ : 171 /* FunctionType */; var node = createNodeWithJSDoc(kind, pos); fillSignature(38 /* EqualsGreaterThanToken */, 4 /* Type */, node); return finishNode(node); @@ -21365,10 +21478,10 @@ var ts; return token() === 24 /* DotToken */ ? undefined : node; } function parseLiteralTypeNode(negative) { - var node = createNode(187 /* LiteralType */); + var node = createNode(188 /* LiteralType */); var unaryMinusExpression; if (negative) { - unaryMinusExpression = createNode(207 /* PrefixUnaryExpression */); + unaryMinusExpression = createNode(208 /* PrefixUnaryExpression */); unaryMinusExpression.operator = 40 /* MinusToken */; nextToken(); } @@ -21389,7 +21502,7 @@ var ts; } function parseImportType() { sourceFile.flags |= 1048576 /* PossiblyContainsDynamicImport */; - var node = createNode(188 /* ImportType */); + var node = createNode(189 /* ImportType */); if (parseOptional(108 /* TypeOfKeyword */)) { node.isTypeOf = true; } @@ -21412,15 +21525,15 @@ var ts; function parseNonArrayType() { switch (token()) { case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 144 /* SymbolKeyword */: - case 128 /* BooleanKeyword */: - case 146 /* UndefinedKeyword */: - case 137 /* NeverKeyword */: - case 141 /* ObjectKeyword */: + case 149 /* UnknownKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 145 /* SymbolKeyword */: + case 129 /* BooleanKeyword */: + case 147 /* UndefinedKeyword */: + case 138 /* NeverKeyword */: + case 142 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 41 /* AsteriskToken */: @@ -21451,7 +21564,7 @@ var ts; return parseTokenNode(); case 104 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 133 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 134 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -21477,20 +21590,20 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 128 /* BooleanKeyword */: - case 138 /* ReadonlyKeyword */: - case 144 /* SymbolKeyword */: - case 147 /* UniqueKeyword */: + case 149 /* UnknownKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 129 /* BooleanKeyword */: + case 139 /* ReadonlyKeyword */: + case 145 /* SymbolKeyword */: + case 148 /* UniqueKeyword */: case 110 /* VoidKeyword */: - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: case 100 /* NullKeyword */: case 104 /* ThisKeyword */: case 108 /* TypeOfKeyword */: - case 137 /* NeverKeyword */: + case 138 /* NeverKeyword */: case 18 /* OpenBraceToken */: case 22 /* OpenBracketToken */: case 29 /* LessThanToken */: @@ -21502,12 +21615,12 @@ var ts; case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: - case 141 /* ObjectKeyword */: + case 142 /* ObjectKeyword */: case 41 /* AsteriskToken */: case 57 /* QuestionToken */: case 53 /* ExclamationToken */: case 25 /* DotDotDotToken */: - case 132 /* InferKeyword */: + case 133 /* InferKeyword */: case 96 /* ImportKeyword */: case 124 /* AssertsKeyword */: return true; @@ -21532,26 +21645,26 @@ var ts; while (!scanner.hasPrecedingLineBreak()) { switch (token()) { case 53 /* ExclamationToken */: - type = createPostfixType(298 /* JSDocNonNullableType */, type); + type = createPostfixType(299 /* JSDocNonNullableType */, type); break; case 57 /* QuestionToken */: // If not in JSDoc and next token is start of a type we have a conditional type if (!(contextFlags & 4194304 /* JSDoc */) && lookAhead(nextTokenIsStartOfType)) { return type; } - type = createPostfixType(297 /* JSDocNullableType */, type); + type = createPostfixType(298 /* JSDocNullableType */, type); break; case 22 /* OpenBracketToken */: parseExpected(22 /* OpenBracketToken */); if (isStartOfType()) { - var node = createNode(185 /* IndexedAccessType */, type.pos); + var node = createNode(186 /* IndexedAccessType */, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(23 /* CloseBracketToken */); type = finishNode(node); } else { - var node = createNode(174 /* ArrayType */, type.pos); + var node = createNode(175 /* ArrayType */, type.pos); node.elementType = type; parseExpected(23 /* CloseBracketToken */); type = finishNode(node); @@ -21570,16 +21683,16 @@ var ts; return finishNode(postfix); } function parseTypeOperator(operator) { - var node = createNode(184 /* TypeOperator */); + var node = createNode(185 /* TypeOperator */); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); return finishNode(node); } function parseInferType() { - var node = createNode(181 /* InferType */); - parseExpected(132 /* InferKeyword */); - var typeParameter = createNode(155 /* TypeParameter */); + var node = createNode(182 /* InferType */); + parseExpected(133 /* InferKeyword */); + var typeParameter = createNode(156 /* TypeParameter */); typeParameter.name = parseIdentifier(); node.typeParameter = finishNode(typeParameter); return finishNode(node); @@ -21587,11 +21700,12 @@ var ts; function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 134 /* KeyOfKeyword */: - case 147 /* UniqueKeyword */: - case 138 /* ReadonlyKeyword */: + case 135 /* KeyOfKeyword */: + case 148 /* UniqueKeyword */: + case 139 /* ReadonlyKeyword */: + case 128 /* AwaitedKeyword */: return parseTypeOperator(operator); - case 132 /* InferKeyword */: + case 133 /* InferKeyword */: return parseInferType(); } return parsePostfixTypeOrHigher(); @@ -21612,10 +21726,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(179 /* IntersectionType */, parseTypeOperatorOrHigher, 50 /* AmpersandToken */); + return parseUnionOrIntersectionType(180 /* IntersectionType */, parseTypeOperatorOrHigher, 50 /* AmpersandToken */); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(178 /* UnionType */, parseIntersectionTypeOrHigher, 51 /* BarToken */); + return parseUnionOrIntersectionType(179 /* UnionType */, parseIntersectionTypeOrHigher, 51 /* BarToken */); } function isStartOfFunctionType() { if (token() === 29 /* LessThanToken */) { @@ -21672,7 +21786,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(168 /* TypePredicate */, typePredicateVariable.pos); + var node = createNode(169 /* TypePredicate */, typePredicateVariable.pos); node.assertsModifier = undefined; node.parameterName = typePredicateVariable; node.type = type; @@ -21684,16 +21798,16 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 133 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 134 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } } function parseAssertsTypePredicate() { - var node = createNode(168 /* TypePredicate */); + var node = createNode(169 /* TypePredicate */); node.assertsModifier = parseExpectedToken(124 /* AssertsKeyword */); node.parameterName = token() === 104 /* ThisKeyword */ ? parseThisTypeNode() : parseIdentifier(); - node.type = parseOptional(133 /* IsKeyword */) ? parseType() : undefined; + node.type = parseOptional(134 /* IsKeyword */) ? parseType() : undefined; return finishNode(node); } function parseType() { @@ -21707,7 +21821,7 @@ var ts; } var type = parseUnionTypeOrHigher(); if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(90 /* ExtendsKeyword */)) { - var node = createNode(180 /* ConditionalType */, type.pos); + var node = createNode(181 /* ConditionalType */, type.pos); node.checkType = type; // The type following 'extends' is not permitted to be another conditional type node.extendsType = parseTypeWorker(/*noConditionalTypes*/ true); @@ -21902,7 +22016,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(212 /* YieldExpression */); + var node = createNode(213 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -21924,13 +22038,13 @@ var ts; ts.Debug.assert(token() === 38 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(202 /* ArrowFunction */, asyncModifier.pos); + node = createNode(203 /* ArrowFunction */, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(202 /* ArrowFunction */, identifier.pos); + node = createNode(203 /* ArrowFunction */, identifier.pos); } - var parameter = createNode(156 /* Parameter */, identifier.pos); + var parameter = createNode(157 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); @@ -22135,7 +22249,7 @@ var ts; return 0 /* False */; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNodeWithJSDoc(202 /* ArrowFunction */); + var node = createNodeWithJSDoc(203 /* ArrowFunction */); node.modifiers = parseModifiersForArrowFunction(); var isAsync = hasModifierOfKind(node, 126 /* AsyncKeyword */) ? 2 /* Await */ : 0 /* None */; // Arrow functions are never generators. @@ -22201,7 +22315,7 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(210 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(211 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -22216,7 +22330,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 97 /* InKeyword */ || t === 152 /* OfKeyword */; + return t === 97 /* InKeyword */ || t === 153 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -22281,39 +22395,39 @@ var ts; return ts.getBinaryOperatorPrecedence(token()) > 0; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(209 /* BinaryExpression */, left.pos); + var node = createNode(210 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(217 /* AsExpression */, left.pos); + var node = createNode(218 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(207 /* PrefixUnaryExpression */); + var node = createNode(208 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(203 /* DeleteExpression */); + var node = createNode(204 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(204 /* TypeOfExpression */); + var node = createNode(205 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(205 /* VoidExpression */); + var node = createNode(206 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -22329,7 +22443,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(206 /* AwaitExpression */); + var node = createNode(207 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -22373,7 +22487,7 @@ var ts; if (token() === 42 /* AsteriskAsteriskToken */) { var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); var end = simpleUnaryExpression.end; - if (simpleUnaryExpression.kind === 199 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 200 /* TypeAssertionExpression */) { parseErrorAt(pos, end, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -22470,7 +22584,7 @@ var ts; */ function parseUpdateExpression() { if (token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) { - var node = createNode(207 /* PrefixUnaryExpression */); + var node = createNode(208 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -22483,7 +22597,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(208 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(209 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -22539,7 +22653,7 @@ var ts; var fullStart = scanner.getStartPos(); nextToken(); // advance past the 'import' nextToken(); // advance past the dot - var node = createNode(219 /* MetaProperty */, fullStart); + var node = createNode(220 /* MetaProperty */, fullStart); node.keywordToken = 96 /* ImportKeyword */; node.name = parseIdentifierName(); expression = finishNode(node); @@ -22622,7 +22736,7 @@ var ts; } // If we have seen "super" it must be followed by '(' or '.'. // If it wasn't then just try to parse out a '.' and report an error. - var node = createNode(194 /* PropertyAccessExpression */, expression.pos); + var node = createNode(195 /* PropertyAccessExpression */, expression.pos); node.expression = expression; parseExpectedToken(24 /* DotToken */, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); // private names will never work with `super` (`super.#foo`), but that's a semantic error, not syntactic @@ -22632,8 +22746,8 @@ var ts; function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 268 /* JsxOpeningElement */) { - var node = createNode(266 /* JsxElement */, opening.pos); + if (opening.kind === 269 /* JsxOpeningElement */) { + var node = createNode(267 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -22642,15 +22756,15 @@ var ts; } result = finishNode(node); } - else if (opening.kind === 271 /* JsxOpeningFragment */) { - var node = createNode(270 /* JsxFragment */, opening.pos); + else if (opening.kind === 272 /* JsxOpeningFragment */) { + var node = createNode(271 /* JsxFragment */, opening.pos); node.openingFragment = opening; node.children = parseJsxChildren(node.openingFragment); node.closingFragment = parseJsxClosingFragment(inExpressionContext); result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 267 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 268 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -22665,7 +22779,7 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(209 /* BinaryExpression */, result.pos); + var badNode = createNode(210 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -22724,7 +22838,7 @@ var ts; return createNodeArray(list, listPos); } function parseJsxAttributes() { - var jsxAttributes = createNode(274 /* JsxAttributes */); + var jsxAttributes = createNode(275 /* JsxAttributes */); jsxAttributes.properties = parseList(13 /* JsxAttributes */, parseJsxAttribute); return finishNode(jsxAttributes); } @@ -22733,7 +22847,7 @@ var ts; parseExpected(29 /* LessThanToken */); if (token() === 31 /* GreaterThanToken */) { // See below for explanation of scanJsxText - var node_1 = createNode(271 /* JsxOpeningFragment */, fullStart); + var node_1 = createNode(272 /* JsxOpeningFragment */, fullStart); scanJsxText(); return finishNode(node_1); } @@ -22745,7 +22859,7 @@ var ts; // Closing tag, so scan the immediately-following text with the JSX scanning instead // of regular scanning to avoid treating illegal characters (e.g. '#') as immediate // scanning errors - node = createNode(268 /* JsxOpeningElement */, fullStart); + node = createNode(269 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -22757,7 +22871,7 @@ var ts; parseExpected(31 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(267 /* JsxSelfClosingElement */, fullStart); + node = createNode(268 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.typeArguments = typeArguments; @@ -22774,7 +22888,7 @@ var ts; var expression = token() === 104 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ false); expression = finishNode(propertyAccess); @@ -22782,7 +22896,7 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(276 /* JsxExpression */); + var node = createNode(277 /* JsxExpression */); if (!parseExpected(18 /* OpenBraceToken */)) { return undefined; } @@ -22808,7 +22922,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(273 /* JsxAttribute */); + var node = createNode(274 /* JsxAttribute */); node.name = parseIdentifierName(); if (token() === 62 /* EqualsToken */) { switch (scanJsxAttributeValue()) { @@ -22823,7 +22937,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(275 /* JsxSpreadAttribute */); + var node = createNode(276 /* JsxSpreadAttribute */); parseExpected(18 /* OpenBraceToken */); parseExpected(25 /* DotDotDotToken */); node.expression = parseExpression(); @@ -22831,7 +22945,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(269 /* JsxClosingElement */); + var node = createNode(270 /* JsxClosingElement */); parseExpected(30 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -22844,7 +22958,7 @@ var ts; return finishNode(node); } function parseJsxClosingFragment(inExpressionContext) { - var node = createNode(272 /* JsxClosingFragment */); + var node = createNode(273 /* JsxClosingFragment */); parseExpected(30 /* LessThanSlashToken */); if (ts.tokenIsIdentifierOrKeyword(token())) { parseErrorAtRange(parseJsxElementName(), ts.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment); @@ -22859,7 +22973,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(199 /* TypeAssertionExpression */); + var node = createNode(200 /* TypeAssertionExpression */); parseExpected(29 /* LessThanToken */); node.type = parseType(); parseExpected(31 /* GreaterThanToken */); @@ -22877,7 +22991,7 @@ var ts; && lookAhead(nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate); } function parsePropertyAccessExpressionRest(expression, questionDotToken) { - var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ true); @@ -22890,7 +23004,7 @@ var ts; return finishNode(propertyAccess); } function parseElementAccessExpressionRest(expression, questionDotToken) { - var indexedAccess = createNode(195 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(196 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; indexedAccess.questionDotToken = questionDotToken; if (token() === 23 /* CloseBracketToken */) { @@ -22926,7 +23040,7 @@ var ts; } if (!questionDotToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(218 /* NonNullExpression */, expression.pos); + var nonNullExpression = createNode(219 /* NonNullExpression */, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; @@ -22947,7 +23061,7 @@ var ts; return token() === 14 /* NoSubstitutionTemplateLiteral */ || token() === 15 /* TemplateHead */; } function parseTaggedTemplateRest(tag, questionDotToken, typeArguments) { - var tagExpression = createNode(198 /* TaggedTemplateExpression */, tag.pos); + var tagExpression = createNode(199 /* TaggedTemplateExpression */, tag.pos); tagExpression.tag = tag; tagExpression.questionDotToken = questionDotToken; tagExpression.typeArguments = typeArguments; @@ -22975,7 +23089,7 @@ var ts; expression = parseTaggedTemplateRest(expression, questionDotToken, typeArguments); continue; } - var callExpr = createNode(196 /* CallExpression */, expression.pos); + var callExpr = createNode(197 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.typeArguments = typeArguments; @@ -22988,7 +23102,7 @@ var ts; } } else if (token() === 20 /* OpenParenToken */) { - var callExpr = createNode(196 /* CallExpression */, expression.pos); + var callExpr = createNode(197 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.arguments = parseArgumentList(); @@ -23000,7 +23114,7 @@ var ts; } if (questionDotToken) { // We failed to parse anything, so report a missing identifier here. - var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = createMissingNode(75 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.Identifier_expected); @@ -23119,28 +23233,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNodeWithJSDoc(200 /* ParenthesizedExpression */); + var node = createNodeWithJSDoc(201 /* ParenthesizedExpression */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(213 /* SpreadElement */); + var node = createNode(214 /* SpreadElement */); parseExpected(25 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 25 /* DotDotDotToken */ ? parseSpreadElement() : - token() === 27 /* CommaToken */ ? createNode(215 /* OmittedExpression */) : + token() === 27 /* CommaToken */ ? createNode(216 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(192 /* ArrayLiteralExpression */); + var node = createNode(193 /* ArrayLiteralExpression */); parseExpected(22 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -23152,17 +23266,17 @@ var ts; function parseObjectLiteralElement() { var node = createNodeWithJSDoc(0 /* Unknown */); if (parseOptionalToken(25 /* DotDotDotToken */)) { - node.kind = 283 /* SpreadAssignment */; + node.kind = 284 /* SpreadAssignment */; node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); - if (parseContextualModifier(131 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 163 /* GetAccessor */); + if (parseContextualModifier(132 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 164 /* GetAccessor */); } - if (parseContextualModifier(142 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 164 /* SetAccessor */); + if (parseContextualModifier(143 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 165 /* SetAccessor */); } var asteriskToken = parseOptionalToken(41 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); @@ -23180,7 +23294,7 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 58 /* ColonToken */); if (isShorthandPropertyAssignment) { - node.kind = 282 /* ShorthandPropertyAssignment */; + node.kind = 283 /* ShorthandPropertyAssignment */; var equalsToken = parseOptionalToken(62 /* EqualsToken */); if (equalsToken) { node.equalsToken = equalsToken; @@ -23188,20 +23302,26 @@ var ts; } } else { - node.kind = 281 /* PropertyAssignment */; + node.kind = 282 /* PropertyAssignment */; parseExpected(58 /* ColonToken */); node.initializer = allowInAnd(parseAssignmentExpressionOrHigher); } return finishNode(node); } function parseObjectLiteralExpression() { - var node = createNode(193 /* ObjectLiteralExpression */); + var node = createNode(194 /* ObjectLiteralExpression */); + var openBracePosition = scanner.getTokenPos(); parseExpected(18 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; } node.properties = parseDelimitedList(12 /* ObjectLiteralMembers */, parseObjectLiteralElement, /*considerSemicolonAsDelimiter*/ true); - parseExpected(19 /* CloseBraceToken */); + if (!parseExpected(19 /* CloseBraceToken */)) { + var lastError = ts.lastOrUndefined(parseDiagnostics); + if (lastError && lastError.code === ts.Diagnostics._0_expected.code) { + ts.addRelatedInfo(lastError, ts.createFileDiagnostic(sourceFile, openBracePosition, 1, ts.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here)); + } + } return finishNode(node); } function parseFunctionExpression() { @@ -23214,7 +23334,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(/*val*/ false); } - var node = createNodeWithJSDoc(201 /* FunctionExpression */); + var node = createNodeWithJSDoc(202 /* FunctionExpression */); node.modifiers = parseModifiers(); parseExpected(94 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(41 /* AsteriskToken */); @@ -23239,7 +23359,7 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(99 /* NewKeyword */); if (parseOptional(24 /* DotToken */)) { - var node_2 = createNode(219 /* MetaProperty */, fullStart); + var node_2 = createNode(220 /* MetaProperty */, fullStart); node_2.keywordToken = 99 /* NewKeyword */; node_2.name = parseIdentifierName(); return finishNode(node_2); @@ -23256,7 +23376,7 @@ var ts; } break; } - var node = createNode(197 /* NewExpression */, fullStart); + var node = createNode(198 /* NewExpression */, fullStart); node.expression = expression; node.typeArguments = typeArguments; if (node.typeArguments || token() === 20 /* OpenParenToken */) { @@ -23266,7 +23386,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(223 /* Block */); + var node = createNode(224 /* Block */); var openBracePosition = scanner.getTokenPos(); if (parseExpected(18 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { @@ -23305,12 +23425,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(224 /* EmptyStatement */); + var node = createNode(225 /* EmptyStatement */); parseExpected(26 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(227 /* IfStatement */); + var node = createNode(228 /* IfStatement */); parseExpected(95 /* IfKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23320,7 +23440,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(228 /* DoStatement */); + var node = createNode(229 /* DoStatement */); parseExpected(86 /* DoKeyword */); node.statement = parseStatement(); parseExpected(111 /* WhileKeyword */); @@ -23335,7 +23455,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(229 /* WhileStatement */); + var node = createNode(230 /* WhileStatement */); parseExpected(111 /* WhileKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23358,8 +23478,8 @@ var ts; } } var forOrForInOrForOfStatement; - if (awaitToken ? parseExpected(152 /* OfKeyword */) : parseOptional(152 /* OfKeyword */)) { - var forOfStatement = createNode(232 /* ForOfStatement */, pos); + if (awaitToken ? parseExpected(153 /* OfKeyword */) : parseOptional(153 /* OfKeyword */)) { + var forOfStatement = createNode(233 /* ForOfStatement */, pos); forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); @@ -23367,14 +23487,14 @@ var ts; forOrForInOrForOfStatement = forOfStatement; } else if (parseOptional(97 /* InKeyword */)) { - var forInStatement = createNode(231 /* ForInStatement */, pos); + var forInStatement = createNode(232 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } else { - var forStatement = createNode(230 /* ForStatement */, pos); + var forStatement = createNode(231 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(26 /* SemicolonToken */); if (token() !== 26 /* SemicolonToken */ && token() !== 21 /* CloseParenToken */) { @@ -23392,7 +23512,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 234 /* BreakStatement */ ? 77 /* BreakKeyword */ : 82 /* ContinueKeyword */); + parseExpected(kind === 235 /* BreakStatement */ ? 77 /* BreakKeyword */ : 82 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -23400,7 +23520,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(235 /* ReturnStatement */); + var node = createNode(236 /* ReturnStatement */); parseExpected(101 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -23409,7 +23529,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(236 /* WithStatement */); + var node = createNode(237 /* WithStatement */); parseExpected(112 /* WithKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23418,7 +23538,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(277 /* CaseClause */); + var node = createNode(278 /* CaseClause */); parseExpected(78 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(58 /* ColonToken */); @@ -23426,7 +23546,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(278 /* DefaultClause */); + var node = createNode(279 /* DefaultClause */); parseExpected(84 /* DefaultKeyword */); parseExpected(58 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); @@ -23436,12 +23556,12 @@ var ts; return token() === 78 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(237 /* SwitchStatement */); + var node = createNode(238 /* SwitchStatement */); parseExpected(103 /* SwitchKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); - var caseBlock = createNode(251 /* CaseBlock */); + var caseBlock = createNode(252 /* CaseBlock */); parseExpected(18 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(19 /* CloseBraceToken */); @@ -23456,7 +23576,7 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(239 /* ThrowStatement */); + var node = createNode(240 /* ThrowStatement */); parseExpected(105 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -23464,7 +23584,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(240 /* TryStatement */); + var node = createNode(241 /* TryStatement */); parseExpected(107 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); node.catchClause = token() === 79 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -23477,7 +23597,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(280 /* CatchClause */); + var result = createNode(281 /* CatchClause */); parseExpected(79 /* CatchKeyword */); if (parseOptional(20 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -23491,7 +23611,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(241 /* DebuggerStatement */); + var node = createNode(242 /* DebuggerStatement */); parseExpected(83 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -23500,15 +23620,15 @@ var ts; // Avoiding having to do the lookahead for a labeled statement by just trying to parse // out an expression, seeing if it is identifier and then seeing if it is followed by // a colon. - var node = createNodeWithJSDoc(0 /* Unknown */); + var node = createNodeWithJSDoc(token() === 75 /* Identifier */ ? 0 /* Unknown */ : 227 /* ExpressionStatement */); var expression = allowInAnd(parseExpression); if (expression.kind === 75 /* Identifier */ && parseOptional(58 /* ColonToken */)) { - node.kind = 238 /* LabeledStatement */; + node.kind = 239 /* LabeledStatement */; node.label = expression; node.statement = parseStatement(); } else { - node.kind = 226 /* ExpressionStatement */; + node.kind = 227 /* ExpressionStatement */; node.expression = expression; parseSemicolon(); } @@ -23562,25 +23682,25 @@ var ts; // // could be legal, it would add complexity for very little gain. case 114 /* InterfaceKeyword */: - case 145 /* TypeKeyword */: + case 146 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 122 /* AbstractKeyword */: case 126 /* AsyncKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 119 /* PublicKeyword */: - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 150 /* GlobalKeyword */: + case 151 /* GlobalKeyword */: nextToken(); return token() === 18 /* OpenBraceToken */ || token() === 75 /* Identifier */ || token() === 89 /* ExportKeyword */; case 96 /* ImportKeyword */: @@ -23589,7 +23709,7 @@ var ts; token() === 18 /* OpenBraceToken */ || ts.tokenIsIdentifierOrKeyword(token()); case 89 /* ExportKeyword */: var currentToken_1 = nextToken(); - if (currentToken_1 === 145 /* TypeKeyword */) { + if (currentToken_1 === 146 /* TypeKeyword */) { currentToken_1 = lookAhead(nextToken); } if (currentToken_1 === 62 /* EqualsToken */ || currentToken_1 === 41 /* AsteriskToken */ || @@ -23643,19 +23763,19 @@ var ts; case 89 /* ExportKeyword */: return isStartOfDeclaration(); case 126 /* AsyncKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 114 /* InterfaceKeyword */: - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: - case 145 /* TypeKeyword */: - case 150 /* GlobalKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: + case 146 /* TypeKeyword */: + case 151 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 120 /* StaticKeyword */: - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: // When these don't start a declaration, they may be the start of a class member if an identifier // immediately follows. Otherwise they're an identifier in an expression statement. return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); @@ -23679,16 +23799,16 @@ var ts; case 18 /* OpenBraceToken */: return parseBlock(/*ignoreMissingOpenBrace*/ false); case 109 /* VarKeyword */: - return parseVariableStatement(createNodeWithJSDoc(242 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(243 /* VariableDeclaration */)); case 115 /* LetKeyword */: if (isLetDeclaration()) { - return parseVariableStatement(createNodeWithJSDoc(242 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(243 /* VariableDeclaration */)); } break; case 94 /* FunctionKeyword */: - return parseFunctionDeclaration(createNodeWithJSDoc(244 /* FunctionDeclaration */)); + return parseFunctionDeclaration(createNodeWithJSDoc(245 /* FunctionDeclaration */)); case 80 /* ClassKeyword */: - return parseClassDeclaration(createNodeWithJSDoc(245 /* ClassDeclaration */)); + return parseClassDeclaration(createNodeWithJSDoc(246 /* ClassDeclaration */)); case 95 /* IfKeyword */: return parseIfStatement(); case 86 /* DoKeyword */: @@ -23698,9 +23818,9 @@ var ts; case 93 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 82 /* ContinueKeyword */: - return parseBreakOrContinueStatement(233 /* ContinueStatement */); + return parseBreakOrContinueStatement(234 /* ContinueStatement */); case 77 /* BreakKeyword */: - return parseBreakOrContinueStatement(234 /* BreakStatement */); + return parseBreakOrContinueStatement(235 /* BreakStatement */); case 101 /* ReturnKeyword */: return parseReturnStatement(); case 112 /* WithKeyword */: @@ -23721,10 +23841,10 @@ var ts; return parseDeclaration(); case 126 /* AsyncKeyword */: case 114 /* InterfaceKeyword */: - case 145 /* TypeKeyword */: - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: - case 130 /* DeclareKeyword */: + case 146 /* TypeKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: + case 131 /* DeclareKeyword */: case 81 /* ConstKeyword */: case 88 /* EnumKeyword */: case 89 /* ExportKeyword */: @@ -23734,8 +23854,8 @@ var ts; case 119 /* PublicKeyword */: case 122 /* AbstractKeyword */: case 120 /* StaticKeyword */: - case 138 /* ReadonlyKeyword */: - case 150 /* GlobalKeyword */: + case 139 /* ReadonlyKeyword */: + case 151 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -23744,7 +23864,7 @@ var ts; return parseExpressionOrLabeledStatement(); } function isDeclareModifier(modifier) { - return modifier.kind === 130 /* DeclareKeyword */; + return modifier.kind === 131 /* DeclareKeyword */; } function parseDeclaration() { var modifiers = lookAhead(function () { return (parseDecorators(), parseModifiers()); }); @@ -23792,13 +23912,13 @@ var ts; return parseClassDeclaration(node); case 114 /* InterfaceKeyword */: return parseInterfaceDeclaration(node); - case 145 /* TypeKeyword */: + case 146 /* TypeKeyword */: return parseTypeAliasDeclaration(node); case 88 /* EnumKeyword */: return parseEnumDeclaration(node); - case 150 /* GlobalKeyword */: - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: + case 151 /* GlobalKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: return parseModuleDeclaration(node); case 96 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(node); @@ -23817,7 +23937,7 @@ var ts; if (node.decorators || node.modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var missing = createMissingNode(264 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(265 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; @@ -23840,16 +23960,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token() === 27 /* CommaToken */) { - return createNode(215 /* OmittedExpression */); + return createNode(216 /* OmittedExpression */); } - var node = createNode(191 /* BindingElement */); + var node = createNode(192 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(191 /* BindingElement */); + var node = createNode(192 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -23865,14 +23985,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(189 /* ObjectBindingPattern */); + var node = createNode(190 /* ObjectBindingPattern */); parseExpected(18 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(19 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(190 /* ArrayBindingPattern */); + var node = createNode(191 /* ArrayBindingPattern */); parseExpected(22 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(23 /* CloseBracketToken */); @@ -23897,7 +24017,7 @@ var ts; return parseVariableDeclaration(/*allowExclamation*/ true); } function parseVariableDeclaration(allowExclamation) { - var node = createNode(242 /* VariableDeclaration */); + var node = createNode(243 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(ts.Diagnostics.Private_identifiers_are_not_allowed_in_variable_declarations); if (allowExclamation && node.name.kind === 75 /* Identifier */ && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { @@ -23910,7 +24030,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(243 /* VariableDeclarationList */); + var node = createNode(244 /* VariableDeclarationList */); switch (token()) { case 109 /* VarKeyword */: break; @@ -23933,7 +24053,7 @@ var ts; // So we need to look ahead to determine if 'of' should be treated as a keyword in // this context. // The checker will then give an error that there is an empty declaration list. - if (token() === 152 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 153 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -23948,13 +24068,13 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; } function parseVariableStatement(node) { - node.kind = 225 /* VariableStatement */; + node.kind = 226 /* VariableStatement */; node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(node) { - node.kind = 244 /* FunctionDeclaration */; + node.kind = 245 /* FunctionDeclaration */; parseExpected(94 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(41 /* AsteriskToken */); node.name = hasModifierOfKind(node, 84 /* DefaultKeyword */) ? parseOptionalIdentifier() : parseIdentifier(); @@ -23965,8 +24085,8 @@ var ts; return finishNode(node); } function parseConstructorName() { - if (token() === 129 /* ConstructorKeyword */) { - return parseExpected(129 /* ConstructorKeyword */); + if (token() === 130 /* ConstructorKeyword */) { + return parseExpected(130 /* ConstructorKeyword */); } if (token() === 10 /* StringLiteral */ && lookAhead(nextToken) === 20 /* OpenParenToken */) { return tryParse(function () { @@ -23978,7 +24098,7 @@ var ts; function tryParseConstructorDeclaration(node) { return tryParse(function () { if (parseConstructorName()) { - node.kind = 162 /* Constructor */; + node.kind = 163 /* Constructor */; fillSignature(58 /* ColonToken */, 0 /* None */, node); node.body = parseFunctionBlockOrSemicolon(0 /* None */, ts.Diagnostics.or_expected); return finishNode(node); @@ -23986,7 +24106,7 @@ var ts; }); } function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) { - node.kind = 161 /* MethodDeclaration */; + node.kind = 162 /* MethodDeclaration */; node.asteriskToken = asteriskToken; var isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; var isAsync = hasModifierOfKind(node, 126 /* AsyncKeyword */) ? 2 /* Await */ : 0 /* None */; @@ -23995,7 +24115,7 @@ var ts; return finishNode(node); } function parsePropertyDeclaration(node) { - node.kind = 159 /* PropertyDeclaration */; + node.kind = 160 /* PropertyDeclaration */; if (!node.questionToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -24057,7 +24177,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 142 /* SetKeyword */ || idToken === 131 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 143 /* SetKeyword */ || idToken === 132 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -24089,7 +24209,7 @@ var ts; if (!parseOptional(59 /* AtToken */)) { break; } - var decorator = createNode(157 /* Decorator */, decoratorStart); + var decorator = createNode(158 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); (list || (list = [])).push(decorator); @@ -24139,20 +24259,20 @@ var ts; } function parseClassElement() { if (token() === 26 /* SemicolonToken */) { - var result = createNode(222 /* SemicolonClassElement */); + var result = createNode(223 /* SemicolonClassElement */); nextToken(); return finishNode(result); } var node = createNodeWithJSDoc(0 /* Unknown */); node.decorators = parseDecorators(); node.modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); - if (parseContextualModifier(131 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 163 /* GetAccessor */); + if (parseContextualModifier(132 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 164 /* GetAccessor */); } - if (parseContextualModifier(142 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 164 /* SetAccessor */); + if (parseContextualModifier(143 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 165 /* SetAccessor */); } - if (token() === 129 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { + if (token() === 130 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { var constructorDeclaration = tryParseConstructorDeclaration(node); if (constructorDeclaration) { return constructorDeclaration; @@ -24189,10 +24309,10 @@ var ts; return ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 214 /* ClassExpression */); + return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 215 /* ClassExpression */); } function parseClassDeclaration(node) { - return parseClassDeclarationOrExpression(node, 245 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(node, 246 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(node, kind) { node.kind = kind; @@ -24235,14 +24355,14 @@ var ts; function parseHeritageClause() { var tok = token(); ts.Debug.assert(tok === 90 /* ExtendsKeyword */ || tok === 113 /* ImplementsKeyword */); // isListElement() should ensure this. - var node = createNode(279 /* HeritageClause */); + var node = createNode(280 /* HeritageClause */); node.token = tok; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); return finishNode(node); } function parseExpressionWithTypeArguments() { - var node = createNode(216 /* ExpressionWithTypeArguments */); + var node = createNode(217 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); node.typeArguments = tryParseTypeArguments(); return finishNode(node); @@ -24258,7 +24378,7 @@ var ts; return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(node) { - node.kind = 246 /* InterfaceDeclaration */; + node.kind = 247 /* InterfaceDeclaration */; parseExpected(114 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); @@ -24267,8 +24387,8 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(node) { - node.kind = 247 /* TypeAliasDeclaration */; - parseExpected(145 /* TypeKeyword */); + node.kind = 248 /* TypeAliasDeclaration */; + parseExpected(146 /* TypeKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(62 /* EqualsToken */); @@ -24281,13 +24401,13 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNodeWithJSDoc(284 /* EnumMember */); + var node = createNodeWithJSDoc(285 /* EnumMember */); node.name = parsePropertyName(); node.initializer = allowInAnd(parseInitializer); return finishNode(node); } function parseEnumDeclaration(node) { - node.kind = 248 /* EnumDeclaration */; + node.kind = 249 /* EnumDeclaration */; parseExpected(88 /* EnumKeyword */); node.name = parseIdentifier(); if (parseExpected(18 /* OpenBraceToken */)) { @@ -24300,7 +24420,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(250 /* ModuleBlock */); + var node = createNode(251 /* ModuleBlock */); if (parseExpected(18 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(19 /* CloseBraceToken */); @@ -24311,7 +24431,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(node, flags) { - node.kind = 249 /* ModuleDeclaration */; + node.kind = 250 /* ModuleDeclaration */; // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 16 /* Namespace */; @@ -24323,8 +24443,8 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(node) { - node.kind = 249 /* ModuleDeclaration */; - if (token() === 150 /* GlobalKeyword */) { + node.kind = 250 /* ModuleDeclaration */; + if (token() === 151 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation node.name = parseIdentifier(); node.flags |= 1024 /* GlobalAugmentation */; @@ -24343,15 +24463,15 @@ var ts; } function parseModuleDeclaration(node) { var flags = 0; - if (token() === 150 /* GlobalKeyword */) { + if (token() === 151 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(node); } - else if (parseOptional(136 /* NamespaceKeyword */)) { + else if (parseOptional(137 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(135 /* ModuleKeyword */); + parseExpected(136 /* ModuleKeyword */); if (token() === 10 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(node); } @@ -24359,7 +24479,7 @@ var ts; return parseModuleOrNamespaceDeclaration(node, flags); } function isExternalModuleReference() { - return token() === 139 /* RequireKeyword */ && + return token() === 140 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -24369,9 +24489,9 @@ var ts; return nextToken() === 43 /* SlashToken */; } function parseNamespaceExportDeclaration(node) { - node.kind = 252 /* NamespaceExportDeclaration */; + node.kind = 253 /* NamespaceExportDeclaration */; parseExpected(123 /* AsKeyword */); - parseExpected(136 /* NamespaceKeyword */); + parseExpected(137 /* NamespaceKeyword */); node.name = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -24384,7 +24504,7 @@ var ts; identifier = parseIdentifier(); } var isTypeOnly = false; - if (token() !== 149 /* FromKeyword */ && + if (token() !== 150 /* FromKeyword */ && (identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) === "type" && (isIdentifier() || tokenAfterImportDefinitelyProducesImportDeclaration())) { isTypeOnly = true; @@ -24394,7 +24514,7 @@ var ts; return parseImportEqualsDeclaration(node, identifier, isTypeOnly); } // Import statement - node.kind = 254 /* ImportDeclaration */; + node.kind = 255 /* ImportDeclaration */; // ImportDeclaration: // import ImportClause from ModuleSpecifier ; // import ModuleSpecifier; @@ -24403,7 +24523,7 @@ var ts; token() === 18 /* OpenBraceToken */ // import { ) { node.importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); - parseExpected(149 /* FromKeyword */); + parseExpected(150 /* FromKeyword */); } node.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -24415,10 +24535,10 @@ var ts; function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { // In `import id ___`, the current token decides whether to produce // an ImportDeclaration or ImportEqualsDeclaration. - return token() === 27 /* CommaToken */ || token() === 149 /* FromKeyword */; + return token() === 27 /* CommaToken */ || token() === 150 /* FromKeyword */; } function parseImportEqualsDeclaration(node, identifier, isTypeOnly) { - node.kind = 253 /* ImportEqualsDeclaration */; + node.kind = 254 /* ImportEqualsDeclaration */; node.name = identifier; parseExpected(62 /* EqualsToken */); node.moduleReference = parseModuleReference(); @@ -24436,7 +24556,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(255 /* ImportClause */, fullStart); + var importClause = createNode(256 /* ImportClause */, fullStart); importClause.isTypeOnly = isTypeOnly; if (identifier) { // ImportedDefaultBinding: @@ -24447,7 +24567,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(27 /* CommaToken */)) { - importClause.namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(257 /* NamedImports */); + importClause.namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(258 /* NamedImports */); } return finishNode(importClause); } @@ -24457,8 +24577,8 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(265 /* ExternalModuleReference */); - parseExpected(139 /* RequireKeyword */); + var node = createNode(266 /* ExternalModuleReference */); + parseExpected(140 /* RequireKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = parseModuleSpecifier(); parseExpected(21 /* CloseParenToken */); @@ -24480,7 +24600,7 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(256 /* NamespaceImport */); + var namespaceImport = createNode(257 /* NamespaceImport */); parseExpected(41 /* AsteriskToken */); parseExpected(123 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -24495,14 +24615,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 257 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); + node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 258 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(263 /* ExportSpecifier */); + return parseImportOrExportSpecifier(264 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(258 /* ImportSpecifier */); + return parseImportOrExportSpecifier(259 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -24527,34 +24647,34 @@ var ts; else { node.name = identifierName; } - if (kind === 258 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 259 /* ImportSpecifier */ && checkIdentifierIsKeyword) { parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseNamespaceExport(pos) { - var node = createNode(262 /* NamespaceExport */, pos); + var node = createNode(263 /* NamespaceExport */, pos); node.name = parseIdentifier(); return finishNode(node); } function parseExportDeclaration(node) { - node.kind = 260 /* ExportDeclaration */; - node.isTypeOnly = parseOptional(145 /* TypeKeyword */); + node.kind = 261 /* ExportDeclaration */; + node.isTypeOnly = parseOptional(146 /* TypeKeyword */); var namespaceExportPos = scanner.getStartPos(); if (parseOptional(41 /* AsteriskToken */)) { if (parseOptional(123 /* AsKeyword */)) { node.exportClause = parseNamespaceExport(namespaceExportPos); } - parseExpected(149 /* FromKeyword */); + parseExpected(150 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(261 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(262 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 149 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(149 /* FromKeyword */); + if (token() === 150 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(150 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -24562,7 +24682,7 @@ var ts; return finishNode(node); } function parseExportAssignment(node) { - node.kind = 259 /* ExportAssignment */; + node.kind = 260 /* ExportAssignment */; if (parseOptional(62 /* EqualsToken */)) { node.isExportEquals = true; } @@ -24582,10 +24702,10 @@ var ts; } function isAnExternalModuleIndicatorNode(node) { return hasModifierOfKind(node, 89 /* ExportKeyword */) - || node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 265 /* ExternalModuleReference */ - || node.kind === 254 /* ImportDeclaration */ - || node.kind === 259 /* ExportAssignment */ - || node.kind === 260 /* ExportDeclaration */ ? node : undefined; + || node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 266 /* ExternalModuleReference */ + || node.kind === 255 /* ImportDeclaration */ + || node.kind === 260 /* ExportAssignment */ + || node.kind === 261 /* ExportDeclaration */ ? node : undefined; } function getImportMetaIfNecessary(sourceFile) { return sourceFile.flags & 2097152 /* PossiblyContainsImportMeta */ ? @@ -24651,7 +24771,7 @@ var ts; JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; // Parses out a JSDoc type expression. function parseJSDocTypeExpression(mayOmitBraces) { - var result = createNode(294 /* JSDocTypeExpression */); + var result = createNode(295 /* JSDocTypeExpression */); var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(18 /* OpenBraceToken */); result.type = doInsideOfContext(4194304 /* JSDoc */, parseJSDocType); if (!mayOmitBraces || hasBrace) { @@ -24814,7 +24934,7 @@ var ts; } } function createJSDocComment() { - var result = createNode(303 /* JSDocComment */, start); + var result = createNode(304 /* JSDocComment */, start); result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd); result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -24884,19 +25004,19 @@ var ts; break; case "class": case "constructor": - tag = parseSimpleTag(start, 310 /* JSDocClassTag */, tagName); + tag = parseSimpleTag(start, 311 /* JSDocClassTag */, tagName); break; case "public": - tag = parseSimpleTag(start, 311 /* JSDocPublicTag */, tagName); + tag = parseSimpleTag(start, 312 /* JSDocPublicTag */, tagName); break; case "private": - tag = parseSimpleTag(start, 312 /* JSDocPrivateTag */, tagName); + tag = parseSimpleTag(start, 313 /* JSDocPrivateTag */, tagName); break; case "protected": - tag = parseSimpleTag(start, 313 /* JSDocProtectedTag */, tagName); + tag = parseSimpleTag(start, 314 /* JSDocProtectedTag */, tagName); break; case "readonly": - tag = parseSimpleTag(start, 314 /* JSDocReadonlyTag */, tagName); + tag = parseSimpleTag(start, 315 /* JSDocReadonlyTag */, tagName); break; case "this": tag = parseThisTag(start, tagName); @@ -25031,7 +25151,7 @@ var ts; return comments.length === 0 ? undefined : comments.join(""); } function parseUnknownTag(start, tagName) { - var result = createNode(306 /* JSDocTag */, start); + var result = createNode(307 /* JSDocTag */, start); result.tagName = tagName; return finishNode(result); } @@ -25076,9 +25196,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 141 /* ObjectKeyword */: + case 142 /* ObjectKeyword */: return true; - case 174 /* ArrayType */: + case 175 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; @@ -25094,8 +25214,8 @@ var ts; typeExpression = tryParseTypeExpression(); } var result = target === 1 /* Property */ ? - createNode(323 /* JSDocPropertyTag */, start) : - createNode(317 /* JSDocParameterTag */, start); + createNode(324 /* JSDocPropertyTag */, start) : + createNode(318 /* JSDocParameterTag */, start); var comment = parseTagComments(indent + scanner.getStartPos() - start); var nestedTypeLiteral = target !== 4 /* CallbackParameter */ && parseNestedTypeLiteral(typeExpression, name, target, indent); if (nestedTypeLiteral) { @@ -25112,20 +25232,20 @@ var ts; } function parseNestedTypeLiteral(typeExpression, name, target, indent) { if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { - var typeLiteralExpression = createNode(294 /* JSDocTypeExpression */, scanner.getTokenPos()); + var typeLiteralExpression = createNode(295 /* JSDocTypeExpression */, scanner.getTokenPos()); var child = void 0; var jsdocTypeLiteral = void 0; var start_3 = scanner.getStartPos(); var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) { - if (child.kind === 317 /* JSDocParameterTag */ || child.kind === 323 /* JSDocPropertyTag */) { + if (child.kind === 318 /* JSDocParameterTag */ || child.kind === 324 /* JSDocPropertyTag */) { children = ts.append(children, child); } } if (children) { - jsdocTypeLiteral = createNode(304 /* JSDocTypeLiteral */, start_3); + jsdocTypeLiteral = createNode(305 /* JSDocTypeLiteral */, start_3); jsdocTypeLiteral.jsDocPropertyTags = children; - if (typeExpression.type.kind === 174 /* ArrayType */) { + if (typeExpression.type.kind === 175 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typeLiteralExpression.type = finishNode(jsdocTypeLiteral); @@ -25137,7 +25257,7 @@ var ts; if (ts.some(tags, ts.isJSDocReturnTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(318 /* JSDocReturnTag */, start); + var result = createNode(319 /* JSDocReturnTag */, start); result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); @@ -25146,13 +25266,13 @@ var ts; if (ts.some(tags, ts.isJSDocTypeTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(320 /* JSDocTypeTag */, start); + var result = createNode(321 /* JSDocTypeTag */, start); result.tagName = tagName; result.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); return finishNode(result); } function parseAuthorTag(start, tagName, indent) { - var result = createNode(309 /* JSDocAuthorTag */, start); + var result = createNode(310 /* JSDocAuthorTag */, start); result.tagName = tagName; var authorInfoWithEmail = tryParse(function () { return tryParseAuthorNameAndEmail(); }); if (!authorInfoWithEmail) { @@ -25206,20 +25326,20 @@ var ts; } } function parseImplementsTag(start, tagName) { - var result = createNode(308 /* JSDocImplementsTag */, start); + var result = createNode(309 /* JSDocImplementsTag */, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseAugmentsTag(start, tagName) { - var result = createNode(307 /* JSDocAugmentsTag */, start); + var result = createNode(308 /* JSDocAugmentsTag */, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseExpressionWithTypeArgumentsForAugments() { var usedBrace = parseOptional(18 /* OpenBraceToken */); - var node = createNode(216 /* ExpressionWithTypeArguments */); + var node = createNode(217 /* ExpressionWithTypeArguments */); node.expression = parsePropertyAccessEntityNameExpression(); node.typeArguments = tryParseTypeArguments(); var res = finishNode(node); @@ -25231,7 +25351,7 @@ var ts; function parsePropertyAccessEntityNameExpression() { var node = parseJSDocIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var prop = createNode(194 /* PropertyAccessExpression */, node.pos); + var prop = createNode(195 /* PropertyAccessExpression */, node.pos); prop.expression = node; prop.name = parseJSDocIdentifierName(); node = finishNode(prop); @@ -25244,14 +25364,14 @@ var ts; return finishNode(tag); } function parseThisTag(start, tagName) { - var tag = createNode(319 /* JSDocThisTag */, start); + var tag = createNode(320 /* JSDocThisTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); return finishNode(tag); } function parseEnumTag(start, tagName) { - var tag = createNode(316 /* JSDocEnumTag */, start); + var tag = createNode(317 /* JSDocEnumTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); @@ -25260,7 +25380,7 @@ var ts; function parseTypedefTag(start, tagName, indent) { var typeExpression = tryParseTypeExpression(); skipWhitespaceOrAsterisk(); - var typedefTag = createNode(322 /* JSDocTypedefTag */, start); + var typedefTag = createNode(323 /* JSDocTypedefTag */, start); typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(); typedefTag.name = getJSDocTypeAliasName(typedefTag.fullName); @@ -25274,9 +25394,9 @@ var ts; var childTypeTag = void 0; while (child = tryParse(function () { return parseChildPropertyTag(indent); })) { if (!jsdocTypeLiteral) { - jsdocTypeLiteral = createNode(304 /* JSDocTypeLiteral */, start); + jsdocTypeLiteral = createNode(305 /* JSDocTypeLiteral */, start); } - if (child.kind === 320 /* JSDocTypeTag */) { + if (child.kind === 321 /* JSDocTypeTag */) { if (childTypeTag) { break; } @@ -25289,7 +25409,7 @@ var ts; } } if (jsdocTypeLiteral) { - if (typeExpression && typeExpression.type.kind === 174 /* ArrayType */) { + if (typeExpression && typeExpression.type.kind === 175 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? @@ -25308,7 +25428,7 @@ var ts; } var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (parseOptional(24 /* DotToken */)) { - var jsDocNamespaceNode = createNode(249 /* ModuleDeclaration */, pos); + var jsDocNamespaceNode = createNode(250 /* ModuleDeclaration */, pos); if (nested) { jsDocNamespaceNode.flags |= 4 /* NestedNamespace */; } @@ -25322,14 +25442,14 @@ var ts; return typeNameOrNamespaceName; } function parseCallbackTag(start, tagName, indent) { - var callbackTag = createNode(315 /* JSDocCallbackTag */, start); + var callbackTag = createNode(316 /* JSDocCallbackTag */, start); callbackTag.tagName = tagName; callbackTag.fullName = parseJSDocTypeNameWithNamespace(); callbackTag.name = getJSDocTypeAliasName(callbackTag.fullName); skipWhitespace(); callbackTag.comment = parseTagComments(indent); var child; - var jsdocSignature = createNode(305 /* JSDocSignature */, start); + var jsdocSignature = createNode(306 /* JSDocSignature */, start); jsdocSignature.parameters = []; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent); })) { jsdocSignature.parameters = ts.append(jsdocSignature.parameters, child); @@ -25337,7 +25457,7 @@ var ts; var returnTag = tryParse(function () { if (parseOptionalJsdoc(59 /* AtToken */)) { var tag = parseTag(indent); - if (tag && tag.kind === 318 /* JSDocReturnTag */) { + if (tag && tag.kind === 319 /* JSDocReturnTag */) { return tag; } } @@ -25382,7 +25502,7 @@ var ts; case 59 /* AtToken */: if (canParseTag) { var child = tryParseChildTag(target, indent); - if (child && (child.kind === 317 /* JSDocParameterTag */ || child.kind === 323 /* JSDocPropertyTag */) && + if (child && (child.kind === 318 /* JSDocParameterTag */ || child.kind === 324 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; @@ -25446,13 +25566,13 @@ var ts; var typeParametersPos = getNodePos(); do { skipWhitespace(); - var typeParameter = createNode(155 /* TypeParameter */); + var typeParameter = createNode(156 /* TypeParameter */); typeParameter.name = parseJSDocIdentifierName(ts.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces); finishNode(typeParameter); skipWhitespaceOrAsterisk(); typeParameters.push(typeParameter); } while (parseOptionalJsdoc(27 /* CommaToken */)); - var result = createNode(321 /* JSDocTemplateTag */, start); + var result = createNode(322 /* JSDocTemplateTag */, start); result.tagName = tagName; result.constraint = constraint; result.typeParameters = createNodeArray(typeParameters, typeParametersPos); @@ -26259,7 +26379,9 @@ var ts; ["esnext.symbol", "lib.es2019.symbol.d.ts"], ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"], ["esnext.intl", "lib.esnext.intl.d.ts"], - ["esnext.bigint", "lib.es2020.bigint.d.ts"] + ["esnext.bigint", "lib.es2020.bigint.d.ts"], + ["esnext.string", "lib.esnext.string.d.ts"], + ["esnext.promise", "lib.esnext.promise.d.ts"] ]; /** * An array of supported "lib" reference file names used to determine the order for inclusion @@ -27759,7 +27881,7 @@ var ts; function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) { var result = returnValue ? {} : undefined; var _loop_3 = function (element) { - if (element.kind !== 281 /* PropertyAssignment */) { + if (element.kind !== 282 /* PropertyAssignment */) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); return "continue"; } @@ -27850,13 +27972,13 @@ var ts; case 8 /* NumericLiteral */: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { break; // not valid JSON syntax } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; // Currently having element option declaration in the tsconfig with type "object" @@ -27873,7 +27995,7 @@ var ts; return convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined); } - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -29058,7 +29180,12 @@ var ts; ts.Debug.assert(ts.extensionIsTS(resolved.extension)); return { fileName: resolved.path, packageId: resolved.packageId }; } - function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations) { + function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, resultFromCache) { + var _a; + if (resultFromCache) { + (_a = resultFromCache.failedLookupLocations).push.apply(_a, failedLookupLocations); + return resultFromCache; + } return { resolvedModule: resolved && { resolvedFileName: resolved.path, originalPath: resolved.originalPath === true ? undefined : resolved.originalPath, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, failedLookupLocations: failedLookupLocations @@ -29750,15 +29877,12 @@ var ts; } ts.nodeModuleNameResolver = nodeModuleNameResolver; function nodeModuleNameResolverWorker(moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference) { + var _a, _b; var traceEnabled = isTraceEnabled(compilerOptions, host); var failedLookupLocations = []; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations }; var result = ts.forEach(extensions, function (ext) { return tryResolve(ext); }); - if (result && result.value) { - var _a = result.value, resolved = _a.resolved, isExternalLibraryImport = _a.isExternalLibraryImport; - return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations); - } - return { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; + return createResolvedModuleWithFailedLookupLocations((_a = result === null || result === void 0 ? void 0 : result.value) === null || _a === void 0 ? void 0 : _a.resolved, (_b = result === null || result === void 0 ? void 0 : result.value) === null || _b === void 0 ? void 0 : _b.isExternalLibraryImport, failedLookupLocations, state.resultFromCache); function tryResolve(extensions) { var loader = function (extensions, candidate, onlyRecordFailures, state) { return nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, /*considerPackageJson*/ true); }; var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, state); @@ -30195,13 +30319,12 @@ var ts; } ts.unmangleScopedPackageName = unmangleScopedPackageName; function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, state) { - var _a; var result = cache && cache.get(containingDirectory); if (result) { if (state.traceEnabled) { trace(state.host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory); } - (_a = state.failedLookupLocations).push.apply(_a, result.failedLookupLocations); + state.resultFromCache = result; return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, originalPath: result.resolvedModule.originalPath || true, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId } }; } } @@ -30212,7 +30335,7 @@ var ts; var containingDirectory = ts.getDirectoryPath(containingFile); var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); // No originalPath because classic resolution doesn't resolve realPath - return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations); + return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations, state.resultFromCache); function tryResolve(extensions) { var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state); if (resolvedUsingSettings) { @@ -30257,7 +30380,7 @@ var ts; var failedLookupLocations = []; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations }; var resolved = loadModuleFromImmediateNodeModulesDirectory(Extensions.DtsOnly, moduleName, globalCache, state, /*typesScopeOnly*/ false); - return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations); + return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations, state.resultFromCache); } ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache; /** @@ -30300,26 +30423,26 @@ var ts; // A module is uninstantiated if it contains only switch (node.kind) { // 1. interface declarations, type alias declarations - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: if (ts.isEnumConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: if (!(ts.hasModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } break; // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: var exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 261 /* NamedExports */) { + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 262 /* NamedExports */) { var state = 0 /* NonInstantiated */; for (var _i = 0, _a = exportDeclaration.exportClause.elements; _i < _a.length; _i++) { var specifier = _a[_i]; @@ -30335,7 +30458,7 @@ var ts; } break; // 5. other uninstantiated module declarations. - case 250 /* ModuleBlock */: { + case 251 /* ModuleBlock */: { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateCached(n, visited); @@ -30357,7 +30480,7 @@ var ts; }); return state_1; } - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 75 /* Identifier */: // Only jsdoc typedef definition can exist in jsdoc namespace, and it should @@ -30565,7 +30688,7 @@ var ts; // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { - if (node.kind === 259 /* ExportAssignment */) { + if (node.kind === 260 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } var name = ts.getNameOfDeclaration(node); @@ -30574,7 +30697,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 154 /* ComputedPropertyName */) { + if (name.kind === 155 /* ComputedPropertyName */) { var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteralLike(nameExpression)) { @@ -30602,36 +30725,36 @@ var ts; return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: return "__constructor" /* Constructor */; - case 170 /* FunctionType */: - case 165 /* CallSignature */: - case 305 /* JSDocSignature */: + case 171 /* FunctionType */: + case 166 /* CallSignature */: + case 306 /* JSDocSignature */: return "__call" /* Call */; - case 171 /* ConstructorType */: - case 166 /* ConstructSignature */: + case 172 /* ConstructorType */: + case 167 /* ConstructSignature */: return "__new" /* New */; - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: return "__index" /* Index */; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 290 /* SourceFile */: + case 291 /* SourceFile */: // json file should behave as // module.exports = ... return "export=" /* ExportEquals */; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) { // module.exports = ... return "export=" /* ExportEquals */; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */); - case 156 /* Parameter */: + case 157 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 300 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); + ts.Debug.assert(node.parent.kind === 301 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); var functionType = node.parent; var index = functionType.parameters.indexOf(node); return "arg" + index; @@ -30731,7 +30854,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (node.kind === 259 /* ExportAssignment */ && !node.isExportEquals)) { + (node.kind === 260 /* ExportAssignment */ && !node.isExportEquals)) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName_1 = false; multipleDefaultExports_1 = true; @@ -30770,7 +30893,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 263 /* ExportSpecifier */ || (node.kind === 253 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 264 /* ExportSpecifier */ || (node.kind === 254 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -30837,7 +30960,7 @@ var ts; // for it. We must clear this so we don't accidentally move any stale data forward from // a previous compilation. if (containerFlags & 1 /* IsContainer */) { - if (node.kind !== 202 /* ArrowFunction */) { + if (node.kind !== 203 /* ArrowFunction */) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -30870,7 +30993,7 @@ var ts; } // We create a return control flow graph for IIFEs and constructors. For constructors // we use the return control flow graph in strict property initialization checks. - currentReturnTarget = isIIFE || node.kind === 162 /* Constructor */ ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 163 /* Constructor */ ? createBranchLabel() : undefined; currentExceptionTarget = undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; @@ -30885,13 +31008,13 @@ var ts; node.flags |= 512 /* HasExplicitReturn */; node.endFlowNode = currentFlow; } - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 162 /* Constructor */) { + if (node.kind === 163 /* Constructor */) { node.returnFlowNode = currentFlow; } } @@ -30935,8 +31058,8 @@ var ts; } } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, function (n) { return n.kind === 244 /* FunctionDeclaration */ ? bind(n) : undefined; }); - bindEach(nodes, function (n) { return n.kind !== 244 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind === 245 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind !== 245 /* FunctionDeclaration */ ? bind(n) : undefined; }); } function bindEach(nodes, bindFunction) { if (bindFunction === void 0) { bindFunction = bind; } @@ -30968,90 +31091,90 @@ var ts; bindJSDoc(node); return; } - if (node.kind >= 225 /* FirstStatement */ && node.kind <= 241 /* LastStatement */ && !options.allowUnreachableCode) { + if (node.kind >= 226 /* FirstStatement */ && node.kind <= 242 /* LastStatement */ && !options.allowUnreachableCode) { node.flowNode = currentFlow; } switch (node.kind) { - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: bindWhileStatement(node); break; - case 228 /* DoStatement */: + case 229 /* DoStatement */: bindDoStatement(node); break; - case 230 /* ForStatement */: + case 231 /* ForStatement */: bindForStatement(node); break; - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 227 /* IfStatement */: + case 228 /* IfStatement */: bindIfStatement(node); break; - case 235 /* ReturnStatement */: - case 239 /* ThrowStatement */: + case 236 /* ReturnStatement */: + case 240 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 240 /* TryStatement */: + case 241 /* TryStatement */: bindTryStatement(node); break; - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: bindSwitchStatement(node); break; - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: bindCaseBlock(node); break; - case 277 /* CaseClause */: + case 278 /* CaseClause */: bindCaseClause(node); break; - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: bindExpressionStatement(node); break; - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: bindLabeledStatement(node); break; - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: bindAccessExpressionFlow(node); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: bindCallExpressionFlow(node); break; - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: bindJSDocTypeAlias(node); break; // In source files and blocks, bind functions first to match hoisting that occurs at runtime - case 290 /* SourceFile */: { + case 291 /* SourceFile */: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 223 /* Block */: - case 250 /* ModuleBlock */: + case 224 /* Block */: + case 251 /* ModuleBlock */: bindEachFunctionsFirst(node.statements); break; default: @@ -31064,18 +31187,18 @@ var ts; switch (expr.kind) { case 75 /* Identifier */: case 104 /* ThisKeyword */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return containsNarrowableReference(expr); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return hasNarrowableArgument(expr); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return isNarrowingExpression(expr.expression); } return false; @@ -31097,7 +31220,7 @@ var ts; } } } - if (expr.expression.kind === 194 /* PropertyAccessExpression */ && + if (expr.expression.kind === 195 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { return true; } @@ -31130,9 +31253,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 62 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -31208,26 +31331,26 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 227 /* IfStatement */: - case 229 /* WhileStatement */: - case 228 /* DoStatement */: + case 228 /* IfStatement */: + case 230 /* WhileStatement */: + case 229 /* DoStatement */: return parent.expression === node; - case 230 /* ForStatement */: - case 210 /* ConditionalExpression */: + case 231 /* ForStatement */: + case 211 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 200 /* ParenthesizedExpression */) { + if (node.kind === 201 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 207 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { + else if (node.kind === 208 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 209 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || + return node.kind === 210 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */); } @@ -31269,7 +31392,7 @@ var ts; } function setContinueTarget(node, target) { var label = activeLabelList; - while (label && node.parent.kind === 238 /* LabeledStatement */) { + while (label && node.parent.kind === 239 /* LabeledStatement */) { label.continueTarget = target; label = label.next; node = node.parent; @@ -31320,12 +31443,12 @@ var ts; bind(node.expression); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 232 /* ForOfStatement */) { + if (node.kind === 233 /* ForOfStatement */) { bind(node.awaitModifier); } addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 243 /* VariableDeclarationList */) { + if (node.initializer.kind !== 244 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -31347,7 +31470,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 235 /* ReturnStatement */) { + if (node.kind === 236 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -31364,7 +31487,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 234 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 235 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -31464,7 +31587,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 278 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 279 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). Note, we no longer need // this property in control flow analysis, it's there only for backwards compatibility. @@ -31513,7 +31636,7 @@ var ts; bind(node.expression); // A top level call expression with a dotted function name and at least one argument // is potentially an assertion and is therefore included in the control flow. - if (node.expression.kind === 196 /* CallExpression */) { + if (node.expression.kind === 197 /* CallExpression */) { var call = node.expression; if (ts.isDottedName(call.expression)) { currentFlow = createFlowCall(currentFlow, call); @@ -31539,7 +31662,7 @@ var ts; currentFlow = finishFlowLabel(postStatementLabel); } function bindDestructuringTargetFlow(node) { - if (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { + if (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -31550,10 +31673,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); } - else if (node.kind === 192 /* ArrayLiteralExpression */) { + else if (node.kind === 193 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 213 /* SpreadElement */) { + if (e.kind === 214 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -31561,16 +31684,16 @@ var ts; } } } - else if (node.kind === 193 /* ObjectLiteralExpression */) { + else if (node.kind === 194 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 281 /* PropertyAssignment */) { + if (p.kind === 282 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 282 /* ShorthandPropertyAssignment */) { + else if (p.kind === 283 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 283 /* SpreadAssignment */) { + else if (p.kind === 284 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -31692,7 +31815,7 @@ var ts; var operator = node.operatorToken.kind; if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 62 /* EqualsToken */ && node.left.kind === 195 /* ElementAccessExpression */) { + if (operator === 62 /* EqualsToken */ && node.left.kind === 196 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -31754,7 +31877,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 194 /* PropertyAccessExpression */) { + if (node.expression.kind === 195 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -31793,14 +31916,14 @@ var ts; } function bindJSDocTypeAlias(node) { node.tagName.parent = node; - if (node.kind !== 316 /* JSDocEnumTag */ && node.fullName) { + if (node.kind !== 317 /* JSDocEnumTag */ && node.fullName) { setParentPointers(node, node.fullName); } } function bindJSDocClassTag(node) { bindEachChild(node); var host = ts.getHostSignatureFromJSDoc(node); - if (host && host.kind !== 161 /* MethodDeclaration */) { + if (host && host.kind !== 162 /* MethodDeclaration */) { addDeclarationToSymbol(host.symbol, host, 32 /* Class */); } } @@ -31814,13 +31937,13 @@ var ts; function bindOptionalChainRest(node) { bind(node.questionDotToken); switch (node.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: bind(node.name); break; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: bind(node.argumentExpression); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: bindEach(node.typeArguments); bindEach(node.arguments); break; @@ -31876,7 +31999,7 @@ var ts; // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = ts.skipParentheses(node.expression); - if (expr.kind === 201 /* FunctionExpression */ || expr.kind === 202 /* ArrowFunction */) { + if (expr.kind === 202 /* FunctionExpression */ || expr.kind === 203 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -31885,7 +32008,7 @@ var ts; bindEachChild(node); } } - if (node.expression.kind === 194 /* PropertyAccessExpression */) { + if (node.expression.kind === 195 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (ts.isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -31894,54 +32017,54 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 193 /* ObjectLiteralExpression */: - case 173 /* TypeLiteral */: - case 304 /* JSDocTypeLiteral */: - case 274 /* JsxAttributes */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 194 /* ObjectLiteralExpression */: + case 174 /* TypeLiteral */: + case 305 /* JSDocTypeLiteral */: + case 275 /* JsxAttributes */: return 1 /* IsContainer */; - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 249 /* ModuleDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 186 /* MappedType */: + case 250 /* ModuleDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 187 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 290 /* SourceFile */: + case 291 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } // falls through - case 162 /* Constructor */: - case 244 /* FunctionDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 165 /* CallSignature */: - case 305 /* JSDocSignature */: - case 300 /* JSDocFunctionType */: - case 170 /* FunctionType */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 171 /* ConstructorType */: + case 163 /* Constructor */: + case 245 /* FunctionDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 166 /* CallSignature */: + case 306 /* JSDocSignature */: + case 301 /* JSDocFunctionType */: + case 171 /* FunctionType */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 172 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 280 /* CatchClause */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 251 /* CaseBlock */: + case 281 /* CatchClause */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 252 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 223 /* Block */: + case 224 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -31974,45 +32097,45 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 290 /* SourceFile */: + case 291 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 173 /* TypeLiteral */: - case 304 /* JSDocTypeLiteral */: - case 193 /* ObjectLiteralExpression */: - case 246 /* InterfaceDeclaration */: - case 274 /* JsxAttributes */: + case 174 /* TypeLiteral */: + case 305 /* JSDocTypeLiteral */: + case 194 /* ObjectLiteralExpression */: + case 247 /* InterfaceDeclaration */: + case 275 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 305 /* JSDocSignature */: - case 167 /* IndexSignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 300 /* JSDocFunctionType */: - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 247 /* TypeAliasDeclaration */: - case 186 /* MappedType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 306 /* JSDocSignature */: + case 168 /* IndexSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 301 /* JSDocFunctionType */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 248 /* TypeAliasDeclaration */: + case 187 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -32113,7 +32236,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 283 /* SpreadAssignment */ || prop.name.kind !== 75 /* Identifier */) { + if (prop.kind === 284 /* SpreadAssignment */ || prop.name.kind !== 75 /* Identifier */) { continue; } var identifier = prop.name; @@ -32125,7 +32248,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 281 /* PropertyAssignment */ || prop.kind === 282 /* ShorthandPropertyAssignment */ || prop.kind === 161 /* MethodDeclaration */ + var currentKind = prop.kind === 282 /* PropertyAssignment */ || prop.kind === 283 /* ShorthandPropertyAssignment */ || prop.kind === 162 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen.get(identifier.escapedText); @@ -32157,10 +32280,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (ts.isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -32346,8 +32469,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 290 /* SourceFile */ && - blockScopeContainer.kind !== 249 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 291 /* SourceFile */ && + blockScopeContainer.kind !== 250 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -32442,7 +32565,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 152 /* LastToken */) { + if (node.kind > 153 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -32518,14 +32641,14 @@ var ts; } // falls through case 104 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 282 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 283 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); case 76 /* PrivateIdentifier */: return checkPrivateIdentifier(node); - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: var expr = node; if (currentFlow && isNarrowableReference(expr)) { expr.flowNode = currentFlow; @@ -32540,7 +32663,7 @@ var ts; declareSymbol(file.locals, /*parent*/ undefined, expr.expression, 1 /* FunctionScopedVariable */ | 134217728 /* ModuleExports */, 111550 /* FunctionScopedVariableExcludes */); } break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var specialKind = ts.getAssignmentDeclarationKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -32568,78 +32691,78 @@ var ts; ts.Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return checkStrictModeCatchClause(node); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return checkStrictModeWithStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return checkStrictModeLabeledStatement(node); - case 183 /* ThisType */: + case 184 /* ThisType */: seenThisKeyword = true; return; - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: break; // Binding the children will handle everything - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return bindTypeParameter(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return bindParameter(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 191 /* BindingElement */: + case 192 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return bindPropertyWorker(node); - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 284 /* EnumMember */: + case 285 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */); - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */); - case 170 /* FunctionType */: - case 300 /* JSDocFunctionType */: - case 305 /* JSDocSignature */: - case 171 /* ConstructorType */: + case 171 /* FunctionType */: + case 301 /* JSDocFunctionType */: + case 306 /* JSDocSignature */: + case 172 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 173 /* TypeLiteral */: - case 304 /* JSDocTypeLiteral */: - case 186 /* MappedType */: + case 174 /* TypeLiteral */: + case 305 /* JSDocTypeLiteral */: + case 187 /* MappedType */: return bindAnonymousTypeWorker(node); - case 310 /* JSDocClassTag */: + case 311 /* JSDocClassTag */: return bindJSDocClassTag(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return bindFunctionExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: var assignmentKind = ts.getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7 /* ObjectDefinePropertyValue */: @@ -32658,65 +32781,65 @@ var ts; } break; // Members of classes, interfaces, and modules - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return bindJsxAttributes(node); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 253 /* ImportEqualsDeclaration */: - case 256 /* NamespaceImport */: - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 254 /* ImportEqualsDeclaration */: + case 257 /* NamespaceImport */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return bindImportClause(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return bindExportDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return bindExportAssignment(node); - case 290 /* SourceFile */: + case 291 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 223 /* Block */: + case 224 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } // falls through - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 317 /* JSDocParameterTag */: - if (node.parent.kind === 305 /* JSDocSignature */) { + case 318 /* JSDocParameterTag */: + if (node.parent.kind === 306 /* JSDocSignature */) { return bindParameter(node); } - if (node.parent.kind !== 304 /* JSDocTypeLiteral */) { + if (node.parent.kind !== 305 /* JSDocTypeLiteral */) { break; } // falls through - case 323 /* JSDocPropertyTag */: + case 324 /* JSDocPropertyTag */: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 299 /* JSDocOptionalType */ ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 300 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); } } @@ -32872,8 +32995,8 @@ var ts; } var thisContainer = ts.getThisContainer(node, /*includeArrowFunctions*/ false); switch (thisContainer.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: var constructorSymbol = thisContainer.symbol; // For `f.prototype.m = function() { this.x = 0; }`, `this.x = 0` should modify `f`'s members, not the function expression. if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -32895,11 +33018,11 @@ var ts; addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */); } break; - case 162 /* Constructor */: - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 163 /* Constructor */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // this.foo assignment in a JavaScript class // Bind this property to the containing class var containingClass = thisContainer.parent; @@ -32911,7 +33034,7 @@ var ts; declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, /*isReplaceableByMethod*/ true); } break; - case 290 /* SourceFile */: + case 291 /* SourceFile */: // this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script if (ts.hasDynamicName(node)) { break; @@ -32941,7 +33064,7 @@ var ts; if (node.expression.kind === 104 /* ThisKeyword */) { bindThisPropertyAssignment(node); } - else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 290 /* SourceFile */) { + else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 291 /* SourceFile */) { if (ts.isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } @@ -32981,7 +33104,7 @@ var ts; } function bindObjectDefinePropertyAssignment(node) { var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - var isToplevel = node.parent.parent.kind === 290 /* SourceFile */; + var isToplevel = node.parent.parent.kind === 291 /* SourceFile */; namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, /*isPrototypeProperty*/ false, /*containerIsClass*/ false); bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, /*isPrototypeProperty*/ false); } @@ -33083,8 +33206,8 @@ var ts; } function isTopLevelNamespaceAssignment(propertyAccess) { return ts.isBinaryExpression(propertyAccess.parent) - ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 290 /* SourceFile */ - : propertyAccess.parent.parent.kind === 290 /* SourceFile */; + ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 291 /* SourceFile */ + : propertyAccess.parent.parent.kind === 291 /* SourceFile */; } function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { var namespaceSymbol = lookupSymbolForPropertyAccess(name); @@ -33163,7 +33286,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 245 /* ClassDeclaration */) { + if (node.kind === 246 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */); } else { @@ -33226,7 +33349,7 @@ var ts; } } function bindParameter(node) { - if (node.kind === 317 /* JSDocParameterTag */ && container.kind !== 305 /* JSDocSignature */) { + if (node.kind === 318 /* JSDocParameterTag */ && container.kind !== 306 /* JSDocSignature */) { return; } if (inStrictMode && !(node.flags & 8388608 /* Ambient */)) { @@ -33303,7 +33426,7 @@ var ts; declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); } } - else if (node.parent.kind === 181 /* InferType */) { + else if (node.parent.kind === 182 /* InferType */) { var container_2 = getInferTypeContainer(node.parent); if (container_2) { if (!container_2.locals) { @@ -33331,11 +33454,11 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 224 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 225 /* EmptyStatement */) || // report error on class declarations - node.kind === 245 /* ClassDeclaration */ || + node.kind === 246 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 249 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); + (node.kind === 250 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); if (reportError) { currentFlow = reportedUnreachableFlow; if (!options.allowUnreachableCode) { @@ -33379,12 +33502,12 @@ var ts; } function isPurelyTypeDeclaration(s) { switch (s.kind) { - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: return true; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return getModuleInstanceState(s) !== 1 /* Instantiated */; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return ts.hasModifier(s, 2048 /* Const */); default: return false; @@ -33433,58 +33556,58 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 196 /* CallExpression */: + case 197 /* CallExpression */: return computeCallExpression(node, subtreeFlags); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return computeNewExpression(node, subtreeFlags); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return computeModuleDeclaration(node, subtreeFlags); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return computeParenthesizedExpression(node, subtreeFlags); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return computeBinaryExpression(node, subtreeFlags); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return computeExpressionStatement(node, subtreeFlags); - case 156 /* Parameter */: + case 157 /* Parameter */: return computeParameter(node, subtreeFlags); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return computeArrowFunction(node, subtreeFlags); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return computeFunctionExpression(node, subtreeFlags); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return computeFunctionDeclaration(node, subtreeFlags); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return computeVariableDeclaration(node, subtreeFlags); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return computeVariableDeclarationList(node, subtreeFlags); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return computeVariableStatement(node, subtreeFlags); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return computeLabeledStatement(node, subtreeFlags); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return computeClassDeclaration(node, subtreeFlags); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return computeClassExpression(node, subtreeFlags); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: return computeHeritageClause(node, subtreeFlags); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return computeCatchClause(node, subtreeFlags); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 162 /* Constructor */: + case 163 /* Constructor */: return computeConstructor(node, subtreeFlags); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return computePropertyDeclaration(node, subtreeFlags); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return computeMethod(node, subtreeFlags); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return computeAccessor(node, subtreeFlags); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return computeImportEquals(node, subtreeFlags); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return computePropertyAccess(node, subtreeFlags); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return computeElementAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); @@ -33535,12 +33658,12 @@ var ts; if (operatorTokenKind === 60 /* QuestionQuestionToken */) { transformFlags |= 8 /* AssertES2020 */; } - else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 193 /* ObjectLiteralExpression */) { + else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 194 /* ObjectLiteralExpression */) { // Destructuring object assignments with are ES2015 syntax // and possibly ES2018 if they contain rest transformFlags |= 32 /* AssertES2018 */ | 256 /* AssertES2015 */ | 1024 /* AssertDestructuringAssignment */; } - else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 192 /* ArrayLiteralExpression */) { + else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 193 /* ArrayLiteralExpression */) { // Destructuring assignments are ES2015 syntax. transformFlags |= 256 /* AssertES2015 */ | 1024 /* AssertDestructuringAssignment */; } @@ -33588,8 +33711,8 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (expressionKind === 217 /* AsExpression */ - || expressionKind === 199 /* TypeAssertionExpression */) { + if (expressionKind === 218 /* AsExpression */ + || expressionKind === 200 /* TypeAssertionExpression */) { transformFlags |= 1 /* AssertTypeScript */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; @@ -33937,13 +34060,13 @@ var ts; // async is ES2017 syntax, but may be ES2018 syntax (for async generators) transformFlags |= 32 /* AssertES2018 */ | 64 /* AssertES2017 */; break; - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: // await is ES2017 syntax, but may be ES2018 syntax (for async generators) transformFlags |= 32 /* AssertES2018 */ | 64 /* AssertES2017 */ | 524288 /* ContainsAwait */; break; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: - case 326 /* PartiallyEmittedExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: + case 327 /* PartiallyEmittedExpression */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; excludeFlags = 536870912 /* OuterExpressionExcludes */; @@ -33952,27 +34075,27 @@ var ts; case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 122 /* AbstractKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 81 /* ConstKeyword */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 218 /* NonNullExpression */: - case 138 /* ReadonlyKeyword */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 219 /* NonNullExpression */: + case 139 /* ReadonlyKeyword */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; break; - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: case 11 /* JsxText */: - case 269 /* JsxClosingElement */: - case 270 /* JsxFragment */: - case 271 /* JsxOpeningFragment */: - case 272 /* JsxClosingFragment */: - case 273 /* JsxAttribute */: - case 274 /* JsxAttributes */: - case 275 /* JsxSpreadAttribute */: - case 276 /* JsxExpression */: + case 270 /* JsxClosingElement */: + case 271 /* JsxFragment */: + case 272 /* JsxOpeningFragment */: + case 273 /* JsxClosingFragment */: + case 274 /* JsxAttribute */: + case 275 /* JsxAttributes */: + case 276 /* JsxSpreadAttribute */: + case 277 /* JsxExpression */: // These nodes are Jsx syntax. transformFlags |= 2 /* AssertJsx */; break; @@ -33985,16 +34108,16 @@ var ts; break; } // falls through - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: if (ts.hasInvalidEscape(node.template)) { transformFlags |= 32 /* AssertES2018 */; break; } // falls through - case 211 /* TemplateExpression */: - case 282 /* ShorthandPropertyAssignment */: + case 212 /* TemplateExpression */: + case 283 /* ShorthandPropertyAssignment */: case 120 /* StaticKeyword */: - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: // These nodes are ES6 syntax. transformFlags |= 256 /* AssertES2015 */; break; @@ -34011,70 +34134,70 @@ var ts; case 9 /* BigIntLiteral */: transformFlags |= 4 /* AssertESNext */; break; - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: // This node is either ES2015 syntax or ES2017 syntax (if it is a for-await-of). if (node.awaitModifier) { transformFlags |= 32 /* AssertES2018 */; } transformFlags |= 256 /* AssertES2015 */; break; - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: // This node is either ES2015 syntax (in a generator) or ES2017 syntax (in an async // generator). transformFlags |= 32 /* AssertES2018 */ | 256 /* AssertES2015 */ | 262144 /* ContainsYield */; break; case 125 /* AnyKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 137 /* NeverKeyword */: - case 141 /* ObjectKeyword */: - case 143 /* StringKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 138 /* NeverKeyword */: + case 142 /* ObjectKeyword */: + case 144 /* StringKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: case 110 /* VoidKeyword */: - case 155 /* TypeParameter */: - case 158 /* PropertySignature */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 168 /* TypePredicate */: - case 169 /* TypeReference */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 172 /* TypeQuery */: - case 173 /* TypeLiteral */: - case 174 /* ArrayType */: - case 175 /* TupleType */: - case 176 /* OptionalType */: - case 177 /* RestType */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 180 /* ConditionalType */: - case 181 /* InferType */: - case 182 /* ParenthesizedType */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 183 /* ThisType */: - case 184 /* TypeOperator */: - case 185 /* IndexedAccessType */: - case 186 /* MappedType */: - case 187 /* LiteralType */: - case 252 /* NamespaceExportDeclaration */: + case 156 /* TypeParameter */: + case 159 /* PropertySignature */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 169 /* TypePredicate */: + case 170 /* TypeReference */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 173 /* TypeQuery */: + case 174 /* TypeLiteral */: + case 175 /* ArrayType */: + case 176 /* TupleType */: + case 177 /* OptionalType */: + case 178 /* RestType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 181 /* ConditionalType */: + case 182 /* InferType */: + case 183 /* ParenthesizedType */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 184 /* ThisType */: + case 185 /* TypeOperator */: + case 186 /* IndexedAccessType */: + case 187 /* MappedType */: + case 188 /* LiteralType */: + case 253 /* NamespaceExportDeclaration */: // Types and signatures are TypeScript syntax, and exclude all other facts. transformFlags = 1 /* AssertTypeScript */; excludeFlags = -2 /* TypeExcludes */; break; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: // Even though computed property names are ES6, we don't treat them as such. // This is so that they can flow through PropertyName transforms unaffected. // Instead, we mark the container as ES6, so that it can properly handle the transform. transformFlags |= 32768 /* ContainsComputedPropertyName */; break; - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: transformFlags |= 256 /* AssertES2015 */ | 8192 /* ContainsRestOrSpread */; break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: transformFlags |= 32 /* AssertES2018 */ | 16384 /* ContainsObjectRestOrSpread */; break; case 102 /* SuperKeyword */: @@ -34086,28 +34209,28 @@ var ts; // Mark this node and its ancestors as containing a lexical `this` keyword. transformFlags |= 4096 /* ContainsLexicalThis */; break; - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: transformFlags |= 256 /* AssertES2015 */ | 131072 /* ContainsBindingPattern */; if (subtreeFlags & 8192 /* ContainsRestOrSpread */) { transformFlags |= 32 /* AssertES2018 */ | 16384 /* ContainsObjectRestOrSpread */; } excludeFlags = 536879104 /* BindingPatternExcludes */; break; - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: transformFlags |= 256 /* AssertES2015 */ | 131072 /* ContainsBindingPattern */; excludeFlags = 536879104 /* BindingPatternExcludes */; break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: transformFlags |= 256 /* AssertES2015 */; if (node.dotDotDotToken) { transformFlags |= 8192 /* ContainsRestOrSpread */; } break; - case 157 /* Decorator */: + case 158 /* Decorator */: // This node is TypeScript syntax, and marks its container as also being TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */ | 2048 /* ContainsTypeScriptClassSyntax */; break; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: excludeFlags = 536922112 /* ObjectLiteralExcludes */; if (subtreeFlags & 32768 /* ContainsComputedPropertyName */) { // If an ObjectLiteralExpression contains a ComputedPropertyName, then it @@ -34120,29 +34243,29 @@ var ts; transformFlags |= 32 /* AssertES2018 */; } break; - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: excludeFlags = 536879104 /* ArrayLiteralOrCallOrNewExcludes */; break; - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: // A loop containing a block scoped binding *may* need to be transformed from ES6. if (subtreeFlags & 65536 /* ContainsBlockScopedBinding */) { transformFlags |= 256 /* AssertES2015 */; } break; - case 290 /* SourceFile */: + case 291 /* SourceFile */: break; - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: transformFlags |= 4 /* AssertESNext */; break; - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: // Return statements may require an `await` in ES2018. transformFlags |= 1048576 /* ContainsHoistedDeclarationOrCompletion */ | 32 /* AssertES2018 */; break; - case 233 /* ContinueStatement */: - case 234 /* BreakStatement */: + case 234 /* ContinueStatement */: + case 235 /* BreakStatement */: transformFlags |= 1048576 /* ContainsHoistedDeclarationOrCompletion */; break; case 76 /* PrivateIdentifier */: @@ -34163,67 +34286,67 @@ var ts; * than calling this function. */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 168 /* FirstTypeNode */ && kind <= 188 /* LastTypeNode */) { + if (kind >= 169 /* FirstTypeNode */ && kind <= 189 /* LastTypeNode */) { return -2 /* TypeExcludes */; } switch (kind) { - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 192 /* ArrayLiteralExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 193 /* ArrayLiteralExpression */: return 536879104 /* ArrayLiteralOrCallOrNewExcludes */; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return 537991168 /* ModuleExcludes */; - case 156 /* Parameter */: + case 157 /* Parameter */: return 536870912 /* ParameterExcludes */; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return 538920960 /* ArrowFunctionExcludes */; - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: return 538925056 /* FunctionExcludes */; - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return 537018368 /* VariableDeclarationListExcludes */; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return 536905728 /* ClassExcludes */; - case 162 /* Constructor */: + case 163 /* Constructor */: return 538923008 /* ConstructorExcludes */; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return 538923008 /* MethodOrAccessorExcludes */; case 125 /* AnyKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 137 /* NeverKeyword */: - case 143 /* StringKeyword */: - case 141 /* ObjectKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 138 /* NeverKeyword */: + case 144 /* StringKeyword */: + case 142 /* ObjectKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: case 110 /* VoidKeyword */: - case 155 /* TypeParameter */: - case 158 /* PropertySignature */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 156 /* TypeParameter */: + case 159 /* PropertySignature */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: return -2 /* TypeExcludes */; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return 536922112 /* ObjectLiteralExcludes */; - case 280 /* CatchClause */: + case 281 /* CatchClause */: return 536887296 /* CatchClauseExcludes */; - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: return 536879104 /* BindingPatternExcludes */; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: - case 326 /* PartiallyEmittedExpression */: - case 200 /* ParenthesizedExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: + case 327 /* PartiallyEmittedExpression */: + case 201 /* ParenthesizedExpression */: case 102 /* SuperKeyword */: return 536870912 /* OuterExpressionExcludes */; - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return 536870912 /* PropertyAccessExcludes */; default: return 536870912 /* NodeExcludes */; @@ -34398,7 +34521,7 @@ var ts; // (their type resolved directly to the member deeply referenced) // So to get the intervening symbols, we need to check if there's a type // query node on any of the symbol's declarations and get symbols there - if (d.type && d.type.kind === 172 /* TypeQuery */) { + if (d.type && d.type.kind === 173 /* TypeQuery */) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -34584,6 +34707,7 @@ var ts; IntersectionState[IntersectionState["None"] = 0] = "None"; IntersectionState[IntersectionState["Source"] = 1] = "Source"; IntersectionState[IntersectionState["Target"] = 2] = "Target"; + IntersectionState[IntersectionState["ExcessCheck"] = 4] = "ExcessCheck"; })(IntersectionState || (IntersectionState = {})); var MappedTypeModifiers; (function (MappedTypeModifiers) { @@ -34626,6 +34750,11 @@ var ts; DeclarationSpaces[DeclarationSpaces["ExportType"] = 2] = "ExportType"; DeclarationSpaces[DeclarationSpaces["ExportNamespace"] = 4] = "ExportNamespace"; })(DeclarationSpaces || (DeclarationSpaces = {})); + function SymbolLinks() { + } + function NodeLinks() { + this.flags = 0; + } function getNodeId(node) { if (!node.id) { node.id = nextNodeId; @@ -34685,7 +34814,6 @@ var ts; var constraintDepth = 0; var currentNode; var emptySymbols = ts.createSymbolTable(); - var identityMapper = ts.identity; var arrayVariances = [1 /* Covariant */]; var compilerOptions = host.getCompilerOptions(); var languageVersion = ts.getEmitScriptTarget(compilerOptions); @@ -35035,6 +35163,7 @@ var ts; var literalTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); var substitutionTypes = ts.createMap(); + var awaitedTypes = ts.createMap(); var evolvingArrayTypes = []; var undefinedProperties = ts.createMap(); var unknownSymbol = createSymbol(4 /* Property */, "unknown"); @@ -35082,6 +35211,8 @@ var ts; var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); var keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; var numberOrBigIntType = getUnionType([numberType, bigintType]); + var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t; }); + var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? wildcardType : t; }); var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var emptyJsxObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); emptyJsxObjectType.objectFlags |= 4096 /* JsxAttributes */; @@ -35591,14 +35722,14 @@ var ts; if (symbol.flags & 33554432 /* Transient */) return symbol; var id = getSymbolId(symbol); - return symbolLinks[id] || (symbolLinks[id] = {}); + return symbolLinks[id] || (symbolLinks[id] = new SymbolLinks()); } function getNodeLinks(node) { var nodeId = getNodeId(node); - return nodeLinks[nodeId] || (nodeLinks[nodeId] = { flags: 0 }); + return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); } function isGlobalSourceFile(node) { - return node.kind === 290 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 291 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -35656,17 +35787,17 @@ var ts; } if (declaration.pos <= usage.pos) { // declaration is before usage - if (declaration.kind === 191 /* BindingElement */) { + if (declaration.kind === 192 /* BindingElement */) { // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) - var errorBindingElement = ts.getAncestor(usage, 191 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 192 /* BindingElement */); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 242 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 243 /* VariableDeclaration */), usage); } - else if (declaration.kind === 242 /* VariableDeclaration */) { + else if (declaration.kind === 243 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } @@ -35697,12 +35828,12 @@ var ts; // or if usage is in a type context: // 1. inside a type query (typeof in type position) // 2. inside a jsdoc comment - if (usage.parent.kind === 263 /* ExportSpecifier */ || (usage.parent.kind === 259 /* ExportAssignment */ && usage.parent.isExportEquals)) { + if (usage.parent.kind === 264 /* ExportSpecifier */ || (usage.parent.kind === 260 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } // When resolving symbols for exports, the `usage` location passed in can be the export site directly - if (usage.kind === 259 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 260 /* ExportAssignment */ && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -35722,9 +35853,9 @@ var ts; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 225 /* VariableStatement */: - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: + case 226 /* VariableStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, container)) { @@ -35745,16 +35876,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 159 /* PropertyDeclaration */ && + current.parent.kind === 160 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasModifier(current.parent, 32 /* Static */)) { - if (declaration.kind === 161 /* MethodDeclaration */) { + if (declaration.kind === 162 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -35776,19 +35907,19 @@ var ts; return "quit"; } switch (node.kind) { - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return true; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // even when stopping at any property declaration, they need to come from the same class return stopAtAnyPropertyDeclaration && (ts.isPropertyDeclaration(declaration) && node.parent === declaration.parent || ts.isParameterPropertyDeclaration(declaration, declaration.parent) && node.parent === declaration.parent.parent) ? "quit" : true; - case 223 /* Block */: + case 224 /* Block */: switch (node.parent.kind) { - case 163 /* GetAccessor */: - case 161 /* MethodDeclaration */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 162 /* MethodDeclaration */: + case 165 /* SetAccessor */: return true; default: return false; @@ -35834,12 +35965,12 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 303 /* JSDocComment */) { + if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 304 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === location.type || - lastLocation.kind === 156 /* Parameter */ || - lastLocation.kind === 155 /* TypeParameter */ + lastLocation.kind === 157 /* Parameter */ || + lastLocation.kind === 156 /* TypeParameter */ // local types not visible outside the function body : false; } @@ -35856,13 +35987,13 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 156 /* Parameter */ || + lastLocation.kind === 157 /* Parameter */ || (lastLocation === location.type && !!ts.findAncestor(result.valueDeclaration, ts.isParameter)); } } } - else if (location.kind === 180 /* ConditionalType */) { + else if (location.kind === 181 /* ConditionalType */) { // A type parameter declared using 'infer T' in a conditional type is visible only in // the true branch of the conditional type. useResult = lastLocation === location.trueType; @@ -35877,14 +36008,14 @@ var ts; } withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; // falls through - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports || emptySymbols; - if (location.kind === 290 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { + if (location.kind === 291 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. if (result = moduleExports.get("default" /* Default */)) { @@ -35908,7 +36039,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && - (ts.getDeclarationOfKind(moduleExport, 263 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 262 /* NamespaceExport */))) { + (ts.getDeclarationOfKind(moduleExport, 264 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 263 /* NamespaceExport */))) { break; } } @@ -35922,12 +36053,12 @@ var ts; } } break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -35944,9 +36075,9 @@ var ts; } } break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: // The below is used to lookup type parameters within a class or interface, as they are added to the class/interface locals // These can never be latebound, so the symbol's raw members are sufficient. `getMembersOfNode` cannot be used, as it would // trigger resolving late-bound names, which we may already be in the process of doing while we're here! @@ -35965,7 +36096,7 @@ var ts; } break loop; } - if (location.kind === 214 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 215 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -35973,7 +36104,7 @@ var ts; } } break; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: // The type parameters of a class are not in scope in the base class expression. if (lastLocation === location.expression && location.parent.token === 90 /* ExtendsKeyword */) { var container = location.parent.parent; @@ -35993,9 +36124,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 246 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 247 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -36003,24 +36134,24 @@ var ts; } } break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: // when targeting ES6 or higher there is no 'arguments' in an arrow function // for lower compile targets the resolved symbol is used to emit an error if (compilerOptions.target >= 2 /* ES2015 */) { break; } // falls through - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -36033,7 +36164,7 @@ var ts; } } break; - case 157 /* Decorator */: + case 158 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -36042,7 +36173,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 156 /* Parameter */) { + if (location.parent && location.parent.kind === 157 /* Parameter */) { location = location.parent; } // @@ -36057,25 +36188,25 @@ var ts; // declare function y(x: T): any; // @param(1 as T) // <-- T should resolve to the type alias outside of class C // class C {} - if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 245 /* ClassDeclaration */)) { + if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 246 /* ClassDeclaration */)) { location = location.parent; } break; - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: // js type aliases do not resolve names from their host, so skip past it location = ts.getJSDocHost(location); break; - case 156 /* Parameter */: + case 157 /* Parameter */: if (lastLocation && lastLocation === location.initializer) { associatedDeclarationForContainingInitializer = location; } break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: if (lastLocation && lastLocation === location.initializer) { var root = ts.getRootDeclaration(location); - if (root.kind === 156 /* Parameter */) { + if (root.kind === 157 /* Parameter */) { associatedDeclarationForContainingInitializer = location; } } @@ -36095,7 +36226,7 @@ var ts; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 290 /* SourceFile */); + ts.Debug.assert(lastLocation.kind === 291 /* SourceFile */); if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) { return lastLocation.symbol; } @@ -36212,10 +36343,10 @@ var ts; } } function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 202 /* ArrowFunction */ && location.kind !== 201 /* FunctionExpression */) { + if (location.kind !== 203 /* ArrowFunction */ && location.kind !== 202 /* FunctionExpression */) { // initializers in instance property declaration of class like entities are executed in constructor and thus deferred return ts.isTypeQueryNode(location) || ((ts.isFunctionLikeDeclaration(location) || - (location.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred + (location.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred } if (lastLocation && lastLocation === location.name) { return false; @@ -36228,12 +36359,12 @@ var ts; } function isSelfReferenceLocation(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 249 /* ModuleDeclaration */: // For `namespace N { N; }` + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 250 /* ModuleDeclaration */: // For `namespace N { N; }` return true; default: return false; @@ -36245,7 +36376,7 @@ var ts; function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 155 /* TypeParameter */) { + if (decl.kind === 156 /* TypeParameter */) { var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent; if (parent === container) { return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias)); // TODO: GH#18217 @@ -36301,9 +36432,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 75 /* Identifier */: - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -36337,7 +36468,7 @@ var ts; if (meaning & (788968 /* Type */ & ~1920 /* Namespace */)) { var symbol = resolveSymbol(resolveName(errorLocation, name, ~788968 /* Type */ & 111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); if (symbol && !(symbol.flags & 1920 /* Namespace */)) { - error(errorLocation, ts.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here, ts.unescapeLeadingUnderscores(name)); + error(errorLocation, ts.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0, ts.unescapeLeadingUnderscores(name)); return true; } } @@ -36347,7 +36478,7 @@ var ts; return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; } function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 263 /* ExportSpecifier */) { + if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 264 /* ExportSpecifier */) { error(errorLocation, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); return true; } @@ -36406,7 +36537,7 @@ var ts; return; } // Block-scoped variables cannot be used before their definition - var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 248 /* EnumDeclaration */); }); + var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 249 /* EnumDeclaration */); }); if (declaration === undefined) return ts.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); if (!(declaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { @@ -36441,13 +36572,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return node; - case 255 /* ImportClause */: + case 256 /* ImportClause */: return node.parent; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return node.parent.parent; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return node.parent.parent.parent; default: return undefined; @@ -36471,28 +36602,28 @@ var ts; * {name: } */ function isAliasSymbolDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */ || - node.kind === 252 /* NamespaceExportDeclaration */ || - node.kind === 255 /* ImportClause */ && !!node.name || - node.kind === 256 /* NamespaceImport */ || - node.kind === 262 /* NamespaceExport */ || - node.kind === 258 /* ImportSpecifier */ || - node.kind === 263 /* ExportSpecifier */ || - node.kind === 259 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || + return node.kind === 254 /* ImportEqualsDeclaration */ || + node.kind === 253 /* NamespaceExportDeclaration */ || + node.kind === 256 /* ImportClause */ && !!node.name || + node.kind === 257 /* NamespaceImport */ || + node.kind === 263 /* NamespaceExport */ || + node.kind === 259 /* ImportSpecifier */ || + node.kind === 264 /* ExportSpecifier */ || + node.kind === 260 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || - node.kind === 282 /* ShorthandPropertyAssignment */ || - node.kind === 281 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); + node.kind === 283 /* ShorthandPropertyAssignment */ || + node.kind === 282 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); } function isAliasableOrJsExpression(e) { return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - if (node.moduleReference.kind === 265 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 266 /* ExternalModuleReference */) { var immediate = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var resolved_4 = resolveExternalModuleSymbol(immediate); markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved_4, /*overwriteEmpty*/ false); @@ -36793,28 +36924,28 @@ var ts; function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; } switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 259 /* ExportAssignment */: - case 209 /* BinaryExpression */: + case 260 /* ExportAssignment */: + case 210 /* BinaryExpression */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ true, dontRecursivelyResolve); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return getTargetOfPropertyAssignment(node, dontRecursivelyResolve); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve); default: return ts.Debug.fail(); @@ -36854,6 +36985,13 @@ var ts; } return links.target; } + function tryResolveAlias(symbol) { + var links = getSymbolLinks(symbol); + if (links.target !== resolvingSymbol) { + return resolveAlias(symbol); + } + return undefined; + } /** * Marks a symbol as type-only if its declaration is syntactically type-only. * If it is not itself marked type-only, but resolves to a type-only alias @@ -36959,13 +37097,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 75 /* Identifier */ || entityName.parent.kind === 153 /* QualifiedName */) { + if (entityName.kind === 75 /* Identifier */ || entityName.parent.kind === 154 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 253 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 254 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } @@ -36989,9 +37127,9 @@ var ts; return symbolFromJSPrototype; } } - else if (name.kind === 153 /* QualifiedName */ || name.kind === 194 /* PropertyAccessExpression */) { - var left = name.kind === 153 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 153 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 154 /* QualifiedName */ || name.kind === 195 /* PropertyAccessExpression */) { + var left = name.kind === 154 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 154 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -37026,7 +37164,7 @@ var ts; throw ts.Debug.assertNever(name, "Unknown entity name kind."); } ts.Debug.assert((ts.getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 259 /* ExportAssignment */)) { + if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 260 /* ExportAssignment */)) { markSymbolOfAliasDeclarationIfTypeOnly(ts.getAliasDeclarationFromName(name), symbol, /*finalTarget*/ undefined, /*overwriteEmpty*/ true); } return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); @@ -37105,7 +37243,7 @@ var ts; } } function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) { - return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : ts.Diagnostics.Cannot_find_module_0); + return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : ts.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations); } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } @@ -37248,7 +37386,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 290 /* SourceFile */)) { + if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 291 /* SourceFile */)) { var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; @@ -37535,7 +37673,7 @@ var ts; var members = node.members; for (var _i = 0, members_3 = members; _i < members_3.length; _i++) { var member = members_3[_i]; - if (member.kind === 162 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 163 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -37622,12 +37760,12 @@ var ts; } } switch (location.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } // falls through - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: var sym = getSymbolOfNode(location); // `sym` may not have exports if this module declaration is backed by the symbol for a `const` that's being rewritten // into a namespace - in such cases, it's best to just let the namespace appear empty (the const members couldn't have referred @@ -37636,9 +37774,9 @@ var ts; return { value: result }; } break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: // Type parameters are bound into `members` lists so they can merge across declarations // This is troublesome, since in all other respects, they behave like locals :cries: // TODO: the below is shared with similar code in `resolveName` - in fact, rephrasing all this symbol @@ -37721,7 +37859,7 @@ var ts; && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) // While exports are generally considered to be in scope, export-specifier declared symbols are _not_ // See similar comment in `resolveName` for details - && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 263 /* ExportSpecifier */))) { + && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 264 /* ExportSpecifier */))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); var candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); if (candidate) { @@ -37765,7 +37903,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 263 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 264 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -37780,10 +37918,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: continue; default: return false; @@ -37914,10 +38052,10 @@ var ts; return node && getSymbolOfNode(node); } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -37964,14 +38102,14 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 172 /* TypeQuery */ || + if (entityName.parent.kind === 173 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 154 /* ComputedPropertyName */) { + entityName.parent.kind === 155 /* ComputedPropertyName */) { // Typeof value meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 153 /* QualifiedName */ || entityName.kind === 194 /* PropertyAccessExpression */ || - entityName.parent.kind === 253 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 154 /* QualifiedName */ || entityName.kind === 195 /* PropertyAccessExpression */ || + entityName.parent.kind === 254 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -38020,10 +38158,10 @@ var ts; function signatureToStringWorker(writer) { var sigOutput; if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 171 /* ConstructorType */ : 170 /* FunctionType */; + sigOutput = kind === 1 /* Construct */ ? 172 /* ConstructorType */ : 171 /* FunctionType */; } else { - sigOutput = kind === 1 /* Construct */ ? 166 /* ConstructSignature */ : 165 /* CallSignature */; + sigOutput = kind === 1 /* Construct */ ? 167 /* ConstructSignature */ : 166 /* CallSignature */; } var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); @@ -38107,6 +38245,7 @@ var ts; getSourceFiles: function () { return host.getSourceFiles(); }, getCurrentDirectory: ts.maybeBind(host, host.getCurrentDirectory), getProbableSymlinks: ts.maybeBind(host, host.getProbableSymlinks), + useCaseSensitiveFileNames: ts.maybeBind(host, host.useCaseSensitiveFileNames) } : undefined }, encounteredError: false, visitedTypes: undefined, @@ -38138,23 +38277,23 @@ var ts; return ts.createKeywordTypeNode(125 /* AnyKeyword */); } if (type.flags & 2 /* Unknown */) { - return ts.createKeywordTypeNode(148 /* UnknownKeyword */); + return ts.createKeywordTypeNode(149 /* UnknownKeyword */); } if (type.flags & 4 /* String */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(143 /* StringKeyword */); + return ts.createKeywordTypeNode(144 /* StringKeyword */); } if (type.flags & 8 /* Number */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(140 /* NumberKeyword */); + return ts.createKeywordTypeNode(141 /* NumberKeyword */); } if (type.flags & 64 /* BigInt */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(151 /* BigIntKeyword */); + return ts.createKeywordTypeNode(152 /* BigIntKeyword */); } if (type.flags & 16 /* Boolean */) { context.approximateLength += 7; - return ts.createKeywordTypeNode(128 /* BooleanKeyword */); + return ts.createKeywordTypeNode(129 /* BooleanKeyword */); } if (type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */)) { var parentSymbol = getParentOfSymbol(type.symbol); @@ -38195,7 +38334,7 @@ var ts; } } context.approximateLength += 13; - return ts.createTypeOperatorNode(147 /* UniqueKeyword */, ts.createKeywordTypeNode(144 /* SymbolKeyword */)); + return ts.createTypeOperatorNode(148 /* UniqueKeyword */, ts.createKeywordTypeNode(145 /* SymbolKeyword */)); } if (type.flags & 16384 /* Void */) { context.approximateLength += 4; @@ -38203,7 +38342,7 @@ var ts; } if (type.flags & 32768 /* Undefined */) { context.approximateLength += 9; - return ts.createKeywordTypeNode(146 /* UndefinedKeyword */); + return ts.createKeywordTypeNode(147 /* UndefinedKeyword */); } if (type.flags & 65536 /* Null */) { context.approximateLength += 4; @@ -38211,15 +38350,15 @@ var ts; } if (type.flags & 131072 /* Never */) { context.approximateLength += 5; - return ts.createKeywordTypeNode(137 /* NeverKeyword */); + return ts.createKeywordTypeNode(138 /* NeverKeyword */); } if (type.flags & 4096 /* ESSymbol */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(144 /* SymbolKeyword */); + return ts.createKeywordTypeNode(145 /* SymbolKeyword */); } if (type.flags & 67108864 /* NonPrimitive */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(141 /* ObjectKeyword */); + return ts.createKeywordTypeNode(142 /* ObjectKeyword */); } if (isThisTypeParameter(type)) { if (context.flags & 4194304 /* InObjectTypeLiteral */) { @@ -38268,7 +38407,7 @@ var ts; } var typeNodes = mapToTypeNodes(types, context, /*isBareList*/ true); if (typeNodes && typeNodes.length > 0) { - var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 178 /* UnionType */ : 179 /* IntersectionType */, typeNodes); + var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 179 /* UnionType */ : 180 /* IntersectionType */, typeNodes); return unionOrIntersectionTypeNode; } else { @@ -38295,6 +38434,11 @@ var ts; context.approximateLength += 2; return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); } + if (type.flags & 134217728 /* Awaited */) { + var awaitedTypeNode = typeToTypeNodeHelper(type.awaitedType, context); + context.approximateLength += 9; + return ts.createTypeOperatorNode(128 /* AwaitedKeyword */, awaitedTypeNode); + } if (type.flags & 16777216 /* Conditional */) { var checkTypeNode = typeToTypeNodeHelper(type.checkType, context); var saveInferTypeParameters = context.inferTypeParameters; @@ -38307,7 +38451,7 @@ var ts; return ts.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode); } if (type.flags & 33554432 /* Substitution */) { - return typeToTypeNodeHelper(type.typeVariable, context); + return typeToTypeNodeHelper(type.baseType, context); } return ts.Debug.fail("Should be unreachable."); function createMappedTypeNodeFromType(type) { @@ -38339,7 +38483,7 @@ var ts; return symbolToTypeNode(symbol, context, isInstanceType); } // Always use 'typeof T' for type of class, enum, and module objects - else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 214 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || + else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 215 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { return symbolToTypeNode(symbol, context, 111551 /* Value */); @@ -38369,7 +38513,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 290 /* SourceFile */ || declaration.parent.kind === 250 /* ModuleBlock */; + return declaration.parent.kind === 291 /* SourceFile */ || declaration.parent.kind === 251 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -38420,12 +38564,12 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 170 /* FunctionType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 171 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 171 /* ConstructorType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 172 /* ConstructorType */, context); return signatureNode; } } @@ -38446,7 +38590,7 @@ var ts; } var elementType = typeToTypeNodeHelper(typeArguments[0], context); var arrayType = ts.createArrayTypeNode(elementType); - return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, arrayType); + return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, arrayType); } else if (type.target.objectFlags & 8 /* Tuple */) { if (typeArguments.length > 0) { @@ -38460,12 +38604,12 @@ var ts; ts.createOptionalTypeNode(tupleConstituentNodes[i]); } var tupleTypeNode = ts.createTupleTypeNode(tupleConstituentNodes); - return type.target.readonly ? ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } } if (context.encounteredError || (context.flags & 524288 /* AllowEmptyTuple */)) { var tupleTypeNode = ts.createTupleTypeNode([]); - return type.target.readonly ? ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } context.encounteredError = true; return undefined; // TODO: GH#18217 @@ -38560,11 +38704,11 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 165 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 166 /* CallSignature */, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 166 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 167 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { var indexSignature = void 0; @@ -38641,7 +38785,7 @@ var ts; var signatures = getSignaturesOfType(filterType(propertyType, function (t) { return !(t.flags & 32768 /* Undefined */); }), 0 /* Call */); for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) { var signature = signatures_1[_i]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 160 /* MethodSignature */, context); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 161 /* MethodSignature */, context); methodDeclaration.name = propertyName; methodDeclaration.questionToken = optionalToken; typeElements.push(preserveCommentsOn(methodDeclaration)); @@ -38658,7 +38802,7 @@ var ts; propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(125 /* AnyKeyword */); } context.flags = savedFlags; - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(138 /* ReadonlyKeyword */)] : undefined; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(139 /* ReadonlyKeyword */)] : undefined; if (modifiers) { context.approximateLength += 9; } @@ -38667,8 +38811,8 @@ var ts; typeElements.push(preserveCommentsOn(propertySignature)); } function preserveCommentsOn(node) { - if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 323 /* JSDocPropertyTag */; })) { - var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 323 /* JSDocPropertyTag */; }); + if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 324 /* JSDocPropertyTag */; })) { + var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 324 /* JSDocPropertyTag */; }); var commentText = d.comment; if (commentText) { ts.setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); @@ -38719,7 +38863,7 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 143 /* StringKeyword */ : 140 /* NumberKeyword */); + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 144 /* StringKeyword */ : 141 /* NumberKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -38732,7 +38876,7 @@ var ts; } context.approximateLength += (name.length + 4); return ts.createIndexSignature( - /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(138 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(139 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context) { var suppressAny = context.flags & 256 /* SuppressAnyReturnType */; @@ -38746,7 +38890,7 @@ var ts; else { typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); } - var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 162 /* Constructor */); }); + var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 163 /* Constructor */); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); @@ -38790,9 +38934,9 @@ var ts; return typeParameterToDeclarationWithConstraint(type, context, constraintNode); } function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 156 /* Parameter */); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 157 /* Parameter */); if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) { - parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 317 /* JSDocParameterTag */); + parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 318 /* JSDocParameterTag */); } var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { @@ -38804,7 +38948,7 @@ var ts; var dotDotDotToken = isRest ? ts.createToken(25 /* DotDotDotToken */) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 75 /* Identifier */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : - parameterDeclaration.name.kind === 153 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : + parameterDeclaration.name.kind === 154 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : ts.symbolName(parameterSymbol) : ts.symbolName(parameterSymbol); @@ -38823,7 +38967,7 @@ var ts; } var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags); var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited); - if (clone.kind === 191 /* BindingElement */) { + if (clone.kind === 192 /* BindingElement */) { clone.initializer = undefined; } return ts.setEmitFlags(clone, 1 /* SingleLine */ | 16777216 /* NoAsciiEscaping */); @@ -38943,10 +39087,10 @@ var ts; var typeParameterNodes; if (context.flags & 512 /* WriteTypeParametersInQualifiedName */ && index < (chain.length - 1)) { var parentSymbol = symbol; - var nextSymbol = chain[index + 1]; - if (ts.getCheckFlags(nextSymbol) & 1 /* Instantiated */) { + var nextSymbol_1 = chain[index + 1]; + if (ts.getCheckFlags(nextSymbol_1) & 1 /* Instantiated */) { var params = getTypeParametersOfClassOrInterface(parentSymbol.flags & 2097152 /* Alias */ ? resolveAlias(parentSymbol) : parentSymbol); - typeParameterNodes = mapToTypeNodes(ts.map(params, nextSymbol.mapper), context); + typeParameterNodes = mapToTypeNodes(ts.map(params, function (t) { return getMappedType(t, nextSymbol_1.mapper); }), context); } else { typeParameterNodes = typeParametersToTypeParameterDeclarations(symbol, context); @@ -38964,7 +39108,7 @@ var ts; return top; } function getSpecifierForModuleSymbol(symbol, context) { - var file = ts.getDeclarationOfKind(symbol, 290 /* SourceFile */); + var file = ts.getDeclarationOfKind(symbol, 291 /* SourceFile */); if (file && file.moduleName !== undefined) { // Use the amd name if it is available return file.moduleName; @@ -39270,8 +39414,8 @@ var ts; return initial; } function symbolTableToDeclarationStatements(symbolTable, context, bundled) { - var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 161 /* MethodDeclaration */, /*useAcessors*/ true); - var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 160 /* MethodSignature */, /*useAcessors*/ false); + var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 162 /* MethodDeclaration */, /*useAcessors*/ true); + var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 161 /* MethodSignature */, /*useAcessors*/ false); // TODO: Use `setOriginalNode` on original declaration names where possible so these declarations see some kind of // declaration mapping // We save the enclosing declaration off here so it's not adjusted by well-meaning declaration @@ -39610,8 +39754,8 @@ var ts; var baseTypes = getBaseTypes(interfaceType); var baseType = ts.length(baseTypes) ? getIntersectionType(baseTypes) : undefined; var members = ts.flatMap(getPropertiesOfType(interfaceType), function (p) { return serializePropertySymbolForInterface(p, baseType); }); - var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 165 /* CallSignature */); - var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 166 /* ConstructSignature */); + var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 166 /* CallSignature */); + var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 167 /* ConstructSignature */); var indexSignatures = serializeIndexSignatures(interfaceType, baseType); var heritageClauses = !ts.length(baseTypes) ? undefined : [ts.createHeritageClause(90 /* ExtendsKeyword */, ts.mapDefined(baseTypes, function (b) { return trySerializeAsTypeReference(b); }))]; addResult(ts.createInterfaceDeclaration( @@ -39726,7 +39870,7 @@ var ts; for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { var sig = signatures_2[_i]; // Each overload becomes a separate function declaration, in order - var decl = signatureToSignatureDeclarationHelper(sig, 244 /* FunctionDeclaration */, context); + var decl = signatureToSignatureDeclarationHelper(sig, 245 /* FunctionDeclaration */, context); decl.name = ts.createIdentifier(localName); addResult(ts.setTextRange(decl, sig.declaration), modifierFlags); } @@ -39819,7 +39963,7 @@ var ts; var staticMembers = symbol.flags & (16 /* Function */ | 512 /* ValueModule */) ? [] : ts.flatMap(ts.filter(getPropertiesOfType(staticType), function (p) { return !(p.flags & 4194304 /* Prototype */) && p.escapedName !== "prototype"; }), function (p) { return serializePropertySymbolForClass(p, /*isStatic*/ true, staticBaseType); }); - var constructors = serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 162 /* Constructor */); + var constructors = serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 163 /* Constructor */); for (var _i = 0, constructors_1 = constructors; _i < constructors_1.length; _i++) { var c = constructors_1[_i]; // A constructor's return type and type parameters are supposed to be controlled by the enclosing class declaration @@ -39851,7 +39995,7 @@ var ts; var targetName = getInternalSymbolName(target, verbatimTargetName); includePrivateSymbol(target); // the target may be within the same scope - attempt to serialize it first switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // Could be a local `import localName = ns.member` or // an external `import localName = require("whatever")` var isLocalImport = !(target.flags & 512 /* ValueModule */); @@ -39861,13 +40005,13 @@ var ts; ? symbolToName(target, context, 67108863 /* All */, /*expectsIdentifier*/ false) : ts.createExternalModuleReference(ts.createLiteral(getSpecifierForModuleSymbol(symbol, context)))), isLocalImport ? modifierFlags : 0 /* None */); break; - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: // export as namespace foo // TODO: Not part of a file's local or export symbol tables // Is bound into file.symbol.globalExports instead, which we don't currently traverse addResult(ts.createNamespaceExportDeclaration(ts.idText(node.name)), 0 /* None */); break; - case 255 /* ImportClause */: + case 256 /* ImportClause */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(ts.createIdentifier(localName), /*namedBindings*/ undefined), @@ -39876,24 +40020,24 @@ var ts; // In such cases, the `target` refers to the module itself already ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*importClause*/ undefined, ts.createNamespaceImport(ts.createIdentifier(localName))), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: addResult(ts.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createNamespaceExport(ts.createIdentifier(localName)), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*importClause*/ undefined, ts.createNamedImports([ ts.createImportSpecifier(localName !== verbatimTargetName ? ts.createIdentifier(verbatimTargetName) : undefined, ts.createIdentifier(localName)) ])), ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: // does not use localName because the symbol name in this case refers to the name in the exports table, // which we must exactly preserve var specifier = node.parent.parent.moduleSpecifier; @@ -39901,11 +40045,11 @@ var ts; // another file serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), specifier ? verbatimTargetName : targetName, specifier && ts.isStringLiteralLike(specifier) ? ts.createLiteral(specifier.text) : undefined); break; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: serializeMaybeAliasAssignment(symbol); break; - case 209 /* BinaryExpression */: - case 194 /* PropertyAccessExpression */: + case 210 /* BinaryExpression */: + case 195 /* PropertyAccessExpression */: // Could be best encoded as though an export specifier or as though an export assignment // If name is default or export=, do an export assignment // Otherwise do an export specifier @@ -40125,17 +40269,18 @@ var ts; context.flags = oldFlags; return result; function visitExistingNodeTreeSymbols(node) { - if (ts.isJSDocAllType(node)) { + // We don't _actually_ support jsdoc namepath types, emit `any` instead + if (ts.isJSDocAllType(node) || node.kind === 303 /* JSDocNamepathType */) { return ts.createKeywordTypeNode(125 /* AnyKeyword */); } if (ts.isJSDocUnknownType(node)) { - return ts.createKeywordTypeNode(148 /* UnknownKeyword */); + return ts.createKeywordTypeNode(149 /* UnknownKeyword */); } if (ts.isJSDocNullableType(node)) { return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(100 /* NullKeyword */)]); } if (ts.isJSDocOptionalType(node)) { - return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(146 /* UndefinedKeyword */)]); + return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(147 /* UndefinedKeyword */)]); } if (ts.isJSDocNonNullableType(node)) { return ts.visitNode(node.type, visitExistingNodeTreeSymbols); @@ -40404,8 +40549,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { - var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 182 /* ParenthesizedType */; }); - if (node.kind === 247 /* TypeAliasDeclaration */) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 183 /* ParenthesizedType */; }); + if (node.kind === 248 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -40413,11 +40558,11 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 250 /* ModuleBlock */ && + node.parent.kind === 251 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 290 /* SourceFile */ || ts.isAmbientModule(location); + return location.kind === 291 /* SourceFile */ || ts.isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { var nameType = getSymbolLinks(symbol).nameType; @@ -40476,17 +40621,17 @@ var ts; if (!declaration) { declaration = symbol.declarations[0]; // Declaration may be nameless, but we'll try anyway } - if (declaration.parent && declaration.parent.kind === 242 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 243 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 214 /* ClassExpression */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 215 /* ClassExpression */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } - return declaration.kind === 214 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 215 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; } } var name = getNameOfSymbolFromNameType(symbol, context); @@ -40503,28 +40648,28 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: - case 316 /* JSDocEnumTag */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: + case 317 /* JSDocEnumTag */: // Top-level jsdoc type aliases are considered exported // First parent is comment node, second is hosting declaration or token; we only care about those tokens or declarations whose parent is a source file return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent)); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // falls through - case 249 /* ModuleDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 244 /* FunctionDeclaration */: - case 248 /* EnumDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 250 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 245 /* FunctionDeclaration */: + case 249 /* EnumDeclaration */: + case 254 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; @@ -40532,54 +40677,54 @@ var ts; var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 253 /* ImportEqualsDeclaration */ && parent.kind !== 290 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { + !(node.kind !== 254 /* ImportEqualsDeclaration */ && parent.kind !== 291 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent); - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.hasModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 162 /* Constructor */: - case 166 /* ConstructSignature */: - case 165 /* CallSignature */: - case 167 /* IndexSignature */: - case 156 /* Parameter */: - case 250 /* ModuleBlock */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 173 /* TypeLiteral */: - case 169 /* TypeReference */: - case 174 /* ArrayType */: - case 175 /* TupleType */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 182 /* ParenthesizedType */: + case 163 /* Constructor */: + case 167 /* ConstructSignature */: + case 166 /* CallSignature */: + case 168 /* IndexSignature */: + case 157 /* Parameter */: + case 251 /* ModuleBlock */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 174 /* TypeLiteral */: + case 170 /* TypeReference */: + case 175 /* ArrayType */: + case 176 /* TupleType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 183 /* ParenthesizedType */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 255 /* ImportClause */: - case 256 /* NamespaceImport */: - case 258 /* ImportSpecifier */: + case 256 /* ImportClause */: + case 257 /* NamespaceImport */: + case 259 /* ImportSpecifier */: return false; // Type parameters are always visible - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: // Source file and namespace export are always visible // falls through - case 290 /* SourceFile */: - case 252 /* NamespaceExportDeclaration */: + case 291 /* SourceFile */: + case 253 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return false; default: return false; @@ -40588,10 +40733,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 259 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 260 /* ExportAssignment */) { exportSymbol = resolveName(node, node.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); } - else if (node.parent.kind === 263 /* ExportSpecifier */) { + else if (node.parent.kind === 264 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } var result; @@ -40694,12 +40839,12 @@ var ts; function getDeclarationContainer(node) { return ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 242 /* VariableDeclaration */: - case 243 /* VariableDeclarationList */: - case 258 /* ImportSpecifier */: - case 257 /* NamedImports */: - case 256 /* NamespaceImport */: - case 255 /* ImportClause */: + case 243 /* VariableDeclaration */: + case 244 /* VariableDeclarationList */: + case 259 /* ImportSpecifier */: + case 258 /* NamedImports */: + case 257 /* NamespaceImport */: + case 256 /* ImportClause */: return false; default: return true; @@ -40732,7 +40877,7 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false); } function isComputedNonLiteralName(name) { - return name.kind === 154 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); + return name.kind === 155 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); } function getRestType(source, properties, symbol) { source = filterType(source, function (t) { return !(t.flags & 98304 /* Nullable */); }); @@ -40786,7 +40931,7 @@ var ts; if (parentAccess && parentAccess.flowNode) { var propName = getDestructuringPropertyName(node); if (propName) { - var result = ts.createNode(195 /* ElementAccessExpression */, node.pos, node.end); + var result = ts.createNode(196 /* ElementAccessExpression */, node.pos, node.end); result.parent = node; result.expression = parentAccess; var literal = ts.createNode(10 /* StringLiteral */, node.pos, node.end); @@ -40801,23 +40946,23 @@ var ts; function getParentElementAccess(node) { var ancestor = node.parent.parent; switch (ancestor.kind) { - case 191 /* BindingElement */: - case 281 /* PropertyAssignment */: + case 192 /* BindingElement */: + case 282 /* PropertyAssignment */: return getSyntheticElementAccess(ancestor); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return getSyntheticElementAccess(node.parent); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ancestor.initializer; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return ancestor.right; } } function getDestructuringPropertyName(node) { var parent = node.parent; - if (node.kind === 191 /* BindingElement */ && parent.kind === 189 /* ObjectBindingPattern */) { + if (node.kind === 192 /* BindingElement */ && parent.kind === 190 /* ObjectBindingPattern */) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 281 /* PropertyAssignment */ || node.kind === 282 /* ShorthandPropertyAssignment */) { + if (node.kind === 282 /* PropertyAssignment */ || node.kind === 283 /* ShorthandPropertyAssignment */) { return getLiteralPropertyNameText(node.name); } return "" + parent.elements.indexOf(node); @@ -40838,8 +40983,12 @@ var ts; if (strictNullChecks && declaration.flags & 8388608 /* Ambient */ && ts.isParameterDeclaration(declaration)) { parentType = getNonNullableType(parentType); } + // Filter `undefined` from the type we check against if the parent has an initializer (which handles the `undefined` case implicitly) + else if (strictNullChecks && pattern.parent.initializer) { + parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */); + } var type; - if (pattern.kind === 189 /* ObjectBindingPattern */) { + if (pattern.kind === 190 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { parentType = getReducedType(parentType); if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) { @@ -40912,7 +41061,7 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 192 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 193 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } @@ -40922,11 +41071,11 @@ var ts; function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 231 /* ForInStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForInStatement */) { var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression))); return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType; } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 233 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -40945,7 +41094,7 @@ var ts; return addOptionality(declaredType, isOptional); } if ((noImplicitAny || ts.isInJSFile(declaration)) && - declaration.kind === 242 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && + declaration.kind === 243 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1 /* Export */) && !(declaration.flags & 8388608 /* Ambient */)) { // If --noImplicitAny is on or the declaration is in a Javascript file, // use control flow tracked 'any' type for non-ambient, non-exported var or let variables with no @@ -40959,11 +41108,11 @@ var ts; return autoArrayType; } } - if (declaration.kind === 156 /* Parameter */) { + if (declaration.kind === 157 /* Parameter */) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 164 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 163 /* GetAccessor */); + if (func.kind === 165 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 164 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -41178,9 +41327,9 @@ var ts; var thisContainer = ts.getThisContainer(expression, /*includeArrowFunctions*/ false); // Properties defined in a constructor (or base constructor, or javascript constructor function) don't get undefined added. // Function expressions that are assigned to the prototype count as methods. - return thisContainer.kind === 162 /* Constructor */ || - thisContainer.kind === 244 /* FunctionDeclaration */ || - (thisContainer.kind === 201 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); + return thisContainer.kind === 163 /* Constructor */ || + thisContainer.kind === 245 /* FunctionDeclaration */ || + (thisContainer.kind === 202 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { ts.Debug.assert(types.length === declarations.length); @@ -41264,7 +41413,7 @@ var ts; function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) { var elements = pattern.elements; var lastElement = ts.lastOrUndefined(elements); - var hasRestElement = !!(lastElement && lastElement.kind === 191 /* BindingElement */ && lastElement.dotDotDotToken); + var hasRestElement = !!(lastElement && lastElement.kind === 192 /* BindingElement */ && lastElement.dotDotDotToken); if (elements.length === 0 || elements.length === 1 && hasRestElement) { return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType; } @@ -41288,7 +41437,7 @@ var ts; function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { if (includePatternInType === void 0) { includePatternInType = false; } if (reportErrors === void 0) { reportErrors = false; } - return pattern.kind === 189 /* ObjectBindingPattern */ + return pattern.kind === 190 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -41327,7 +41476,7 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 156 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 157 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(declaration) { @@ -41385,7 +41534,7 @@ var ts; return reportCircularityError(symbol); } var type; - if (declaration.kind === 259 /* ExportAssignment */) { + if (declaration.kind === 260 /* ExportAssignment */) { type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration); } else if (ts.isBinaryExpression(declaration) || @@ -41456,7 +41605,7 @@ var ts; } function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { - if (accessor.kind === 163 /* GetAccessor */) { + if (accessor.kind === 164 /* GetAccessor */) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; } @@ -41490,15 +41639,15 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 163 /* GetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 164 /* GetAccessor */); error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } return type; } function resolveTypeOfAccessors(symbol) { - var getter = ts.getDeclarationOfKind(symbol, 163 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 164 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 164 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 165 /* SetAccessor */); if (getter && ts.isInJSFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -41566,9 +41715,9 @@ var ts; if (symbol.flags & 1536 /* Module */ && ts.isShorthandAmbientModuleSymbol(symbol)) { return anyType; } - else if (declaration.kind === 209 /* BinaryExpression */ || + else if (declaration.kind === 210 /* BinaryExpression */ || ts.isAccessExpression(declaration) && - declaration.parent.kind === 209 /* BinaryExpression */) { + declaration.parent.kind === 210 /* BinaryExpression */) { return getWidenedTypeForAssignmentDeclaration(symbol); } else if (symbol.flags & 512 /* ValueModule */ && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) { @@ -41635,7 +41784,7 @@ var ts; return errorType; } // Check if variable has initializer that circularly references the variable itself - if (noImplicitAny && (declaration.kind !== 156 /* Parameter */ || declaration.initializer)) { + if (noImplicitAny && (declaration.kind !== 157 /* Parameter */ || declaration.initializer)) { error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); } // Circularities could also result from parameters in function expressions that end up @@ -41734,36 +41883,36 @@ var ts; return undefined; } switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 160 /* MethodSignature */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 300 /* JSDocFunctionType */: - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 247 /* TypeAliasDeclaration */: - case 321 /* JSDocTemplateTag */: - case 322 /* JSDocTypedefTag */: - case 316 /* JSDocEnumTag */: - case 315 /* JSDocCallbackTag */: - case 186 /* MappedType */: - case 180 /* ConditionalType */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 161 /* MethodSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 301 /* JSDocFunctionType */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 248 /* TypeAliasDeclaration */: + case 322 /* JSDocTemplateTag */: + case 323 /* JSDocTypedefTag */: + case 317 /* JSDocEnumTag */: + case 316 /* JSDocCallbackTag */: + case 187 /* MappedType */: + case 181 /* ConditionalType */: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 186 /* MappedType */) { + if (node.kind === 187 /* MappedType */) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } - else if (node.kind === 180 /* ConditionalType */) { + else if (node.kind === 181 /* ConditionalType */) { return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node)); var thisType = includeThisTypes && - (node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */ || node.kind === 246 /* InterfaceDeclaration */ || isJSConstructor(node)) && + (node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */ || node.kind === 247 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } @@ -41771,7 +41920,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 246 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 247 /* InterfaceDeclaration */); ts.Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); } @@ -41781,9 +41930,9 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 246 /* InterfaceDeclaration */ || - node.kind === 245 /* ClassDeclaration */ || - node.kind === 214 /* ClassExpression */ || + if (node.kind === 247 /* InterfaceDeclaration */ || + node.kind === 246 /* ClassDeclaration */ || + node.kind === 215 /* ClassExpression */ || isJSConstructor(node) || ts.isTypeAlias(node)) { var declaration = node; @@ -42001,7 +42150,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 246 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 247 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getReducedType(getTypeFromTypeNode(node)); @@ -42037,7 +42186,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 246 /* InterfaceDeclaration */) { + if (declaration.kind === 247 /* InterfaceDeclaration */) { if (declaration.flags & 128 /* ContainsThis */) { return false; } @@ -42125,7 +42274,7 @@ var ts; if (ts.isStringLiteralLike(expr)) { return true; } - else if (expr.kind === 209 /* BinaryExpression */) { + else if (expr.kind === 210 /* BinaryExpression */) { return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right); } return false; @@ -42140,12 +42289,12 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return true; - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; case 75 /* Identifier */: return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return isStringConcatExpression(expr); default: return false; @@ -42159,7 +42308,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 248 /* EnumDeclaration */) { + if (declaration.kind === 249 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && ts.isStringLiteralLike(member.initializer)) { @@ -42186,7 +42335,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 248 /* EnumDeclaration */) { + if (declaration.kind === 249 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var value = getEnumMemberValue(member); @@ -42259,22 +42408,22 @@ var ts; function isThislessType(node) { switch (node.kind) { case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: - case 141 /* ObjectKeyword */: + case 149 /* UnknownKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: + case 142 /* ObjectKeyword */: case 110 /* VoidKeyword */: - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: case 100 /* NullKeyword */: - case 137 /* NeverKeyword */: - case 187 /* LiteralType */: + case 138 /* NeverKeyword */: + case 188 /* LiteralType */: return true; - case 174 /* ArrayType */: + case 175 /* ArrayType */: return isThislessType(node.elementType); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -42300,7 +42449,7 @@ var ts; function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - return (node.kind === 162 /* Constructor */ || (!!returnType && isThislessType(returnType))) && + return (node.kind === 163 /* Constructor */ || (!!returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } @@ -42316,14 +42465,14 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -42614,7 +42763,6 @@ var ts; var stringIndexInfo; var numberIndexInfo; if (ts.rangeEquals(typeParameters, typeArguments, 0, typeParameters.length)) { - mapper = identityMapper; members = source.symbol ? getMembersOfSymbol(source.symbol) : ts.createSymbolTable(source.declaredProperties); callSignatures = source.declaredCallSignatures; constructSignatures = source.declaredConstructSignatures; @@ -43118,8 +43266,7 @@ var ts; var checkType = type.checkType; var constraint = getLowerBoundOfKeyType(checkType); if (constraint !== checkType) { - var mapper = makeUnaryTypeMapper(type.root.checkType, constraint); - return getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); + return getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper)); } } return type; @@ -43168,7 +43315,7 @@ var ts; // Create a mapper from T to the current iteration type constituent. Then, if the // mapped type is itself an instantiated type, combine the iteration mapper with the // instantiation mapper. - var templateMapper = combineTypeMappers(type.mapper, createTypeMapper([typeParameter], [t])); + var templateMapper = appendTypeMapping(type.mapper, typeParameter, t); // If the current iteration type constituent is a string literal type, create a property. // Otherwise, for type string create a string index signature. if (isTypeUsableAsPropertyName(t)) { @@ -43218,6 +43365,7 @@ var ts; type = errorType; } symbol.type = type; + symbol.mapper = undefined; } return symbol.type; } @@ -43232,7 +43380,7 @@ var ts; function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? - instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), type.mapper || identityMapper) : + instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), type.mapper) : errorType); } function getConstraintDeclarationForMappedType(type) { @@ -43240,8 +43388,8 @@ var ts; } function isMappedTypeWithKeyofConstraintDeclaration(type) { var constraintDeclaration = getConstraintDeclarationForMappedType(type); // TODO: GH#18217 - return constraintDeclaration.kind === 184 /* TypeOperator */ && - constraintDeclaration.operator === 134 /* KeyOfKeyword */; + return constraintDeclaration.kind === 185 /* TypeOperator */ && + constraintDeclaration.operator === 135 /* KeyOfKeyword */; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { @@ -43249,7 +43397,7 @@ var ts; // If the constraint declaration is a 'keyof T' node, the modifiers type is T. We check // AST nodes here because, when T is a non-generic type, the logic below eagerly resolves // 'keyof T' to a literal union type and we can't recover T from that type. - type.modifiersType = instantiateType(getTypeFromTypeNode(getConstraintDeclarationForMappedType(type).type), type.mapper || identityMapper); + type.modifiersType = instantiateType(getTypeFromTypeNode(getConstraintDeclarationForMappedType(type).type), type.mapper); } else { // Otherwise, get the declared constraint type, and if the constraint type is a type parameter, @@ -43258,7 +43406,7 @@ var ts; var declaredType = getTypeFromMappedTypeNode(type.declaration); var constraint = getConstraintTypeFromMappedType(declaredType); var extendedConstraint = constraint && constraint.flags & 262144 /* TypeParameter */ ? getConstraintOfTypeParameter(constraint) : constraint; - type.modifiersType = extendedConstraint && extendedConstraint.flags & 4194304 /* Index */ ? instantiateType(extendedConstraint.type, type.mapper || identityMapper) : unknownType; + type.modifiersType = extendedConstraint && extendedConstraint.flags & 4194304 /* Index */ ? instantiateType(extendedConstraint.type, type.mapper) : unknownType; } } return type.modifiersType; @@ -43345,8 +43493,8 @@ var ts; } } // The properties of a union type are those that are present in all constituent types, so - // we only need to check the properties of the first type - if (type.flags & 1048576 /* Union */) { + // we only need to check the properties of the first type without index signature + if (type.flags & 1048576 /* Union */ && !getIndexInfoOfType(current, 0 /* String */) && !getIndexInfoOfType(current, 1 /* Number */)) { break; } } @@ -43447,8 +43595,7 @@ var ts; var simplified = getSimplifiedType(type.checkType, /*writing*/ false); var constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified; if (constraint && constraint !== type.checkType) { - var mapper = makeUnaryTypeMapper(type.root.checkType, constraint); - var instantiated = getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); + var instantiated = getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper)); if (!(instantiated.flags & 131072 /* Never */)) { return instantiated; } @@ -43467,7 +43614,7 @@ var ts; var hasDisjointDomainType = false; for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { var t = types_4[_i]; - if (t.flags & 63176704 /* Instantiable */) { + if (t.flags & 197394432 /* Instantiable */) { // We keep following constraints as long as we have an instantiable type that is known // not to be circular or infinite (hence we stop on index access types). var constraint = getConstraintOfType(t); @@ -43503,7 +43650,7 @@ var ts; return undefined; } function getBaseConstraintOfType(type) { - if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { + if (type.flags & (193200128 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { var constraint = getResolvedBaseConstraint(type); return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined; } @@ -43605,6 +43752,10 @@ var ts; constraintDepth--; return result; } + if (t.flags & 134217728 /* Awaited */) { + var basePromiseType = getBaseConstraint(t.awaitedType); + return basePromiseType ? getAwaitedType(basePromiseType) : undefined; + } if (t.flags & 33554432 /* Substitution */) { return getBaseConstraint(t.substitute); } @@ -43665,8 +43816,7 @@ var ts; if (typeVariable) { var constraint = getConstraintOfTypeParameter(typeVariable); if (constraint && (isArrayType(constraint) || isTupleType(constraint))) { - var mapper = makeUnaryTypeMapper(typeVariable, constraint); - return instantiateType(type, combineTypeMappers(mapper, type.mapper)); + return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper)); } } return type; @@ -43677,7 +43827,7 @@ var ts; * type itself. */ function getApparentType(type) { - var t = type.flags & 63176704 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; + var t = type.flags & 197394432 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; return ts.getObjectFlags(t) & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) : t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : t.flags & 132 /* StringLike */ ? globalStringType : @@ -43938,7 +44088,7 @@ var ts; ts.append(propTypes, getIndexTypeOfType(type, 1 /* Number */)); } if (propTypes.length) { - return getUnionType(propTypes, 2 /* Subtype */); + return getUnionType(propTypes); } } return undefined; @@ -43965,10 +44115,10 @@ var ts; function isJSDocOptionalParameter(node) { return ts.isInJSFile(node) && ( // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType - node.type && node.type.kind === 299 /* JSDocOptionalType */ + node.type && node.type.kind === 300 /* JSDocOptionalType */ || ts.getJSDocParameterTags(node).some(function (_a) { var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 299 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 300 /* JSDocOptionalType */; })); } function tryFindAmbientModule(moduleName, withAugmentations) { @@ -43987,7 +44137,7 @@ var ts; var signature = getSignatureFromDeclaration(node.parent); var parameterIndex = node.parent.parameters.indexOf(node); ts.Debug.assert(parameterIndex >= 0); - return parameterIndex >= getMinArgumentCount(signature); + return parameterIndex >= getMinArgumentCount(signature, /*strongArityForUntypedJS*/ true); } var iife = ts.getImmediatelyInvokedFunctionExpression(node.parent); if (iife) { @@ -44002,7 +44152,7 @@ var ts; return false; } var isBracketed = node.isBracketed, typeExpression = node.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 299 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 300 /* JSDocOptionalType */; } function createTypePredicate(kind, parameterName, parameterIndex, type) { return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; @@ -44062,6 +44212,9 @@ var ts; ts.isValueSignatureDeclaration(declaration) && !ts.hasJSDocParameterTags(declaration) && !ts.getJSDocType(declaration); + if (isUntypedSignatureInJSFile) { + flags |= 16 /* IsUntypedSignatureInJSFile */; + } // If this is a JSDoc construct signature, then skip the first parameter in the // parameter list. The first parameter represents the return type of the construct // signature. @@ -44081,30 +44234,29 @@ var ts; else { parameters.push(paramSymbol); } - if (type && type.kind === 187 /* LiteralType */) { + if (type && type.kind === 188 /* LiteralType */) { flags |= 2 /* HasLiteralTypes */; } // Record a new minimum argument count if this is not an optional parameter var isOptionalParameter_1 = isOptionalJSDocParameterTag(param) || param.initializer || param.questionToken || param.dotDotDotToken || iife && parameters.length > iife.arguments.length && !type || - isUntypedSignatureInJSFile || isJSDocOptionalParameter(param); if (!isOptionalParameter_1) { minArgumentCount = parameters.length; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 163 /* GetAccessor */ || declaration.kind === 164 /* SetAccessor */) && + if ((declaration.kind === 164 /* GetAccessor */ || declaration.kind === 165 /* SetAccessor */) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; + var otherKind = declaration.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 162 /* Constructor */ ? + var classType = declaration.kind === 163 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); @@ -44166,11 +44318,11 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - return node.name.kind === 154 /* ComputedPropertyName */ + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + return node.name.kind === 155 /* ComputedPropertyName */ && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse); @@ -44242,7 +44394,7 @@ var ts; function createTypePredicateFromTypePredicateNode(node, signature) { var parameterName = node.parameterName; var type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 183 /* ThisType */ ? + return parameterName.kind === 184 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, /*parameterName*/ undefined, /*parameterIndex*/ undefined, type) : createTypePredicate(node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */, parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type); } @@ -44285,7 +44437,7 @@ var ts; return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 162 /* Constructor */) { + if (declaration.kind === 163 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } if (ts.isJSDocConstructSignature(declaration)) { @@ -44295,12 +44447,12 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 163 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { + if (declaration.kind === 164 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 164 /* SetAccessor */); + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 165 /* SetAccessor */); var setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -44390,7 +44542,7 @@ var ts; // will result in a different declaration kind. if (!signature.isolatedSignatureType) { var kind = signature.declaration ? signature.declaration.kind : 0 /* Unknown */; - var isConstructor = kind === 162 /* Constructor */ || kind === 166 /* ConstructSignature */ || kind === 171 /* ConstructorType */; + var isConstructor = kind === 163 /* Constructor */ || kind === 167 /* ConstructSignature */ || kind === 172 /* ConstructorType */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -44404,7 +44556,7 @@ var ts; return symbol.members.get("__index" /* Index */); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 140 /* NumberKeyword */ : 143 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 141 /* NumberKeyword */ : 144 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -44438,13 +44590,13 @@ var ts; if (typeParameter.symbol) { for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.parent.kind === 181 /* InferType */) { + if (declaration.parent.kind === 182 /* InferType */) { // When an 'infer T' declaration is immediately contained in a type reference node // (such as 'Foo'), T's constraint is inferred from the constraint of the // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are // present, we form an intersection of the inferred constraint types. var grandParent = declaration.parent.parent; - if (grandParent.kind === 169 /* TypeReference */) { + if (grandParent.kind === 170 /* TypeReference */) { var typeReference = grandParent; var typeParameters = getTypeParametersForTypeReference(typeReference); if (typeParameters) { @@ -44469,7 +44621,7 @@ var ts; } // When an 'infer T' declaration is immediately contained in a rest parameter // declaration, we infer an 'unknown[]' constraint. - else if (grandParent.kind === 156 /* Parameter */ && grandParent.dotDotDotToken) { + else if (grandParent.kind === 157 /* Parameter */ && grandParent.dotDotDotToken) { inferences = ts.append(inferences, createArrayType(unknownType)); } } @@ -44486,14 +44638,24 @@ var ts; } else { var constraintDeclaration = getConstraintDeclaration(typeParameter); - typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : - getInferredTypeParameterConstraint(typeParameter) || noConstraintType; + if (!constraintDeclaration) { + typeParameter.constraint = getInferredTypeParameterConstraint(typeParameter) || noConstraintType; + } + else { + var type = getTypeFromTypeNode(constraintDeclaration); + if (type.flags & 1 /* Any */ && type !== errorType) { // Allow errorType to propegate to keep downstream errors suppressed + // use keyofConstraintType as the base constraint for mapped type key constraints (unknown isn;t assignable to that, but `any` was), + // use unknown otherwise + type = constraintDeclaration.parent.parent.kind === 187 /* MappedType */ ? keyofConstraintType : unknownType; + } + typeParameter.constraint = type; + } } } return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - var tp = ts.getDeclarationOfKind(typeParameter.symbol, 155 /* TypeParameter */); + var tp = ts.getDeclarationOfKind(typeParameter.symbol, 156 /* TypeParameter */); var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent; return host && getSymbolOfNode(host); } @@ -44573,8 +44735,8 @@ var ts; } var node = type.node; var typeArguments = !node ? ts.emptyArray : - node.kind === 169 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : - node.kind === 174 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : + node.kind === 170 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : + node.kind === 175 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments; @@ -44618,7 +44780,7 @@ var ts; return errorType; } } - if (node.kind === 169 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { + if (node.kind === 170 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { return createDeferredTypeReference(type, node, /*mapper*/ undefined); } // In a type reference, the outer type parameters of the referenced class or interface are automatically @@ -44663,9 +44825,9 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return node.typeName; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -44696,9 +44858,7 @@ var ts; // Get type from reference to named type that cannot be generic (enum or type parameter) var res = tryGetDeclaredTypeOfSymbol(symbol); if (res) { - return checkNoTypeArguments(node, symbol) ? - res.flags & 262144 /* TypeParameter */ ? getConstrainedTypeVariable(res, node) : getRegularTypeOfLiteralType(res) : - errorType; + return checkNoTypeArguments(node, symbol) ? getRegularTypeOfLiteralType(res) : errorType; } if (symbol.flags & 111551 /* Value */ && isJSDocTypeReference(node)) { var jsdocType = getTypeFromJSDocValueReference(node, symbol); @@ -44734,7 +44894,7 @@ var ts; } isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, /*requireStringLiteralLikeArgument*/ true) && !!valueType.symbol; } - var isImportTypeWithQualifier = node.kind === 188 /* ImportType */ && node.qualifier; + var isImportTypeWithQualifier = node.kind === 189 /* ImportType */ && node.qualifier; // valueType might not have a symbol, eg, {import('./b').STRING_LITERAL} if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier)) { typeType = getTypeReferenceType(node, valueType.symbol); @@ -44744,45 +44904,45 @@ var ts; } return links.resolvedJSDocType; } - function getSubstitutionType(typeVariable, substitute) { - if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === typeVariable) { - return typeVariable; + function getSubstitutionType(baseType, substitute) { + if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === baseType) { + return baseType; } - var id = getTypeId(typeVariable) + ">" + getTypeId(substitute); + var id = getTypeId(baseType) + ">" + getTypeId(substitute); var cached = substitutionTypes.get(id); if (cached) { return cached; } var result = createType(33554432 /* Substitution */); - result.typeVariable = typeVariable; + result.baseType = baseType; result.substitute = substitute; substitutionTypes.set(id, result); return result; } function isUnaryTupleTypeNode(node) { - return node.kind === 175 /* TupleType */ && node.elementTypes.length === 1; + return node.kind === 176 /* TupleType */ && node.elementTypes.length === 1; } - function getImpliedConstraint(typeVariable, checkNode, extendsNode) { - return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(typeVariable, checkNode.elementTypes[0], extendsNode.elementTypes[0]) : - getActualTypeVariable(getTypeFromTypeNode(checkNode)) === typeVariable ? getTypeFromTypeNode(extendsNode) : + function getImpliedConstraint(type, checkNode, extendsNode) { + return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elementTypes[0], extendsNode.elementTypes[0]) : + getActualTypeVariable(getTypeFromTypeNode(checkNode)) === type ? getTypeFromTypeNode(extendsNode) : undefined; } - function getConstrainedTypeVariable(typeVariable, node) { + function getConditionalFlowTypeOfType(type, node) { var constraints; - while (node && !ts.isStatement(node) && node.kind !== 303 /* JSDocComment */) { + while (node && !ts.isStatement(node) && node.kind !== 304 /* JSDocComment */) { var parent = node.parent; - if (parent.kind === 180 /* ConditionalType */ && node === parent.trueType) { - var constraint = getImpliedConstraint(typeVariable, parent.checkType, parent.extendsType); + if (parent.kind === 181 /* ConditionalType */ && node === parent.trueType) { + var constraint = getImpliedConstraint(type, parent.checkType, parent.extendsType); if (constraint) { constraints = ts.append(constraints, constraint); } } node = parent; } - return constraints ? getSubstitutionType(typeVariable, getIntersectionType(ts.append(constraints, typeVariable))) : typeVariable; + return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type; } function isJSDocTypeReference(node) { - return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 169 /* TypeReference */ || node.kind === 188 /* ImportType */); + return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 170 /* TypeReference */ || node.kind === 189 /* ImportType */); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { @@ -44895,9 +45055,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: return declaration; } } @@ -45018,19 +45178,19 @@ var ts; } function getArrayOrTupleTargetType(node) { var readonly = isReadonlyTypeOperator(node.parent); - if (node.kind === 174 /* ArrayType */ || node.elementTypes.length === 1 && node.elementTypes[0].kind === 177 /* RestType */) { + if (node.kind === 175 /* ArrayType */ || node.elementTypes.length === 1 && node.elementTypes[0].kind === 178 /* RestType */) { return readonly ? globalReadonlyArrayType : globalArrayType; } var lastElement = ts.lastOrUndefined(node.elementTypes); - var restElement = lastElement && lastElement.kind === 177 /* RestType */ ? lastElement : undefined; - var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 176 /* OptionalType */ && n !== restElement; }) + 1; + var restElement = lastElement && lastElement.kind === 178 /* RestType */ ? lastElement : undefined; + var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 177 /* OptionalType */ && n !== restElement; }) + 1; return getTupleTypeOfArity(node.elementTypes.length, minLength, !!restElement, readonly, /*associatedNames*/ undefined); } // Return true if the given type reference node is directly aliased or if it needs to be deferred // because it is possibly contained in a circular chain of eagerly resolved types. function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { - return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 174 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : - node.kind === 175 /* TupleType */ ? ts.some(node.elementTypes, mayResolveTypeAlias) : + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 175 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : + node.kind === 176 /* TupleType */ ? ts.some(node.elementTypes, mayResolveTypeAlias) : hasDefaultTypeArguments || ts.some(node.typeArguments, mayResolveTypeAlias)); } // Return true when the given node is transitively contained in type constructs that eagerly @@ -45039,15 +45199,15 @@ var ts; function isResolvedByTypeAlias(node) { var parent = node.parent; switch (parent.kind) { - case 182 /* ParenthesizedType */: - case 169 /* TypeReference */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 185 /* IndexedAccessType */: - case 180 /* ConditionalType */: - case 184 /* TypeOperator */: + case 183 /* ParenthesizedType */: + case 170 /* TypeReference */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 186 /* IndexedAccessType */: + case 181 /* ConditionalType */: + case 185 /* TypeOperator */: return isResolvedByTypeAlias(parent); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return true; } return false; @@ -45056,27 +45216,27 @@ var ts; // of a type alias. function mayResolveTypeAlias(node) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node.typeName, 788968 /* Type */).flags & 524288 /* TypeAlias */); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return true; - case 184 /* TypeOperator */: - return node.operator !== 147 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); - case 182 /* ParenthesizedType */: - case 176 /* OptionalType */: - case 299 /* JSDocOptionalType */: - case 297 /* JSDocNullableType */: - case 298 /* JSDocNonNullableType */: - case 294 /* JSDocTypeExpression */: + case 185 /* TypeOperator */: + return node.operator !== 148 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); + case 183 /* ParenthesizedType */: + case 177 /* OptionalType */: + case 300 /* JSDocOptionalType */: + case 298 /* JSDocNullableType */: + case 299 /* JSDocNonNullableType */: + case 295 /* JSDocTypeExpression */: return mayResolveTypeAlias(node.type); - case 177 /* RestType */: - return node.type.kind !== 174 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); - case 178 /* UnionType */: - case 179 /* IntersectionType */: + case 178 /* RestType */: + return node.type.kind !== 175 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); + case 179 /* UnionType */: + case 180 /* IntersectionType */: return ts.some(node.types, mayResolveTypeAlias); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); } @@ -45090,18 +45250,18 @@ var ts; links.resolvedType = emptyObjectType; } else if (isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 175 /* TupleType */ && node.elementTypes.length === 0 ? target : + links.resolvedType = node.kind === 176 /* TupleType */ && node.elementTypes.length === 0 ? target : createDeferredTypeReference(target, node, /*mapper*/ undefined); } else { - var elementTypes = node.kind === 174 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); + var elementTypes = node.kind === 175 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); links.resolvedType = createTypeReference(target, elementTypes); } } return links.resolvedType; } function isReadonlyTypeOperator(node) { - return ts.isTypeOperatorNode(node) && node.operator === 138 /* ReadonlyKeyword */; + return ts.isTypeOperatorNode(node) && node.operator === 139 /* ReadonlyKeyword */; } // We represent tuple types as type references to synthesized generic interface types created by // this function. The types are of the form: @@ -45206,7 +45366,7 @@ var ts; // We ignore 'never' types in unions if (!(flags & 131072 /* Never */)) { includes |= flags & 71041023 /* IncludesMask */; - if (flags & 66846720 /* StructuredOrInstantiable */) + if (flags & 201064448 /* StructuredOrInstantiable */) includes |= 262144 /* IncludesStructuredOrInstantiable */; if (type === wildcardType) includes |= 8388608 /* IncludesWildcard */; @@ -45338,7 +45498,7 @@ var ts; neverType; } } - var objectFlags = (includes & 66994211 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | + var objectFlags = (includes & 201211939 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 268435456 /* ContainsIntersections */ : 0); return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments); } @@ -45692,7 +45852,7 @@ var ts; type = getReducedType(type); return type.flags & 1048576 /* Union */ ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : - maybeTypeOfKind(type, 58982400 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) : + maybeTypeOfKind(type, 193200128 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) : ts.getObjectFlags(type) & 32 /* Mapped */ ? filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); }) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : @@ -45714,20 +45874,24 @@ var ts; return indexType.flags & 131072 /* Never */ ? stringType : indexType; } function getTypeFromTypeOperatorNode(node) { + var _a; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 134 /* KeyOfKeyword */: + case 135 /* KeyOfKeyword */: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 147 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 144 /* SymbolKeyword */ + case 148 /* UniqueKeyword */: + links.resolvedType = node.type.kind === 145 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : errorType; break; - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: links.resolvedType = getTypeFromTypeNode(node.type); break; + case 128 /* AwaitedKeyword */: + links.resolvedType = (_a = getAwaitedType(getTypeFromTypeNode(node.type))) !== null && _a !== void 0 ? _a : unknownType; + break; default: throw ts.Debug.assertNever(node.operator); } @@ -45762,13 +45926,13 @@ var ts; if (type.flags & 2097152 /* Intersection */) { return ts.some(type.types, isJSLiteralType); } - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { return isJSLiteralType(getResolvedBaseConstraint(type)); } return false; } function getPropertyNameFromIndex(indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode : undefined; return isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? @@ -45779,7 +45943,7 @@ var ts; undefined; } function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags) { - var accessExpression = accessNode && accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode : undefined; var propName = accessNode && ts.isPrivateIdentifier(accessNode) ? undefined : getPropertyNameFromIndex(indexType, accessNode); if (propName !== undefined) { var prop = getPropertyOfType(objectType, propName); @@ -45916,9 +46080,9 @@ var ts; } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode.argumentExpression : - accessNode.kind === 185 /* IndexedAccessType */ ? accessNode.indexType : - accessNode.kind === 154 /* ComputedPropertyName */ ? accessNode.expression : + return accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode.argumentExpression : + accessNode.kind === 186 /* IndexedAccessType */ ? accessNode.indexType : + accessNode.kind === 155 /* ComputedPropertyName */ ? accessNode.expression : accessNode; } function isGenericObjectType(type) { @@ -45929,7 +46093,7 @@ var ts; } return !!(type.objectFlags & 8388608 /* IsGenericObjectType */); } - return !!(type.flags & 58982400 /* InstantiableNonPrimitive */) || isGenericMappedType(type); + return !!(type.flags & 193200128 /* InstantiableNonPrimitive */) || isGenericMappedType(type); } function isGenericIndexType(type) { if (type.flags & 3145728 /* UnionOrIntersection */) { @@ -45939,7 +46103,7 @@ var ts; } return !!(type.objectFlags & 33554432 /* IsGenericIndexType */); } - return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); + return !!(type.flags & (193200128 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); } function isThisTypeParameter(type) { return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType); @@ -45992,7 +46156,7 @@ var ts; return type[cache] = distributedOverIndex; } // Only do the inner distributions if the index can no longer be instantiated to cause index distribution again - if (!(indexType.flags & 63176704 /* Instantiable */)) { + if (!(indexType.flags & 197394432 /* Instantiable */)) { // (T | U)[K] -> T[K] | U[K] (reading) // (T | U)[K] -> T[K] & U[K] (writing) // (T & U)[K] -> T[K] & U[K] @@ -46064,7 +46228,7 @@ var ts; // object type. Note that for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in // an expression. This is to preserve backwards compatibility. For example, an element access 'this["foo"]' // has always been resolved eagerly using the constraint type of 'this' at the given location. - if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 185 /* IndexedAccessType */) && isGenericObjectType(objectType)) { + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 186 /* IndexedAccessType */) && isGenericObjectType(objectType)) { if (objectType.flags & 3 /* AnyOrUnknown */) { return objectType; } @@ -46114,7 +46278,7 @@ var ts; links.resolvedType = resolved.flags & 8388608 /* IndexedAccess */ && resolved.objectType === objectType && resolved.indexType === indexType ? - getConstrainedTypeVariable(resolved, node) : resolved; + getConditionalFlowTypeOfType(resolved, node) : resolved; } return links.resolvedType; } @@ -46134,7 +46298,7 @@ var ts; } function getActualTypeVariable(type) { if (type.flags & 33554432 /* Substitution */) { - return type.typeVariable; + return type.baseType; } if (type.flags & 8388608 /* IndexedAccess */ && (type.objectType.flags & 33554432 /* Substitution */ || type.indexType.flags & 33554432 /* Substitution */)) { @@ -46162,7 +46326,7 @@ var ts; // types rules (i.e. proper contravariance) for inferences. inferTypes(context.inferences, checkType, extendsType, 128 /* NoConstraints */ | 256 /* AlwaysStrict */); } - combinedMapper = combineTypeMappers(mapper, context.mapper); + combinedMapper = mergeTypeMappers(mapper, context.mapper); } // Instantiate the extends type including inferences for 'infer T' type parameters var inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType; @@ -46353,7 +46517,7 @@ var ts; } function getAliasSymbolForTypeNode(node) { var host = node.parent; - while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 138 /* ReadonlyKeyword */) { + while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 139 /* ReadonlyKeyword */) { host = host.parent; } return ts.isTypeAlias(host) ? getSymbolOfNode(host) : undefined; @@ -46415,7 +46579,7 @@ var ts; * this function should be called in a left folding style, with left = previous result of getSpreadType * and right = the new element to be spread. */ - function getSpreadType(left, right, symbol, objectFlags, readonly, isParentTypeNullable) { + function getSpreadType(left, right, symbol, objectFlags, readonly) { if (left.flags & 1 /* Any */ || right.flags & 1 /* Any */) { return anyType; } @@ -46431,16 +46595,16 @@ var ts; if (left.flags & 1048576 /* Union */) { var merged = tryMergeUnionOfObjectTypeAndEmptyObject(left, readonly); if (merged) { - return getSpreadType(merged, right, symbol, objectFlags, readonly, isParentTypeNullable); + return getSpreadType(merged, right, symbol, objectFlags, readonly); } - return mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly, isParentTypeNullable); }); + return mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly); }); } if (right.flags & 1048576 /* Union */) { var merged = tryMergeUnionOfObjectTypeAndEmptyObject(right, readonly); if (merged) { - return getSpreadType(left, merged, symbol, objectFlags, readonly, maybeTypeOfKind(right, 98304 /* Nullable */)); + return getSpreadType(left, merged, symbol, objectFlags, readonly); } - return mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly, maybeTypeOfKind(right, 98304 /* Nullable */)); }); + return mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly); }); } if (right.flags & (528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 132 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)) { return left; @@ -46502,14 +46666,6 @@ var ts; result.nameType = getSymbolLinks(leftProp).nameType; members.set(leftProp.escapedName, result); } - else if (strictNullChecks && - !isParentTypeNullable && - symbol && - !isFromSpreadAssignment(leftProp, symbol) && - isFromSpreadAssignment(rightProp, symbol) && - !maybeTypeOfKind(rightType, 98304 /* Nullable */)) { - error(leftProp.valueDeclaration, ts.Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, ts.unescapeLeadingUnderscores(leftProp.escapedName)); - } } else { members.set(leftProp.escapedName, getSpreadSymbol(leftProp, readonly)); @@ -46608,7 +46764,7 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 246 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 247 /* InterfaceDeclaration */)) { if (!ts.hasModifier(container, 32 /* Static */) && (!ts.isConstructorDeclaration(container) || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -46639,90 +46795,93 @@ var ts; return links.resolvedType; } function getTypeFromTypeNode(node) { + return getConditionalFlowTypeOfType(getTypeFromTypeNodeWorker(node), node); + } + function getTypeFromTypeNodeWorker(node) { switch (node.kind) { case 125 /* AnyKeyword */: - case 295 /* JSDocAllType */: - case 296 /* JSDocUnknownType */: + case 296 /* JSDocAllType */: + case 297 /* JSDocUnknownType */: return anyType; - case 148 /* UnknownKeyword */: + case 149 /* UnknownKeyword */: return unknownType; - case 143 /* StringKeyword */: + case 144 /* StringKeyword */: return stringType; - case 140 /* NumberKeyword */: + case 141 /* NumberKeyword */: return numberType; - case 151 /* BigIntKeyword */: + case 152 /* BigIntKeyword */: return bigintType; - case 128 /* BooleanKeyword */: + case 129 /* BooleanKeyword */: return booleanType; - case 144 /* SymbolKeyword */: + case 145 /* SymbolKeyword */: return esSymbolType; case 110 /* VoidKeyword */: return voidType; - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: return undefinedType; case 100 /* NullKeyword */: return nullType; - case 137 /* NeverKeyword */: + case 138 /* NeverKeyword */: return neverType; - case 141 /* ObjectKeyword */: + case 142 /* ObjectKeyword */: return node.flags & 131072 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType; - case 183 /* ThisType */: + case 184 /* ThisType */: case 104 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 187 /* LiteralType */: + case 188 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return getTypeFromTypeReference(node); - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return node.assertsModifier ? voidType : booleanType; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 174 /* ArrayType */: - case 175 /* TupleType */: + case 175 /* ArrayType */: + case 176 /* TupleType */: return getTypeFromArrayOrTupleTypeNode(node); - case 176 /* OptionalType */: + case 177 /* OptionalType */: return getTypeFromOptionalTypeNode(node); - case 178 /* UnionType */: + case 179 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 179 /* IntersectionType */: + case 180 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 297 /* JSDocNullableType */: + case 298 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 299 /* JSDocOptionalType */: + case 300 /* JSDocOptionalType */: return addOptionality(getTypeFromTypeNode(node.type)); - case 182 /* ParenthesizedType */: - case 298 /* JSDocNonNullableType */: - case 294 /* JSDocTypeExpression */: + case 183 /* ParenthesizedType */: + case 299 /* JSDocNonNullableType */: + case 295 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 177 /* RestType */: + case 178 /* RestType */: return getElementTypeOfArrayType(getTypeFromTypeNode(node.type)) || errorType; - case 301 /* JSDocVariadicType */: + case 302 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 173 /* TypeLiteral */: - case 304 /* JSDocTypeLiteral */: - case 300 /* JSDocFunctionType */: - case 305 /* JSDocSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 174 /* TypeLiteral */: + case 305 /* JSDocTypeLiteral */: + case 301 /* JSDocFunctionType */: + case 306 /* JSDocSignature */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 184 /* TypeOperator */: + case 185 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 186 /* MappedType */: + case 187 /* MappedType */: return getTypeFromMappedTypeNode(node); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return getTypeFromConditionalTypeNode(node); - case 181 /* InferType */: + case 182 /* InferType */: return getTypeFromInferTypeNode(node); - case 188 /* ImportType */: + case 189 /* ImportType */: return getTypeFromImportTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode case 75 /* Identifier */: - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: var symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -46752,27 +46911,41 @@ var ts; function instantiateSignatures(signatures, mapper) { return instantiateList(signatures, mapper, instantiateSignature); } - function makeUnaryTypeMapper(source, target) { - return function (t) { return t === source ? target : t; }; + function createTypeMapper(sources, targets) { + return sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : makeArrayTypeMapper(sources, targets); } - function makeBinaryTypeMapper(source1, target1, source2, target2) { - return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; }; + function getMappedType(type, mapper) { + switch (mapper.kind) { + case 0 /* Simple */: + return type === mapper.source ? mapper.target : type; + case 1 /* Array */: + var sources = mapper.sources; + var targets = mapper.targets; + for (var i = 0; i < sources.length; i++) { + if (type === sources[i]) { + return targets ? targets[i] : anyType; + } + } + return type; + case 2 /* Function */: + return mapper.func(type); + case 3 /* Composite */: + case 4 /* Merged */: + var t1 = getMappedType(type, mapper.mapper1); + return t1 !== type && mapper.kind === 3 /* Composite */ ? instantiateType(t1, mapper.mapper2) : getMappedType(t1, mapper.mapper2); + } + } + function makeUnaryTypeMapper(source, target) { + return { kind: 0 /* Simple */, source: source, target: target }; } function makeArrayTypeMapper(sources, targets) { - return function (t) { - for (var i = 0; i < sources.length; i++) { - if (t === sources[i]) { - return targets ? targets[i] : anyType; - } - } - return t; - }; + return { kind: 1 /* Array */, sources: sources, targets: targets }; } - function createTypeMapper(sources, targets) { - ts.Debug.assert(targets === undefined || sources.length === targets.length); - return sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : - sources.length === 2 ? makeBinaryTypeMapper(sources[0], targets ? targets[0] : anyType, sources[1], targets ? targets[1] : anyType) : - makeArrayTypeMapper(sources, targets); + function makeFunctionTypeMapper(func) { + return { kind: 2 /* Function */, func: func }; + } + function makeCompositeTypeMapper(kind, mapper1, mapper2) { + return { kind: kind, mapper1: mapper1, mapper2: mapper2 }; } function createTypeEraser(sources) { return createTypeMapper(sources, /*targets*/ undefined); @@ -46782,29 +46955,25 @@ var ts; * This is used during inference when instantiating type parameter defaults. */ function createBackreferenceMapper(context, index) { - return function (t) { return ts.findIndex(context.inferences, function (info) { return info.typeParameter === t; }) >= index ? unknownType : t; }; + return makeFunctionTypeMapper(function (t) { return ts.findIndex(context.inferences, function (info) { return info.typeParameter === t; }) >= index ? unknownType : t; }); } function combineTypeMappers(mapper1, mapper2) { - if (!mapper1) - return mapper2; - if (!mapper2) - return mapper1; - return function (t) { return instantiateType(mapper1(t), mapper2); }; + return mapper1 ? makeCompositeTypeMapper(3 /* Composite */, mapper1, mapper2) : mapper2; } - function createReplacementMapper(source, target, baseMapper) { - return function (t) { return t === source ? target : baseMapper(t); }; + function mergeTypeMappers(mapper1, mapper2) { + return mapper1 ? makeCompositeTypeMapper(4 /* Merged */, mapper1, mapper2) : mapper2; } - function permissiveMapper(type) { - return type.flags & 262144 /* TypeParameter */ ? wildcardType : type; + function prependTypeMapping(source, target, mapper) { + return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(4 /* Merged */, makeUnaryTypeMapper(source, target), mapper); + } + function appendTypeMapping(mapper, source, target) { + return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(4 /* Merged */, mapper, makeUnaryTypeMapper(source, target)); } function getRestrictiveTypeParameter(tp) { return tp.constraint === unknownType ? tp : tp.restrictiveInstantiation || (tp.restrictiveInstantiation = createTypeParameter(tp.symbol), tp.restrictiveInstantiation.constraint = unknownType, tp.restrictiveInstantiation); } - function restrictiveMapper(type) { - return type.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(type) : type; - } function cloneTypeParameter(typeParameter) { var result = createTypeParameter(typeParameter.symbol); result.target = typeParameter; @@ -46838,7 +47007,7 @@ var ts; } function instantiateSymbol(symbol, mapper) { var links = getSymbolLinks(symbol); - if (links.type && !maybeTypeOfKind(links.type, 524288 /* Object */ | 63176704 /* Instantiable */)) { + if (links.type && !couldContainTypeVariables(links.type)) { // If the type of the symbol is already resolved, and if that type could not possibly // be affected by instantiation, simply return the symbol itself. return symbol; @@ -46904,7 +47073,8 @@ var ts; // We are instantiating an anonymous type that has one or more type parameters in scope. Apply the // mapper to the type parameters to produce the effective list of type arguments, and compute the // instantiation cache key from the type IDs of the type arguments. - var typeArguments = ts.map(typeParameters, combineTypeMappers(type.mapper, mapper)); + var combinedMapper_1 = combineTypeMappers(type.mapper, mapper); + var typeArguments = ts.map(typeParameters, function (t) { return getMappedType(t, combinedMapper_1); }); var id = getTypeListId(typeArguments); var result = links.instantiations.get(id); if (!result) { @@ -46919,9 +47089,9 @@ var ts; return type; } function maybeTypeParameterReference(node) { - return !(node.kind === 153 /* QualifiedName */ || - node.parent.kind === 169 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || - node.parent.kind === 188 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); + return !(node.kind === 154 /* QualifiedName */ || + node.parent.kind === 170 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || + node.parent.kind === 189 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); } function isTypeParameterPossiblyReferenced(tp, node) { // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks @@ -46930,7 +47100,7 @@ var ts; if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container = tp.symbol.declarations[0].parent; for (var n = node; n !== container; n = n.parent) { - if (!n || n.kind === 223 /* Block */ || n.kind === 180 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { + if (!n || n.kind === 224 /* Block */ || n.kind === 181 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { return true; } } @@ -46939,12 +47109,12 @@ var ts; return true; function containsReference(node) { switch (node.kind) { - case 183 /* ThisType */: + case 184 /* ThisType */: return !!tp.isThisType; case 75 /* Identifier */: return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) && - getTypeFromTypeNode(node) === tp; - case 172 /* TypeQuery */: + getTypeFromTypeNodeWorker(node) === tp; // use worker because we're looking for === equality + case 173 /* TypeQuery */: return true; } return !!ts.forEachChild(node, containsReference); @@ -46976,8 +47146,8 @@ var ts; var mappedTypeVariable = instantiateType(typeVariable, mapper); if (typeVariable !== mappedTypeVariable) { return mapType(getReducedType(mappedTypeVariable), function (t) { - if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { - var replacementMapper = createReplacementMapper(typeVariable, t, mapper); + if (t.flags & (3 /* AnyOrUnknown */ | 193200128 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { + var replacementMapper = prependTypeMapping(typeVariable, t, mapper); return isArrayType(t) ? instantiateMappedArrayType(t, type, replacementMapper) : isTupleType(t) ? instantiateMappedTupleType(t, type, replacementMapper) : instantiateAnonymousType(type, replacementMapper); @@ -47010,7 +47180,7 @@ var ts; createTupleType(elementTypes, newMinLength, tupleType.target.hasRestElement, newReadonly, tupleType.target.associatedNames); } function instantiateMappedTypeTemplate(type, key, isOptional, mapper) { - var templateMapper = combineTypeMappers(mapper, createTypeMapper([getTypeParameterFromMappedType(type)], [key])); + var templateMapper = appendTypeMapping(mapper, getTypeParameterFromMappedType(type), key); var propType = instantiateType(getTemplateTypeFromMappedType(type.target || type), templateMapper); var modifiers = getMappedTypeModifiers(type); return strictNullChecks && modifiers & 4 /* IncludeOptional */ && !maybeTypeOfKind(propType, 32768 /* Undefined */ | 16384 /* Void */) ? getOptionalType(propType) : @@ -47040,7 +47210,7 @@ var ts; // We are instantiating a conditional type that has one or more type parameters in scope. Apply the // mapper to the type parameters to produce the effective list of type arguments, and compute the // instantiation cache key from the type IDs of the type arguments. - var typeArguments = ts.map(root.outerTypeParameters, mapper); + var typeArguments = ts.map(root.outerTypeParameters, function (t) { return getMappedType(t, mapper); }); var id = getTypeListId(typeArguments); var result = root.instantiations.get(id); if (!result) { @@ -47058,15 +47228,15 @@ var ts; // type A | B, we produce (A extends U ? X : Y) | (B extends U ? X : Y). if (root.isDistributive) { var checkType_1 = root.checkType; - var instantiatedType = mapper(checkType_1); + var instantiatedType = getMappedType(checkType_1, mapper); if (checkType_1 !== instantiatedType && instantiatedType.flags & (1048576 /* Union */ | 131072 /* Never */)) { - return mapType(instantiatedType, function (t) { return getConditionalType(root, createReplacementMapper(checkType_1, t, mapper)); }); + return mapType(instantiatedType, function (t) { return getConditionalType(root, prependTypeMapping(checkType_1, t, mapper)); }); } } return getConditionalType(root, mapper); } function instantiateType(type, mapper) { - if (!type || !mapper || mapper === identityMapper) { + if (!type || !mapper) { return type; } if (instantiationDepth === 50 || instantiationCount >= 5000000) { @@ -47084,9 +47254,10 @@ var ts; return result; } function instantiateTypeWorker(type, mapper) { + var _a; var flags = type.flags; if (flags & 262144 /* TypeParameter */) { - return mapper(type); + return getMappedType(type, mapper); } if (flags & 524288 /* Object */) { var objectFlags = type.objectFlags; @@ -47131,8 +47302,11 @@ var ts; if (flags & 16777216 /* Conditional */) { return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper)); } + if (flags & 134217728 /* Awaited */) { + return (_a = getAwaitedType(instantiateType(type.awaitedType, mapper))) !== null && _a !== void 0 ? _a : unknownType; + } if (flags & 33554432 /* Substitution */) { - var maybeVariable = instantiateType(type.typeVariable, mapper); + var maybeVariable = instantiateType(type.baseType, mapper); if (maybeVariable.flags & 8650752 /* TypeVariable */) { return getSubstitutionType(maybeVariable, instantiateType(type.substitute, mapper)); } @@ -47172,35 +47346,35 @@ var ts; // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 244 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type return isContextSensitiveFunctionLikeDeclaration(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return ts.some(node.properties, isContextSensitive); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return ts.some(node.elements, isContextSensitive); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive); - case 273 /* JsxAttribute */: { + case 274 /* JsxAttribute */: { // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. var initializer = node.initializer; return !!initializer && isContextSensitive(initializer); } - case 276 /* JsxExpression */: { + case 277 /* JsxExpression */: { // It is possible to that node.expression is undefined (e.g
) var expression = node.expression; return !!expression && isContextSensitive(expression); @@ -47219,7 +47393,7 @@ var ts; if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 202 /* ArrowFunction */) { + if (node.kind !== 203 /* ArrowFunction */) { // If the first parameter is not an explicit 'this' parameter, then the function has // an implicit 'this' parameter which is subject to contextual typing. var parameter = ts.firstOrUndefined(node.parameters); @@ -47232,7 +47406,7 @@ var ts; } function hasContextSensitiveReturnExpression(node) { // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 223 /* Block */ && isContextSensitive(node.body); + return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 224 /* Block */ && isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && @@ -47285,7 +47459,7 @@ var ts; function isTypeDerivedFrom(source, target) { return source.flags & 1048576 /* Union */ ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) : target.flags & 1048576 /* Union */ ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) : - source.flags & 58982400 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : + source.flags & 193200128 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : target === globalObjectType ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) : target === globalFunctionType ? !!(source.flags & 524288 /* Object */) && isFunctionObjectType(source) : hasBaseType(source, getTargetType(target)); @@ -47335,23 +47509,23 @@ var ts; return true; } switch (node.kind) { - case 276 /* JsxExpression */: - case 200 /* ParenthesizedExpression */: + case 277 /* JsxExpression */: + case 201 /* ParenthesizedExpression */: return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: case 27 /* CommaToken */: return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); } return false; @@ -47542,7 +47716,7 @@ var ts; } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: // child is of the type of the expression return { errorNode: child, innerExpression: child.expression, nameType: nameType }; case 11 /* JsxText */: @@ -47551,9 +47725,9 @@ var ts; } // child is a string return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() }; - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 270 /* JsxFragment */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 271 /* JsxFragment */: // child is of type JSX.Element return { errorNode: child, innerExpression: child, nameType: nameType }; default: @@ -47704,11 +47878,11 @@ var ts; } _b = prop.kind; switch (_b) { - case 164 /* SetAccessor */: return [3 /*break*/, 2]; - case 163 /* GetAccessor */: return [3 /*break*/, 2]; - case 161 /* MethodDeclaration */: return [3 /*break*/, 2]; - case 282 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; - case 281 /* PropertyAssignment */: return [3 /*break*/, 4]; + case 165 /* SetAccessor */: return [3 /*break*/, 2]; + case 164 /* GetAccessor */: return [3 /*break*/, 2]; + case 162 /* MethodDeclaration */: return [3 /*break*/, 2]; + case 283 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; + case 282 /* PropertyAssignment */: return [3 /*break*/, 4]; } return [3 /*break*/, 6]; case 2: return [4 /*yield*/, { errorNode: prop.name, innerExpression: undefined, nameType: type }]; @@ -47785,8 +47959,8 @@ var ts; return 0 /* False */; } var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 161 /* MethodDeclaration */ && - kind !== 160 /* MethodSignature */ && kind !== 162 /* Constructor */; + var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 162 /* MethodDeclaration */ && + kind !== 161 /* MethodSignature */ && kind !== 163 /* Constructor */; var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -48047,7 +48221,7 @@ var ts; return !!(related & 1 /* Succeeded */); } } - if (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */) { + if (source.flags & 201064448 /* StructuredOrInstantiable */ || target.flags & 201064448 /* StructuredOrInstantiable */) { return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; @@ -48060,7 +48234,7 @@ var ts; var t = isFreshLiteralType(type) ? type.regularType : ts.getObjectFlags(type) & 4 /* Reference */ && type.node ? createTypeReference(type.target, getTypeArguments(type)) : type.flags & 3145728 /* UnionOrIntersection */ ? getReducedType(type) : - type.flags & 33554432 /* Substitution */ ? writing ? type.typeVariable : type.substitute : + type.flags & 33554432 /* Substitution */ ? writing ? type.baseType : type.substitute : type.flags & 25165824 /* Simplifiable */ ? getSimplifiedType(type, writing) : type; if (t === type) @@ -48280,8 +48454,15 @@ var ts; if (incompatibleStack.length) reportIncompatibleStack(); var _a = getTypeNamesForErrorDisplay(source, target), sourceType = _a[0], targetType = _a[1]; - if (target.flags & 262144 /* TypeParameter */ && target.immediateBaseConstraint !== undefined && isTypeAssignableTo(source, target.immediateBaseConstraint)) { - reportError(ts.Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2, sourceType, targetType, typeToString(target.immediateBaseConstraint)); + if (target.flags & 262144 /* TypeParameter */) { + var constraint = getBaseConstraintOfType(target); + var constraintElab = constraint && isTypeAssignableTo(source, constraint); + if (constraintElab) { + reportError(ts.Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2, sourceType, targetType, typeToString(constraint)); + } + else { + reportError(ts.Diagnostics._0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1, targetType, sourceType); + } } if (!message) { if (relation === comparableRelation) { @@ -48417,7 +48598,7 @@ var ts; if (source.flags & 1048576 /* Union */) { result = relation === comparableRelation ? someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState) : - eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */)); + eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState & 4 /* ExcessCheck */); } else { if (target.flags & 1048576 /* Union */) { @@ -48425,9 +48606,9 @@ var ts; } else if (target.flags & 2097152 /* Intersection */) { result = typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2 /* Target */); - if (result && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks)) { + if (result && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) && !(intersectionState & 4 /* ExcessCheck */)) { // Validate against excess props using the original `source` - if (!propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 0 /* None */)) { + if (!propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 4 /* ExcessCheck */)) { return 0 /* False */; } } @@ -48446,9 +48627,11 @@ var ts; // // - For a primitive type or type parameter (such as 'number = A & B') there is no point in // breaking the intersection apart. - result = someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */); + if (!isNonGenericObjectType(target) || !ts.every(source.types, function (t) { return isNonGenericObjectType(t) && !(ts.getObjectFlags(t) & 2097152 /* NonInferrableType */); })) { + result = someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */); + } } - if (!result && (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */)) { + if (!result && (source.flags & 201064448 /* StructuredOrInstantiable */ || target.flags & 201064448 /* StructuredOrInstantiable */)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) { resetErrorInfo(saveErrorInfo); } @@ -48678,12 +48861,12 @@ var ts; } return 0 /* False */; } - function eachTypeRelatedToType(source, target, reportErrors) { + function eachTypeRelatedToType(source, target, reportErrors, intersectionState) { var result = -1 /* True */; var sourceTypes = source.types; for (var _i = 0, sourceTypes_2 = sourceTypes; _i < sourceTypes_2.length; _i++) { var sourceType = sourceTypes_2[_i]; - var related = isRelatedTo(sourceType, target, reportErrors); + var related = isRelatedTo(sourceType, target, reportErrors, /*headMessage*/ undefined, intersectionState); if (!related) { return 0 /* False */; } @@ -48771,10 +48954,10 @@ var ts; // We're in the middle of variance checking - integrate any unmeasurable/unreliable flags from this cached component var saved = entry & 24 /* ReportsMask */; if (saved & 8 /* ReportsUnmeasurable */) { - instantiateType(source, reportUnmeasurableMarkers); + instantiateType(source, makeFunctionTypeMapper(reportUnmeasurableMarkers)); } if (saved & 16 /* ReportsUnreliable */) { - instantiateType(source, reportUnreliableMarkers); + instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers)); } } return entry & 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */; @@ -48813,7 +48996,8 @@ var ts; if (outofbandVarianceMarkerHandler) { originalHandler = outofbandVarianceMarkerHandler; outofbandVarianceMarkerHandler = function (onlyUnreliable) { - propagatingVarianceFlags |= onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */; + propagatingVarianceFlags |= + onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */; return originalHandler(onlyUnreliable); }; } @@ -48940,6 +49124,17 @@ var ts; } } } + else if (target.flags & 134217728 /* Awaited */ && source.flags & 134217728 /* Awaited */) { + var targetType = target.awaitedType; + var sourceType = instantiateType(source.awaitedType, makeFunctionTypeMapper(reportUnreliableMarkers)); + // An `awaited S` is related to an `awaited T` if `S` is related to `T`: + // + // S <: T ⇒ awaited S <: awaited T + // + if (result = isRelatedTo(sourceType, targetType, reportErrors)) { + return result; + } + } else if (isGenericMappedType(target)) { // A source type T is related to a target type { [P in X]: T[P] } var template = getTemplateTypeFromMappedType(target); @@ -49053,6 +49248,21 @@ var ts; } } } + else if (source.flags & 134217728 /* Awaited */) { + // An `awaited S` is related to `T` if `awaited C` is related to `T`, where `C` is the + // constraint of `S`: + // + // S <: C ^ awaited C <: T ⇒ awaited S <: T + // + // For example `awaited Promise` is assignable to `number`. + var constraint = getConstraintOfType(source.awaitedType); + var awaitedConstraint = constraint && getAwaitedType(constraint); + if (awaitedConstraint) { + if (result = isRelatedTo(awaitedConstraint, target, reportErrors)) { + return result; + } + } + } else { // An empty object type is related to any mapped type that includes a '?' modifier. if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target) && isEmptyObjectType(source)) { @@ -49212,7 +49422,7 @@ var ts; if (modifiersRelated) { var result_6; var targetConstraint = getConstraintTypeFromMappedType(target); - var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers); + var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers)); if (result_6 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) { var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); return result_6 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); @@ -49680,7 +49890,7 @@ var ts; * See signatureAssignableTo, compareSignaturesIdentical */ function signatureRelatedTo(source, target, erase, reportErrors, incompatibleReporter) { - return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0, reportErrors, reportError, incompatibleReporter, isRelatedTo, reportUnreliableMarkers); + return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0, reportErrors, reportError, incompatibleReporter, isRelatedTo, makeFunctionTypeMapper(reportUnreliableMarkers)); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -49831,10 +50041,6 @@ var ts; // make sure exactly 1 matches before returning it return match === -1 || discriminable.indexOf(/*searchElement*/ true, match + 1) !== -1 ? defaultValue : target.types[match]; } - function isFromSpreadAssignment(prop, container) { - var _a; - return ((_a = prop.valueDeclaration) === null || _a === void 0 ? void 0 : _a.parent) !== container.valueDeclaration; - } /** * A type is 'weak' if it is an object type with at least one optional property * and no required properties, call/construct signatures or index signatures @@ -49908,13 +50114,11 @@ var ts; variance = 4 /* Independent */; } outofbandVarianceMarkerHandler = oldHandler; - if (unmeasurable || unreliable) { - if (unmeasurable) { - variance |= 8 /* Unmeasurable */; - } - if (unreliable) { - variance |= 16 /* Unreliable */; - } + if (unmeasurable) { + variance |= 8 /* Unmeasurable */; + } + if (unreliable) { + variance |= 16 /* Unreliable */; } variances.push(variance); }; @@ -50687,12 +50891,12 @@ var ts; } var diagnostic; switch (declaration.kind) { - case 209 /* BinaryExpression */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 210 /* BinaryExpression */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 156 /* Parameter */: + case 157 /* Parameter */: var param = declaration; if (ts.isIdentifier(param.name) && (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && @@ -50707,23 +50911,23 @@ var ts; noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; if (!noImplicitAny) { // Don't issue a suggestion for binding elements since the codefix doesn't yet support them. return; } break; - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: if (noImplicitAny && !declaration.name) { if (wideningKind === 1 /* GeneratorYield */) { error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); @@ -50737,7 +50941,7 @@ var ts; wideningKind === 1 /* GeneratorYield */ ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 186 /* MappedType */: + case 187 /* MappedType */: if (noImplicitAny) { error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } @@ -50799,8 +51003,8 @@ var ts; signature: signature, flags: flags, compareTypes: compareTypes, - mapper: function (t) { return mapToInferredType(context, t, /*fix*/ true); }, - nonFixingMapper: function (t) { return mapToInferredType(context, t, /*fix*/ false); }, + mapper: makeFunctionTypeMapper(function (t) { return mapToInferredType(context, t, /*fix*/ true); }), + nonFixingMapper: makeFunctionTypeMapper(function (t) { return mapToInferredType(context, t, /*fix*/ false); }), }; return context; } @@ -50865,7 +51069,7 @@ var ts; if (objectFlags & 67108864 /* CouldContainTypeVariablesComputed */) { return !!(objectFlags & 134217728 /* CouldContainTypeVariables */); } - var result = !!(type.flags & 63176704 /* Instantiable */ || + var result = !!(type.flags & 197394432 /* Instantiable */ || objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 131072 /* ObjectRestType */) || @@ -51161,7 +51365,7 @@ var ts; var indexType = getSimplifiedType(target.indexType, /*writing*/ false); // Generally simplifications of instantiable indexes are avoided to keep relationship checking correct, however if our target is an access, we can consider // that key of that access to be "instantiated", since we're looking to find the infernce goal in any way we can. - if (indexType.flags & 63176704 /* Instantiable */) { + if (indexType.flags & 197394432 /* Instantiable */) { var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, /*writing*/ false), indexType, /*writing*/ false); if (simplified_1 && simplified_1 !== target) { invokeOnce(source, simplified_1, inferFromTypes); @@ -51196,6 +51400,9 @@ var ts; inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } + else if (source.flags & 134217728 /* Awaited */ && target.flags & 134217728 /* Awaited */) { + inferFromTypes(source.awaitedType, target.awaitedType); + } else if (target.flags & 16777216 /* Conditional */) { var savePriority = priority; priority |= contravariant ? 16 /* ContravariantConditional */ : 0; @@ -51203,6 +51410,10 @@ var ts; inferToMultipleTypes(source, targetTypes, target.flags); priority = savePriority; } + else if (target.flags & 134217728 /* Awaited */) { + var targetTypes = [target.awaitedType, createPromiseLikeType(target.awaitedType)]; + inferToMultipleTypes(source, targetTypes, target.flags); + } else if (target.flags & 3145728 /* UnionOrIntersection */) { inferToMultipleTypes(source, target.types, target.flags); } @@ -51216,7 +51427,7 @@ var ts; } else { source = getReducedType(source); - if (!(priority & 128 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 63176704 /* Instantiable */))) { + if (!(priority & 128 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 197394432 /* Instantiable */))) { var apparentSource = getApparentType(source); // getApparentType can return _any_ type, since an indexed access or conditional may simplify to any other type. // If that occurs and it doesn't simplify to an object or intersection, we'll need to restart `inferFromTypes` @@ -51498,6 +51709,32 @@ var ts; } // Infer from the members of source and target only if the two types are possibly related if (!typesDefinitelyUnrelated(source, target)) { + if (isArrayType(source) || isTupleType(source)) { + if (isTupleType(target)) { + var sourceLength = isTupleType(source) ? getLengthOfTupleType(source) : 0; + var targetLength = getLengthOfTupleType(target); + var sourceRestType = isTupleType(source) ? getRestTypeOfTupleType(source) : getElementTypeOfArrayType(source); + var targetRestType = getRestTypeOfTupleType(target); + var fixedLength = targetLength < sourceLength || sourceRestType ? targetLength : sourceLength; + for (var i = 0; i < fixedLength; i++) { + inferFromTypes(i < sourceLength ? getTypeArguments(source)[i] : sourceRestType, getTypeArguments(target)[i]); + } + if (targetRestType) { + var types = fixedLength < sourceLength ? getTypeArguments(source).slice(fixedLength, sourceLength) : []; + if (sourceRestType) { + types.push(sourceRestType); + } + if (types.length) { + inferFromTypes(getUnionType(types), targetRestType); + } + } + return; + } + if (isArrayType(target)) { + inferFromIndexTypes(source, target); + return; + } + } inferFromProperties(source, target); inferFromSignatures(source, target, 0 /* Call */); inferFromSignatures(source, target, 1 /* Construct */); @@ -51505,32 +51742,6 @@ var ts; } } function inferFromProperties(source, target) { - if (isArrayType(source) || isTupleType(source)) { - if (isTupleType(target)) { - var sourceLength = isTupleType(source) ? getLengthOfTupleType(source) : 0; - var targetLength = getLengthOfTupleType(target); - var sourceRestType = isTupleType(source) ? getRestTypeOfTupleType(source) : getElementTypeOfArrayType(source); - var targetRestType = getRestTypeOfTupleType(target); - var fixedLength = targetLength < sourceLength || sourceRestType ? targetLength : sourceLength; - for (var i = 0; i < fixedLength; i++) { - inferFromTypes(i < sourceLength ? getTypeArguments(source)[i] : sourceRestType, getTypeArguments(target)[i]); - } - if (targetRestType) { - var types = fixedLength < sourceLength ? getTypeArguments(source).slice(fixedLength, sourceLength) : []; - if (sourceRestType) { - types.push(sourceRestType); - } - if (types.length) { - inferFromTypes(getUnionType(types), targetRestType); - } - } - return; - } - if (isArrayType(target)) { - inferFromIndexTypes(source, target); - return; - } - } var properties = getPropertiesOfObjectType(target); for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { var targetProp = properties_3[_i]; @@ -51548,7 +51759,7 @@ var ts; var len = sourceLen < targetLen ? sourceLen : targetLen; var skipParameters = !!(ts.getObjectFlags(source) & 2097152 /* NonInferrableType */); for (var i = 0; i < len; i++) { - inferFromSignature(getBaseSignature(sourceSignatures[sourceLen - len + i]), getBaseSignature(targetSignatures[targetLen - len + i]), skipParameters); + inferFromSignature(getBaseSignature(sourceSignatures[sourceLen - len + i]), getErasedSignature(targetSignatures[targetLen - len + i]), skipParameters); } } function inferFromSignature(source, target, skipParameters) { @@ -51556,7 +51767,7 @@ var ts; var saveBivariant = bivariant; var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; // Once we descend into a bivariant signature we remain bivariant for all nested inferences - bivariant = bivariant || kind === 161 /* MethodDeclaration */ || kind === 160 /* MethodSignature */ || kind === 162 /* Constructor */; + bivariant = bivariant || kind === 162 /* MethodDeclaration */ || kind === 161 /* MethodSignature */ || kind === 163 /* Constructor */; applyToParameterTypes(source, target, inferFromContravariantTypes); bivariant = saveBivariant; } @@ -51664,7 +51875,7 @@ var ts; if (defaultType) { // Instantiate the default type. Any forward reference to a type // parameter should be instantiated to the empty object type. - inferredType = instantiateType(defaultType, combineTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper)); + inferredType = instantiateType(defaultType, mergeTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper)); } } } @@ -51726,7 +51937,7 @@ var ts; case "AsyncIterator": return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later; default: - if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; } else { @@ -51747,7 +51958,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - return !!ts.findAncestor(node, function (n) { return n.kind === 172 /* TypeQuery */ ? true : n.kind === 75 /* Identifier */ || n.kind === 153 /* QualifiedName */ ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 173 /* TypeQuery */ ? true : n.kind === 75 /* Identifier */ || n.kind === 154 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -51762,11 +51973,11 @@ var ts; return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; case 104 /* ThisKeyword */: return "0"; - case 218 /* NonNullExpression */: - case 200 /* ParenthesizedExpression */: + case 219 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: var propName = getAccessedPropertyName(node); if (propName !== undefined) { var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); @@ -51777,24 +51988,24 @@ var ts; } function isMatchingReference(source, target) { switch (target.kind) { - case 200 /* ParenthesizedExpression */: - case 218 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: + case 219 /* NonNullExpression */: return isMatchingReference(source, target.expression); } switch (source.kind) { case 75 /* Identifier */: return target.kind === 75 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 242 /* VariableDeclaration */ || target.kind === 191 /* BindingElement */) && + (target.kind === 243 /* VariableDeclaration */ || target.kind === 192 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 104 /* ThisKeyword */: return target.kind === 104 /* ThisKeyword */; case 102 /* SuperKeyword */: return target.kind === 102 /* SuperKeyword */; - case 218 /* NonNullExpression */: - case 200 /* ParenthesizedExpression */: + case 219 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: return isMatchingReference(source.expression, target); - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return ts.isAccessExpression(target) && getAccessedPropertyName(source) === getAccessedPropertyName(target) && isMatchingReference(source.expression, target.expression); @@ -51802,7 +52013,7 @@ var ts; return false; } function getAccessedPropertyName(access) { - return access.kind === 194 /* PropertyAccessExpression */ ? access.name.escapedText : + return access.kind === 195 /* PropertyAccessExpression */ ? access.name.escapedText : ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } @@ -51831,7 +52042,7 @@ var ts; if (prop.isDiscriminantProperty === undefined) { prop.isDiscriminantProperty = (prop.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && - !maybeTypeOfKind(getTypeOfSymbol(prop), 63176704 /* Instantiable */); + !maybeTypeOfKind(getTypeOfSymbol(prop), 197394432 /* Instantiable */); } return !!prop.isDiscriminantProperty; } @@ -51864,7 +52075,7 @@ var ts; } } } - if (callExpression.expression.kind === 194 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 195 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -51982,7 +52193,7 @@ var ts; if (flags & 67108864 /* NonPrimitive */) { return strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */; } - if (flags & 63176704 /* Instantiable */) { + if (flags & 197394432 /* Instantiable */) { return getTypeFacts(getBaseConstraintOfType(type) || unknownType); } if (flags & 3145728 /* UnionOrIntersection */) { @@ -52019,15 +52230,15 @@ var ts; return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 192 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 281 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 193 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 282 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 209 /* BinaryExpression */ && parent.parent.left === parent || - parent.parent.kind === 232 /* ForOfStatement */ && parent.parent.initializer === parent; + return parent.parent.kind === 210 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 233 /* ForOfStatement */ && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -52044,21 +52255,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return stringType; - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || errorType; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return undefinedType; - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return errorType; @@ -52066,7 +52277,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 189 /* ObjectBindingPattern */ ? + var type = pattern.kind === 190 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : @@ -52084,30 +52295,30 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 231 /* ForInStatement */) { + if (node.parent.parent.kind === 232 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 232 /* ForOfStatement */) { + if (node.parent.parent.kind === 233 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 242 /* VariableDeclaration */ ? + return node.kind === 243 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function isEmptyArrayAssignment(node) { - return node.kind === 242 /* VariableDeclaration */ && node.initializer && + return node.kind === 243 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 191 /* BindingElement */ && node.parent.kind === 209 /* BinaryExpression */ && + node.kind !== 192 /* BindingElement */ && node.parent.kind === 210 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: return getReferenceCandidate(node.left); @@ -52119,13 +52330,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 200 /* ParenthesizedExpression */ || - parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || - parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? + return parent.kind === 201 /* ParenthesizedExpression */ || + parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || + parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 277 /* CaseClause */) { + if (clause.kind === 278 /* CaseClause */) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -52141,20 +52352,19 @@ var ts; } return links.switchTypes; } - // Get the types from all cases in a switch on `typeof`. An - // `undefined` element denotes an explicit `default` clause. - function getSwitchClauseTypeOfWitnesses(switchStatement) { + function getSwitchClauseTypeOfWitnesses(switchStatement, retainDefault) { var witnesses = []; for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) { var clause = _a[_i]; - if (clause.kind === 277 /* CaseClause */) { + if (clause.kind === 278 /* CaseClause */) { if (ts.isStringLiteralLike(clause.expression)) { witnesses.push(clause.expression.text); continue; } return ts.emptyArray; } - witnesses.push(/*explicitDefaultStatement*/ undefined); + if (retainDefault) + witnesses.push(/*explicitDefaultStatement*/ undefined); } return witnesses; } @@ -52308,12 +52518,12 @@ var ts; var root = getReferenceRoot(node); var parent = root.parent; var isLengthPushOrUnshift = ts.isPropertyAccessExpression(parent) && (parent.name.escapedText === "length" || - parent.parent.kind === 196 /* CallExpression */ + parent.parent.kind === 197 /* CallExpression */ && ts.isIdentifier(parent.name) && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 195 /* ElementAccessExpression */ && + var isElementAssignment = parent.kind === 196 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 209 /* BinaryExpression */ && + parent.parent.kind === 210 /* BinaryExpression */ && parent.parent.operatorToken.kind === 62 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -52321,8 +52531,8 @@ var ts; return isLengthPushOrUnshift || isElementAssignment; } function isDeclarationWithExplicitTypeAnnotation(declaration) { - return !!(declaration && (declaration.kind === 242 /* VariableDeclaration */ || declaration.kind === 156 /* Parameter */ || - declaration.kind === 159 /* PropertyDeclaration */ || declaration.kind === 158 /* PropertySignature */) && + return !!(declaration && (declaration.kind === 243 /* VariableDeclaration */ || declaration.kind === 157 /* Parameter */ || + declaration.kind === 160 /* PropertyDeclaration */ || declaration.kind === 159 /* PropertySignature */) && ts.getEffectiveTypeAnnotationNode(declaration)); } function getExplicitTypeOfSymbol(symbol, diagnostic) { @@ -52352,11 +52562,11 @@ var ts; return getExplicitThisType(node); case 102 /* SuperKeyword */: return checkSuperExpression(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: var type = getTypeOfDottedName(node.expression, diagnostic); var prop = type && getPropertyOfType(type, node.name.escapedText); return prop && getExplicitTypeOfSymbol(prop, diagnostic); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return getTypeOfDottedName(node.expression, diagnostic); } } @@ -52370,7 +52580,7 @@ var ts; // circularities in control flow analysis, we use getTypeOfDottedName when resolving the call // target expression of an assertion. var funcType = void 0; - if (node.parent.kind === 226 /* ExpressionStatement */) { + if (node.parent.kind === 227 /* ExpressionStatement */) { funcType = getTypeOfDottedName(node.expression, /*diagnostic*/ undefined); } else if (node.expression.kind !== 102 /* SuperKeyword */) { @@ -52414,7 +52624,7 @@ var ts; } function isFalseExpression(expr) { var node = ts.skipParentheses(expr); - return node.kind === 91 /* FalseKeyword */ || node.kind === 209 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || + return node.kind === 91 /* FalseKeyword */ || node.kind === 210 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right)); } function isReachableFlowNodeWorker(flow, noCacheCheck) { @@ -52489,7 +52699,7 @@ var ts; if (flowAnalysisDisabled) { return errorType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 133970943 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 268188671 /* Narrowable */)) { return declaredType; } flowInvocationCount++; @@ -52501,7 +52711,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); - if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 218 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 219 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { return declaredType; } return resultType; @@ -52582,8 +52792,8 @@ var ts; // Check if we should continue with the control flow of the containing function. var container = flow.node; if (container && container !== flowContainer && - reference.kind !== 194 /* PropertyAccessExpression */ && - reference.kind !== 195 /* ElementAccessExpression */ && + reference.kind !== 195 /* PropertyAccessExpression */ && + reference.kind !== 196 /* ElementAccessExpression */ && reference.kind !== 104 /* ThisKeyword */) { flow = container.flowNode; continue; @@ -52608,7 +52818,7 @@ var ts; } function getInitialOrAssignedType(flow) { var node = flow.node; - return getConstraintForLocation(node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */ ? + return getConstraintForLocation(node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference); } @@ -52648,14 +52858,14 @@ var ts; // in which case we continue control flow analysis back to the function's declaration if (ts.isVariableDeclaration(node) && (ts.isInJSFile(node) || ts.isVarConst(node))) { var init = ts.getDeclaredExpandoInitializer(node); - if (init && (init.kind === 201 /* FunctionExpression */ || init.kind === 202 /* ArrowFunction */)) { + if (init && (init.kind === 202 /* FunctionExpression */ || init.kind === 203 /* ArrowFunction */)) { return getTypeAtFlowNode(flow.antecedent); } } return declaredType; } // for (const _ in ref) acts as a nonnull on ref - if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 231 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { + if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 232 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))); } // Assignment doesn't affect reference @@ -52666,7 +52876,7 @@ var ts; if (node.kind === 91 /* FalseKeyword */) { return unreachableNeverType; } - if (node.kind === 209 /* BinaryExpression */) { + if (node.kind === 210 /* BinaryExpression */) { if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) { return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); } @@ -52697,7 +52907,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 196 /* CallExpression */ ? + var expr = node.kind === 197 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -52705,7 +52915,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 196 /* CallExpression */) { + if (node.kind === 197 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -52755,7 +52965,7 @@ var ts; if (isMatchingReference(reference, expr)) { type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } - else if (expr.kind === 204 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { + else if (expr.kind === 205 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } else { @@ -52763,7 +52973,7 @@ var ts; if (optionalChainContainsReference(expr, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & (32768 /* Undefined */ | 131072 /* Never */)); }); } - else if (expr.kind === 204 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { + else if (expr.kind === 205 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined"); }); } } @@ -52975,12 +53185,18 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 204 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { + if (left_1.kind === 205 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 204 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { + if (right_1.kind === 205 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } + if (ts.isConstructorAccessExpression(left_1)) { + return narrowTypeByConstructor(type, left_1, operator_1, right_1, assumeTrue); + } + if (ts.isConstructorAccessExpression(right_1)) { + return narrowTypeByConstructor(type, right_1, operator_1, left_1, assumeTrue); + } if (isMatchingReference(reference, left_1)) { return narrowTypeByEquality(type, operator_1, right_1, assumeTrue); } @@ -53112,7 +53328,7 @@ var ts; if (isTypeSubtypeOf(targetType, type)) { return targetType; } - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(targetType, constraint)) { return getIntersectionType([type, targetType]); @@ -53182,7 +53398,7 @@ var ts; if (isTypeSubtypeOf(candidate, type)) { return candidate; } - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(candidate, constraint)) { return getIntersectionType([type, candidate]); @@ -53192,7 +53408,7 @@ var ts; }; } function narrowBySwitchOnTypeOf(type, switchStatement, clauseStart, clauseEnd) { - var switchWitnesses = getSwitchClauseTypeOfWitnesses(switchStatement); + var switchWitnesses = getSwitchClauseTypeOfWitnesses(switchStatement, /*retainDefault*/ true); if (!switchWitnesses.length) { return type; } @@ -53255,6 +53471,50 @@ var ts; } return getTypeWithFacts(mapType(type, narrowTypeForTypeofSwitch(impliedType)), switchFacts); } + function narrowTypeByConstructor(type, constructorAccessExpr, operator, identifier, assumeTrue) { + // Do not narrow when checking inequality. + if (assumeTrue ? (operator !== 34 /* EqualsEqualsToken */ && operator !== 36 /* EqualsEqualsEqualsToken */) : (operator !== 35 /* ExclamationEqualsToken */ && operator !== 37 /* ExclamationEqualsEqualsToken */)) { + return type; + } + // In the case of `x.y`, a `x.constructor === T` type guard resets the narrowed type of `y` to its declared type. + if (!isMatchingReference(reference, constructorAccessExpr.expression)) { + return declaredType; + } + // Get the type of the constructor identifier expression, if it is not a function then do not narrow. + var identifierType = getTypeOfExpression(identifier); + if (!isFunctionType(identifierType) && !isConstructorType(identifierType)) { + return type; + } + // Get the prototype property of the type identifier so we can find out its type. + var prototypeProperty = getPropertyOfType(identifierType, "prototype"); + if (!prototypeProperty) { + return type; + } + // Get the type of the prototype, if it is undefined, or the global `Object` or `Function` types then do not narrow. + var prototypeType = getTypeOfSymbol(prototypeProperty); + var candidate = !isTypeAny(prototypeType) ? prototypeType : undefined; + if (!candidate || candidate === globalObjectType || candidate === globalFunctionType) { + return type; + } + // If the type that is being narrowed is `any` then just return the `candidate` type since every type is a subtype of `any`. + if (isTypeAny(type)) { + return candidate; + } + // Filter out types that are not considered to be "constructed by" the `candidate` type. + return filterType(type, function (t) { return isConstructedBy(t, candidate); }); + function isConstructedBy(source, target) { + // If either the source or target type are a class type then we need to check that they are the same exact type. + // This is because you may have a class `A` that defines some set of properties, and another class `B` + // that defines the same set of properties as class `A`, in that case they are structurally the same + // type, but when you do something like `instanceOfA.constructor === B` it will return false. + if (source.flags & 524288 /* Object */ && ts.getObjectFlags(source) & 1 /* Class */ || + target.flags & 524288 /* Object */ && ts.getObjectFlags(target) & 1 /* Class */) { + return source.symbol === target.symbol; + } + // For all other types just check that the `source` type is a subtype of the `target` type. + return isTypeSubtypeOf(source, target); + } + } function narrowTypeByInstanceof(type, expr, assumeTrue) { var left = getReferenceCandidate(expr.left); if (!isMatchingReference(reference, left)) { @@ -53349,16 +53609,16 @@ var ts; case 75 /* Identifier */: case 104 /* ThisKeyword */: case 102 /* SuperKeyword */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return narrowTypeByCallExpression(type, expr, assumeTrue); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: if (expr.operator === 53 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -53403,9 +53663,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 250 /* ModuleBlock */ || - node.kind === 290 /* SourceFile */ || - node.kind === 159 /* PropertyDeclaration */; + node.kind === 251 /* ModuleBlock */ || + node.kind === 291 /* SourceFile */ || + node.kind === 160 /* PropertyDeclaration */; }); } // Check if a parameter is assigned anywhere within its declaring function. @@ -53427,7 +53687,7 @@ var ts; if (node.kind === 75 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 156 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 157 /* Parameter */) { symbol.isAssigned = true; } } @@ -53443,7 +53703,7 @@ var ts; function removeOptionalityFromDeclaredType(declaredType, declaration) { if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 156 /* Parameter */ && + declaration.kind === 157 /* Parameter */ && declaration.initializer && getFalsyFlags(declaredType) & 32768 /* Undefined */ && !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768 /* Undefined */); @@ -53457,13 +53717,13 @@ var ts; } function isConstraintPosition(node) { var parent = node.parent; - return parent.kind === 194 /* PropertyAccessExpression */ || - parent.kind === 196 /* CallExpression */ && parent.expression === node || - parent.kind === 195 /* ElementAccessExpression */ && parent.expression === node || - parent.kind === 191 /* BindingElement */ && parent.name === node && !!parent.initializer; + return parent.kind === 195 /* PropertyAccessExpression */ || + parent.kind === 197 /* CallExpression */ && parent.expression === node || + parent.kind === 196 /* ElementAccessExpression */ && parent.expression === node || + parent.kind === 192 /* BindingElement */ && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { - return type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); + return type.flags & 193200128 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); } function getConstraintForLocation(type, node) { // When a node is the left hand expression of a property access, element access, or call expression, @@ -53502,7 +53762,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 202 /* ArrowFunction */) { + if (container.kind === 203 /* ArrowFunction */) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasModifier(container, 256 /* Async */)) { @@ -53523,7 +53783,7 @@ var ts; // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration.kind === 245 /* ClassDeclaration */ + if (declaration.kind === 246 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -53535,14 +53795,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 214 /* ClassExpression */) { + else if (declaration.kind === 215 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); - while (container.kind !== 290 /* SourceFile */) { + while (container.kind !== 291 /* SourceFile */) { if (container.parent === declaration) { - if (container.kind === 159 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { + if (container.kind === 160 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 33554432 /* ConstructorReferenceInClass */; } @@ -53591,7 +53851,7 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 156 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 157 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; @@ -53600,8 +53860,8 @@ var ts; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 201 /* FunctionExpression */ || - flowContainer.kind === 202 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 202 /* FunctionExpression */ || + flowContainer.kind === 203 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } @@ -53610,9 +53870,9 @@ var ts; // declaration container are the same). var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || - isInTypeQuery(node) || node.parent.kind === 263 /* ExportSpecifier */) || - node.parent.kind === 218 /* NonNullExpression */ || - declaration.kind === 242 /* VariableDeclaration */ && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 264 /* ExportSpecifier */) || + node.parent.kind === 219 /* NonNullExpression */ || + declaration.kind === 243 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 8388608 /* Ambient */; var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : @@ -53647,7 +53907,7 @@ var ts; if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || ts.isSourceFile(symbol.valueDeclaration) || - symbol.valueDeclaration.parent.kind === 280 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 281 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -53670,7 +53930,7 @@ var ts; // mark iteration statement as containing block-scoped binding captured in some function var capturesBlockScopeBindingInLoopBody = true; if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container) { var part = getPartOfForStatementContainingNode(node.parent, container); if (part) { @@ -53691,7 +53951,7 @@ var ts; // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */; } @@ -53710,7 +53970,7 @@ var ts; function isAssignedInBodyOfForStatement(node, container) { // skip parenthesized nodes var current = node; - while (current.parent.kind === 200 /* ParenthesizedExpression */) { + while (current.parent.kind === 201 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -53718,7 +53978,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 207 /* PrefixUnaryExpression */ || current.parent.kind === 208 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 208 /* PrefixUnaryExpression */ || current.parent.kind === 209 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; } @@ -53731,7 +53991,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 159 /* PropertyDeclaration */ || container.kind === 162 /* Constructor */) { + if (container.kind === 160 /* PropertyDeclaration */ || container.kind === 163 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -53799,37 +54059,37 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var capturedByArrowFunction = false; - if (container.kind === 162 /* Constructor */) { + if (container.kind === 163 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 202 /* ArrowFunction */) { + if (container.kind === 203 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); capturedByArrowFunction = true; } switch (container.kind) { - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 162 /* Constructor */: + case 163 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: if (ts.hasModifier(container, 32 /* Static */) && !(compilerOptions.target === 99 /* ESNext */ && compilerOptions.useDefineForClassFields)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -53869,7 +54129,9 @@ var ts; var classSymbol = checkExpression(className).symbol; if (classSymbol && classSymbol.members && (classSymbol.flags & 16 /* Function */)) { var classType = getDeclaredTypeOfSymbol(classSymbol).thisType; - return getFlowTypeOfReference(node, classType); + if (classType) { + return getFlowTypeOfReference(node, classType); + } } } // Check if it's a constructor definition, can be either a variable decl or function decl @@ -53877,7 +54139,7 @@ var ts; // * /** @constructor */ function [name]() { ... } // * /** @constructor */ var x = function() { ... } else if (isInJS && - (container.kind === 201 /* FunctionExpression */ || container.kind === 244 /* FunctionDeclaration */) && + (container.kind === 202 /* FunctionExpression */ || container.kind === 245 /* FunctionDeclaration */) && ts.getJSDocClassTag(container)) { var classType = getDeclaredTypeOfSymbol(getMergedSymbol(container.symbol)).thisType; return getFlowTypeOfReference(node, classType); @@ -53924,7 +54186,7 @@ var ts; } function getClassNameFromPrototypeMethod(container) { // Check if it's the RHS of a x.prototype.y = function [name]() { .... } - if (container.kind === 201 /* FunctionExpression */ && + if (container.kind === 202 /* FunctionExpression */ && ts.isBinaryExpression(container.parent) && ts.getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = container' @@ -53934,16 +54196,16 @@ var ts; .expression; // x } // x.prototype = { method() { } } - else if (container.kind === 161 /* MethodDeclaration */ && - container.parent.kind === 193 /* ObjectLiteralExpression */ && + else if (container.kind === 162 /* MethodDeclaration */ && + container.parent.kind === 194 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { return container.parent.parent.left.expression; } // x.prototype = { method: function() { } } - else if (container.kind === 201 /* FunctionExpression */ && - container.parent.kind === 281 /* PropertyAssignment */ && - container.parent.parent.kind === 193 /* ObjectLiteralExpression */ && + else if (container.kind === 202 /* FunctionExpression */ && + container.parent.kind === 282 /* PropertyAssignment */ && + container.parent.parent.kind === 194 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { return container.parent.parent.parent.left.expression; @@ -53951,7 +54213,7 @@ var ts; // Object.defineProperty(x, "method", { value: function() { } }); // Object.defineProperty(x, "method", { set: (x: () => void) => void }); // Object.defineProperty(x, "method", { get: () => function() { }) }); - else if (container.kind === 201 /* FunctionExpression */ && + else if (container.kind === 202 /* FunctionExpression */ && ts.isPropertyAssignment(container.parent) && ts.isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && @@ -53976,7 +54238,7 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 300 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 301 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -53990,15 +54252,15 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 156 /* Parameter */ && n.parent === constructorDecl; }); + return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 157 /* Parameter */ && n.parent === constructorDecl; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 196 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 197 /* CallExpression */ && node.parent.expression === node; var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 202 /* ArrowFunction */) { + while (container && container.kind === 203 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -54011,14 +54273,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 154 /* ComputedPropertyName */; }); - if (current && current.kind === 154 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 155 /* ComputedPropertyName */; }); + if (current && current.kind === 155 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 193 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 194 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -54026,7 +54288,7 @@ var ts; } return errorType; } - if (!isCallExpression && container.kind === 162 /* Constructor */) { + if (!isCallExpression && container.kind === 163 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasModifier(container, 32 /* Static */) || isCallExpression) { @@ -54095,7 +54357,7 @@ var ts; // as a call expression cannot be used as the target of a destructuring assignment while a property access can. // // For element access expressions (`super[x]`), we emit a generic helper that forwards the element access in both situations. - if (container.kind === 161 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { + if (container.kind === 162 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -54109,7 +54371,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 193 /* ObjectLiteralExpression */) { + if (container.parent.kind === 194 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return errorType; @@ -54130,7 +54392,7 @@ var ts; if (!baseClassType) { return errorType; } - if (container.kind === 162 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 163 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return errorType; @@ -54145,7 +54407,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 162 /* Constructor */; + return container.kind === 163 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -54153,21 +54415,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 193 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 194 /* ObjectLiteralExpression */) { if (ts.hasModifier(container, 32 /* Static */)) { - return container.kind === 161 /* MethodDeclaration */ || - container.kind === 160 /* MethodSignature */ || - container.kind === 163 /* GetAccessor */ || - container.kind === 164 /* SetAccessor */; + return container.kind === 162 /* MethodDeclaration */ || + container.kind === 161 /* MethodSignature */ || + container.kind === 164 /* GetAccessor */ || + container.kind === 165 /* SetAccessor */; } else { - return container.kind === 161 /* MethodDeclaration */ || - container.kind === 160 /* MethodSignature */ || - container.kind === 163 /* GetAccessor */ || - container.kind === 164 /* SetAccessor */ || - container.kind === 159 /* PropertyDeclaration */ || - container.kind === 158 /* PropertySignature */ || - container.kind === 162 /* Constructor */; + return container.kind === 162 /* MethodDeclaration */ || + container.kind === 161 /* MethodSignature */ || + container.kind === 164 /* GetAccessor */ || + container.kind === 165 /* SetAccessor */ || + container.kind === 160 /* PropertyDeclaration */ || + container.kind === 159 /* PropertySignature */ || + container.kind === 163 /* Constructor */; } } } @@ -54175,10 +54437,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 161 /* MethodDeclaration */ || - func.kind === 163 /* GetAccessor */ || - func.kind === 164 /* SetAccessor */) && func.parent.kind === 193 /* ObjectLiteralExpression */ ? func.parent : - func.kind === 201 /* FunctionExpression */ && func.parent.kind === 281 /* PropertyAssignment */ ? func.parent.parent : + return (func.kind === 162 /* MethodDeclaration */ || + func.kind === 164 /* GetAccessor */ || + func.kind === 165 /* SetAccessor */) && func.parent.kind === 194 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 202 /* FunctionExpression */ && func.parent.kind === 282 /* PropertyAssignment */ ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -54190,7 +54452,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 202 /* ArrowFunction */) { + if (func.kind === 203 /* ArrowFunction */) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -54217,7 +54479,7 @@ var ts; if (thisType) { return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); } - if (literal.parent.kind !== 281 /* PropertyAssignment */) { + if (literal.parent.kind !== 282 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -54231,7 +54493,7 @@ var ts; // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. var parent = ts.walkUpParenthesizedExpressions(func.parent); - if (parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { + if (parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { var target = parent.left; if (ts.isAccessExpression(target)) { var expression = target.expression; @@ -54284,9 +54546,9 @@ var ts; return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 156 /* Parameter */: + case 157 /* Parameter */: return getContextuallyTypedParameterType(declaration); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return getContextualTypeForBindingElement(declaration); // By default, do nothing and return undefined - only parameters and binding elements have context implied by a parent } @@ -54295,7 +54557,7 @@ var ts; var parent = declaration.parent.parent; var name = declaration.propertyName || declaration.name; var parentType = getContextualTypeForVariableLikeDeclaration(parent) || - parent.kind !== 191 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); + parent.kind !== 192 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); if (parentType && !ts.isBindingPattern(name) && !isComputedNonLiteralName(name)) { var nameType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(nameType)) { @@ -54336,6 +54598,9 @@ var ts; if (contextualReturnType) { if (functionFlags & 2 /* Async */) { // Async function var contextualAwaitedType = getAwaitedTypeOfPromise(contextualReturnType); + if (contextualAwaitedType && contextualAwaitedType.flags & 134217728 /* Awaited */) { + contextualAwaitedType = contextualAwaitedType.awaitedType; + } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return contextualReturnType; // Regular function @@ -54347,6 +54612,9 @@ var ts; var contextualType = getContextualType(node); if (contextualType) { var contextualAwaitedType = getAwaitedType(contextualType); + if (contextualAwaitedType && contextualAwaitedType.flags & 134217728 /* Awaited */) { + contextualAwaitedType = contextualAwaitedType.awaitedType; + } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return undefined; @@ -54417,7 +54685,7 @@ var ts; return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 198 /* TaggedTemplateExpression */) { + if (template.parent.kind === 199 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -54653,21 +54921,21 @@ var ts; case 91 /* FalseKeyword */: case 100 /* NullKeyword */: case 75 /* Identifier */: - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: return true; - case 194 /* PropertyAccessExpression */: - case 200 /* ParenthesizedExpression */: + case 195 /* PropertyAccessExpression */: + case 201 /* ParenthesizedExpression */: return isPossiblyDiscriminantValue(node.expression); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return !node.expression || isPossiblyDiscriminantValue(node.expression); } return false; } function discriminateContextualTypeByObjectMembers(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 281 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 282 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } function discriminateContextualTypeByJSXAttributes(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 273 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 274 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. @@ -54692,7 +54960,7 @@ var ts; // If the given contextual type contains instantiable types and if a mapper representing // return type inferences is available, instantiate those types using that mapper. function instantiateContextualType(contextualType, node, contextFlags) { - if (contextualType && maybeTypeOfKind(contextualType, 63176704 /* Instantiable */)) { + if (contextualType && maybeTypeOfKind(contextualType, 197394432 /* Instantiable */)) { var inferenceContext = getInferenceContext(node); // If no inferences have been made, nothing is gained from instantiating as type parameters // would just be replaced with their defaults similar to the apparent type. @@ -54715,7 +54983,7 @@ var ts; // are classified as instantiable (i.e. it doesn't instantiate object types), and (b) it performs // no reductions on instantiated union types. function instantiateInstantiableTypes(type, mapper) { - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { return instantiateType(type, mapper); } if (type.flags & 1048576 /* Union */) { @@ -54753,58 +55021,58 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 191 /* BindingElement */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 192 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 202 /* ArrowFunction */: - case 235 /* ReturnStatement */: + case 203 /* ArrowFunction */: + case 236 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return getContextualTypeForAwaitOperand(parent); - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (parent.expression.kind === 96 /* ImportKeyword */) { return stringType; } /* falls through */ - case 197 /* NewExpression */: + case 198 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: return ts.isConstTypeReference(parent.type) ? undefined : getTypeFromTypeNode(parent.type); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node, contextFlags); - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent, contextFlags); - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: return getApparentTypeOfContextualType(parent.parent, contextFlags); - case 192 /* ArrayLiteralExpression */: { + case 193 /* ArrayLiteralExpression */: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); - case 221 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 211 /* TemplateExpression */); + case 222 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 212 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 200 /* ParenthesizedExpression */: { + case 201 /* ParenthesizedExpression */: { // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast. var tag = ts.isInJSFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent, contextFlags); } - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return getContextualTypeForJsxExpression(parent); - case 273 /* JsxAttribute */: - case 275 /* JsxSpreadAttribute */: + case 274 /* JsxAttribute */: + case 276 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: return getContextualJsxElementAttributesType(parent, contextFlags); } return undefined; @@ -54961,7 +55229,7 @@ var ts; return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 201 /* FunctionExpression */ || node.kind === 202 /* ArrowFunction */; + return node.kind === 202 /* FunctionExpression */ || node.kind === 203 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -54975,7 +55243,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; @@ -55020,8 +55288,8 @@ var ts; return checkIteratedTypeOrElementType(33 /* Spread */, arrayOrIterableType, undefinedType, node.expression); } function hasDefaultValue(node) { - return (node.kind === 191 /* BindingElement */ && !!node.initializer) || - (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); + return (node.kind === 192 /* BindingElement */ && !!node.initializer) || + (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); } function checkArrayLiteral(node, checkMode, forceTuple) { var elements = node.elements; @@ -55034,7 +55302,7 @@ var ts; var inConstContext = isConstContext(node); for (var i = 0; i < elementCount; i++) { var e = elements[i]; - var spread = e.kind === 213 /* SpreadElement */ && e.expression; + var spread = e.kind === 214 /* SpreadElement */ && e.expression; var spreadType = spread && checkExpression(spread, checkMode, forceTuple); if (spreadType && isTupleType(spreadType)) { elementTypes.push.apply(elementTypes, getTypeArguments(spreadType)); @@ -55120,7 +55388,7 @@ var ts; } function isNumericName(name) { switch (name.kind) { - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return isNumericComputedName(name); case 75 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -55206,11 +55474,12 @@ var ts; // Grammar checking checkGrammarObjectLiteralExpression(node, inDestructuringPattern); var propertiesTable; + var allPropertiesTable = ts.createSymbolTable(); var propertiesArray = []; var spread = emptyObjectType; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 189 /* ObjectBindingPattern */ || contextualType.pattern.kind === 193 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 190 /* ObjectBindingPattern */ || contextualType.pattern.kind === 194 /* ObjectLiteralExpression */); var inConstContext = isConstContext(node); var checkFlags = inConstContext ? 8 /* Readonly */ : 0; var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node); @@ -55225,13 +55494,13 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = getSymbolOfNode(memberDecl); - var computedNameType = memberDecl.name && memberDecl.name.kind === 154 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? + var computedNameType = memberDecl.name && memberDecl.name.kind === 155 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? checkComputedPropertyName(memberDecl.name) : undefined; - if (memberDecl.kind === 281 /* PropertyAssignment */ || - memberDecl.kind === 282 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 282 /* PropertyAssignment */ || + memberDecl.kind === 283 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { - var type = memberDecl.kind === 281 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : - memberDecl.kind === 282 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : + var type = memberDecl.kind === 282 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : + memberDecl.kind === 283 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode); if (isInJavascript) { var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -55254,8 +55523,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 281 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 282 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 282 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 283 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -55279,8 +55548,9 @@ var ts; prop.type = type; prop.target = member; member = prop; + allPropertiesTable.set(prop.escapedName, prop); } - else if (memberDecl.kind === 283 /* SpreadAssignment */) { + else if (memberDecl.kind === 284 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } @@ -55296,6 +55566,16 @@ var ts; error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); return errorType; } + for (var _i = 0, _a = getPropertiesOfType(type); _i < _a.length; _i++) { + var right = _a[_i]; + var rightType = getTypeOfSymbol(right); + var left = allPropertiesTable.get(right.escapedName); + if (strictNullChecks && + left && + !maybeTypeOfKind(rightType, 98304 /* Nullable */)) { + error(left.valueDeclaration, ts.Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, ts.unescapeLeadingUnderscores(left.escapedName)); + } + } spread = getSpreadType(spread, type, node.symbol, objectFlags, inConstContext); offset = i + 1; continue; @@ -55306,7 +55586,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 163 /* GetAccessor */ || memberDecl.kind === 164 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 164 /* GetAccessor */ || memberDecl.kind === 165 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) { @@ -55331,9 +55611,9 @@ var ts; // type with those properties for which the binding pattern specifies a default value. // If the object literal is spread into another object literal, skip this step and let the top-level object // literal handle it instead. - if (contextualTypeHasPattern && node.parent.kind !== 283 /* SpreadAssignment */) { - for (var _i = 0, _a = getPropertiesOfType(contextualType); _i < _a.length; _i++) { - var prop = _a[_i]; + if (contextualTypeHasPattern && node.parent.kind !== 284 /* SpreadAssignment */) { + for (var _b = 0, _c = getPropertiesOfType(contextualType); _b < _c.length; _b++) { + var prop = _c[_b]; if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) { if (!(prop.flags & 16777216 /* Optional */)) { error(prop.valueDeclaration || prop.bindingElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); @@ -55373,13 +55653,13 @@ var ts; } } function isValidSpreadType(type) { - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { var constraint = getBaseConstraintOfType(type); if (constraint !== undefined) { return isValidSpreadType(constraint); } } - return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */) || + return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 193200128 /* InstantiableNonPrimitive */) || getFalsyFlags(type) & 117632 /* DefinitelyFalsy */ && isValidSpreadType(removeDefinitelyFalsyTypes(type)) || type.flags & 3145728 /* UnionOrIntersection */ && ts.every(type.types, isValidSpreadType)); } @@ -55473,7 +55753,7 @@ var ts; } } else { - ts.Debug.assert(attributeDecl.kind === 275 /* JsxSpreadAttribute */); + ts.Debug.assert(attributeDecl.kind === 276 /* JsxSpreadAttribute */); if (attributesTable.size > 0) { spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, /*readonly*/ false); attributesTable = ts.createSymbolTable(); @@ -55496,7 +55776,7 @@ var ts; } } // Handle children attribute - var parent = openingLikeElement.parent.kind === 266 /* JsxElement */ ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 267 /* JsxElement */ ? openingLikeElement.parent : undefined; // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); @@ -55916,7 +56196,7 @@ var ts; */ function checkPropertyAccessibility(node, isSuper, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 153 /* QualifiedName */ ? node.right : node.kind === 188 /* ImportType */ ? node : node.name; + var errorNode = node.kind === 154 /* QualifiedName */ ? node.right : node.kind === 189 /* ImportType */ ? node : node.name; if (ts.getCheckFlags(prop) & 1024 /* ContainsPrivate */) { // Synthetic property with private constituent property error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type)); @@ -56075,7 +56355,7 @@ var ts; return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right); } function isMethodAccessForCall(node) { - while (node.parent.kind === 200 /* ParenthesizedExpression */) { + while (node.parent.kind === 201 /* ParenthesizedExpression */) { node = node.parent; } return ts.isCallOrNewExpression(node.parent) && node.parent.expression === node; @@ -56228,7 +56508,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 162 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { + if (flowContainer.kind === 163 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { assumeUninitialized = true; } } @@ -56260,8 +56540,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName); } - else if (valueDeclaration.kind === 245 /* ClassDeclaration */ && - node.parent.kind !== 169 /* TypeReference */ && + else if (valueDeclaration.kind === 246 /* ClassDeclaration */ && + node.parent.kind !== 170 /* TypeReference */ && !(valueDeclaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName); @@ -56273,22 +56553,22 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return true; - case 281 /* PropertyAssignment */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 283 /* SpreadAssignment */: - case 154 /* ComputedPropertyName */: - case 221 /* TemplateSpan */: - case 276 /* JsxExpression */: - case 273 /* JsxAttribute */: - case 274 /* JsxAttributes */: - case 275 /* JsxSpreadAttribute */: - case 268 /* JsxOpeningElement */: - case 216 /* ExpressionWithTypeArguments */: - case 279 /* HeritageClause */: + case 282 /* PropertyAssignment */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 284 /* SpreadAssignment */: + case 155 /* ComputedPropertyName */: + case 222 /* TemplateSpan */: + case 277 /* JsxExpression */: + case 274 /* JsxAttribute */: + case 275 /* JsxAttributes */: + case 276 /* JsxSpreadAttribute */: + case 269 /* JsxOpeningElement */: + case 217 /* ExpressionWithTypeArguments */: + case 280 /* HeritageClause */: return false; default: return ts.isExpressionNode(node) ? false : "quit"; @@ -56438,7 +56718,19 @@ var ts; return ts.getSpellingSuggestion(name, symbols, getCandidateName); function getCandidateName(candidate) { var candidateName = ts.symbolName(candidate); - return !ts.startsWith(candidateName, "\"") && candidate.flags & meaning ? candidateName : undefined; + if (ts.startsWith(candidateName, "\"")) { + return undefined; + } + if (candidate.flags & meaning) { + return candidateName; + } + if (candidate.flags & 2097152 /* Alias */) { + var alias = tryResolveAlias(candidate); + if (alias && alias.flags & meaning) { + return candidateName; + } + } + return undefined; } } function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isThisAccess) { @@ -56451,7 +56743,7 @@ var ts; if (!hasPrivateModifier && !hasPrivateIdentifier) { return; } - if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */))) { + if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */)) { return; } if (isThisAccess) { @@ -56465,16 +56757,16 @@ var ts; } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return isValidPropertyAccessWithType(node, node.expression.kind === 102 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression))); - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getWidenedType(checkExpression(node.left))); - case 188 /* ImportType */: + case 189 /* ImportType */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getTypeFromTypeNode(node)); } } function isValidPropertyAccessForCompletions(node, type, property) { - return isValidPropertyAccessWithType(node, node.kind === 194 /* PropertyAccessExpression */ && node.expression.kind === 102 /* SuperKeyword */, property.escapedName, type); + return isValidPropertyAccessWithType(node, node.kind === 195 /* PropertyAccessExpression */ && node.expression.kind === 102 /* SuperKeyword */, property.escapedName, type); // Previously we validated the 'this' type of methods but this adversely affected performance. See #31377 for more context. } function isValidPropertyAccessWithType(node, isSuper, propertyName, type) { @@ -56497,7 +56789,7 @@ var ts; */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 243 /* VariableDeclarationList */) { + if (initializer.kind === 244 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -56526,7 +56818,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 231 /* ForInStatement */ && + if (node.kind === 232 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -56610,13 +56902,13 @@ var ts; // This gets us diagnostics for the type arguments and marks them as referenced. ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 198 /* TaggedTemplateExpression */) { + if (node.kind === 199 /* TaggedTemplateExpression */) { checkExpression(node.template); } else if (ts.isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); } - else if (node.kind !== 157 /* Decorator */) { + else if (node.kind !== 158 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -56680,7 +56972,7 @@ var ts; } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 213 /* SpreadElement */ || arg.kind === 220 /* SyntheticExpression */ && arg.isSpread); + return !!arg && (arg.kind === 214 /* SpreadElement */ || arg.kind === 221 /* SyntheticExpression */ && arg.isSpread); } function getSpreadArgumentIndex(args) { return ts.findIndex(args, isSpreadArgument); @@ -56694,9 +56986,9 @@ var ts; var callIsIncomplete = false; // In incomplete call we want to be lenient when we have too few arguments var effectiveParameterCount = getParameterCount(signature); var effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 198 /* TaggedTemplateExpression */) { + if (node.kind === 199 /* TaggedTemplateExpression */) { argCount = args.length; - if (node.template.kind === 211 /* TemplateExpression */) { + if (node.template.kind === 212 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. var lastSpan = ts.last(node.template.templateSpans); // we should always have at least one span. @@ -56711,7 +57003,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 157 /* Decorator */) { + else if (node.kind === 158 /* Decorator */) { argCount = getDecoratorArgumentCount(node, signature); } else if (ts.isJsxOpeningLikeElement(node)) { @@ -56726,7 +57018,7 @@ var ts; else { if (!node.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(node.kind === 197 /* NewExpression */); + ts.Debug.assert(node.kind === 198 /* NewExpression */); return getMinArgumentCount(signature) === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; @@ -56819,7 +57111,7 @@ var ts; // example, given a 'function wrap(cb: (x: T) => U): (x: T) => U' and a call expression // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the // return type of 'wrap'. - if (node.kind !== 157 /* Decorator */) { + if (node.kind !== 158 /* Decorator */) { var contextualType = getContextualType(node); if (contextualType) { // We clone the inference context to avoid disturbing a resolution in progress for an @@ -56862,7 +57154,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 215 /* OmittedExpression */) { + if (arg.kind !== 216 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); inferTypes(context.inferences, argType, paramType); @@ -56876,7 +57168,7 @@ var ts; } function getArrayifiedType(type) { return type.flags & 1048576 /* Union */ ? mapType(type, getArrayifiedType) : - type.flags & (1 /* Any */ | 63176704 /* Instantiable */) || isMutableArrayOrTuple(type) ? type : + type.flags & (1 /* Any */ | 197394432 /* Instantiable */) || isMutableArrayOrTuple(type) ? type : isTupleType(type) ? createTupleType(getTypeArguments(type), type.target.minLength, type.target.hasRestElement, /*readonly*/ false, type.target.associatedNames) : createArrayType(getIndexedAccessType(type, numberType)); } @@ -56886,7 +57178,7 @@ var ts; if (isSpreadArgument(arg)) { // We are inferring from a spread expression in the last argument position, i.e. both the parameter // and the argument are ...x forms. - return arg.kind === 220 /* SyntheticExpression */ ? + return arg.kind === 221 /* SyntheticExpression */ ? createArrayType(arg.type) : getArrayifiedType(checkExpressionWithContextualType(arg.expression, restType, context, 0 /* Normal */)); } @@ -57041,7 +57333,7 @@ var ts; return undefined; } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 197 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 198 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -57071,7 +57363,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 215 /* OmittedExpression */) { + if (arg.kind !== 216 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, /*inferenceContext*/ undefined, checkMode); // If one or more arguments are still excluded (as indicated by CheckMode.SkipContextSensitive), @@ -57112,7 +57404,7 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 196 /* CallExpression */) { + if (node.kind === 197 /* CallExpression */) { var callee = ts.skipOuterExpressions(node.expression); if (ts.isAccessExpression(callee)) { return callee.expression; @@ -57120,7 +57412,7 @@ var ts; } } function createSyntheticExpression(parent, type, isSpread) { - var result = ts.createNode(220 /* SyntheticExpression */, parent.pos, parent.end); + var result = ts.createNode(221 /* SyntheticExpression */, parent.pos, parent.end); result.parent = parent; result.type = type; result.isSpread = isSpread || false; @@ -57130,17 +57422,17 @@ var ts; * Returns the effective arguments for an expression that works like a function invocation. */ function getEffectiveCallArguments(node) { - if (node.kind === 198 /* TaggedTemplateExpression */) { + if (node.kind === 199 /* TaggedTemplateExpression */) { var template = node.template; var args_3 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 211 /* TemplateExpression */) { + if (template.kind === 212 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args_3.push(span.expression); }); } return args_3; } - if (node.kind === 157 /* Decorator */) { + if (node.kind === 158 /* Decorator */) { return getEffectiveDecoratorArguments(node); } if (ts.isJsxOpeningLikeElement(node)) { @@ -57170,30 +57462,30 @@ var ts; var parent = node.parent; var expr = node.expression; switch (parent.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class). return [ createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent))) ]; - case 156 /* Parameter */: + case 157 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts). var func = parent.parent; return [ - createSyntheticExpression(expr, parent.parent.kind === 162 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), + createSyntheticExpression(expr, parent.parent.kind === 163 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), createSyntheticExpression(expr, anyType), createSyntheticExpression(expr, numberType) ]; - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts). If we are emitting decorators // for ES3, we will only pass two arguments. - var hasPropDesc = parent.kind !== 159 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; + var hasPropDesc = parent.kind !== 160 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; return [ createSyntheticExpression(expr, getParentTypeOfClassElement(parent)), createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)), @@ -57207,17 +57499,17 @@ var ts; */ function getDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return 1; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return 2; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // For ES3 or decorators with only two parameters we supply only two arguments return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3; - case 156 /* Parameter */: + case 157 /* Parameter */: return 3; default: return ts.Debug.fail(); @@ -57342,8 +57634,8 @@ var ts; return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { - var isTaggedTemplate = node.kind === 198 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 157 /* Decorator */; + var isTaggedTemplate = node.kind === 199 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 158 /* Decorator */; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var reportErrors = !candidatesOutArray; var typeArguments; @@ -57405,7 +57697,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 196 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 197 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -57921,7 +58213,7 @@ var ts; var declaration = signature.declaration; var modifiers = ts.getSelectedModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */); // (1) Public constructors and (2) constructor functions are always accessible. - if (!modifiers || declaration.kind !== 162 /* Constructor */) { + if (!modifiers || declaration.kind !== 163 /* Constructor */) { return true; } var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -58052,16 +58344,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 156 /* Parameter */: + case 157 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return ts.Debug.fail(); @@ -58152,16 +58444,16 @@ var ts; } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 196 /* CallExpression */: + case 197 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray, checkMode); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray, checkMode); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 157 /* Decorator */: + case 158 /* Decorator */: return resolveDecorator(node, candidatesOutArray, checkMode); - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); } throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -58250,7 +58542,7 @@ var ts; return false; } var parent = node.parent; - while (parent && parent.kind === 194 /* PropertyAccessExpression */) { + while (parent && parent.kind === 195 /* PropertyAccessExpression */) { parent = parent.parent; } if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -58275,12 +58567,12 @@ var ts; if (node.expression.kind === 102 /* SuperKeyword */) { return voidType; } - if (node.kind === 197 /* NewExpression */) { + if (node.kind === 198 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 162 /* Constructor */ && - declaration.kind !== 166 /* ConstructSignature */ && - declaration.kind !== 171 /* ConstructorType */ && + declaration.kind !== 163 /* Constructor */ && + declaration.kind !== 167 /* ConstructSignature */ && + declaration.kind !== 172 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any @@ -58300,7 +58592,7 @@ var ts; if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) { return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent)); } - if (node.kind === 196 /* CallExpression */ && node.parent.kind === 226 /* ExpressionStatement */ && + if (node.kind === 197 /* CallExpression */ && node.parent.kind === 227 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { if (!ts.isDottedName(node.expression)) { error(node.expression, ts.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); @@ -58407,9 +58699,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 244 /* FunctionDeclaration */ + ? 245 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 242 /* VariableDeclaration */ + ? 243 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -58437,18 +58729,18 @@ var ts; case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return true; - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isValidConstAssertionArgument(node.expression); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: var op = node.operator; var arg = node.operand; return op === 40 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) || op === 39 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */; - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: var expr = node.expression; if (ts.isIdentifier(expr)) { var symbol = getSymbolAtLocation(expr); @@ -58498,7 +58790,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return errorType; } - else if (container.kind === 162 /* Constructor */) { + else if (container.kind === 163 /* Constructor */) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -58591,7 +58883,7 @@ var ts; } return length; } - function getMinArgumentCount(signature) { + function getMinArgumentCount(signature, strongArityForUntypedJS) { if (signatureHasRestParameter(signature)) { var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); if (isTupleType(restType)) { @@ -58601,6 +58893,9 @@ var ts; } } } + if (!strongArityForUntypedJS && signature.flags & 16 /* IsUntypedSignatureInJSFile */) { + return 0; + } return signature.minArgumentCount; } function hasEffectiveRestParameter(signature) { @@ -58762,7 +59057,7 @@ var ts; var yieldType; var nextType; var fallbackReturnType = voidType; - if (func.body.kind !== 223 /* Block */) { // Async or normal arrow function + if (func.body.kind !== 224 /* Block */) { // Async or normal arrow function returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */); if (isAsync) { // From within an async function you can return either a non-promise value or a promise. Any @@ -58949,10 +59244,9 @@ var ts; return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node)); } function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 204 /* TypeOfExpression */) { + if (node.expression.kind === 205 /* TypeOfExpression */) { var operandType = getTypeOfExpression(node.expression.expression); - // This cast is safe because the switch is possibly exhaustive and does not contain a default case, so there can be no undefined. - var witnesses = getSwitchClauseTypeOfWitnesses(node); + var witnesses = getSwitchClauseTypeOfWitnesses(node, /*retainDefault*/ false); // notEqualFacts states that the type of the switched value is not equal to every type in the switch. var notEqualFacts_1 = getFactsFromTypeofSwitch(0, 0, witnesses, /*hasDefault*/ true); var type_3 = getBaseConstraintOfType(operandType) || operandType; @@ -59009,11 +59303,11 @@ var ts; } function mayReturnNever(func) { switch (func.kind) { - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return true; - case 161 /* MethodDeclaration */: - return func.parent.kind === 193 /* ObjectLiteralExpression */; + case 162 /* MethodDeclaration */: + return func.parent.kind === 194 /* ObjectLiteralExpression */; default: return false; } @@ -59039,7 +59333,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (func.kind === 160 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 223 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 161 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 224 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */; @@ -59072,7 +59366,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); checkNodeDeferred(node); // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode && checkMode & 4 /* SkipContextSensitive */ && isContextSensitive(node)) { @@ -59096,7 +59390,7 @@ var ts; } // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 201 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 202 /* FunctionExpression */) { checkGrammarForGenerator(node); } contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -59149,7 +59443,7 @@ var ts; type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnType = getReturnTypeFromAnnotation(node); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); @@ -59162,7 +59456,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 223 /* Block */) { + if (node.body.kind === 224 /* Block */) { checkSourceElement(node.body); } else { @@ -59252,7 +59546,7 @@ var ts; expr.expression.kind === 104 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var ctor = ts.getContainingFunction(expr); - if (!(ctor && ctor.kind === 162 /* Constructor */)) { + if (!(ctor && ctor.kind === 163 /* Constructor */)) { return true; } if (symbol.valueDeclaration) { @@ -59277,7 +59571,7 @@ var ts; var symbol_2 = getNodeLinks(node).resolvedSymbol; if (symbol_2.flags & 2097152 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol_2); - return !!declaration && declaration.kind === 256 /* NamespaceImport */; + return !!declaration && declaration.kind === 257 /* NamespaceImport */; } } } @@ -59303,7 +59597,7 @@ var ts; error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); return booleanType; } - if (expr.kind === 194 /* PropertyAccessExpression */ && ts.isPrivateIdentifier(expr.name)) { + if (expr.kind === 195 /* PropertyAccessExpression */ && ts.isPrivateIdentifier(expr.name)) { error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier); } var links = getNodeLinks(expr); @@ -59353,7 +59647,7 @@ var ts; var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos); var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); var func = ts.getContainingFunction(node); - if (func && func.kind !== 162 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { + if (func && func.kind !== 163 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); } @@ -59525,7 +59819,7 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 296 /* NumberLike */ | 12288 /* ESSymbolLike */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { + if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 193200128 /* InstantiableNonPrimitive */)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -59545,7 +59839,7 @@ var ts; if (rightIsThis === void 0) { rightIsThis = false; } var properties = node.properties; var property = properties[propertyIndex]; - if (property.kind === 281 /* PropertyAssignment */ || property.kind === 282 /* ShorthandPropertyAssignment */) { + if (property.kind === 282 /* PropertyAssignment */ || property.kind === 283 /* ShorthandPropertyAssignment */) { var name = property.name; var exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -59558,9 +59852,9 @@ var ts; } var elementType = getIndexedAccessType(objectLiteralType, exprType, name); var type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 282 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); + return checkDestructuringAssignment(property.kind === 283 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); } - else if (property.kind === 283 /* SpreadAssignment */) { + else if (property.kind === 284 /* SpreadAssignment */) { if (propertyIndex < properties.length - 1) { error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } @@ -59603,8 +59897,8 @@ var ts; function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 215 /* OmittedExpression */) { - if (element.kind !== 213 /* SpreadElement */) { + if (element.kind !== 216 /* OmittedExpression */) { + if (element.kind !== 214 /* SpreadElement */) { var indexType = getLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { // We create a synthetic expression so that getIndexedAccessType doesn't get confused @@ -59622,7 +59916,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 209 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { + if (restExpression.kind === 210 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -59638,7 +59932,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { var target; - if (exprOrAssignment.kind === 282 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 283 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -59654,24 +59948,24 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 209 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { + if (target.kind === 210 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 193 /* ObjectLiteralExpression */) { + if (target.kind === 194 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 192 /* ArrayLiteralExpression */) { + if (target.kind === 193 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 283 /* SpreadAssignment */ ? + var error = target.parent.kind === 284 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; - var optionalError = target.parent.kind === 283 /* SpreadAssignment */ ? + var optionalError = target.parent.kind === 284 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; if (checkReferenceExpression(target, error, optionalError)) { @@ -59696,36 +59990,36 @@ var ts; case 75 /* Identifier */: case 10 /* StringLiteral */: case 13 /* RegularExpressionLiteral */: - case 198 /* TaggedTemplateExpression */: - case 211 /* TemplateExpression */: + case 199 /* TaggedTemplateExpression */: + case 212 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: case 100 /* NullKeyword */: - case 146 /* UndefinedKeyword */: - case 201 /* FunctionExpression */: - case 214 /* ClassExpression */: - case 202 /* ArrowFunction */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: - case 204 /* TypeOfExpression */: - case 218 /* NonNullExpression */: - case 267 /* JsxSelfClosingElement */: - case 266 /* JsxElement */: + case 147 /* UndefinedKeyword */: + case 202 /* FunctionExpression */: + case 215 /* ClassExpression */: + case 203 /* ArrowFunction */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 205 /* TypeOfExpression */: + case 219 /* NonNullExpression */: + case 268 /* JsxSelfClosingElement */: + case 267 /* JsxElement */: return true; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -59737,9 +60031,9 @@ var ts; } return false; // Some forms listed here for clarity - case 205 /* VoidExpression */: // Explicit opt-out - case 199 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 217 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 206 /* VoidExpression */: // Explicit opt-out + case 200 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 218 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -59771,7 +60065,7 @@ var ts; } checkGrammarNullishCoalesceWithLogicalExpression(node); var operator = node.operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (node.left.kind === 193 /* ObjectLiteralExpression */ || node.left.kind === 192 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (node.left.kind === 194 /* ObjectLiteralExpression */ || node.left.kind === 193 /* ArrayLiteralExpression */)) { finishInvocation(checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 104 /* ThisKeyword */)); break; } @@ -59838,7 +60132,7 @@ var ts; // expression-wide checks and does not use a work stack to fold nested binary expressions into the same callstack frame function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (left.kind === 193 /* ObjectLiteralExpression */ || left.kind === 192 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (left.kind === 194 /* ObjectLiteralExpression */ || left.kind === 193 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 104 /* ThisKeyword */); } var leftType; @@ -60243,7 +60537,7 @@ var ts; return stringType; } function getContextNode(node) { - if (node.kind === 274 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { + if (node.kind === 275 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes) } return node; @@ -60292,13 +60586,13 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 199 /* TypeAssertionExpression */ || node.kind === 217 /* AsExpression */; + return node.kind === 200 /* TypeAssertionExpression */ || node.kind === 218 /* AsExpression */; } function checkDeclarationInitializer(declaration, contextualType) { var initializer = ts.getEffectiveInitializer(declaration); var type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, 0 /* Normal */) : checkExpressionCached(initializer)); - return ts.isParameter(declaration) && declaration.name.kind === 190 /* ArrayBindingPattern */ && + return ts.isParameter(declaration) && declaration.name.kind === 191 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type; } @@ -60308,7 +60602,7 @@ var ts; var elementTypes = arity ? getTypeArguments(type).slice() : []; for (var i = arity; i < patternElements.length; i++) { var e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === 191 /* BindingElement */ && e.dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === 192 /* BindingElement */ && e.dotDotDotToken)) { elementTypes.push(!ts.isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, /*includePatternInType*/ false, /*reportErrors*/ false) : anyType); if (!ts.isOmittedExpression(e) && !hasDefaultValue(e)) { reportImplicitAny(e, anyType); @@ -60337,7 +60631,7 @@ var ts; var types = contextualType.types; return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); }); } - if (contextualType.flags & 58982400 /* InstantiableNonPrimitive */) { + if (contextualType.flags & 193200128 /* InstantiableNonPrimitive */) { // If the contextual type is a type variable constrained to a primitive type, consider // this a literal context for literals of that primitive type. For example, given a // type parameter 'T extends string', infer string literal types for T. @@ -60374,7 +60668,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); @@ -60385,7 +60679,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -60619,11 +60913,11 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 195 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 75 /* Identifier */ || node.kind === 153 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || - (node.parent.kind === 172 /* TypeQuery */ && node.parent.exprName === node)) || - (node.parent.kind === 263 /* ExportSpecifier */); // We allow reexporting const enums + var ok = (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 196 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 75 /* Identifier */ || node.kind === 154 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 173 /* TypeQuery */ && node.parent.exprName === node)) || + (node.parent.kind === 264 /* ExportSpecifier */); // We allow reexporting const enums if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } @@ -60648,9 +60942,9 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 214 /* ClassExpression */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 215 /* ClassExpression */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -60676,78 +60970,78 @@ var ts; return trueType; case 91 /* FalseKeyword */: return falseType; - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: return checkTemplateExpression(node); case 13 /* RegularExpressionLiteral */: return globalRegExpType; - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode, forceTuple); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return checkQualifiedName(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (node.expression.kind === 96 /* ImportKeyword */) { return checkImportCallExpression(node); } // falls through - case 197 /* NewExpression */: + case 198 /* NewExpression */: return checkCallExpression(node, checkMode); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return checkClassExpression(node); - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: return checkAssertion(node); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: return checkNonNullAssertion(node); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return checkMetaProperty(node); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return checkDeleteExpression(node); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return checkVoidExpression(node); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return checkAwaitExpression(node); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 215 /* OmittedExpression */: + case 216 /* OmittedExpression */: return undefinedWideningType; - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return checkYieldExpression(node); - case 220 /* SyntheticExpression */: + case 221 /* SyntheticExpression */: return node.type; - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 266 /* JsxElement */: + case 267 /* JsxElement */: return checkJsxElement(node, checkMode); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node, checkMode); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return checkJsxFragment(node); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 268 /* JsxOpeningElement */: + case 269 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -60784,7 +61078,7 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { - if (!(func.kind === 162 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 163 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -60795,12 +61089,15 @@ var ts; if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 162 /* Constructor */ || func.kind === 166 /* ConstructSignature */ || func.kind === 171 /* ConstructorType */) { + if (func.kind === 163 /* Constructor */ || func.kind === 167 /* ConstructSignature */ || func.kind === 172 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 202 /* ArrowFunction */) { + if (func.kind === 203 /* ArrowFunction */) { error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } + if (func.kind === 164 /* GetAccessor */ || func.kind === 165 /* SetAccessor */) { + error(node, ts.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); + } } // Only check rest parameter type if it's not a binding pattern. Since binding patterns are // not allowed in a rest parameter, we already have an error from checkGrammarParameterList. @@ -60856,13 +61153,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 202 /* ArrowFunction */: - case 165 /* CallSignature */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 170 /* FunctionType */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 203 /* ArrowFunction */: + case 166 /* CallSignature */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 171 /* FunctionType */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: var parent = node.parent; if (node === parent.type) { return parent; @@ -60880,7 +61177,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 190 /* ArrayBindingPattern */ || name.kind === 189 /* ObjectBindingPattern */) { + else if (name.kind === 191 /* ArrayBindingPattern */ || name.kind === 190 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -60889,13 +61186,13 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 167 /* IndexSignature */) { + if (node.kind === 168 /* IndexSignature */) { checkGrammarIndexSignature(node); } // TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled - else if (node.kind === 170 /* FunctionType */ || node.kind === 244 /* FunctionDeclaration */ || node.kind === 171 /* ConstructorType */ || - node.kind === 165 /* CallSignature */ || node.kind === 162 /* Constructor */ || - node.kind === 166 /* ConstructSignature */) { + else if (node.kind === 171 /* FunctionType */ || node.kind === 245 /* FunctionDeclaration */ || node.kind === 172 /* ConstructorType */ || + node.kind === 166 /* CallSignature */ || node.kind === 163 /* Constructor */ || + node.kind === 167 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -60925,10 +61222,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 165 /* CallSignature */: + case 166 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -60958,7 +61255,7 @@ var ts; checkAsyncFunctionReturnType(node, returnTypeNode); } } - if (node.kind !== 167 /* IndexSignature */ && node.kind !== 300 /* JSDocFunctionType */) { + if (node.kind !== 168 /* IndexSignature */ && node.kind !== 301 /* JSDocFunctionType */) { registerForUnusedIdentifiersCheck(node); } } @@ -60970,7 +61267,7 @@ var ts; var privateIdentifiers = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 162 /* Constructor */) { + if (member.kind === 163 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param, member) && !ts.isBindingPattern(param.name)) { @@ -60990,16 +61287,16 @@ var ts; var memberName = name && ts.getPropertyNameForPropertyNameNode(name); if (memberName) { switch (member.kind) { - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: addName(names, name, memberName, 1 /* GetAccessor */); break; - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: addName(names, name, memberName, 2 /* SetAccessor */); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: addName(names, name, memberName, 3 /* GetOrSetAccessor */); break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: addName(names, name, memberName, 8 /* Method */); break; } @@ -61062,7 +61359,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 158 /* PropertySignature */) { + if (member.kind === 159 /* PropertySignature */) { var memberName = void 0; var name = member.name; switch (name.kind) { @@ -61087,7 +61384,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 246 /* InterfaceDeclaration */) { + if (node.kind === 247 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -61107,7 +61404,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 143 /* StringKeyword */: + case 144 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -61115,7 +61412,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 140 /* NumberKeyword */: + case 141 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -61157,7 +61454,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 161 /* MethodDeclaration */ && node.body) { + if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 162 /* MethodDeclaration */ && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -61185,7 +61482,7 @@ var ts; if (ts.isPrivateIdentifierPropertyDeclaration(n)) { return true; } - return n.kind === 159 /* PropertyDeclaration */ && + return n.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(n, 32 /* Static */) && !!n.initializer; } @@ -61215,7 +61512,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_3 = statements; _i < statements_3.length; _i++) { var statement = statements_3[_i]; - if (statement.kind === 226 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 227 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -61240,7 +61537,7 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 163 /* GetAccessor */) { + if (node.kind === 164 /* GetAccessor */) { if (!(node.flags & 8388608 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 256 /* HasImplicitReturn */)) { if (!(node.flags & 512 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -61250,7 +61547,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (ts.isPrivateIdentifier(node.name)) { @@ -61259,7 +61556,7 @@ var ts; if (!hasNonBindableDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; + var otherKind = node.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getModifierFlags(node); @@ -61277,7 +61574,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 163 /* GetAccessor */) { + if (node.kind === 164 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -61325,7 +61622,7 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 169 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 170 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } ts.forEach(node.typeArguments, checkSourceElement); @@ -61370,7 +61667,7 @@ var ts; var seenOptionalElement = false; for (var i = 0; i < elementTypes.length; i++) { var e = elementTypes[i]; - if (e.kind === 177 /* RestType */) { + if (e.kind === 178 /* RestType */) { if (i !== elementTypes.length - 1) { grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); break; @@ -61379,7 +61676,7 @@ var ts; error(e, ts.Diagnostics.A_rest_element_type_must_be_an_array_type); } } - else if (e.kind === 176 /* OptionalType */) { + else if (e.kind === 177 /* OptionalType */) { seenOptionalElement = true; } else if (seenOptionalElement) { @@ -61400,7 +61697,7 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType, /*stringsOnly*/ false))) { - if (accessNode.kind === 195 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && + if (accessNode.kind === 196 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } @@ -61451,7 +61748,7 @@ var ts; ts.forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 180 /* ConditionalType */ && n.parent.extendsType === n; })) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 181 /* ConditionalType */ && n.parent.extendsType === n; })) { grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); @@ -61468,9 +61765,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 246 /* InterfaceDeclaration */ && - n.parent.kind !== 245 /* ClassDeclaration */ && - n.parent.kind !== 214 /* ClassExpression */ && + if (n.parent.kind !== 247 /* InterfaceDeclaration */ && + n.parent.kind !== 246 /* ClassDeclaration */ && + n.parent.kind !== 215 /* ClassExpression */ && n.flags & 8388608 /* Ambient */) { if (!(flags & 2 /* Ambient */) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) { // It is nested in an ambient context, which means it is automatically exported @@ -61566,7 +61863,7 @@ var ts; // Both are literal property names that are the same. ts.isPropertyNameLiteral(node.name) && ts.isPropertyNameLiteral(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 161 /* MethodDeclaration */ || node.kind === 160 /* MethodSignature */) && + var reportError = (node.kind === 162 /* MethodDeclaration */ || node.kind === 161 /* MethodSignature */) && ts.hasModifier(node, 32 /* Static */) !== ts.hasModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -61606,7 +61903,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 8388608 /* Ambient */; - var inAmbientContextOrInterface = node.parent.kind === 246 /* InterfaceDeclaration */ || node.parent.kind === 173 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 247 /* InterfaceDeclaration */ || node.parent.kind === 174 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -61617,10 +61914,10 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if ((node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */) && !inAmbientContext) { + if ((node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */) && !inAmbientContext) { hasNonAmbientClass = true; } - if (node.kind === 244 /* FunctionDeclaration */ || node.kind === 161 /* MethodDeclaration */ || node.kind === 160 /* MethodSignature */ || node.kind === 162 /* Constructor */) { + if (node.kind === 245 /* FunctionDeclaration */ || node.kind === 162 /* MethodDeclaration */ || node.kind === 161 /* MethodSignature */ || node.kind === 163 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -61751,25 +62048,25 @@ var ts; function getDeclarationSpaces(decl) { var d = decl; switch (d.kind) { - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: // A jsdoc typedef and callback are, by definition, type aliases. // falls through - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: return 2 /* ExportType */; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: return 2 /* ExportType */ | 1 /* ExportValue */; - case 290 /* SourceFile */: + case 291 /* SourceFile */: return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: // Export assigned entity name expressions act as aliases and should fall through, otherwise they export values if (!ts.isEntityNameExpression(d.expression)) { return 1 /* ExportValue */; @@ -61777,17 +62074,17 @@ var ts; d = d.expression; // The below options all declare an Alias, which is allowed to merge with other values within the importing module. // falls through - case 253 /* ImportEqualsDeclaration */: - case 256 /* NamespaceImport */: - case 255 /* ImportClause */: + case 254 /* ImportEqualsDeclaration */: + case 257 /* NamespaceImport */: + case 256 /* ImportClause */: var result_8 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_8 |= getDeclarationSpaces(d); }); return result_8; - case 242 /* VariableDeclaration */: - case 191 /* BindingElement */: - case 244 /* FunctionDeclaration */: - case 258 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 + case 243 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 245 /* FunctionDeclaration */: + case 259 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 case 75 /* Identifier */: // https://github.com/microsoft/TypeScript/issues/36098 // Identifiers are used as declarations of assignment declarations whose parents may be // SyntaxKind.CallExpression - `Object.defineProperty(thing, "aField", {value: 42});` @@ -61810,9 +62107,9 @@ var ts; * @param type The type of the promise. * @remarks The "promised type" of a type is the type of the "value" parameter of the "onfulfilled" callback. */ - function getPromisedTypeOfPromise(promise, errorNode) { + function getPromisedTypeOfPromise(type, errorNode) { // - // { // promise + // { // type // then( // thenFunction // onfulfilled: ( // onfulfilledParameterType // value: T // valueParameterType @@ -61820,17 +62117,18 @@ var ts; // ): any; // } // - if (isTypeAny(promise)) { + if (isTypeAny(type)) { return undefined; } - var typeAsPromise = promise; + var typeAsPromise = type; if (typeAsPromise.promisedTypeOfPromise) { return typeAsPromise.promisedTypeOfPromise; } - if (isReferenceToType(promise, getGlobalPromiseType(/*reportErrors*/ false))) { - return typeAsPromise.promisedTypeOfPromise = getTypeArguments(promise)[0]; + if (isReferenceToType(type, getGlobalPromiseType(/*reportErrors*/ false)) || + isReferenceToType(type, getGlobalPromiseLikeType(/*reportErrors*/ false))) { + return typeAsPromise.promisedTypeOfPromise = getAwaitedType(getTypeArguments(type)[0], errorNode); } - var thenFunction = getTypeOfPropertyOfType(promise, "then"); // TODO: GH#18217 + var thenFunction = getTypeOfPropertyOfType(type, "then"); // TODO: GH#18217 if (isTypeAny(thenFunction)) { return undefined; } @@ -61865,28 +62163,127 @@ var ts; var awaitedType = getAwaitedType(type, errorNode, diagnosticMessage, arg0); return awaitedType || errorType; } + /** + * Gets or creates an `awaited T` type for a generic type. + * + * The "awaited type" of a generic type cannot be determined until it is instantiated. As + * a result, an `AwaitedType` for the generic type is created that can be instantiated + * or related later. + */ + function getAwaitedTypeForGenericType(type) { + var typeId = "" + type.id; + var awaitedType = awaitedTypes.get(typeId); + if (!awaitedType) { + awaitedType = createType(134217728 /* Awaited */); + awaitedType.awaitedType = type; + awaitedTypes.set(typeId, awaitedType); + } + return awaitedType; + } + function unwrapAwaitedType(type) { + return type.flags & 1048576 /* Union */ ? + mapType(type, unwrapAwaitedType) : + type.flags & 134217728 /* Awaited */ ? type.awaitedType : type; + } + /** + * Determines whether a type has a callable `then` member. + */ + function isThenableType(type) { + var thenFunction = getTypeOfPropertyOfType(type, "then"); + return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, 2097152 /* NEUndefinedOrNull */), 0 /* Call */).length > 0; + } + /** + * Determines whether a type is a generic type whose base constraint could possibly resolve to a different + * type when awaited. A type is a generic "thenable" type when all of the following conditions are met: + * - The type is a generic object type, + * - AND one of the following conditions are met + * - The type has no base constraint, + * - OR The base constraint of the type is `any`, `unknown`, `object`, or the empty object `{}`, + * - OR The base constraint has a callable `then` member. + */ + function isGenericAwaitableType(type) { + if (isGenericObjectType(type)) { + if (type.flags & 2097152 /* Intersection */) { + return ts.some(type.types, isGenericAwaitableType); + } + var baseConstraint = getBaseConstraintOfType(type); + return !baseConstraint || + !!(baseConstraint.flags & (3 /* AnyOrUnknown */ | 67108864 /* NonPrimitive */)) || + baseConstraint === emptyObjectType || + baseConstraint === emptyGenericType || + isThenableType(baseConstraint); + } + return false; + } + /** + * Gets the "awaited type" of a type. + * + * The "awaited type" of an expression is its "promised type" if the expression is a + * Promise-like type; otherwise, it is the type of the expression. If the "promised + * type" is itself a Promise-like, the "promised type" is recursively unwrapped until a + * non-promise type is found. + * + * This is used to reflect the runtime behavior of the `await` keyword and the `awaited T` + * type. + */ function getAwaitedType(type, errorNode, diagnosticMessage, arg0) { + if (isTypeAny(type)) { + return type; + } + // If the type is already an awaited type, return it. + // + // For example: + // + // awaited T -> awaited T + // + if (type.flags & 134217728 /* Awaited */) { + return type; + } var typeAsAwaitable = type; if (typeAsAwaitable.awaitedTypeOfType) { return typeAsAwaitable.awaitedTypeOfType; } - if (isTypeAny(type)) { - return typeAsAwaitable.awaitedTypeOfType = type; + // For a union, get a union of the awaited types of each constituent. + // + // For example: + // + // awaited (number | string) -> number | string + // awaited (number | Promise) -> number | string + // awaited (T | string) -> awaited T | string + // awaited (T | Promise) -> awaited T | string + // awaited (T | Promise) -> awaited T + // awaited (T | U) -> awaited T | awaited U + // + return typeAsAwaitable.awaitedTypeOfType = + mapType(type, errorNode ? function (constituentType) { return getAwaitedTypeWorker(constituentType, errorNode, diagnosticMessage, arg0); } : getAwaitedTypeWorker); + } + function getAwaitedTypeWorker(type, errorNode, diagnosticMessage, arg0) { + // If the type is already an awaited type, return it. + // + // For example: + // + // awaited T -> awaited T + // + if (type.flags & 134217728 /* Awaited */) { + return type; } - if (type.flags & 1048576 /* Union */) { - var types = void 0; - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var constituentType = _a[_i]; - types = ts.append(types, getAwaitedType(constituentType, errorNode, diagnosticMessage, arg0)); - } - if (!types) { - return undefined; - } - return typeAsAwaitable.awaitedTypeOfType = getUnionType(types); + // We cannot resolve the awaited type for a type variable until it is instantiated. As + // such, we create an `awaited T` type that can either be instantiated or related later. + // + // For example: + // + // T -> awaited T + // + if (isGenericAwaitableType(type)) { + return getAwaitedTypeForGenericType(type); + } + var typeAsAwaitable = type; + if (typeAsAwaitable.awaitedTypeOfType) { + return typeAsAwaitable.awaitedTypeOfType; } var promisedType = getPromisedTypeOfPromise(type); if (promisedType) { - if (type.id === promisedType.id || awaitedTypeStack.indexOf(promisedType.id) >= 0) { + if (type.id === promisedType.id || awaitedTypeStack.lastIndexOf(promisedType.id) >= 0) { // Verify that we don't have a bad actor in the form of a promise whose // promised type is the same as the promise type, or a mutually recursive // promise. If so, we return undefined as we cannot guess the shape. If this @@ -61900,6 +62297,7 @@ var ts; // onfulfilled: (value: BadPromise) => any, // onrejected: (error: any) => any): BadPromise; // } + // // The above interface will pass the PromiseLike check, and return a // promised type of `BadPromise`. Since this is a self reference, we // don't want to keep recursing ad infinitum. @@ -61936,8 +62334,8 @@ var ts; } // The type was not a promise, so it could not be unwrapped any further. // As long as the type does not have a callable "then" property, it is - // safe to return the type; otherwise, an error will be reported in - // the call to getNonThenableType and we will return undefined. + // safe to return the type; otherwise, an error is reported and we return + // undefined. // // An example of a non-promise "thenable" might be: // @@ -61949,8 +62347,7 @@ var ts; // of a runtime problem. If the user wants to return this value from an async // function, they would need to wrap it in some other value. If they want it to // be treated as a promise, they can cast to . - var thenFunction = getTypeOfPropertyOfType(type, "then"); - if (thenFunction && getSignaturesOfType(thenFunction, 0 /* Call */).length > 0) { + if (isThenableType(type)) { if (errorNode) { if (!diagnosticMessage) return ts.Debug.fail(); @@ -62063,24 +62460,24 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 156 /* Parameter */: + case 157 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -62127,14 +62524,14 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 179 /* IntersectionType */: - case 178 /* UnionType */: + case 180 /* IntersectionType */: + case 179 /* UnionType */: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return getEntityNameForDecoratorMetadata(node.type); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return node.typeName; } } @@ -62143,13 +62540,13 @@ var ts; var commonEntityName; for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { var typeNode = types_19[_i]; - while (typeNode.kind === 182 /* ParenthesizedType */) { + while (typeNode.kind === 183 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 137 /* NeverKeyword */) { + if (typeNode.kind === 138 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 146 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 147 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -62195,14 +62592,14 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 156 /* Parameter */) { + if (node.kind === 157 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -62211,23 +62608,23 @@ var ts; } } break; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - var otherKind = node.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + var otherKind = node.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 156 /* Parameter */: + case 157 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -62290,7 +62687,7 @@ var ts; else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && node.typeExpression && node.typeExpression.type && !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 153 /* QualifiedName */ ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 154 /* QualifiedName */ ? node.name.right : node.name)); } } } @@ -62331,7 +62728,7 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return node.name; default: return undefined; @@ -62344,7 +62741,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 155 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -62373,7 +62770,7 @@ var ts; } } } - var body = node.kind === 160 /* MethodSignature */ ? undefined : node.body; + var body = node.kind === 161 /* MethodSignature */ ? undefined : node.body; checkSourceElement(body); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); if (produceDiagnostics && !ts.getEffectiveReturnTypeNode(node)) { @@ -62415,42 +62812,42 @@ var ts; for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) { var node = potentiallyUnusedIdentifiers_1[_i]; switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 290 /* SourceFile */: - case 249 /* ModuleDeclaration */: - case 223 /* Block */: - case 251 /* CaseBlock */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 291 /* SourceFile */: + case 250 /* ModuleDeclaration */: + case 224 /* Block */: + case 252 /* CaseBlock */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 162 /* Constructor */: - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 163 /* Constructor */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; - case 181 /* InferType */: + case 182 /* InferType */: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -62470,11 +62867,11 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 161 /* MethodDeclaration */: - case 159 /* PropertyDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - if (member.kind === 164 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + case 162 /* MethodDeclaration */: + case 160 /* PropertyDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + if (member.kind === 165 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { // Already would have reported an error on the getter. break; } @@ -62485,7 +62882,7 @@ var ts; addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); } break; - case 162 /* Constructor */: + case 163 /* Constructor */: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { @@ -62493,8 +62890,8 @@ var ts; } } break; - case 167 /* IndexSignature */: - case 222 /* SemicolonClassElement */: + case 168 /* IndexSignature */: + case 223 /* SemicolonClassElement */: // Can't be private break; default: @@ -62521,7 +62918,7 @@ var ts; continue; var name = ts.idText(typeParameter.name); var parent = typeParameter.parent; - if (parent.kind !== 181 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { + if (parent.kind !== 182 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { if (seenParentsWithEveryUnused.tryAdd(parent)) { var range = ts.isJSDocTemplateTag(parent) // Whole @template tag @@ -62604,7 +63001,7 @@ var ts; var importDecl = importClause.parent; var nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? - (importClause.namedBindings.kind === 256 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) + (importClause.namedBindings.kind === 257 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) : 0); if (nDeclarations === unuseds.length) { addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 @@ -62622,7 +63019,7 @@ var ts; var bindingPattern = _a[0], bindingElements = _a[1]; var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */; if (bindingPattern.elements.length === bindingElements.length) { - if (bindingElements.length === 1 && bindingPattern.parent.kind === 242 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 243 /* VariableDeclarationList */) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 243 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 244 /* VariableDeclarationList */) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { @@ -62643,7 +63040,7 @@ var ts; if (declarationList.declarations.length === declarations.length) { addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? ts.createDiagnosticForNode(ts.first(declarations).name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(declarations).name)) - : ts.createDiagnosticForNode(declarationList.parent.kind === 225 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); + : ts.createDiagnosticForNode(declarationList.parent.kind === 226 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); } else { for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { @@ -62657,22 +63054,22 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return ts.idText(name); - case 190 /* ArrayBindingPattern */: - case 189 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name); default: return ts.Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 255 /* ImportClause */ || node.kind === 258 /* ImportSpecifier */ || node.kind === 256 /* NamespaceImport */; + return node.kind === 256 /* ImportClause */ || node.kind === 259 /* ImportSpecifier */ || node.kind === 257 /* NamespaceImport */; } function importClauseFromImported(decl) { - return decl.kind === 255 /* ImportClause */ ? decl : decl.kind === 256 /* NamespaceImport */ ? decl.parent : decl.parent.parent; + return decl.kind === 256 /* ImportClause */ ? decl : decl.kind === 257 /* NamespaceImport */ ? decl.parent : decl.parent.parent; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 223 /* Block */) { + if (node.kind === 224 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -62702,12 +63099,12 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 159 /* PropertyDeclaration */ || - node.kind === 158 /* PropertySignature */ || - node.kind === 161 /* MethodDeclaration */ || - node.kind === 160 /* MethodSignature */ || - node.kind === 163 /* GetAccessor */ || - node.kind === 164 /* SetAccessor */) { + if (node.kind === 160 /* PropertyDeclaration */ || + node.kind === 159 /* PropertySignature */ || + node.kind === 162 /* MethodDeclaration */ || + node.kind === 161 /* MethodSignature */ || + node.kind === 164 /* GetAccessor */ || + node.kind === 165 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -62716,7 +63113,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 156 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 157 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -62773,7 +63170,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -62788,7 +63185,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { + if (parent.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -62823,7 +63220,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 242 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 243 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -62835,17 +63232,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 243 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 225 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 244 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 226 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 223 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 250 /* ModuleBlock */ || - container.kind === 249 /* ModuleDeclaration */ || - container.kind === 290 /* SourceFile */); + (container.kind === 224 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 251 /* ModuleBlock */ || + container.kind === 250 /* ModuleDeclaration */ || + container.kind === 291 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -62875,18 +63272,18 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 191 /* BindingElement */) { - if (node.parent.kind === 189 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { + if (node.kind === 192 /* BindingElement */) { + if (node.parent.kind === 190 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 154 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access @@ -62907,19 +63304,19 @@ var ts; } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 190 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 191 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.getRootDeclaration(node).kind === 156 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 157 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { - var needCheckInitializer = node.initializer && node.parent.parent.kind !== 231 /* ForInStatement */; + var needCheckInitializer = node.initializer && node.parent.parent.kind !== 232 /* ForInStatement */; var needCheckWidenedType = node.name.elements.length === 0; if (needCheckInitializer || needCheckWidenedType) { // Don't validate for-in initializer as it is already an error @@ -62956,7 +63353,7 @@ var ts; ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) && ts.hasEntries(symbol.exports); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 231 /* ForInStatement */) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 232 /* ForInStatement */) { checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, /*headMessage*/ undefined); } } @@ -62982,10 +63379,10 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 159 /* PropertyDeclaration */ && node.kind !== 158 /* PropertySignature */) { + if (node.kind !== 160 /* PropertyDeclaration */ && node.kind !== 159 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { + if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -62997,7 +63394,7 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 159 /* PropertyDeclaration */ || nextDeclaration.kind === 158 /* PropertySignature */ + var message = nextDeclaration.kind === 160 /* PropertyDeclaration */ || nextDeclaration.kind === 159 /* PropertySignature */ ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; var declName = ts.declarationNameToString(nextDeclarationName); @@ -63007,8 +63404,8 @@ var ts; } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 156 /* Parameter */ && right.kind === 242 /* VariableDeclaration */) || - (left.kind === 242 /* VariableDeclaration */ && right.kind === 156 /* Parameter */)) { + if ((left.kind === 157 /* Parameter */ && right.kind === 243 /* VariableDeclaration */) || + (left.kind === 243 /* VariableDeclaration */ && right.kind === 157 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -63048,7 +63445,7 @@ var ts; var type = checkTruthinessExpression(node.expression); checkTestingKnownTruthyCallableType(node.expression, node.thenStatement, type); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 224 /* EmptyStatement */) { + if (node.thenStatement.kind === 225 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -63119,12 +63516,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 243 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 244 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 243 /* VariableDeclarationList */) { + if (node.initializer.kind === 244 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -63158,14 +63555,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 243 /* VariableDeclarationList */) { + if (node.initializer.kind === 244 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier); // There may be a destructuring assignment on the left side - if (varExpr.kind === 192 /* ArrayLiteralExpression */ || varExpr.kind === 193 /* ObjectLiteralExpression */) { + if (varExpr.kind === 193 /* ArrayLiteralExpression */ || varExpr.kind === 194 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -63197,7 +63594,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 243 /* VariableDeclarationList */) { + if (node.initializer.kind === 244 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -63211,7 +63608,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 192 /* ArrayLiteralExpression */ || varExpr.kind === 193 /* ObjectLiteralExpression */) { + if (varExpr.kind === 193 /* ArrayLiteralExpression */ || varExpr.kind === 194 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -63224,7 +63621,7 @@ var ts; } // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { + if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 193200128 /* InstantiableNonPrimitive */)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, typeToString(rightType)); } checkSourceElement(node.statement); @@ -63862,7 +64259,7 @@ var ts; var isGenerator = !!(functionFlags & 1 /* Generator */); var isAsync = !!(functionFlags & 2 /* Async */); return isGenerator ? getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, isAsync) || errorType : - isAsync ? getPromisedTypeOfPromise(returnType) || errorType : + isAsync ? unwrapAwaitedType(getAwaitedType(returnType) || errorType) : returnType; } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { @@ -63884,12 +64281,12 @@ var ts; var functionFlags = ts.getFunctionFlags(func); if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 164 /* SetAccessor */) { + if (func.kind === 165 /* SetAccessor */) { if (node.expression) { error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 162 /* Constructor */) { + else if (func.kind === 163 /* Constructor */) { if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -63897,7 +64294,7 @@ var ts; else if (getReturnTypeFromAnnotation(func)) { var unwrappedReturnType = unwrapReturnType(returnType, functionFlags); var unwrappedExprType = functionFlags & 2 /* Async */ - ? checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) + ? unwrapAwaitedType(checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)) : exprType; if (unwrappedReturnType) { // If the function has a return type, but promisedType is @@ -63907,7 +64304,7 @@ var ts; } } } - else if (func.kind !== 162 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 163 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { // The function has a return type, but the return statement doesn't have an expression. error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } @@ -63936,7 +64333,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 278 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 279 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -63945,7 +64342,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 277 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 278 /* CaseClause */) { // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable // to or from the type of the 'switch' expression. @@ -63977,7 +64374,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 238 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 239 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label)); return true; } @@ -64084,8 +64481,8 @@ var ts; // this allows us to rule out cases when both property and indexer are inherited from the base class var errorNode; if (propDeclaration && name && - (propDeclaration.kind === 209 /* BinaryExpression */ || - name.kind === 154 /* ComputedPropertyName */ || + (propDeclaration.kind === 210 /* BinaryExpression */ || + name.kind === 155 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -64162,7 +64559,7 @@ var ts; function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 169 /* TypeReference */) { + if (node.kind === 170 /* TypeReference */) { var type = getTypeFromTypeReference(node); if (type.flags & 262144 /* TypeParameter */) { for (var i = index; i < typeParameters.length; i++) { @@ -64408,7 +64805,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 245 /* ClassDeclaration */ || d.kind === 246 /* InterfaceDeclaration */; + return d.kind === 246 /* ClassDeclaration */ || d.kind === 247 /* InterfaceDeclaration */; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -64463,7 +64860,7 @@ var ts; continue basePropertyCheck; } } - if (derivedClassDecl.kind === 214 /* ClassExpression */) { + if (derivedClassDecl.kind === 215 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -64485,7 +64882,7 @@ var ts; // property/accessor is overridden with property/accessor if (!compilerOptions.useDefineForClassFields || baseDeclarationFlags & 128 /* Abstract */ && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer) - || base.valueDeclaration && base.valueDeclaration.parent.kind === 246 /* InterfaceDeclaration */ + || base.valueDeclaration && base.valueDeclaration.parent.kind === 247 /* InterfaceDeclaration */ || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) { // when the base property is abstract or from an interface, base/derived flags don't need to match // same when the derived property is from an assignment @@ -64500,7 +64897,7 @@ var ts; error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type)); } else { - var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 159 /* PropertyDeclaration */ && !d.initializer; }); + var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 160 /* PropertyDeclaration */ && !d.initializer; }); if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 128 /* Abstract */) @@ -64597,7 +64994,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 159 /* PropertyDeclaration */ && + return node.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(node, 32 /* Static */ | 128 /* Abstract */) && !node.exclamationToken && !node.initializer; @@ -64621,7 +65018,7 @@ var ts; var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 246 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 247 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -64727,7 +65124,7 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: var value_2 = evaluate(expr.operand); if (typeof value_2 === "number") { switch (expr.operator) { @@ -64737,7 +65134,7 @@ var ts; } } break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -64766,7 +65163,7 @@ var ts; case 8 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return evaluate(expr.expression); case 75 /* Identifier */: var identifier = expr; @@ -64774,14 +65171,14 @@ var ts; return +(identifier.escapedText); } return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText); - case 195 /* ElementAccessExpression */: - case 194 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384 /* Enum */) { var name = void 0; - if (ex.kind === 194 /* PropertyAccessExpression */) { + if (ex.kind === 195 /* PropertyAccessExpression */) { name = ex.name.escapedText; } else { @@ -64811,8 +65208,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 75 /* Identifier */ || - node.kind === 194 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || - node.kind === 195 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && + node.kind === 195 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || + node.kind === 196 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && ts.isStringLiteralLike(node.argumentExpression); } function checkEnumDeclaration(node) { @@ -64848,7 +65245,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 248 /* EnumDeclaration */) { + if (declaration.kind !== 249 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -64876,8 +65273,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { var declaration = declarations_8[_i]; - if ((declaration.kind === 245 /* ClassDeclaration */ || - (declaration.kind === 244 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 246 /* ClassDeclaration */ || + (declaration.kind === 245 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 8388608 /* Ambient */)) { return declaration; } @@ -64940,7 +65337,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 245 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 246 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -64990,23 +65387,23 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 259 /* ExportAssignment */: - case 260 /* ExportDeclaration */: + case 260 /* ExportAssignment */: + case 261 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 253 /* ImportEqualsDeclaration */: - case 254 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 191 /* BindingElement */: - case 242 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 243 /* VariableDeclaration */: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -65017,12 +65414,12 @@ var ts; break; } // falls through - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 244 /* FunctionDeclaration */: - case 246 /* InterfaceDeclaration */: - case 249 /* ModuleDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 245 /* FunctionDeclaration */: + case 247 /* InterfaceDeclaration */: + case 250 /* ModuleDeclaration */: + case 248 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -65045,12 +65442,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: do { node = node.left; } while (node.kind !== 75 /* Identifier */); return node; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: do { if (ts.isModuleExportsAccessExpression(node.expression) && !ts.isPrivateIdentifier(node.name)) { return node.name; @@ -65070,9 +65467,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 250 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 290 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 260 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 251 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 291 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 261 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -65107,14 +65504,14 @@ var ts; (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 263 /* ExportSpecifier */ ? + var message = node.kind === 264 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } // Don't allow to re-export something with no value side when `--isolatedModules` is set. if (compilerOptions.isolatedModules - && node.kind === 263 /* ExportSpecifier */ + && node.kind === 264 /* ExportSpecifier */ && !node.parent.parent.isTypeOnly && !(target.flags & 111551 /* Value */) && !(node.flags & 8388608 /* Ambient */)) { @@ -65142,7 +65539,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 256 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 257 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -65166,7 +65563,7 @@ var ts; if (ts.hasModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 265 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 266 /* ExternalModuleReference */) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 111551 /* Value */) { @@ -65211,10 +65608,10 @@ var ts; else if (!ts.isNamespaceExport(node.exportClause)) { checkImportBinding(node.exportClause); } - var inAmbientExternalModule = node.parent.kind === 250 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 250 /* ModuleBlock */ && + var inAmbientExternalModule = node.parent.kind === 251 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 251 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 8388608 /* Ambient */; - if (node.parent.kind !== 290 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 291 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -65232,14 +65629,14 @@ var ts; } function checkGrammarExportDeclaration(node) { var _a; - var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 261 /* NamedExports */; + var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 262 /* NamedExports */; if (isTypeOnlyExportStar) { grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type); } return !isTypeOnlyExportStar; } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 290 /* SourceFile */ || node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 249 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 291 /* SourceFile */ || node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 250 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -65295,8 +65692,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 290 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 249 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 291 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 250 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -65410,165 +65807,165 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 249 /* ModuleDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 244 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 245 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } - if (kind >= 225 /* FirstStatement */ && kind <= 241 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { + if (kind >= 226 /* FirstStatement */ && kind <= 242 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, ts.Diagnostics.Unreachable_code_detected); } switch (kind) { - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return checkTypeParameter(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return checkParameter(node); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return checkPropertyDeclaration(node); - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: return checkPropertySignature(node); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: return checkSignatureDeclaration(node); - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: return checkMethodDeclaration(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return checkConstructorDeclaration(node); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return checkAccessorDeclaration(node); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return checkTypeReferenceNode(node); - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return checkTypePredicate(node); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return checkTypeQuery(node); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return checkTypeLiteral(node); - case 174 /* ArrayType */: + case 175 /* ArrayType */: return checkArrayType(node); - case 175 /* TupleType */: + case 176 /* TupleType */: return checkTupleType(node); - case 178 /* UnionType */: - case 179 /* IntersectionType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 182 /* ParenthesizedType */: - case 176 /* OptionalType */: - case 177 /* RestType */: + case 183 /* ParenthesizedType */: + case 177 /* OptionalType */: + case 178 /* RestType */: return checkSourceElement(node.type); - case 183 /* ThisType */: + case 184 /* ThisType */: return checkThisType(node); - case 184 /* TypeOperator */: + case 185 /* TypeOperator */: return checkTypeOperator(node); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return checkConditionalType(node); - case 181 /* InferType */: + case 182 /* InferType */: return checkInferType(node); - case 188 /* ImportType */: + case 189 /* ImportType */: return checkImportType(node); - case 307 /* JSDocAugmentsTag */: + case 308 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 308 /* JSDocImplementsTag */: + case 309 /* JSDocImplementsTag */: return checkJSDocImplementsTag(node); - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: return checkJSDocTypeAliasTag(node); - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return checkJSDocTemplateTag(node); - case 320 /* JSDocTypeTag */: + case 321 /* JSDocTypeTag */: return checkJSDocTypeTag(node); - case 317 /* JSDocParameterTag */: + case 318 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: checkJSDocFunctionType(node); // falls through - case 298 /* JSDocNonNullableType */: - case 297 /* JSDocNullableType */: - case 295 /* JSDocAllType */: - case 296 /* JSDocUnknownType */: - case 304 /* JSDocTypeLiteral */: + case 299 /* JSDocNonNullableType */: + case 298 /* JSDocNullableType */: + case 296 /* JSDocAllType */: + case 297 /* JSDocUnknownType */: + case 305 /* JSDocTypeLiteral */: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 301 /* JSDocVariadicType */: + case 302 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 294 /* JSDocTypeExpression */: + case 295 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 186 /* MappedType */: + case 187 /* MappedType */: return checkMappedType(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 223 /* Block */: - case 250 /* ModuleBlock */: + case 224 /* Block */: + case 251 /* ModuleBlock */: return checkBlock(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return checkVariableStatement(node); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return checkExpressionStatement(node); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return checkIfStatement(node); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return checkDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return checkWhileStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return checkForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return checkForInStatement(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return checkForOfStatement(node); - case 233 /* ContinueStatement */: - case 234 /* BreakStatement */: + case 234 /* ContinueStatement */: + case 235 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return checkReturnStatement(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return checkWithStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return checkSwitchStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return checkLabeledStatement(node); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return checkThrowStatement(node); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return checkTryStatement(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return checkBindingElement(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return checkClassDeclaration(node); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return checkImportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return checkExportDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return checkExportAssignment(node); - case 224 /* EmptyStatement */: - case 241 /* DebuggerStatement */: + case 225 /* EmptyStatement */: + case 242 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 264 /* MissingDeclaration */: + case 265 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -65663,33 +66060,33 @@ var ts; currentNode = node; instantiationCount = 0; switch (node.kind) { - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 198 /* TaggedTemplateExpression */: - case 157 /* Decorator */: - case 268 /* JsxOpeningElement */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 199 /* TaggedTemplateExpression */: + case 158 /* Decorator */: + case 269 /* JsxOpeningElement */: // These node kinds are deferred checked when overload resolution fails // To save on work, we ensure the arguments are checked just once, in // a deferred way resolveUntypedCall(node); break; - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: checkClassExpressionDeferred(node); break; - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: checkJsxSelfClosingElementDeferred(node); break; - case 266 /* JsxElement */: + case 267 /* JsxElement */: checkJsxElementDeferred(node); break; } @@ -65832,17 +66229,17 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; // falls through - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -65850,8 +66247,8 @@ var ts; // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration. // falls through - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -65860,7 +66257,7 @@ var ts; copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968 /* Type */); } break; - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -65908,16 +66305,16 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 155 /* TypeParameter */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 248 /* EnumDeclaration */: + case 156 /* TypeParameter */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: return true; - case 255 /* ImportClause */: + case 256 /* ImportClause */: return node.isTypeOnly; - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; default: return false; @@ -65925,16 +66322,16 @@ var ts; } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 153 /* QualifiedName */) { + while (node.parent.kind === 154 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 169 /* TypeReference */; + return node.parent.kind === 170 /* TypeReference */; } function isHeritageClauseElementIdentifier(node) { - while (node.parent.kind === 194 /* PropertyAccessExpression */) { + while (node.parent.kind === 195 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent.kind === 216 /* ExpressionWithTypeArguments */; + return node.parent.kind === 217 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -65962,13 +66359,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 153 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 154 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 253 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 254 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } - if (nodeOnRightSide.parent.kind === 259 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 260 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } return undefined; @@ -65994,7 +66391,7 @@ var ts; node = parent; parent = parent.parent; } - if (parent && parent.kind === 188 /* ImportType */ && parent.qualifier === node) { + if (parent && parent.kind === 189 /* ImportType */ && parent.qualifier === node) { return parent; } return undefined; @@ -66004,7 +66401,7 @@ var ts; return getSymbolOfNode(name.parent); } if (ts.isInJSFile(name) && - name.parent.kind === 194 /* PropertyAccessExpression */ && + name.parent.kind === 195 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { // Check if this is a special property assignment if (!ts.isPrivateIdentifier(name)) { @@ -66014,7 +66411,7 @@ var ts; } } } - if (name.parent.kind === 259 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { + if (name.parent.kind === 260 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { // Even an entity name expression that doesn't resolve as an entityname may still typecheck as a property access expression var success = resolveEntityName(name, /*all meanings*/ 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*ignoreErrors*/ true); @@ -66024,7 +66421,7 @@ var ts; } else if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name) && isInRightSideOfImportOrExportAssignment(name)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(name, 253 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(name, 254 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(name, /*dontResolveAlias*/ true); } @@ -66042,7 +66439,7 @@ var ts; if (isHeritageClauseElementIdentifier(name)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (name.parent.kind === 216 /* ExpressionWithTypeArguments */) { + if (name.parent.kind === 217 /* ExpressionWithTypeArguments */) { meaning = 788968 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { @@ -66058,10 +66455,10 @@ var ts; return entityNameSymbol; } } - if (name.parent.kind === 317 /* JSDocParameterTag */) { + if (name.parent.kind === 318 /* JSDocParameterTag */) { return ts.getParameterSymbolFromJSDoc(name.parent); } - if (name.parent.kind === 155 /* TypeParameter */ && name.parent.parent.kind === 321 /* JSDocTemplateTag */) { + if (name.parent.kind === 156 /* TypeParameter */ && name.parent.parent.kind === 322 /* JSDocTemplateTag */) { ts.Debug.assert(!ts.isInJSFile(name)); // Otherwise `isDeclarationName` would have been true. var typeParameter = ts.getTypeParameterFromJsDoc(name.parent); return typeParameter && typeParameter.symbol; @@ -66078,12 +66475,12 @@ var ts; } return resolveEntityName(name, 111551 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (name.kind === 194 /* PropertyAccessExpression */ || name.kind === 153 /* QualifiedName */) { + else if (name.kind === 195 /* PropertyAccessExpression */ || name.kind === 154 /* QualifiedName */) { var links = getNodeLinks(name); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (name.kind === 194 /* PropertyAccessExpression */) { + if (name.kind === 195 /* PropertyAccessExpression */) { checkPropertyAccessExpression(name); } else { @@ -66093,17 +66490,17 @@ var ts; } } else if (isTypeReferenceIdentifier(name)) { - var meaning = name.parent.kind === 169 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; + var meaning = name.parent.kind === 170 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - if (name.parent.kind === 168 /* TypePredicate */) { + if (name.parent.kind === 169 /* TypePredicate */) { return resolveEntityName(name, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node, ignoreErrors) { - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } var parent = node.parent; @@ -66126,8 +66523,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); } - else if (parent.kind === 191 /* BindingElement */ && - grandParent.kind === 189 /* ObjectBindingPattern */ && + else if (parent.kind === 192 /* BindingElement */ && + grandParent.kind === 190 /* ObjectBindingPattern */ && node === parent.propertyName) { var typeOfPattern = getTypeOfNode(grandParent); var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); @@ -66139,8 +66536,8 @@ var ts; switch (node.kind) { case 75 /* Identifier */: case 76 /* PrivateIdentifier */: - case 194 /* PropertyAccessExpression */: - case 153 /* QualifiedName */: + case 195 /* PropertyAccessExpression */: + case 154 /* QualifiedName */: return getSymbolOfNameOrPropertyAccessExpression(node); case 104 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -66154,14 +66551,14 @@ var ts; return checkExpression(node).symbol; } // falls through - case 183 /* ThisType */: + case 184 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 102 /* SuperKeyword */: return checkExpression(node).symbol; - case 129 /* ConstructorKeyword */: + case 130 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 162 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 163 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -66172,7 +66569,7 @@ var ts; // 3). Dynamic import call or require in javascript // 4). type A = import("./f/*gotToDefinitionHere*/oo") if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 254 /* ImportDeclaration */ || node.parent.kind === 260 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 255 /* ImportDeclaration */ || node.parent.kind === 261 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || ((ts.isInJSFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteralLike*/ false)) || ts.isImportCall(node.parent)) || (ts.isLiteralTypeNode(node.parent) && ts.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent)) { return resolveExternalModuleName(node, node, ignoreErrors); @@ -66194,7 +66591,7 @@ var ts; case 38 /* EqualsGreaterThanToken */: case 80 /* ClassKeyword */: return getSymbolOfNode(node.parent); - case 188 /* ImportType */: + case 189 /* ImportType */: return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : undefined; case 89 /* ExportKeyword */: return ts.isExportAssignment(node.parent) ? ts.Debug.checkDefined(node.parent.symbol) : undefined; @@ -66203,7 +66600,7 @@ var ts; } } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 282 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 283 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */); } return undefined; @@ -66274,23 +66671,23 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfAssignmentPattern(expr) { - ts.Debug.assert(expr.kind === 193 /* ObjectLiteralExpression */ || expr.kind === 192 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 194 /* ObjectLiteralExpression */ || expr.kind === 193 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 232 /* ForOfStatement */) { + if (expr.parent.kind === 233 /* ForOfStatement */) { var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 209 /* BinaryExpression */) { + if (expr.parent.kind === 210 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 281 /* PropertyAssignment */) { + if (expr.parent.kind === 282 /* PropertyAssignment */) { var node_4 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression); var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_4) || errorType; var propertyIndex = ts.indexOfNode(node_4.properties, expr.parent); @@ -66338,7 +66735,7 @@ var ts; case 8 /* NumericLiteral */: case 10 /* StringLiteral */: return getLiteralType(name.text); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType; default: @@ -66394,7 +66791,7 @@ var ts; if (!ts.isGeneratedIdentifier(nodeIn)) { var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier); if (node) { - var isPropertyName_1 = node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node; + var isPropertyName_1 = node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node; return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } @@ -66450,7 +66847,7 @@ var ts; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 290 /* SourceFile */) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 291 /* SourceFile */) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. @@ -66478,7 +66875,7 @@ var ts; } function isSymbolOfDestructuredElementOfCatchBinding(symbol) { return ts.isBindingElement(symbol.valueDeclaration) - && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 280 /* CatchClause */; + && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 281 /* CatchClause */; } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 /* BlockScoped */ && !ts.isSourceFile(symbol.valueDeclaration)) { @@ -66509,7 +66906,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 524288 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 223 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 224 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -66550,19 +66947,19 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 255 /* ImportClause */: - case 256 /* NamespaceImport */: - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 256 /* ImportClause */: + case 257 /* NamespaceImport */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: var symbol = getSymbolOfNode(node) || unknownSymbol; return isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: var exportClause = node.exportClause; return !!exportClause && (ts.isNamespaceExport(exportClause) || ts.some(exportClause.elements, isValueAliasDeclaration)); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return node.expression && node.expression.kind === 75 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) : true; @@ -66571,7 +66968,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 290 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 291 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -66673,15 +67070,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 284 /* EnumMember */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 285 /* EnumMember */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return true; } return false; } function getConstantValue(node) { - if (node.kind === 284 /* EnumMember */) { + if (node.kind === 285 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -66860,9 +67257,11 @@ var ts; return; } var file = host.getSourceFile(resolvedDirective.resolvedFileName); - // Add the transitive closure of path references loaded by this file (as long as they are not) - // part of an existing type reference. - addReferencedFilesToTypeDirective(file, key); + if (file) { + // Add the transitive closure of path references loaded by this file (as long as they are not) + // part of an existing type reference. + addReferencedFilesToTypeDirective(file, key); + } }); } return { @@ -66920,12 +67319,12 @@ var ts; getJsxFactoryEntity: getJsxFactoryEntity, getAllAccessorDeclarations: function (accessor) { accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration); // TODO: GH#18217 - var otherKind = accessor.kind === 164 /* SetAccessor */ ? 163 /* GetAccessor */ : 164 /* SetAccessor */; + var otherKind = accessor.kind === 165 /* SetAccessor */ ? 164 /* GetAccessor */ : 165 /* SetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind); var firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor; var secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor; - var setAccessor = accessor.kind === 164 /* SetAccessor */ ? accessor : otherAccessor; - var getAccessor = accessor.kind === 163 /* GetAccessor */ ? accessor : otherAccessor; + var setAccessor = accessor.kind === 165 /* SetAccessor */ ? accessor : otherAccessor; + var getAccessor = accessor.kind === 164 /* GetAccessor */ ? accessor : otherAccessor; return { firstAccessor: firstAccessor, secondAccessor: secondAccessor, @@ -66941,7 +67340,7 @@ var ts; }, getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) { var n = ts.getParseTreeNode(node); - ts.Debug.assert(n && n.kind === 290 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + ts.Debug.assert(n && n.kind === 291 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); var sym = getSymbolOfNode(node); if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); @@ -66950,7 +67349,7 @@ var ts; } }; function isInHeritageClause(node) { - return node.parent && node.parent.kind === 216 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 279 /* HeritageClause */; + return node.parent && node.parent.kind === 217 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 280 /* HeritageClause */; } // defined here to avoid outer scope pollution function getTypeReferenceDirectivesForEntityName(node) { @@ -66962,7 +67361,7 @@ var ts; // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries var meaning = 788968 /* Type */ | 1920 /* Namespace */; - if ((node.kind === 75 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 194 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { + if ((node.kind === 75 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 195 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -67013,7 +67412,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 290 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 291 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -67041,12 +67440,12 @@ var ts; } } function getExternalModuleFileFromDeclaration(declaration) { - var specifier = declaration.kind === 249 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); + var specifier = declaration.kind === 250 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, /*moduleNotFoundError*/ undefined); // TODO: GH#18217 if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 290 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 291 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -67238,14 +67637,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 161 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 162 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 163 /* GetAccessor */ || node.kind === 164 /* SetAccessor */) { + else if (node.kind === 164 /* GetAccessor */ || node.kind === 165 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -67262,17 +67661,17 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 138 /* ReadonlyKeyword */) { - if (node.kind === 158 /* PropertySignature */ || node.kind === 160 /* MethodSignature */) { + if (modifier.kind !== 139 /* ReadonlyKeyword */) { + if (node.kind === 159 /* PropertySignature */ || node.kind === 161 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 167 /* IndexSignature */) { + if (node.kind === 168 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 81 /* ConstKeyword */: - if (node.kind !== 248 /* EnumDeclaration */) { + if (node.kind !== 249 /* EnumDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(81 /* ConstKeyword */)); } break; @@ -67292,7 +67691,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { + else if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -67318,10 +67717,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { + else if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 156 /* Parameter */) { + else if (node.kind === 157 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -67333,11 +67732,11 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 159 /* PropertyDeclaration */ && node.kind !== 158 /* PropertySignature */ && node.kind !== 167 /* IndexSignature */ && node.kind !== 156 /* Parameter */) { + else if (node.kind !== 160 /* PropertyDeclaration */ && node.kind !== 159 /* PropertySignature */ && node.kind !== 168 /* IndexSignature */ && node.kind !== 157 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -67360,19 +67759,19 @@ var ts; else if (ts.isClassLike(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 156 /* Parameter */) { + else if (node.kind === 157 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; case 84 /* DefaultKeyword */: - var container = node.parent.kind === 290 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 249 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 291 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 250 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512 /* Default */; break; - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: if (flags & 2 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } @@ -67382,10 +67781,10 @@ var ts; else if (ts.isClassLike(node.parent) && !ts.isPropertyDeclaration(node)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 156 /* Parameter */) { + else if (node.kind === 157 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 250 /* ModuleBlock */) { + else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 251 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } else if (ts.isPrivateIdentifierPropertyDeclaration(node)) { @@ -67398,14 +67797,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 245 /* ClassDeclaration */) { - if (node.kind !== 161 /* MethodDeclaration */ && - node.kind !== 159 /* PropertyDeclaration */ && - node.kind !== 163 /* GetAccessor */ && - node.kind !== 164 /* SetAccessor */) { + if (node.kind !== 246 /* ClassDeclaration */) { + if (node.kind !== 162 /* MethodDeclaration */ && + node.kind !== 160 /* PropertyDeclaration */ && + node.kind !== 164 /* GetAccessor */ && + node.kind !== 165 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 245 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { + if (!(node.parent.kind === 246 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -67427,7 +67826,7 @@ var ts; else if (flags & 2 /* Ambient */ || node.parent.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 156 /* Parameter */) { + else if (node.kind === 157 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256 /* Async */; @@ -67435,7 +67834,7 @@ var ts; break; } } - if (node.kind === 162 /* Constructor */) { + if (node.kind === 163 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -67450,13 +67849,13 @@ var ts; } return false; } - else if ((node.kind === 254 /* ImportDeclaration */ || node.kind === 253 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 255 /* ImportDeclaration */ || node.kind === 254 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 156 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 157 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 156 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 157 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -67477,37 +67876,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 162 /* Constructor */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 167 /* IndexSignature */: - case 249 /* ModuleDeclaration */: - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 260 /* ExportDeclaration */: - case 259 /* ExportAssignment */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 156 /* Parameter */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 163 /* Constructor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 168 /* IndexSignature */: + case 250 /* ModuleDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 261 /* ExportDeclaration */: + case 260 /* ExportAssignment */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 157 /* Parameter */: return false; default: - if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { + if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { return false; } switch (node.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 126 /* AsyncKeyword */); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 122 /* AbstractKeyword */); - case 246 /* InterfaceDeclaration */: - case 225 /* VariableStatement */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 226 /* VariableStatement */: + case 248 /* TypeAliasDeclaration */: return true; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 81 /* ConstKeyword */); default: ts.Debug.fail(); @@ -67520,10 +67919,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 161 /* MethodDeclaration */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -67638,7 +68037,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 143 /* StringKeyword */ && parameter.type.kind !== 140 /* NumberKeyword */) { + if (parameter.type.kind !== 144 /* StringKeyword */ && parameter.type.kind !== 141 /* NumberKeyword */) { var type = getTypeFromTypeNode(parameter.type); if (type.flags & 4 /* String */ || type.flags & 8 /* Number */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType)); @@ -67680,7 +68079,7 @@ var ts; if (args) { for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 215 /* OmittedExpression */) { + if (arg.kind === 216 /* OmittedExpression */) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -67757,20 +68156,20 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 154 /* ComputedPropertyName */) { + if (node.kind !== 155 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 209 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { + if (computedPropertyName.expression.kind === 210 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } return false; } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 244 /* FunctionDeclaration */ || - node.kind === 201 /* FunctionExpression */ || - node.kind === 161 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 245 /* FunctionDeclaration */ || + node.kind === 202 /* FunctionExpression */ || + node.kind === 162 /* MethodDeclaration */); if (node.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -67789,7 +68188,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 283 /* SpreadAssignment */) { + if (prop.kind === 284 /* SpreadAssignment */) { if (inDestructuring) { // a rest property cannot be destructured any further var expression = ts.skipParentheses(prop.expression); @@ -67800,11 +68199,11 @@ var ts; continue; } var name = prop.name; - if (name.kind === 154 /* ComputedPropertyName */) { + if (name.kind === 155 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name); } - if (prop.kind === 282 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 283 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); @@ -67817,7 +68216,7 @@ var ts; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { // TODO: GH#19955 var mod = _c[_b]; - if (mod.kind !== 126 /* AsyncKeyword */ || prop.kind !== 161 /* MethodDeclaration */) { + if (mod.kind !== 126 /* AsyncKeyword */ || prop.kind !== 162 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -67832,10 +68231,10 @@ var ts; // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; switch (prop.kind) { - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); // falls through - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8 /* NumericLiteral */) { @@ -67843,13 +68242,13 @@ var ts; } currentKind = 4 /* PropertyAssignment */; break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: currentKind = 8 /* Method */; break; - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: currentKind = 1 /* GetAccessor */; break; - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: currentKind = 2 /* SetAccessor */; break; default: @@ -67888,7 +68287,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 275 /* JsxSpreadAttribute */) { + if (attr.kind === 276 /* JsxSpreadAttribute */) { continue; } var name = attr.name, initializer = attr.initializer; @@ -67898,7 +68297,7 @@ var ts; else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 276 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 277 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -67912,14 +68311,14 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 232 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 233 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 32768 /* AwaitContext */) === 0 /* None */) { // use of 'for-await-of' in non-async function var sourceFile = ts.getSourceFileOfNode(forInOrOfStatement); if (!hasParseDiagnostics(sourceFile)) { var diagnostic = ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); var func = ts.getContainingFunction(forInOrOfStatement); - if (func && func.kind !== 162 /* Constructor */) { + if (func && func.kind !== 163 /* Constructor */) { ts.Debug.assert((ts.getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function."); var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); @@ -67930,7 +68329,7 @@ var ts; return false; } } - if (forInOrOfStatement.initializer.kind === 243 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 244 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -67945,20 +68344,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 232 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 232 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 232 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -67983,11 +68382,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, accessor.kind === 163 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, accessor.kind === 164 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - if (accessor.kind === 164 /* SetAccessor */) { + if (accessor.kind === 165 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -68009,21 +68408,21 @@ var ts; * A set accessor has one parameter or a `this` parameter and one more parameter. */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 163 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 164 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 163 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 164 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 147 /* UniqueKeyword */) { - if (node.type.kind !== 144 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(144 /* SymbolKeyword */)); + if (node.operator === 148 /* UniqueKeyword */) { + if (node.type.kind !== 145 /* SymbolKeyword */) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(145 /* SymbolKeyword */)); } var parent = ts.walkUpParenthesizedTypes(node.parent); switch (parent.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: var decl = parent; if (decl.name.kind !== 75 /* Identifier */) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -68035,13 +68434,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: if (!ts.hasModifier(parent, 32 /* Static */) || !ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: if (!ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -68050,9 +68449,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_not_allowed_here); } } - else if (node.operator === 138 /* ReadonlyKeyword */) { - if (node.type.kind !== 174 /* ArrayType */ && node.type.kind !== 175 /* TupleType */) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(144 /* SymbolKeyword */)); + else if (node.operator === 139 /* ReadonlyKeyword */) { + if (node.type.kind !== 175 /* ArrayType */ && node.type.kind !== 176 /* TupleType */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(145 /* SymbolKeyword */)); } } } @@ -68065,8 +68464,8 @@ var ts; if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 161 /* MethodDeclaration */) { - if (node.parent.kind === 193 /* ObjectLiteralExpression */) { + if (node.kind === 162 /* MethodDeclaration */) { + if (node.parent.kind === 194 /* ObjectLiteralExpression */) { // We only disallow modifier on a method declaration if it is a property of object-literal-expression if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 126 /* AsyncKeyword */)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -68094,14 +68493,14 @@ var ts; if (node.flags & 8388608 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.kind === 161 /* MethodDeclaration */ && !node.body) { + else if (node.kind === 162 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 246 /* InterfaceDeclaration */) { + else if (node.parent.kind === 247 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 173 /* TypeLiteral */) { + else if (node.parent.kind === 174 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -68112,11 +68511,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 233 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 234 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -68124,8 +68523,8 @@ var ts; return false; } break; - case 237 /* SwitchStatement */: - if (node.kind === 234 /* BreakStatement */ && !node.label) { + case 238 /* SwitchStatement */: + if (node.kind === 235 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -68140,13 +68539,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 234 /* BreakStatement */ + var message = node.kind === 235 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 234 /* BreakStatement */ + var message = node.kind === 235 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -68170,12 +68569,12 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return ts.isStringOrNumericLiteralLike(expr) || - expr.kind === 207 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 208 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function isBigIntLiteralExpression(expr) { return expr.kind === 9 /* BigIntLiteral */ || - expr.kind === 207 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 208 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */; } function isSimpleLiteralEnumReference(expr) { @@ -68206,7 +68605,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 231 /* ForInStatement */ && node.parent.parent.kind !== 232 /* ForOfStatement */) { + if (node.parent.parent.kind !== 232 /* ForInStatement */ && node.parent.parent.kind !== 233 /* ForOfStatement */) { if (node.flags & 8388608 /* Ambient */) { checkAmbientInitializer(node); } @@ -68219,7 +68618,7 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 225 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { + if (node.exclamationToken && (node.parent.parent.kind !== 226 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation); } var moduleKind = ts.getEmitModuleKind(compilerOptions); @@ -68282,15 +68681,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 227 /* IfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 236 /* WithStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 228 /* IfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 237 /* WithStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: return false; - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -68374,7 +68773,7 @@ var ts; return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } } - else if (node.parent.kind === 246 /* InterfaceDeclaration */) { + else if (node.parent.kind === 247 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -68382,7 +68781,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 173 /* TypeLiteral */) { + else if (node.parent.kind === 174 /* TypeLiteral */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -68411,13 +68810,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 246 /* InterfaceDeclaration */ || - node.kind === 247 /* TypeAliasDeclaration */ || - node.kind === 254 /* ImportDeclaration */ || - node.kind === 253 /* ImportEqualsDeclaration */ || - node.kind === 260 /* ExportDeclaration */ || - node.kind === 259 /* ExportAssignment */ || - node.kind === 252 /* NamespaceExportDeclaration */ || + if (node.kind === 247 /* InterfaceDeclaration */ || + node.kind === 248 /* TypeAliasDeclaration */ || + node.kind === 255 /* ImportDeclaration */ || + node.kind === 254 /* ImportEqualsDeclaration */ || + node.kind === 261 /* ExportDeclaration */ || + node.kind === 260 /* ExportAssignment */ || + node.kind === 253 /* NamespaceExportDeclaration */ || ts.hasModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -68426,7 +68825,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 225 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 226 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -68449,7 +68848,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 223 /* Block */ || node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { + if (node.parent.kind === 224 /* Block */ || node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { var links_2 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_2.hasReportedStatementInAmbientContext) { @@ -68471,10 +68870,10 @@ var ts; if (languageVersion >= 1 /* ES5 */) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 187 /* LiteralType */)) { + else if (ts.isChildOfNodeWithKind(node, 188 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 284 /* EnumMember */)) { + else if (ts.isChildOfNodeWithKind(node, 285 /* EnumMember */)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -68649,14 +69048,14 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 244 /* FunctionDeclaration */ && declaration.kind !== 161 /* MethodDeclaration */) || + return (declaration.kind !== 245 /* FunctionDeclaration */ && declaration.kind !== 162 /* MethodDeclaration */) || !!declaration.body; } /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */ function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return ts.isIdentifier(name); default: return ts.isDeclarationName(name); @@ -68664,14 +69063,14 @@ var ts; } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 255 /* ImportClause */: // For default import - case 253 /* ImportEqualsDeclaration */: - case 256 /* NamespaceImport */: - case 258 /* ImportSpecifier */: // For rename import `x as y` + case 256 /* ImportClause */: // For default import + case 254 /* ImportEqualsDeclaration */: + case 257 /* NamespaceImport */: + case 259 /* ImportSpecifier */: // For rename import `x as y` return true; case 75 /* Identifier */: // For regular import, `decl` is an Identifier under the ImportSpecifier. - return decl.parent.kind === 258 /* ImportSpecifier */; + return decl.parent.kind === 259 /* ImportSpecifier */; default: return false; } @@ -68934,7 +69333,7 @@ var ts; result.push(createModifier(89 /* ExportKeyword */)); } if (flags & 2 /* Ambient */) { - result.push(createModifier(130 /* DeclareKeyword */)); + result.push(createModifier(131 /* DeclareKeyword */)); } if (flags & 512 /* Default */) { result.push(createModifier(84 /* DefaultKeyword */)); @@ -68958,7 +69357,7 @@ var ts; result.push(createModifier(120 /* StaticKeyword */)); } if (flags & 64 /* Readonly */) { - result.push(createModifier(138 /* ReadonlyKeyword */)); + result.push(createModifier(139 /* ReadonlyKeyword */)); } if (flags & 256 /* Async */) { result.push(createModifier(126 /* AsyncKeyword */)); @@ -68968,7 +69367,7 @@ var ts; ts.createModifiersFromModifierFlags = createModifiersFromModifierFlags; // Names function createQualifiedName(left, right) { - var node = createSynthesizedNode(153 /* QualifiedName */); + var node = createSynthesizedNode(154 /* QualifiedName */); node.left = left; node.right = asName(right); return node; @@ -68987,7 +69386,7 @@ var ts; : expression; } function createComputedPropertyName(expression) { - var node = createSynthesizedNode(154 /* ComputedPropertyName */); + var node = createSynthesizedNode(155 /* ComputedPropertyName */); node.expression = parenthesizeForComputedName(expression); return node; } @@ -69000,7 +69399,7 @@ var ts; ts.updateComputedPropertyName = updateComputedPropertyName; // Signature elements function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createSynthesizedNode(155 /* TypeParameter */); + var node = createSynthesizedNode(156 /* TypeParameter */); node.name = asName(name); node.constraint = constraint; node.default = defaultType; @@ -69016,7 +69415,7 @@ var ts; } ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createSynthesizedNode(156 /* Parameter */); + var node = createSynthesizedNode(157 /* Parameter */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; @@ -69040,7 +69439,7 @@ var ts; } ts.updateParameter = updateParameter; function createDecorator(expression) { - var node = createSynthesizedNode(157 /* Decorator */); + var node = createSynthesizedNode(158 /* Decorator */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -69053,7 +69452,7 @@ var ts; ts.updateDecorator = updateDecorator; // Type Elements function createPropertySignature(modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(158 /* PropertySignature */); + var node = createSynthesizedNode(159 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -69073,7 +69472,7 @@ var ts; } ts.updatePropertySignature = updatePropertySignature; function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - var node = createSynthesizedNode(159 /* PropertyDeclaration */); + var node = createSynthesizedNode(160 /* PropertyDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69097,7 +69496,7 @@ var ts; } ts.updateProperty = updateProperty; function createMethodSignature(typeParameters, parameters, type, name, questionToken) { - var node = createSignatureDeclaration(160 /* MethodSignature */, typeParameters, parameters, type); + var node = createSignatureDeclaration(161 /* MethodSignature */, typeParameters, parameters, type); node.name = asName(name); node.questionToken = questionToken; return node; @@ -69114,7 +69513,7 @@ var ts; } ts.updateMethodSignature = updateMethodSignature; function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(161 /* MethodDeclaration */); + var node = createSynthesizedNode(162 /* MethodDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -69174,7 +69573,7 @@ var ts; } ts.updateMethod = updateMethod; function createConstructor(decorators, modifiers, parameters, body) { - var node = createSynthesizedNode(162 /* Constructor */); + var node = createSynthesizedNode(163 /* Constructor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; @@ -69194,7 +69593,7 @@ var ts; } ts.updateConstructor = updateConstructor; function createGetAccessor(decorators, modifiers, name, parameters, type, body) { - var node = createSynthesizedNode(163 /* GetAccessor */); + var node = createSynthesizedNode(164 /* GetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69217,7 +69616,7 @@ var ts; } ts.updateGetAccessor = updateGetAccessor; function createSetAccessor(decorators, modifiers, name, parameters, body) { - var node = createSynthesizedNode(164 /* SetAccessor */); + var node = createSynthesizedNode(165 /* SetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69238,7 +69637,7 @@ var ts; } ts.updateSetAccessor = updateSetAccessor; function createCallSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(165 /* CallSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(166 /* CallSignature */, typeParameters, parameters, type); } ts.createCallSignature = createCallSignature; function updateCallSignature(node, typeParameters, parameters, type) { @@ -69246,7 +69645,7 @@ var ts; } ts.updateCallSignature = updateCallSignature; function createConstructSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(166 /* ConstructSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(167 /* ConstructSignature */, typeParameters, parameters, type); } ts.createConstructSignature = createConstructSignature; function updateConstructSignature(node, typeParameters, parameters, type) { @@ -69254,7 +69653,7 @@ var ts; } ts.updateConstructSignature = updateConstructSignature; function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createSynthesizedNode(167 /* IndexSignature */); + var node = createSynthesizedNode(168 /* IndexSignature */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); @@ -69298,7 +69697,7 @@ var ts; } ts.createTypePredicateNode = createTypePredicateNode; function createTypePredicateNodeWithModifier(assertsModifier, parameterName, type) { - var node = createSynthesizedNode(168 /* TypePredicate */); + var node = createSynthesizedNode(169 /* TypePredicate */); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); node.type = type; @@ -69318,7 +69717,7 @@ var ts; } ts.updateTypePredicateNodeWithModifier = updateTypePredicateNodeWithModifier; function createTypeReferenceNode(typeName, typeArguments) { - var node = createSynthesizedNode(169 /* TypeReference */); + var node = createSynthesizedNode(170 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments); return node; @@ -69332,7 +69731,7 @@ var ts; } ts.updateTypeReferenceNode = updateTypeReferenceNode; function createFunctionTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(170 /* FunctionType */, typeParameters, parameters, type); + return createSignatureDeclaration(171 /* FunctionType */, typeParameters, parameters, type); } ts.createFunctionTypeNode = createFunctionTypeNode; function updateFunctionTypeNode(node, typeParameters, parameters, type) { @@ -69340,7 +69739,7 @@ var ts; } ts.updateFunctionTypeNode = updateFunctionTypeNode; function createConstructorTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(171 /* ConstructorType */, typeParameters, parameters, type); + return createSignatureDeclaration(172 /* ConstructorType */, typeParameters, parameters, type); } ts.createConstructorTypeNode = createConstructorTypeNode; function updateConstructorTypeNode(node, typeParameters, parameters, type) { @@ -69348,7 +69747,7 @@ var ts; } ts.updateConstructorTypeNode = updateConstructorTypeNode; function createTypeQueryNode(exprName) { - var node = createSynthesizedNode(172 /* TypeQuery */); + var node = createSynthesizedNode(173 /* TypeQuery */); node.exprName = exprName; return node; } @@ -69360,7 +69759,7 @@ var ts; } ts.updateTypeQueryNode = updateTypeQueryNode; function createTypeLiteralNode(members) { - var node = createSynthesizedNode(173 /* TypeLiteral */); + var node = createSynthesizedNode(174 /* TypeLiteral */); node.members = createNodeArray(members); return node; } @@ -69372,7 +69771,7 @@ var ts; } ts.updateTypeLiteralNode = updateTypeLiteralNode; function createArrayTypeNode(elementType) { - var node = createSynthesizedNode(174 /* ArrayType */); + var node = createSynthesizedNode(175 /* ArrayType */); node.elementType = ts.parenthesizeArrayTypeMember(elementType); return node; } @@ -69384,7 +69783,7 @@ var ts; } ts.updateArrayTypeNode = updateArrayTypeNode; function createTupleTypeNode(elementTypes) { - var node = createSynthesizedNode(175 /* TupleType */); + var node = createSynthesizedNode(176 /* TupleType */); node.elementTypes = createNodeArray(elementTypes); return node; } @@ -69396,7 +69795,7 @@ var ts; } ts.updateTupleTypeNode = updateTupleTypeNode; function createOptionalTypeNode(type) { - var node = createSynthesizedNode(176 /* OptionalType */); + var node = createSynthesizedNode(177 /* OptionalType */); node.type = ts.parenthesizeArrayTypeMember(type); return node; } @@ -69408,7 +69807,7 @@ var ts; } ts.updateOptionalTypeNode = updateOptionalTypeNode; function createRestTypeNode(type) { - var node = createSynthesizedNode(177 /* RestType */); + var node = createSynthesizedNode(178 /* RestType */); node.type = type; return node; } @@ -69420,7 +69819,7 @@ var ts; } ts.updateRestTypeNode = updateRestTypeNode; function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(178 /* UnionType */, types); + return createUnionOrIntersectionTypeNode(179 /* UnionType */, types); } ts.createUnionTypeNode = createUnionTypeNode; function updateUnionTypeNode(node, types) { @@ -69428,7 +69827,7 @@ var ts; } ts.updateUnionTypeNode = updateUnionTypeNode; function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(179 /* IntersectionType */, types); + return createUnionOrIntersectionTypeNode(180 /* IntersectionType */, types); } ts.createIntersectionTypeNode = createIntersectionTypeNode; function updateIntersectionTypeNode(node, types) { @@ -69447,7 +69846,7 @@ var ts; : node; } function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - var node = createSynthesizedNode(180 /* ConditionalType */); + var node = createSynthesizedNode(181 /* ConditionalType */); node.checkType = ts.parenthesizeConditionalTypeMember(checkType); node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType); node.trueType = trueType; @@ -69465,7 +69864,7 @@ var ts; } ts.updateConditionalTypeNode = updateConditionalTypeNode; function createInferTypeNode(typeParameter) { - var node = createSynthesizedNode(181 /* InferType */); + var node = createSynthesizedNode(182 /* InferType */); node.typeParameter = typeParameter; return node; } @@ -69477,7 +69876,7 @@ var ts; } ts.updateInferTypeNode = updateInferTypeNode; function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) { - var node = createSynthesizedNode(188 /* ImportType */); + var node = createSynthesizedNode(189 /* ImportType */); node.argument = argument; node.qualifier = qualifier; node.typeArguments = ts.parenthesizeTypeParameters(typeArguments); @@ -69495,7 +69894,7 @@ var ts; } ts.updateImportTypeNode = updateImportTypeNode; function createParenthesizedType(type) { - var node = createSynthesizedNode(182 /* ParenthesizedType */); + var node = createSynthesizedNode(183 /* ParenthesizedType */); node.type = type; return node; } @@ -69507,12 +69906,12 @@ var ts; } ts.updateParenthesizedType = updateParenthesizedType; function createThisTypeNode() { - return createSynthesizedNode(183 /* ThisType */); + return createSynthesizedNode(184 /* ThisType */); } ts.createThisTypeNode = createThisTypeNode; function createTypeOperatorNode(operatorOrType, type) { - var node = createSynthesizedNode(184 /* TypeOperator */); - node.operator = typeof operatorOrType === "number" ? operatorOrType : 134 /* KeyOfKeyword */; + var node = createSynthesizedNode(185 /* TypeOperator */); + node.operator = typeof operatorOrType === "number" ? operatorOrType : 135 /* KeyOfKeyword */; node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); return node; } @@ -69522,7 +69921,7 @@ var ts; } ts.updateTypeOperatorNode = updateTypeOperatorNode; function createIndexedAccessTypeNode(objectType, indexType) { - var node = createSynthesizedNode(185 /* IndexedAccessType */); + var node = createSynthesizedNode(186 /* IndexedAccessType */); node.objectType = ts.parenthesizeElementTypeMember(objectType); node.indexType = indexType; return node; @@ -69536,7 +69935,7 @@ var ts; } ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { - var node = createSynthesizedNode(186 /* MappedType */); + var node = createSynthesizedNode(187 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.questionToken = questionToken; @@ -69554,7 +69953,7 @@ var ts; } ts.updateMappedTypeNode = updateMappedTypeNode; function createLiteralTypeNode(literal) { - var node = createSynthesizedNode(187 /* LiteralType */); + var node = createSynthesizedNode(188 /* LiteralType */); node.literal = literal; return node; } @@ -69567,7 +69966,7 @@ var ts; ts.updateLiteralTypeNode = updateLiteralTypeNode; // Binding Patterns function createObjectBindingPattern(elements) { - var node = createSynthesizedNode(189 /* ObjectBindingPattern */); + var node = createSynthesizedNode(190 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -69579,7 +69978,7 @@ var ts; } ts.updateObjectBindingPattern = updateObjectBindingPattern; function createArrayBindingPattern(elements) { - var node = createSynthesizedNode(190 /* ArrayBindingPattern */); + var node = createSynthesizedNode(191 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -69591,7 +69990,7 @@ var ts; } ts.updateArrayBindingPattern = updateArrayBindingPattern; function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createSynthesizedNode(191 /* BindingElement */); + var node = createSynthesizedNode(192 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -69610,7 +70009,7 @@ var ts; ts.updateBindingElement = updateBindingElement; // Expression function createArrayLiteral(elements, multiLine) { - var node = createSynthesizedNode(192 /* ArrayLiteralExpression */); + var node = createSynthesizedNode(193 /* ArrayLiteralExpression */); node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) node.multiLine = true; @@ -69624,7 +70023,7 @@ var ts; } ts.updateArrayLiteral = updateArrayLiteral; function createObjectLiteral(properties, multiLine) { - var node = createSynthesizedNode(193 /* ObjectLiteralExpression */); + var node = createSynthesizedNode(194 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); if (multiLine) node.multiLine = true; @@ -69638,7 +70037,7 @@ var ts; } ts.updateObjectLiteral = updateObjectLiteral; function createPropertyAccess(expression, name) { - var node = createSynthesizedNode(194 /* PropertyAccessExpression */); + var node = createSynthesizedNode(195 /* PropertyAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.name = asName(name); setEmitFlags(node, 131072 /* NoIndentation */); @@ -69660,7 +70059,7 @@ var ts; } ts.updatePropertyAccess = updatePropertyAccess; function createPropertyAccessChain(expression, questionDotToken, name) { - var node = createSynthesizedNode(194 /* PropertyAccessExpression */); + var node = createSynthesizedNode(195 /* PropertyAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -69681,7 +70080,7 @@ var ts; } ts.updatePropertyAccessChain = updatePropertyAccessChain; function createElementAccess(expression, index) { - var node = createSynthesizedNode(195 /* ElementAccessExpression */); + var node = createSynthesizedNode(196 /* ElementAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.argumentExpression = asExpression(index); return node; @@ -69698,7 +70097,7 @@ var ts; } ts.updateElementAccess = updateElementAccess; function createElementAccessChain(expression, questionDotToken, index) { - var node = createSynthesizedNode(195 /* ElementAccessExpression */); + var node = createSynthesizedNode(196 /* ElementAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -69716,7 +70115,7 @@ var ts; } ts.updateElementAccessChain = updateElementAccessChain; function createCall(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(196 /* CallExpression */); + var node = createSynthesizedNode(197 /* CallExpression */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); @@ -69735,7 +70134,7 @@ var ts; } ts.updateCall = updateCall; function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { - var node = createSynthesizedNode(196 /* CallExpression */); + var node = createSynthesizedNode(197 /* CallExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -69755,7 +70154,7 @@ var ts; } ts.updateCallChain = updateCallChain; function createNew(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(197 /* NewExpression */); + var node = createSynthesizedNode(198 /* NewExpression */); node.expression = ts.parenthesizeForNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; @@ -69771,7 +70170,7 @@ var ts; } ts.updateNew = updateNew; function createTaggedTemplate(tag, typeArgumentsOrTemplate, template) { - var node = createSynthesizedNode(198 /* TaggedTemplateExpression */); + var node = createSynthesizedNode(199 /* TaggedTemplateExpression */); node.tag = ts.parenthesizeForAccess(tag); if (template) { node.typeArguments = asNodeArray(typeArgumentsOrTemplate); @@ -69794,7 +70193,7 @@ var ts; } ts.updateTaggedTemplate = updateTaggedTemplate; function createTypeAssertion(type, expression) { - var node = createSynthesizedNode(199 /* TypeAssertionExpression */); + var node = createSynthesizedNode(200 /* TypeAssertionExpression */); node.type = type; node.expression = ts.parenthesizePrefixOperand(expression); return node; @@ -69808,7 +70207,7 @@ var ts; } ts.updateTypeAssertion = updateTypeAssertion; function createParen(expression) { - var node = createSynthesizedNode(200 /* ParenthesizedExpression */); + var node = createSynthesizedNode(201 /* ParenthesizedExpression */); node.expression = expression; return node; } @@ -69820,7 +70219,7 @@ var ts; } ts.updateParen = updateParen; function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(201 /* FunctionExpression */); + var node = createSynthesizedNode(202 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -69844,7 +70243,7 @@ var ts; } ts.updateFunctionExpression = updateFunctionExpression; function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createSynthesizedNode(202 /* ArrowFunction */); + var node = createSynthesizedNode(203 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -69866,7 +70265,7 @@ var ts; } ts.updateArrowFunction = updateArrowFunction; function createDelete(expression) { - var node = createSynthesizedNode(203 /* DeleteExpression */); + var node = createSynthesizedNode(204 /* DeleteExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -69878,7 +70277,7 @@ var ts; } ts.updateDelete = updateDelete; function createTypeOf(expression) { - var node = createSynthesizedNode(204 /* TypeOfExpression */); + var node = createSynthesizedNode(205 /* TypeOfExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -69890,7 +70289,7 @@ var ts; } ts.updateTypeOf = updateTypeOf; function createVoid(expression) { - var node = createSynthesizedNode(205 /* VoidExpression */); + var node = createSynthesizedNode(206 /* VoidExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -69902,7 +70301,7 @@ var ts; } ts.updateVoid = updateVoid; function createAwait(expression) { - var node = createSynthesizedNode(206 /* AwaitExpression */); + var node = createSynthesizedNode(207 /* AwaitExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -69914,7 +70313,7 @@ var ts; } ts.updateAwait = updateAwait; function createPrefix(operator, operand) { - var node = createSynthesizedNode(207 /* PrefixUnaryExpression */); + var node = createSynthesizedNode(208 /* PrefixUnaryExpression */); node.operator = operator; node.operand = ts.parenthesizePrefixOperand(operand); return node; @@ -69927,7 +70326,7 @@ var ts; } ts.updatePrefix = updatePrefix; function createPostfix(operand, operator) { - var node = createSynthesizedNode(208 /* PostfixUnaryExpression */); + var node = createSynthesizedNode(209 /* PostfixUnaryExpression */); node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; @@ -69940,7 +70339,7 @@ var ts; } ts.updatePostfix = updatePostfix; function createBinary(left, operator, right) { - var node = createSynthesizedNode(209 /* BinaryExpression */); + var node = createSynthesizedNode(210 /* BinaryExpression */); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = ts.parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); @@ -69957,7 +70356,7 @@ var ts; } ts.updateBinary = updateBinary; function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - var node = createSynthesizedNode(210 /* ConditionalExpression */); + var node = createSynthesizedNode(211 /* ConditionalExpression */); node.condition = ts.parenthesizeForConditionalHead(condition); node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(57 /* QuestionToken */); node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); @@ -69977,7 +70376,7 @@ var ts; } ts.updateConditional = updateConditional; function createTemplateExpression(head, templateSpans) { - var node = createSynthesizedNode(211 /* TemplateExpression */); + var node = createSynthesizedNode(212 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; @@ -70074,7 +70473,7 @@ var ts; } ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral; function createYield(asteriskTokenOrExpression, expression) { - var node = createSynthesizedNode(212 /* YieldExpression */); + var node = createSynthesizedNode(213 /* YieldExpression */); node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 41 /* AsteriskToken */ ? asteriskTokenOrExpression : undefined; node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 41 /* AsteriskToken */ ? asteriskTokenOrExpression : expression; return node; @@ -70088,7 +70487,7 @@ var ts; } ts.updateYield = updateYield; function createSpread(expression) { - var node = createSynthesizedNode(213 /* SpreadElement */); + var node = createSynthesizedNode(214 /* SpreadElement */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -70100,7 +70499,7 @@ var ts; } ts.updateSpread = updateSpread; function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(214 /* ClassExpression */); + var node = createSynthesizedNode(215 /* ClassExpression */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70121,11 +70520,11 @@ var ts; } ts.updateClassExpression = updateClassExpression; function createOmittedExpression() { - return createSynthesizedNode(215 /* OmittedExpression */); + return createSynthesizedNode(216 /* OmittedExpression */); } ts.createOmittedExpression = createOmittedExpression; function createExpressionWithTypeArguments(typeArguments, expression) { - var node = createSynthesizedNode(216 /* ExpressionWithTypeArguments */); + var node = createSynthesizedNode(217 /* ExpressionWithTypeArguments */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); return node; @@ -70139,7 +70538,7 @@ var ts; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; function createAsExpression(expression, type) { - var node = createSynthesizedNode(217 /* AsExpression */); + var node = createSynthesizedNode(218 /* AsExpression */); node.expression = expression; node.type = type; return node; @@ -70153,7 +70552,7 @@ var ts; } ts.updateAsExpression = updateAsExpression; function createNonNullExpression(expression) { - var node = createSynthesizedNode(218 /* NonNullExpression */); + var node = createSynthesizedNode(219 /* NonNullExpression */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -70165,7 +70564,7 @@ var ts; } ts.updateNonNullExpression = updateNonNullExpression; function createMetaProperty(keywordToken, name) { - var node = createSynthesizedNode(219 /* MetaProperty */); + var node = createSynthesizedNode(220 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; return node; @@ -70179,7 +70578,7 @@ var ts; ts.updateMetaProperty = updateMetaProperty; // Misc function createTemplateSpan(expression, literal) { - var node = createSynthesizedNode(221 /* TemplateSpan */); + var node = createSynthesizedNode(222 /* TemplateSpan */); node.expression = expression; node.literal = literal; return node; @@ -70193,12 +70592,12 @@ var ts; } ts.updateTemplateSpan = updateTemplateSpan; function createSemicolonClassElement() { - return createSynthesizedNode(222 /* SemicolonClassElement */); + return createSynthesizedNode(223 /* SemicolonClassElement */); } ts.createSemicolonClassElement = createSemicolonClassElement; // Element function createBlock(statements, multiLine) { - var block = createSynthesizedNode(223 /* Block */); + var block = createSynthesizedNode(224 /* Block */); block.statements = createNodeArray(statements); if (multiLine) block.multiLine = multiLine; @@ -70212,7 +70611,7 @@ var ts; } ts.updateBlock = updateBlock; function createVariableStatement(modifiers, declarationList) { - var node = createSynthesizedNode(225 /* VariableStatement */); + var node = createSynthesizedNode(226 /* VariableStatement */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; @@ -70227,11 +70626,11 @@ var ts; } ts.updateVariableStatement = updateVariableStatement; function createEmptyStatement() { - return createSynthesizedNode(224 /* EmptyStatement */); + return createSynthesizedNode(225 /* EmptyStatement */); } ts.createEmptyStatement = createEmptyStatement; function createExpressionStatement(expression) { - var node = createSynthesizedNode(226 /* ExpressionStatement */); + var node = createSynthesizedNode(227 /* ExpressionStatement */); node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } @@ -70247,7 +70646,7 @@ var ts; /** @deprecated Use `updateExpressionStatement` instead. */ ts.updateStatement = updateExpressionStatement; function createIf(expression, thenStatement, elseStatement) { - var node = createSynthesizedNode(227 /* IfStatement */); + var node = createSynthesizedNode(228 /* IfStatement */); node.expression = expression; node.thenStatement = asEmbeddedStatement(thenStatement); node.elseStatement = asEmbeddedStatement(elseStatement); @@ -70263,7 +70662,7 @@ var ts; } ts.updateIf = updateIf; function createDo(statement, expression) { - var node = createSynthesizedNode(228 /* DoStatement */); + var node = createSynthesizedNode(229 /* DoStatement */); node.statement = asEmbeddedStatement(statement); node.expression = expression; return node; @@ -70277,7 +70676,7 @@ var ts; } ts.updateDo = updateDo; function createWhile(expression, statement) { - var node = createSynthesizedNode(229 /* WhileStatement */); + var node = createSynthesizedNode(230 /* WhileStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -70291,7 +70690,7 @@ var ts; } ts.updateWhile = updateWhile; function createFor(initializer, condition, incrementor, statement) { - var node = createSynthesizedNode(230 /* ForStatement */); + var node = createSynthesizedNode(231 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -70309,7 +70708,7 @@ var ts; } ts.updateFor = updateFor; function createForIn(initializer, expression, statement) { - var node = createSynthesizedNode(231 /* ForInStatement */); + var node = createSynthesizedNode(232 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = asEmbeddedStatement(statement); @@ -70325,7 +70724,7 @@ var ts; } ts.updateForIn = updateForIn; function createForOf(awaitModifier, initializer, expression, statement) { - var node = createSynthesizedNode(232 /* ForOfStatement */); + var node = createSynthesizedNode(233 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = ts.isCommaSequence(expression) ? createParen(expression) : expression; @@ -70343,7 +70742,7 @@ var ts; } ts.updateForOf = updateForOf; function createContinue(label) { - var node = createSynthesizedNode(233 /* ContinueStatement */); + var node = createSynthesizedNode(234 /* ContinueStatement */); node.label = asName(label); return node; } @@ -70355,7 +70754,7 @@ var ts; } ts.updateContinue = updateContinue; function createBreak(label) { - var node = createSynthesizedNode(234 /* BreakStatement */); + var node = createSynthesizedNode(235 /* BreakStatement */); node.label = asName(label); return node; } @@ -70367,7 +70766,7 @@ var ts; } ts.updateBreak = updateBreak; function createReturn(expression) { - var node = createSynthesizedNode(235 /* ReturnStatement */); + var node = createSynthesizedNode(236 /* ReturnStatement */); node.expression = expression; return node; } @@ -70379,7 +70778,7 @@ var ts; } ts.updateReturn = updateReturn; function createWith(expression, statement) { - var node = createSynthesizedNode(236 /* WithStatement */); + var node = createSynthesizedNode(237 /* WithStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -70393,7 +70792,7 @@ var ts; } ts.updateWith = updateWith; function createSwitch(expression, caseBlock) { - var node = createSynthesizedNode(237 /* SwitchStatement */); + var node = createSynthesizedNode(238 /* SwitchStatement */); node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; @@ -70407,7 +70806,7 @@ var ts; } ts.updateSwitch = updateSwitch; function createLabel(label, statement) { - var node = createSynthesizedNode(238 /* LabeledStatement */); + var node = createSynthesizedNode(239 /* LabeledStatement */); node.label = asName(label); node.statement = asEmbeddedStatement(statement); return node; @@ -70421,7 +70820,7 @@ var ts; } ts.updateLabel = updateLabel; function createThrow(expression) { - var node = createSynthesizedNode(239 /* ThrowStatement */); + var node = createSynthesizedNode(240 /* ThrowStatement */); node.expression = expression; return node; } @@ -70433,7 +70832,7 @@ var ts; } ts.updateThrow = updateThrow; function createTry(tryBlock, catchClause, finallyBlock) { - var node = createSynthesizedNode(240 /* TryStatement */); + var node = createSynthesizedNode(241 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -70449,12 +70848,12 @@ var ts; } ts.updateTry = updateTry; function createDebuggerStatement() { - return createSynthesizedNode(241 /* DebuggerStatement */); + return createSynthesizedNode(242 /* DebuggerStatement */); } ts.createDebuggerStatement = createDebuggerStatement; function createVariableDeclaration(name, type, initializer) { /* Internally, one should probably use createTypeScriptVariableDeclaration instead and handle definite assignment assertions */ - var node = createSynthesizedNode(242 /* VariableDeclaration */); + var node = createSynthesizedNode(243 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -70472,7 +70871,7 @@ var ts; ts.updateVariableDeclaration = updateVariableDeclaration; /* @internal */ function createTypeScriptVariableDeclaration(name, exclaimationToken, type, initializer) { - var node = createSynthesizedNode(242 /* VariableDeclaration */); + var node = createSynthesizedNode(243 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -70492,7 +70891,7 @@ var ts; ts.updateTypeScriptVariableDeclaration = updateTypeScriptVariableDeclaration; function createVariableDeclarationList(declarations, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(243 /* VariableDeclarationList */); + var node = createSynthesizedNode(244 /* VariableDeclarationList */); node.flags |= flags & 3 /* BlockScoped */; node.declarations = createNodeArray(declarations); return node; @@ -70505,7 +70904,7 @@ var ts; } ts.updateVariableDeclarationList = updateVariableDeclarationList; function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(244 /* FunctionDeclaration */); + var node = createSynthesizedNode(245 /* FunctionDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -70531,7 +70930,7 @@ var ts; } ts.updateFunctionDeclaration = updateFunctionDeclaration; function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(245 /* ClassDeclaration */); + var node = createSynthesizedNode(246 /* ClassDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70553,7 +70952,7 @@ var ts; } ts.updateClassDeclaration = updateClassDeclaration; function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(246 /* InterfaceDeclaration */); + var node = createSynthesizedNode(247 /* InterfaceDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70575,7 +70974,7 @@ var ts; } ts.updateInterfaceDeclaration = updateInterfaceDeclaration; function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createSynthesizedNode(247 /* TypeAliasDeclaration */); + var node = createSynthesizedNode(248 /* TypeAliasDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70595,7 +70994,7 @@ var ts; } ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration; function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createSynthesizedNode(248 /* EnumDeclaration */); + var node = createSynthesizedNode(249 /* EnumDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70614,7 +71013,7 @@ var ts; ts.updateEnumDeclaration = updateEnumDeclaration; function createModuleDeclaration(decorators, modifiers, name, body, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(249 /* ModuleDeclaration */); + var node = createSynthesizedNode(250 /* ModuleDeclaration */); node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); @@ -70633,7 +71032,7 @@ var ts; } ts.updateModuleDeclaration = updateModuleDeclaration; function createModuleBlock(statements) { - var node = createSynthesizedNode(250 /* ModuleBlock */); + var node = createSynthesizedNode(251 /* ModuleBlock */); node.statements = createNodeArray(statements); return node; } @@ -70645,7 +71044,7 @@ var ts; } ts.updateModuleBlock = updateModuleBlock; function createCaseBlock(clauses) { - var node = createSynthesizedNode(251 /* CaseBlock */); + var node = createSynthesizedNode(252 /* CaseBlock */); node.clauses = createNodeArray(clauses); return node; } @@ -70657,7 +71056,7 @@ var ts; } ts.updateCaseBlock = updateCaseBlock; function createNamespaceExportDeclaration(name) { - var node = createSynthesizedNode(252 /* NamespaceExportDeclaration */); + var node = createSynthesizedNode(253 /* NamespaceExportDeclaration */); node.name = asName(name); return node; } @@ -70669,7 +71068,7 @@ var ts; } ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration; function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createSynthesizedNode(253 /* ImportEqualsDeclaration */); + var node = createSynthesizedNode(254 /* ImportEqualsDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70687,7 +71086,7 @@ var ts; } ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createSynthesizedNode(254 /* ImportDeclaration */); + var node = createSynthesizedNode(255 /* ImportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -70706,7 +71105,7 @@ var ts; ts.updateImportDeclaration = updateImportDeclaration; function createImportClause(name, namedBindings, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(255 /* ImportClause */); + var node = createSynthesizedNode(256 /* ImportClause */); node.name = name; node.namedBindings = namedBindings; node.isTypeOnly = isTypeOnly; @@ -70722,13 +71121,13 @@ var ts; } ts.updateImportClause = updateImportClause; function createNamespaceImport(name) { - var node = createSynthesizedNode(256 /* NamespaceImport */); + var node = createSynthesizedNode(257 /* NamespaceImport */); node.name = name; return node; } ts.createNamespaceImport = createNamespaceImport; function createNamespaceExport(name) { - var node = createSynthesizedNode(262 /* NamespaceExport */); + var node = createSynthesizedNode(263 /* NamespaceExport */); node.name = name; return node; } @@ -70746,7 +71145,7 @@ var ts; } ts.updateNamespaceExport = updateNamespaceExport; function createNamedImports(elements) { - var node = createSynthesizedNode(257 /* NamedImports */); + var node = createSynthesizedNode(258 /* NamedImports */); node.elements = createNodeArray(elements); return node; } @@ -70758,7 +71157,7 @@ var ts; } ts.updateNamedImports = updateNamedImports; function createImportSpecifier(propertyName, name) { - var node = createSynthesizedNode(258 /* ImportSpecifier */); + var node = createSynthesizedNode(259 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; return node; @@ -70772,7 +71171,7 @@ var ts; } ts.updateImportSpecifier = updateImportSpecifier; function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createSynthesizedNode(259 /* ExportAssignment */); + var node = createSynthesizedNode(260 /* ExportAssignment */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -70790,7 +71189,7 @@ var ts; ts.updateExportAssignment = updateExportAssignment; function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(260 /* ExportDeclaration */); + var node = createSynthesizedNode(261 /* ExportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isTypeOnly = isTypeOnly; @@ -70815,7 +71214,7 @@ var ts; } ts.createEmptyExports = createEmptyExports; function createNamedExports(elements) { - var node = createSynthesizedNode(261 /* NamedExports */); + var node = createSynthesizedNode(262 /* NamedExports */); node.elements = createNodeArray(elements); return node; } @@ -70827,7 +71226,7 @@ var ts; } ts.updateNamedExports = updateNamedExports; function createExportSpecifier(propertyName, name) { - var node = createSynthesizedNode(263 /* ExportSpecifier */); + var node = createSynthesizedNode(264 /* ExportSpecifier */); node.propertyName = asName(propertyName); node.name = asName(name); return node; @@ -70842,7 +71241,7 @@ var ts; ts.updateExportSpecifier = updateExportSpecifier; // Module references function createExternalModuleReference(expression) { - var node = createSynthesizedNode(265 /* ExternalModuleReference */); + var node = createSynthesizedNode(266 /* ExternalModuleReference */); node.expression = expression; return node; } @@ -70856,14 +71255,14 @@ var ts; // JSDoc /* @internal */ function createJSDocTypeExpression(type) { - var node = createSynthesizedNode(294 /* JSDocTypeExpression */); + var node = createSynthesizedNode(295 /* JSDocTypeExpression */); node.type = type; return node; } ts.createJSDocTypeExpression = createJSDocTypeExpression; /* @internal */ function createJSDocTypeTag(typeExpression, comment) { - var tag = createJSDocTag(320 /* JSDocTypeTag */, "type"); + var tag = createJSDocTag(321 /* JSDocTypeTag */, "type"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -70871,7 +71270,7 @@ var ts; ts.createJSDocTypeTag = createJSDocTypeTag; /* @internal */ function createJSDocReturnTag(typeExpression, comment) { - var tag = createJSDocTag(318 /* JSDocReturnTag */, "returns"); + var tag = createJSDocTag(319 /* JSDocReturnTag */, "returns"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -70879,14 +71278,14 @@ var ts; ts.createJSDocReturnTag = createJSDocReturnTag; /** @internal */ function createJSDocThisTag(typeExpression) { - var tag = createJSDocTag(319 /* JSDocThisTag */, "this"); + var tag = createJSDocTag(320 /* JSDocThisTag */, "this"); tag.typeExpression = typeExpression; return tag; } ts.createJSDocThisTag = createJSDocThisTag; /* @internal */ function createJSDocParamTag(name, isBracketed, typeExpression, comment) { - var tag = createJSDocTag(317 /* JSDocParameterTag */, "param"); + var tag = createJSDocTag(318 /* JSDocParameterTag */, "param"); tag.typeExpression = typeExpression; tag.name = name; tag.isBracketed = isBracketed; @@ -70896,7 +71295,7 @@ var ts; ts.createJSDocParamTag = createJSDocParamTag; /* @internal */ function createJSDocComment(comment, tags) { - var node = createSynthesizedNode(303 /* JSDocComment */); + var node = createSynthesizedNode(304 /* JSDocComment */); node.comment = comment; node.tags = tags; return node; @@ -70910,7 +71309,7 @@ var ts; } // JSX function createJsxElement(openingElement, children, closingElement) { - var node = createSynthesizedNode(266 /* JsxElement */); + var node = createSynthesizedNode(267 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -70926,7 +71325,7 @@ var ts; } ts.updateJsxElement = updateJsxElement; function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(267 /* JsxSelfClosingElement */); + var node = createSynthesizedNode(268 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -70942,7 +71341,7 @@ var ts; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; function createJsxOpeningElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(268 /* JsxOpeningElement */); + var node = createSynthesizedNode(269 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -70958,7 +71357,7 @@ var ts; } ts.updateJsxOpeningElement = updateJsxOpeningElement; function createJsxClosingElement(tagName) { - var node = createSynthesizedNode(269 /* JsxClosingElement */); + var node = createSynthesizedNode(270 /* JsxClosingElement */); node.tagName = tagName; return node; } @@ -70970,7 +71369,7 @@ var ts; } ts.updateJsxClosingElement = updateJsxClosingElement; function createJsxFragment(openingFragment, children, closingFragment) { - var node = createSynthesizedNode(270 /* JsxFragment */); + var node = createSynthesizedNode(271 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -70992,11 +71391,11 @@ var ts; } ts.updateJsxText = updateJsxText; function createJsxOpeningFragment() { - return createSynthesizedNode(271 /* JsxOpeningFragment */); + return createSynthesizedNode(272 /* JsxOpeningFragment */); } ts.createJsxOpeningFragment = createJsxOpeningFragment; function createJsxJsxClosingFragment() { - return createSynthesizedNode(272 /* JsxClosingFragment */); + return createSynthesizedNode(273 /* JsxClosingFragment */); } ts.createJsxJsxClosingFragment = createJsxJsxClosingFragment; function updateJsxFragment(node, openingFragment, children, closingFragment) { @@ -71008,7 +71407,7 @@ var ts; } ts.updateJsxFragment = updateJsxFragment; function createJsxAttribute(name, initializer) { - var node = createSynthesizedNode(273 /* JsxAttribute */); + var node = createSynthesizedNode(274 /* JsxAttribute */); node.name = name; node.initializer = initializer; return node; @@ -71022,7 +71421,7 @@ var ts; } ts.updateJsxAttribute = updateJsxAttribute; function createJsxAttributes(properties) { - var node = createSynthesizedNode(274 /* JsxAttributes */); + var node = createSynthesizedNode(275 /* JsxAttributes */); node.properties = createNodeArray(properties); return node; } @@ -71034,7 +71433,7 @@ var ts; } ts.updateJsxAttributes = updateJsxAttributes; function createJsxSpreadAttribute(expression) { - var node = createSynthesizedNode(275 /* JsxSpreadAttribute */); + var node = createSynthesizedNode(276 /* JsxSpreadAttribute */); node.expression = expression; return node; } @@ -71046,7 +71445,7 @@ var ts; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; function createJsxExpression(dotDotDotToken, expression) { - var node = createSynthesizedNode(276 /* JsxExpression */); + var node = createSynthesizedNode(277 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; @@ -71060,7 +71459,7 @@ var ts; ts.updateJsxExpression = updateJsxExpression; // Clauses function createCaseClause(expression, statements) { - var node = createSynthesizedNode(277 /* CaseClause */); + var node = createSynthesizedNode(278 /* CaseClause */); node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; @@ -71074,7 +71473,7 @@ var ts; } ts.updateCaseClause = updateCaseClause; function createDefaultClause(statements) { - var node = createSynthesizedNode(278 /* DefaultClause */); + var node = createSynthesizedNode(279 /* DefaultClause */); node.statements = createNodeArray(statements); return node; } @@ -71086,7 +71485,7 @@ var ts; } ts.updateDefaultClause = updateDefaultClause; function createHeritageClause(token, types) { - var node = createSynthesizedNode(279 /* HeritageClause */); + var node = createSynthesizedNode(280 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); return node; @@ -71099,7 +71498,7 @@ var ts; } ts.updateHeritageClause = updateHeritageClause; function createCatchClause(variableDeclaration, block) { - var node = createSynthesizedNode(280 /* CatchClause */); + var node = createSynthesizedNode(281 /* CatchClause */); node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -71114,7 +71513,7 @@ var ts; ts.updateCatchClause = updateCatchClause; // Property assignments function createPropertyAssignment(name, initializer) { - var node = createSynthesizedNode(281 /* PropertyAssignment */); + var node = createSynthesizedNode(282 /* PropertyAssignment */); node.name = asName(name); node.questionToken = undefined; node.initializer = ts.parenthesizeExpressionForList(initializer); @@ -71129,7 +71528,7 @@ var ts; } ts.updatePropertyAssignment = updatePropertyAssignment; function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createSynthesizedNode(282 /* ShorthandPropertyAssignment */); + var node = createSynthesizedNode(283 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; @@ -71143,7 +71542,7 @@ var ts; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; function createSpreadAssignment(expression) { - var node = createSynthesizedNode(283 /* SpreadAssignment */); + var node = createSynthesizedNode(284 /* SpreadAssignment */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -71156,7 +71555,7 @@ var ts; ts.updateSpreadAssignment = updateSpreadAssignment; // Enum function createEnumMember(name, initializer) { - var node = createSynthesizedNode(284 /* EnumMember */); + var node = createSynthesizedNode(285 /* EnumMember */); node.name = asName(name); node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); return node; @@ -71177,7 +71576,7 @@ var ts; (typeReferences !== undefined && node.typeReferenceDirectives !== typeReferences) || (libReferences !== undefined && node.libReferenceDirectives !== libReferences) || (hasNoDefaultLib !== undefined && node.hasNoDefaultLib !== hasNoDefaultLib)) { - var updated = createSynthesizedNode(290 /* SourceFile */); + var updated = createSynthesizedNode(291 /* SourceFile */); updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; @@ -71261,7 +71660,7 @@ var ts; * @param original The original statement. */ function createNotEmittedStatement(original) { - var node = createSynthesizedNode(325 /* NotEmittedStatement */); + var node = createSynthesizedNode(326 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; @@ -71273,7 +71672,7 @@ var ts; */ /* @internal */ function createEndOfDeclarationMarker(original) { - var node = createSynthesizedNode(329 /* EndOfDeclarationMarker */); + var node = createSynthesizedNode(330 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -71285,7 +71684,7 @@ var ts; */ /* @internal */ function createMergeDeclarationMarker(original) { - var node = createSynthesizedNode(328 /* MergeDeclarationMarker */); + var node = createSynthesizedNode(329 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -71300,7 +71699,7 @@ var ts; * @param location The location for the expression. Defaults to the positions from "original" if provided. */ function createPartiallyEmittedExpression(expression, original) { - var node = createSynthesizedNode(326 /* PartiallyEmittedExpression */); + var node = createSynthesizedNode(327 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; setTextRange(node, original); @@ -71316,7 +71715,7 @@ var ts; ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; function flattenCommaElements(node) { if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { - if (node.kind === 327 /* CommaListExpression */) { + if (node.kind === 328 /* CommaListExpression */) { return node.elements; } if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) { @@ -71326,7 +71725,7 @@ var ts; return node; } function createCommaList(elements) { - var node = createSynthesizedNode(327 /* CommaListExpression */); + var node = createSynthesizedNode(328 /* CommaListExpression */); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); return node; } @@ -71339,7 +71738,7 @@ var ts; ts.updateCommaList = updateCommaList; /* @internal */ function createSyntheticReferenceExpression(expression, thisArg) { - var node = createSynthesizedNode(330 /* SyntheticReferenceExpression */); + var node = createSynthesizedNode(331 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; return node; @@ -71355,7 +71754,7 @@ var ts; ts.updateSyntheticReferenceExpression = updateSyntheticReferenceExpression; function createBundle(sourceFiles, prepends) { if (prepends === void 0) { prepends = ts.emptyArray; } - var node = ts.createNode(291 /* Bundle */); + var node = ts.createNode(292 /* Bundle */); node.prepends = prepends; node.sourceFiles = sourceFiles; return node; @@ -71390,7 +71789,7 @@ var ts; ], function (helper) { return helper.name; })); } function createUnparsedSource() { - var node = ts.createNode(292 /* UnparsedSource */); + var node = ts.createNode(293 /* UnparsedSource */); node.prologues = ts.emptyArray; node.referencedFiles = ts.emptyArray; node.libReferenceDirectives = ts.emptyArray; @@ -71525,10 +71924,10 @@ var ts; } function mapBundleFileSectionKindToSyntaxKind(kind) { switch (kind) { - case "prologue" /* Prologue */: return 285 /* UnparsedPrologue */; - case "prepend" /* Prepend */: return 286 /* UnparsedPrepend */; - case "internal" /* Internal */: return 288 /* UnparsedInternalText */; - case "text" /* Text */: return 287 /* UnparsedText */; + case "prologue" /* Prologue */: return 286 /* UnparsedPrologue */; + case "prepend" /* Prepend */: return 287 /* UnparsedPrepend */; + case "internal" /* Internal */: return 289 /* UnparsedInternalText */; + case "text" /* Text */: return 288 /* UnparsedText */; case "emitHelpers" /* EmitHelpers */: case "no-default-lib" /* NoDefaultLib */: case "reference" /* Reference */: @@ -71546,14 +71945,14 @@ var ts; return node; } function createUnparsedSyntheticReference(section, parent) { - var node = ts.createNode(289 /* UnparsedSyntheticReference */, section.pos, section.end); + var node = ts.createNode(290 /* UnparsedSyntheticReference */, section.pos, section.end); node.parent = parent; node.data = section.data; node.section = section; return node; } function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapTextOrBuildInfoPath, javascriptPath, declarationPath, buildInfoPath, buildInfo, oldFileOfCurrentEmit) { - var node = ts.createNode(293 /* InputFiles */); + var node = ts.createNode(294 /* InputFiles */); if (!ts.isString(javascriptTextOrReadFileText)) { var cache_1 = ts.createMap(); var textGetter_1 = function (path) { @@ -71750,7 +72149,7 @@ var ts; // To avoid holding onto transformation artifacts, we keep track of any // parse tree node we are annotating. This allows us to clean them up after // all transformations have completed. - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node))); @@ -72291,7 +72690,7 @@ var ts; if (!outermostLabeledStatement) { return node; } - var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 238 /* LabeledStatement */ + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 239 /* LabeledStatement */ ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node); if (afterRestoreLabelCallback) { @@ -72310,13 +72709,13 @@ var ts; case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: return false; - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -72343,7 +72742,7 @@ var ts; } else { switch (callee.kind) { - case 194 /* PropertyAccessExpression */: { + case 195 /* PropertyAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a.b()` target is `(_a = a).b` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -72356,7 +72755,7 @@ var ts; } break; } - case 195 /* ElementAccessExpression */: { + case 196 /* ElementAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -72416,14 +72815,14 @@ var ts; ts.Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); } switch (property.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return createExpressionForAccessorDeclaration(node.properties, property, receiver, !!node.multiLine); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return createExpressionForPropertyAssignment(property, receiver); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return createExpressionForMethodDeclaration(property, receiver); } } @@ -72749,7 +73148,7 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 200 /* ParenthesizedExpression */) { + if (skipped.kind === 201 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -72783,10 +73182,10 @@ var ts; // // If `a ** d` is on the left of operator `**`, we need to parenthesize to preserve // the intended order of operations: `(a ** b) ** c` - var binaryOperatorPrecedence = ts.getOperatorPrecedence(209 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(209 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(210 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(210 /* BinaryExpression */, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 202 /* ArrowFunction */ && binaryOperatorPrecedence > 3) { + if (!isLeftSideOfBinary && operand.kind === 203 /* ArrowFunction */ && binaryOperatorPrecedence > 3) { // We need to parenthesize arrow functions on the right side to avoid it being // parsed as parenthesized expression: `a && (() => {})` return true; @@ -72798,7 +73197,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 212 /* YieldExpression */) { + && operand.kind === 213 /* YieldExpression */) { return false; } return true; @@ -72886,7 +73285,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { + if (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -72899,7 +73298,7 @@ var ts; return 0 /* Unknown */; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(210 /* ConditionalExpression */, 57 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(211 /* ConditionalExpression */, 57 /* QuestionToken */); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) { @@ -72934,8 +73333,8 @@ var ts; var needsParens = isCommaSequence(check); if (!needsParens) { switch (getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) { - case 214 /* ClassExpression */: - case 201 /* FunctionExpression */: + case 215 /* ClassExpression */: + case 202 /* FunctionExpression */: needsParens = true; } } @@ -72951,9 +73350,9 @@ var ts; function parenthesizeForNew(expression) { var leftmostExpr = getLeftmostExpression(expression, /*stopAtCallExpressions*/ true); switch (leftmostExpr.kind) { - case 196 /* CallExpression */: + case 197 /* CallExpression */: return ts.createParen(expression); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return !leftmostExpr.arguments ? ts.createParen(expression) : expression; @@ -72976,7 +73375,7 @@ var ts; // var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 197 /* NewExpression */ || emittedExpression.arguments)) { + && (emittedExpression.kind !== 198 /* NewExpression */ || emittedExpression.arguments)) { return expression; } return ts.setTextRange(ts.createParen(expression), expression); @@ -73014,7 +73413,7 @@ var ts; function parenthesizeExpressionForList(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(209 /* BinaryExpression */, 27 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(210 /* BinaryExpression */, 27 /* CommaToken */); return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(ts.createParen(expression), expression); @@ -73025,29 +73424,29 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 201 /* FunctionExpression */ || kind === 202 /* ArrowFunction */) { + if (kind === 202 /* FunctionExpression */ || kind === 203 /* ArrowFunction */) { var mutableCall = ts.getMutableClone(emittedExpression); mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); return recreateOuterExpressions(expression, mutableCall, 4 /* PartiallyEmittedExpressions */); } } var leftmostExpressionKind = getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind; - if (leftmostExpressionKind === 193 /* ObjectLiteralExpression */ || leftmostExpressionKind === 201 /* FunctionExpression */) { + if (leftmostExpressionKind === 194 /* ObjectLiteralExpression */ || leftmostExpressionKind === 202 /* FunctionExpression */) { return ts.setTextRange(ts.createParen(expression), expression); } return expression; } ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; function parenthesizeConditionalTypeMember(member) { - return member.kind === 180 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; + return member.kind === 181 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; } ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember; function parenthesizeElementTypeMember(member) { switch (member.kind) { - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: return ts.createParenthesizedType(member); } return parenthesizeConditionalTypeMember(member); @@ -73055,9 +73454,9 @@ var ts; ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember; function parenthesizeArrayTypeMember(member) { switch (member.kind) { - case 172 /* TypeQuery */: - case 184 /* TypeOperator */: - case 181 /* InferType */: + case 173 /* TypeQuery */: + case 185 /* TypeOperator */: + case 182 /* InferType */: return ts.createParenthesizedType(member); } return parenthesizeElementTypeMember(member); @@ -73083,28 +73482,28 @@ var ts; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: node = node.operand; continue; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: node = node.left; continue; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: node = node.condition; continue; - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: node = node.tag; continue; - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 217 /* AsExpression */: - case 195 /* ElementAccessExpression */: - case 194 /* PropertyAccessExpression */: - case 218 /* NonNullExpression */: - case 326 /* PartiallyEmittedExpression */: + case 218 /* AsExpression */: + case 196 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 219 /* NonNullExpression */: + case 327 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -73113,15 +73512,15 @@ var ts; } ts.getLeftmostExpression = getLeftmostExpression; function parenthesizeConciseBody(body) { - if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 193 /* ObjectLiteralExpression */)) { + if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 194 /* ObjectLiteralExpression */)) { return ts.setTextRange(ts.createParen(body), body); } return body; } ts.parenthesizeConciseBody = parenthesizeConciseBody; function isCommaSequence(node) { - return node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || - node.kind === 327 /* CommaListExpression */; + return node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || + node.kind === 328 /* CommaListExpression */; } ts.isCommaSequence = isCommaSequence; var OuterExpressionKinds; @@ -73134,13 +73533,13 @@ var ts; function isOuterExpression(node, kinds) { if (kinds === void 0) { kinds = 7 /* All */; } switch (node.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return (kinds & 1 /* Parentheses */) !== 0; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: - case 218 /* NonNullExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: + case 219 /* NonNullExpression */: return (kinds & 2 /* Assertions */) !== 0; - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: return (kinds & 4 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -73165,7 +73564,7 @@ var ts; } ts.skipOuterExpressions = skipOuterExpressions; function skipAssertions(node) { - while (ts.isAssertionExpression(node) || node.kind === 218 /* NonNullExpression */) { + while (ts.isAssertionExpression(node) || node.kind === 219 /* NonNullExpression */) { node = node.expression; } return node; @@ -73173,11 +73572,11 @@ var ts; ts.skipAssertions = skipAssertions; function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 200 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); - case 199 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 217 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); - case 218 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); - case 326 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); + case 201 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); + case 200 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 218 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); + case 219 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); + case 327 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); } } /** @@ -73195,7 +73594,7 @@ var ts; * the containing expression is created/updated. */ function isIgnorableParen(node) { - return node.kind === 200 /* ParenthesizedExpression */ + return node.kind === 201 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node) && ts.nodeIsSynthesized(ts.getSourceMapRange(node)) && ts.nodeIsSynthesized(ts.getCommentRange(node)) @@ -73313,10 +73712,10 @@ var ts; var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 254 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 255 /* ImportDeclaration */ && node.importClause) { return ts.getGeneratedNameForNode(node); } - if (node.kind === 260 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 261 /* ExportDeclaration */ && node.moduleSpecifier) { return ts.getGeneratedNameForNode(node); } return undefined; @@ -73435,7 +73834,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -73447,11 +73846,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -73483,12 +73882,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 156 /* Parameter */: - case 191 /* BindingElement */: + case 157 /* Parameter */: + case 192 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 213 /* SpreadElement */: - case 283 /* SpreadAssignment */: + case 214 /* SpreadElement */: + case 284 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -73506,7 +73905,7 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 191 /* BindingElement */: + case 192 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -73521,7 +73920,7 @@ var ts; : propertyName; } break; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -73536,7 +73935,7 @@ var ts; : propertyName; } break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` if (bindingElement.name && ts.isPrivateIdentifier(bindingElement.name)) { return ts.Debug.failBadSyntaxKind(bindingElement.name); @@ -73559,13 +73958,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: - case 192 /* ArrayLiteralExpression */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: + case 193 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -73605,11 +74004,11 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 190 /* ArrayBindingPattern */: - case 192 /* ArrayLiteralExpression */: + case 191 /* ArrayBindingPattern */: + case 193 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 189 /* ObjectBindingPattern */: - case 193 /* ObjectLiteralExpression */: + case 190 /* ObjectBindingPattern */: + case 194 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -73768,289 +74167,289 @@ var ts; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 152 /* LastToken */) || kind === 183 /* ThisType */) { + if ((kind > 0 /* FirstToken */ && kind <= 153 /* LastToken */) || kind === 184 /* ThisType */) { return node; } switch (kind) { // Names case 75 /* Identifier */: return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); // Signature elements - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); - case 156 /* Parameter */: + case 157 /* Parameter */: return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 157 /* Decorator */: + case 158 /* Decorator */: return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); // Type elements - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), // QuestionToken and ExclamationToken is uniqued in Property Declaration and the signature of 'updateProperty' is that too visitNode(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 160 /* MethodSignature */: + case 161 /* MethodSignature */: return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 162 /* Constructor */: + case 163 /* Constructor */: return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 165 /* CallSignature */: + case 166 /* CallSignature */: return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); // Types - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return ts.updateTypePredicateNodeWithModifier(node, visitNode(node.assertsModifier, visitor), visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 170 /* FunctionType */: + case 171 /* FunctionType */: return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 171 /* ConstructorType */: + case 172 /* ConstructorType */: return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 174 /* ArrayType */: + case 175 /* ArrayType */: return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); - case 175 /* TupleType */: + case 176 /* TupleType */: return ts.updateTupleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); - case 176 /* OptionalType */: + case 177 /* OptionalType */: return ts.updateOptionalTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 177 /* RestType */: + case 178 /* RestType */: return ts.updateRestTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 178 /* UnionType */: + case 179 /* UnionType */: return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 179 /* IntersectionType */: + case 180 /* IntersectionType */: return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode)); - case 181 /* InferType */: + case 182 /* InferType */: return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); - case 188 /* ImportType */: + case 189 /* ImportType */: return ts.updateImportTypeNode(node, visitNode(node.argument, visitor, ts.isTypeNode), visitNode(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf); - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 184 /* TypeOperator */: + case 185 /* TypeOperator */: return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); - case 186 /* MappedType */: + case 187 /* MappedType */: return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 187 /* LiteralType */: + case 188 /* LiteralType */: return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); // Binding patterns - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); // Expression - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: if (node.flags & 32 /* OptionalChain */) { - return ts.updatePropertyAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, visitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier)); + return ts.updatePropertyAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier)); } return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifierOrPrivateIdentifier)); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: if (node.flags & 32 /* OptionalChain */) { - return ts.updateElementAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, visitor, ts.isToken), visitNode(node.argumentExpression, visitor, ts.isExpression)); + return ts.updateElementAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.argumentExpression, visitor, ts.isExpression)); } return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { - return ts.updateCallChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, visitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + return ts.updateCallChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); } return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 202 /* ArrowFunction */: - return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, visitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); - case 203 /* DeleteExpression */: + case 203 /* ArrowFunction */: + return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, tokenVisitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); + case 204 /* DeleteExpression */: return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 209 /* BinaryExpression */: - return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, visitor, ts.isToken)); - case 210 /* ConditionalExpression */: - return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, visitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 211 /* TemplateExpression */: + case 210 /* BinaryExpression */: + return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, tokenVisitor, ts.isToken)); + case 211 /* ConditionalExpression */: + return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, tokenVisitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); + case 212 /* TemplateExpression */: return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 217 /* AsExpression */: + case 218 /* AsExpression */: return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); // Misc - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 223 /* Block */: + case 224 /* Block */: return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return ts.updateExpressionStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 232 /* ForOfStatement */: - return ts.updateForOf(node, visitNode(node.awaitModifier, visitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 233 /* ContinueStatement */: + case 233 /* ForOfStatement */: + return ts.updateForOf(node, visitNode(node.awaitModifier, tokenVisitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 234 /* ContinueStatement */: return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 234 /* BreakStatement */: + case 235 /* BreakStatement */: return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ts.updateTypeScriptVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings), node.isTypeOnly); - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: return ts.updateNamespaceExport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 257 /* NamedImports */: + case 258 /* NamedImports */: return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExportBindings), visitNode(node.moduleSpecifier, visitor, ts.isExpression), node.isTypeOnly); - case 261 /* NamedExports */: + case 262 /* NamedExports */: return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); // Module references - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); // JSX - case 266 /* JsxElement */: + case 267 /* JsxElement */: return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 268 /* JsxOpeningElement */: + case 269 /* JsxOpeningElement */: return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 275 /* JsxSpreadAttribute */: + case 276 /* JsxSpreadAttribute */: return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Clauses - case 277 /* CaseClause */: + case 278 /* CaseClause */: return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); // Property assignments - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); // Enum - case 284 /* EnumMember */: + case 285 /* EnumMember */: return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 290 /* SourceFile */: + case 291 /* SourceFile */: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: // No need to visit nodes with no children. @@ -74093,58 +74492,58 @@ var ts; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 152 /* LastToken */)) { + if ((kind > 0 /* FirstToken */ && kind <= 153 /* LastToken */)) { return initial; } // We do not yet support types. - if ((kind >= 168 /* TypePredicate */ && kind <= 187 /* LiteralType */)) { + if ((kind >= 169 /* TypePredicate */ && kind <= 188 /* LiteralType */)) { return initial; } var result = initial; switch (node.kind) { // Leaf nodes - case 222 /* SemicolonClassElement */: - case 224 /* EmptyStatement */: - case 215 /* OmittedExpression */: - case 241 /* DebuggerStatement */: - case 325 /* NotEmittedStatement */: + case 223 /* SemicolonClassElement */: + case 225 /* EmptyStatement */: + case 216 /* OmittedExpression */: + case 242 /* DebuggerStatement */: + case 326 /* NotEmittedStatement */: // No need to visit nodes with no children. break; // Names - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: result = reduceNode(node.expression, cbNode, result); break; // Signature elements - case 156 /* Parameter */: + case 157 /* Parameter */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 157 /* Decorator */: + case 158 /* Decorator */: result = reduceNode(node.expression, cbNode, result); break; // Type member - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.questionToken, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74153,12 +74552,12 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 162 /* Constructor */: + case 163 /* Constructor */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74166,7 +74565,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74174,50 +74573,50 @@ var ts; result = reduceNode(node.body, cbNode, result); break; // Binding patterns - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: result = reduceNodes(node.elements, cbNodes, result); break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Expression - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: result = reduceNodes(node.elements, cbNodes, result); break; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: result = reduceNodes(node.properties, cbNodes, result); break; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.argumentExpression, cbNode, result); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 197 /* NewExpression */: + case 198 /* NewExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: result = reduceNode(node.tag, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNode(node.template, cbNode, result); break; - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: result = reduceNode(node.type, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -74225,123 +74624,123 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 200 /* ParenthesizedExpression */: - case 203 /* DeleteExpression */: - case 204 /* TypeOfExpression */: - case 205 /* VoidExpression */: - case 206 /* AwaitExpression */: - case 212 /* YieldExpression */: - case 213 /* SpreadElement */: - case 218 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: + case 204 /* DeleteExpression */: + case 205 /* TypeOfExpression */: + case 206 /* VoidExpression */: + case 207 /* AwaitExpression */: + case 213 /* YieldExpression */: + case 214 /* SpreadElement */: + case 219 /* NonNullExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: result = reduceNode(node.operand, cbNode, result); break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; - case 217 /* AsExpression */: + case 218 /* AsExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.type, cbNode, result); break; // Misc - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; // Element - case 223 /* Block */: + case 224 /* Block */: result = reduceNodes(node.statements, cbNodes, result); break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 227 /* IfStatement */: + case 228 /* IfStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 228 /* DoStatement */: + case 229 /* DoStatement */: result = reduceNode(node.statement, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 229 /* WhileStatement */: - case 236 /* WithStatement */: + case 230 /* WhileStatement */: + case 237 /* WithStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 230 /* ForStatement */: + case 231 /* ForStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 235 /* ReturnStatement */: - case 239 /* ThrowStatement */: + case 236 /* ReturnStatement */: + case 240 /* ThrowStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 240 /* TryStatement */: + case 241 /* TryStatement */: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: result = reduceNodes(node.declarations, cbNodes, result); break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74350,7 +74749,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74358,143 +74757,143 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.members, cbNodes, result); break; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: result = reduceNodes(node.statements, cbNodes, result); break; - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: result = reduceNodes(node.clauses, cbNodes, result); break; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.moduleReference, cbNode, result); break; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 255 /* ImportClause */: + case 256 /* ImportClause */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: result = reduceNode(node.name, cbNode, result); break; - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: result = reduceNode(node.name, cbNode, result); break; - case 257 /* NamedImports */: - case 261 /* NamedExports */: + case 258 /* NamedImports */: + case 262 /* NamedExports */: result = reduceNodes(node.elements, cbNodes, result); break; - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; // Module references - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: result = reduceNode(node.expression, cbNode, result); break; // JSX - case 266 /* JsxElement */: + case 267 /* JsxElement */: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: result = reduceNode(node.openingFragment, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingFragment, cbNode, result); break; - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: result = reduceNode(node.tagName, cbNode, result); result = reduceNodes(node.typeArguments, cbNode, result); result = reduceNode(node.attributes, cbNode, result); break; - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: result = reduceNodes(node.properties, cbNodes, result); break; - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: result = reduceNode(node.tagName, cbNode, result); break; - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 275 /* JsxSpreadAttribute */: + case 276 /* JsxSpreadAttribute */: result = reduceNode(node.expression, cbNode, result); break; - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: result = reduceNode(node.expression, cbNode, result); break; // Clauses - case 277 /* CaseClause */: + case 278 /* CaseClause */: result = reduceNode(node.expression, cbNode, result); // falls through - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: result = reduceNodes(node.statements, cbNodes, result); break; - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: result = reduceNodes(node.types, cbNodes, result); break; - case 280 /* CatchClause */: + case 281 /* CatchClause */: result = reduceNode(node.variableDeclaration, cbNode, result); result = reduceNode(node.block, cbNode, result); break; // Property assignments - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: result = reduceNode(node.expression, cbNode, result); break; // Enum - case 284 /* EnumMember */: + case 285 /* EnumMember */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Top-level nodes - case 290 /* SourceFile */: + case 291 /* SourceFile */: result = reduceNodes(node.statements, cbNodes, result); break; // Transformation nodes - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: result = reduceNodes(node.elements, cbNodes, result); break; default: @@ -74567,7 +74966,7 @@ var ts; function aggregateTransformFlagsForSubtree(node) { // We do not transform ambient declarations or types, so there is no need to // recursively aggregate transform flags. - if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 216 /* ExpressionWithTypeArguments */)) { + if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 217 /* ExpressionWithTypeArguments */)) { return 0 /* None */; } // Aggregate the transform flags of each child. @@ -75241,7 +75640,7 @@ var ts; function chainBundle(transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 290 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 291 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return ts.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends); @@ -75292,7 +75691,7 @@ var ts; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" @@ -75305,13 +75704,13 @@ var ts; hasImportDefault = true; } break; - case 253 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 265 /* ExternalModuleReference */) { + case 254 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 266 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -75342,13 +75741,13 @@ var ts; } } break; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: if (ts.hasModifier(node, 1 /* Export */)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -75356,7 +75755,7 @@ var ts; } } break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default function() { } @@ -75376,7 +75775,7 @@ var ts; } } break; - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default class { } @@ -75555,7 +75954,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member) { - return member.kind === 159 /* PropertyDeclaration */ + return member.kind === 160 /* PropertyDeclaration */ && member.initializer !== undefined; } ts.isInitializedProperty = isInitializedProperty; @@ -76184,8 +76583,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(194 /* PropertyAccessExpression */); - context.enableSubstitution(195 /* ElementAccessExpression */); + context.enableSubstitution(195 /* PropertyAccessExpression */); + context.enableSubstitution(196 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -76211,14 +76610,14 @@ var ts; var applicableSubstitutions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 291 /* Bundle */) { + if (node.kind === 292 /* Bundle */) { return transformBundle(node); } return transformSourceFile(node); } function transformBundle(node) { return ts.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 293 /* InputFiles */) { + if (prepend.kind === 294 /* InputFiles */) { return ts.createUnparsedSourceFile(prepend, "js"); } return prepend; @@ -76269,16 +76668,16 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 290 /* SourceFile */: - case 251 /* CaseBlock */: - case 250 /* ModuleBlock */: - case 223 /* Block */: + case 291 /* SourceFile */: + case 252 /* CaseBlock */: + case 251 /* ModuleBlock */: + case 224 /* Block */: currentLexicalScope = node; currentNameScope = undefined; currentScopeFirstDeclarationsOfName = undefined; break; - case 245 /* ClassDeclaration */: - case 244 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 245 /* FunctionDeclaration */: if (ts.hasModifier(node, 2 /* Ambient */)) { break; } @@ -76290,7 +76689,7 @@ var ts; // These nodes should always have names unless they are default-exports; // however, class declaration parsing allows for undefined names, so syntactically invalid // programs may also have an undefined name. - ts.Debug.assert(node.kind === 245 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); + ts.Debug.assert(node.kind === 246 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); } if (ts.isClassDeclaration(node)) { // XXX: should probably also cover interfaces and type aliases that can have type variables? @@ -76333,10 +76732,10 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 259 /* ExportAssignment */: - case 260 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 260 /* ExportAssignment */: + case 261 /* ExportDeclaration */: return visitEllidableStatement(node); default: return visitorWorker(node); @@ -76357,13 +76756,13 @@ var ts; return node; } switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return visitImportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitExportAssignment(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -76383,11 +76782,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 260 /* ExportDeclaration */ || - node.kind === 254 /* ImportDeclaration */ || - node.kind === 255 /* ImportClause */ || - (node.kind === 253 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 265 /* ExternalModuleReference */)) { + if (node.kind === 261 /* ExportDeclaration */ || + node.kind === 255 /* ImportDeclaration */ || + node.kind === 256 /* ImportClause */ || + (node.kind === 254 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 266 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -76411,19 +76810,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: return visitConstructor(node); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // Property declarations are not TypeScript syntax, but they must be visited // for the decorator transformation. return visitPropertyDeclaration(node); - case 167 /* IndexSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 161 /* MethodDeclaration */: + case 168 /* IndexSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 162 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 222 /* SemicolonClassElement */: + case 223 /* SemicolonClassElement */: return node; default: return ts.Debug.failBadSyntaxKind(node); @@ -76459,62 +76858,62 @@ var ts; case 118 /* ProtectedKeyword */: case 122 /* AbstractKeyword */: case 81 /* ConstKeyword */: - case 130 /* DeclareKeyword */: - case 138 /* ReadonlyKeyword */: + case 131 /* DeclareKeyword */: + case 139 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided // falls through - case 174 /* ArrayType */: - case 175 /* TupleType */: - case 176 /* OptionalType */: - case 177 /* RestType */: - case 173 /* TypeLiteral */: - case 168 /* TypePredicate */: - case 155 /* TypeParameter */: + case 175 /* ArrayType */: + case 176 /* TupleType */: + case 177 /* OptionalType */: + case 178 /* RestType */: + case 174 /* TypeLiteral */: + case 169 /* TypePredicate */: + case 156 /* TypeParameter */: case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 128 /* BooleanKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 137 /* NeverKeyword */: + case 149 /* UnknownKeyword */: + case 129 /* BooleanKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 138 /* NeverKeyword */: case 110 /* VoidKeyword */: - case 144 /* SymbolKeyword */: - case 171 /* ConstructorType */: - case 170 /* FunctionType */: - case 172 /* TypeQuery */: - case 169 /* TypeReference */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 180 /* ConditionalType */: - case 182 /* ParenthesizedType */: - case 183 /* ThisType */: - case 184 /* TypeOperator */: - case 185 /* IndexedAccessType */: - case 186 /* MappedType */: - case 187 /* LiteralType */: + case 145 /* SymbolKeyword */: + case 172 /* ConstructorType */: + case 171 /* FunctionType */: + case 173 /* TypeQuery */: + case 170 /* TypeReference */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 181 /* ConditionalType */: + case 183 /* ParenthesizedType */: + case 184 /* ThisType */: + case 185 /* TypeOperator */: + case 186 /* IndexedAccessType */: + case 187 /* MappedType */: + case 188 /* LiteralType */: // TypeScript type nodes are elided. // falls through - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: // TypeScript index signatures are elided. // falls through - case 157 /* Decorator */: + case 158 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. // falls through - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. return undefined; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects return visitPropertyDeclaration(node); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: // TypeScript namespace export declarations are elided. return undefined; - case 162 /* Constructor */: + case 163 /* Constructor */: return visitConstructor(node); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return ts.createNotEmittedStatement(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: // This may be a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -76524,7 +76923,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: // This may be a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -76534,35 +76933,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: // This may be a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 156 /* Parameter */: + case 157 /* Parameter */: // This may be a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -76572,35 +76971,35 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return visitCallExpression(node); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return visitNewExpression(node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); default: @@ -77013,12 +77412,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -77171,7 +77570,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 159 /* PropertyDeclaration */ + ? member.kind === 160 /* PropertyDeclaration */ // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it // should not invoke `Object.getOwnPropertyDescriptor`. ? ts.createVoidZero() @@ -77294,10 +77693,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */ - || kind === 159 /* PropertyDeclaration */; + return kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */ + || kind === 160 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -77307,7 +77706,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 161 /* MethodDeclaration */; + return node.kind === 162 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -77318,12 +77717,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return true; } return false; @@ -77340,15 +77739,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 159 /* PropertyDeclaration */: - case 156 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 157 /* Parameter */: return serializeTypeNode(node.type); - case 164 /* SetAccessor */: - case 163 /* GetAccessor */: + case 165 /* SetAccessor */: + case 164 /* GetAccessor */: return serializeTypeNode(getAccessorTypeNode(node)); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 161 /* MethodDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 162 /* MethodDeclaration */: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); @@ -77385,7 +77784,7 @@ var ts; return ts.createArrayLiteral(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 163 /* GetAccessor */) { + if (container && node.kind === 164 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -77431,30 +77830,30 @@ var ts; } switch (node.kind) { case 110 /* VoidKeyword */: - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: case 100 /* NullKeyword */: - case 137 /* NeverKeyword */: + case 138 /* NeverKeyword */: return ts.createVoidZero(); - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: return ts.createIdentifier("Function"); - case 174 /* ArrayType */: - case 175 /* TupleType */: + case 175 /* ArrayType */: + case 176 /* TupleType */: return ts.createIdentifier("Array"); - case 168 /* TypePredicate */: - case 128 /* BooleanKeyword */: + case 169 /* TypePredicate */: + case 129 /* BooleanKeyword */: return ts.createIdentifier("Boolean"); - case 143 /* StringKeyword */: + case 144 /* StringKeyword */: return ts.createIdentifier("String"); - case 141 /* ObjectKeyword */: + case 142 /* ObjectKeyword */: return ts.createIdentifier("Object"); - case 187 /* LiteralType */: + case 188 /* LiteralType */: switch (node.literal.kind) { case 10 /* StringLiteral */: return ts.createIdentifier("String"); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: case 8 /* NumericLiteral */: return ts.createIdentifier("Number"); case 9 /* BigIntLiteral */: @@ -77465,34 +77864,34 @@ var ts; default: return ts.Debug.failBadSyntaxKind(node.literal); } - case 140 /* NumberKeyword */: + case 141 /* NumberKeyword */: return ts.createIdentifier("Number"); - case 151 /* BigIntKeyword */: + case 152 /* BigIntKeyword */: return getGlobalBigIntNameWithFallback(); - case 144 /* SymbolKeyword */: + case 145 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return serializeTypeReferenceNode(node); - case 179 /* IntersectionType */: - case 178 /* UnionType */: + case 180 /* IntersectionType */: + case 179 /* UnionType */: return serializeTypeList(node.types); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return serializeTypeList([node.trueType, node.falseType]); - case 184 /* TypeOperator */: - if (node.operator === 138 /* ReadonlyKeyword */) { + case 185 /* TypeOperator */: + if (node.operator === 139 /* ReadonlyKeyword */) { return serializeTypeNode(node.type); } break; - case 172 /* TypeQuery */: - case 185 /* IndexedAccessType */: - case 186 /* MappedType */: - case 173 /* TypeLiteral */: + case 173 /* TypeQuery */: + case 186 /* IndexedAccessType */: + case 187 /* MappedType */: + case 174 /* TypeLiteral */: case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 183 /* ThisType */: - case 188 /* ImportType */: + case 149 /* UnknownKeyword */: + case 184 /* ThisType */: + case 189 /* ImportType */: break; default: return ts.Debug.failBadSyntaxKind(node); @@ -77505,13 +77904,13 @@ var ts; var serializedUnion; for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { var typeNode = types_20[_i]; - while (typeNode.kind === 182 /* ParenthesizedType */) { + while (typeNode.kind === 183 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 137 /* NeverKeyword */) { + if (typeNode.kind === 138 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 146 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 147 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var serializedIndividual = serializeTypeNode(typeNode); @@ -77620,7 +78019,7 @@ var ts; name.original = undefined; name.parent = ts.getParseTreeNode(currentLexicalScope); // ensure the parent is set to a parse tree node. return name; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return serializeQualifiedNameAsExpression(node); } } @@ -78180,12 +78579,12 @@ var ts; // enums in any other scope are emitted as a `let` declaration. var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)) - ], currentLexicalScope.kind === 290 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); + ], currentLexicalScope.kind === 291 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 248 /* EnumDeclaration */) { + if (node.kind === 249 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -78310,7 +78709,7 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 250 /* ModuleBlock */) { + if (body.kind === 251 /* ModuleBlock */) { saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; @@ -78356,13 +78755,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (body.kind !== 250 /* ModuleBlock */) { + if (body.kind !== 251 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 249 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 250 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -78412,7 +78811,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 256 /* NamespaceImport */) { + if (node.kind === 257 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -78660,16 +79059,16 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(75 /* Identifier */); - context.enableSubstitution(282 /* ShorthandPropertyAssignment */); + context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(249 /* ModuleDeclaration */); + context.enableEmitNotification(250 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 249 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 250 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 248 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 249 /* EnumDeclaration */; } /** * Hook for node emit. @@ -78730,9 +79129,9 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -78770,9 +79169,9 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 290 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 249 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 248 /* EnumDeclaration */); + if (container && container.kind !== 291 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 250 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 249 /* EnumDeclaration */); if (substitute) { return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), /*location*/ node); @@ -78923,40 +79322,40 @@ var ts; if (!(node.transformFlags & 4194304 /* ContainsClassFields */)) return node; switch (node.kind) { - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: return visitClassLike(node); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return visitPropertyAccessExpression(node); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return visitPrefixUnaryExpression(node); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return visitPostfixUnaryExpression(node, /*valueIsDiscarded*/ false); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return visitCallExpression(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node); case 76 /* PrivateIdentifier */: return visitPrivateIdentifier(node); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return visitExpressionStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); } return ts.visitEachChild(node, visitor, context); } function visitorDestructuringTarget(node) { switch (node.kind) { - case 193 /* ObjectLiteralExpression */: - case 192 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return visitAssignmentPattern(node); default: return visitor(node); @@ -78979,20 +79378,20 @@ var ts; */ function classElementVisitor(node) { switch (node.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: // Constructors for classes using class fields are transformed in // `visitClassDeclaration` or `visitClassExpression`. return undefined; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 161 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 162 /* MethodDeclaration */: // Visit the name of the member (if it's a computed property name). return ts.visitEachChild(node, classElementVisitor, context); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 222 /* SemicolonClassElement */: + case 223 /* SemicolonClassElement */: return node; default: return visitor(node); @@ -79758,31 +80157,31 @@ var ts; case 126 /* AsyncKeyword */: // ES2017 async modifier should be elided for targets < ES2017 return undefined; - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return visitAwaitExpression(node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 102 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 162 /* Constructor */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 163 /* Constructor */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -79791,27 +80190,27 @@ var ts; function asyncBodyVisitor(node) { if (ts.isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatementInAsyncBody(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatementInAsyncBody(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatementInAsyncBody(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatementInAsyncBody(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClauseInAsyncBody(node); - case 223 /* Block */: - case 237 /* SwitchStatement */: - case 251 /* CaseBlock */: - case 277 /* CaseClause */: - case 278 /* DefaultClause */: - case 240 /* TryStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 227 /* IfStatement */: - case 236 /* WithStatement */: - case 238 /* LabeledStatement */: + case 224 /* Block */: + case 238 /* SwitchStatement */: + case 252 /* CaseBlock */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: + case 241 /* TryStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 228 /* IfStatement */: + case 237 /* WithStatement */: + case 239 /* LabeledStatement */: return ts.visitEachChild(node, asyncBodyVisitor, context); default: return ts.Debug.assertNever(node, "Unhandled node."); @@ -80016,7 +80415,7 @@ var ts; var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 202 /* ArrowFunction */; + var isArrowFunction = node.kind === 203 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current @@ -80107,17 +80506,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(196 /* CallExpression */); - context.enableSubstitution(194 /* PropertyAccessExpression */); - context.enableSubstitution(195 /* ElementAccessExpression */); + context.enableSubstitution(197 /* CallExpression */); + context.enableSubstitution(195 /* PropertyAccessExpression */); + context.enableSubstitution(196 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(245 /* ClassDeclaration */); - context.enableEmitNotification(161 /* MethodDeclaration */); - context.enableEmitNotification(163 /* GetAccessor */); - context.enableEmitNotification(164 /* SetAccessor */); - context.enableEmitNotification(162 /* Constructor */); + context.enableEmitNotification(246 /* ClassDeclaration */); + context.enableEmitNotification(162 /* MethodDeclaration */); + context.enableEmitNotification(164 /* GetAccessor */); + context.enableEmitNotification(165 /* SetAccessor */); + context.enableEmitNotification(163 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(225 /* VariableStatement */); + context.enableEmitNotification(226 /* VariableStatement */); } } /** @@ -80165,11 +80564,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -80201,11 +80600,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 245 /* ClassDeclaration */ - || kind === 162 /* Constructor */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */; + return kind === 246 /* ClassDeclaration */ + || kind === 163 /* Constructor */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -80373,64 +80772,64 @@ var ts; return node; } switch (node.kind) { - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return visitAwaitExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return visitYieldExpression(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitReturnStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitLabeledStatement(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node, noDestructuringValue); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClause(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return visitVoidExpression(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return doWithLexicalThis(visitConstructorDeclaration, node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return doWithLexicalThis(visitMethodDeclaration, node); - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: return doWithLexicalThis(visitGetAccessorDeclaration, node); - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: return doWithLexicalThis(visitSetAccessorDeclaration, node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return doWithLexicalThis(visitFunctionDeclaration, node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return doWithLexicalThis(visitFunctionExpression, node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return visitArrowFunction(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return visitParameter(node); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return visitExpressionStatement(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, noDestructuringValue); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 102 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return doWithLexicalThis(visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -80464,7 +80863,7 @@ var ts; function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2 /* Async */) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 232 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 233 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node); @@ -80476,7 +80875,7 @@ var ts; var objects = []; for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { var e = elements_4[_i]; - if (e.kind === 283 /* SpreadAssignment */) { + if (e.kind === 284 /* SpreadAssignment */) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -80485,7 +80884,7 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - chunkObject = ts.append(chunkObject, e.kind === 281 /* PropertyAssignment */ + chunkObject = ts.append(chunkObject, e.kind === 282 /* PropertyAssignment */ ? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } @@ -80519,7 +80918,7 @@ var ts; // If we translate the above to `__assign({}, k, l)`, the `l` will evaluate before `k` is spread and we // end up with `{ a: 1, b: 2, c: 3 }` var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 193 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 194 /* ObjectLiteralExpression */) { objects.unshift(ts.createObjectLiteral()); } var expression = objects[0]; @@ -80897,17 +81296,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(196 /* CallExpression */); - context.enableSubstitution(194 /* PropertyAccessExpression */); - context.enableSubstitution(195 /* ElementAccessExpression */); + context.enableSubstitution(197 /* CallExpression */); + context.enableSubstitution(195 /* PropertyAccessExpression */); + context.enableSubstitution(196 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(245 /* ClassDeclaration */); - context.enableEmitNotification(161 /* MethodDeclaration */); - context.enableEmitNotification(163 /* GetAccessor */); - context.enableEmitNotification(164 /* SetAccessor */); - context.enableEmitNotification(162 /* Constructor */); + context.enableEmitNotification(246 /* ClassDeclaration */); + context.enableEmitNotification(162 /* MethodDeclaration */); + context.enableEmitNotification(164 /* GetAccessor */); + context.enableEmitNotification(165 /* SetAccessor */); + context.enableEmitNotification(163 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(225 /* VariableStatement */); + context.enableEmitNotification(226 /* VariableStatement */); } } /** @@ -80955,11 +81354,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -80991,11 +81390,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 245 /* ClassDeclaration */ - || kind === 162 /* Constructor */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */; + return kind === 246 /* ClassDeclaration */ + || kind === 163 /* Constructor */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -81093,7 +81492,7 @@ var ts; return node; } switch (node.kind) { - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -81125,21 +81524,21 @@ var ts; return node; } switch (node.kind) { - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: - case 196 /* CallExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: + case 197 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { var updated = visitOptionalExpression(node, /*captureThisArg*/ false, /*isDelete*/ false); ts.Debug.assertNotNode(updated, ts.isSyntheticReference); return updated; } return ts.visitEachChild(node, visitor, context); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (node.operatorToken.kind === 60 /* QuestionQuestionToken */) { return transformNullishCoalescingExpression(node); } return ts.visitEachChild(node, visitor, context); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return visitDeleteExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -81179,7 +81578,7 @@ var ts; thisArg = expression; } } - expression = node.kind === 194 /* PropertyAccessExpression */ + expression = node.kind === 195 /* PropertyAccessExpression */ ? ts.updatePropertyAccess(node, expression, ts.visitNode(node.name, visitor, ts.isIdentifier)) : ts.updateElementAccess(node, expression, ts.visitNode(node.argumentExpression, visitor, ts.isExpression)); return thisArg ? ts.createSyntheticReferenceExpression(expression, thisArg) : expression; @@ -81193,10 +81592,10 @@ var ts; } function visitNonOptionalExpression(node, captureThisArg, isDelete) { switch (node.kind) { - case 200 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 196 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); + case 201 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); + case 197 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); default: return ts.visitNode(node, visitor, ts.isExpression); } } @@ -81215,8 +81614,8 @@ var ts; for (var i = 0; i < chain.length; i++) { var segment = chain[i]; switch (segment.kind) { - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: if (i === chain.length - 1 && captureThisArg) { if (shouldCaptureInTempVariable(rightExpression)) { thisArg = ts.createTempVariable(hoistVariableDeclaration); @@ -81226,11 +81625,11 @@ var ts; thisArg = rightExpression; } } - rightExpression = segment.kind === 194 /* PropertyAccessExpression */ + rightExpression = segment.kind === 195 /* PropertyAccessExpression */ ? ts.createPropertyAccess(rightExpression, ts.visitNode(segment.name, visitor, ts.isIdentifier)) : ts.createElementAccess(rightExpression, ts.visitNode(segment.argumentExpression, visitor, ts.isExpression)); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (i === 0 && leftThisArg) { rightExpression = ts.createFunctionCall(rightExpression, leftThisArg.kind === 102 /* SuperKeyword */ ? ts.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression)); } @@ -81328,13 +81727,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 266 /* JsxElement */: + case 267 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ false); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -81344,13 +81743,13 @@ var ts; switch (node.kind) { case 11 /* JsxText */: return visitJsxText(node); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return visitJsxExpression(node); - case 266 /* JsxElement */: + case 267 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ true); default: return ts.Debug.failBadSyntaxKind(node); @@ -81425,7 +81824,7 @@ var ts; literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile); return ts.setTextRange(literal, node); } - else if (node.kind === 276 /* JsxExpression */) { + else if (node.kind === 277 /* JsxExpression */) { if (node.expression === undefined) { return ts.createTrue(); } @@ -81519,7 +81918,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 266 /* JsxElement */) { + if (node.kind === 267 /* JsxElement */) { return getTagName(node.openingElement); } else { @@ -81825,7 +82224,7 @@ var ts; return node; } switch (node.kind) { - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -82038,13 +82437,13 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 - && node.kind === 235 /* ReturnStatement */ + && node.kind === 236 /* ReturnStatement */ && !node.expression; } function shouldVisitNode(node) { return (node.transformFlags & 256 /* ContainsES2015 */) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 223 /* Block */))) + || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 224 /* Block */))) || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatement(node)) || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0; } @@ -82066,63 +82465,63 @@ var ts; switch (node.kind) { case 120 /* StaticKeyword */: return undefined; // elide static keyword - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return visitClassDeclaration(node); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return visitClassExpression(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return visitParameter(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return visitArrowFunction(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return visitFunctionExpression(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return visitVariableDeclaration(node); case 75 /* Identifier */: return visitIdentifier(node); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return visitSwitchStatement(node); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return visitCaseBlock(node); - case 223 /* Block */: + case 224 /* Block */: return visitBlock(node, /*isFunctionBody*/ false); - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitLabeledStatement(node); - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node, /*outermostLabeledStatement*/ undefined); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return visitExpressionStatement(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClause(node); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return visitCallExpression(node); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return visitNewExpression(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 14 /* NoSubstitutionTemplateLiteral */: case 15 /* TemplateHead */: @@ -82133,28 +82532,28 @@ var ts; return visitStringLiteral(node); case 8 /* NumericLiteral */: return visitNumericLiteral(node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: return visitTemplateExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return visitYieldExpression(node); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return visitSpreadElement(node); case 102 /* SuperKeyword */: return visitSuperKeyword(/*isExpressionOfCall*/ false); case 104 /* ThisKeyword */: return visitThisKeyword(node); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return visitMetaProperty(node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return visitAccessorDeclaration(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitReturnStatement(node); default: return ts.visitEachChild(node, visitor, context); @@ -82245,14 +82644,14 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 234 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 235 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; var label = node.label; if (!label) { - if (node.kind === 234 /* BreakStatement */) { + if (node.kind === 235 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -82263,7 +82662,7 @@ var ts; } } else { - if (node.kind === 234 /* BreakStatement */) { + if (node.kind === 235 /* BreakStatement */) { labelMarker = "break-" + label.escapedText; setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker); } @@ -82659,11 +83058,11 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 235 /* ReturnStatement */) { + if (statement.kind === 236 /* ReturnStatement */) { return true; } // An if-statement with two covered branches is covered. - else if (statement.kind === 227 /* IfStatement */) { + else if (statement.kind === 228 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && @@ -82671,7 +83070,7 @@ var ts; } } // A block is covered if it has a last statement which is covered. - else if (statement.kind === 223 /* Block */) { + else if (statement.kind === 224 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -82869,7 +83268,7 @@ var ts; * @param node A node. */ function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 202 /* ArrowFunction */) { + if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 203 /* ArrowFunction */) { insertCaptureThisForNode(statements, node, ts.createThis()); return true; } @@ -82890,22 +83289,22 @@ var ts; if (hierarchyFacts & 16384 /* NewTarget */) { var newTarget = void 0; switch (node.kind) { - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return statements; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // Methods and accessors cannot be constructors, so 'new.target' will // always return 'undefined'. newTarget = ts.createVoidZero(); break; - case 162 /* Constructor */: + case 163 /* Constructor */: // Class constructors can only be called with `new`, so `this.constructor` // should be relatively safe to use. newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"); break; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: // Functions can be called or constructed, and may have a `this` due to // being a member or when calling an imported function via `other_1.f()`. newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), 98 /* InstanceOfKeyword */, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"), ts.createVoidZero()); @@ -82937,20 +83336,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 222 /* SemicolonClassElement */: + case 223 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 162 /* Constructor */: + case 163 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -83152,7 +83551,7 @@ var ts; : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 244 /* FunctionDeclaration */ || node.kind === 201 /* FunctionExpression */)) { + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 245 /* FunctionDeclaration */ || node.kind === 202 /* FunctionExpression */)) { name = ts.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */); @@ -83196,7 +83595,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 202 /* ArrowFunction */); + ts.Debug.assert(node.kind === 203 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -83264,9 +83663,9 @@ var ts; function visitExpressionStatement(node) { // If we are here it is most likely because our expression is a destructuring assignment. switch (node.expression.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return ts.updateExpressionStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return ts.updateExpressionStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } return ts.visitEachChild(node, visitor, context); @@ -83285,9 +83684,9 @@ var ts; // expression. If we are in a state where we do not need the destructuring value, // we pass that information along to the children that care about it. switch (node.expression.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return ts.updateParen(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return ts.updateParen(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } } @@ -83501,14 +83900,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -83696,7 +84095,7 @@ var ts; && i < numInitialPropertiesWithoutYield) { numInitialPropertiesWithoutYield = i; } - if (property.name.kind === 154 /* ComputedPropertyName */) { + if (property.name.kind === 155 /* ComputedPropertyName */) { numInitialProperties = i; break; } @@ -83817,11 +84216,11 @@ var ts; } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 230 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 231 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); - case 232 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); - case 228 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); - case 229 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); + case 231 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); + case 232 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); + case 233 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); + case 229 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); + case 230 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); default: return ts.Debug.failBadSyntaxKind(node, "IterationStatement expected"); } } @@ -83846,11 +84245,11 @@ var ts; function createConvertedLoopState(node) { var loopInitializer; switch (node.kind) { - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 243 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 244 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -84249,20 +84648,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -84369,7 +84768,7 @@ var ts; var updated; var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 163 /* GetAccessor */) { + if (node.kind === 164 /* GetAccessor */) { updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -84861,13 +85260,13 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(104 /* ThisKeyword */); - context.enableEmitNotification(162 /* Constructor */); - context.enableEmitNotification(161 /* MethodDeclaration */); - context.enableEmitNotification(163 /* GetAccessor */); - context.enableEmitNotification(164 /* SetAccessor */); - context.enableEmitNotification(202 /* ArrowFunction */); - context.enableEmitNotification(201 /* FunctionExpression */); - context.enableEmitNotification(244 /* FunctionDeclaration */); + context.enableEmitNotification(163 /* Constructor */); + context.enableEmitNotification(162 /* MethodDeclaration */); + context.enableEmitNotification(164 /* GetAccessor */); + context.enableEmitNotification(165 /* SetAccessor */); + context.enableEmitNotification(203 /* ArrowFunction */); + context.enableEmitNotification(202 /* FunctionExpression */); + context.enableEmitNotification(245 /* FunctionDeclaration */); } } /** @@ -84908,10 +85307,10 @@ var ts; */ function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 191 /* BindingElement */: - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 242 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 243 /* VariableDeclaration */: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } @@ -84993,11 +85392,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 226 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 227 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 196 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 197 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -85005,7 +85404,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 213 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 214 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -85045,15 +85444,15 @@ var ts; if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(268 /* JsxOpeningElement */); - context.enableEmitNotification(269 /* JsxClosingElement */); - context.enableEmitNotification(267 /* JsxSelfClosingElement */); + context.enableEmitNotification(269 /* JsxOpeningElement */); + context.enableEmitNotification(270 /* JsxClosingElement */); + context.enableEmitNotification(268 /* JsxSelfClosingElement */); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(194 /* PropertyAccessExpression */); - context.enableSubstitution(281 /* PropertyAssignment */); + context.enableSubstitution(195 /* PropertyAccessExpression */); + context.enableSubstitution(282 /* PropertyAssignment */); return ts.chainBundle(transformSourceFile); /** * Transforms an ES5 source file to ES3. @@ -85072,9 +85471,9 @@ var ts; */ function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 268 /* JsxOpeningElement */: - case 269 /* JsxClosingElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 270 /* JsxClosingElement */: + case 268 /* JsxSelfClosingElement */: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -85409,13 +85808,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 228 /* DoStatement */: + case 229 /* DoStatement */: return visitDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return visitWhileStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return visitSwitchStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -85428,24 +85827,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return visitFunctionExpression(node); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return visitAccessorDeclaration(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatement(node); - case 234 /* BreakStatement */: + case 235 /* BreakStatement */: return visitBreakStatement(node); - case 233 /* ContinueStatement */: + case 234 /* ContinueStatement */: return visitContinueStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 262144 /* ContainsYield */) { @@ -85466,21 +85865,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return visitConditionalExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return visitYieldExpression(node); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return visitCallExpression(node); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -85493,9 +85892,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return visitFunctionExpression(node); default: return ts.Debug.failBadSyntaxKind(node); @@ -85703,7 +86102,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -85715,7 +86114,7 @@ var ts; // _a.b = %sent%; target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -86091,35 +86490,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 223 /* Block */: + case 224 /* Block */: return transformAndEmitBlock(node); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return transformAndEmitIfStatement(node); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return transformAndEmitDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return transformAndEmitForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 233 /* ContinueStatement */: + case 234 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 234 /* BreakStatement */: + case 235 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return transformAndEmitWithStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -86549,7 +86948,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 278 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 279 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -86562,7 +86961,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 277 /* CaseClause */) { + if (clause.kind === 278 /* CaseClause */) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -87791,11 +88190,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(209 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(207 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(208 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(290 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(210 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(208 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(209 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(291 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var currentSourceFile; // The current file. @@ -88119,23 +88518,23 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return visitImportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return visitExportDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitExportAssignment(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return visitClassDeclaration(node); - case 328 /* MergeDeclarationMarker */: + case 329 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 329 /* EndOfDeclarationMarker */: + case 330 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, moduleExpressionElementVisitor, context); @@ -88162,24 +88561,24 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var elem = _a[_i]; switch (elem.kind) { - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return false; default: ts.Debug.assertNever(elem, "Unhandled object member kind"); } @@ -88679,7 +89078,7 @@ var ts; // // To balance the declaration, add the exports of the elided variable // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -88734,10 +89133,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 257 /* NamedImports */: + case 258 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding, /* liveBinding */ true); @@ -88950,7 +89349,7 @@ var ts; * @param emit A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -89014,10 +89413,10 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return substituteBinaryExpression(node); - case 208 /* PostfixUnaryExpression */: - case 207 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -89038,7 +89437,7 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 290 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 291 /* SourceFile */) { return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), /*location*/ node); } @@ -89113,7 +89512,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 208 /* PostfixUnaryExpression */ + var expression = node.kind === 209 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 45 /* PlusPlusToken */ ? 63 /* PlusEqualsToken */ : 64 /* MinusEqualsToken */), ts.createLiteral(1)), /*location*/ node) : node; @@ -89212,12 +89611,12 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols - context.enableSubstitution(209 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(207 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(208 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(219 /* MetaProperty */); // Substitutes 'import.meta' - context.enableEmitNotification(290 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols + context.enableSubstitution(210 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(208 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(209 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(220 /* MetaProperty */); // Substitutes 'import.meta' + context.enableEmitNotification(291 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var exportFunctionsMap = []; // The export function associated with a source file. @@ -89441,7 +89840,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 260 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 261 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -89466,7 +89865,7 @@ var ts; } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 260 /* ExportDeclaration */) { + if (externalImport.kind !== 261 /* ExportDeclaration */) { continue; } if (!externalImport.exportClause) { @@ -89549,19 +89948,19 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); // TODO: GH#18217 switch (entry.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // falls through - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(ts.createExpressionStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { if (ts.isNamedExports(entry.exportClause)) { @@ -89620,13 +90019,13 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return visitImportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return visitExportDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -89806,7 +90205,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 290 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 291 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -89870,7 +90269,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -89932,10 +90331,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 257 /* NamedImports */: + case 258 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -90115,43 +90514,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return visitClassDeclaration(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatement(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatement(node); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return visitDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return visitWhileStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitLabeledStatement(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return visitWithStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return visitSwitchStatement(node); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return visitCaseBlock(node); - case 277 /* CaseClause */: + case 278 /* CaseClause */: return visitCaseClause(node); - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: return visitDefaultClause(node); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return visitTryStatement(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClause(node); - case 223 /* Block */: + case 224 /* Block */: return visitBlock(node); - case 328 /* MergeDeclarationMarker */: + case 329 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 329 /* EndOfDeclarationMarker */: + case 330 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -90398,7 +90797,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 290 /* SourceFile */; + return container !== undefined && container.kind === 291 /* SourceFile */; } else { return false; @@ -90431,7 +90830,7 @@ var ts; * @param emitCallback A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -90481,7 +90880,7 @@ var ts; */ function substituteUnspecified(node) { switch (node.kind) { - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return substituteShorthandPropertyAssignment(node); } return node; @@ -90517,12 +90916,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return substituteBinaryExpression(node); - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return substituteMetaProperty(node); } return node; @@ -90615,14 +91014,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 208 /* PostfixUnaryExpression */ + var expression = node.kind === 209 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) { var exportName = exportedNames_5[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 208 /* PostfixUnaryExpression */) { + if (node.kind === 209 /* PostfixUnaryExpression */) { expression = node.operator === 45 /* PlusPlusToken */ ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -90650,7 +91049,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 290 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 291 /* SourceFile */) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -90689,7 +91088,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(290 /* SourceFile */); + context.enableEmitNotification(291 /* SourceFile */); context.enableSubstitution(75 /* Identifier */); var helperNameSubstitutions; return ts.chainBundle(transformSourceFile); @@ -90714,12 +91113,12 @@ var ts; } function visitor(node) { switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // Elide `import=` as it is not legal with --module ES6 return undefined; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitExportAssignment(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: var exportDecl = node; return visitExportDeclaration(exportDecl); } @@ -90850,7 +91249,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.kind === 246 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90879,7 +91278,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.kind === 246 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90926,7 +91325,7 @@ var ts; return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]); } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { + if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90935,8 +91334,8 @@ var ts; } // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit // The only exception here is if the constructor was marked as private. we are not emitting the constructor parameters at all. - else if (node.kind === 159 /* PropertyDeclaration */ || node.kind === 194 /* PropertyAccessExpression */ || node.kind === 158 /* PropertySignature */ || - (node.kind === 156 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { + else if (node.kind === 160 /* PropertyDeclaration */ || node.kind === 195 /* PropertyAccessExpression */ || node.kind === 159 /* PropertySignature */ || + (node.kind === 157 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -90945,7 +91344,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 245 /* ClassDeclaration */ || node.kind === 156 /* Parameter */) { + else if (node.parent.kind === 246 /* ClassDeclaration */ || node.kind === 157 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90970,7 +91369,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (node.kind === 164 /* SetAccessor */) { + if (node.kind === 165 /* SetAccessor */) { // Getters can infer the return type from the returned expression, but setters cannot, so the // "_from_external_module_1_but_cannot_be_named" case cannot occur. if (ts.hasModifier(node, 32 /* Static */)) { @@ -91009,26 +91408,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 165 /* CallSignature */: + case 166 /* CallSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.hasModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -91036,7 +91435,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.kind === 246 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -91050,7 +91449,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -91075,30 +91474,30 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 166 /* ConstructSignature */: - case 171 /* ConstructorType */: + case 167 /* ConstructSignature */: + case 172 /* ConstructorType */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 165 /* CallSignature */: + case 166 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -91106,7 +91505,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 246 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91119,15 +91518,15 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 244 /* FunctionDeclaration */: - case 170 /* FunctionType */: + case 245 /* FunctionDeclaration */: + case 171 /* FunctionType */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - case 164 /* SetAccessor */: - case 163 /* GetAccessor */: + case 165 /* SetAccessor */: + case 164 /* GetAccessor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91141,39 +91540,39 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 186 /* MappedType */: + case 187 /* MappedType */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 171 /* ConstructorType */: - case 166 /* ConstructSignature */: + case 172 /* ConstructorType */: + case 167 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 165 /* CallSignature */: + case 166 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 246 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 170 /* FunctionType */: - case 244 /* FunctionDeclaration */: + case 171 /* FunctionType */: + case 245 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -91188,7 +91587,7 @@ var ts; function getHeritageClauseVisibilityError() { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 245 /* ClassDeclaration */) { + if (node.parent.parent.kind === 246 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible diagnosticMessage = ts.isHeritageClause(node.parent) && node.parent.token === 113 /* ImplementsKeyword */ ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : @@ -91239,7 +91638,7 @@ var ts; } function isInternalDeclaration(node, currentSourceFile) { var parseTreeNode = ts.getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 156 /* Parameter */) { + if (parseTreeNode && parseTreeNode.kind === 157 /* Parameter */) { var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : undefined; var text = currentSourceFile.text; @@ -91398,10 +91797,10 @@ var ts; return result; } function transformRoot(node) { - if (node.kind === 290 /* SourceFile */ && node.isDeclarationFile) { + if (node.kind === 291 /* SourceFile */ && node.isDeclarationFile) { return node; } - if (node.kind === 291 /* Bundle */) { + if (node.kind === 292 /* Bundle */) { isBundledEmit = true; refs = ts.createMap(); libs = ts.createMap(); @@ -91424,14 +91823,14 @@ var ts; resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules) needsDeclare = false; var statements = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile, /*bundled*/ true)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); - var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(130 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); + var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(131 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); return newFile; } needsDeclare = true; var updated = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); return ts.updateSourceFileNode(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); }), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 293 /* InputFiles */) { + if (prepend.kind === 294 /* InputFiles */) { var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal); hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib; collectReferences(sourceFile, refs); @@ -91572,7 +91971,7 @@ var ts; return name; } else { - if (name.kind === 190 /* ArrayBindingPattern */) { + if (name.kind === 191 /* ArrayBindingPattern */) { return ts.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement)); } else { @@ -91580,7 +91979,7 @@ var ts; } } function visitBindingElement(elem) { - if (elem.kind === 215 /* OmittedExpression */) { + if (elem.kind === 216 /* OmittedExpression */) { return elem; } return ts.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined); @@ -91618,7 +92017,7 @@ var ts; // Literal const declarations will have an initializer ensured rather than a type return; } - var shouldUseResolverType = node.kind === 156 /* Parameter */ && + var shouldUseResolverType = node.kind === 157 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { @@ -91627,7 +92026,7 @@ var ts; if (!ts.getParseTreeNode(node)) { return type ? ts.visitNode(type, visitDeclarationSubtree) : ts.createKeywordTypeNode(125 /* AnyKeyword */); } - if (node.kind === 164 /* SetAccessor */) { + if (node.kind === 165 /* SetAccessor */) { // Set accessors with no associated type node (from it's param or get accessor return) are `any` since they are never contextually typed right now // (The inferred type here will be void, but the old declaration emitter printed `any`, so this replicates that) return ts.createKeywordTypeNode(125 /* AnyKeyword */); @@ -91638,12 +92037,12 @@ var ts; oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node); } - if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { + if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); } - if (node.kind === 156 /* Parameter */ - || node.kind === 159 /* PropertyDeclaration */ - || node.kind === 158 /* PropertySignature */) { + if (node.kind === 157 /* Parameter */ + || node.kind === 160 /* PropertyDeclaration */ + || node.kind === 159 /* PropertySignature */) { if (!node.initializer) return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType)); return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); @@ -91660,20 +92059,20 @@ var ts; function isDeclarationAndNotVisible(node) { node = ts.getParseTreeNode(node); switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 249 /* ModuleDeclaration */: - case 246 /* InterfaceDeclaration */: - case 245 /* ClassDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 248 /* EnumDeclaration */: + case 245 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 247 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: return !resolver.isDeclarationVisible(node); // The following should be doing their own visibility checks based on filtering their members - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return !getBindingNameVisible(node); - case 253 /* ImportEqualsDeclaration */: - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: - case 259 /* ExportAssignment */: + case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 260 /* ExportAssignment */: return false; } return false; @@ -91754,7 +92153,7 @@ var ts; function rewriteModuleSpecifier(parent, input) { if (!input) return undefined; // TODO: GH#18217 - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 249 /* ModuleDeclaration */ && parent.kind !== 188 /* ImportType */); + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 250 /* ModuleDeclaration */ && parent.kind !== 189 /* ImportType */); if (ts.isStringLiteralLike(input)) { if (isBundledEmit) { var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent); @@ -91774,7 +92173,7 @@ var ts; function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 265 /* ExternalModuleReference */) { + if (decl.moduleReference.kind === 266 /* ExternalModuleReference */) { // Rewrite external module names if necessary var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl); return ts.updateImportEqualsDeclaration(decl, @@ -91801,7 +92200,7 @@ var ts; return visibleDefaultBinding && ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, /*namedBindings*/ undefined, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)); } - if (decl.importClause.namedBindings.kind === 256 /* NamespaceImport */) { + if (decl.importClause.namedBindings.kind === 257 /* NamespaceImport */) { // Namespace import (optionally with visible default) var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : /*namedBindings*/ undefined; return visibleDefaultBinding || namedBindings ? ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, namedBindings, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined; @@ -91890,7 +92289,7 @@ var ts; // We'd see a TDZ violation at runtime var canProduceDiagnostic = ts.canProduceDiagnostics(input); var oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 173 /* TypeLiteral */ || input.kind === 186 /* MappedType */) && input.parent.kind !== 247 /* TypeAliasDeclaration */); + var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 174 /* TypeLiteral */ || input.kind === 187 /* MappedType */) && input.parent.kind !== 248 /* TypeAliasDeclaration */); // Emit methods which are private as properties with no type information if (ts.isMethodDeclaration(input) || ts.isMethodSignature(input)) { if (ts.hasModifier(input, 8 /* Private */)) { @@ -91911,38 +92310,38 @@ var ts; } if (isProcessedComponent(input)) { switch (input.kind) { - case 216 /* ExpressionWithTypeArguments */: { + case 217 /* ExpressionWithTypeArguments */: { if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateExpressionWithTypeArguments(node, ts.parenthesizeTypeParameters(node.typeArguments), node.expression)); } - case 169 /* TypeReference */: { + case 170 /* TypeReference */: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateTypeReferenceNode(node, node.typeName, ts.parenthesizeTypeParameters(node.typeArguments))); } - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: return cleanup(ts.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); - case 162 /* Constructor */: { + case 163 /* Constructor */: { // A constructor declaration may not have a type annotation - var ctor = ts.createSignatureDeclaration(162 /* Constructor */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0 /* None */), + var ctor = ts.createSignatureDeclaration(163 /* Constructor */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0 /* None */), /*type*/ undefined); ctor.modifiers = ts.createNodeArray(ensureModifiers(input)); return cleanup(ctor); } - case 161 /* MethodDeclaration */: { + case 162 /* MethodDeclaration */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } - var sig = ts.createSignatureDeclaration(160 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); + var sig = ts.createSignatureDeclaration(161 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); sig.name = input.name; sig.modifiers = ts.createNodeArray(ensureModifiers(input)); sig.questionToken = input.questionToken; return cleanup(sig); } - case 163 /* GetAccessor */: { + case 164 /* GetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -91951,7 +92350,7 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8 /* Private */)), ensureType(input, accessorType), /*body*/ undefined)); } - case 164 /* SetAccessor */: { + case 165 /* SetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -91959,31 +92358,31 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8 /* Private */)), /*body*/ undefined)); } - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updateProperty(input, /*decorators*/ undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 160 /* MethodSignature */: { + case 161 /* MethodSignature */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updateMethodSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), input.name, input.questionToken)); } - case 165 /* CallSignature */: { + case 166 /* CallSignature */: { return cleanup(ts.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 167 /* IndexSignature */: { + case 168 /* IndexSignature */: { return cleanup(ts.updateIndexSignature(input, /*decorators*/ undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || ts.createKeywordTypeNode(125 /* AnyKeyword */))); } - case 242 /* VariableDeclaration */: { + case 243 /* VariableDeclaration */: { if (ts.isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -91991,13 +92390,13 @@ var ts; suppressNewDiagnosticContexts = true; // Variable declaration types also suppress new diagnostic contexts, provided the contexts wouldn't be made for binding pattern types return cleanup(ts.updateTypeScriptVariableDeclaration(input, input.name, /*exclaimationToken*/ undefined, ensureType(input, input.type), ensureNoInitializer(input))); } - case 155 /* TypeParameter */: { + case 156 /* TypeParameter */: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(ts.updateTypeParameterDeclaration(input, input.name, /*constraint*/ undefined, /*defaultType*/ undefined)); } return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context)); } - case 180 /* ConditionalType */: { + case 181 /* ConditionalType */: { // We have to process conditional types in a special way because for visibility purposes we need to push a new enclosingDeclaration // just for the `infer` types in the true branch. It's an implicit declaration scope that only applies to _part_ of the type. var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree); @@ -92009,13 +92408,13 @@ var ts; var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree); return cleanup(ts.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 170 /* FunctionType */: { + case 171 /* FunctionType */: { return cleanup(ts.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 171 /* ConstructorType */: { + case 172 /* ConstructorType */: { return cleanup(ts.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 188 /* ImportType */: { + case 189 /* ImportType */: { if (!ts.isLiteralImportTypeNode(input)) return cleanup(input); return cleanup(ts.updateImportTypeNode(input, ts.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf)); @@ -92044,7 +92443,7 @@ var ts; } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 161 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); + return node.parent.kind === 162 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -92054,7 +92453,7 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 260 /* ExportDeclaration */: { + case 261 /* ExportDeclaration */: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -92064,7 +92463,7 @@ var ts; return ts.updateExportDeclaration(input, /*decorators*/ undefined, input.modifiers, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier), input.isTypeOnly); } - case 259 /* ExportAssignment */: { + case 260 /* ExportAssignment */: { // Always visible if the parent node isn't dropped for being not visible if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; @@ -92080,7 +92479,7 @@ var ts; errorNode: input }); }; var varDecl = ts.createVariableDeclaration(newId, resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); return [statement, ts.updateExportAssignment(input, input.decorators, input.modifiers, newId)]; } } @@ -92105,10 +92504,10 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 253 /* ImportEqualsDeclaration */: { + case 254 /* ImportEqualsDeclaration */: { return transformImportEqualsDeclaration(input); } - case 254 /* ImportDeclaration */: { + case 255 /* ImportDeclaration */: { return transformImportDeclaration(input); } } @@ -92129,14 +92528,14 @@ var ts; } var previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 247 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all + case 248 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all return cleanup(ts.updateTypeAliasDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode))); - case 246 /* InterfaceDeclaration */: { + case 247 /* InterfaceDeclaration */: { return cleanup(ts.updateInterfaceDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree))); } - case 244 /* FunctionDeclaration */: { + case 245 /* FunctionDeclaration */: { // Generators lose their generator-ness, excepting their return type var clean = cleanup(ts.updateFunctionDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), @@ -92184,10 +92583,10 @@ var ts; return clean; } } - case 249 /* ModuleDeclaration */: { + case 250 /* ModuleDeclaration */: { needsDeclare = false; var inner = input.body; - if (inner && inner.kind === 250 /* ModuleBlock */) { + if (inner && inner.kind === 251 /* ModuleBlock */) { var oldNeedsScopeFix = needsScopeFixMarker; var oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; @@ -92230,7 +92629,7 @@ var ts; /*decorators*/ undefined, mods, input.name, body)); } } - case 245 /* ClassDeclaration */: { + case 246 /* ClassDeclaration */: { var modifiers = ts.createNodeArray(ensureModifiers(input)); var typeParameters = ensureTypeParams(input, input.typeParameters); var ctor = ts.getFirstConstructorWithBody(input); @@ -92291,7 +92690,7 @@ var ts; typeName: input.name }); }; var varDecl = ts.createVariableDeclaration(newId_1, resolver.createTypeOfExpression(extendsClause_1.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); var heritageClauses = ts.createNodeArray(ts.map(input.heritageClauses, function (clause) { if (clause.token === 90 /* ExtendsKeyword */) { var oldDiag_2 = getSymbolAccessibilityDiagnostic; @@ -92311,10 +92710,10 @@ var ts; /*decorators*/ undefined, modifiers, input.name, typeParameters, heritageClauses, members)); } } - case 225 /* VariableStatement */: { + case 226 /* VariableStatement */: { return cleanup(transformVariableStatement(input)); } - case 248 /* EnumDeclaration */: { + case 249 /* EnumDeclaration */: { return cleanup(ts.updateEnumDeclaration(input, /*decorators*/ undefined, ts.createNodeArray(ensureModifiers(input)), input.name, ts.createNodeArray(ts.mapDefined(input.members, function (m) { if (shouldStripInternal(m)) return; @@ -92333,7 +92732,7 @@ var ts; if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 249 /* ModuleDeclaration */) { + if (input.kind === 250 /* ModuleDeclaration */) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -92354,7 +92753,7 @@ var ts; return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); })); } function recreateBindingElement(e) { - if (e.kind === 215 /* OmittedExpression */) { + if (e.kind === 216 /* OmittedExpression */) { return; } if (e.name) { @@ -92404,7 +92803,7 @@ var ts; function ensureModifierFlags(node) { var mask = 3071 /* All */ ^ (4 /* Public */ | 256 /* Async */); // No async modifiers in declaration files var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */; - var parentIsFile = node.parent.kind === 290 /* SourceFile */; + var parentIsFile = node.parent.kind === 291 /* SourceFile */; if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) { mask ^= 2 /* Ambient */; additions = 0 /* None */; @@ -92433,7 +92832,7 @@ var ts; } ts.transformDeclarations = transformDeclarations; function isAlwaysType(node) { - if (node.kind === 246 /* InterfaceDeclaration */) { + if (node.kind === 247 /* InterfaceDeclaration */) { return true; } return false; @@ -92458,7 +92857,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 163 /* GetAccessor */ + return accessor.kind === 164 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -92467,52 +92866,52 @@ var ts; } function canHaveLiteralInitializer(node) { switch (node.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return !ts.hasModifier(node, 8 /* Private */); - case 156 /* Parameter */: - case 242 /* VariableDeclaration */: + case 157 /* Parameter */: + case 243 /* VariableDeclaration */: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 249 /* ModuleDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 246 /* InterfaceDeclaration */: - case 245 /* ClassDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 248 /* EnumDeclaration */: - case 225 /* VariableStatement */: - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: - case 259 /* ExportAssignment */: + case 245 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 247 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: + case 226 /* VariableStatement */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 260 /* ExportAssignment */: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 166 /* ConstructSignature */: - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 167 /* IndexSignature */: - case 242 /* VariableDeclaration */: - case 155 /* TypeParameter */: - case 216 /* ExpressionWithTypeArguments */: - case 169 /* TypeReference */: - case 180 /* ConditionalType */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 188 /* ImportType */: + case 167 /* ConstructSignature */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 168 /* IndexSignature */: + case 243 /* VariableDeclaration */: + case 156 /* TypeParameter */: + case 217 /* ExpressionWithTypeArguments */: + case 170 /* TypeReference */: + case 181 /* ConditionalType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 189 /* ImportType */: return true; } return false; @@ -92645,7 +93044,7 @@ var ts; * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(331 /* Count */); + var enabledSyntaxKindFeatures = new Array(332 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -93009,7 +93408,7 @@ var ts; /*@internal*/ function getOutputPathsFor(sourceFile, host, forceDtsPaths) { var options = host.getCompilerOptions(); - if (sourceFile.kind === 291 /* Bundle */) { + if (sourceFile.kind === 292 /* Bundle */) { return getOutputPathsForBundle(options, forceDtsPaths); } else { @@ -93339,7 +93738,7 @@ var ts; mapRoot: compilerOptions.mapRoot, extendedDiagnostics: compilerOptions.extendedDiagnostics, }); - if (forceDtsEmit && declarationTransform.transformed[0].kind === 290 /* SourceFile */) { + if (forceDtsEmit && declarationTransform.transformed[0].kind === 291 /* SourceFile */) { var sourceFile = declarationTransform.transformed[0]; exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit; } @@ -93362,8 +93761,8 @@ var ts; ts.forEachChild(node, collectLinkedAliases); } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) { - var bundle = sourceFileOrBundle.kind === 291 /* Bundle */ ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 290 /* SourceFile */ ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 292 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 291 /* SourceFile */ ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; var sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -93404,7 +93803,7 @@ var ts; } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { return (mapOptions.sourceMap || mapOptions.inlineSourceMap) - && (sourceFileOrBundle.kind !== 290 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); + && (sourceFileOrBundle.kind !== 291 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); } function getSourceRoot(mapOptions) { // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the @@ -93515,7 +93914,7 @@ var ts; }; function createSourceFilesFromBundleBuildInfo(bundle, buildInfoDirectory, host) { var sourceFiles = bundle.sourceFiles.map(function (fileName) { - var sourceFile = ts.createNode(290 /* SourceFile */, 0, 0); + var sourceFile = ts.createNode(291 /* SourceFile */, 0, 0); sourceFile.fileName = ts.getRelativePathFromDirectory(host.getCurrentDirectory(), ts.getNormalizedAbsolutePath(fileName, buildInfoDirectory), !host.useCaseSensitiveFileNames()); sourceFile.text = ""; sourceFile.statements = ts.createNodeArray(); @@ -93527,7 +93926,7 @@ var ts; sourceFile.text = prologueInfo.text; sourceFile.end = prologueInfo.text.length; sourceFile.statements = ts.createNodeArray(prologueInfo.directives.map(function (directive) { - var statement = ts.createNode(226 /* ExpressionStatement */, directive.pos, directive.end); + var statement = ts.createNode(227 /* ExpressionStatement */, directive.pos, directive.end); statement.expression = ts.createNode(10 /* StringLiteral */, directive.expression.pos, directive.expression.end); statement.expression.text = directive.expression.text; return statement; @@ -93704,9 +94103,9 @@ var ts; break; } switch (node.kind) { - case 290 /* SourceFile */: return printFile(node); - case 291 /* Bundle */: return printBundle(node); - case 292 /* UnparsedSource */: return printUnparsedSource(node); + case 291 /* SourceFile */: return printFile(node); + case 292 /* Bundle */: return printBundle(node); + case 293 /* UnparsedSource */: return printUnparsedSource(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); @@ -93957,12 +94356,12 @@ var ts; } // falls through case 2 /* Comments */: - if (!commentsDisabled && node.kind !== 290 /* SourceFile */) { + if (!commentsDisabled && node.kind !== 291 /* SourceFile */) { return pipelineEmitWithComments; } // falls through case 3 /* SourceMaps */: - if (!sourceMapsDisabled && node.kind !== 290 /* SourceFile */ && !ts.isInJsonFile(node)) { + if (!sourceMapsDisabled && node.kind !== 291 /* SourceFile */ && !ts.isInJsonFile(node)) { return pipelineEmitWithSourceMap; } // falls through @@ -94004,15 +94403,15 @@ var ts; case 16 /* TemplateMiddle */: case 17 /* TemplateTail */: return emitLiteral(node, /*jsxAttributeEscape*/ false); - case 292 /* UnparsedSource */: - case 286 /* UnparsedPrepend */: + case 293 /* UnparsedSource */: + case 287 /* UnparsedPrepend */: return emitUnparsedSourceOrPrepend(node); - case 285 /* UnparsedPrologue */: + case 286 /* UnparsedPrologue */: return writeUnparsedNode(node); - case 287 /* UnparsedText */: - case 288 /* UnparsedInternalText */: + case 288 /* UnparsedText */: + case 289 /* UnparsedInternalText */: return emitUnparsedTextLike(node); - case 289 /* UnparsedSyntheticReference */: + case 290 /* UnparsedSyntheticReference */: return emitUnparsedSyntheticReference(node); // Identifiers case 75 /* Identifier */: @@ -94022,260 +94421,260 @@ var ts; return emitPrivateIdentifier(node); // Parse tree nodes // Names - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return emitQualifiedName(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return emitTypeParameter(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return emitParameter(node); - case 157 /* Decorator */: + case 158 /* Decorator */: return emitDecorator(node); // Type members - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: return emitPropertySignature(node); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 160 /* MethodSignature */: + case 161 /* MethodSignature */: return emitMethodSignature(node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return emitConstructor(node); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return emitAccessorDeclaration(node); - case 165 /* CallSignature */: + case 166 /* CallSignature */: return emitCallSignature(node); - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: return emitConstructSignature(node); - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: return emitIndexSignature(node); // Types - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return emitTypePredicate(node); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return emitTypeReference(node); - case 170 /* FunctionType */: + case 171 /* FunctionType */: return emitFunctionType(node); - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 171 /* ConstructorType */: + case 172 /* ConstructorType */: return emitConstructorType(node); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return emitTypeQuery(node); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return emitTypeLiteral(node); - case 174 /* ArrayType */: + case 175 /* ArrayType */: return emitArrayType(node); - case 175 /* TupleType */: + case 176 /* TupleType */: return emitTupleType(node); - case 176 /* OptionalType */: + case 177 /* OptionalType */: return emitOptionalType(node); - case 178 /* UnionType */: + case 179 /* UnionType */: return emitUnionType(node); - case 179 /* IntersectionType */: + case 180 /* IntersectionType */: return emitIntersectionType(node); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return emitConditionalType(node); - case 181 /* InferType */: + case 182 /* InferType */: return emitInferType(node); - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return emitParenthesizedType(node); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 183 /* ThisType */: + case 184 /* ThisType */: return emitThisType(); - case 184 /* TypeOperator */: + case 185 /* TypeOperator */: return emitTypeOperator(node); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 186 /* MappedType */: + case 187 /* MappedType */: return emitMappedType(node); - case 187 /* LiteralType */: + case 188 /* LiteralType */: return emitLiteralType(node); - case 188 /* ImportType */: + case 189 /* ImportType */: return emitImportTypeNode(node); - case 295 /* JSDocAllType */: + case 296 /* JSDocAllType */: writePunctuation("*"); return; - case 296 /* JSDocUnknownType */: + case 297 /* JSDocUnknownType */: writePunctuation("?"); return; - case 297 /* JSDocNullableType */: + case 298 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 298 /* JSDocNonNullableType */: + case 299 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 299 /* JSDocOptionalType */: + case 300 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 177 /* RestType */: - case 301 /* JSDocVariadicType */: + case 178 /* RestType */: + case 302 /* JSDocVariadicType */: return emitRestOrJSDocVariadicType(node); // Binding patterns - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return emitBindingElement(node); // Misc - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return emitTemplateSpan(node); - case 222 /* SemicolonClassElement */: + case 223 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 223 /* Block */: + case 224 /* Block */: return emitBlock(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return emitVariableStatement(node); - case 224 /* EmptyStatement */: + case 225 /* EmptyStatement */: return emitEmptyStatement(/*isEmbeddedStatement*/ false); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return emitExpressionStatement(node); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return emitIfStatement(node); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return emitDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return emitWhileStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return emitForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return emitForInStatement(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return emitForOfStatement(node); - case 233 /* ContinueStatement */: + case 234 /* ContinueStatement */: return emitContinueStatement(node); - case 234 /* BreakStatement */: + case 235 /* BreakStatement */: return emitBreakStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return emitReturnStatement(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return emitWithStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return emitSwitchStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return emitLabeledStatement(node); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return emitThrowStatement(node); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return emitTryStatement(node); - case 241 /* DebuggerStatement */: + case 242 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return emitClassDeclaration(node); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return emitModuleBlock(node); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return emitCaseBlock(node); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return emitImportDeclaration(node); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return emitImportClause(node); - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return emitNamespaceImport(node); - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: return emitNamespaceExport(node); - case 257 /* NamedImports */: + case 258 /* NamedImports */: return emitNamedImports(node); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return emitImportSpecifier(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return emitExportAssignment(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return emitExportDeclaration(node); - case 261 /* NamedExports */: + case 262 /* NamedExports */: return emitNamedExports(node); - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: return emitExportSpecifier(node); - case 264 /* MissingDeclaration */: + case 265 /* MissingDeclaration */: return; // Module references - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 11 /* JsxText */: return emitJsxText(node); - case 268 /* JsxOpeningElement */: - case 271 /* JsxOpeningFragment */: + case 269 /* JsxOpeningElement */: + case 272 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 269 /* JsxClosingElement */: - case 272 /* JsxClosingFragment */: + case 270 /* JsxClosingElement */: + case 273 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return emitJsxAttribute(node); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return emitJsxAttributes(node); - case 275 /* JsxSpreadAttribute */: + case 276 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 277 /* CaseClause */: + case 278 /* CaseClause */: return emitCaseClause(node); - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: return emitDefaultClause(node); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: return emitHeritageClause(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 284 /* EnumMember */: + case 285 /* EnumMember */: return emitEnumMember(node); // JSDoc nodes (only used in codefixes currently) - case 317 /* JSDocParameterTag */: - case 323 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: + case 324 /* JSDocPropertyTag */: return emitJSDocPropertyLikeTag(node); - case 318 /* JSDocReturnTag */: - case 320 /* JSDocTypeTag */: - case 319 /* JSDocThisTag */: - case 316 /* JSDocEnumTag */: + case 319 /* JSDocReturnTag */: + case 321 /* JSDocTypeTag */: + case 320 /* JSDocThisTag */: + case 317 /* JSDocEnumTag */: return emitJSDocSimpleTypedTag(node); - case 308 /* JSDocImplementsTag */: - case 307 /* JSDocAugmentsTag */: + case 309 /* JSDocImplementsTag */: + case 308 /* JSDocAugmentsTag */: return emitJSDocHeritageTag(node); - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); - case 322 /* JSDocTypedefTag */: + case 323 /* JSDocTypedefTag */: return emitJSDocTypedefTag(node); - case 315 /* JSDocCallbackTag */: + case 316 /* JSDocCallbackTag */: return emitJSDocCallbackTag(node); - case 305 /* JSDocSignature */: + case 306 /* JSDocSignature */: return emitJSDocSignature(node); - case 304 /* JSDocTypeLiteral */: + case 305 /* JSDocTypeLiteral */: return emitJSDocTypeLiteral(node); - case 310 /* JSDocClassTag */: - case 306 /* JSDocTag */: + case 311 /* JSDocClassTag */: + case 307 /* JSDocTag */: return emitJSDocSimpleTag(node); - case 303 /* JSDocComment */: + case 304 /* JSDocComment */: return emitJSDoc(node); // Transformation nodes (ignored) } @@ -94312,71 +94711,71 @@ var ts; writeTokenNode(node, writeKeyword); return; // Expressions - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return emitCallExpression(node); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return emitNewExpression(node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return emitFunctionExpression(node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return emitArrowFunction(node); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return emitDeleteExpression(node); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return emitVoidExpression(node); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return emitAwaitExpression(node); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return emitBinaryExpression(node); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return emitConditionalExpression(node); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: return emitTemplateExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return emitYieldExpression(node); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return emitSpreadExpression(node); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return emitClassExpression(node); - case 215 /* OmittedExpression */: + case 216 /* OmittedExpression */: return; - case 217 /* AsExpression */: + case 218 /* AsExpression */: return emitAsExpression(node); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: return emitNonNullExpression(node); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return emitMetaProperty(node); // JSX - case 266 /* JsxElement */: + case 267 /* JsxElement */: return emitJsxElement(node); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return emitJsxFragment(node); // Transformation nodes - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: return emitCommaList(node); } } @@ -94418,7 +94817,7 @@ var ts; } function emitHelpers(node) { var helpersEmitted = false; - var bundle = node.kind === 291 /* Bundle */ ? node : undefined; + var bundle = node.kind === 292 /* Bundle */ ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -94518,7 +94917,7 @@ var ts; var pos = getTextPosWithWriteLine(); writeUnparsedNode(unparsed); if (bundleFileInfo) { - updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 287 /* UnparsedText */ ? + updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 288 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */); } @@ -94591,7 +94990,7 @@ var ts; emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 300 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 301 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { @@ -94653,7 +95052,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - writeKeyword(node.kind === 163 /* GetAccessor */ ? "get" : "set"); + writeKeyword(node.kind === 164 /* GetAccessor */ ? "get" : "set"); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -94836,7 +95235,7 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - if (node.readonlyToken.kind !== 138 /* ReadonlyKeyword */) { + if (node.readonlyToken.kind !== 139 /* ReadonlyKeyword */) { writeKeyword("readonly"); } writeSpace(); @@ -94927,7 +95326,7 @@ var ts; } function emitPropertyAccessExpression(node) { var expression = ts.cast(emitExpression(node.expression), ts.isExpression); - var token = ts.getDotOrQuestionDotToken(node); + var token = node.questionDotToken || ts.createNode(24 /* DotToken */, node.expression.end, node.name.pos); var indentBeforeDot = needsIndentation(node, node.expression, token); var indentAfterDot = needsIndentation(node, token, node.name); increaseIndentIf(indentBeforeDot, /*writeSpaceIfNotIndenting*/ false); @@ -94938,7 +95337,12 @@ var ts; if (shouldEmitDotDot) { writePunctuation("."); } - emitTokenWithComment(token.kind, node.expression.end, writePunctuation, node); + if (node.questionDotToken) { + emit(token); + } + else { + emitTokenWithComment(token.kind, node.expression.end, writePunctuation, node); + } increaseIndentIf(indentAfterDot, /*writeSpaceIfNotIndenting*/ false); emit(node.name); decreaseIndentIf(indentBeforeDot, indentAfterDot); @@ -95056,7 +95460,7 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 207 /* PrefixUnaryExpression */ + return operand.kind === 208 /* PrefixUnaryExpression */ && ((node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */)) || (node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */))); } @@ -95244,7 +95648,7 @@ var ts; if (node.elseStatement) { writeLineOrSpace(node); emitTokenWithComment(87 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 227 /* IfStatement */) { + if (node.elseStatement.kind === 228 /* IfStatement */) { writeSpace(); emit(node.elseStatement); } @@ -95307,7 +95711,7 @@ var ts; emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - emitTokenWithComment(152 /* OfKeyword */, node.initializer.end, writeKeyword, node); + emitTokenWithComment(153 /* OfKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); @@ -95315,7 +95719,7 @@ var ts; } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 243 /* VariableDeclarationList */) { + if (node.kind === 244 /* VariableDeclarationList */) { emit(node); } else { @@ -95611,7 +96015,7 @@ var ts; var body = node.body; if (!body) return writeTrailingSemicolon(); - while (body.kind === 249 /* ModuleDeclaration */) { + while (body.kind === 250 /* ModuleDeclaration */) { writePunctuation("."); emit(body.name); body = body.body; @@ -95656,7 +96060,7 @@ var ts; if (node.importClause) { emit(node.importClause); writeSpace(); - emitTokenWithComment(149 /* FromKeyword */, node.importClause.end, writeKeyword, node); + emitTokenWithComment(150 /* FromKeyword */, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -95664,7 +96068,7 @@ var ts; } function emitImportClause(node) { if (node.isTypeOnly) { - emitTokenWithComment(145 /* TypeKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(146 /* TypeKeyword */, node.pos, writeKeyword, node); writeSpace(); } emit(node.name); @@ -95704,7 +96108,7 @@ var ts; var nextPos = emitTokenWithComment(89 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { - nextPos = emitTokenWithComment(145 /* TypeKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(146 /* TypeKeyword */, nextPos, writeKeyword, node); writeSpace(); } if (node.exportClause) { @@ -95716,7 +96120,7 @@ var ts; if (node.moduleSpecifier) { writeSpace(); var fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(149 /* FromKeyword */, fromPos, writeKeyword, node); + emitTokenWithComment(150 /* FromKeyword */, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } @@ -95727,7 +96131,7 @@ var ts; writeSpace(); nextPos = emitTokenWithComment(123 /* AsKeyword */, nextPos, writeKeyword, node); writeSpace(); - nextPos = emitTokenWithComment(136 /* NamespaceKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(137 /* NamespaceKeyword */, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeTrailingSemicolon(); @@ -95947,7 +96351,7 @@ var ts; } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 320 /* JSDocTypeTag */ && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 321 /* JSDocTypeTag */ && !node.comment) { writeSpace(); emit(node.tags[0]); } @@ -95981,7 +96385,7 @@ var ts; function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 294 /* JSDocTypeExpression */) { + if (tag.typeExpression.kind === 295 /* JSDocTypeExpression */) { emitJSDocTypeExpression(tag.typeExpression); } else { @@ -96000,7 +96404,7 @@ var ts; emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 304 /* JSDocTypeLiteral */) { + if (tag.typeExpression && tag.typeExpression.kind === 305 /* JSDocTypeLiteral */) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -96780,7 +97184,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 200 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 201 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -96845,84 +97249,84 @@ var ts; if (!node) return; switch (node.kind) { - case 223 /* Block */: + case 224 /* Block */: ts.forEach(node.statements, generateNames); break; - case 238 /* LabeledStatement */: - case 236 /* WithStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 239 /* LabeledStatement */: + case 237 /* WithStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: generateNames(node.statement); break; - case 227 /* IfStatement */: + case 228 /* IfStatement */: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: - case 231 /* ForInStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: + case 232 /* ForInStatement */: generateNames(node.initializer); generateNames(node.statement); break; - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: generateNames(node.caseBlock); break; - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: ts.forEach(node.clauses, generateNames); break; - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: ts.forEach(node.statements, generateNames); break; - case 240 /* TryStatement */: + case 241 /* TryStatement */: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 280 /* CatchClause */: + case 281 /* CatchClause */: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: generateNames(node.declarationList); break; - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: ts.forEach(node.declarations, generateNames); break; - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 191 /* BindingElement */: - case 245 /* ClassDeclaration */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 192 /* BindingElement */: + case 246 /* ClassDeclaration */: generateNameIfNeeded(node.name); break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: generateNameIfNeeded(node.name); if (ts.getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) { ts.forEach(node.parameters, generateNames); generateNames(node.body); } break; - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: ts.forEach(node.elements, generateNames); break; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: generateNames(node.importClause); break; - case 255 /* ImportClause */: + case 256 /* ImportClause */: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: generateNameIfNeeded(node.name); break; - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: generateNameIfNeeded(node.name); break; - case 257 /* NamedImports */: + case 258 /* NamedImports */: ts.forEach(node.elements, generateNames); break; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -96931,12 +97335,12 @@ var ts; if (!node) return; switch (node.kind) { - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: generateNameIfNeeded(node.name); break; } @@ -97118,23 +97522,23 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16 /* Optimistic */), !!(flags & 8 /* ReservedInNestedScopes */)); - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 259 /* ExportAssignment */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 260 /* ExportAssignment */: return generateNameForExportDefault(); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return generateNameForClassExpression(); - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return generateNameForMethodOrAccessor(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return makeTempVariableName(0 /* Auto */, /*reserveInNestedScopes*/ true); default: return makeTempVariableName(0 /* Auto */); @@ -97182,7 +97586,7 @@ var ts; hasWrittenComment = false; var emitFlags = ts.getEmitFlags(node); var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var isEmittedNode = node.kind !== 325 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 326 /* NotEmittedStatement */; // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is "preserve" we will not do any transformation. // It is expensive to walk entire tree just to set one kind of node to have no comments. var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 11 /* JsxText */; @@ -97206,7 +97610,7 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 243 /* VariableDeclarationList */) { + if (node.kind === 244 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -97465,7 +97869,7 @@ var ts; else { var _a = ts.getSourceMapRange(node), pos = _a.pos, end = _a.end, _b = _a.source, source = _b === void 0 ? sourceMapSource : _b; var emitFlags = ts.getEmitFlags(node); - if (node.kind !== 325 /* NotEmittedStatement */ + if (node.kind !== 326 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitSourcePos(source, skipSourceTrivia(source, pos)); @@ -97478,7 +97882,7 @@ var ts; else { pipelinePhase(hint, node); } - if (node.kind !== 325 /* NotEmittedStatement */ + if (node.kind !== 326 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitSourcePos(source, end); @@ -97938,7 +98342,6 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var ignoreDiagnosticCommentRegEx = /(^\s*$)|(^\s*\/\/\/?\s*(@ts-ignore)?)/; function findConfigFile(searchPath, fileExists, configName) { if (configName === void 0) { configName = "tsconfig.json"; } return ts.forEachAncestorDirectory(searchPath, function (ancestor) { @@ -98508,6 +98911,7 @@ var ts; }; } function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) { + var _a; var createProgramOptions = ts.isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions; // TODO: GH#18217 var rootNames = createProgramOptions.rootNames, options = createProgramOptions.options, configFileParsingDiagnostics = createProgramOptions.configFileParsingDiagnostics, projectReferences = createProgramOptions.projectReferences; var oldProgram = createProgramOptions.oldProgram; @@ -98604,7 +99008,16 @@ var ts; var projectReferenceRedirects; var mapFromFileToProjectReferenceRedirects; var mapFromToProjectReferenceRedirectSource; - var useSourceOfProjectReferenceRedirect = !!host.useSourceOfProjectReferenceRedirect && host.useSourceOfProjectReferenceRedirect(); + var useSourceOfProjectReferenceRedirect = !!((_a = host.useSourceOfProjectReferenceRedirect) === null || _a === void 0 ? void 0 : _a.call(host)) && + !options.disableSourceOfProjectReferenceRedirect; + var onProgramCreateComplete = updateHostForUseSourceOfProjectReferenceRedirect({ + compilerHost: host, + useSourceOfProjectReferenceRedirect: useSourceOfProjectReferenceRedirect, + toPath: toPath, + getResolvedProjectReferences: getResolvedProjectReferences, + getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, + forEachResolvedProjectReference: forEachResolvedProjectReference + }); var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); // We set `structuralIsReused` to `undefined` because `tryReuseStructureFromOldProgram` calls `tryReuseStructureFromOldProgram` which checks // `structuralIsReused`, which would be a TDZ violation if it was not set in advance to `undefined`. @@ -98617,12 +99030,6 @@ var ts; if (!resolvedProjectReferences) { resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); } - if (host.setResolvedProjectReferenceCallbacks) { - host.setResolvedProjectReferenceCallbacks({ - getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, - forEachResolvedProjectReference: forEachResolvedProjectReference - }); - } if (rootNames.length) { for (var _i = 0, resolvedProjectReferences_1 = resolvedProjectReferences; _i < resolvedProjectReferences_1.length; _i++) { var parsedRef = resolvedProjectReferences_1[_i]; @@ -98631,8 +99038,8 @@ var ts; var out = parsedRef.commandLine.options.outFile || parsedRef.commandLine.options.out; if (useSourceOfProjectReferenceRedirect) { if (out || ts.getEmitModuleKind(parsedRef.commandLine.options) === ts.ModuleKind.None) { - for (var _a = 0, _b = parsedRef.commandLine.fileNames; _a < _b.length; _a++) { - var fileName = _b[_a]; + for (var _b = 0, _c = parsedRef.commandLine.fileNames; _b < _c.length; _b++) { + var fileName = _c[_b]; processSourceFile(fileName, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined); } } @@ -98642,8 +99049,8 @@ var ts; processSourceFile(ts.changeExtension(out, ".d.ts"), /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined); } else if (ts.getEmitModuleKind(parsedRef.commandLine.options) === ts.ModuleKind.None) { - for (var _c = 0, _d = parsedRef.commandLine.fileNames; _c < _d.length; _c++) { - var fileName = _d[_c]; + for (var _d = 0, _e = parsedRef.commandLine.fileNames; _d < _e.length; _d++) { + var fileName = _e[_d]; if (!ts.fileExtensionIs(fileName, ".d.ts" /* Dts */) && !ts.fileExtensionIs(fileName, ".json" /* Json */)) { processSourceFile(ts.getOutputDeclarationFileName(fileName, parsedRef.commandLine, !host.useCaseSensitiveFileNames()), /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined); } @@ -98695,8 +99102,8 @@ var ts; // not part of the new program. if (oldProgram && host.onReleaseOldSourceFile) { var oldSourceFiles = oldProgram.getSourceFiles(); - for (var _e = 0, oldSourceFiles_1 = oldSourceFiles; _e < oldSourceFiles_1.length; _e++) { - var oldSourceFile = oldSourceFiles_1[_e]; + for (var _f = 0, oldSourceFiles_1 = oldSourceFiles; _f < oldSourceFiles_1.length; _f++) { + var oldSourceFile = oldSourceFiles_1[_f]; var newFile = getSourceFileByPath(oldSourceFile.resolvedPath); if (shouldCreateNewSourceFile || !newFile || // old file wasnt redirect but new file is @@ -98761,8 +99168,10 @@ var ts; forEachResolvedProjectReference: forEachResolvedProjectReference, isSourceOfProjectReferenceRedirect: isSourceOfProjectReferenceRedirect, emitBuildInfo: emitBuildInfo, - getProbableSymlinks: getProbableSymlinks + getProbableSymlinks: getProbableSymlinks, + useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); }, }; + onProgramCreateComplete(); verifyCompilerOptions(); ts.performance.mark("afterProgram"); ts.performance.measure("Program", "beforeProgram", "afterProgram"); @@ -99008,12 +99417,6 @@ var ts; } if (projectReferences) { resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); - if (host.setResolvedProjectReferenceCallbacks) { - host.setResolvedProjectReferenceCallbacks({ - getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, - forEachResolvedProjectReference: forEachResolvedProjectReference - }); - } } // check if program source files has changed in the way that can affect structure of the program var newSourceFiles = []; @@ -99337,19 +99740,19 @@ var ts; } var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName); var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName); - var diagnostics; - for (var _i = 0, _a = [fileProcessingDiagnosticsInFile, programDiagnosticsInFile]; _i < _a.length; _i++) { - var diags = _a[_i]; - if (diags) { - for (var _b = 0, diags_4 = diags; _b < diags_4.length; _b++) { - var diag = diags_4[_b]; - if (shouldReportDiagnostic(diag)) { - diagnostics = ts.append(diagnostics, diag); - } - } - } + return getMergedProgramDiagnostics(sourceFile, fileProcessingDiagnosticsInFile, programDiagnosticsInFile); + } + function getMergedProgramDiagnostics(sourceFile) { + var allDiagnostics = []; + for (var _i = 1; _i < arguments.length; _i++) { + allDiagnostics[_i - 1] = arguments[_i]; } - return diagnostics || ts.emptyArray; + var _a; + var flatDiagnostics = ts.flatten(allDiagnostics); + if (!((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { + return flatDiagnostics; + } + return getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics).diagnostics; } function getDeclarationDiagnostics(sourceFile, cancellationToken) { var options = program.getCompilerOptions(); @@ -99413,49 +99816,66 @@ var ts; sourceFile.scriptKind === 5 /* External */ || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */); var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray; var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray; - var diagnostics; - for (var _i = 0, _a = [bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined]; _i < _a.length; _i++) { - var diags = _a[_i]; - if (diags) { - for (var _b = 0, diags_5 = diags; _b < diags_5.length; _b++) { - var diag = diags_5[_b]; - if (shouldReportDiagnostic(diag)) { - diagnostics = ts.append(diagnostics, diag); - } - } - } - } - return diagnostics || ts.emptyArray; + return getMergedBindAndCheckDiagnostics(sourceFile, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined); }); } + function getMergedBindAndCheckDiagnostics(sourceFile) { + var allDiagnostics = []; + for (var _i = 1; _i < arguments.length; _i++) { + allDiagnostics[_i - 1] = arguments[_i]; + } + var _a; + var flatDiagnostics = ts.flatten(allDiagnostics); + if (!((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { + return flatDiagnostics; + } + var _b = getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics), diagnostics = _b.diagnostics, directives = _b.directives; + for (var _c = 0, _d = directives.getUnusedExpectations(); _c < _d.length; _c++) { + var errorExpectation = _d[_c]; + diagnostics.push(ts.createDiagnosticForRange(sourceFile, errorExpectation.range, ts.Diagnostics.Unused_ts_expect_error_directive)); + } + return diagnostics; + } + /** + * Creates a map of comment directives along with the diagnostics immediately preceded by one of them. + * Comments that match to any of those diagnostics are marked as used. + */ + function getDiagnosticsWithPrecedingDirectives(sourceFile, commentDirectives, flatDiagnostics) { + // Diagnostics are only reported if there is no comment directive preceding them + // This will modify the directives map by marking "used" ones with a corresponding diagnostic + var directives = ts.createCommentDirectivesMap(sourceFile, commentDirectives); + var diagnostics = flatDiagnostics.filter(function (diagnostic) { return markPrecedingCommentDirectiveLine(diagnostic, directives) === -1; }); + return { diagnostics: diagnostics, directives: directives }; + } function getSuggestionDiagnostics(sourceFile, cancellationToken) { return runWithCancellationToken(function () { return getDiagnosticsProducingTypeChecker().getSuggestionDiagnostics(sourceFile, cancellationToken); }); } /** - * Skip errors if previous line start with '// @ts-ignore' comment, not counting non-empty non-comment lines + * @returns The line index marked as preceding the diagnostic, or -1 if none was. */ - function shouldReportDiagnostic(diagnostic) { + function markPrecedingCommentDirectiveLine(diagnostic, directives) { var file = diagnostic.file, start = diagnostic.start; - if (file) { - var lineStarts = ts.getLineStarts(file); - var line = ts.computeLineAndCharacterOfPosition(lineStarts, start).line; // TODO: GH#18217 - while (line > 0) { - var previousLineText = file.text.slice(lineStarts[line - 1], lineStarts[line]); - var result = ignoreDiagnosticCommentRegEx.exec(previousLineText); - if (!result) { - // non-empty line - return true; - } - if (result[3]) { - // @ts-ignore - return false; - } - line--; + if (!file) { + return -1; + } + // Start out with the line just before the text + var lineStarts = ts.getLineStarts(file); + var line = ts.computeLineAndCharacterOfPosition(lineStarts, start).line - 1; // TODO: GH#18217 + while (line >= 0) { + // As soon as that line is known to have a comment directive, use that + if (directives.markUsed(line)) { + return line; + } + // Stop searching if the line is not empty and not a comment + var lineText = file.text.slice(lineStarts[line - 1], lineStarts[line]).trim(); + if (lineText !== "" && !/^(\s*)\/\/(.*)$/.test(lineText)) { + return -1; } + line--; } - return true; + return -1; } function getJSSyntacticDiagnosticsForFile(sourceFile) { return runWithCancellationToken(function () { @@ -99467,22 +99887,22 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 156 /* Parameter */: - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: + case 157 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); return "skip"; } // falls through - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: - case 242 /* VariableDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: + case 243 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); @@ -99490,58 +99910,58 @@ var ts; } } switch (node.kind) { - case 255 /* ImportClause */: + case 256 /* ImportClause */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node.parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); return "skip"; } break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); return "skip"; } break; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_TypeScript_files)); return "skip"; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 113 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: var interfaceKeyword = ts.tokenToString(114 /* InterfaceKeyword */); ts.Debug.assertIsDefined(interfaceKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); return "skip"; - case 249 /* ModuleDeclaration */: - var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(136 /* NamespaceKeyword */) : ts.tokenToString(135 /* ModuleKeyword */); + case 250 /* ModuleDeclaration */: + var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(137 /* NamespaceKeyword */) : ts.tokenToString(136 /* ModuleKeyword */); ts.Debug.assertIsDefined(moduleKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); return "skip"; - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); return "skip"; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: var enumKeyword = ts.Debug.checkDefined(ts.tokenToString(88 /* EnumKeyword */)); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); return "skip"; - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 217 /* AsExpression */: + case 218 /* AsExpression */: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } } @@ -99550,29 +99970,29 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); } switch (parent.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } // falls through - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - checkModifiers(parent.modifiers, parent.kind === 225 /* VariableStatement */); + checkModifiers(parent.modifiers, parent.kind === 226 /* VariableStatement */); return "skip"; } break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -99584,19 +100004,19 @@ var ts; return "skip"; } break; - case 156 /* Parameter */: + case 157 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 216 /* ExpressionWithTypeArguments */: - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: - case 198 /* TaggedTemplateExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 217 /* ExpressionWithTypeArguments */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 199 /* TaggedTemplateExpression */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); @@ -99618,8 +100038,8 @@ var ts; case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - case 138 /* ReadonlyKeyword */: - case 130 /* DeclareKeyword */: + case 139 /* ReadonlyKeyword */: + case 131 /* DeclareKeyword */: case 122 /* AbstractKeyword */: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind))); break; @@ -100861,6 +101281,155 @@ var ts; } } ts.createProgram = createProgram; + function updateHostForUseSourceOfProjectReferenceRedirect(host) { + var mapOfDeclarationDirectories; + var symlinkedDirectories; + var symlinkedFiles; + var originalFileExists = host.compilerHost.fileExists; + var originalDirectoryExists = host.compilerHost.directoryExists; + var originalGetDirectories = host.compilerHost.getDirectories; + var originalRealpath = host.compilerHost.realpath; + if (!host.useSourceOfProjectReferenceRedirect) + return ts.noop; + // This implementation of fileExists checks if the file being requested is + // .d.ts file for the referenced Project. + // If it is it returns true irrespective of whether that file exists on host + host.compilerHost.fileExists = function (file) { + if (originalFileExists.call(host.compilerHost, file)) + return true; + if (!host.getResolvedProjectReferences()) + return false; + if (!ts.isDeclarationFileName(file)) + return false; + // Project references go to source file instead of .d.ts file + return fileOrDirectoryExistsUsingSource(file, /*isFile*/ true); + }; + if (originalDirectoryExists) { + // This implementation of directoryExists checks if the directory being requested is + // directory of .d.ts file for the referenced Project. + // If it is it returns true irrespective of whether that directory exists on host + host.compilerHost.directoryExists = function (path) { + if (originalDirectoryExists.call(host.compilerHost, path)) { + handleDirectoryCouldBeSymlink(path); + return true; + } + if (!host.getResolvedProjectReferences()) + return false; + if (!mapOfDeclarationDirectories) { + mapOfDeclarationDirectories = ts.createMap(); + host.forEachResolvedProjectReference(function (ref) { + if (!ref) + return; + var out = ref.commandLine.options.outFile || ref.commandLine.options.out; + if (out) { + mapOfDeclarationDirectories.set(ts.getDirectoryPath(host.toPath(out)), true); + } + else { + // Set declaration's in different locations only, if they are next to source the directory present doesnt change + var declarationDir = ref.commandLine.options.declarationDir || ref.commandLine.options.outDir; + if (declarationDir) { + mapOfDeclarationDirectories.set(host.toPath(declarationDir), true); + } + } + }); + } + return fileOrDirectoryExistsUsingSource(path, /*isFile*/ false); + }; + } + if (originalGetDirectories) { + // Call getDirectories only if directory actually present on the host + // This is needed to ensure that we arent getting directories that we fake about presence for + host.compilerHost.getDirectories = function (path) { + return !host.getResolvedProjectReferences() || (originalDirectoryExists && originalDirectoryExists.call(host.compilerHost, path)) ? + originalGetDirectories.call(host.compilerHost, path) : + []; + }; + } + // This is something we keep for life time of the host + if (originalRealpath) { + host.compilerHost.realpath = function (s) { + return (symlinkedFiles === null || symlinkedFiles === void 0 ? void 0 : symlinkedFiles.get(host.toPath(s))) || + originalRealpath.call(host.compilerHost, s); + }; + } + return onProgramCreateComplete; + function onProgramCreateComplete() { + host.compilerHost.fileExists = originalFileExists; + host.compilerHost.directoryExists = originalDirectoryExists; + host.compilerHost.getDirectories = originalGetDirectories; + // DO not revert realpath as it could be used later + } + function fileExistsIfProjectReferenceDts(file) { + var source = host.getSourceOfProjectReferenceRedirect(file); + return source !== undefined ? + ts.isString(source) ? originalFileExists.call(host.compilerHost, source) : true : + undefined; + } + function directoryExistsIfProjectReferenceDeclDir(dir) { + var dirPath = host.toPath(dir); + var dirPathWithTrailingDirectorySeparator = "" + dirPath + ts.directorySeparator; + return ts.forEachKey(mapOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath || + // Any parent directory of declaration dir + ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) || + // Any directory inside declaration dir + ts.startsWith(dirPath, declDirPath + "/"); }); + } + function handleDirectoryCouldBeSymlink(directory) { + if (!host.getResolvedProjectReferences()) + return; + // Because we already watch node_modules, handle symlinks in there + if (!originalRealpath || !ts.stringContains(directory, ts.nodeModulesPathPart)) + return; + if (!symlinkedDirectories) + symlinkedDirectories = ts.createMap(); + var directoryPath = ts.ensureTrailingDirectorySeparator(host.toPath(directory)); + if (symlinkedDirectories.has(directoryPath)) + return; + var real = ts.normalizePath(originalRealpath.call(host.compilerHost, directory)); + var realPath; + if (real === directory || + (realPath = ts.ensureTrailingDirectorySeparator(host.toPath(real))) === directoryPath) { + // not symlinked + symlinkedDirectories.set(directoryPath, false); + return; + } + symlinkedDirectories.set(directoryPath, { + real: ts.ensureTrailingDirectorySeparator(real), + realPath: realPath + }); + } + function fileOrDirectoryExistsUsingSource(fileOrDirectory, isFile) { + var fileOrDirectoryExistsUsingSource = isFile ? + function (file) { return fileExistsIfProjectReferenceDts(file); } : + function (dir) { return directoryExistsIfProjectReferenceDeclDir(dir); }; + // Check current directory or file + var result = fileOrDirectoryExistsUsingSource(fileOrDirectory); + if (result !== undefined) + return result; + if (!symlinkedDirectories) + return false; + var fileOrDirectoryPath = host.toPath(fileOrDirectory); + if (!ts.stringContains(fileOrDirectoryPath, ts.nodeModulesPathPart)) + return false; + if (isFile && symlinkedFiles && symlinkedFiles.has(fileOrDirectoryPath)) + return true; + // If it contains node_modules check if its one of the symlinked path we know of + return ts.firstDefinedIterator(symlinkedDirectories.entries(), function (_a) { + var directoryPath = _a[0], symlinkedDirectory = _a[1]; + if (!symlinkedDirectory || !ts.startsWith(fileOrDirectoryPath, directoryPath)) + return undefined; + var result = fileOrDirectoryExistsUsingSource(fileOrDirectoryPath.replace(directoryPath, symlinkedDirectory.realPath)); + if (isFile && result) { + if (!symlinkedFiles) + symlinkedFiles = ts.createMap(); + // Store the real path for the file' + var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory()); + symlinkedFiles.set(fileOrDirectoryPath, "" + symlinkedDirectory.real + absolutePath.replace(new RegExp(directoryPath, "i"), "")); + } + return result; + }) || false; + } + } /*@internal*/ function handleNoEmitOptions(program, sourceFile, cancellationToken) { var options = program.getCompilerOptions(); @@ -101481,6 +102050,7 @@ var ts; state.affectedFilesPendingEmit = oldState.affectedFilesPendingEmit.slice(); state.affectedFilesPendingEmitKind = ts.cloneMapOrUndefined(oldState.affectedFilesPendingEmitKind); state.affectedFilesPendingEmitIndex = oldState.affectedFilesPendingEmitIndex; + state.seenAffectedFiles = ts.createMap(); } } // Update changed files and copy semantic diagnostics if we can @@ -101526,8 +102096,8 @@ var ts; if (oldCompilerOptions && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) { // Add all files to affectedFilesPendingEmit since emit changed newProgram.getSourceFiles().forEach(function (f) { return addToAffectedFilesPendingEmit(state, f.resolvedPath, 1 /* Full */); }); - ts.Debug.assert(state.seenAffectedFiles === undefined); - state.seenAffectedFiles = ts.createMap(); + ts.Debug.assert(!state.seenAffectedFiles || !state.seenAffectedFiles.size); + state.seenAffectedFiles = state.seenAffectedFiles || ts.createMap(); } state.emittedBuildInfo = !state.changedFilesSet.size && !state.affectedFilesPendingEmit; return state; @@ -102407,13 +102977,13 @@ var ts; return true; } ts.canWatchDirectory = canWatchDirectory; - ts.maxNumberOfFilesToIterateForInvalidation = 256; function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) { var filesWithChangedSetOfUnresolvedImports; var filesWithInvalidatedResolutions; var filesWithInvalidatedNonRelativeUnresolvedImports; - var allFilesHaveInvalidatedResolution = false; var nonRelativeExternalModuleResolutions = ts.createMultiMap(); + var resolutionsWithFailedLookups = []; + var resolvedFileToResolution = ts.createMultiMap(); var getCurrentDirectory = ts.memoize(function () { return resolutionHost.getCurrentDirectory(); }); // TODO: GH#18217 var cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost(); // The resolvedModuleNames and resolvedTypeReferenceDirectives are the cache of resolutions per file. @@ -102477,7 +103047,8 @@ var ts; closeTypeRootsWatch(); resolvedModuleNames.clear(); resolvedTypeReferenceDirectives.clear(); - allFilesHaveInvalidatedResolution = false; + resolvedFileToResolution.clear(); + resolutionsWithFailedLookups.length = 0; // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update // (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution) clearPerDirectoryResolutions(); @@ -102499,7 +103070,7 @@ var ts; return !!value && !!value.length; } function createHasInvalidatedResolution(forceAllFilesAsInvalidated) { - if (allFilesHaveInvalidatedResolution || forceAllFilesAsInvalidated) { + if (forceAllFilesAsInvalidated) { // Any file asked would have invalidated resolution filesWithInvalidatedResolutions = undefined; return ts.returnTrue; @@ -102517,7 +103088,6 @@ var ts; nonRelativeExternalModuleResolutions.clear(); } function finishCachingPerDirectoryResolution() { - allFilesHaveInvalidatedResolution = false; filesWithInvalidatedNonRelativeUnresolvedImports = undefined; clearPerDirectoryResolutions(); directoryWatchesOfFailedLookups.forEach(function (watcher, path) { @@ -102528,6 +103098,7 @@ var ts; }); } function resolveModuleName(moduleName, containingFile, compilerOptions, host, redirectedReference) { + var _a; var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference); // return result immediately only if global cache support is not enabled or if it is .ts, .tsx or .d.ts if (!resolutionHost.getGlobalCache) { @@ -102538,15 +103109,20 @@ var ts; if (globalCache !== undefined && !ts.isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && ts.extensionIsTS(primaryResult.resolvedModule.extension))) { // create different collection of failed lookup locations for second pass // if it will fail and we've already found something during the first pass - we don't want to pollute its results - var _a = ts.loadModuleFromGlobalCache(ts.Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName), resolutionHost.projectName, compilerOptions, host, globalCache), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations; + var _b = ts.loadModuleFromGlobalCache(ts.Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName), resolutionHost.projectName, compilerOptions, host, globalCache), resolvedModule = _b.resolvedModule, failedLookupLocations = _b.failedLookupLocations; if (resolvedModule) { - return { resolvedModule: resolvedModule, failedLookupLocations: ts.addRange(primaryResult.failedLookupLocations, failedLookupLocations) }; + // Modify existing resolution so its saved in the directory cache as well + primaryResult.resolvedModule = resolvedModule; + (_a = primaryResult.failedLookupLocations).push.apply(_a, failedLookupLocations); + return primaryResult; } } // Default return the result from the first pass return primaryResult; } - function resolveNamesWithLocalCache(names, containingFile, redirectedReference, cache, perDirectoryCacheWithRedirects, loader, getResolutionWithResolvedFileName, shouldRetryResolution, reusedNames, logChanges) { + function resolveNamesWithLocalCache(_a) { + var names = _a.names, containingFile = _a.containingFile, redirectedReference = _a.redirectedReference, cache = _a.cache, perDirectoryCacheWithRedirects = _a.perDirectoryCacheWithRedirects, loader = _a.loader, getResolutionWithResolvedFileName = _a.getResolutionWithResolvedFileName, shouldRetryResolution = _a.shouldRetryResolution, reusedNames = _a.reusedNames, logChanges = _a.logChanges; + var _b; var path = resolutionHost.toPath(containingFile); var resolutionsInFile = cache.get(path) || cache.set(path, ts.createMap()).get(path); var dirPath = ts.getDirectoryPath(path); @@ -102571,7 +103147,7 @@ var ts; var resolution = resolutionsInFile.get(name); // Resolution is valid if it is present and not invalidated if (!seenNamesInFile.has(name) && - allFilesHaveInvalidatedResolution || unmatchedRedirects || !resolution || resolution.isInvalidated || + unmatchedRedirects || !resolution || resolution.isInvalidated || // If the name is unresolved import that was invalidated, recalculate (hasInvalidatedNonRelativeUnresolvedImport && !ts.isExternalModuleNameRelative(name) && shouldRetryResolution(resolution))) { var existingResolution = resolution; @@ -102580,13 +103156,13 @@ var ts; resolution = resolutionInDirectory; } else { - resolution = loader(name, containingFile, compilerOptions, resolutionHost, redirectedReference); + resolution = loader(name, containingFile, compilerOptions, ((_b = resolutionHost.getCompilerHost) === null || _b === void 0 ? void 0 : _b.call(resolutionHost)) || resolutionHost, redirectedReference); perDirectoryResolution.set(name, resolution); } resolutionsInFile.set(name, resolution); - watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution); + watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName); if (existingResolution) { - stopWatchFailedLookupLocationOfResolution(existingResolution); + stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName); } if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) { filesWithChangedSetOfUnresolvedImports.push(path); @@ -102601,7 +103177,7 @@ var ts; // Stop watching and remove the unused name resolutionsInFile.forEach(function (resolution, name) { if (!seenNamesInFile.has(name) && !ts.contains(reusedNames, name)) { - stopWatchFailedLookupLocationOfResolution(resolution); + stopWatchFailedLookupLocationOfResolution(resolution, path, getResolutionWithResolvedFileName); resolutionsInFile.delete(name); } }); @@ -102625,21 +103201,35 @@ var ts; } } function resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference) { - return resolveNamesWithLocalCache(typeDirectiveNames, containingFile, redirectedReference, resolvedTypeReferenceDirectives, perDirectoryResolvedTypeReferenceDirectives, ts.resolveTypeReferenceDirective, getResolvedTypeReferenceDirective, - /*shouldRetryResolution*/ function (resolution) { return resolution.resolvedTypeReferenceDirective === undefined; }, - /*reusedNames*/ undefined, /*logChanges*/ false); + return resolveNamesWithLocalCache({ + names: typeDirectiveNames, + containingFile: containingFile, + redirectedReference: redirectedReference, + cache: resolvedTypeReferenceDirectives, + perDirectoryCacheWithRedirects: perDirectoryResolvedTypeReferenceDirectives, + loader: ts.resolveTypeReferenceDirective, + getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective, + shouldRetryResolution: function (resolution) { return resolution.resolvedTypeReferenceDirective === undefined; }, + }); } function resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference) { - return resolveNamesWithLocalCache(moduleNames, containingFile, redirectedReference, resolvedModuleNames, perDirectoryResolvedModuleNames, resolveModuleName, getResolvedModule, - /*shouldRetryResolution*/ function (resolution) { return !resolution.resolvedModule || !ts.resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension); }, reusedNames, logChangesWhenResolvingModule); + return resolveNamesWithLocalCache({ + names: moduleNames, + containingFile: containingFile, + redirectedReference: redirectedReference, + cache: resolvedModuleNames, + perDirectoryCacheWithRedirects: perDirectoryResolvedModuleNames, + loader: resolveModuleName, + getResolutionWithResolvedFileName: getResolvedModule, + shouldRetryResolution: function (resolution) { return !resolution.resolvedModule || !ts.resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension); }, + reusedNames: reusedNames, + logChanges: logChangesWhenResolvingModule + }); } function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName, containingFile) { var cache = resolvedModuleNames.get(resolutionHost.toPath(containingFile)); return cache && cache.get(moduleName); } - function isNodeModulesDirectory(dirPath) { - return ts.endsWith(dirPath, "/node_modules"); - } function isNodeModulesAtTypesDirectory(dirPath) { return ts.endsWith(dirPath, "/node_modules/@types"); } @@ -102675,7 +103265,7 @@ var ts; dirPath = ts.getDirectoryPath(dirPath); } // If the directory is node_modules use it to watch, always watch it recursively - if (isNodeModulesDirectory(dirPath)) { + if (ts.isNodeModulesDirectory(dirPath)) { return canWatchDirectory(ts.getDirectoryPath(dirPath)) ? { dir: dir, dirPath: dirPath } : undefined; } var nonRecursive = true; @@ -102699,26 +103289,33 @@ var ts; function isPathWithDefaultFailedLookupExtension(path) { return ts.fileExtensionIsOneOf(path, failedLookupDefaultExtensions); } - function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution) { - // No need to set the resolution refCount - if (resolution.failedLookupLocations && resolution.failedLookupLocations.length) { - if (resolution.refCount) { - resolution.refCount++; + function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName) { + if (resolution.refCount) { + resolution.refCount++; + ts.Debug.assertDefined(resolution.files); + } + else { + resolution.refCount = 1; + ts.Debug.assert(resolution.files === undefined); + if (ts.isExternalModuleNameRelative(name)) { + watchFailedLookupLocationOfResolution(resolution); } else { - resolution.refCount = 1; - if (ts.isExternalModuleNameRelative(name)) { - watchFailedLookupLocationOfResolution(resolution); - } - else { - nonRelativeExternalModuleResolutions.add(name, resolution); - } + nonRelativeExternalModuleResolutions.add(name, resolution); + } + var resolved = getResolutionWithResolvedFileName(resolution); + if (resolved && resolved.resolvedFileName) { + resolvedFileToResolution.add(resolutionHost.toPath(resolved.resolvedFileName), resolution); } } + (resolution.files || (resolution.files = [])).push(filePath); } function watchFailedLookupLocationOfResolution(resolution) { ts.Debug.assert(!!resolution.refCount); var failedLookupLocations = resolution.failedLookupLocations; + if (!failedLookupLocations.length) + return; + resolutionsWithFailedLookups.push(resolution); var setAtRoot = false; for (var _i = 0, failedLookupLocations_1 = failedLookupLocations; _i < failedLookupLocations_1.length; _i++) { var failedLookupLocation = failedLookupLocations_1[_i]; @@ -102746,14 +103343,11 @@ var ts; setDirectoryWatcher(rootDir, rootPath, /*nonRecursive*/ true); // TODO: GH#18217 } } - function setRefCountToUndefined(resolution) { - resolution.refCount = undefined; - } function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name) { var program = resolutionHost.getCurrentProgram(); - var updateResolution = program && program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name) ? - setRefCountToUndefined : watchFailedLookupLocationOfResolution; - resolutions.forEach(updateResolution); + if (!program || !program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name)) { + resolutions.forEach(watchFailedLookupLocationOfResolution); + } } function setDirectoryWatcher(dir, dirPath, nonRecursive) { var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); @@ -102765,14 +103359,20 @@ var ts; directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath, nonRecursive), refCount: 1, nonRecursive: nonRecursive }); } } - function stopWatchFailedLookupLocationOfResolution(resolution) { - if (!resolution.refCount) { - return; - } + function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName) { + ts.unorderedRemoveItem(ts.Debug.assertDefined(resolution.files), filePath); resolution.refCount--; if (resolution.refCount) { return; } + var resolved = getResolutionWithResolvedFileName(resolution); + if (resolved && resolved.resolvedFileName) { + resolvedFileToResolution.remove(resolutionHost.toPath(resolved.resolvedFileName), resolution); + } + if (!ts.unorderedRemoveItem(resolutionsWithFailedLookups, resolution)) { + // If not watching failed lookups, it wont be there in resolutionsWithFailedLookups + return; + } var failedLookupLocations = resolution.failedLookupLocations; var removeAtRoot = false; for (var _i = 0, failedLookupLocations_2 = failedLookupLocations; _i < failedLookupLocations_2.length; _i++) { @@ -102815,16 +103415,16 @@ var ts; // Since the file existence changed, update the sourceFiles cache cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); } - if (!allFilesHaveInvalidatedResolution && invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath)) { + if (invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath)) { resolutionHost.onInvalidatedResolution(); } }, nonRecursive ? 0 /* None */ : 1 /* Recursive */); } - function removeResolutionsOfFileFromCache(cache, filePath) { + function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName) { // Deleted file, stop watching failed lookups for all the resolutions in the file var resolutions = cache.get(filePath); if (resolutions) { - resolutions.forEach(stopWatchFailedLookupLocationOfResolution); + resolutions.forEach(function (resolution) { return stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName); }); cache.delete(filePath); } } @@ -102845,57 +103445,26 @@ var ts; resolvedProjectReference.commandLine.fileNames.forEach(function (f) { return removeResolutionsOfFile(resolutionHost.toPath(f)); }); } function removeResolutionsOfFile(filePath) { - removeResolutionsOfFileFromCache(resolvedModuleNames, filePath); - removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath); - } - function invalidateResolutionCache(cache, isInvalidatedResolution, getResolutionWithResolvedFileName) { - var seen = ts.createMap(); - cache.forEach(function (resolutions, containingFilePath) { - var dirPath = ts.getDirectoryPath(containingFilePath); - var seenInDir = seen.get(dirPath); - if (!seenInDir) { - seenInDir = ts.createMap(); - seen.set(dirPath, seenInDir); - } - resolutions.forEach(function (resolution, name) { - if (seenInDir.has(name)) { - return; - } - seenInDir.set(name, true); - if (!resolution.isInvalidated && isInvalidatedResolution(resolution, getResolutionWithResolvedFileName)) { - // Mark the file as needing re-evaluation of module resolution instead of using it blindly. - resolution.isInvalidated = true; - (filesWithInvalidatedResolutions || (filesWithInvalidatedResolutions = ts.createMap())).set(containingFilePath, true); - // When its a file with inferred types resolution, invalidate type reference directive resolution - if (ts.endsWith(containingFilePath, ts.inferredTypesContainingFile)) { - resolutionHost.onChangedAutomaticTypeDirectiveNames(); - } - } - }); - }); - } - function hasReachedResolutionIterationLimit() { - var maxSize = resolutionHost.maxNumberOfFilesToIterateForInvalidation || ts.maxNumberOfFilesToIterateForInvalidation; - return resolvedModuleNames.size > maxSize || resolvedTypeReferenceDirectives.size > maxSize; - } - function invalidateResolutions(isInvalidatedResolution) { - // If more than maxNumberOfFilesToIterateForInvalidation present, - // just invalidated all files and recalculate the resolutions for files instead - if (hasReachedResolutionIterationLimit()) { - allFilesHaveInvalidatedResolution = true; - return; + removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule); + removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective); + } + function invalidateResolution(resolution) { + resolution.isInvalidated = true; + var changedInAutoTypeReferenced = false; + for (var _i = 0, _a = ts.Debug.assertDefined(resolution.files); _i < _a.length; _i++) { + var containingFilePath = _a[_i]; + (filesWithInvalidatedResolutions || (filesWithInvalidatedResolutions = ts.createMap())).set(containingFilePath, true); + // When its a file with inferred types resolution, invalidate type reference directive resolution + changedInAutoTypeReferenced = changedInAutoTypeReferenced || containingFilePath.endsWith(ts.inferredTypesContainingFile); + } + if (changedInAutoTypeReferenced) { + resolutionHost.onChangedAutomaticTypeDirectiveNames(); } - invalidateResolutionCache(resolvedModuleNames, isInvalidatedResolution, getResolvedModule); - invalidateResolutionCache(resolvedTypeReferenceDirectives, isInvalidatedResolution, getResolvedTypeReferenceDirective); } function invalidateResolutionOfFile(filePath) { removeResolutionsOfFile(filePath); - invalidateResolutions( // Resolution is invalidated if the resulting file name is same as the deleted file path - function (resolution, getResolutionWithResolvedFileName) { - var result = getResolutionWithResolvedFileName(resolution); - return !!result && resolutionHost.toPath(result.resolvedFileName) === filePath; // TODO: GH#18217 - }); + ts.forEach(resolvedFileToResolution.get(filePath), invalidateResolution); } function setFilesWithInvalidatedNonRelativeUnresolvedImports(filesMap) { ts.Debug.assert(filesWithInvalidatedNonRelativeUnresolvedImports === filesMap || filesWithInvalidatedNonRelativeUnresolvedImports === undefined); @@ -102921,8 +103490,8 @@ var ts; // Some file or directory in the watching directory is created // Return early if it does not have any of the watching extension or not the custom failed lookup path var dirOfFileOrDirectory = ts.getDirectoryPath(fileOrDirectoryPath); - if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || isNodeModulesDirectory(fileOrDirectoryPath) || - isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || isNodeModulesDirectory(dirOfFileOrDirectory)) { + if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || ts.isNodeModulesDirectory(fileOrDirectoryPath) || + isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || ts.isNodeModulesDirectory(dirOfFileOrDirectory)) { // Invalidate any resolution from this directory isChangedFailedLookupLocation = function (location) { var locationPath = resolutionHost.toPath(location); @@ -102941,20 +103510,21 @@ var ts; isChangedFailedLookupLocation = function (location) { return resolutionHost.toPath(location) === fileOrDirectoryPath; }; } } - var hasChangedFailedLookupLocation = function (resolution) { return ts.some(resolution.failedLookupLocations, isChangedFailedLookupLocation); }; - var invalidatedFilesCount = filesWithInvalidatedResolutions && filesWithInvalidatedResolutions.size; - invalidateResolutions( + var invalidated = false; // Resolution is invalidated if the resulting file name is same as the deleted file path - hasChangedFailedLookupLocation); - return allFilesHaveInvalidatedResolution || filesWithInvalidatedResolutions && filesWithInvalidatedResolutions.size !== invalidatedFilesCount; + for (var _i = 0, resolutionsWithFailedLookups_1 = resolutionsWithFailedLookups; _i < resolutionsWithFailedLookups_1.length; _i++) { + var resolution = resolutionsWithFailedLookups_1[_i]; + if (resolution.failedLookupLocations.some(isChangedFailedLookupLocation)) { + invalidateResolution(resolution); + invalidated = true; + } + } + return invalidated; } function closeTypeRootsWatch() { ts.clearMap(typeRootsWatches, ts.closeFileWatcher); } function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath) { - if (allFilesHaveInvalidatedResolution) { - return undefined; - } if (isInDirectoryPath(rootPath, typeRootPath)) { return rootPath; } @@ -103153,38 +103723,52 @@ var ts; function comparePathsByNumberOfDirectorySeparators(a, b) { return ts.compareValues(numberOfDirectorySeparators(a), numberOfDirectorySeparators(b)); } - /** - * Looks for existing imports that use symlinks to this module. - * Symlinks will be returned first so they are preferred over the real path. - */ - function getAllModulePaths(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap) { + function forEachFileNameOfModule(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap, preferSymlinks, cb) { var redirects = redirectTargetsMap.get(importedFileName); var importedFileNames = redirects ? __spreadArrays(redirects, [importedFileName]) : [importedFileName]; var cwd = host.getCurrentDirectory ? host.getCurrentDirectory() : ""; var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); }); + if (!preferSymlinks) { + var result_10 = ts.forEach(targets, cb); + if (result_10) + return result_10; + } var links = host.getProbableSymlinks ? host.getProbableSymlinks(files) : ts.discoverProbableSymlinks(files, getCanonicalFileName, cwd); - var result = []; var compareStrings = (!host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames()) ? ts.compareStringsCaseSensitive : ts.compareStringsCaseInsensitive; - links.forEach(function (resolved, path) { + var result = ts.forEachEntry(links, function (resolved, path) { if (ts.startsWithDirectory(importingFileName, resolved, getCanonicalFileName)) { - return; // Don't want to a package to globally import from itself + return undefined; // Don't want to a package to globally import from itself } var target = ts.find(targets, function (t) { return compareStrings(t.slice(0, resolved.length + 1), resolved + "/") === 0 /* EqualTo */; }); if (target === undefined) - return; + return undefined; var relative = ts.getRelativePathFromDirectory(resolved, target, getCanonicalFileName); var option = ts.resolvePath(path, relative); if (!host.fileExists || host.fileExists(option)) { - result.push(option); + var result_11 = cb(option); + if (result_11) + return result_11; } }); - result.push.apply(result, targets); - if (result.length < 2) - return result; + return result || + (preferSymlinks ? ts.forEach(targets, cb) : undefined); + } + moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule; + /** + * Looks for existing imports that use symlinks to this module. + * Symlinks will be returned first so they are preferred over the real path. + */ + function getAllModulePaths(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap) { + var cwd = host.getCurrentDirectory ? host.getCurrentDirectory() : ""; + var allFileNames = ts.createMap(); + forEachFileNameOfModule(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap, + /*preferSymlinks*/ true, function (path) { + // dont return value, so we collect everything + allFileNames.set(path, getCanonicalFileName(path)); + }); // Sort by paths closest to importing file Name directory - var allFileNames = ts.arrayToMap(result, ts.identity, getCanonicalFileName); var sortedPaths = []; var _loop_18 = function (directory) { var directoryStart = ts.ensureTrailingDirectorySeparator(directory); @@ -103719,10 +104303,6 @@ var ts; */ function createProgramHost(system, createProgram) { var getDefaultLibLocation = ts.memoize(function () { return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath())); }); - var host = system; - // TODO: `host` is unused! - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - host; return { useCaseSensitiveFileNames: function () { return system.useCaseSensitiveFileNames; }, getNewLine: function () { return system.newLine; }, @@ -103739,7 +104319,6 @@ var ts; trace: function (s) { return system.write(s + system.newLine); }, createDirectory: function (path) { return system.createDirectory(path); }, writeFile: function (path, data, writeByteOrderMark) { return system.writeFile(path, data, writeByteOrderMark); }, - onCachedDirectoryStructureHostCreate: function (cacheHost) { return host = cacheHost || system; }, createHash: ts.maybeBind(system, system.createHash), createProgram: createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram }; @@ -103867,9 +104446,6 @@ var ts; var canConfigFileJsonReportNoInputFiles = false; var hasChangedConfigFileParsingErrors = false; var cachedDirectoryStructureHost = configFileName === undefined ? undefined : ts.createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames); - if (cachedDirectoryStructureHost && host.onCachedDirectoryStructureHostCreate) { - host.onCachedDirectoryStructureHostCreate(cachedDirectoryStructureHost); - } var directoryStructureHost = cachedDirectoryStructureHost || host; var parseConfigFileHost = ts.parseConfigHostFromCompilerHostLike(host, directoryStructureHost); // From tsc we want to get already parsed result and hence check for rootFileNames @@ -103910,6 +104486,7 @@ var ts; // Members for ResolutionCacheHost compilerHost.toPath = toPath; compilerHost.getCompilationSettings = function () { return compilerOptions; }; + compilerHost.useSourceOfProjectReferenceRedirect = ts.maybeBind(host, host.useSourceOfProjectReferenceRedirect); compilerHost.watchDirectoryOfFailedLookupLocation = function (dir, cb, flags) { return watchDirectory(host, dir, cb, flags, watchOptions, ts.WatchType.FailedLookupLocations); }; compilerHost.watchTypeRootsDirectory = function (dir, cb, flags) { return watchDirectory(host, dir, cb, flags, watchOptions, ts.WatchType.TypeRoots); }; compilerHost.getCachedDirectoryStructureHost = function () { return cachedDirectoryStructureHost; }; @@ -103919,7 +104496,6 @@ var ts; scheduleProgramUpdate(); }; compilerHost.fileIsOpen = ts.returnFalse; - compilerHost.maxNumberOfFilesToIterateForInvalidation = host.maxNumberOfFilesToIterateForInvalidation; compilerHost.getCurrentProgram = getCurrentProgram; compilerHost.writeLog = writeLog; // Cache for the module resolution @@ -103952,8 +104528,8 @@ var ts; // Update the wild card directory watch watchConfigFileWildCardDirectories(); return configFileName ? - { getCurrentProgram: getCurrentBuilderProgram, getProgram: synchronizeProgram, close: close } : - { getCurrentProgram: getCurrentBuilderProgram, getProgram: synchronizeProgram, updateRootFileNames: updateRootFileNames, close: close }; + { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close: close } : + { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames: updateRootFileNames, close: close }; function close() { resolutionCache.clear(); ts.clearMap(sourceFilesCache, function (value) { @@ -104001,7 +104577,7 @@ var ts; else { createNewProgram(hasInvalidatedResolution); } - if (host.afterProgramCreate) { + if (host.afterProgramCreate && program !== builderProgram) { host.afterProgramCreate(builderProgram); } return builderProgram; @@ -104017,6 +104593,7 @@ var ts; resolutionCache.startCachingPerDirectoryResolution(); compilerHost.hasInvalidatedResolution = hasInvalidatedResolution; compilerHost.hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames; + hasChangedAutomaticTypeDirectiveNames = false; builderProgram = createProgram(rootFileNames, compilerOptions, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences); resolutionCache.finishCachingPerDirectoryResolution(); // Update watches @@ -104061,7 +104638,7 @@ var ts; // If file is missing on host from cache, we can definitely say file doesnt exist // otherwise we need to ensure from the disk if (isFileMissingOnHost(sourceFilesCache.get(path))) { - return true; + return false; } return directoryStructureHost.fileExists(fileName); } @@ -104158,16 +104735,19 @@ var ts; host.clearTimeout(timerToUpdateProgram); } writeLog("Scheduling update"); - timerToUpdateProgram = host.setTimeout(updateProgram, 250); + timerToUpdateProgram = host.setTimeout(updateProgramWithWatchStatus, 250); } function scheduleProgramReload() { ts.Debug.assert(!!configFileName); reloadLevel = ts.ConfigFileProgramReloadLevel.Full; scheduleProgramUpdate(); } - function updateProgram() { + function updateProgramWithWatchStatus() { timerToUpdateProgram = undefined; reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation); + updateProgram(); + } + function updateProgram() { switch (reloadLevel) { case ts.ConfigFileProgramReloadLevel.Partial: ts.perfLogger.logStartUpdateProgram("PartialConfigReload"); @@ -104183,6 +104763,7 @@ var ts; break; } ts.perfLogger.logStopUpdateProgram("Done"); + return getCurrentBuilderProgram(); } function reloadFileNamesFromConfigFile() { writeLog("Reloading new file names and options"); @@ -106257,6 +106838,7 @@ var ts; placeOpenBraceOnNewLineForFunctions: false, placeOpenBraceOnNewLineForControlBlocks: false, semicolons: SemicolonPreference.Ignore, + trimTrailingWhitespace: true }; } ts.getDefaultFormatCodeSettings = getDefaultFormatCodeSettings; @@ -106487,37 +107069,37 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ts.isInJSFile(node) && ts.getJSDocEnumTag(node) ? 7 /* All */ : 1 /* Value */; - case 156 /* Parameter */: - case 191 /* BindingElement */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 280 /* CatchClause */: - case 273 /* JsxAttribute */: + case 157 /* Parameter */: + case 192 /* BindingElement */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 281 /* CatchClause */: + case 274 /* JsxAttribute */: return 1 /* Value */; - case 155 /* TypeParameter */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 173 /* TypeLiteral */: + case 156 /* TypeParameter */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 174 /* TypeLiteral */: return 2 /* Type */; - case 322 /* JSDocTypedefTag */: + case 323 /* JSDocTypedefTag */: // If it has no name node, it shares the name with the value declaration below it. return node.name === undefined ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */; - case 284 /* EnumMember */: - case 245 /* ClassDeclaration */: + case 285 /* EnumMember */: + case 246 /* ClassDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } @@ -106527,16 +107109,16 @@ var ts; else { return 4 /* Namespace */; } - case 248 /* EnumDeclaration */: - case 257 /* NamedImports */: - case 258 /* ImportSpecifier */: - case 253 /* ImportEqualsDeclaration */: - case 254 /* ImportDeclaration */: - case 259 /* ExportAssignment */: - case 260 /* ExportDeclaration */: + case 249 /* EnumDeclaration */: + case 258 /* NamedImports */: + case 259 /* ImportSpecifier */: + case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 260 /* ExportAssignment */: + case 261 /* ExportDeclaration */: return 7 /* All */; // An external module can be a Value - case 290 /* SourceFile */: + case 291 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 7 /* All */; @@ -106544,10 +107126,10 @@ var ts; ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { node = getAdjustedReferenceLocation(node); - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { return 1 /* Value */; } - else if (node.parent.kind === 259 /* ExportAssignment */ || node.parent.kind === 265 /* ExternalModuleReference */) { + else if (node.parent.kind === 260 /* ExportAssignment */ || node.parent.kind === 266 /* ExternalModuleReference */) { return 7 /* All */; } else if (isInRightSideOfInternalImportEqualsDeclaration(node)) { @@ -106579,11 +107161,11 @@ var ts; // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - var name = node.kind === 153 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; - return name && name.parent.kind === 253 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; + var name = node.kind === 154 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; + return name && name.parent.kind === 254 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 153 /* QualifiedName */) { + while (node.parent.kind === 154 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -106595,27 +107177,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 153 /* QualifiedName */) { - while (root.parent && root.parent.kind === 153 /* QualifiedName */) { + if (root.parent.kind === 154 /* QualifiedName */) { + while (root.parent && root.parent.kind === 154 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 169 /* TypeReference */ && !isLastClause; + return root.parent.kind === 170 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 194 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 194 /* PropertyAccessExpression */) { + if (root.parent.kind === 195 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 195 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 216 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 279 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 217 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 280 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 245 /* ClassDeclaration */ && root.parent.parent.token === 113 /* ImplementsKeyword */) || - (decl.kind === 246 /* InterfaceDeclaration */ && root.parent.parent.token === 90 /* ExtendsKeyword */); + return (decl.kind === 246 /* ClassDeclaration */ && root.parent.parent.token === 113 /* ImplementsKeyword */) || + (decl.kind === 247 /* InterfaceDeclaration */ && root.parent.parent.token === 90 /* ExtendsKeyword */); } return false; } @@ -106626,15 +107208,15 @@ var ts; switch (node.kind) { case 104 /* ThisKeyword */: return !ts.isExpressionNode(node); - case 183 /* ThisType */: + case 184 /* ThisType */: return true; } switch (node.parent.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return true; - case 188 /* ImportType */: + case 189 /* ImportType */: return !node.parent.isTypeOf; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent); } return false; @@ -106701,7 +107283,7 @@ var ts; ts.climbPastPropertyOrElementAccess = climbPastPropertyOrElementAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 238 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 239 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -106762,22 +107344,22 @@ var ts; ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 281 /* PropertyAssignment */: - case 284 /* EnumMember */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 249 /* ModuleDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 282 /* PropertyAssignment */: + case 285 /* EnumMember */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 250 /* ModuleDeclaration */: return ts.getNameOfDeclaration(node.parent) === node; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return true; - case 187 /* LiteralType */: - return node.parent.parent.kind === 185 /* IndexedAccessType */; + case 188 /* LiteralType */: + return node.parent.parent.kind === 186 /* IndexedAccessType */; default: return false; } @@ -106801,17 +107383,17 @@ var ts; return undefined; } switch (node.kind) { - case 290 /* SourceFile */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 249 /* ModuleDeclaration */: + case 291 /* SourceFile */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 250 /* ModuleDeclaration */: return node; } } @@ -106819,54 +107401,54 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: return ts.isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return "module" /* moduleElement */; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return "class" /* classElement */; - case 246 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; - case 247 /* TypeAliasDeclaration */: - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: + case 247 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; + case 248 /* TypeAliasDeclaration */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: return "type" /* typeElement */; - case 248 /* EnumDeclaration */: return "enum" /* enumElement */; - case 242 /* VariableDeclaration */: + case 249 /* EnumDeclaration */: return "enum" /* enumElement */; + case 243 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 202 /* ArrowFunction */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return "function" /* functionElement */; - case 163 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; - case 164 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 164 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; + case 165 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: return "method" /* memberFunctionElement */; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: var initializer = node.initializer; return ts.isFunctionLike(initializer) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */; - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 282 /* ShorthandPropertyAssignment */: - case 283 /* SpreadAssignment */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 283 /* ShorthandPropertyAssignment */: + case 284 /* SpreadAssignment */: return "property" /* memberVariableElement */; - case 167 /* IndexSignature */: return "index" /* indexSignatureElement */; - case 166 /* ConstructSignature */: return "construct" /* constructSignatureElement */; - case 165 /* CallSignature */: return "call" /* callSignatureElement */; - case 162 /* Constructor */: return "constructor" /* constructorImplementationElement */; - case 155 /* TypeParameter */: return "type parameter" /* typeParameterElement */; - case 284 /* EnumMember */: return "enum member" /* enumMemberElement */; - case 156 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 253 /* ImportEqualsDeclaration */: - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: - case 256 /* NamespaceImport */: - case 262 /* NamespaceExport */: + case 168 /* IndexSignature */: return "index" /* indexSignatureElement */; + case 167 /* ConstructSignature */: return "construct" /* constructSignatureElement */; + case 166 /* CallSignature */: return "call" /* callSignatureElement */; + case 163 /* Constructor */: return "constructor" /* constructorImplementationElement */; + case 156 /* TypeParameter */: return "type parameter" /* typeParameterElement */; + case 285 /* EnumMember */: return "enum member" /* enumMemberElement */; + case 157 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; + case 254 /* ImportEqualsDeclaration */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: + case 257 /* NamespaceImport */: + case 263 /* NamespaceExport */: return "alias" /* alias */; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var kind = ts.getAssignmentDeclarationKind(node); var right = node.right; switch (kind) { @@ -106895,7 +107477,7 @@ var ts; } case 75 /* Identifier */: return ts.isImportClause(node.parent) ? "alias" /* alias */ : "" /* unknown */; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: var scriptKind = getNodeKind(node.expression); // If the expression didn't come back with something (like it does for an identifiers) return scriptKind === "" /* unknown */ ? "const" /* constElement */ : scriptKind; @@ -106918,7 +107500,7 @@ var ts; return true; case 75 /* Identifier */: // 'this' as a parameter - return ts.identifierIsThisKeyword(node) && node.parent.kind === 156 /* Parameter */; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 157 /* Parameter */; default: return false; } @@ -106983,42 +107565,42 @@ var ts; return false; } switch (n.kind) { - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 193 /* ObjectLiteralExpression */: - case 189 /* ObjectBindingPattern */: - case 173 /* TypeLiteral */: - case 223 /* Block */: - case 250 /* ModuleBlock */: - case 251 /* CaseBlock */: - case 257 /* NamedImports */: - case 261 /* NamedExports */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 194 /* ObjectLiteralExpression */: + case 190 /* ObjectBindingPattern */: + case 174 /* TypeLiteral */: + case 224 /* Block */: + case 251 /* ModuleBlock */: + case 252 /* CaseBlock */: + case 258 /* NamedImports */: + case 262 /* NamedExports */: return nodeEndsWith(n, 19 /* CloseBraceToken */, sourceFile); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 197 /* NewExpression */: + case 198 /* NewExpression */: if (!n.arguments) { return true; } // falls through - case 196 /* CallExpression */: - case 200 /* ParenthesizedExpression */: - case 182 /* ParenthesizedType */: + case 197 /* CallExpression */: + case 201 /* ParenthesizedExpression */: + case 183 /* ParenthesizedType */: return nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 166 /* ConstructSignature */: - case 165 /* CallSignature */: - case 202 /* ArrowFunction */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 167 /* ConstructSignature */: + case 166 /* CallSignature */: + case 203 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -107028,65 +107610,65 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 21 /* CloseParenToken */, sourceFile); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return !!n.body && isCompletedNode(n.body, sourceFile); - case 227 /* IfStatement */: + case 228 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 26 /* SemicolonToken */, sourceFile); - case 192 /* ArrayLiteralExpression */: - case 190 /* ArrayBindingPattern */: - case 195 /* ElementAccessExpression */: - case 154 /* ComputedPropertyName */: - case 175 /* TupleType */: + case 193 /* ArrayLiteralExpression */: + case 191 /* ArrayBindingPattern */: + case 196 /* ElementAccessExpression */: + case 155 /* ComputedPropertyName */: + case 176 /* TupleType */: return nodeEndsWith(n, 23 /* CloseBracketToken */, sourceFile); - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 23 /* CloseBracketToken */, sourceFile); - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicity always consider them non-completed return false; - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 229 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 230 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 228 /* DoStatement */: + case 229 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; return hasChildOfKind(n, 111 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 204 /* TypeOfExpression */: - case 203 /* DeleteExpression */: - case 205 /* VoidExpression */: - case 212 /* YieldExpression */: - case 213 /* SpreadElement */: + case 205 /* TypeOfExpression */: + case 204 /* DeleteExpression */: + case 206 /* VoidExpression */: + case 213 /* YieldExpression */: + case 214 /* SpreadElement */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 260 /* ExportDeclaration */: - case 254 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: return ts.nodeIsPresent(n.moduleSpecifier); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -107193,11 +107775,11 @@ var ts; function getAdjustedLocationForDeclaration(node, forRename) { if (!forRename) { switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return getAdjustedLocationForClass(node); - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return getAdjustedLocationForFunction(node); } } @@ -107292,11 +107874,11 @@ var ts; node.kind === 94 /* FunctionKeyword */ ? ts.isFunctionDeclaration(parent) || ts.isFunctionExpression(node) : node.kind === 114 /* InterfaceKeyword */ ? ts.isInterfaceDeclaration(parent) : node.kind === 88 /* EnumKeyword */ ? ts.isEnumDeclaration(parent) : - node.kind === 145 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : - node.kind === 136 /* NamespaceKeyword */ || node.kind === 135 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : + node.kind === 146 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : + node.kind === 137 /* NamespaceKeyword */ || node.kind === 136 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : node.kind === 96 /* ImportKeyword */ ? ts.isImportEqualsDeclaration(parent) : - node.kind === 131 /* GetKeyword */ ? ts.isGetAccessorDeclaration(parent) : - node.kind === 142 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { + node.kind === 132 /* GetKeyword */ ? ts.isGetAccessorDeclaration(parent) : + node.kind === 143 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { var location = getAdjustedLocationForDeclaration(parent, forRename); if (location) { return location; @@ -107310,7 +107892,7 @@ var ts; return decl.name; } } - if (node.kind === 145 /* TypeKeyword */) { + if (node.kind === 146 /* TypeKeyword */) { // import /**/type [|name|] from ...; // import /**/type { [|name|] } from ...; // import /**/type { propertyName as [|name|] } from ...; @@ -107377,12 +107959,12 @@ var ts; } } // import name = /**/require("[|module|]"); - if (node.kind === 139 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { + if (node.kind === 140 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { return parent.expression; } // import ... /**/from "[|module|]"; // export ... /**/from "[|module|]"; - if (node.kind === 149 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { + if (node.kind === 150 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { return parent.moduleSpecifier; } // class ... /**/extends [|name|] ... @@ -107407,7 +107989,7 @@ var ts; } } // ... T extends /**/infer [|U|] ? ... - if (node.kind === 132 /* InferKeyword */ && ts.isInferTypeNode(parent)) { + if (node.kind === 133 /* InferKeyword */ && ts.isInferTypeNode(parent)) { return parent.typeParameter.name; } // { [ [|K|] /**/in keyof T]: ... } @@ -107415,12 +107997,12 @@ var ts; return parent.name; } // /**/keyof [|T|] - if (node.kind === 134 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 134 /* KeyOfKeyword */ && + if (node.kind === 135 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 135 /* KeyOfKeyword */ && ts.isTypeReferenceNode(parent.type)) { return parent.type.typeName; } // /**/readonly [|name|][] - if (node.kind === 138 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 138 /* ReadonlyKeyword */ && + if (node.kind === 139 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 139 /* ReadonlyKeyword */ && ts.isArrayTypeNode(parent.type) && ts.isTypeReferenceNode(parent.type.elementType)) { return parent.type.elementType.typeName; } @@ -107457,7 +108039,7 @@ var ts; // for (... /**/in [|name|]) // for (... /**/of [|name|]) if (node.kind === 97 /* InKeyword */ && ts.isForInStatement(parent) || - node.kind === 152 /* OfKeyword */ && ts.isForOfStatement(parent)) { + node.kind === 153 /* OfKeyword */ && ts.isForOfStatement(parent)) { return ts.skipOuterExpressions(parent.expression); } } @@ -107598,7 +108180,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 290 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); + ts.Debug.assert(startNode !== undefined || n.kind === 291 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. @@ -107668,17 +108250,17 @@ var ts; return true; } //
{ |
or
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 276 /* JsxExpression */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 277 /* JsxExpression */) { return true; } //
{ // | // } < /div> - if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 276 /* JsxExpression */) { + if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 277 /* JsxExpression */) { return true; } //
|
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 269 /* JsxClosingElement */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 270 /* JsxClosingElement */) { return true; } return false; @@ -107819,7 +108401,7 @@ var ts; // falls through case 108 /* TypeOfKeyword */: case 90 /* ExtendsKeyword */: - case 134 /* KeyOfKeyword */: + case 135 /* KeyOfKeyword */: case 24 /* DotToken */: case 51 /* BarToken */: case 57 /* QuestionToken */: @@ -107874,16 +108456,16 @@ var ts; result.push("export" /* exportedModifier */); if (node.flags & 8388608 /* Ambient */) result.push("declare" /* ambientModifier */); - if (node.kind === 259 /* ExportAssignment */) + if (node.kind === 260 /* ExportAssignment */) result.push("export" /* exportedModifier */); return result.length > 0 ? result.join(",") : "" /* none */; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 169 /* TypeReference */ || node.kind === 196 /* CallExpression */) { + if (node.kind === 170 /* TypeReference */ || node.kind === 197 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 245 /* ClassDeclaration */ || node.kind === 246 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 246 /* ClassDeclaration */ || node.kind === 247 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -107928,18 +108510,18 @@ var ts; } ts.cloneCompilerOptions = cloneCompilerOptions; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 192 /* ArrayLiteralExpression */ || - node.kind === 193 /* ObjectLiteralExpression */) { + if (node.kind === 193 /* ArrayLiteralExpression */ || + node.kind === 194 /* ObjectLiteralExpression */) { // [a,b,c] from: // [a, b, c] = someExpression; - if (node.parent.kind === 209 /* BinaryExpression */ && + if (node.parent.kind === 210 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */) { return true; } // [a, b, c] from: // for([a, b, c] of expression) - if (node.parent.kind === 232 /* ForOfStatement */ && + if (node.parent.kind === 233 /* ForOfStatement */ && node.parent.initializer === node) { return true; } @@ -107947,7 +108529,7 @@ var ts; // [x, [a, b, c] ] = someExpression // or // {x, a: {a, b, c} } = someExpression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 281 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 282 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -107993,29 +108575,29 @@ var ts; ts.typeKeywords = [ 125 /* AnyKeyword */, 124 /* AssertsKeyword */, - 151 /* BigIntKeyword */, - 128 /* BooleanKeyword */, + 152 /* BigIntKeyword */, + 129 /* BooleanKeyword */, 91 /* FalseKeyword */, - 134 /* KeyOfKeyword */, - 137 /* NeverKeyword */, + 135 /* KeyOfKeyword */, + 138 /* NeverKeyword */, 100 /* NullKeyword */, - 140 /* NumberKeyword */, - 141 /* ObjectKeyword */, - 138 /* ReadonlyKeyword */, - 143 /* StringKeyword */, - 144 /* SymbolKeyword */, + 141 /* NumberKeyword */, + 142 /* ObjectKeyword */, + 139 /* ReadonlyKeyword */, + 144 /* StringKeyword */, + 145 /* SymbolKeyword */, 106 /* TrueKeyword */, 110 /* VoidKeyword */, - 146 /* UndefinedKeyword */, - 147 /* UniqueKeyword */, - 148 /* UnknownKeyword */, + 147 /* UndefinedKeyword */, + 148 /* UniqueKeyword */, + 149 /* UnknownKeyword */, ]; function isTypeKeyword(kind) { return ts.contains(ts.typeKeywords, kind); } ts.isTypeKeyword = isTypeKeyword; function isTypeKeywordToken(node) { - return node.kind === 145 /* TypeKeyword */; + return node.kind === 146 /* TypeKeyword */; } ts.isTypeKeywordToken = isTypeKeywordToken; /** True if the symbol is for an external module, as opposed to a namespace. */ @@ -108048,7 +108630,7 @@ var ts; } ts.skipConstraint = skipConstraint; function getNameFromPropertyName(name) { - return name.kind === 154 /* ComputedPropertyName */ + return name.kind === 155 /* ComputedPropertyName */ // treat computed property names where expression is string/numeric literal as just string/numeric literal ? ts.isStringOrNumericLiteralLike(name.expression) ? name.expression.text : undefined : ts.isPrivateIdentifier(name) ? ts.idText(name) : ts.getTextOfIdentifierOrLiteral(name); @@ -108195,7 +108777,7 @@ var ts; } ts.findModifier = findModifier; function insertImport(changes, sourceFile, importDecl, blankLineBetween) { - var importKindPredicate = importDecl.kind === 225 /* VariableStatement */ ? ts.isRequireVariableDeclarationStatement : ts.isAnyImportSyntax; + var importKindPredicate = importDecl.kind === 226 /* VariableStatement */ ? ts.isRequireVariableDeclarationStatement : ts.isAnyImportSyntax; var lastImportDeclaration = ts.findLast(sourceFile.statements, function (statement) { return importKindPredicate(statement); }); if (lastImportDeclaration) { changes.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl); @@ -108241,7 +108823,7 @@ var ts; // Display-part writer helpers // #region function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 156 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 157 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -108538,14 +109120,14 @@ var ts; var symbol = checker.getSymbolAtLocation(node.name); var renameInfo = symbol && renameMap.get(String(ts.getSymbolId(symbol))); if (renameInfo && renameInfo.text !== (node.name || node.propertyName).getText()) { - clone = ts.createBindingElement(node.dotDotDotToken, node.propertyName || node.name, renameInfo, node.initializer); + clone = ts.setOriginalNode(ts.createBindingElement(node.dotDotDotToken, node.propertyName || node.name, renameInfo, node.initializer), node); } } else if (renameMap && checker && ts.isIdentifier(node)) { var symbol = checker.getSymbolAtLocation(node); var renameInfo = symbol && renameMap.get(String(ts.getSymbolId(symbol))); if (renameInfo) { - clone = ts.createIdentifier(renameInfo.text); + clone = ts.setOriginalNode(ts.createIdentifier(renameInfo.text), node); } } if (!clone) { @@ -108705,15 +109287,15 @@ var ts; function getContextualTypeFromParent(node, checker) { var parent = node.parent; switch (parent.kind) { - case 197 /* NewExpression */: + case 198 /* NewExpression */: return checker.getContextualType(parent); - case 209 /* BinaryExpression */: { + case 210 /* BinaryExpression */: { var _a = parent, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node); } - case 277 /* CaseClause */: + case 278 /* CaseClause */: return parent.expression === node ? getSwitchedType(parent, checker) : undefined; default: return checker.getContextualType(node); @@ -108752,8 +109334,8 @@ var ts; switch (node.kind) { case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 211 /* TemplateExpression */: - case 198 /* TaggedTemplateExpression */: + case 212 /* TemplateExpression */: + case 199 /* TaggedTemplateExpression */: return true; default: return false; @@ -108792,41 +109374,41 @@ var ts; } ts.getTypeNodeIfAccessible = getTypeNodeIfAccessible; function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) { - return kind === 165 /* CallSignature */ - || kind === 166 /* ConstructSignature */ - || kind === 167 /* IndexSignature */ - || kind === 158 /* PropertySignature */ - || kind === 160 /* MethodSignature */; + return kind === 166 /* CallSignature */ + || kind === 167 /* ConstructSignature */ + || kind === 168 /* IndexSignature */ + || kind === 159 /* PropertySignature */ + || kind === 161 /* MethodSignature */; } ts.syntaxRequiresTrailingCommaOrSemicolonOrASI = syntaxRequiresTrailingCommaOrSemicolonOrASI; function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) { - return kind === 244 /* FunctionDeclaration */ - || kind === 162 /* Constructor */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */; + return kind === 245 /* FunctionDeclaration */ + || kind === 163 /* Constructor */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */; } ts.syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI = syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI; function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) { - return kind === 249 /* ModuleDeclaration */; + return kind === 250 /* ModuleDeclaration */; } ts.syntaxRequiresTrailingModuleBlockOrSemicolonOrASI = syntaxRequiresTrailingModuleBlockOrSemicolonOrASI; function syntaxRequiresTrailingSemicolonOrASI(kind) { - return kind === 225 /* VariableStatement */ - || kind === 226 /* ExpressionStatement */ - || kind === 228 /* DoStatement */ - || kind === 233 /* ContinueStatement */ - || kind === 234 /* BreakStatement */ - || kind === 235 /* ReturnStatement */ - || kind === 239 /* ThrowStatement */ - || kind === 241 /* DebuggerStatement */ - || kind === 159 /* PropertyDeclaration */ - || kind === 247 /* TypeAliasDeclaration */ - || kind === 254 /* ImportDeclaration */ - || kind === 253 /* ImportEqualsDeclaration */ - || kind === 260 /* ExportDeclaration */ - || kind === 252 /* NamespaceExportDeclaration */ - || kind === 259 /* ExportAssignment */; + return kind === 226 /* VariableStatement */ + || kind === 227 /* ExpressionStatement */ + || kind === 229 /* DoStatement */ + || kind === 234 /* ContinueStatement */ + || kind === 235 /* BreakStatement */ + || kind === 236 /* ReturnStatement */ + || kind === 240 /* ThrowStatement */ + || kind === 242 /* DebuggerStatement */ + || kind === 160 /* PropertyDeclaration */ + || kind === 248 /* TypeAliasDeclaration */ + || kind === 255 /* ImportDeclaration */ + || kind === 254 /* ImportEqualsDeclaration */ + || kind === 261 /* ExportDeclaration */ + || kind === 253 /* NamespaceExportDeclaration */ + || kind === 260 /* ExportAssignment */; } ts.syntaxRequiresTrailingSemicolonOrASI = syntaxRequiresTrailingSemicolonOrASI; ts.syntaxMayBeASICandidate = ts.or(syntaxRequiresTrailingCommaOrSemicolonOrASI, syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI, syntaxRequiresTrailingModuleBlockOrSemicolonOrASI, syntaxRequiresTrailingSemicolonOrASI); @@ -108856,7 +109438,7 @@ var ts; return false; } // See comment in parser’s `parseDoStatement` - if (node.kind === 228 /* DoStatement */) { + if (node.kind === 229 /* DoStatement */) { return true; } var topNode = ts.findAncestor(node, function (ancestor) { return !ancestor.parent; }); @@ -109116,6 +109698,10 @@ var ts; return symbol.name; } ts.getNameForExportedSymbol = getNameForExportedSymbol; + function startsWithUnderscore(name) { + return name.charCodeAt(0) === 95 /* _ */; + } + ts.startsWithUnderscore = startsWithUnderscore; // #endregion })(ts || (ts = {})); var ts; @@ -109219,10 +109805,10 @@ var ts; } break; case 125 /* AnyKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: if (angleBracketStack > 0 && !syntacticClassifierAbsent) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, @@ -109411,9 +109997,9 @@ var ts; return true; } switch (keyword2) { - case 131 /* GetKeyword */: - case 142 /* SetKeyword */: - case 129 /* ConstructorKeyword */: + case 132 /* GetKeyword */: + case 143 /* SetKeyword */: + case 130 /* ConstructorKeyword */: case 120 /* StaticKeyword */: return true; // Allow things like "public get", "public constructor" and "public static". default: @@ -109554,10 +110140,10 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 249 /* ModuleDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 244 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 245 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -109777,18 +110363,18 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); // e.g. "param" pos = tag.tagName.end; switch (tag.kind) { - case 317 /* JSDocParameterTag */: + case 318 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); pos = tag.end; break; - case 320 /* JSDocTypeTag */: + case 321 /* JSDocTypeTag */: processElement(tag.typeExpression); pos = tag.end; break; - case 318 /* JSDocReturnTag */: + case 319 /* JSDocReturnTag */: processElement(tag.typeExpression); pos = tag.end; break; @@ -109939,22 +110525,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 268 /* JsxOpeningElement */: + case 269 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -109983,17 +110569,17 @@ var ts; var parent = token.parent; if (tokenKind === 62 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (parent.kind === 242 /* VariableDeclaration */ || - parent.kind === 159 /* PropertyDeclaration */ || - parent.kind === 156 /* Parameter */ || - parent.kind === 273 /* JsxAttribute */) { + if (parent.kind === 243 /* VariableDeclaration */ || + parent.kind === 160 /* PropertyDeclaration */ || + parent.kind === 157 /* Parameter */ || + parent.kind === 274 /* JsxAttribute */) { return 5 /* operator */; } } - if (parent.kind === 209 /* BinaryExpression */ || - parent.kind === 207 /* PrefixUnaryExpression */ || - parent.kind === 208 /* PostfixUnaryExpression */ || - parent.kind === 210 /* ConditionalExpression */) { + if (parent.kind === 210 /* BinaryExpression */ || + parent.kind === 208 /* PrefixUnaryExpression */ || + parent.kind === 209 /* PostfixUnaryExpression */ || + parent.kind === 211 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -110006,7 +110592,7 @@ var ts; return 25 /* bigintLiteral */; } else if (tokenKind === 10 /* StringLiteral */) { - return token && token.parent.kind === 273 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token && token.parent.kind === 274 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 13 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -110022,32 +110608,32 @@ var ts; else if (tokenKind === 75 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 156 /* Parameter */: + case 157 /* Parameter */: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -110171,11 +110757,11 @@ var ts; function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host) { var parent = node.parent; switch (parent.kind) { - case 187 /* LiteralType */: + case 188 /* LiteralType */: switch (parent.parent.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(parent)), isNewIdentifier: false }; - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: // Get all apparent property names // i.e. interface Foo { // foo: string; @@ -110183,9 +110769,9 @@ var ts; // } // let x: Foo["/*completion position*/"] return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(parent.parent.objectType)); - case 188 /* ImportType */: + case 189 /* ImportType */: return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) }; - case 178 /* UnionType */: { + case 179 /* UnionType */: { if (!ts.isTypeReferenceNode(parent.parent.parent)) return undefined; var alreadyUsedTypes_1 = getAlreadyUsedTypesInStringLiteralUnion(parent.parent, parent); @@ -110195,7 +110781,7 @@ var ts; default: return undefined; } - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: if (ts.isObjectLiteralExpression(parent.parent) && parent.name === node) { // Get quoted name of properties of the object literal expression // i.e. interface ConfigFiles { @@ -110212,7 +110798,7 @@ var ts; return stringLiteralCompletionsFromProperties(typeChecker.getContextualType(parent.parent)); } return fromContextualType(); - case 195 /* ElementAccessExpression */: { + case 196 /* ElementAccessExpression */: { var _a = parent, expression = _a.expression, argumentExpression = _a.argumentExpression; if (node === argumentExpression) { // Get all names of properties on the expression @@ -110225,8 +110811,8 @@ var ts; } return undefined; } - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: if (!ts.isRequireCall(parent, /*checkArgumentIsStringLiteralLike*/ false) && !ts.isImportCall(parent)) { var argumentInfo = ts.SignatureHelp.getArgumentInfoForCompletions(node, position, sourceFile); // Get string literal completions from specialized signatures of the target @@ -110235,9 +110821,9 @@ var ts; return argumentInfo ? getStringLiteralCompletionsFromSignature(argumentInfo, typeChecker) : fromContextualType(); } // falls through (is `require("")` or `import("")`) - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: - case 265 /* ExternalModuleReference */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 266 /* ExternalModuleReference */: // Get all known external module names or complete a path to a module // i.e. import * as ns from "/*completion position*/"; // var y = import("/*completion position*/"); @@ -111188,11 +111774,11 @@ var ts; return ts.getContextualTypeFromParent(previousToken, checker); case 62 /* EqualsToken */: switch (parent.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return checker.getContextualType(parent.initializer); // TODO: GH#18217 - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return checker.getTypeAtLocation(parent.left); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return checker.getContextualTypeForJsxAttribute(parent); default: return undefined; @@ -111202,7 +111788,7 @@ var ts; case 78 /* CaseKeyword */: return ts.getSwitchedType(ts.cast(parent, ts.isCaseClause), checker); case 18 /* OpenBraceToken */: - return ts.isJsxExpression(parent) && parent.parent.kind !== 266 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; + return ts.isJsxExpression(parent) && parent.parent.kind !== 267 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; default: var argInfo = ts.SignatureHelp.getArgumentInfoForCompletions(previousToken, position, sourceFile); return argInfo ? @@ -111221,7 +111807,7 @@ var ts; return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker)); } function isModuleSymbol(symbol) { - return symbol.declarations.some(function (d) { return d.kind === 290 /* SourceFile */; }); + return symbol.declarations.some(function (d) { return d.kind === 291 /* SourceFile */; }); } function getCompletionData(program, log, sourceFile, isUncheckedFile, position, preferences, detailsEntryId, host) { var typeChecker = program.getTypeChecker(); @@ -111272,11 +111858,11 @@ var ts; if (tag.tagName.pos <= position && position <= tag.tagName.end) { return { kind: 1 /* JsDocTagName */ }; } - if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 294 /* JSDocTypeExpression */) { + if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 295 /* JSDocTypeExpression */) { currentToken = ts.getTokenAtPosition(sourceFile, position); if (!currentToken || (!ts.isDeclarationName(currentToken) && - (currentToken.parent.kind !== 323 /* JSDocPropertyTag */ || + (currentToken.parent.kind !== 324 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken))) { // Use as type location if inside tag's type expression insideJsDocTagTypeExpression = isCurrentlyEditingNode(tag.typeExpression); @@ -111328,7 +111914,7 @@ var ts; isRightOfDot = contextToken.kind === 24 /* DotToken */; isRightOfQuestionDot = contextToken.kind === 28 /* QuestionDotToken */; switch (parent.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: propertyAccessToConvert = parent; node = propertyAccessToConvert.expression; if (node.end === contextToken.pos && @@ -111340,14 +111926,14 @@ var ts; return undefined; } break; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: node = parent.left; break; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: node = parent.name; break; - case 188 /* ImportType */: - case 219 /* MetaProperty */: + case 189 /* ImportType */: + case 220 /* MetaProperty */: node = parent; break; default: @@ -111360,7 +111946,7 @@ var ts; // // If the tagname is a property access expression, we will then walk up to the top most of property access expression. // Then, try to get a JSX container and its associated attributes type. - if (parent && parent.kind === 194 /* PropertyAccessExpression */) { + if (parent && parent.kind === 195 /* PropertyAccessExpression */) { contextToken = parent; parent = parent.parent; } @@ -111368,38 +111954,38 @@ var ts; if (currentToken.parent === location) { switch (currentToken.kind) { case 31 /* GreaterThanToken */: - if (currentToken.parent.kind === 266 /* JsxElement */ || currentToken.parent.kind === 268 /* JsxOpeningElement */) { + if (currentToken.parent.kind === 267 /* JsxElement */ || currentToken.parent.kind === 269 /* JsxOpeningElement */) { location = currentToken; } break; case 43 /* SlashToken */: - if (currentToken.parent.kind === 267 /* JsxSelfClosingElement */) { + if (currentToken.parent.kind === 268 /* JsxSelfClosingElement */) { location = currentToken; } break; } } switch (parent.kind) { - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: if (contextToken.kind === 43 /* SlashToken */) { isStartingCloseTag = true; location = contextToken; } break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (!binaryExpressionMayBeOpenTag(parent)) { break; } // falls through - case 267 /* JsxSelfClosingElement */: - case 266 /* JsxElement */: - case 268 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 267 /* JsxElement */: + case 269 /* JsxOpeningElement */: if (contextToken.kind === 29 /* LessThanToken */) { isRightOfOpenTag = true; location = contextToken; } break; - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: switch (previousToken.kind) { case 62 /* EqualsToken */: isJsxInitializer = true; @@ -111479,11 +112065,11 @@ var ts; }; function isTagWithTypeExpression(tag) { switch (tag.kind) { - case 317 /* JSDocParameterTag */: - case 323 /* JSDocPropertyTag */: - case 318 /* JSDocReturnTag */: - case 320 /* JSDocTypeTag */: - case 322 /* JSDocTypedefTag */: + case 318 /* JSDocParameterTag */: + case 324 /* JSDocPropertyTag */: + case 319 /* JSDocReturnTag */: + case 321 /* JSDocTypeTag */: + case 323 /* JSDocTypedefTag */: return true; default: return false; @@ -111528,7 +112114,7 @@ var ts; // If the module is merged with a value, we must get the type of the class and add its propertes (for inherited static methods). if (!isTypeLocation && symbol.declarations && - symbol.declarations.some(function (d) { return d.kind !== 290 /* SourceFile */ && d.kind !== 249 /* ModuleDeclaration */ && d.kind !== 248 /* EnumDeclaration */; })) { + symbol.declarations.some(function (d) { return d.kind !== 291 /* SourceFile */ && d.kind !== 250 /* ModuleDeclaration */ && d.kind !== 249 /* EnumDeclaration */; })) { var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType(); var insertQuestionDot = false; if (type.isNullableType()) { @@ -111575,7 +112161,7 @@ var ts; if (isRightOfQuestionDot && ts.some(type.getCallSignatures())) { isNewIdentifierLocation = true; } - var propertyAccess = node.kind === 188 /* ImportType */ ? node : node.parent; + var propertyAccess = node.kind === 189 /* ImportType */ ? node : node.parent; if (isUncheckedFile) { // In javascript files, for union types, we don't just get the members that // the individual types have in common, we also include all the members that @@ -111731,7 +112317,7 @@ var ts; } } // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` - if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 290 /* SourceFile */) { + if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 291 /* SourceFile */) { var thisType = typeChecker.tryGetThisTypeAt(scopeNode, /*includeGlobalThis*/ false); if (thisType) { for (var _a = 0, _b = getPropertiesForCompletion(thisType, typeChecker); _a < _b.length; _a++) { @@ -111781,10 +112367,10 @@ var ts; } function isSnippetScope(scopeNode) { switch (scopeNode.kind) { - case 290 /* SourceFile */: - case 211 /* TemplateExpression */: - case 276 /* JsxExpression */: - case 223 /* Block */: + case 291 /* SourceFile */: + case 212 /* TemplateExpression */: + case 277 /* JsxExpression */: + case 224 /* Block */: return true; default: return ts.isStatement(scopeNode); @@ -111830,27 +112416,27 @@ var ts; function isContextTokenValueLocation(contextToken) { return contextToken && contextToken.kind === 108 /* TypeOfKeyword */ && - (contextToken.parent.kind === 172 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); + (contextToken.parent.kind === 173 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); } function isContextTokenTypeLocation(contextToken) { if (contextToken) { var parentKind = contextToken.parent.kind; switch (contextToken.kind) { case 58 /* ColonToken */: - return parentKind === 159 /* PropertyDeclaration */ || - parentKind === 158 /* PropertySignature */ || - parentKind === 156 /* Parameter */ || - parentKind === 242 /* VariableDeclaration */ || + return parentKind === 160 /* PropertyDeclaration */ || + parentKind === 159 /* PropertySignature */ || + parentKind === 157 /* Parameter */ || + parentKind === 243 /* VariableDeclaration */ || ts.isFunctionLikeKind(parentKind); case 62 /* EqualsToken */: - return parentKind === 247 /* TypeAliasDeclaration */; + return parentKind === 248 /* TypeAliasDeclaration */; case 123 /* AsKeyword */: - return parentKind === 217 /* AsExpression */; + return parentKind === 218 /* AsExpression */; case 29 /* LessThanToken */: - return parentKind === 169 /* TypeReference */ || - parentKind === 199 /* TypeAssertionExpression */; + return parentKind === 170 /* TypeReference */ || + parentKind === 200 /* TypeAssertionExpression */; case 90 /* ExtendsKeyword */: - return parentKind === 155 /* TypeParameter */; + return parentKind === 156 /* TypeParameter */; } } return false; @@ -112061,7 +112647,7 @@ var ts; return true; } if (contextToken.kind === 31 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 268 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 269 /* JsxOpeningElement */) { // Two possibilities: // 1.
/**/ // - contextToken: GreaterThanToken (before cursor) @@ -112071,10 +112657,10 @@ var ts; // - contextToken: GreaterThanToken (before cursor) // - location: GreaterThanToken (after cursor) // - same parent (JSXOpeningElement) - return location.parent.kind !== 268 /* JsxOpeningElement */; + return location.parent.kind !== 269 /* JsxOpeningElement */; } - if (contextToken.parent.kind === 269 /* JsxClosingElement */ || contextToken.parent.kind === 267 /* JsxSelfClosingElement */) { - return !!contextToken.parent.parent && contextToken.parent.parent.kind === 266 /* JsxElement */; + if (contextToken.parent.kind === 270 /* JsxClosingElement */ || contextToken.parent.kind === 268 /* JsxSelfClosingElement */) { + return !!contextToken.parent.parent && contextToken.parent.parent.kind === 267 /* JsxElement */; } } return false; @@ -112085,40 +112671,40 @@ var ts; // Previous token may have been a keyword that was converted to an identifier. switch (keywordForNode(previousToken)) { case 27 /* CommaToken */: - return containingNodeKind === 196 /* CallExpression */ // func( a, | - || containingNodeKind === 162 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 197 /* NewExpression */ // new C(a, | - || containingNodeKind === 192 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 209 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 170 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 197 /* CallExpression */ // func( a, | + || containingNodeKind === 163 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 198 /* NewExpression */ // new C(a, | + || containingNodeKind === 193 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 210 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 171 /* FunctionType */; // var x: (s: string, list| case 20 /* OpenParenToken */: - return containingNodeKind === 196 /* CallExpression */ // func( | - || containingNodeKind === 162 /* Constructor */ // constructor( | - || containingNodeKind === 197 /* NewExpression */ // new C(a| - || containingNodeKind === 200 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 182 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 197 /* CallExpression */ // func( | + || containingNodeKind === 163 /* Constructor */ // constructor( | + || containingNodeKind === 198 /* NewExpression */ // new C(a| + || containingNodeKind === 201 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 183 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 22 /* OpenBracketToken */: - return containingNodeKind === 192 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 167 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 154 /* ComputedPropertyName */; // [ | /* this can become an index signature */ - case 135 /* ModuleKeyword */: // module | - case 136 /* NamespaceKeyword */: // namespace | + return containingNodeKind === 193 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 168 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 155 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + case 136 /* ModuleKeyword */: // module | + case 137 /* NamespaceKeyword */: // namespace | return true; case 24 /* DotToken */: - return containingNodeKind === 249 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 250 /* ModuleDeclaration */; // module A.| case 18 /* OpenBraceToken */: - return containingNodeKind === 245 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 246 /* ClassDeclaration */; // class A{ | case 62 /* EqualsToken */: - return containingNodeKind === 242 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 209 /* BinaryExpression */; // x = a| + return containingNodeKind === 243 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 210 /* BinaryExpression */; // x = a| case 15 /* TemplateHead */: - return containingNodeKind === 211 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 212 /* TemplateExpression */; // `aa ${| case 16 /* TemplateMiddle */: - return containingNodeKind === 221 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 222 /* TemplateSpan */; // `aa ${10} dd ${| case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - return containingNodeKind === 159 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 160 /* PropertyDeclaration */; // class A{ public | } } return false; @@ -112145,7 +112731,7 @@ var ts; completionKind = 0 /* ObjectPropertyDeclaration */; var typeMembers; var existingMembers; - if (objectLikeContainer.kind === 193 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 194 /* ObjectLiteralExpression */) { var instantiatedType = typeChecker.getContextualType(objectLikeContainer); var completionsType = instantiatedType && typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */); if (!instantiatedType || !completionsType) @@ -112155,7 +112741,7 @@ var ts; existingMembers = objectLikeContainer.properties; } else { - ts.Debug.assert(objectLikeContainer.kind === 189 /* ObjectBindingPattern */); + ts.Debug.assert(objectLikeContainer.kind === 190 /* ObjectBindingPattern */); // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -112166,12 +112752,12 @@ var ts; // through type declaration or inference. // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - // type of parameter will flow in from the contextual type of the function - var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 232 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 156 /* Parameter */) { + var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 233 /* ForOfStatement */; + if (!canGetType && rootDeclaration.kind === 157 /* Parameter */) { if (ts.isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); } - else if (rootDeclaration.parent.kind === 161 /* MethodDeclaration */ || rootDeclaration.parent.kind === 164 /* SetAccessor */) { + else if (rootDeclaration.parent.kind === 162 /* MethodDeclaration */ || rootDeclaration.parent.kind === 165 /* SetAccessor */) { canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -112221,7 +112807,7 @@ var ts; return 0 /* Continue */; // cursor is in an import clause // try to show exported member for imported module - var moduleSpecifier = (namedImportsOrExports.kind === 257 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; + var moduleSpecifier = (namedImportsOrExports.kind === 258 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); // TODO: GH#18217 if (!moduleSpecifierSymbol) return 2 /* Fail */; @@ -112343,11 +112929,11 @@ var ts; case 30 /* LessThanSlashToken */: case 43 /* SlashToken */: case 75 /* Identifier */: - case 194 /* PropertyAccessExpression */: - case 274 /* JsxAttributes */: - case 273 /* JsxAttribute */: - case 275 /* JsxSpreadAttribute */: - if (parent && (parent.kind === 267 /* JsxSelfClosingElement */ || parent.kind === 268 /* JsxOpeningElement */)) { + case 195 /* PropertyAccessExpression */: + case 275 /* JsxAttributes */: + case 274 /* JsxAttribute */: + case 276 /* JsxSpreadAttribute */: + if (parent && (parent.kind === 268 /* JsxSelfClosingElement */ || parent.kind === 269 /* JsxOpeningElement */)) { if (contextToken.kind === 31 /* GreaterThanToken */) { var precedingToken = ts.findPrecedingToken(contextToken.pos, sourceFile, /*startNode*/ undefined); if (!parent.typeArguments || (precedingToken && precedingToken.kind === 43 /* SlashToken */)) @@ -112355,7 +112941,7 @@ var ts; } return parent; } - else if (parent.kind === 273 /* JsxAttribute */) { + else if (parent.kind === 274 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -112367,7 +112953,7 @@ var ts; // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 10 /* StringLiteral */: - if (parent && ((parent.kind === 273 /* JsxAttribute */) || (parent.kind === 275 /* JsxSpreadAttribute */))) { + if (parent && ((parent.kind === 274 /* JsxAttribute */) || (parent.kind === 276 /* JsxSpreadAttribute */))) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -112377,8 +112963,8 @@ var ts; break; case 19 /* CloseBraceToken */: if (parent && - parent.kind === 276 /* JsxExpression */ && - parent.parent && parent.parent.kind === 273 /* JsxAttribute */) { + parent.kind === 277 /* JsxExpression */ && + parent.parent && parent.parent.kind === 274 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -112386,7 +112972,7 @@ var ts; // each JsxAttribute can have initializer as JsxExpression return parent.parent.parent.parent; } - if (parent && parent.kind === 275 /* JsxSpreadAttribute */) { + if (parent && parent.kind === 276 /* JsxSpreadAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -112406,51 +112992,51 @@ var ts; var containingNodeKind = parent.kind; switch (contextToken.kind) { case 27 /* CommaToken */: - return containingNodeKind === 242 /* VariableDeclaration */ || + return containingNodeKind === 243 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken) || - containingNodeKind === 225 /* VariableStatement */ || - containingNodeKind === 248 /* EnumDeclaration */ || // enum a { foo, | + containingNodeKind === 226 /* VariableStatement */ || + containingNodeKind === 249 /* EnumDeclaration */ || // enum a { foo, | isFunctionLikeButNotConstructor(containingNodeKind) || - containingNodeKind === 246 /* InterfaceDeclaration */ || // interface A= contextToken.pos); case 24 /* DotToken */: - return containingNodeKind === 190 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 191 /* ArrayBindingPattern */; // var [.| case 58 /* ColonToken */: - return containingNodeKind === 191 /* BindingElement */; // var {x :html| + return containingNodeKind === 192 /* BindingElement */; // var {x :html| case 22 /* OpenBracketToken */: - return containingNodeKind === 190 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 191 /* ArrayBindingPattern */; // var [x| case 20 /* OpenParenToken */: - return containingNodeKind === 280 /* CatchClause */ || + return containingNodeKind === 281 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); case 18 /* OpenBraceToken */: - return containingNodeKind === 248 /* EnumDeclaration */; // enum a { | + return containingNodeKind === 249 /* EnumDeclaration */; // enum a { | case 29 /* LessThanToken */: - return containingNodeKind === 245 /* ClassDeclaration */ || // class A< | - containingNodeKind === 214 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 246 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 247 /* TypeAliasDeclaration */ || // type List< | + return containingNodeKind === 246 /* ClassDeclaration */ || // class A< | + containingNodeKind === 215 /* ClassExpression */ || // var C = class D< | + containingNodeKind === 247 /* InterfaceDeclaration */ || // interface A< | + containingNodeKind === 248 /* TypeAliasDeclaration */ || // type List< | ts.isFunctionLikeKind(containingNodeKind); case 120 /* StaticKeyword */: - return containingNodeKind === 159 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); + return containingNodeKind === 160 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); case 25 /* DotDotDotToken */: - return containingNodeKind === 156 /* Parameter */ || - (!!parent.parent && parent.parent.kind === 190 /* ArrayBindingPattern */); // var [...z| + return containingNodeKind === 157 /* Parameter */ || + (!!parent.parent && parent.parent.kind === 191 /* ArrayBindingPattern */); // var [...z| case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - return containingNodeKind === 156 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); + return containingNodeKind === 157 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); case 123 /* AsKeyword */: - return containingNodeKind === 258 /* ImportSpecifier */ || - containingNodeKind === 263 /* ExportSpecifier */ || - containingNodeKind === 256 /* NamespaceImport */; - case 131 /* GetKeyword */: - case 142 /* SetKeyword */: + return containingNodeKind === 259 /* ImportSpecifier */ || + containingNodeKind === 264 /* ExportSpecifier */ || + containingNodeKind === 257 /* NamespaceImport */; + case 132 /* GetKeyword */: + case 143 /* SetKeyword */: return !isFromObjectTypeDeclaration(contextToken); case 80 /* ClassKeyword */: case 88 /* EnumKeyword */: @@ -112461,7 +113047,7 @@ var ts; case 115 /* LetKeyword */: case 81 /* ConstKeyword */: case 121 /* YieldKeyword */: - case 145 /* TypeKeyword */: // type htm| + case 146 /* TypeKeyword */: // type htm| return true; case 41 /* AsteriskToken */: return ts.isFunctionLike(contextToken.parent) && !ts.isMethodDeclaration(contextToken.parent); @@ -112487,7 +113073,7 @@ var ts; case 122 /* AbstractKeyword */: case 80 /* ClassKeyword */: case 81 /* ConstKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 88 /* EnumKeyword */: case 94 /* FunctionKeyword */: case 114 /* InterfaceKeyword */: @@ -112509,7 +113095,7 @@ var ts; && !(ts.isClassLike(contextToken.parent) && (contextToken !== previousToken || position > previousToken.end)); } function isFunctionLikeButNotConstructor(kind) { - return ts.isFunctionLikeKind(kind) && kind !== 162 /* Constructor */; + return ts.isFunctionLikeKind(kind) && kind !== 163 /* Constructor */; } function isDotOfNumericLiteral(contextToken) { if (contextToken.kind === 8 /* NumericLiteral */) { @@ -112519,7 +113105,7 @@ var ts; return false; } function isVariableDeclarationListButNotTypeArgument(node) { - return node.parent.kind === 243 /* VariableDeclarationList */ + return node.parent.kind === 244 /* VariableDeclarationList */ && !ts.isPossiblyTypeArgumentPosition(node, sourceFile, typeChecker); } /** @@ -112537,13 +113123,13 @@ var ts; for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 281 /* PropertyAssignment */ && - m.kind !== 282 /* ShorthandPropertyAssignment */ && - m.kind !== 191 /* BindingElement */ && - m.kind !== 161 /* MethodDeclaration */ && - m.kind !== 163 /* GetAccessor */ && - m.kind !== 164 /* SetAccessor */ && - m.kind !== 283 /* SpreadAssignment */) { + if (m.kind !== 282 /* PropertyAssignment */ && + m.kind !== 283 /* ShorthandPropertyAssignment */ && + m.kind !== 192 /* BindingElement */ && + m.kind !== 162 /* MethodDeclaration */ && + m.kind !== 164 /* GetAccessor */ && + m.kind !== 165 /* SetAccessor */ && + m.kind !== 284 /* SpreadAssignment */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -112614,10 +113200,10 @@ var ts; for (var _i = 0, existingMembers_2 = existingMembers; _i < existingMembers_2.length; _i++) { var m = existingMembers_2[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 159 /* PropertyDeclaration */ && - m.kind !== 161 /* MethodDeclaration */ && - m.kind !== 163 /* GetAccessor */ && - m.kind !== 164 /* SetAccessor */) { + if (m.kind !== 160 /* PropertyDeclaration */ && + m.kind !== 162 /* MethodDeclaration */ && + m.kind !== 164 /* GetAccessor */ && + m.kind !== 165 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -112658,7 +113244,7 @@ var ts; if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 273 /* JsxAttribute */) { + if (attr.kind === 274 /* JsxAttribute */) { seenNames.set(attr.name.escapedText, true); } else if (ts.isJsxSpreadAttribute(attr)) { @@ -112708,7 +113294,7 @@ var ts; var _keywordCompletions = []; var allKeywordsCompletions = ts.memoize(function () { var res = []; - for (var i = 77 /* FirstKeyword */; i <= 152 /* LastKeyword */; i++) { + for (var i = 77 /* FirstKeyword */; i <= 153 /* LastKeyword */; i++) { res.push({ name: ts.tokenToString(i), kind: "keyword" /* keyword */, @@ -112734,12 +113320,12 @@ var ts; return false; case 1 /* All */: return isFunctionLikeBodyKeyword(kind) - || kind === 130 /* DeclareKeyword */ - || kind === 135 /* ModuleKeyword */ - || kind === 145 /* TypeKeyword */ - || kind === 136 /* NamespaceKeyword */ + || kind === 131 /* DeclareKeyword */ + || kind === 136 /* ModuleKeyword */ + || kind === 146 /* TypeKeyword */ + || kind === 137 /* NamespaceKeyword */ || kind === 123 /* AsKeyword */ - || ts.isTypeKeyword(kind) && kind !== 146 /* UndefinedKeyword */; + || ts.isTypeKeyword(kind) && kind !== 147 /* UndefinedKeyword */; case 5 /* FunctionLikeBodyKeywords */: return isFunctionLikeBodyKeyword(kind); case 2 /* ClassElementKeywords */: @@ -112761,46 +113347,46 @@ var ts; switch (kind) { case 122 /* AbstractKeyword */: case 125 /* AnyKeyword */: - case 151 /* BigIntKeyword */: - case 128 /* BooleanKeyword */: - case 130 /* DeclareKeyword */: + case 152 /* BigIntKeyword */: + case 129 /* BooleanKeyword */: + case 131 /* DeclareKeyword */: case 88 /* EnumKeyword */: - case 150 /* GlobalKeyword */: + case 151 /* GlobalKeyword */: case 113 /* ImplementsKeyword */: - case 132 /* InferKeyword */: + case 133 /* InferKeyword */: case 114 /* InterfaceKeyword */: - case 133 /* IsKeyword */: - case 134 /* KeyOfKeyword */: - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: - case 137 /* NeverKeyword */: - case 140 /* NumberKeyword */: - case 141 /* ObjectKeyword */: + case 134 /* IsKeyword */: + case 135 /* KeyOfKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: + case 138 /* NeverKeyword */: + case 141 /* NumberKeyword */: + case 142 /* ObjectKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 119 /* PublicKeyword */: - case 138 /* ReadonlyKeyword */: - case 143 /* StringKeyword */: - case 144 /* SymbolKeyword */: - case 145 /* TypeKeyword */: - case 147 /* UniqueKeyword */: - case 148 /* UnknownKeyword */: + case 139 /* ReadonlyKeyword */: + case 144 /* StringKeyword */: + case 145 /* SymbolKeyword */: + case 146 /* TypeKeyword */: + case 148 /* UniqueKeyword */: + case 149 /* UnknownKeyword */: return true; default: return false; } } function isInterfaceOrTypeLiteralCompletionKeyword(kind) { - return kind === 138 /* ReadonlyKeyword */; + return kind === 139 /* ReadonlyKeyword */; } function isClassMemberCompletionKeyword(kind) { switch (kind) { case 122 /* AbstractKeyword */: - case 129 /* ConstructorKeyword */: - case 131 /* GetKeyword */: - case 142 /* SetKeyword */: + case 130 /* ConstructorKeyword */: + case 132 /* GetKeyword */: + case 143 /* SetKeyword */: case 126 /* AsyncKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: return true; default: return ts.isClassMemberModifier(kind); @@ -112859,7 +113445,7 @@ var ts; function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) { // class c { method() { } | method2() { } } switch (location.kind) { - case 324 /* SyntaxList */: + case 325 /* SyntaxList */: return ts.tryCast(location.parent, ts.isObjectTypeDeclaration); case 1 /* EndOfFileToken */: var cls = ts.tryCast(ts.lastOrUndefined(ts.cast(location.parent, ts.isSourceFile).statements), ts.isObjectTypeDeclaration); @@ -113027,11 +113613,11 @@ var ts; case 111 /* WhileKeyword */: case 86 /* DoKeyword */: return useParent(node.parent, function (n) { return ts.isIterationStatement(n, /*lookInLabeledStatements*/ true); }, getLoopBreakContinueOccurrences); - case 129 /* ConstructorKeyword */: - return getFromAllDeclarations(ts.isConstructorDeclaration, [129 /* ConstructorKeyword */]); - case 131 /* GetKeyword */: - case 142 /* SetKeyword */: - return getFromAllDeclarations(ts.isAccessor, [131 /* GetKeyword */, 142 /* SetKeyword */]); + case 130 /* ConstructorKeyword */: + return getFromAllDeclarations(ts.isConstructorDeclaration, [130 /* ConstructorKeyword */]); + case 132 /* GetKeyword */: + case 143 /* SetKeyword */: + return getFromAllDeclarations(ts.isAccessor, [132 /* GetKeyword */, 143 /* SetKeyword */]); case 127 /* AwaitKeyword */: return useParent(node.parent, ts.isAwaitExpression, getAsyncAndAwaitOccurrences); case 126 /* AsyncKeyword */: @@ -113079,7 +113665,7 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 290 /* SourceFile */) { + if (ts.isFunctionBlock(parent) || parent.kind === 291 /* SourceFile */) { return parent; } // A throw-statement is only owned by a try-statement if the try-statement has @@ -113111,16 +113697,16 @@ var ts; function getBreakOrContinueOwner(statement) { return ts.findAncestor(statement, function (node) { switch (node.kind) { - case 237 /* SwitchStatement */: - if (statement.kind === 233 /* ContinueStatement */) { + case 238 /* SwitchStatement */: + if (statement.kind === 234 /* ContinueStatement */) { return false; } // falls through - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 229 /* WhileStatement */: - case 228 /* DoStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 230 /* WhileStatement */: + case 229 /* DoStatement */: return !statement.label || isLabeledBy(node, statement.label.escapedText); default: // Don't cross function boundaries. @@ -113136,11 +113722,11 @@ var ts; // Types of node whose children might have modifiers. var container = declaration.parent; switch (container.kind) { - case 250 /* ModuleBlock */: - case 290 /* SourceFile */: - case 223 /* Block */: - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 251 /* ModuleBlock */: + case 291 /* SourceFile */: + case 224 /* Block */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: // Container is either a class declaration or the declaration is a classDeclaration if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) { return __spreadArrays(declaration.members, [declaration]); @@ -113148,14 +113734,14 @@ var ts; else { return container.statements; } - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 244 /* FunctionDeclaration */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: return __spreadArrays(container.parameters, (ts.isClassLike(container.parent) ? container.parent.members : [])); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 173 /* TypeLiteral */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 174 /* TypeLiteral */: var nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. @@ -113188,7 +113774,7 @@ var ts; var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 93 /* ForKeyword */, 111 /* WhileKeyword */, 86 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 228 /* DoStatement */) { + if (loopNode.kind === 229 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 111 /* WhileKeyword */)) { @@ -113208,13 +113794,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -113581,10 +114167,10 @@ var ts; if (cancellationToken) cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (!isAvailableThroughGlobal) { var parent = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent.kind === 242 /* VariableDeclaration */) { + if (exportKind === 2 /* ExportEquals */ && parent.kind === 243 /* VariableDeclaration */) { var name = parent.name; if (name.kind === 75 /* Identifier */) { directImports.push(name); @@ -113597,20 +114183,20 @@ var ts; break; case 75 /* Identifier */: // for 'const x = require("y"); break; // TODO: GH#23879 - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: handleNamespaceImport(direct, direct.name, ts.hasModifier(direct, 1 /* Export */), /*alreadyAddedDirect*/ false); break; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: directImports.push(direct); var namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 256 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 257 /* NamespaceImport */) { handleNamespaceImport(direct, namedBindings.name, /*isReExport*/ false, /*alreadyAddedDirect*/ true); } else if (!isAvailableThroughGlobal && ts.isDefaultImport(direct)) { addIndirectUser(getSourceFileLikeForImportDeclaration(direct)); // Add a check for indirect uses to handle synthetic default imports } break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: if (!direct.exportClause) { // This is `export * from "foo"`, so imports of this module may import the export too. handleDirectImports(getContainingModuleSymbol(direct, checker)); @@ -113620,7 +114206,7 @@ var ts; directImports.push(direct); } break; - case 188 /* ImportType */: + case 189 /* ImportType */: directImports.push(direct); break; default: @@ -113637,7 +114223,7 @@ var ts; } else if (!isAvailableThroughGlobal) { var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - ts.Debug.assert(sourceFileLike.kind === 290 /* SourceFile */ || sourceFileLike.kind === 249 /* ModuleDeclaration */); + ts.Debug.assert(sourceFileLike.kind === 291 /* SourceFile */ || sourceFileLike.kind === 250 /* ModuleDeclaration */); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUsers(sourceFileLike); } @@ -113694,7 +114280,7 @@ var ts; } return { importSearches: importSearches, singleReferences: singleReferences }; function handleImport(decl) { - if (decl.kind === 253 /* ImportEqualsDeclaration */) { + if (decl.kind === 254 /* ImportEqualsDeclaration */) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } @@ -113704,7 +114290,7 @@ var ts; handleNamespaceImportLike(decl); return; } - if (decl.kind === 188 /* ImportType */) { + if (decl.kind === 189 /* ImportType */) { if (decl.qualifier) { var firstIdentifier = ts.getFirstIdentifier(decl.qualifier); if (firstIdentifier.escapedText === ts.symbolName(exportSymbol)) { @@ -113720,7 +114306,7 @@ var ts; if (decl.moduleSpecifier.kind !== 10 /* StringLiteral */) { return; } - if (decl.kind === 260 /* ExportDeclaration */) { + if (decl.kind === 261 /* ExportDeclaration */) { if (decl.exportClause && ts.isNamedExports(decl.exportClause)) { searchForNamedImport(decl.exportClause); } @@ -113729,10 +114315,10 @@ var ts; var _a = decl.importClause || { name: undefined, namedBindings: undefined }, name = _a.name, namedBindings = _a.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: handleNamespaceImportLike(namedBindings.name); break; - case 257 /* NamedImports */: + case 258 /* NamedImports */: // 'default' might be accessed as a named import `{ default as foo }`. if (exportKind === 0 /* Named */ || exportKind === 1 /* Default */) { searchForNamedImport(namedBindings); @@ -113782,7 +114368,7 @@ var ts; } } else { - var localSymbol = element.kind === 263 /* ExportSpecifier */ && element.propertyName + var localSymbol = element.kind === 264 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol. : checker.getSymbolAtLocation(name); addSearch(name, localSymbol); @@ -113811,7 +114397,7 @@ var ts; for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { var referencingFile = sourceFiles_1[_i]; var searchSourceFile = searchModuleSymbol.valueDeclaration; - if (searchSourceFile.kind === 290 /* SourceFile */) { + if (searchSourceFile.kind === 291 /* SourceFile */) { for (var _a = 0, _b = referencingFile.referencedFiles; _a < _b.length; _a++) { var ref = _b[_a]; if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { @@ -113859,7 +114445,7 @@ var ts; } /** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */ function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return ts.forEach(sourceFileLike.kind === 290 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return ts.forEach(sourceFileLike.kind === 291 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); }); } @@ -113874,15 +114460,15 @@ var ts; else { forEachPossibleImportOrExportStatement(sourceFile, function (statement) { switch (statement.kind) { - case 260 /* ExportDeclaration */: - case 254 /* ImportDeclaration */: { + case 261 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: { var decl = statement; if (decl.moduleSpecifier && ts.isStringLiteral(decl.moduleSpecifier)) { action(decl, decl.moduleSpecifier); } break; } - case 253 /* ImportEqualsDeclaration */: { + case 254 /* ImportEqualsDeclaration */: { var decl = statement; if (isExternalModuleImportEquals(decl)) { action(decl, decl.moduleReference.expression); @@ -113906,7 +114492,7 @@ var ts; var parent = node.parent; var grandParent = parent.parent; if (symbol.exportSymbol) { - if (parent.kind === 194 /* PropertyAccessExpression */) { + if (parent.kind === 195 /* PropertyAccessExpression */) { // When accessing an export of a JS module, there's no alias. The symbol will still be flagged as an export even though we're at the use. // So check that we are at the declaration. return symbol.declarations.some(function (d) { return d === parent; }) && ts.isBinaryExpression(grandParent) @@ -114036,13 +114622,13 @@ var ts; function isNodeImport(node) { var parent = node.parent; switch (parent.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return parent.name === node && isExternalModuleImportEquals(parent); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. return !parent.propertyName; - case 255 /* ImportClause */: - case 256 /* NamespaceImport */: + case 256 /* ImportClause */: + case 257 /* NamespaceImport */: ts.Debug.assert(parent.name === node); return true; default: @@ -114075,21 +114661,21 @@ var ts; return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 196 /* CallExpression */) { + if (node.kind === 197 /* CallExpression */) { return node.getSourceFile(); } var parent = node.parent; - if (parent.kind === 290 /* SourceFile */) { + if (parent.kind === 291 /* SourceFile */) { return parent; } - ts.Debug.assert(parent.kind === 250 /* ModuleBlock */); + ts.Debug.assert(parent.kind === 251 /* ModuleBlock */); return ts.cast(parent.parent, isAmbientModuleDeclaration); } function isAmbientModuleDeclaration(node) { - return node.kind === 249 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; + return node.kind === 250 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; } function isExternalModuleImportEquals(eq) { - return eq.moduleReference.kind === 265 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; + return eq.moduleReference.kind === 266 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; } })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); @@ -114191,7 +114777,7 @@ var ts; if (!node) return undefined; switch (node.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return !ts.isVariableDeclarationList(node.parent) || node.parent.declarations.length !== 1 ? node : ts.isVariableStatement(node.parent.parent) ? @@ -114199,27 +114785,27 @@ var ts; ts.isForInOrOfStatement(node.parent.parent) ? getContextNode(node.parent.parent) : node.parent; - case 191 /* BindingElement */: + case 192 /* BindingElement */: return getContextNode(node.parent.parent); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return node.parent.parent.parent; - case 263 /* ExportSpecifier */: - case 256 /* NamespaceImport */: + case 264 /* ExportSpecifier */: + case 257 /* NamespaceImport */: return node.parent.parent; - case 255 /* ImportClause */: + case 256 /* ImportClause */: return node.parent; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return ts.isExpressionStatement(node.parent) ? node.parent : node; - case 232 /* ForOfStatement */: - case 231 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 232 /* ForInStatement */: return { start: node.initializer, end: node.expression }; - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(ts.findAncestor(node.parent, function (node) { return ts.isBinaryExpression(node) || ts.isForInOrOfStatement(node); @@ -114280,13 +114866,13 @@ var ts; } FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { return undefined; } var checker = program.getTypeChecker(); // If invoked directly on a shorthand property assignment, then return // the declaration of the symbol being assigned (not the symbol being assigned to). - if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { var result_1 = []; Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_1.push(nodeEntry(node)); }); return result_1; @@ -114436,13 +115022,13 @@ var ts; if (symbol) { return getDefinitionKindAndDisplayParts(symbol, checker, node); } - else if (node.kind === 193 /* ObjectLiteralExpression */) { + else if (node.kind === 194 /* ObjectLiteralExpression */) { return { kind: "interface" /* interfaceElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("object literal"), ts.punctuationPart(21 /* CloseParenToken */)] }; } - else if (node.kind === 214 /* ClassExpression */) { + else if (node.kind === 215 /* ClassExpression */) { return { kind: "local class" /* localClassElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("anonymous local class"), ts.punctuationPart(21 /* CloseParenToken */)] @@ -114492,7 +115078,7 @@ var ts; return node.kind === 84 /* DefaultKeyword */ || !!ts.getDeclarationFromName(node) || ts.isLiteralComputedPropertyDeclarationName(node) - || (node.kind === 129 /* ConstructorKeyword */ && ts.isConstructorDeclaration(node.parent)); + || (node.kind === 130 /* ConstructorKeyword */ && ts.isConstructorDeclaration(node.parent)); } /** * True if 'decl' provides a value, as in `function f() {}`; @@ -114503,47 +115089,47 @@ var ts; if (!!(decl.flags & 8388608 /* Ambient */)) return true; switch (decl.kind) { - case 209 /* BinaryExpression */: - case 191 /* BindingElement */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 210 /* BinaryExpression */: + case 192 /* BindingElement */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: case 84 /* DefaultKeyword */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 263 /* ExportSpecifier */: - case 255 /* ImportClause */: // default import - case 253 /* ImportEqualsDeclaration */: - case 258 /* ImportSpecifier */: - case 246 /* InterfaceDeclaration */: - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: - case 273 /* JsxAttribute */: - case 249 /* ModuleDeclaration */: - case 252 /* NamespaceExportDeclaration */: - case 256 /* NamespaceImport */: - case 262 /* NamespaceExport */: - case 156 /* Parameter */: - case 282 /* ShorthandPropertyAssignment */: - case 247 /* TypeAliasDeclaration */: - case 155 /* TypeParameter */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 264 /* ExportSpecifier */: + case 256 /* ImportClause */: // default import + case 254 /* ImportEqualsDeclaration */: + case 259 /* ImportSpecifier */: + case 247 /* InterfaceDeclaration */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: + case 274 /* JsxAttribute */: + case 250 /* ModuleDeclaration */: + case 253 /* NamespaceExportDeclaration */: + case 257 /* NamespaceImport */: + case 263 /* NamespaceExport */: + case 157 /* Parameter */: + case 283 /* ShorthandPropertyAssignment */: + case 248 /* TypeAliasDeclaration */: + case 156 /* TypeParameter */: return true; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // In `({ x: y } = 0);`, `x` is not a write access. (Won't call this function for `y`.) return !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent); - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return !!decl.body; - case 242 /* VariableDeclaration */: - case 159 /* PropertyDeclaration */: + case 243 /* VariableDeclaration */: + case 160 /* PropertyDeclaration */: return !!decl.initializer || ts.isCatchClause(decl.parent); - case 160 /* MethodSignature */: - case 158 /* PropertySignature */: - case 323 /* JSDocPropertyTag */: - case 317 /* JSDocParameterTag */: + case 161 /* MethodSignature */: + case 159 /* PropertySignature */: + case 324 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: return false; default: return ts.Debug.failBadSyntaxKind(decl); @@ -114704,10 +115290,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; switch (decl.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: // Don't include the source file itself. (This may not be ideal behavior, but awkward to include an entire file as a reference.) break; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: if (sourceFilesSet.has(decl.getSourceFile().fileName)) { references.push(nodeEntry(decl.name)); } @@ -114736,9 +115322,9 @@ var ts; } /** As in a `readonly prop: any` or `constructor(readonly prop: any)`, not a `readonly any[]`. */ function isReadonlyTypeOperator(node) { - return node.kind === 138 /* ReadonlyKeyword */ + return node.kind === 139 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(node.parent) - && node.parent.operator === 138 /* ReadonlyKeyword */; + && node.parent.operator === 139 /* ReadonlyKeyword */; } /** getReferencedSymbols for special node kinds. */ function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { @@ -114749,12 +115335,12 @@ var ts; } // A modifier readonly (like on a property declaration) is not special; // a readonly type keyword (like `readonly string[]`) is. - if (node.kind === 138 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { + if (node.kind === 139 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { return undefined; } // Likewise, when we *are* looking for a special keyword, make sure we // *don’t* include readonly member modifiers. - return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 138 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); + return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 139 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); } // Labels if (ts.isJumpStatementTarget(node)) { @@ -114815,7 +115401,7 @@ var ts; } function getSpecialSearchKind(node) { switch (node.kind) { - case 129 /* ConstructorKeyword */: + case 130 /* ConstructorKeyword */: return 1 /* Constructor */; case 75 /* Identifier */: if (ts.isClassLike(node.parent)) { @@ -115055,7 +115641,7 @@ var ts; // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 201 /* FunctionExpression */ || valueDeclaration.kind === 214 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 202 /* FunctionExpression */ || valueDeclaration.kind === 215 /* ClassExpression */)) { return valueDeclaration; } if (!declarations) { @@ -115065,7 +115651,7 @@ var ts; if (flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.find(declarations, function (d) { return ts.hasModifier(d, 8 /* Private */) || ts.isPrivateIdentifierPropertyDeclaration(d); }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 245 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 246 /* ClassDeclaration */); } // Else this is a public property and could be accessed from anywhere. return undefined; @@ -115094,7 +115680,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (!container || container.kind === 290 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 291 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { // This is a global variable and not an external module, any declaration defined // within this scope is visible outside the file return undefined; @@ -115463,15 +116049,15 @@ var ts; if (constructorSymbol && constructorSymbol.declarations) { for (var _i = 0, _a = constructorSymbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - var ctrKeyword = ts.findChildOfKind(decl, 129 /* ConstructorKeyword */, sourceFile); - ts.Debug.assert(decl.kind === 162 /* Constructor */ && !!ctrKeyword); + var ctrKeyword = ts.findChildOfKind(decl, 130 /* ConstructorKeyword */, sourceFile); + ts.Debug.assert(decl.kind === 163 /* Constructor */ && !!ctrKeyword); addNode(ctrKeyword); } } if (classSymbol.exports) { classSymbol.exports.forEach(function (member) { var decl = member.valueDeclaration; - if (decl && decl.kind === 161 /* MethodDeclaration */) { + if (decl && decl.kind === 162 /* MethodDeclaration */) { var body = decl.body; if (body) { forEachDescendantOfKind(body, 104 /* ThisKeyword */, function (thisKeyword) { @@ -115495,7 +116081,7 @@ var ts; } for (var _i = 0, _a = constructor.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - ts.Debug.assert(decl.kind === 162 /* Constructor */); + ts.Debug.assert(decl.kind === 163 /* Constructor */); var body = decl.body; if (body) { forEachDescendantOfKind(body, 102 /* SuperKeyword */, function (node) { @@ -115525,7 +116111,7 @@ var ts; if (refNode.kind !== 75 /* Identifier */) { return; } - if (refNode.parent.kind === 282 /* ShorthandPropertyAssignment */) { + if (refNode.parent.kind === 283 /* ShorthandPropertyAssignment */) { // Go ahead and dereference the shorthand assignment by going to its definition getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); } @@ -115545,7 +116131,7 @@ var ts; } else if (ts.isFunctionLike(typeHavingNode) && typeHavingNode.body) { var body = typeHavingNode.body; - if (body.kind === 223 /* Block */) { + if (body.kind === 224 /* Block */) { ts.forEachReturnStatement(body, function (returnStatement) { if (returnStatement.expression) addIfImplementation(returnStatement.expression); @@ -115573,13 +116159,13 @@ var ts; */ function isImplementationExpression(node) { switch (node.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isImplementationExpression(node.expression); - case 202 /* ArrowFunction */: - case 201 /* FunctionExpression */: - case 193 /* ObjectLiteralExpression */: - case 214 /* ClassExpression */: - case 192 /* ArrayLiteralExpression */: + case 203 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 194 /* ObjectLiteralExpression */: + case 215 /* ClassExpression */: + case 193 /* ArrayLiteralExpression */: return true; default: return false; @@ -115632,13 +116218,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -115659,41 +116245,41 @@ var ts; return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references: references }]; } function isParameterName(node) { - return node.kind === 75 /* Identifier */ && node.parent.kind === 156 /* Parameter */ && node.parent.name === node; + return node.kind === 75 /* Identifier */ && node.parent.kind === 157 /* Parameter */ && node.parent.name === node; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); // Whether 'this' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // falls through - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { return undefined; } // falls through - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. default: return undefined; } - var references = ts.flatMap(searchSpaceNode.kind === 290 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { + var references = ts.flatMap(searchSpaceNode.kind === 291 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { cancellationToken.throwIfCancellationRequested(); return getPossibleSymbolReferenceNodes(sourceFile, "this", ts.isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter(function (node) { if (!ts.isThis(node)) { @@ -115701,19 +116287,19 @@ var ts; } var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); switch (searchSpaceNode.kind) { - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: return searchSpaceNode.symbol === container.symbol; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: return ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol; - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: // Make sure the container belongs to the same class // and has the appropriate static modifier from the original container. return container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag; - case 290 /* SourceFile */: - return container.kind === 290 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); + case 291 /* SourceFile */: + return container.kind === 291 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); } }); }).map(function (n) { return nodeEntry(n); }); @@ -115796,7 +116382,7 @@ var ts; ts.Debug.assert(paramProps.length === 2 && !!(paramProps[0].flags & 1 /* FunctionScopedVariable */) && !!(paramProps[1].flags & 4 /* Property */)); // is [parameter, property] return fromRoot(symbol.flags & 1 /* FunctionScopedVariable */ ? paramProps[1] : paramProps[0]); } - var exportSpecifier = ts.getDeclarationOfKind(symbol, 263 /* ExportSpecifier */); + var exportSpecifier = ts.getDeclarationOfKind(symbol, 264 /* ExportSpecifier */); if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) { var localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); if (localSymbol) { @@ -115841,7 +116427,7 @@ var ts; }); } function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { - var bindingElement = ts.getDeclarationOfKind(symbol, 191 /* BindingElement */); + var bindingElement = ts.getDeclarationOfKind(symbol, 192 /* BindingElement */); if (bindingElement && ts.isObjectBindingElementWithoutPropertyName(bindingElement)) { return ts.getPropertySymbolFromBindingElement(checker, bindingElement); } @@ -116237,55 +116823,55 @@ var ts; } switch (node.kind) { case 75 /* Identifier */: - case 253 /* ImportEqualsDeclaration */: - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: // do not descend into nodes that cannot contain callable nodes return; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: // do not descend into the type side of an assertion collect(node.expression); return; - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: // do not descend into the type of a variable or parameter declaration collect(node.name); collect(node.initializer); return; - case 196 /* CallExpression */: + case 197 /* CallExpression */: // do not descend into the type arguments of a call expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 197 /* NewExpression */: + case 198 /* NewExpression */: // do not descend into the type arguments of a new expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: // do not descend into the type arguments of a tagged template expression recordCallSite(node); collect(node.tag); collect(node.template); return; - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: // do not descend into the type arguments of a JsxOpeningLikeElement recordCallSite(node); collect(node.tagName); collect(node.attributes); return; - case 157 /* Decorator */: + case 158 /* Decorator */: recordCallSite(node); collect(node.expression); return; - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: recordCallSite(node); ts.forEachChild(node, collect); break; @@ -116335,22 +116921,22 @@ var ts; var callSites = []; var collect = createCallSiteCollector(program, callSites); switch (node.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: collectCallSitesOfSourceFile(node, collect); break; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: collectCallSitesOfModuleDeclaration(node, collect); break; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect); break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: collectCallSitesOfClassLikeDeclaration(node, collect); break; default: @@ -116647,7 +117233,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { var shorthandSymbol_1 = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); return shorthandSymbol_1 ? shorthandSymbol_1.declarations.map(function (decl) { return createDefinitionInfo(decl, typeChecker, shorthandSymbol_1, node); }) : []; } @@ -116816,11 +117402,11 @@ var ts; return true; } switch (declaration.kind) { - case 255 /* ImportClause */: - case 253 /* ImportEqualsDeclaration */: + case 256 /* ImportClause */: + case 254 /* ImportEqualsDeclaration */: return true; - case 258 /* ImportSpecifier */: - return declaration.parent.kind === 257 /* NamedImports */; + case 259 /* ImportSpecifier */: + return declaration.parent.kind === 258 /* NamedImports */; default: return false; } @@ -116834,7 +117420,7 @@ var ts; function getConstructSignatureDefinition() { // Applicable only if we are in a new expression, or we are on a constructor declaration // and in either case the symbol has a construct signature definition, i.e. class - if (symbol.flags & 32 /* Class */ && !(symbol.flags & 16 /* Function */) && (ts.isNewExpressionTarget(node) || node.kind === 129 /* ConstructorKeyword */)) { + if (symbol.flags & 32 /* Class */ && !(symbol.flags & 16 /* Function */) && (ts.isNewExpressionTarget(node) || node.kind === 130 /* ConstructorKeyword */)) { var cls = ts.find(filteredDeclarations, ts.isClassLike) || ts.Debug.fail("Expected declaration to have at least one class-like declaration"); return getSignatureDefinition(cls.members, /*selectConstructors*/ true); } @@ -116907,9 +117493,9 @@ var ts; } function isConstructorLike(node) { switch (node.kind) { - case 162 /* Constructor */: - case 171 /* ConstructorType */: - case 166 /* ConstructSignature */: + case 163 /* Constructor */: + case 172 /* ConstructorType */: + case 167 /* ConstructSignature */: return true; default: return false; @@ -117027,11 +117613,11 @@ var ts; JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; function getCommentHavingNodes(declaration) { switch (declaration.kind) { - case 317 /* JSDocParameterTag */: - case 323 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: + case 324 /* JSDocPropertyTag */: return [declaration]; - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: return [declaration, declaration.parent]; default: return ts.getJSDocCommentsAndTags(declaration); @@ -117052,18 +117638,18 @@ var ts; function getCommentText(tag) { var comment = tag.comment; switch (tag.kind) { - case 308 /* JSDocImplementsTag */: + case 309 /* JSDocImplementsTag */: return withNode(tag.class); - case 307 /* JSDocAugmentsTag */: + case 308 /* JSDocAugmentsTag */: return withNode(tag.class); - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return withList(tag.typeParameters); - case 320 /* JSDocTypeTag */: + case 321 /* JSDocTypeTag */: return withNode(tag.typeExpression); - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 323 /* JSDocPropertyTag */: - case 317 /* JSDocParameterTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 324 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: var name = tag.name; return name ? withNode(name) : comment; default: @@ -117232,23 +117818,23 @@ var ts; } function getCommentOwnerInfoWorker(commentOwner) { switch (commentOwner.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 160 /* MethodSignature */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 161 /* MethodSignature */: var parameters = commentOwner.parameters; return { commentOwner: commentOwner, parameters: parameters }; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return getCommentOwnerInfoWorker(commentOwner.initializer); - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 158 /* PropertySignature */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 247 /* TypeAliasDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 159 /* PropertySignature */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 248 /* TypeAliasDeclaration */: return { commentOwner: commentOwner }; - case 225 /* VariableStatement */: { + case 226 /* VariableStatement */: { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; var parameters_1 = varDeclarations.length === 1 && varDeclarations[0].initializer @@ -117256,14 +117842,14 @@ var ts; : undefined; return { commentOwner: commentOwner, parameters: parameters_1 }; } - case 290 /* SourceFile */: + case 291 /* SourceFile */: return "quit"; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: // If in walking up the tree, we hit a a nested namespace declaration, // then we must be somewhere within a dotted namespace name; however we don't // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. - return commentOwner.parent.kind === 249 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; - case 209 /* BinaryExpression */: { + return commentOwner.parent.kind === 250 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; + case 210 /* BinaryExpression */: { var be = commentOwner; if (ts.getAssignmentDeclarationKind(be) === 0 /* None */) { return "quit"; @@ -117271,7 +117857,7 @@ var ts; var parameters_2 = ts.isFunctionLike(be.right) ? be.right.parameters : ts.emptyArray; return { commentOwner: commentOwner, parameters: parameters_2 }; } - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: var init = commentOwner.initializer; if (init && (ts.isFunctionExpression(init) || ts.isArrowFunction(init))) { return { commentOwner: commentOwner, parameters: init.parameters }; @@ -117287,14 +117873,14 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 200 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 201 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return rightHandSide.parameters; - case 214 /* ClassExpression */: { + case 215 /* ClassExpression */: { var ctr = ts.find(rightHandSide.members, ts.isConstructorDeclaration); return ctr ? ctr.parameters : ts.emptyArray; } @@ -117356,9 +117942,9 @@ var ts; } function shouldKeepItem(declaration, checker) { switch (declaration.kind) { - case 255 /* ImportClause */: - case 258 /* ImportSpecifier */: - case 253 /* ImportEqualsDeclaration */: + case 256 /* ImportClause */: + case 259 /* ImportSpecifier */: + case 254 /* ImportEqualsDeclaration */: var importer = checker.getSymbolAtLocation(declaration.name); // TODO: GH#18217 var imported = checker.getAliasedSymbol(importer); return importer.escapedName !== imported.escapedName; @@ -117368,7 +117954,7 @@ var ts; } function tryAddSingleDeclarationName(declaration, containers) { var name = ts.getNameOfDeclaration(declaration); - return !!name && (pushLiteral(name, containers) || name.kind === 154 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); + return !!name && (pushLiteral(name, containers) || name.kind === 155 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); } // Only added the names of computed properties if they're simple dotted expressions, like: // @@ -117385,7 +117971,7 @@ var ts; // First, if we started with a computed property name, then add all but the last // portion into the container array. var name = ts.getNameOfDeclaration(declaration); - if (name && name.kind === 154 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { + if (name && name.kind === 155 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { return ts.emptyArray; } // Don't include the last portion. @@ -117592,7 +118178,7 @@ var ts; return; } switch (node.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it. var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); @@ -117604,21 +118190,21 @@ var ts; } } break; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 161 /* MethodSignature */: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 255 /* ImportClause */: + case 256 /* ImportClause */: var importClause = node; // Handle default import case e.g.: // import d from "mod"; @@ -117630,7 +118216,7 @@ var ts; // import {a, b as B} from "mod"; var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 256 /* NamespaceImport */) { + if (namedBindings.kind === 257 /* NamespaceImport */) { addLeafNode(namedBindings); } else { @@ -117641,17 +118227,17 @@ var ts; } } break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: addNodeWithRecursiveChild(node, node.name); break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: var expression = node.expression; // Use the expression as the name of the SpreadAssignment, otherwise show as . ts.isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node); break; - case 191 /* BindingElement */: - case 281 /* PropertyAssignment */: - case 242 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 282 /* PropertyAssignment */: + case 243 /* VariableDeclaration */: var _e = node, name = _e.name, initializer = _e.initializer; if (ts.isBindingPattern(name)) { addChildrenRecursively(name); @@ -117666,7 +118252,7 @@ var ts; addNodeWithRecursiveChild(node, initializer); } break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: var nameNode = node.name; // If we see a function declaration track as a possible ES5 class if (nameNode && ts.isIdentifier(nameNode)) { @@ -117674,11 +118260,11 @@ var ts; } addNodeWithRecursiveChild(node, node.body); break; - case 202 /* ArrowFunction */: - case 201 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 202 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: startNode(node); for (var _f = 0, _g = node.members; _f < _g.length; _f++) { var member = _g[_f]; @@ -117688,9 +118274,9 @@ var ts; } endNode(); break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: startNode(node); for (var _h = 0, _j = node.members; _h < _j.length; _h++) { var member = _j[_h]; @@ -117698,20 +118284,20 @@ var ts; } endNode(); break; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 259 /* ExportAssignment */: - case 263 /* ExportSpecifier */: - case 253 /* ImportEqualsDeclaration */: - case 167 /* IndexSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 247 /* TypeAliasDeclaration */: + case 260 /* ExportAssignment */: + case 264 /* ExportSpecifier */: + case 254 /* ImportEqualsDeclaration */: + case 168 /* IndexSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 248 /* TypeAliasDeclaration */: addLeafNode(node); break; - case 196 /* CallExpression */: - case 209 /* BinaryExpression */: { + case 197 /* CallExpression */: + case 210 /* BinaryExpression */: { var special = ts.getAssignmentDeclarationKind(node); switch (special) { case 1 /* ExportsProperty */: @@ -117953,12 +118539,12 @@ var ts; return false; } switch (a.kind) { - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return ts.hasModifier(a, 32 /* Static */) === ts.hasModifier(b, 32 /* Static */); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return areSameModule(a, b); default: return true; @@ -117974,7 +118560,7 @@ var ts; // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'! function areSameModule(a, b) { // TODO: GH#18217 - return a.body.kind === b.body.kind && (a.body.kind !== 249 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 250 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); } /** Merge source into target. Source should be thrown away after this is called. */ function merge(target, source) { @@ -118004,7 +118590,7 @@ var ts; * So `new()` can still come before an `aardvark` method. */ function tryGetName(node) { - if (node.kind === 249 /* ModuleDeclaration */) { + if (node.kind === 250 /* ModuleDeclaration */) { return getModuleName(node); } var declName = ts.getNameOfDeclaration(node); @@ -118013,16 +118599,16 @@ var ts; return propertyName && ts.unescapeLeadingUnderscores(propertyName); } switch (node.kind) { - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 214 /* ClassExpression */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 215 /* ClassExpression */: return getFunctionOrClassName(node); default: return undefined; } } function getItemName(node, name) { - if (node.kind === 249 /* ModuleDeclaration */) { + if (node.kind === 250 /* ModuleDeclaration */) { return cleanText(getModuleName(node)); } if (name) { @@ -118034,18 +118620,18 @@ var ts; } } switch (node.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return ts.isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; - case 202 /* ArrowFunction */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 203 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: if (ts.getModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -118053,13 +118639,13 @@ var ts; // (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the // navigation bar. return getFunctionOrClassName(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return "constructor"; - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: return "new()"; - case 165 /* CallSignature */: + case 166 /* CallSignature */: return "()"; - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: return "[]"; default: return ""; @@ -118092,19 +118678,19 @@ var ts; } // Some nodes are otherwise important enough to always include in the primary navigation menu. switch (navigationBarNodeKind(item)) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 248 /* EnumDeclaration */: - case 246 /* InterfaceDeclaration */: - case 249 /* ModuleDeclaration */: - case 290 /* SourceFile */: - case 247 /* TypeAliasDeclaration */: - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 249 /* EnumDeclaration */: + case 247 /* InterfaceDeclaration */: + case 250 /* ModuleDeclaration */: + case 291 /* SourceFile */: + case 248 /* TypeAliasDeclaration */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: return true; - case 202 /* ArrowFunction */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -118114,10 +118700,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 250 /* ModuleBlock */: - case 290 /* SourceFile */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: + case 251 /* ModuleBlock */: + case 291 /* SourceFile */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: return true; default: return false; @@ -118177,7 +118763,7 @@ var ts; // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 249 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 250 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } @@ -118191,13 +118777,13 @@ var ts; return decl.body && ts.isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 154 /* ComputedPropertyName */; + return !member.name || member.name.kind === 155 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 290 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); + return node.kind === 291 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); } function getModifiers(node) { - if (node.parent && node.parent.kind === 242 /* VariableDeclaration */) { + if (node.parent && node.parent.kind === 243 /* VariableDeclaration */) { node = node.parent; } return ts.getNodeModifiers(node); @@ -118255,9 +118841,9 @@ var ts; } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 202 /* ArrowFunction */: - case 201 /* FunctionExpression */: - case 214 /* ClassExpression */: + case 203 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 215 /* ClassExpression */: return true; default: return false; @@ -118765,7 +119351,7 @@ var ts; } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 223 /* Block */: + case 224 /* Block */: if (ts.isFunctionLike(n.parent)) { return functionSpan(n.parent, n, sourceFile); } @@ -118773,16 +119359,16 @@ var ts; // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. switch (n.parent.kind) { - case 228 /* DoStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 230 /* ForStatement */: - case 227 /* IfStatement */: - case 229 /* WhileStatement */: - case 236 /* WithStatement */: - case 280 /* CatchClause */: + case 229 /* DoStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 231 /* ForStatement */: + case 228 /* IfStatement */: + case 230 /* WhileStatement */: + case 237 /* WithStatement */: + case 281 /* CatchClause */: return spanForNode(n.parent); - case 240 /* TryStatement */: + case 241 /* TryStatement */: // Could be the try-block, or the finally-block. var tryStatement = n.parent; if (tryStatement.tryBlock === n) { @@ -118799,26 +119385,29 @@ var ts; // the span of the block, independent of any parent span. return createOutliningSpan(ts.createTextSpanFromNode(n, sourceFile), "code" /* Code */); } - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return spanForNode(n.parent); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 251 /* CaseBlock */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 252 /* CaseBlock */: return spanForNode(n); - case 193 /* ObjectLiteralExpression */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: + return spanForNodeArray(n.statements); + case 194 /* ObjectLiteralExpression */: return spanForObjectOrArrayLiteral(n); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return spanForObjectOrArrayLiteral(n, 22 /* OpenBracketToken */); - case 266 /* JsxElement */: + case 267 /* JsxElement */: return spanForJSXElement(n); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return spanForJSXFragment(n); - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: return spanForJSXAttributes(n.attributes); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: return spanForTemplateLiteral(n); } @@ -118861,13 +119450,16 @@ var ts; var closeToken = ts.findChildOfKind(n, close, sourceFile); return openToken && closeToken && spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart); } + function spanForNodeArray(nodeArray) { + return nodeArray.length ? createOutliningSpan(ts.createTextSpanFromRange(nodeArray), "code" /* Code */) : undefined; + } } function functionSpan(node, body, sourceFile) { var openToken = ts.isNodeArrayMultiLine(node.parameters, sourceFile) ? ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile) : ts.findChildOfKind(body, 18 /* OpenBraceToken */, sourceFile); var closeToken = ts.findChildOfKind(body, 19 /* CloseBraceToken */, sourceFile); - return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 202 /* ArrowFunction */); + return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 203 /* ArrowFunction */); } function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart) { if (autoCollapse === void 0) { autoCollapse = false; } @@ -119402,10 +119994,10 @@ var ts; */ function tryConsumeDeclare() { var token = ts.scanner.getToken(); - if (token === 130 /* DeclareKeyword */) { + if (token === 131 /* DeclareKeyword */) { // declare module "mod" token = nextToken(); - if (token === 135 /* ModuleKeyword */) { + if (token === 136 /* ModuleKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { recordAmbientExternalModule(); @@ -119427,7 +120019,7 @@ var ts; token = nextToken(); if (token === 20 /* OpenParenToken */) { token = nextToken(); - if (token === 10 /* StringLiteral */) { + if (token === 10 /* StringLiteral */ || token === 14 /* NoSubstitutionTemplateLiteral */) { // import("mod"); recordModuleName(); return true; @@ -119441,7 +120033,7 @@ var ts; else { if (token === 75 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 149 /* FromKeyword */) { + if (token === 150 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import d from "mod"; @@ -119472,7 +120064,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 149 /* FromKeyword */) { + if (token === 150 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import {a as A} from "mod"; @@ -119488,7 +120080,7 @@ var ts; token = nextToken(); if (token === 75 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 149 /* FromKeyword */) { + if (token === 150 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import * as NS from "mod" @@ -119518,7 +120110,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 149 /* FromKeyword */) { + if (token === 150 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export {a as A} from "mod"; @@ -119530,7 +120122,7 @@ var ts; } else if (token === 41 /* AsteriskToken */) { token = nextToken(); - if (token === 149 /* FromKeyword */) { + if (token === 150 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export * from "mod" @@ -119553,13 +120145,15 @@ var ts; } return false; } - function tryConsumeRequireCall(skipCurrentToken) { + function tryConsumeRequireCall(skipCurrentToken, allowTemplateLiterals) { + if (allowTemplateLiterals === void 0) { allowTemplateLiterals = false; } var token = skipCurrentToken ? nextToken() : ts.scanner.getToken(); - if (token === 139 /* RequireKeyword */) { + if (token === 140 /* RequireKeyword */) { token = nextToken(); if (token === 20 /* OpenParenToken */) { token = nextToken(); - if (token === 10 /* StringLiteral */) { + if (token === 10 /* StringLiteral */ || + allowTemplateLiterals && token === 14 /* NoSubstitutionTemplateLiteral */) { // require("mod"); recordModuleName(); } @@ -119576,7 +120170,7 @@ var ts; return true; } token = nextToken(); - if (token === 10 /* StringLiteral */) { + if (token === 10 /* StringLiteral */ || token === 14 /* NoSubstitutionTemplateLiteral */) { // looks like define ("modname", ... - skip string literal and comma token = nextToken(); if (token === 27 /* CommaToken */) { @@ -119596,7 +120190,7 @@ var ts; // scan until ']' or EOF while (token !== 23 /* CloseBracketToken */ && token !== 1 /* EndOfFileToken */) { // record string literals as module names - if (token === 10 /* StringLiteral */) { + if (token === 10 /* StringLiteral */ || token === 14 /* NoSubstitutionTemplateLiteral */) { recordModuleName(); } token = nextToken(); @@ -119631,7 +120225,8 @@ var ts; if (tryConsumeDeclare() || tryConsumeImport() || tryConsumeExport() || - (detectJavaScriptImports && (tryConsumeRequireCall(/*skipCurrentToken*/ false) || tryConsumeDefine()))) { + (detectJavaScriptImports && (tryConsumeRequireCall(/*skipCurrentToken*/ false, /*allowTemplateLiterals*/ true) || + tryConsumeDefine()))) { continue; } else { @@ -119707,14 +120302,14 @@ var ts; return getRenameInfoError(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); } // Cannot rename `default` as in `import { default as foo } from "./someModule"; - if (ts.isIdentifier(node) && node.originalKeywordKind === 84 /* DefaultKeyword */ && symbol.parent.flags & 1536 /* Module */) { + if (ts.isIdentifier(node) && node.originalKeywordKind === 84 /* DefaultKeyword */ && symbol.parent && symbol.parent.flags & 1536 /* Module */) { return undefined; } if (ts.isStringLiteralLike(node) && ts.tryGetImportFromModuleSpecifier(node)) { return options && options.allowRenameOfImportPath ? getRenameInfoForModule(node, sourceFile, symbol) : undefined; } var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 154 /* ComputedPropertyName */) + var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 155 /* ComputedPropertyName */) ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node)) : undefined; var displayName = specifierName || typeChecker.symbolToString(symbol); @@ -119926,14 +120521,14 @@ var ts; ts.Debug.assertEqual(closeBraceToken.kind, 19 /* CloseBraceToken */); // Group `-/+readonly` and `-/+?` var groupedWithPlusMinusTokens = groupChildren(children, function (child) { - return child === node.readonlyToken || child.kind === 138 /* ReadonlyKeyword */ || + return child === node.readonlyToken || child.kind === 139 /* ReadonlyKeyword */ || child === node.questionToken || child.kind === 57 /* QuestionToken */; }); // Group type parameter with surrounding brackets var groupedWithBrackets = groupChildren(groupedWithPlusMinusTokens, function (_a) { var kind = _a.kind; return kind === 22 /* OpenBracketToken */ || - kind === 155 /* TypeParameter */ || + kind === 156 /* TypeParameter */ || kind === 23 /* CloseBracketToken */; }); return [ @@ -120040,7 +120635,7 @@ var ts; } function createSyntaxList(children) { ts.Debug.assertGreaterThanOrEqual(children.length, 1); - var syntaxList = ts.createNode(324 /* SyntaxList */, children[0].pos, ts.last(children).end); + var syntaxList = ts.createNode(325 /* SyntaxList */, children[0].pos, ts.last(children).end); syntaxList._children = children; return syntaxList; } @@ -120049,14 +120644,14 @@ var ts; return kind === 18 /* OpenBraceToken */ || kind === 22 /* OpenBracketToken */ || kind === 20 /* OpenParenToken */ - || kind === 268 /* JsxOpeningElement */; + || kind === 269 /* JsxOpeningElement */; } function isListCloser(token) { var kind = token && token.kind; return kind === 19 /* CloseBraceToken */ || kind === 23 /* CloseBracketToken */ || kind === 21 /* CloseParenToken */ - || kind === 269 /* JsxClosingElement */; + || kind === 270 /* JsxClosingElement */; } })(SmartSelectionRange = ts.SmartSelectionRange || (ts.SmartSelectionRange = {})); })(ts || (ts = {})); @@ -120261,10 +120856,10 @@ var ts; } return undefined; } - else if (ts.isTemplateHead(node) && parent.parent.kind === 198 /* TaggedTemplateExpression */) { + else if (ts.isTemplateHead(node) && parent.parent.kind === 199 /* TaggedTemplateExpression */) { var templateExpression = parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 211 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 212 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } @@ -120331,17 +120926,17 @@ var ts; return undefined; var parent = startingToken.parent; switch (parent.kind) { - case 200 /* ParenthesizedExpression */: - case 161 /* MethodDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 201 /* ParenthesizedExpression */: + case 162 /* MethodDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: var info = getArgumentOrParameterListInfo(startingToken, sourceFile); if (!info) return undefined; var argumentIndex = info.argumentIndex, argumentCount = info.argumentCount, argumentsSpan = info.argumentsSpan; var contextualType = ts.isMethodDeclaration(parent) ? checker.getContextualTypeForObjectLiteralElement(parent) : checker.getContextualType(parent); return contextualType && { contextualType: contextualType, argumentIndex: argumentIndex, argumentCount: argumentCount, argumentsSpan: argumentsSpan }; - case 209 /* BinaryExpression */: { + case 210 /* BinaryExpression */: { var highestBinary = getHighestBinary(parent); var contextualType_1 = checker.getContextualType(highestBinary); var argumentIndex_1 = startingToken.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent) - 1; @@ -120465,7 +121060,7 @@ var ts; // | | // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 211 /* TemplateExpression */) { + if (template.kind === 212 /* TemplateExpression */) { var lastSpan = ts.last(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -120812,11 +121407,11 @@ var ts; function containsTopLevelCommonjs(sourceFile) { return sourceFile.statements.some(function (statement) { switch (statement.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return statement.declarationList.declarations.some(function (decl) { return !!decl.initializer && ts.isRequireCall(propertyAccessLeftHandSide(decl.initializer), /*checkArgumentIsStringLiteralLike*/ true); }); - case 226 /* ExpressionStatement */: { + case 227 /* ExpressionStatement */: { var expression = statement.expression; if (!ts.isBinaryExpression(expression)) return ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true); @@ -120833,12 +121428,12 @@ var ts; } function importNameForConvertToDefaultImport(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: var importClause = node.importClause, moduleSpecifier = node.moduleSpecifier; - return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 256 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) + return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 257 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : undefined; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return node.name; default: return undefined; @@ -120896,9 +121491,9 @@ var ts; // should be kept up to date with getTransformationBody in convertToAsyncFunction.ts function isFixablePromiseArgument(arg) { switch (arg.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); // falls through case 100 /* NullKeyword */: @@ -120913,7 +121508,7 @@ var ts; } function canBeConvertedToClass(node) { var _a, _b, _c, _d; - if (node.kind === 201 /* FunctionExpression */) { + if (node.kind === 202 /* FunctionExpression */) { if (ts.isVariableDeclaration(node.parent) && ((_a = node.symbol.members) === null || _a === void 0 ? void 0 : _a.size)) { return true; } @@ -120921,7 +121516,7 @@ var ts; var symbol = decl === null || decl === void 0 ? void 0 : decl.symbol; return !!(symbol && (((_b = symbol.exports) === null || _b === void 0 ? void 0 : _b.size) || ((_c = symbol.members) === null || _c === void 0 ? void 0 : _c.size))); } - if (node.kind === 244 /* FunctionDeclaration */) { + if (node.kind === 245 /* FunctionDeclaration */) { return !!((_d = node.symbol.members) === null || _d === void 0 ? void 0 : _d.size); } return false; @@ -120940,7 +121535,7 @@ var ts; } var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32 /* Class */) { - return ts.getDeclarationOfKind(symbol, 214 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 215 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; } if (flags & 384 /* Enum */) @@ -121026,11 +121621,11 @@ var ts; // If we requested completions after `x.` at the top-level, we may be at a source file location. switch (location.parent && location.parent.kind) { // If we've typed a character of the attribute name, will be 'JsxAttribute', else will be 'JsxOpeningElement'. - case 268 /* JsxOpeningElement */: - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: return location.kind === 75 /* Identifier */ ? "property" /* memberVariableElement */ : "JSX attribute" /* jsxAttribute */; - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return "JSX attribute" /* jsxAttribute */; default: return "property" /* memberVariableElement */; @@ -121074,7 +121669,7 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (location.parent && location.parent.kind === 194 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 195 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -121094,7 +121689,7 @@ var ts; } if (callExpressionLike) { signature = typeChecker.getResolvedSignature(callExpressionLike); // TODO: GH#18217 - var useConstructSignatures = callExpressionLike.kind === 197 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 102 /* SuperKeyword */); + var useConstructSignatures = callExpressionLike.kind === 198 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 102 /* SuperKeyword */); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -121150,29 +121745,29 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || // name of function declaration - (location.kind === 129 /* ConstructorKeyword */ && location.parent.kind === 162 /* Constructor */)) { // At constructor keyword of constructor declaration + (location.kind === 130 /* ConstructorKeyword */ && location.parent.kind === 163 /* Constructor */)) { // At constructor keyword of constructor declaration // get the signature from the declaration and write it var functionDeclaration_1 = location.parent; // Use function declaration to write the signatures only if the symbol corresponding to this declaration var locationIsSymbolDeclaration = symbol.declarations && ts.find(symbol.declarations, function (declaration) { - return declaration === (location.kind === 129 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); + return declaration === (location.kind === 130 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); }); if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 162 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration_1.kind === 163 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); // TODO: GH#18217 } else { signature = allSignatures[0]; } - if (functionDeclaration_1.kind === 162 /* Constructor */) { + if (functionDeclaration_1.kind === 163 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = "constructor" /* constructorImplementationElement */; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 165 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 166 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -121183,7 +121778,7 @@ var ts; } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { addAliasPrefixIfNecessary(); - if (ts.getDeclarationOfKind(symbol, 214 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 215 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -121206,7 +121801,7 @@ var ts; } if ((symbolFlags & 524288 /* TypeAlias */) && (semanticMeaning & 2 /* Type */)) { prefixNextMeaning(); - displayParts.push(ts.keywordPart(145 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(146 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); @@ -121227,9 +121822,9 @@ var ts; } if (symbolFlags & 1536 /* Module */ && !isThisExpression) { prefixNextMeaning(); - var declaration = ts.getDeclarationOfKind(symbol, 249 /* ModuleDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 250 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 75 /* Identifier */; - displayParts.push(ts.keywordPart(isNamespace ? 136 /* NamespaceKeyword */ : 135 /* ModuleKeyword */)); + displayParts.push(ts.keywordPart(isNamespace ? 137 /* NamespaceKeyword */ : 136 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -121248,7 +121843,7 @@ var ts; } else { // Method/function type parameter - var decl = ts.getDeclarationOfKind(symbol, 155 /* TypeParameter */); + var decl = ts.getDeclarationOfKind(symbol, 156 /* TypeParameter */); if (decl === undefined) return ts.Debug.fail(); var declaration = decl.parent; @@ -121256,21 +121851,21 @@ var ts; if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); // TODO: GH#18217 - if (declaration.kind === 166 /* ConstructSignature */) { + if (declaration.kind === 167 /* ConstructSignature */) { displayParts.push(ts.keywordPart(99 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 165 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 166 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } - else if (declaration.kind === 247 /* TypeAliasDeclaration */) { + else if (declaration.kind === 248 /* TypeAliasDeclaration */) { // Type alias type parameter // For example // type list = T[]; // Both T will go through same code path addInPrefix(); - displayParts.push(ts.keywordPart(145 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(146 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -121282,7 +121877,7 @@ var ts; symbolKind = "enum member" /* enumMemberElement */; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 284 /* EnumMember */) { + if (declaration.kind === 285 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -121312,17 +121907,17 @@ var ts; } } switch (symbol.declarations[0].kind) { - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(136 /* NamespaceKeyword */)); + displayParts.push(ts.keywordPart(137 /* NamespaceKeyword */)); break; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 62 /* EqualsToken */ : 84 /* DefaultKeyword */)); break; - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); break; default: @@ -121331,13 +121926,13 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 253 /* ImportEqualsDeclaration */) { + if (declaration.kind === 254 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(62 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(139 /* RequireKeyword */)); + displayParts.push(ts.keywordPart(140 /* RequireKeyword */)); displayParts.push(ts.punctuationPart(20 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(21 /* CloseParenToken */)); @@ -121410,10 +122005,10 @@ var ts; // For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo` // there documentation comments might be attached to the right hand side symbol of their declarations. // The pattern of such special property access is that the parent symbol is the symbol of the file. - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 290 /* SourceFile */; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 291 /* SourceFile */; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 209 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 210 /* BinaryExpression */) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -121531,16 +122126,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 201 /* FunctionExpression */) { + if (declaration.kind === 202 /* FunctionExpression */) { return true; } - if (declaration.kind !== 242 /* VariableDeclaration */ && declaration.kind !== 244 /* FunctionDeclaration */) { + if (declaration.kind !== 243 /* VariableDeclaration */ && declaration.kind !== 245 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { // Reached source file or module block - if (parent.kind === 290 /* SourceFile */ || parent.kind === 250 /* ModuleBlock */) { + if (parent.kind === 291 /* SourceFile */ || parent.kind === 251 /* ModuleBlock */) { return false; } } @@ -121840,10 +122435,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 273 /* JsxAttribute */: - case 268 /* JsxOpeningElement */: - case 269 /* JsxClosingElement */: - case 267 /* JsxSelfClosingElement */: + case 274 /* JsxAttribute */: + case 269 /* JsxOpeningElement */: + case 270 /* JsxClosingElement */: + case 268 /* JsxSelfClosingElement */: // May parse an identifier like `module-layout`; that will be scanned as a keyword at first, but we should parse the whole thing to get an identifier. return ts.isKeyword(node.kind) || node.kind === 75 /* Identifier */; } @@ -122035,7 +122630,7 @@ var ts; (function (formatting) { function getAllRules() { var allTokens = []; - for (var token = 0 /* FirstToken */; token <= 152 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 153 /* LastToken */; token++) { if (token !== 1 /* EndOfFileToken */) { allTokens.push(token); } @@ -122050,9 +122645,9 @@ var ts; var anyToken = { tokens: allTokens, isSpecific: false }; var anyTokenIncludingMultilineComments = tokenRangeFrom(__spreadArrays(allTokens, [3 /* MultiLineCommentTrivia */])); var anyTokenIncludingEOF = tokenRangeFrom(__spreadArrays(allTokens, [1 /* EndOfFileToken */])); - var keywords = tokenRangeFromRange(77 /* FirstKeyword */, 152 /* LastKeyword */); + var keywords = tokenRangeFromRange(77 /* FirstKeyword */, 153 /* LastKeyword */); var binaryOperators = tokenRangeFromRange(29 /* FirstBinaryOperator */, 74 /* LastBinaryOperator */); - var binaryKeywordOperators = [97 /* InKeyword */, 98 /* InstanceOfKeyword */, 152 /* OfKeyword */, 123 /* AsKeyword */, 133 /* IsKeyword */]; + var binaryKeywordOperators = [97 /* InKeyword */, 98 /* InstanceOfKeyword */, 153 /* OfKeyword */, 123 /* AsKeyword */, 134 /* IsKeyword */]; var unaryPrefixOperators = [45 /* PlusPlusToken */, 46 /* MinusMinusToken */, 54 /* TildeToken */, 53 /* ExclamationToken */]; var unaryPrefixExpressions = [ 8 /* NumericLiteral */, 9 /* BigIntLiteral */, 75 /* Identifier */, 20 /* OpenParenToken */, @@ -122126,7 +122721,7 @@ var ts; // Though, we do extra check on the context to make sure we are dealing with get/set node. Example: // get x() {} // set x(val) {} - rule("SpaceAfterGetSetInMember", [131 /* GetKeyword */, 142 /* SetKeyword */], 75 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), + rule("SpaceAfterGetSetInMember", [132 /* GetKeyword */, 143 /* SetKeyword */], 75 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), rule("NoSpaceBetweenYieldKeywordAndStar", 121 /* YieldKeyword */, 41 /* AsteriskToken */, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 16 /* DeleteSpace */), rule("SpaceBetweenYieldOrYieldStarAndOperand", [121 /* YieldKeyword */, 41 /* AsteriskToken */], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 4 /* InsertSpace */), rule("NoSpaceBetweenReturnAndSemicolon", 101 /* ReturnKeyword */, 26 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), @@ -122150,34 +122745,34 @@ var ts; rule("NoSpaceAfterEqualInJsxAttribute", 62 /* EqualsToken */, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // TypeScript-specific rules // Use of module as a function call. e.g.: import m2 = module("m2"); - rule("NoSpaceAfterModuleImport", [135 /* ModuleKeyword */, 139 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("NoSpaceAfterModuleImport", [136 /* ModuleKeyword */, 140 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // Add a space around certain TypeScript keywords rule("SpaceAfterCertainTypeScriptKeywords", [ 122 /* AbstractKeyword */, 80 /* ClassKeyword */, - 130 /* DeclareKeyword */, + 131 /* DeclareKeyword */, 84 /* DefaultKeyword */, 88 /* EnumKeyword */, 89 /* ExportKeyword */, 90 /* ExtendsKeyword */, - 131 /* GetKeyword */, + 132 /* GetKeyword */, 113 /* ImplementsKeyword */, 96 /* ImportKeyword */, 114 /* InterfaceKeyword */, - 135 /* ModuleKeyword */, - 136 /* NamespaceKeyword */, + 136 /* ModuleKeyword */, + 137 /* NamespaceKeyword */, 117 /* PrivateKeyword */, 119 /* PublicKeyword */, 118 /* ProtectedKeyword */, - 138 /* ReadonlyKeyword */, - 142 /* SetKeyword */, + 139 /* ReadonlyKeyword */, + 143 /* SetKeyword */, 120 /* StaticKeyword */, - 145 /* TypeKeyword */, - 149 /* FromKeyword */, - 134 /* KeyOfKeyword */, - 132 /* InferKeyword */, + 146 /* TypeKeyword */, + 150 /* FromKeyword */, + 135 /* KeyOfKeyword */, + 133 /* InferKeyword */, ], anyToken, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [90 /* ExtendsKeyword */, 113 /* ImplementsKeyword */, 149 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), + rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [90 /* ExtendsKeyword */, 113 /* ImplementsKeyword */, 150 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { rule("SpaceAfterModuleName", 10 /* StringLiteral */, 18 /* OpenBraceToken */, [isModuleDeclContext], 4 /* InsertSpace */), // Lambda expressions @@ -122208,8 +122803,8 @@ var ts; 119 /* PublicKeyword */, 117 /* PrivateKeyword */, 118 /* ProtectedKeyword */, - 131 /* GetKeyword */, - 142 /* SetKeyword */, + 132 /* GetKeyword */, + 143 /* SetKeyword */, 22 /* OpenBracketToken */, 41 /* AsteriskToken */, ], [isEndOfDecoratorContextOnSameLine], 4 /* InsertSpace */), @@ -122220,8 +122815,8 @@ var ts; // These rules are applied after high priority var userConfigurableRules = [ // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses - rule("SpaceAfterConstructor", 129 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("NoSpaceAfterConstructor", 129 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("SpaceAfterConstructor", 130 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), + rule("NoSpaceAfterConstructor", 130 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), rule("SpaceAfterComma", 27 /* CommaToken */, anyToken, [isOptionEnabled("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNextTokenNotCloseBracket, isNextTokenNotCloseParen], 4 /* InsertSpace */), rule("NoSpaceAfterComma", 27 /* CommaToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext], 16 /* DeleteSpace */), // Insert space after function keyword for anonymous functions @@ -122249,6 +122844,9 @@ var ts; rule("NoSpaceBetweenEmptyBraceBrackets", 18 /* OpenBraceToken */, 19 /* CloseBraceToken */, [isNonJsxSameLineTokenContext, isObjectContext], 16 /* DeleteSpace */), rule("NoSpaceAfterOpenBrace", 18 /* OpenBraceToken */, anyToken, [isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), rule("NoSpaceBeforeCloseBrace", anyToken, 19 /* CloseBraceToken */, [isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + // Insert a space after opening and before closing empty brace brackets + rule("SpaceBetweenEmptyBraceBrackets", 18 /* OpenBraceToken */, 19 /* CloseBraceToken */, [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces")], 4 /* InsertSpace */), + rule("NoSpaceBetweenEmptyBraceBrackets", 18 /* OpenBraceToken */, 19 /* CloseBraceToken */, [isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // Insert space after opening and before closing template string braces rule("SpaceAfterTemplateHeadAndMiddle", [15 /* TemplateHead */, 16 /* TemplateMiddle */], anyToken, [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), rule("SpaceBeforeTemplateMiddleAndTail", anyToken, [16 /* TemplateMiddle */, 17 /* TemplateTail */], [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), @@ -122360,51 +122958,51 @@ var ts; return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; }; } function isForContext(context) { - return context.contextNode.kind === 230 /* ForStatement */; + return context.contextNode.kind === 231 /* ForStatement */; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return context.contextNode.operatorToken.kind !== 27 /* CommaToken */; - case 210 /* ConditionalExpression */: - case 180 /* ConditionalType */: - case 217 /* AsExpression */: - case 263 /* ExportSpecifier */: - case 258 /* ImportSpecifier */: - case 168 /* TypePredicate */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: + case 211 /* ConditionalExpression */: + case 181 /* ConditionalType */: + case 218 /* AsExpression */: + case 264 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 169 /* TypePredicate */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 191 /* BindingElement */: + case 192 /* BindingElement */: // equals in type X = ... // falls through - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: // equal in import a = module('a'); // falls through - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // equal in let a = 0 // falls through - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: // equal in p = 0 // falls through - case 156 /* Parameter */: - case 284 /* EnumMember */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 157 /* Parameter */: + case 285 /* EnumMember */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: // "in" keyword in [P in keyof T]: T[P] // falls through - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return context.currentTokenSpan.kind === 97 /* InKeyword */ || context.nextTokenSpan.kind === 97 /* InKeyword */ || context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 232 /* ForOfStatement */: - return context.currentTokenSpan.kind === 152 /* OfKeyword */ || context.nextTokenSpan.kind === 152 /* OfKeyword */; + case 233 /* ForOfStatement */: + return context.currentTokenSpan.kind === 153 /* OfKeyword */ || context.nextTokenSpan.kind === 153 /* OfKeyword */; } return false; } @@ -122416,22 +123014,22 @@ var ts; } function isTypeAnnotationContext(context) { var contextKind = context.contextNode.kind; - return contextKind === 159 /* PropertyDeclaration */ || - contextKind === 158 /* PropertySignature */ || - contextKind === 156 /* Parameter */ || - contextKind === 242 /* VariableDeclaration */ || + return contextKind === 160 /* PropertyDeclaration */ || + contextKind === 159 /* PropertySignature */ || + contextKind === 157 /* Parameter */ || + contextKind === 243 /* VariableDeclaration */ || ts.isFunctionLikeKind(contextKind); } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 210 /* ConditionalExpression */ || - context.contextNode.kind === 180 /* ConditionalType */; + return context.contextNode.kind === 211 /* ConditionalExpression */ || + context.contextNode.kind === 181 /* ConditionalType */; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 189 /* ObjectBindingPattern */ || - context.contextNode.kind === 186 /* MappedType */ || + return context.contextNode.kind === 190 /* ObjectBindingPattern */ || + context.contextNode.kind === 187 /* MappedType */ || isSingleLineBlockContext(context); } // This check is done before an open brace in a control construct, a function, or a typescript block declaration @@ -122457,34 +123055,34 @@ var ts; return true; } switch (node.kind) { - case 223 /* Block */: - case 251 /* CaseBlock */: - case 193 /* ObjectLiteralExpression */: - case 250 /* ModuleBlock */: + case 224 /* Block */: + case 252 /* CaseBlock */: + case 194 /* ObjectLiteralExpression */: + case 251 /* ModuleBlock */: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: // falls through - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // case SyntaxKind.MethodSignature: // falls through - case 165 /* CallSignature */: - case 201 /* FunctionExpression */: - case 162 /* Constructor */: - case 202 /* ArrowFunction */: + case 166 /* CallSignature */: + case 202 /* FunctionExpression */: + case 163 /* Constructor */: + case 203 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: // falls through - case 246 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one + case 247 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one return true; } return false; @@ -122493,40 +123091,40 @@ var ts; return !isFunctionDeclContext(context); } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 244 /* FunctionDeclaration */ || context.contextNode.kind === 201 /* FunctionExpression */; + return context.contextNode.kind === 245 /* FunctionDeclaration */ || context.contextNode.kind === 202 /* FunctionExpression */; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 173 /* TypeLiteral */: - case 249 /* ModuleDeclaration */: - case 260 /* ExportDeclaration */: - case 261 /* NamedExports */: - case 254 /* ImportDeclaration */: - case 257 /* NamedImports */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 174 /* TypeLiteral */: + case 250 /* ModuleDeclaration */: + case 261 /* ExportDeclaration */: + case 262 /* NamedExports */: + case 255 /* ImportDeclaration */: + case 258 /* NamedImports */: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 245 /* ClassDeclaration */: - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: - case 280 /* CatchClause */: - case 250 /* ModuleBlock */: - case 237 /* SwitchStatement */: + case 246 /* ClassDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 281 /* CatchClause */: + case 251 /* ModuleBlock */: + case 238 /* SwitchStatement */: return true; - case 223 /* Block */: { + case 224 /* Block */: { var blockParent = context.currentTokenParent.parent; // In a codefix scenario, we can't rely on parents being set. So just always return true. - if (!blockParent || blockParent.kind !== 202 /* ArrowFunction */ && blockParent.kind !== 201 /* FunctionExpression */) { + if (!blockParent || blockParent.kind !== 203 /* ArrowFunction */ && blockParent.kind !== 202 /* FunctionExpression */) { return true; } } @@ -122535,32 +123133,32 @@ var ts; } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 227 /* IfStatement */: - case 237 /* SwitchStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 229 /* WhileStatement */: - case 240 /* TryStatement */: - case 228 /* DoStatement */: - case 236 /* WithStatement */: + case 228 /* IfStatement */: + case 238 /* SwitchStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 230 /* WhileStatement */: + case 241 /* TryStatement */: + case 229 /* DoStatement */: + case 237 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: // falls through - case 280 /* CatchClause */: + case 281 /* CatchClause */: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 193 /* ObjectLiteralExpression */; + return context.contextNode.kind === 194 /* ObjectLiteralExpression */; } function isFunctionCallContext(context) { - return context.contextNode.kind === 196 /* CallExpression */; + return context.contextNode.kind === 197 /* CallExpression */; } function isNewContext(context) { - return context.contextNode.kind === 197 /* NewExpression */; + return context.contextNode.kind === 198 /* NewExpression */; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -122575,28 +123173,28 @@ var ts; return context.nextTokenSpan.kind !== 21 /* CloseParenToken */; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 202 /* ArrowFunction */; + return context.contextNode.kind === 203 /* ArrowFunction */; } function isImportTypeContext(context) { - return context.contextNode.kind === 188 /* ImportType */; + return context.contextNode.kind === 189 /* ImportType */; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 11 /* JsxText */; } function isNonJsxElementOrFragmentContext(context) { - return context.contextNode.kind !== 266 /* JsxElement */ && context.contextNode.kind !== 270 /* JsxFragment */; + return context.contextNode.kind !== 267 /* JsxElement */ && context.contextNode.kind !== 271 /* JsxFragment */; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 276 /* JsxExpression */ || context.contextNode.kind === 275 /* JsxSpreadAttribute */; + return context.contextNode.kind === 277 /* JsxExpression */ || context.contextNode.kind === 276 /* JsxSpreadAttribute */; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 273 /* JsxAttribute */; + return context.nextTokenParent.kind === 274 /* JsxAttribute */; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 273 /* JsxAttribute */; + return context.contextNode.kind === 274 /* JsxAttribute */; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 267 /* JsxSelfClosingElement */; + return context.contextNode.kind === 268 /* JsxSelfClosingElement */; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -122611,45 +123209,45 @@ var ts; while (ts.isExpressionNode(node)) { node = node.parent; } - return node.kind === 157 /* Decorator */; + return node.kind === 158 /* Decorator */; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 243 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 244 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; } function isModuleDeclContext(context) { - return context.contextNode.kind === 249 /* ModuleDeclaration */; + return context.contextNode.kind === 250 /* ModuleDeclaration */; } function isObjectTypeContext(context) { - return context.contextNode.kind === 173 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 174 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 166 /* ConstructSignature */; + return context.contextNode.kind === 167 /* ConstructSignature */; } function isTypeArgumentOrParameterOrAssertion(token, parent) { if (token.kind !== 29 /* LessThanToken */ && token.kind !== 31 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 169 /* TypeReference */: - case 199 /* TypeAssertionExpression */: - case 247 /* TypeAliasDeclaration */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 216 /* ExpressionWithTypeArguments */: + case 170 /* TypeReference */: + case 200 /* TypeAssertionExpression */: + case 248 /* TypeAliasDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 217 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -122660,28 +123258,28 @@ var ts; isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 199 /* TypeAssertionExpression */; + return context.contextNode.kind === 200 /* TypeAssertionExpression */; } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 110 /* VoidKeyword */ && context.currentTokenParent.kind === 205 /* VoidExpression */; + return context.currentTokenSpan.kind === 110 /* VoidKeyword */ && context.currentTokenParent.kind === 206 /* VoidExpression */; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 212 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 213 /* YieldExpression */ && context.contextNode.expression !== undefined; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 218 /* NonNullExpression */; + return context.contextNode.kind === 219 /* NonNullExpression */; } function isNotStatementConditionContext(context) { return !isStatementConditionContext(context); } function isStatementConditionContext(context) { switch (context.contextNode.kind) { - case 227 /* IfStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 228 /* IfStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return true; default: return false; @@ -122706,12 +123304,12 @@ var ts; return nextTokenKind === 19 /* CloseBraceToken */ || nextTokenKind === 1 /* EndOfFileToken */; } - if (nextTokenKind === 222 /* SemicolonClassElement */ || + if (nextTokenKind === 223 /* SemicolonClassElement */ || nextTokenKind === 26 /* SemicolonToken */) { return false; } - if (context.contextNode.kind === 246 /* InterfaceDeclaration */ || - context.contextNode.kind === 247 /* TypeAliasDeclaration */) { + if (context.contextNode.kind === 247 /* InterfaceDeclaration */ || + context.contextNode.kind === 248 /* TypeAliasDeclaration */) { // Can’t remove semicolon after `foo`; it would parse as a method declaration: // // interface I { @@ -122725,9 +123323,9 @@ var ts; if (ts.isPropertyDeclaration(context.currentTokenParent)) { return !context.currentTokenParent.initializer; } - return context.currentTokenParent.kind !== 230 /* ForStatement */ - && context.currentTokenParent.kind !== 224 /* EmptyStatement */ - && context.currentTokenParent.kind !== 222 /* SemicolonClassElement */ + return context.currentTokenParent.kind !== 231 /* ForStatement */ + && context.currentTokenParent.kind !== 225 /* EmptyStatement */ + && context.currentTokenParent.kind !== 223 /* SemicolonClassElement */ && nextTokenKind !== 22 /* OpenBracketToken */ && nextTokenKind !== 20 /* OpenParenToken */ && nextTokenKind !== 39 /* PlusToken */ @@ -122735,7 +123333,7 @@ var ts; && nextTokenKind !== 43 /* SlashToken */ && nextTokenKind !== 13 /* RegularExpressionLiteral */ && nextTokenKind !== 27 /* CommaToken */ - && nextTokenKind !== 211 /* TemplateExpression */ + && nextTokenKind !== 212 /* TemplateExpression */ && nextTokenKind !== 15 /* TemplateHead */ && nextTokenKind !== 14 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 24 /* DotToken */; @@ -122826,12 +123424,12 @@ var ts; return map; } function getRuleBucketIndex(row, column) { - ts.Debug.assert(row <= 152 /* LastKeyword */ && column <= 152 /* LastKeyword */, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 153 /* LastKeyword */ && column <= 153 /* LastKeyword */, "Must compute formatting context from tokens"); return (row * mapRowLength) + column; } var maskBitSize = 5; var mask = 31; // MaskBitSize bits - var mapRowLength = 152 /* LastToken */ + 1; + var mapRowLength = 153 /* LastToken */ + 1; var RulesPosition; (function (RulesPosition) { RulesPosition[RulesPosition["StopRulesSpecific"] = 0] = "StopRulesSpecific"; @@ -123019,17 +123617,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: var body = parent.body; - return !!body && body.kind === 250 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); - case 290 /* SourceFile */: - case 223 /* Block */: - case 250 /* ModuleBlock */: + return !!body && body.kind === 251 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); + case 291 /* SourceFile */: + case 224 /* Block */: + case 251 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -123186,7 +123784,9 @@ var ts; var leadingTrivia = formattingScanner.getCurrentLeadingTrivia(); if (leadingTrivia) { indentTriviaItems(leadingTrivia, initialIndentation, /*indentNextTokenOrTrivia*/ false, function (item) { return processRange(item, sourceFile.getLineAndCharacterOfPosition(item.pos), enclosingNode, enclosingNode, /*dynamicIndentation*/ undefined); }); - trimTrailingWhitespacesForRemainingRange(); + if (options.trimTrailingWhitespace !== false) { + trimTrailingWhitespacesForRemainingRange(); + } } } return edits; @@ -123254,19 +123854,19 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 245 /* ClassDeclaration */: return 80 /* ClassKeyword */; - case 246 /* InterfaceDeclaration */: return 114 /* InterfaceKeyword */; - case 244 /* FunctionDeclaration */: return 94 /* FunctionKeyword */; - case 248 /* EnumDeclaration */: return 248 /* EnumDeclaration */; - case 163 /* GetAccessor */: return 131 /* GetKeyword */; - case 164 /* SetAccessor */: return 142 /* SetKeyword */; - case 161 /* MethodDeclaration */: + case 246 /* ClassDeclaration */: return 80 /* ClassKeyword */; + case 247 /* InterfaceDeclaration */: return 114 /* InterfaceKeyword */; + case 245 /* FunctionDeclaration */: return 94 /* FunctionKeyword */; + case 249 /* EnumDeclaration */: return 249 /* EnumDeclaration */; + case 164 /* GetAccessor */: return 132 /* GetKeyword */; + case 165 /* SetAccessor */: return 143 /* SetKeyword */; + case 162 /* MethodDeclaration */: if (node.asteriskToken) { return 41 /* AsteriskToken */; } // falls through - case 159 /* PropertyDeclaration */: - case 156 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 157 /* Parameter */: var name = ts.getNameOfDeclaration(node); if (name) { return name.kind; @@ -123323,15 +123923,15 @@ var ts; case 43 /* SlashToken */: case 31 /* GreaterThanToken */: switch (container.kind) { - case 268 /* JsxOpeningElement */: - case 269 /* JsxClosingElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 270 /* JsxClosingElement */: + case 268 /* JsxSelfClosingElement */: return false; } break; case 22 /* OpenBracketToken */: case 23 /* CloseBracketToken */: - if (container.kind !== 186 /* MappedType */) { + if (container.kind !== 187 /* MappedType */) { return false; } break; @@ -123434,7 +124034,7 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 157 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 158 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); if (child.kind === 11 /* JsxText */) { @@ -123454,7 +124054,7 @@ var ts; } } childContextNode = node; - if (isFirstListItem && parent.kind === 192 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent.kind === 193 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -123626,7 +124226,7 @@ var ts; function processPair(currentItem, currentStartLine, currentParent, previousItem, previousStartLine, previousParent, contextNode, dynamicIndentation) { formattingContext.updateContext(previousItem, previousParent, currentItem, currentParent, contextNode); var rules = getRules(formattingContext); - var trimTrailingWhitespaces = false; + var trimTrailingWhitespaces = formattingContext.options.trimTrailingWhitespace !== false; var lineAction = 0 /* None */; if (rules) { // Apply rules in reverse order so that higher priority rules (which are first in the array) @@ -123653,11 +124253,11 @@ var ts; ts.Debug.assert(lineAction === 0 /* None */); } // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line - trimTrailingWhitespaces = !(rule.action & 16 /* DeleteSpace */) && rule.flags !== 1 /* CanDeleteNewLines */; + trimTrailingWhitespaces = trimTrailingWhitespaces && !(rule.action & 16 /* DeleteSpace */) && rule.flags !== 1 /* CanDeleteNewLines */; }); } else { - trimTrailingWhitespaces = currentItem.kind !== 1 /* EndOfFileToken */; + trimTrailingWhitespaces = trimTrailingWhitespaces && currentItem.kind !== 1 /* EndOfFileToken */; } if (currentStartLine !== previousStartLine && trimTrailingWhitespaces) { // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line @@ -123897,12 +124497,12 @@ var ts; formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { - case 162 /* Constructor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 202 /* ArrowFunction */: + case 163 /* Constructor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 203 /* ArrowFunction */: if (node.typeParameters === list) { return 29 /* LessThanToken */; } @@ -123910,8 +124510,8 @@ var ts; return 20 /* OpenParenToken */; } break; - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } @@ -123919,12 +124519,12 @@ var ts; return 20 /* OpenParenToken */; } break; - case 169 /* TypeReference */: + case 170 /* TypeReference */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } break; - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return 18 /* OpenBraceToken */; } return 0 /* Unknown */; @@ -124042,7 +124642,7 @@ var ts; if (options.indentStyle === ts.IndentStyle.Block) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 209 /* BinaryExpression */) { + if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 210 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -124196,7 +124796,7 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 290 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 291 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -124244,7 +124844,7 @@ var ts; } SmartIndenter.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 227 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 228 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 87 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -124282,40 +124882,40 @@ var ts; } function getListByRange(start, end, node, sourceFile) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return getList(node.typeArguments); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return getList(node.properties); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return getList(node.elements); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return getList(node.members); - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 162 /* Constructor */: - case 171 /* ConstructorType */: - case 166 /* ConstructSignature */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 163 /* Constructor */: + case 172 /* ConstructorType */: + case 167 /* ConstructSignature */: return getList(node.typeParameters) || getList(node.parameters); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 321 /* JSDocTemplateTag */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 322 /* JSDocTemplateTag */: return getList(node.typeParameters); - case 197 /* NewExpression */: - case 196 /* CallExpression */: + case 198 /* NewExpression */: + case 197 /* CallExpression */: return getList(node.typeArguments) || getList(node.arguments); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return getList(node.declarations); - case 257 /* NamedImports */: - case 261 /* NamedExports */: + case 258 /* NamedImports */: + case 262 /* NamedExports */: return getList(node.elements); - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: return getList(node.elements); } function getList(list) { @@ -124338,7 +124938,7 @@ var ts; return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options); } function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) { - if (node.parent && node.parent.kind === 243 /* VariableDeclarationList */) { + if (node.parent && node.parent.kind === 244 /* VariableDeclarationList */) { // VariableDeclarationList has no wrapping tokens return -1 /* Unknown */; } @@ -124411,87 +125011,87 @@ var ts; function nodeWillIndentChild(settings, parent, child, sourceFile, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 226 /* ExpressionStatement */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 192 /* ArrayLiteralExpression */: - case 223 /* Block */: - case 250 /* ModuleBlock */: - case 193 /* ObjectLiteralExpression */: - case 173 /* TypeLiteral */: - case 186 /* MappedType */: - case 175 /* TupleType */: - case 251 /* CaseBlock */: - case 278 /* DefaultClause */: - case 277 /* CaseClause */: - case 200 /* ParenthesizedExpression */: - case 194 /* PropertyAccessExpression */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 225 /* VariableStatement */: - case 259 /* ExportAssignment */: - case 235 /* ReturnStatement */: - case 210 /* ConditionalExpression */: - case 190 /* ArrayBindingPattern */: - case 189 /* ObjectBindingPattern */: - case 268 /* JsxOpeningElement */: - case 271 /* JsxOpeningFragment */: - case 267 /* JsxSelfClosingElement */: - case 276 /* JsxExpression */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 156 /* Parameter */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 182 /* ParenthesizedType */: - case 198 /* TaggedTemplateExpression */: - case 206 /* AwaitExpression */: - case 261 /* NamedExports */: - case 257 /* NamedImports */: - case 263 /* ExportSpecifier */: - case 258 /* ImportSpecifier */: - case 159 /* PropertyDeclaration */: + case 227 /* ExpressionStatement */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 193 /* ArrayLiteralExpression */: + case 224 /* Block */: + case 251 /* ModuleBlock */: + case 194 /* ObjectLiteralExpression */: + case 174 /* TypeLiteral */: + case 187 /* MappedType */: + case 176 /* TupleType */: + case 252 /* CaseBlock */: + case 279 /* DefaultClause */: + case 278 /* CaseClause */: + case 201 /* ParenthesizedExpression */: + case 195 /* PropertyAccessExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 226 /* VariableStatement */: + case 260 /* ExportAssignment */: + case 236 /* ReturnStatement */: + case 211 /* ConditionalExpression */: + case 191 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 269 /* JsxOpeningElement */: + case 272 /* JsxOpeningFragment */: + case 268 /* JsxSelfClosingElement */: + case 277 /* JsxExpression */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 157 /* Parameter */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 183 /* ParenthesizedType */: + case 199 /* TaggedTemplateExpression */: + case 207 /* AwaitExpression */: + case 262 /* NamedExports */: + case 258 /* NamedImports */: + case 264 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 160 /* PropertyDeclaration */: return true; - case 242 /* VariableDeclaration */: - case 281 /* PropertyAssignment */: - case 209 /* BinaryExpression */: - if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 193 /* ObjectLiteralExpression */) { // TODO: GH#18217 + case 243 /* VariableDeclaration */: + case 282 /* PropertyAssignment */: + case 210 /* BinaryExpression */: + if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 194 /* ObjectLiteralExpression */) { // TODO: GH#18217 return rangeIsOnOneLine(sourceFile, child); } - if (parent.kind !== 209 /* BinaryExpression */) { + if (parent.kind !== 210 /* BinaryExpression */) { return true; } break; - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 230 /* ForStatement */: - case 227 /* IfStatement */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 202 /* ArrowFunction */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - return childKind !== 223 /* Block */; - case 260 /* ExportDeclaration */: - return childKind !== 261 /* NamedExports */; - case 254 /* ImportDeclaration */: - return childKind !== 255 /* ImportClause */ || - (!!child.namedBindings && child.namedBindings.kind !== 257 /* NamedImports */); - case 266 /* JsxElement */: - return childKind !== 269 /* JsxClosingElement */; - case 270 /* JsxFragment */: - return childKind !== 272 /* JsxClosingFragment */; - case 179 /* IntersectionType */: - case 178 /* UnionType */: - if (childKind === 173 /* TypeLiteral */) { + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 231 /* ForStatement */: + case 228 /* IfStatement */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 203 /* ArrowFunction */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + return childKind !== 224 /* Block */; + case 261 /* ExportDeclaration */: + return childKind !== 262 /* NamedExports */; + case 255 /* ImportDeclaration */: + return childKind !== 256 /* ImportClause */ || + (!!child.namedBindings && child.namedBindings.kind !== 258 /* NamedImports */); + case 267 /* JsxElement */: + return childKind !== 270 /* JsxClosingElement */; + case 271 /* JsxFragment */: + return childKind !== 273 /* JsxClosingFragment */; + case 180 /* IntersectionType */: + case 179 /* UnionType */: + if (childKind === 174 /* TypeLiteral */) { return false; } // falls through @@ -124502,11 +125102,11 @@ var ts; SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent) { switch (kind) { - case 235 /* ReturnStatement */: - case 239 /* ThrowStatement */: - case 233 /* ContinueStatement */: - case 234 /* BreakStatement */: - return parent.kind !== 223 /* Block */; + case 236 /* ReturnStatement */: + case 240 /* ThrowStatement */: + case 234 /* ContinueStatement */: + case 235 /* BreakStatement */: + return parent.kind !== 224 /* Block */; default: return false; } @@ -124648,7 +125248,7 @@ var ts; * Checks if 'candidate' argument is a legal separator in the list that contains 'node' as an element */ function isSeparator(node, candidate) { - return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 193 /* ObjectLiteralExpression */)); + return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 194 /* ObjectLiteralExpression */)); } function spaces(count) { var s = ""; @@ -124825,7 +125425,7 @@ var ts; } } else { - endNode = node.kind !== 242 /* VariableDeclaration */ && node.questionToken ? node.questionToken : node.name; + endNode = node.kind !== 243 /* VariableDeclaration */ && node.questionToken ? node.questionToken : node.name; } this.insertNodeAt(sourceFile, endNode.end, type, { prefix: ": " }); return true; @@ -124979,18 +125579,18 @@ var ts; }; ChangeTracker.prototype.getInsertNodeAfterOptionsWorker = function (node) { switch (node.kind) { - case 245 /* ClassDeclaration */: - case 249 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 250 /* ModuleDeclaration */: return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: case 10 /* StringLiteral */: case 75 /* Identifier */: return { prefix: ", " }; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return { suffix: "," + this.newLineCharacter }; case 89 /* ExportKeyword */: return { prefix: " " }; - case 156 /* Parameter */: + case 157 /* Parameter */: return {}; default: ts.Debug.assert(ts.isStatement(node) || ts.isClassOrTypeElement(node)); // Else we haven't handled this kind of node yet -- add it @@ -124999,7 +125599,7 @@ var ts; }; ChangeTracker.prototype.insertName = function (sourceFile, node, name) { ts.Debug.assert(!node.name); - if (node.kind === 202 /* ArrowFunction */) { + if (node.kind === 203 /* ArrowFunction */) { var arrow = ts.findChildOfKind(node, 38 /* EqualsGreaterThanToken */, sourceFile); var lparen = ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile); if (lparen) { @@ -125013,14 +125613,14 @@ var ts; // Replacing full range of arrow to get rid of the leading space -- replace ` =>` with `)` this.replaceRange(sourceFile, arrow, ts.createToken(21 /* CloseParenToken */)); } - if (node.body.kind !== 223 /* Block */) { + if (node.body.kind !== 224 /* Block */) { // `() => 0` => `function f() { return 0; }` this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [ts.createToken(18 /* OpenBraceToken */), ts.createToken(101 /* ReturnKeyword */)], { joiner: " ", suffix: " " }); this.insertNodesAt(sourceFile, node.body.end, [ts.createToken(26 /* SemicolonToken */), ts.createToken(19 /* CloseBraceToken */)], { joiner: " " }); } } else { - var pos = ts.findChildOfKind(node, node.kind === 201 /* FunctionExpression */ ? 94 /* FunctionKeyword */ : 80 /* ClassKeyword */, sourceFile).end; + var pos = ts.findChildOfKind(node, node.kind === 202 /* FunctionExpression */ ? 94 /* FunctionKeyword */ : 80 /* ClassKeyword */, sourceFile).end; this.insertNodeAt(sourceFile, pos, ts.createIdentifier(name), { prefix: " " }); } }; @@ -125278,7 +125878,9 @@ var ts; : format(change.node); // strip initial indentation (spaces or tabs) if text will be inserted in the middle of the line var noIndent = (options.preserveLeadingWhitespace || options.indentation !== undefined || ts.getLineStartPositionForPosition(pos, sourceFile) === pos) ? text : text.replace(/^\s+/, ""); - return (options.prefix || "") + noIndent + (options.suffix || ""); + return (options.prefix || "") + noIndent + + ((!options.suffix || ts.endsWith(noIndent, options.suffix)) + ? "" : options.suffix); } function getFormatCodeSettingsForWriting(_a, sourceFile) { var options = _a.options; @@ -125583,14 +126185,14 @@ var ts; } textChanges_3.isValidLocationToAddComment = isValidLocationToAddComment; function needSemicolonBetween(a, b) { - return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 154 /* ComputedPropertyName */ + return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 155 /* ComputedPropertyName */ || ts.isStatementButNotDeclaration(a) && ts.isStatementButNotDeclaration(b); // TODO: only if b would start with a `(` or `[` } var deleteDeclaration; (function (deleteDeclaration_1) { function deleteDeclaration(changes, deletedNodesInLists, sourceFile, node) { switch (node.kind) { - case 156 /* Parameter */: { + case 157 /* Parameter */: { var oldFunction = node.parent; if (ts.isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && @@ -125605,15 +126207,15 @@ var ts; } break; } - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: var isFirstImport = sourceFile.imports.length && node === ts.first(sourceFile.imports).parent || node === ts.find(sourceFile.statements, ts.isImportDeclaration); deleteNode(changes, sourceFile, node, // For first import, leave header comment in place isFirstImport ? { leadingTriviaOption: LeadingTriviaOption.Exclude } : undefined); break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: var pattern = node.parent; - var preserveComma = pattern.kind === 190 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); + var preserveComma = pattern.kind === 191 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); if (preserveComma) { deleteNode(changes, sourceFile, node); } @@ -125621,13 +126223,13 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node); break; - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); break; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: var namedImports = node.parent; if (namedImports.elements.length === 1) { deleteImportBinding(changes, sourceFile, namedImports); @@ -125636,7 +126238,7 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: deleteImportBinding(changes, sourceFile, node); break; default: @@ -125683,13 +126285,13 @@ var ts; // Delete the entire import declaration // |import * as ns from './file'| // |import { a } from './file'| - var importDecl = ts.getAncestor(node, 254 /* ImportDeclaration */); + var importDecl = ts.getAncestor(node, 255 /* ImportDeclaration */); deleteNode(changes, sourceFile, importDecl); } } function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) { var parent = node.parent; - if (parent.kind === 280 /* CatchClause */) { + if (parent.kind === 281 /* CatchClause */) { // TODO: There's currently no unused diagnostic for this, could be a suggestion changes.deleteNodeRange(sourceFile, ts.findChildOfKind(parent, 20 /* OpenParenToken */, sourceFile), ts.findChildOfKind(parent, 21 /* CloseParenToken */, sourceFile)); return; @@ -125700,14 +126302,14 @@ var ts; } var gp = parent.parent; switch (gp.kind) { - case 232 /* ForOfStatement */: - case 231 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 232 /* ForInStatement */: changes.replaceNode(sourceFile, node, ts.createObjectLiteral()); break; - case 230 /* ForStatement */: + case 231 /* ForStatement */: deleteNode(changes, sourceFile, parent); break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: deleteNode(changes, sourceFile, gp); break; default: @@ -125886,8 +126488,8 @@ var ts; var token = ts.getTokenAtPosition(sourceFile, pos); var assertion = ts.Debug.checkDefined(ts.findAncestor(token, function (n) { return ts.isAsExpression(n) || ts.isTypeAssertion(n); }), "Expected to find an assertion expression"); var replacement = ts.isAsExpression(assertion) - ? ts.createAsExpression(assertion.expression, ts.createKeywordTypeNode(148 /* UnknownKeyword */)) - : ts.createTypeAssertion(ts.createKeywordTypeNode(148 /* UnknownKeyword */), assertion.expression); + ? ts.createAsExpression(assertion.expression, ts.createKeywordTypeNode(149 /* UnknownKeyword */)) + : ts.createTypeAssertion(ts.createKeywordTypeNode(149 /* UnknownKeyword */), assertion.expression); changeTracker.replaceNode(sourceFile, assertion.expression, replacement); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -126118,7 +126720,7 @@ var ts; } var declaration = ts.tryCast(symbol.valueDeclaration, ts.isVariableDeclaration); var variableName = declaration && ts.tryCast(declaration.name, ts.isIdentifier); - var variableStatement = ts.getAncestor(declaration, 225 /* VariableStatement */); + var variableStatement = ts.getAncestor(declaration, 226 /* VariableStatement */); if (!declaration || !variableStatement || declaration.type || !declaration.initializer || @@ -126196,10 +126798,10 @@ var ts; function isInsideAwaitableBody(node) { return node.kind & 32768 /* AwaitContext */ || !!ts.findAncestor(node, function (ancestor) { return ancestor.parent && ts.isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || - ts.isBlock(ancestor) && (ancestor.parent.kind === 244 /* FunctionDeclaration */ || - ancestor.parent.kind === 201 /* FunctionExpression */ || - ancestor.parent.kind === 202 /* ArrowFunction */ || - ancestor.parent.kind === 161 /* MethodDeclaration */); + ts.isBlock(ancestor) && (ancestor.parent.kind === 245 /* FunctionDeclaration */ || + ancestor.parent.kind === 202 /* FunctionExpression */ || + ancestor.parent.kind === 203 /* ArrowFunction */ || + ancestor.parent.kind === 162 /* MethodDeclaration */); }); } function makeChange(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) { @@ -126318,10 +126920,10 @@ var ts; function isPossiblyPartOfDestructuring(node) { switch (node.kind) { case 75 /* Identifier */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return true; default: return false; @@ -126336,7 +126938,7 @@ var ts; function isPossiblyPartOfCommaSeperatedInitializer(node) { switch (node.kind) { case 75 /* Identifier */: - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: case 27 /* CommaToken */: return true; default: @@ -126385,9 +126987,9 @@ var ts; return; } var declaration = token.parent; - if (declaration.kind === 159 /* PropertyDeclaration */ && + if (declaration.kind === 160 /* PropertyDeclaration */ && (!fixedNodes || fixedNodes.tryAdd(declaration))) { - changeTracker.insertModifierBefore(sourceFile, 130 /* DeclareKeyword */, declaration); + changeTracker.insertModifierBefore(sourceFile, 131 /* DeclareKeyword */, declaration); } } })(codefix = ts.codefix || (ts.codefix = {})); @@ -126522,26 +127124,26 @@ var ts; } function isDeclarationWithType(node) { return ts.isFunctionLikeDeclaration(node) || - node.kind === 242 /* VariableDeclaration */ || - node.kind === 158 /* PropertySignature */ || - node.kind === 159 /* PropertyDeclaration */; + node.kind === 243 /* VariableDeclaration */ || + node.kind === 159 /* PropertySignature */ || + node.kind === 160 /* PropertyDeclaration */; } function transformJSDocType(node) { switch (node.kind) { - case 295 /* JSDocAllType */: - case 296 /* JSDocUnknownType */: + case 296 /* JSDocAllType */: + case 297 /* JSDocUnknownType */: return ts.createTypeReferenceNode("any", ts.emptyArray); - case 299 /* JSDocOptionalType */: + case 300 /* JSDocOptionalType */: return transformJSDocOptionalType(node); - case 298 /* JSDocNonNullableType */: + case 299 /* JSDocNonNullableType */: return transformJSDocType(node.type); - case 297 /* JSDocNullableType */: + case 298 /* JSDocNullableType */: return transformJSDocNullableType(node); - case 301 /* JSDocVariadicType */: + case 302 /* JSDocVariadicType */: return transformJSDocVariadicType(node); - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: return transformJSDocFunctionType(node); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return transformJSDocTypeReference(node); default: var visited = ts.visitEachChild(node, transformJSDocType, /*context*/ undefined); // TODO: GH#18217 @@ -126563,7 +127165,7 @@ var ts; } function transformJSDocParameter(node) { var index = node.parent.parameters.indexOf(node); - var isRest = node.type.kind === 301 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 + var isRest = node.type.kind === 302 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 var name = node.name || (isRest ? "rest" : "arg" + index); var dotdotdot = isRest ? ts.createToken(25 /* DotDotDotToken */) : node.dotDotDotToken; return ts.createParameter(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer); @@ -126603,8 +127205,8 @@ var ts; var index = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, - /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 140 /* NumberKeyword */ ? "n" : "s", - /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 140 /* NumberKeyword */ ? "number" : "string", []), + /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 141 /* NumberKeyword */ ? "n" : "s", + /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 141 /* NumberKeyword */ ? "number" : "string", []), /*initializer*/ undefined); var indexSignature = ts.createTypeLiteralNode([ts.createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]); ts.setEmitFlags(indexSignature, 1 /* SingleLine */); @@ -126862,7 +127464,7 @@ var ts; function annotate(changes, importAdder, sourceFile, declaration, type, program, host) { var typeNode = ts.getTypeNodeIfAccessible(type, declaration, program, host); if (typeNode) { - if (ts.isInJSFile(sourceFile) && declaration.kind !== 158 /* PropertySignature */) { + if (ts.isInJSFile(sourceFile) && declaration.kind !== 159 /* PropertySignature */) { var parent = ts.isVariableDeclaration(declaration) ? ts.tryCast(declaration.parent.parent, ts.isVariableStatement) : declaration; if (!parent) { return; @@ -126911,13 +127513,13 @@ var ts; return !!merged; }); }); var tag = ts.createJSDocComment(comments.join("\n"), ts.createNodeArray(__spreadArrays((oldTags || ts.emptyArray), unmergedNewTags))); - var jsDocNode = parent.kind === 202 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; + var jsDocNode = parent.kind === 203 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; jsDocNode.jsDoc = parent.jsDoc; jsDocNode.jsDocCache = parent.jsDocCache; changes.insertJsdocCommentBefore(sourceFile, jsDocNode, tag); } function getJsDocNodeForArrowFunction(signature) { - if (signature.parent.kind === 159 /* PropertyDeclaration */) { + if (signature.parent.kind === 160 /* PropertyDeclaration */) { return signature.parent; } return signature.parent.parent; @@ -126927,14 +127529,14 @@ var ts; return undefined; } switch (oldTag.kind) { - case 317 /* JSDocParameterTag */: { + case 318 /* JSDocParameterTag */: { var oldParam = oldTag; var newParam = newTag; return ts.isIdentifier(oldParam.name) && ts.isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? ts.createJSDocParamTag(newParam.name, newParam.isBracketed, newParam.typeExpression, oldParam.comment) : undefined; } - case 318 /* JSDocReturnTag */: + case 319 /* JSDocReturnTag */: return ts.createJSDocReturnTag(newTag.typeExpression, oldTag.comment); } } @@ -126959,18 +127561,18 @@ var ts; function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) { var searchToken; switch (containingFunction.kind) { - case 162 /* Constructor */: - searchToken = ts.findChildOfKind(containingFunction, 129 /* ConstructorKeyword */, sourceFile); + case 163 /* Constructor */: + searchToken = ts.findChildOfKind(containingFunction, 130 /* ConstructorKeyword */, sourceFile); break; - case 202 /* ArrowFunction */: - case 201 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 202 /* FunctionExpression */: var parent = containingFunction.parent; searchToken = ts.isVariableDeclaration(parent) && ts.isIdentifier(parent.name) ? parent.name : containingFunction.name; break; - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: searchToken = containingFunction.name; break; } @@ -127112,24 +127714,24 @@ var ts; node = node.parent; } switch (node.parent.kind) { - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: addCandidateType(usage, checker.getVoidType()); break; - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: usage.isNumber = true; break; - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: inferTypeFromPrefixUnaryExpression(node.parent, usage); break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: inferTypeFromBinaryExpression(node, node.parent, usage); break; - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: inferTypeFromSwitchStatementLabel(node.parent, usage); break; - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: if (node.parent.expression === node) { inferTypeFromCallExpression(node.parent, usage); } @@ -127137,20 +127739,20 @@ var ts; inferTypeFromContextualType(node, usage); } break; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: inferTypeFromPropertyAccessExpression(node.parent, usage); break; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: inferTypeFromPropertyElementExpression(node.parent, node, usage); break; - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: inferTypeFromPropertyAssignment(node.parent, usage); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: inferTypeFromPropertyDeclaration(node.parent, usage); break; - case 242 /* VariableDeclaration */: { + case 243 /* VariableDeclaration */: { var _a = node.parent, name = _a.name, initializer = _a.initializer; if (node === name) { if (initializer) { // This can happen for `let x = null;` which still has an implicit-any error. @@ -127269,7 +127871,7 @@ var ts; case 56 /* BarBarToken */: case 60 /* QuestionQuestionToken */: if (node === parent.left && - (node.parent.parent.kind === 242 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { + (node.parent.parent.kind === 243 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { // var x = x || {}; // TODO: use getFalsyflagsOfType addCandidateType(usage, checker.getTypeAtLocation(parent.right)); @@ -127297,7 +127899,7 @@ var ts; } } calculateUsageOfNode(parent, call.return_); - if (parent.kind === 196 /* CallExpression */) { + if (parent.kind === 197 /* CallExpression */) { (usage.calls || (usage.calls = [])).push(call); } else { @@ -127513,6 +128115,9 @@ var ts; else if (genericType.flags & 3145728 /* UnionOrIntersection */) { return ts.flatMap(genericType.types, function (t) { return inferTypeParameters(t, usageType, typeParameter); }); } + else if (genericType.flags & 134217728 /* Awaited */) { + return inferTypeParameters(genericType.awaitedType, usageType, typeParameter); + } else if (ts.getObjectFlags(genericType) & 4 /* Reference */ && ts.getObjectFlags(usageType) & 4 /* Reference */) { // this is wrong because we need a reference to the targetType to, so we can check that it's also a reference var genericArgs = checker.getTypeArguments(genericType); @@ -127616,12 +128221,12 @@ var ts; var precedingNode; var newClassDeclaration; switch (ctorDeclaration.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: precedingNode = ctorDeclaration; changes.delete(sourceFile, ctorDeclaration); newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: precedingNode = ctorDeclaration.parent.parent; newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration); if (ctorDeclaration.parent.declarations.length === 1) { @@ -127676,7 +128281,7 @@ var ts; return; } // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 226 /* ExpressionStatement */ + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 227 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; changes.delete(sourceFile, nodeToDelete); if (!assignmentBinaryExpression.right) { @@ -127684,7 +128289,7 @@ var ts; /*type*/ undefined, /*initializer*/ undefined); } switch (assignmentBinaryExpression.right.kind) { - case 201 /* FunctionExpression */: { + case 202 /* FunctionExpression */: { var functionExpression = assignmentBinaryExpression.right; var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(functionExpression, 126 /* AsyncKeyword */)); var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, @@ -127692,12 +128297,12 @@ var ts; ts.copyLeadingComments(assignmentBinaryExpression, method, sourceFile); return method; } - case 202 /* ArrowFunction */: { + case 203 /* ArrowFunction */: { var arrowFunction = assignmentBinaryExpression.right; var arrowFunctionBody = arrowFunction.body; var bodyBlock = void 0; // case 1: () => { return [1,2,3] } - if (arrowFunctionBody.kind === 223 /* Block */) { + if (arrowFunctionBody.kind === 224 /* Block */) { bodyBlock = arrowFunctionBody; } // case 2: () => [1,2,3] @@ -127725,7 +128330,7 @@ var ts; } function createClassFromVariableDeclaration(node) { var initializer = node.initializer; - if (!initializer || initializer.kind !== 201 /* FunctionExpression */) { + if (!initializer || initializer.kind !== 202 /* FunctionExpression */) { return undefined; } if (node.name.kind !== 75 /* Identifier */) { @@ -127797,27 +128402,21 @@ var ts; return; } var synthNamesMap = ts.createMap(); - var originalTypeMap = ts.createMap(); - var allVarNames = []; var isInJavascript = ts.isInJSFile(functionToConvert); var setOfExpressionsToReturn = getAllPromiseExpressionsToReturn(functionToConvert, checker); - var functionToConvertRenamed = renameCollidingVarNames(functionToConvert, checker, synthNamesMap, context, setOfExpressionsToReturn, originalTypeMap, allVarNames); - var constIdentifiers = getConstIdentifiers(synthNamesMap); + var functionToConvertRenamed = renameCollidingVarNames(functionToConvert, checker, synthNamesMap, context.sourceFile); var returnStatements = functionToConvertRenamed.body && ts.isBlock(functionToConvertRenamed.body) ? getReturnStatementsWithPromiseHandlers(functionToConvertRenamed.body) : ts.emptyArray; - var transformer = { checker: checker, synthNamesMap: synthNamesMap, allVarNames: allVarNames, setOfExpressionsToReturn: setOfExpressionsToReturn, constIdentifiers: constIdentifiers, originalTypeMap: originalTypeMap, isInJSFile: isInJavascript }; + var transformer = { checker: checker, synthNamesMap: synthNamesMap, setOfExpressionsToReturn: setOfExpressionsToReturn, isInJSFile: isInJavascript }; if (!returnStatements.length) { return; } // add the async keyword changes.insertLastModifierBefore(sourceFile, 126 /* AsyncKeyword */, functionToConvert); - function startTransformation(node, nodeToReplace) { - var newNodes = transformExpression(node, transformer, node); - changes.replaceNodeWithNodes(sourceFile, nodeToReplace, newNodes); - } - var _loop_13 = function (statement) { - ts.forEachChild(statement, function visit(node) { + var _loop_13 = function (returnStatement) { + ts.forEachChild(returnStatement, function visit(node) { if (ts.isCallExpression(node)) { - startTransformation(node, statement); + var newNodes = transformExpression(node, transformer); + changes.replaceNodeWithNodes(sourceFile, returnStatement, newNodes); } else if (!ts.isFunctionLike(node)) { ts.forEachChild(node, visit); @@ -127825,8 +128424,8 @@ var ts; }); }; for (var _i = 0, returnStatements_1 = returnStatements; _i < returnStatements_1.length; _i++) { - var statement = returnStatements_1[_i]; - _loop_13(statement); + var returnStatement = returnStatements_1[_i]; + _loop_13(returnStatement); } } function getReturnStatementsWithPromiseHandlers(body) { @@ -127837,16 +128436,6 @@ var ts; }); return res; } - // Returns the identifiers that are never reassigned in the refactor - function getConstIdentifiers(synthNamesMap) { - var constIdentifiers = []; - synthNamesMap.forEach(function (val) { - if (val.numberOfAssignmentsOriginal === 0) { - constIdentifiers.push(val.identifier); - } - }); - return constIdentifiers; - } /* Finds all of the expressions of promise type that should not be saved in a variable during the refactor */ @@ -127856,16 +128445,16 @@ var ts; } var setOfExpressionsToReturn = ts.createMap(); ts.forEachChild(func.body, function visit(node) { - if (isPromiseReturningExpression(node, checker, "then")) { + if (isPromiseReturningCallExpression(node, checker, "then")) { setOfExpressionsToReturn.set(ts.getNodeId(node).toString(), true); ts.forEach(node.arguments, visit); } - else if (isPromiseReturningExpression(node, checker, "catch")) { + else if (isPromiseReturningCallExpression(node, checker, "catch")) { setOfExpressionsToReturn.set(ts.getNodeId(node).toString(), true); // if .catch() is the last call in the chain, move leftward in the chain until we hit something else that should be returned ts.forEachChild(node, visit); } - else if (isPromiseReturningExpression(node, checker)) { + else if (isPromiseTypedExpression(node, checker)) { setOfExpressionsToReturn.set(ts.getNodeId(node).toString(), true); // don't recurse here, since we won't refactor any children or arguments of the expression } @@ -127875,16 +128464,22 @@ var ts; }); return setOfExpressionsToReturn; } - /* - Returns true if node is a promise returning expression - If name is not undefined, node is a promise returning call of name - */ - function isPromiseReturningExpression(node, checker, name) { - var isNodeExpression = name ? ts.isCallExpression(node) : ts.isExpression(node); - var isExpressionOfName = isNodeExpression && (!name || ts.hasPropertyAccessExpressionWithName(node, name)); + function isPromiseReturningCallExpression(node, checker, name) { + if (!ts.isCallExpression(node)) + return false; + var isExpressionOfName = ts.hasPropertyAccessExpressionWithName(node, name); var nodeType = isExpressionOfName && checker.getTypeAtLocation(node); return !!(nodeType && checker.getPromisedTypeOfPromise(nodeType)); } + function isParameterOfPromiseCallback(node, checker) { + return ts.isParameter(node) && (isPromiseReturningCallExpression(node.parent.parent, checker, "then") || + isPromiseReturningCallExpression(node.parent.parent, checker, "catch")); + } + function isPromiseTypedExpression(node, checker) { + if (!ts.isExpression(node)) + return false; + return !!checker.getPromisedTypeOfPromise(checker.getTypeAtLocation(node)); + } function declaredInFile(symbol, sourceFile) { return symbol.valueDeclaration && symbol.valueDeclaration.getSourceFile() === sourceFile; } @@ -127893,31 +128488,36 @@ var ts; This function collects all existing identifier names and names of identifiers that will be created in the refactor. It then checks for any collisions and renames them through getSynthesizedDeepClone */ - function renameCollidingVarNames(nodeToRename, checker, synthNamesMap, context, setOfAllExpressionsToReturn, originalType, allVarNames) { + function renameCollidingVarNames(nodeToRename, checker, synthNamesMap, sourceFile) { + var variableNames = []; var identsToRenameMap = ts.createMap(); // key is the symbol id - var collidingSymbolMap = ts.createMap(); + var collidingSymbolMap = ts.createMultiMap(); ts.forEachChild(nodeToRename, function visit(node) { if (!ts.isIdentifier(node)) { ts.forEachChild(node, visit); return; } var symbol = checker.getSymbolAtLocation(node); - var isDefinedInFile = symbol && declaredInFile(symbol, context.sourceFile); + var isDefinedInFile = symbol && declaredInFile(symbol, sourceFile); if (symbol && isDefinedInFile) { var type = checker.getTypeAtLocation(node); + // Note - the choice of the last call signature is arbitrary var lastCallSignature = getLastCallSignature(type, checker); var symbolIdString = ts.getSymbolId(symbol).toString(); - // if the identifier refers to a function we want to add the new synthesized variable for the declaration (ex. blob in let blob = res(arg)) - // Note - the choice of the last call signature is arbitrary + // If the identifier refers to a function, we want to add the new synthesized variable for the declaration. Example: + // fetch('...').then(response => { ... }) + // will eventually become + // const response = await fetch('...') + // so we push an entry for 'response'. if (lastCallSignature && !ts.isFunctionLikeDeclaration(node.parent) && !synthNamesMap.has(symbolIdString)) { var firstParameter = ts.firstOrUndefined(lastCallSignature.parameters); var ident = firstParameter && ts.isParameter(firstParameter.valueDeclaration) && ts.tryCast(firstParameter.valueDeclaration.name, ts.isIdentifier) || ts.createOptimisticUniqueName("result"); var synthName = getNewNameIfConflict(ident, collidingSymbolMap); synthNamesMap.set(symbolIdString, synthName); - allVarNames.push({ identifier: synthName.identifier, symbol: symbol }); - addNameToFrequencyMap(collidingSymbolMap, ident.text, symbol); + variableNames.push({ identifier: synthName.identifier, symbol: symbol }); + collidingSymbolMap.add(ident.text, symbol); } - // we only care about identifiers that are parameters, declarations, or binding elements (don't care about other uses) + // We only care about identifiers that are parameters, variable declarations, or binding elements else if (node.parent && (ts.isParameter(node.parent) || ts.isVariableDeclaration(node.parent) || ts.isBindingElement(node.parent))) { var originalName = node.text; var collidingSymbols = collidingSymbolMap.get(originalName); @@ -127926,96 +128526,65 @@ var ts; var newName = getNewNameIfConflict(node, collidingSymbolMap); identsToRenameMap.set(symbolIdString, newName.identifier); synthNamesMap.set(symbolIdString, newName); - allVarNames.push({ identifier: newName.identifier, symbol: symbol }); - addNameToFrequencyMap(collidingSymbolMap, originalName, symbol); + variableNames.push({ identifier: newName.identifier, symbol: symbol }); + collidingSymbolMap.add(originalName, symbol); } else { var identifier = ts.getSynthesizedDeepClone(node); identsToRenameMap.set(symbolIdString, identifier); - synthNamesMap.set(symbolIdString, createSynthIdentifier(identifier, [], allVarNames.filter(function (elem) { return elem.identifier.text === node.text; }).length /*, numberOfAssignmentsSynthesized: 0*/)); - if ((ts.isParameter(node.parent) && isExpressionOrCallOnTypePromise(node.parent.parent)) || ts.isVariableDeclaration(node.parent)) { - allVarNames.push({ identifier: identifier, symbol: symbol }); - addNameToFrequencyMap(collidingSymbolMap, originalName, symbol); + synthNamesMap.set(symbolIdString, createSynthIdentifier(identifier)); + if (isParameterOfPromiseCallback(node.parent, checker) || ts.isVariableDeclaration(node.parent)) { + variableNames.push({ identifier: identifier, symbol: symbol }); + collidingSymbolMap.add(originalName, symbol); } } } } }); - return ts.getSynthesizedDeepCloneWithRenames(nodeToRename, /*includeTrivia*/ true, identsToRenameMap, checker, deepCloneCallback); - function isExpressionOrCallOnTypePromise(child) { - var node = child.parent; - if (ts.isCallExpression(node) || ts.isIdentifier(node) && !setOfAllExpressionsToReturn.get(ts.getNodeId(node).toString())) { - var nodeType = checker.getTypeAtLocation(node); - var isPromise = nodeType && checker.getPromisedTypeOfPromise(nodeType); - return !!isPromise; - } - return false; - } - function deepCloneCallback(node, clone) { - if (ts.isIdentifier(node)) { - var symbol = checker.getSymbolAtLocation(node); - var symboldIdString = symbol && ts.getSymbolId(symbol).toString(); - var renameInfo = symbol && synthNamesMap.get(symboldIdString); - if (renameInfo) { - var type = checker.getTypeAtLocation(node); - originalType.set(ts.getNodeId(clone).toString(), type); - } - } - var val = setOfAllExpressionsToReturn.get(ts.getNodeId(node).toString()); - if (val !== undefined) { - setOfAllExpressionsToReturn.delete(ts.getNodeId(node).toString()); - setOfAllExpressionsToReturn.set(ts.getNodeId(clone).toString(), val); - } - } - } - function addNameToFrequencyMap(renamedVarNameFrequencyMap, originalName, symbol) { - if (renamedVarNameFrequencyMap.has(originalName)) { - renamedVarNameFrequencyMap.get(originalName).push(symbol); - } - else { - renamedVarNameFrequencyMap.set(originalName, [symbol]); - } + return ts.getSynthesizedDeepCloneWithRenames(nodeToRename, /*includeTrivia*/ true, identsToRenameMap, checker); } function getNewNameIfConflict(name, originalNames) { var numVarsSameName = (originalNames.get(name.text) || ts.emptyArray).length; - var numberOfAssignmentsOriginal = 0; var identifier = numVarsSameName === 0 ? name : ts.createIdentifier(name.text + "_" + numVarsSameName); - return createSynthIdentifier(identifier, [], numberOfAssignmentsOriginal); + return createSynthIdentifier(identifier); + } + function silentFail() { + codeActionSucceeded = false; + return ts.emptyArray; } // dispatch function to recursively build the refactoring // should be kept up to date with isFixablePromiseHandler in suggestionDiagnostics.ts - function transformExpression(node, transformer, outermostParent, prevArgName) { - if (!node) { - return ts.emptyArray; - } - var originalType = ts.isIdentifier(node) && transformer.originalTypeMap.get(ts.getNodeId(node).toString()); - var nodeType = originalType || transformer.checker.getTypeAtLocation(node); - if (ts.isCallExpression(node) && ts.hasPropertyAccessExpressionWithName(node, "then") && nodeType && !!transformer.checker.getPromisedTypeOfPromise(nodeType)) { - return transformThen(node, transformer, outermostParent, prevArgName); - } - else if (ts.isCallExpression(node) && ts.hasPropertyAccessExpressionWithName(node, "catch") && nodeType && !!transformer.checker.getPromisedTypeOfPromise(nodeType)) { + function transformExpression(node, transformer, prevArgName) { + if (isPromiseReturningCallExpression(node, transformer.checker, "then")) { + if (node.arguments.length === 0) + return silentFail(); + return transformThen(node, transformer, prevArgName); + } + if (isPromiseReturningCallExpression(node, transformer.checker, "catch")) { + if (node.arguments.length === 0) + return silentFail(); return transformCatch(node, transformer, prevArgName); } - else if (ts.isPropertyAccessExpression(node)) { - return transformExpression(node.expression, transformer, outermostParent, prevArgName); + if (ts.isPropertyAccessExpression(node)) { + return transformExpression(node.expression, transformer, prevArgName); } - else if (nodeType && transformer.checker.getPromisedTypeOfPromise(nodeType)) { - return transformPromiseCall(node, transformer, prevArgName); + var nodeType = transformer.checker.getTypeAtLocation(node); + if (nodeType && transformer.checker.getPromisedTypeOfPromise(nodeType)) { + ts.Debug.assertNode(node.original.parent, ts.isPropertyAccessExpression); + return transformPromiseExpressionOfPropertyAccess(node, transformer, prevArgName); } - codeActionSucceeded = false; - return ts.emptyArray; + return silentFail(); } function transformCatch(node, transformer, prevArgName) { var func = node.arguments[0]; var argName = getArgBindingName(func, transformer); - var shouldReturn = transformer.setOfExpressionsToReturn.get(ts.getNodeId(node).toString()); var possibleNameForVarDecl; /* If there is another call in the chain after the .catch() we are transforming, we will need to save the result of both paths (try block and catch block) To do this, we will need to synthesize a variable that we were not aware of while we were adding identifiers to the synthNamesMap We will use the prevArgName and then update the synthNamesMap with a new variable name for the next transformation step */ - if (prevArgName && !shouldReturn) { + if (prevArgName && !shouldReturn(node, transformer)) { if (isSynthIdentifier(prevArgName)) { possibleNameForVarDecl = prevArgName; transformer.synthNamesMap.forEach(function (val, key) { @@ -128028,13 +128597,12 @@ var ts; else { possibleNameForVarDecl = createSynthIdentifier(ts.createOptimisticUniqueName("result"), prevArgName.types); } - possibleNameForVarDecl.numberOfAssignmentsOriginal = 2; // Try block and catch block - // update the constIdentifiers list - if (transformer.constIdentifiers.some(function (elem) { return elem.text === possibleNameForVarDecl.identifier.text; })) { - transformer.constIdentifiers.push(createUniqueSynthName(possibleNameForVarDecl).identifier); - } + // We are about to write a 'let' variable declaration, but `transformExpression` for both + // the try block and catch block will assign to this name. Setting this flag indicates + // that future assignments should be written as `name = value` instead of `const name = value`. + possibleNameForVarDecl.hasBeenDeclared = true; } - var tryBlock = ts.createBlock(transformExpression(node.expression, transformer, node, possibleNameForVarDecl)); + var tryBlock = ts.createBlock(transformExpression(node.expression, transformer, possibleNameForVarDecl)); var transformationBody = getTransformationBody(func, possibleNameForVarDecl, argName, node, transformer); var catchArg = argName ? isSynthIdentifier(argName) ? argName.identifier.text : argName.bindingPattern : "e"; var catchVariableDeclaration = ts.createVariableDeclaration(catchArg); @@ -128044,7 +128612,7 @@ var ts; */ var varDeclList; var varDeclIdentifier; - if (possibleNameForVarDecl && !shouldReturn) { + if (possibleNameForVarDecl && !shouldReturn(node, transformer)) { varDeclIdentifier = ts.getSynthesizedDeepClone(possibleNameForVarDecl.identifier); var typeArray = possibleNameForVarDecl.types; var unionType = transformer.checker.getUnionType(typeArray, 2 /* Subtype */); @@ -128057,68 +128625,53 @@ var ts; && ts.createVariableStatement(/* modifiers */ undefined, ts.createVariableDeclarationList([ts.createVariableDeclaration(ts.getSynthesizedDeepCloneWithRenames(prevArgName.bindingPattern), /* type */ undefined, varDeclIdentifier)], 2 /* Const */)); return ts.compact([varDeclList, tryStatement, destructuredResult]); } - function getIdentifierTextsFromBindingName(bindingName) { - if (ts.isIdentifier(bindingName)) - return [bindingName.text]; - return ts.flatMap(bindingName.elements, function (element) { - if (ts.isOmittedExpression(element)) - return []; - return getIdentifierTextsFromBindingName(element.name); - }); - } function createUniqueSynthName(prevArgName) { var renamedPrevArg = ts.createOptimisticUniqueName(prevArgName.identifier.text); return createSynthIdentifier(renamedPrevArg); } - function transformThen(node, transformer, outermostParent, prevArgName) { - var _a = node.arguments, res = _a[0], rej = _a[1]; - if (!res) { - return transformExpression(node.expression, transformer, outermostParent); - } - var argNameRes = getArgBindingName(res, transformer); - var transformationBody = getTransformationBody(res, prevArgName, argNameRes, node, transformer); - if (rej) { - var argNameRej = getArgBindingName(rej, transformer); - var tryBlock = ts.createBlock(transformExpression(node.expression, transformer, node, argNameRes).concat(transformationBody)); - var transformationBody2 = getTransformationBody(rej, prevArgName, argNameRej, node, transformer); - var catchArg = argNameRej ? isSynthIdentifier(argNameRej) ? argNameRej.identifier.text : argNameRej.bindingPattern : "e"; + function transformThen(node, transformer, prevArgName) { + var _a = node.arguments, onFulfilled = _a[0], onRejected = _a[1]; + var onFulfilledArgumentName = getArgBindingName(onFulfilled, transformer); + var transformationBody = getTransformationBody(onFulfilled, prevArgName, onFulfilledArgumentName, node, transformer); + if (onRejected) { + var onRejectedArgumentName = getArgBindingName(onRejected, transformer); + var tryBlock = ts.createBlock(transformExpression(node.expression, transformer, onFulfilledArgumentName).concat(transformationBody)); + var transformationBody2 = getTransformationBody(onRejected, prevArgName, onRejectedArgumentName, node, transformer); + var catchArg = onRejectedArgumentName ? isSynthIdentifier(onRejectedArgumentName) ? onRejectedArgumentName.identifier.text : onRejectedArgumentName.bindingPattern : "e"; var catchVariableDeclaration = ts.createVariableDeclaration(catchArg); var catchClause = ts.createCatchClause(catchVariableDeclaration, ts.createBlock(transformationBody2)); return [ts.createTry(tryBlock, catchClause, /* finallyBlock */ undefined)]; } - return transformExpression(node.expression, transformer, node, argNameRes).concat(transformationBody); - } - function getFlagOfBindingName(bindingName, constIdentifiers) { - var identifiers = getIdentifierTextsFromBindingName(getNode(bindingName)); - var inArr = constIdentifiers.some(function (elem) { return ts.contains(identifiers, elem.text); }); - return inArr ? 2 /* Const */ : 1 /* Let */; + return transformExpression(node.expression, transformer, onFulfilledArgumentName).concat(transformationBody); } - function transformPromiseCall(node, transformer, prevArgName) { - var shouldReturn = transformer.setOfExpressionsToReturn.get(ts.getNodeId(node).toString()); - // the identifier is empty when the handler (.then()) ignores the argument - In this situation we do not need to save the result of the promise returning call - var originalNodeParent = node.original ? node.original.parent : node.parent; - if (prevArgName && !shouldReturn && (!originalNodeParent || ts.isPropertyAccessExpression(originalNodeParent))) { - return createTransformedStatement(prevArgName, ts.createAwait(node), transformer); - } - else if (!prevArgName && !shouldReturn && (!originalNodeParent || ts.isPropertyAccessExpression(originalNodeParent))) { - return [ts.createStatement(ts.createAwait(node))]; + /** + * Transforms the 'x' part of `x.then(...)`, or the 'y()' part of `y.catch(...)`, where 'x' and 'y()' are Promises. + */ + function transformPromiseExpressionOfPropertyAccess(node, transformer, prevArgName) { + if (shouldReturn(node, transformer)) { + return [ts.createReturn(ts.getSynthesizedDeepClone(node))]; } - return [ts.createReturn(ts.getSynthesizedDeepClone(node))]; + return createVariableOrAssignmentOrExpressionStatement(prevArgName, ts.createAwait(node)); } - function createTransformedStatement(prevArgName, rightHandSide, transformer) { - if (!prevArgName || isEmpty(prevArgName)) { + function createVariableOrAssignmentOrExpressionStatement(variableName, rightHandSide) { + if (!variableName || isEmptyBindingName(variableName)) { // if there's no argName to assign to, there still might be side effects - return [ts.createStatement(rightHandSide)]; + return [ts.createExpressionStatement(rightHandSide)]; } - if (isSynthIdentifier(prevArgName) && prevArgName.types.length < prevArgName.numberOfAssignmentsOriginal) { + if (isSynthIdentifier(variableName) && variableName.hasBeenDeclared) { // if the variable has already been declared, we don't need "let" or "const" - return [ts.createStatement(ts.createAssignment(ts.getSynthesizedDeepClone(prevArgName.identifier), rightHandSide))]; + return [ts.createExpressionStatement(ts.createAssignment(ts.getSynthesizedDeepClone(variableName.identifier), rightHandSide))]; } - return [ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(ts.getSynthesizedDeepClone(getNode(prevArgName)), /*type*/ undefined, rightHandSide)], getFlagOfBindingName(prevArgName, transformer.constIdentifiers))))]; + return [ + ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration(ts.getSynthesizedDeepClone(getNode(variableName)), + /*type*/ undefined, rightHandSide) + ], 2 /* Const */)) + ]; } // should be kept up to date with isFixablePromiseArgument in suggestionDiagnostics.ts function getTransformationBody(func, prevArgName, argName, parent, transformer) { - var shouldReturn = transformer.setOfExpressionsToReturn.get(ts.getNodeId(parent).toString()); switch (func.kind) { case 100 /* NullKeyword */: // do not produce a transformed statement for a null argument @@ -128129,24 +128682,23 @@ var ts; break; } var synthCall = ts.createCall(ts.getSynthesizedDeepClone(func), /*typeArguments*/ undefined, isSynthIdentifier(argName) ? [argName.identifier] : []); - if (shouldReturn) { + if (shouldReturn(parent, transformer)) { return [ts.createReturn(synthCall)]; } - var type = transformer.originalTypeMap.get(ts.getNodeId(func).toString()) || transformer.checker.getTypeAtLocation(func); + var type = transformer.checker.getTypeAtLocation(func); var callSignatures = transformer.checker.getSignaturesOfType(type, 0 /* Call */); if (!callSignatures.length) { // if identifier in handler has no call signatures, it's invalid - codeActionSucceeded = false; - break; + return silentFail(); } var returnType = callSignatures[0].getReturnType(); - var varDeclOrAssignment = createTransformedStatement(prevArgName, ts.createAwait(synthCall), transformer); + var varDeclOrAssignment = createVariableOrAssignmentOrExpressionStatement(prevArgName, ts.createAwait(synthCall)); if (prevArgName) { prevArgName.types.push(returnType); } return varDeclOrAssignment; - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: { + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: { var funcBody = func.body; // Arrow functions with block bodies { } will enter this control flow if (ts.isBlock(funcBody)) { @@ -128164,8 +128716,9 @@ var ts; refactoredStmts.push(statement); } } - return shouldReturn ? refactoredStmts.map(function (s) { return ts.getSynthesizedDeepClone(s); }) : - removeReturns(refactoredStmts, prevArgName, transformer, seenReturnStatement); + return shouldReturn(parent, transformer) + ? refactoredStmts.map(function (s) { return ts.getSynthesizedDeepClone(s); }) + : removeReturns(refactoredStmts, prevArgName, transformer, seenReturnStatement); } else { var innerRetStmts = ts.isFixablePromiseHandler(funcBody) ? [ts.createReturn(funcBody)] : ts.emptyArray; @@ -128177,8 +128730,8 @@ var ts; var returnType_1 = getLastCallSignature(type_1, transformer.checker).getReturnType(); var rightHandSide = ts.getSynthesizedDeepClone(funcBody); var possiblyAwaitedRightHandSide = !!transformer.checker.getPromisedTypeOfPromise(returnType_1) ? ts.createAwait(rightHandSide) : rightHandSide; - if (!shouldReturn) { - var transformedStatement = createTransformedStatement(prevArgName, possiblyAwaitedRightHandSide, transformer); + if (!shouldReturn(parent, transformer)) { + var transformedStatement = createVariableOrAssignmentOrExpressionStatement(prevArgName, possiblyAwaitedRightHandSide); if (prevArgName) { prevArgName.types.push(returnType_1); } @@ -128191,8 +128744,7 @@ var ts; } default: // If no cases apply, we've found a transformation body we don't know how to handle, so the refactoring should no-op to avoid deleting code. - codeActionSucceeded = false; - break; + return silentFail(); } return ts.emptyArray; } @@ -128206,12 +128758,12 @@ var ts; var stmt = stmts_1[_i]; if (ts.isReturnStatement(stmt)) { if (stmt.expression) { - var possiblyAwaitedExpression = isPromiseReturningExpression(stmt.expression, transformer.checker) ? ts.createAwait(stmt.expression) : stmt.expression; + var possiblyAwaitedExpression = isPromiseTypedExpression(stmt.expression, transformer.checker) ? ts.createAwait(stmt.expression) : stmt.expression; if (prevArgName === undefined) { ret.push(ts.createExpressionStatement(possiblyAwaitedExpression)); } else { - ret.push(ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(getNode(prevArgName), /*type*/ undefined, possiblyAwaitedExpression)], getFlagOfBindingName(prevArgName, transformer.constIdentifiers))))); + ret.push(ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(getNode(prevArgName), /*type*/ undefined, possiblyAwaitedExpression)], 2 /* Const */)))); } } } @@ -128221,7 +128773,7 @@ var ts; } // if block has no return statement, need to define prevArgName as undefined to prevent undeclared variables if (!seenReturnStatement && prevArgName !== undefined) { - ret.push(ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(getNode(prevArgName), /*type*/ undefined, ts.createIdentifier("undefined"))], getFlagOfBindingName(prevArgName, transformer.constIdentifiers))))); + ret.push(ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(getNode(prevArgName), /*type*/ undefined, ts.createIdentifier("undefined"))], 2 /* Const */)))); } return ret; } @@ -128231,7 +128783,7 @@ var ts; var stmt = innerRetStmts_1[_i]; ts.forEachChild(stmt, function visit(node) { if (ts.isCallExpression(node)) { - var temp = transformExpression(node, transformer, node, prevArgName); + var temp = transformExpression(node, transformer, prevArgName); innerCbBody = innerCbBody.concat(temp); if (innerCbBody.length > 0) { return; @@ -128245,7 +128797,6 @@ var ts; return innerCbBody; } function getArgBindingName(funcNode, transformer) { - var numberOfAssignmentsOriginal = 0; var types = []; var name; if (ts.isFunctionLikeDeclaration(funcNode)) { @@ -128277,10 +128828,10 @@ var ts; var originalNode = getOriginalNode(identifier); var symbol = getSymbol(originalNode); if (!symbol) { - return createSynthIdentifier(identifier, types, numberOfAssignmentsOriginal); + return createSynthIdentifier(identifier, types); } var mapEntry = transformer.synthNamesMap.get(ts.getSymbolId(symbol).toString()); - return mapEntry || createSynthIdentifier(identifier, types, numberOfAssignmentsOriginal); + return mapEntry || createSynthIdentifier(identifier, types); } function getSymbol(node) { return node.symbol ? node.symbol : transformer.checker.getSymbolAtLocation(node); @@ -128289,22 +128840,21 @@ var ts; return node.original ? node.original : node; } } - function isEmpty(bindingName) { + function isEmptyBindingName(bindingName) { if (!bindingName) { return true; } if (isSynthIdentifier(bindingName)) { return !bindingName.identifier.text; } - return ts.every(bindingName.elements, isEmpty); + return ts.every(bindingName.elements, isEmptyBindingName); } function getNode(bindingName) { return isSynthIdentifier(bindingName) ? bindingName.identifier : bindingName.bindingPattern; } - function createSynthIdentifier(identifier, types, numberOfAssignmentsOriginal) { + function createSynthIdentifier(identifier, types) { if (types === void 0) { types = []; } - if (numberOfAssignmentsOriginal === void 0) { numberOfAssignmentsOriginal = 0; } - return { kind: 0 /* Identifier */, identifier: identifier, types: types, numberOfAssignmentsOriginal: numberOfAssignmentsOriginal }; + return { kind: 0 /* Identifier */, identifier: identifier, types: types, hasBeenDeclared: false }; } function createSynthBindingPattern(bindingPattern, elements, types) { if (elements === void 0) { elements = ts.emptyArray; } @@ -128317,6 +128867,9 @@ var ts; function isSynthBindingPattern(bindingName) { return bindingName.kind === 1 /* BindingPattern */; } + function shouldReturn(expression, transformer) { + return !!expression.original && transformer.setOfExpressionsToReturn.has(ts.getNodeId(expression.original).toString()); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -128350,10 +128903,10 @@ var ts; } var importNode = ts.importFromModuleSpecifier(moduleSpecifier); switch (importNode.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: changes.replaceNode(importingFile, importNode, ts.makeImport(importNode.name, /*namedImports*/ undefined, moduleSpecifier, quotePreference)); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (ts.isRequireCall(importNode, /*checkArgumentIsStringLiteralLike*/ false)) { changes.replaceNode(importingFile, importNode, ts.createPropertyAccess(ts.getSynthesizedDeepClone(importNode), "default")); } @@ -128406,20 +128959,20 @@ var ts; } function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, quotePreference) { switch (statement.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); return false; - case 226 /* ExpressionStatement */: { + case 227 /* ExpressionStatement */: { var expression = statement.expression; switch (expression.kind) { - case 196 /* CallExpression */: { + case 197 /* CallExpression */: { if (ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true)) { // For side-effecting require() call, just make a side-effecting import. changes.replaceNode(sourceFile, statement, ts.makeImport(/*name*/ undefined, /*namedImports*/ undefined, expression.arguments[0], quotePreference)); } return false; } - case 209 /* BinaryExpression */: { + case 210 /* BinaryExpression */: { var operatorToken = expression.operatorToken; return operatorToken.kind === 62 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports); } @@ -128461,8 +129014,8 @@ var ts; /** Converts `const name = require("moduleSpecifier").propertyName` */ function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, quotePreference) { switch (name.kind) { - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: { + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: { // `const [a, b] = require("c").d` --> `import { d } from "c"; const [a, b] = d;` var tmp = makeUniqueName(propertyName, identifiers); return [ @@ -128513,16 +129066,16 @@ var ts; function tryChangeModuleExportsObject(object) { var statements = ts.mapAllOrFail(object.properties, function (prop) { switch (prop.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. // falls through - case 282 /* ShorthandPropertyAssignment */: - case 283 /* SpreadAssignment */: + case 283 /* ShorthandPropertyAssignment */: + case 284 /* SpreadAssignment */: return undefined; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.createToken(89 /* ExportKeyword */)], prop); default: ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind " + prop.kind); @@ -128586,7 +129139,7 @@ var ts; function convertExportsDotXEquals_replaceNode(name, exported) { var modifiers = [ts.createToken(89 /* ExportKeyword */)]; switch (exported.kind) { - case 201 /* FunctionExpression */: { + case 202 /* FunctionExpression */: { var expressionName = exported.name; if (expressionName && expressionName.text !== name) { // `exports.f = function g() {}` -> `export const f = function g() {}` @@ -128594,10 +129147,10 @@ var ts; } } // falls through - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: // `exports.f = function() {}` --> `export function f() {}` return functionExpressionToDeclaration(name, modifiers, exported); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: // `exports.C = class {}` --> `export class C {}` return classExpressionToDeclaration(name, modifiers, exported); default: @@ -128615,7 +129168,7 @@ var ts; */ function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target, quotePreference) { switch (name.kind) { - case 189 /* ObjectBindingPattern */: { + case 190 /* ObjectBindingPattern */: { var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) { return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name) ? undefined @@ -128628,7 +129181,7 @@ var ts; } } // falls through -- object destructuring has an interesting pattern and must be a variable declaration - case 190 /* ArrayBindingPattern */: { + case 191 /* ArrayBindingPattern */: { /* import x from "x"; const [a, b, c] = x; @@ -128711,11 +129264,11 @@ var ts; function isFreeIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return parent.name !== node; - case 191 /* BindingElement */: + case 192 /* BindingElement */: return parent.propertyName !== node; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return parent.propertyName !== node; default: return true; @@ -129173,11 +129726,11 @@ var ts; function getTargetModuleFromNamespaceLikeImport(declaration, checker) { var _a; switch (declaration.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return checker.resolveExternalModuleName(declaration.initializer.arguments[0]); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return checker.getAliasedSymbol(declaration.symbol); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: var namespaceImport = ts.tryCast((_a = declaration.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings, ts.isNamespaceImport); return namespaceImport && checker.getAliasedSymbol(namespaceImport.symbol); default: @@ -129187,11 +129740,11 @@ var ts; function getNamespaceLikeImportText(declaration) { var _a, _b, _c; switch (declaration.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return (_a = ts.tryCast(declaration.name, ts.isIdentifier)) === null || _a === void 0 ? void 0 : _a.text; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return declaration.name.text; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return (_c = ts.tryCast((_b = declaration.importClause) === null || _b === void 0 ? void 0 : _b.namedBindings, ts.isNamespaceImport)) === null || _c === void 0 ? void 0 : _c.name.text; default: return ts.Debug.assertNever(declaration); @@ -129200,10 +129753,10 @@ var ts; function tryAddToExistingImport(existingImports, canUseTypeOnlyImport) { return ts.firstDefined(existingImports, function (_a) { var declaration = _a.declaration, importKind = _a.importKind; - if (declaration.kind === 253 /* ImportEqualsDeclaration */) + if (declaration.kind === 254 /* ImportEqualsDeclaration */) return undefined; - if (declaration.kind === 242 /* VariableDeclaration */) { - return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 189 /* ObjectBindingPattern */ + if (declaration.kind === 243 /* VariableDeclaration */) { + return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 190 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind: importKind, moduleSpecifier: declaration.initializer.arguments[0].text, canUseTypeOnlyImport: false } : undefined; } @@ -129211,7 +129764,7 @@ var ts; if (!importClause) return undefined; var name = importClause.name, namedBindings = importClause.namedBindings; - return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 257 /* NamedImports */) + return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 258 /* NamedImports */) ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: importClause, importKind: importKind, moduleSpecifier: declaration.moduleSpecifier.getText(), canUseTypeOnlyImport: canUseTypeOnlyImport } : undefined; }); @@ -129224,7 +129777,7 @@ var ts; if (ts.isRequireVariableDeclaration(i.parent, /*requireStringLiteralLikeArgument*/ true)) { return checker.resolveExternalModuleName(moduleSpecifier) === moduleSymbol ? { declaration: i.parent, importKind: importKind } : undefined; } - if (i.kind === 254 /* ImportDeclaration */ || i.kind === 253 /* ImportEqualsDeclaration */) { + if (i.kind === 255 /* ImportDeclaration */ || i.kind === 254 /* ImportEqualsDeclaration */) { return checker.getSymbolAtLocation(moduleSpecifier) === moduleSymbol ? { declaration: i, importKind: importKind } : undefined; } }); @@ -129267,9 +129820,9 @@ var ts; } function newImportInfoFromExistingSpecifier(_a, preferTypeOnlyImport, useRequire) { var declaration = _a.declaration, importKind = _a.importKind; - var moduleSpecifier = declaration.kind === 254 /* ImportDeclaration */ ? declaration.moduleSpecifier : - declaration.kind === 242 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : - declaration.moduleReference.kind === 265 /* ExternalModuleReference */ ? declaration.moduleReference.expression : + var moduleSpecifier = declaration.kind === 255 /* ImportDeclaration */ ? declaration.moduleSpecifier : + declaration.kind === 243 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : + declaration.moduleReference.kind === 266 /* ExternalModuleReference */ ? declaration.moduleReference.expression : undefined; return moduleSpecifier && ts.isStringLiteral(moduleSpecifier) ? { kind: 3 /* AddNew */, moduleSpecifier: moduleSpecifier.text, importKind: importKind, typeOnly: preferTypeOnlyImport, useRequire: useRequire } @@ -129480,7 +130033,7 @@ var ts; } } function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, canUseTypeOnlyImport) { - if (clause.kind === 189 /* ObjectBindingPattern */) { + if (clause.kind === 190 /* ObjectBindingPattern */) { if (defaultImport) { addElementToBindingPattern(clause, defaultImport, "default"); } @@ -129590,9 +130143,9 @@ var ts; } function forEachExternalModuleToImportFrom(program, host, from, filterByPackageJson, cb) { var filteredCount = 0; - var packageJson = filterByPackageJson && createAutoImportFilter(from, program, host); + var moduleSpecifierResolutionHost = createModuleSpecifierResolutionHost(program, host); + var packageJson = filterByPackageJson && createAutoImportFilter(from, program, host, moduleSpecifierResolutionHost); var allSourceFiles = program.getSourceFiles(); - var globalTypingsCache = host.getGlobalTypingsCacheLocation && host.getGlobalTypingsCacheLocation(); forEachExternalModule(program.getTypeChecker(), allSourceFiles, function (module, sourceFile) { if (sourceFile === undefined) { if (!packageJson || packageJson.allowsImportingAmbientModule(module, allSourceFiles)) { @@ -129604,7 +130157,7 @@ var ts; } else if (sourceFile && sourceFile !== from && - isImportablePath(from.fileName, sourceFile.fileName, ts.hostGetCanonicalFileName(host), globalTypingsCache)) { + isImportableFile(program, from, sourceFile, moduleSpecifierResolutionHost)) { if (!packageJson || packageJson.allowsImportingSourceFile(sourceFile, allSourceFiles)) { cb(module); } @@ -129630,6 +130183,19 @@ var ts; } } } + function isImportableFile(program, from, to, moduleSpecifierResolutionHost) { + var _a; + var getCanonicalFileName = ts.hostGetCanonicalFileName(moduleSpecifierResolutionHost); + var globalTypingsCache = (_a = moduleSpecifierResolutionHost.getGlobalTypingsCacheLocation) === null || _a === void 0 ? void 0 : _a.call(moduleSpecifierResolutionHost); + return !!ts.moduleSpecifiers.forEachFileNameOfModule(program.getSourceFiles(), from.fileName, to.fileName, ts.hostGetCanonicalFileName(moduleSpecifierResolutionHost), moduleSpecifierResolutionHost, program.redirectTargetsMap, + /*preferSymlinks*/ false, function (toPath) { + var toFile = program.getSourceFile(toPath); + // Determine to import using toPath only if toPath is what we were looking at + // or there doesnt exist the file in the program by the symlink + return (toFile === to || !toFile) && + isImportablePath(from.fileName, toPath, getCanonicalFileName, globalTypingsCache); + }); + } /** * Don't include something from a `node_modules` that isn't actually reachable by a global import. * A relative import to node_modules is usually a bad idea. @@ -129673,12 +130239,10 @@ var ts; return !ts.isStringANonContextualKeyword(res) ? res || "_" : "_" + res; } codefix.moduleSpecifierToValidIdentifier = moduleSpecifierToValidIdentifier; - function createAutoImportFilter(fromFile, program, host) { - var packageJsons = host.getPackageJsonsVisibleToFile && host.getPackageJsonsVisibleToFile(fromFile.fileName) || ts.getPackageJsonsVisibleToFile(fromFile.fileName, host); - var dependencyGroups = 1 /* Dependencies */ | 2 /* DevDependencies */ | 8 /* OptionalDependencies */; + function createModuleSpecifierResolutionHost(program, host) { // Mix in `getProbablySymlinks` from Program when host doesn't have it // in order for non-Project hosts to have a symlinks cache. - var moduleSpecifierResolutionHost = { + return { directoryExists: ts.maybeBind(host, host.directoryExists), fileExists: ts.maybeBind(host, host.fileExists), getCurrentDirectory: ts.maybeBind(host, host.getCurrentDirectory), @@ -129687,8 +130251,13 @@ var ts; getProbableSymlinks: ts.maybeBind(host, host.getProbableSymlinks) || program.getProbableSymlinks, getGlobalTypingsCacheLocation: ts.maybeBind(host, host.getGlobalTypingsCacheLocation), }; + } + function createAutoImportFilter(fromFile, program, host, moduleSpecifierResolutionHost) { + if (moduleSpecifierResolutionHost === void 0) { moduleSpecifierResolutionHost = createModuleSpecifierResolutionHost(program, host); } + var packageJsons = host.getPackageJsonsVisibleToFile && host.getPackageJsonsVisibleToFile(fromFile.fileName) || ts.getPackageJsonsVisibleToFile(fromFile.fileName, host); + var dependencyGroups = 1 /* Dependencies */ | 2 /* DevDependencies */ | 8 /* OptionalDependencies */; var usesNodeCoreModules; - return { allowsImportingAmbientModule: allowsImportingAmbientModule, allowsImportingSourceFile: allowsImportingSourceFile, allowsImportingSpecifier: allowsImportingSpecifier }; + return { allowsImportingAmbientModule: allowsImportingAmbientModule, allowsImportingSourceFile: allowsImportingSourceFile, allowsImportingSpecifier: allowsImportingSpecifier, moduleSpecifierResolutionHost: moduleSpecifierResolutionHost }; function moduleSpecifierIsCoveredByPackageJson(specifier) { var packageName = getNodeModuleRootSpecifier(specifier); for (var _i = 0, packageJsons_1 = packageJsons; _i < packageJsons_1.length; _i++) { @@ -129960,7 +130529,7 @@ var ts; } else { var typeNode = getTypeNode(program.getTypeChecker(), parentDeclaration, token); - addPropertyDeclaration(changes, declSourceFile, parentDeclaration, token.text, typeNode, makeStatic); + addPropertyDeclaration(changes, declSourceFile, parentDeclaration, token.text, typeNode, makeStatic ? 32 /* Static */ : 0); } } }; @@ -130040,7 +130609,7 @@ var ts; function addMissingMemberInJs(changeTracker, declSourceFile, classDeclaration, token, makeStatic) { var tokenName = token.text; if (makeStatic) { - if (classDeclaration.kind === 214 /* ClassExpression */) { + if (classDeclaration.kind === 215 /* ClassExpression */) { return; } var className = classDeclaration.name.getText(); @@ -130076,12 +130645,19 @@ var ts; } function getActionsForAddMissingMemberInTypeScriptFile(context, declSourceFile, classDeclaration, token, makeStatic) { var typeNode = getTypeNode(context.program.getTypeChecker(), classDeclaration, token); - var addProp = createAddPropertyDeclarationAction(context, declSourceFile, classDeclaration, makeStatic, token.text, typeNode); - return makeStatic || ts.isPrivateIdentifier(token) ? [addProp] : [addProp, createAddIndexSignatureAction(context, declSourceFile, classDeclaration, token.text, typeNode)]; + var actions = [createAddPropertyDeclarationAction(context, declSourceFile, classDeclaration, token.text, typeNode, makeStatic ? 32 /* Static */ : 0)]; + if (makeStatic || ts.isPrivateIdentifier(token)) { + return actions; + } + if (ts.startsWithUnderscore(token.text)) { + actions.unshift(createAddPropertyDeclarationAction(context, declSourceFile, classDeclaration, token.text, typeNode, 8 /* Private */)); + } + actions.push(createAddIndexSignatureAction(context, declSourceFile, classDeclaration, token.text, typeNode)); + return actions; } function getTypeNode(checker, classDeclaration, token) { var typeNode; - if (token.parent.parent.kind === 209 /* BinaryExpression */) { + if (token.parent.parent.kind === 210 /* BinaryExpression */) { var binaryExpression = token.parent.parent; var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); @@ -130093,14 +130669,17 @@ var ts; } return typeNode || ts.createKeywordTypeNode(125 /* AnyKeyword */); } - function createAddPropertyDeclarationAction(context, declSourceFile, classDeclaration, makeStatic, tokenName, typeNode) { - var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addPropertyDeclaration(t, declSourceFile, classDeclaration, tokenName, typeNode, makeStatic); }); - return codefix.createCodeFixAction(fixName, changes, [makeStatic ? ts.Diagnostics.Declare_static_property_0 : ts.Diagnostics.Declare_property_0, tokenName], fixId, ts.Diagnostics.Add_all_missing_members); + function createAddPropertyDeclarationAction(context, declSourceFile, classDeclaration, tokenName, typeNode, modifierFlags) { + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addPropertyDeclaration(t, declSourceFile, classDeclaration, tokenName, typeNode, modifierFlags); }); + if (modifierFlags & 8 /* Private */) { + return codefix.createCodeFixActionWithoutFixAll(fixName, changes, [ts.Diagnostics.Declare_private_property_0, tokenName]); + } + return codefix.createCodeFixAction(fixName, changes, [modifierFlags & 32 /* Static */ ? ts.Diagnostics.Declare_static_property_0 : ts.Diagnostics.Declare_property_0, tokenName], fixId, ts.Diagnostics.Add_all_missing_members); } - function addPropertyDeclaration(changeTracker, declSourceFile, classDeclaration, tokenName, typeNode, makeStatic) { + function addPropertyDeclaration(changeTracker, declSourceFile, classDeclaration, tokenName, typeNode, modifierFlags) { var property = ts.createProperty( /*decorators*/ undefined, - /*modifiers*/ makeStatic ? [ts.createToken(120 /* StaticKeyword */)] : undefined, tokenName, + /*modifiers*/ modifierFlags ? ts.createNodeArray(ts.createModifiersFromModifierFlags(modifierFlags)) : undefined, tokenName, /*questionToken*/ undefined, typeNode, /*initializer*/ undefined); var lastProp = getNodeToInsertPropertyAfter(classDeclaration); @@ -130124,7 +130703,7 @@ var ts; } function createAddIndexSignatureAction(context, declSourceFile, classDeclaration, tokenName, typeNode) { // Index signatures cannot have the static modifier. - var stringTypeNode = ts.createKeywordTypeNode(143 /* StringKeyword */); + var stringTypeNode = ts.createKeywordTypeNode(144 /* StringKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -130148,7 +130727,7 @@ var ts; } function addMethodDeclaration(context, changeTracker, declSourceFile, typeDecl, token, callExpression, makeStatic, inJs, preferences) { var methodDeclaration = codefix.createMethodFromCallExpression(context, callExpression, token.text, inJs, makeStatic, preferences, typeDecl); - var containingMethodDeclaration = ts.getAncestor(callExpression, 161 /* MethodDeclaration */); + var containingMethodDeclaration = ts.getAncestor(callExpression, 162 /* MethodDeclaration */); if (containingMethodDeclaration && containingMethodDeclaration.parent === typeDecl) { changeTracker.insertNodeAfter(declSourceFile, containingMethodDeclaration, methodDeclaration); } @@ -130167,7 +130746,10 @@ var ts; return !!(type && type.flags & 132 /* StringLike */); }); var enumMember = ts.createEnumMember(token, hasStringInitializer ? ts.createStringLiteral(token.text) : undefined); - changes.replaceNode(enumDeclaration.getSourceFile(), enumDeclaration, ts.updateEnumDeclaration(enumDeclaration, enumDeclaration.decorators, enumDeclaration.modifiers, enumDeclaration.name, ts.concatenate(enumDeclaration.members, ts.singleElementArray(enumMember)))); + changes.replaceNode(enumDeclaration.getSourceFile(), enumDeclaration, ts.updateEnumDeclaration(enumDeclaration, enumDeclaration.decorators, enumDeclaration.modifiers, enumDeclaration.name, ts.concatenate(enumDeclaration.members, ts.singleElementArray(enumMember))), { + leadingTriviaOption: ts.textChanges.LeadingTriviaOption.IncludeAll, + trailingTriviaOption: ts.textChanges.TrailingTriviaOption.Exclude + }); } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); @@ -130212,7 +130794,7 @@ var ts; (function (codefix) { var fixName = "fixCannotFindModule"; var fixIdInstallTypesPackage = "installTypesPackage"; - var errorCodeCannotFindModule = ts.Diagnostics.Cannot_find_module_0.code; + var errorCodeCannotFindModule = ts.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations.code; var errorCodes = [ errorCodeCannotFindModule, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code, @@ -130704,7 +131286,7 @@ var ts; return [createDeleteFix(delVar, ts.Diagnostics.Remove_variable_statement)]; } var result = []; - if (token.kind === 132 /* InferKeyword */) { + if (token.kind === 133 /* InferKeyword */) { var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return changeInferToUnknown(t, sourceFile, token); }); var name = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name.text; result.push(codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Replace_infer_0_with_unknown, name], fixIdInfer, ts.Diagnostics.Replace_all_unused_infer_with_unknown)); @@ -130736,7 +131318,7 @@ var ts; tryPrefixDeclaration(changes, diag.code, sourceFile, token); break; case fixIdDelete: { - if (token.kind === 132 /* InferKeyword */) + if (token.kind === 133 /* InferKeyword */) break; // Can't delete var importDecl = tryGetFullImport(token); if (importDecl) { @@ -130755,7 +131337,7 @@ var ts; break; } case fixIdInfer: - if (token.kind === 132 /* InferKeyword */) { + if (token.kind === 133 /* InferKeyword */) { changeInferToUnknown(changes, sourceFile, token); } break; @@ -130766,7 +131348,7 @@ var ts; }, }); function changeInferToUnknown(changes, sourceFile, token) { - changes.replaceNode(sourceFile, token.parent, ts.createKeywordTypeNode(148 /* UnknownKeyword */)); + changes.replaceNode(sourceFile, token.parent, ts.createKeywordTypeNode(149 /* UnknownKeyword */)); } function createDeleteFix(changes, diag) { return codefix.createCodeFixAction(fixName, changes, diag, fixIdDelete, ts.Diagnostics.Delete_all_unused_declarations); @@ -130782,7 +131364,7 @@ var ts; if (token.kind !== 18 /* OpenBraceToken */ || !ts.isObjectBindingPattern(token.parent)) return false; var decl = token.parent.parent; - if (decl.kind === 156 /* Parameter */) { + if (decl.kind === 157 /* Parameter */) { tryDeleteParameter(changes, sourceFile, decl, checker, sourceFiles, isFixAll); } else { @@ -130793,7 +131375,7 @@ var ts; function tryDeleteFullVariableStatement(sourceFile, token, changes) { var declarationList = ts.tryCast(token.parent, ts.isVariableDeclarationList); if (declarationList && declarationList.getChildren(sourceFile)[0] === token) { - changes.delete(sourceFile, declarationList.parent.kind === 225 /* VariableStatement */ ? declarationList.parent : declarationList); + changes.delete(sourceFile, declarationList.parent.kind === 226 /* VariableStatement */ ? declarationList.parent : declarationList); return true; } return false; @@ -130802,7 +131384,7 @@ var ts; // Don't offer to prefix a property. if (errorCode === ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code) return; - if (token.kind === 132 /* InferKeyword */) { + if (token.kind === 133 /* InferKeyword */) { token = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name; } if (ts.isIdentifier(token) && canPrefix(token)) { @@ -130811,14 +131393,14 @@ var ts; } function canPrefix(token) { switch (token.parent.kind) { - case 156 /* Parameter */: - case 155 /* TypeParameter */: + case 157 /* Parameter */: + case 156 /* TypeParameter */: return true; - case 242 /* VariableDeclaration */: { + case 243 /* VariableDeclaration */: { var varDecl = token.parent; switch (varDecl.parent.parent.kind) { - case 232 /* ForOfStatement */: - case 231 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 232 /* ForInStatement */: return true; } } @@ -130865,17 +131447,17 @@ var ts; function mayDeleteParameter(p, checker, isFixAll) { var parent = p.parent; switch (parent.kind) { - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: // Don't remove a parameter if this overrides something. var symbol = checker.getSymbolAtLocation(parent.name); if (ts.isMemberSymbolInBaseType(symbol, checker)) return false; // falls through - case 162 /* Constructor */: - case 244 /* FunctionDeclaration */: + case 163 /* Constructor */: + case 245 /* FunctionDeclaration */: return true; - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: { + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: { // Can't remove a non-last parameter in a callback. Can remove a parameter in code-fix-all if future parameters are also unused. var parameters = parent.parameters; var index = parameters.indexOf(p); @@ -130884,7 +131466,7 @@ var ts; ? parameters.slice(index + 1).every(function (p) { return p.name.kind === 75 /* Identifier */ && !p.symbol.isReferenced; }) : index === parameters.length - 1; } - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: // Setter must have a parameter return false; default: @@ -130933,7 +131515,7 @@ var ts; var container = (ts.isBlock(statement.parent) ? statement.parent : statement).parent; if (!ts.isBlock(statement.parent) || statement === ts.first(statement.parent.statements)) { switch (container.kind) { - case 227 /* IfStatement */: + case 228 /* IfStatement */: if (container.elseStatement) { if (ts.isBlock(statement.parent)) { break; @@ -130944,8 +131526,8 @@ var ts; return; } // falls through - case 229 /* WhileStatement */: - case 230 /* ForStatement */: + case 230 /* WhileStatement */: + case 231 /* ForStatement */: changes.delete(sourceFile, container); return; } @@ -131018,7 +131600,7 @@ var ts; var typeNode = info.typeNode, type = info.type; var original = typeNode.getText(sourceFile); var actions = [fix(type, fixIdPlain, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)]; - if (typeNode.kind === 297 /* JSDocNullableType */) { + if (typeNode.kind === 298 /* JSDocNullableType */) { // for nullable types, suggest the flow-compatible `T | null | undefined` // in addition to the jsdoc/closure-compatible `T | null` actions.push(fix(checker.getNullableType(type, 32768 /* Undefined */), fixIdNullable, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)); @@ -131038,7 +131620,7 @@ var ts; if (!info) return; var typeNode = info.typeNode, type = info.type; - var fixedType = typeNode.kind === 297 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; + var fixedType = typeNode.kind === 298 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; doChange(changes, sourceFile, typeNode, fixedType, checker); }); } @@ -131055,22 +131637,22 @@ var ts; // NOTE: Some locations are not handled yet: // MappedTypeNode.typeParameters and SignatureDeclaration.typeParameters, as well as CallExpression.typeArguments switch (node.kind) { - case 217 /* AsExpression */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 244 /* FunctionDeclaration */: - case 163 /* GetAccessor */: - case 167 /* IndexSignature */: - case 186 /* MappedType */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 156 /* Parameter */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 164 /* SetAccessor */: - case 247 /* TypeAliasDeclaration */: - case 199 /* TypeAssertionExpression */: - case 242 /* VariableDeclaration */: + case 218 /* AsExpression */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 245 /* FunctionDeclaration */: + case 164 /* GetAccessor */: + case 168 /* IndexSignature */: + case 187 /* MappedType */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 157 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 165 /* SetAccessor */: + case 248 /* TypeAliasDeclaration */: + case 200 /* TypeAssertionExpression */: + case 243 /* VariableDeclaration */: return true; default: return false; @@ -131080,6 +131662,51 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "fixMissingCallParentheses"; + var errorCodes = [ + ts.Diagnostics.This_condition_will_always_return_true_since_the_function_is_always_defined_Did_you_mean_to_call_it_instead.code, + ]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + fixIds: [fixId], + getCodeActions: function (context) { + var sourceFile = context.sourceFile, span = context.span; + var callName = getCallName(sourceFile, span.start); + if (!callName) + return; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, callName); }); + return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_missing_call_parentheses, fixId, ts.Diagnostics.Add_all_missing_call_parentheses)]; + }, + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var callName = getCallName(diag.file, diag.start); + if (callName) + doChange(changes, diag.file, callName); + }); } + }); + function doChange(changes, sourceFile, name) { + changes.replaceNodeWithText(sourceFile, name, name.text + "()"); + } + function getCallName(sourceFile, start) { + var token = ts.getTokenAtPosition(sourceFile, start); + if (ts.isPropertyAccessExpression(token.parent)) { + var current = token.parent; + while (ts.isPropertyAccessExpression(current.parent)) { + current = current.parent; + } + return current.name; + } + if (ts.isIdentifier(token)) { + return token; + } + return undefined; + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var codefix; (function (codefix) { @@ -131127,14 +131754,14 @@ var ts; } var insertBefore; switch (containingFunction.kind) { - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: insertBefore = containingFunction.name; break; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: insertBefore = ts.findChildOfKind(containingFunction, 94 /* FunctionKeyword */, sourceFile); break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: insertBefore = ts.findChildOfKind(containingFunction, 20 /* OpenParenToken */, sourceFile) || ts.first(containingFunction.parameters); break; default: @@ -131265,8 +131892,8 @@ var ts; var optional = !!(symbol.flags & 16777216 /* Optional */); var ambient = !!(enclosingDeclaration.flags & 8388608 /* Ambient */); switch (declaration.kind) { - case 158 /* PropertySignature */: - case 159 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 160 /* PropertyDeclaration */: var flags = preferences.quotePreference === "single" ? 268435456 /* UseSingleQuotesForStringLiteralType */ : undefined; var typeNode = checker.typeToTypeNode(type, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context)); if (importAdder) { @@ -131280,8 +131907,8 @@ var ts; /*decorators*/ undefined, modifiers, name, optional ? ts.createToken(57 /* QuestionToken */) : undefined, typeNode, /*initializer*/ undefined)); break; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: { + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: { var typeNode_1 = checker.typeToTypeNode(type, enclosingDeclaration, /*flags*/ undefined, getNoopSymbolTrackerWithResolver(context)); var allAccessors = ts.getAllAccessorDeclarations(declarations, declaration); var orderedAccessors = allAccessors.secondAccessor @@ -131310,8 +131937,8 @@ var ts; } break; } - case 160 /* MethodSignature */: - case 161 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 162 /* MethodDeclaration */: // The signature for the implementation appears as an entry in `signatures` iff // there is only one signature. // If there are overloads and an implementation signature, it appears as an @@ -131356,7 +131983,7 @@ var ts; var program = context.program; var checker = program.getTypeChecker(); var scriptTarget = ts.getEmitScriptTarget(program.getCompilerOptions()); - var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 161 /* MethodDeclaration */, enclosingDeclaration, 1 /* NoTruncation */ | 256 /* SuppressAnyReturnType */, getNoopSymbolTrackerWithResolver(context)); + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 162 /* MethodDeclaration */, enclosingDeclaration, 1 /* NoTruncation */ | 256 /* SuppressAnyReturnType */, getNoopSymbolTrackerWithResolver(context)); if (!signatureDeclaration) { return undefined; } @@ -131618,7 +132245,7 @@ var ts; }); function getActionsForUsageOfInvalidImport(context) { var sourceFile = context.sourceFile; - var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 196 /* CallExpression */ : 197 /* NewExpression */; + var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 197 /* CallExpression */ : 198 /* NewExpression */; var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start), function (a) { return a.kind === targetKind; }); if (!node) { return []; @@ -131737,7 +132364,7 @@ var ts; return codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Add_undefined_type_to_property_0, propertyDeclaration.name.getText()], fixIdAddUndefinedType, ts.Diagnostics.Add_undefined_type_to_all_uninitialized_properties); } function addUndefinedType(changeTracker, propertyDeclarationSourceFile, propertyDeclaration) { - var undefinedTypeNode = ts.createKeywordTypeNode(146 /* UndefinedKeyword */); + var undefinedTypeNode = ts.createKeywordTypeNode(147 /* UndefinedKeyword */); var type = propertyDeclaration.type; // TODO: GH#18217 var types = ts.isUnionTypeNode(type) ? type.types.concat(undefinedTypeNode) : [type, undefinedTypeNode]; changeTracker.replaceNode(propertyDeclarationSourceFile, type, ts.createUnionTypeNode(types)); @@ -131913,7 +132540,7 @@ var ts; function getImportTypeNode(sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos); ts.Debug.assert(token.kind === 96 /* ImportKeyword */, "This token should be an ImportKeyword"); - ts.Debug.assert(token.parent.kind === 188 /* ImportType */, "Token parent should be an ImportType"); + ts.Debug.assert(token.parent.kind === 189 /* ImportType */, "Token parent should be an ImportType"); return token.parent; } function doChange(changes, sourceFile, importType) { @@ -131965,7 +132592,7 @@ var ts; var otherMembers = members.filter(function (member) { return !ts.isIndexSignatureDeclaration(member); }); var parameter = ts.first(indexSignature.parameters); var mappedTypeParameter = ts.createTypeParameterDeclaration(ts.cast(parameter.name, ts.isIdentifier), parameter.type); - var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(138 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); + var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(139 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); var intersectionType = ts.createIntersectionTypeNode(__spreadArrays(ts.getAllSuperTypeNodes(container), [ mappedIntersectionType ], (otherMembers.length ? [ts.createTypeLiteralNode(otherMembers)] : ts.emptyArray))); @@ -132089,6 +132716,46 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "fixExpectedComma"; + var expectedErrorCode = ts.Diagnostics._0_expected.code; + var errorCodes = [expectedErrorCode]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var info = getInfo(sourceFile, context.span.start, context.errorCode); + if (!info) { + return undefined; + } + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, info); }); + return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Change_0_to_1, ";", ","], fixId, [ts.Diagnostics.Change_0_to_1, ";", ","])]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var info = getInfo(diag.file, diag.start, diag.code); + if (info) + doChange(changes, context.sourceFile, info); + }); }, + }); + function getInfo(sourceFile, pos, _) { + var node = ts.getTokenAtPosition(sourceFile, pos); + return (node.kind === 26 /* SemicolonToken */ && + node.parent && + (ts.isObjectLiteralExpression(node.parent) || + ts.isArrayLiteralExpression(node.parent))) ? { node: node } : undefined; + } + function doChange(changes, sourceFile, _a) { + var node = _a.node; + var newNode = ts.createNode(27 /* CommaToken */); + changes.replaceNode(sourceFile, node, newNode); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var refactor; (function (refactor) { @@ -132126,16 +132793,16 @@ var ts; return undefined; } switch (exportNode.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 249 /* ModuleDeclaration */: { + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 250 /* ModuleDeclaration */: { var node = exportNode; return node.name && ts.isIdentifier(node.name) ? { exportNode: node, exportName: node.name, wasDefault: wasDefault, exportingModuleSymbol: exportingModuleSymbol } : undefined; } - case 225 /* VariableStatement */: { + case 226 /* VariableStatement */: { var vs = exportNode; // Must be `export const x = something;`. if (!(vs.declarationList.flags & 2 /* Const */) || vs.declarationList.declarations.length !== 1) { @@ -132163,12 +132830,12 @@ var ts; else { var exportKeyword = ts.Debug.checkDefined(ts.findModifier(exportNode, 89 /* ExportKeyword */), "Should find an export keyword in modifier list"); switch (exportNode.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: changes.insertNodeAfter(exportingSourceFile, exportKeyword, ts.createToken(84 /* DefaultKeyword */)); break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // If 'x' isn't used in this file, `export const x = 0;` --> `export default 0;` if (!ts.FindAllReferences.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile)) { // We checked in `getInfo` that an initializer exists. @@ -132176,9 +132843,9 @@ var ts; break; } // falls through - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 249 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 250 /* ModuleDeclaration */: // `export type T = number;` -> `type T = number; export default T;` changes.deleteModifier(exportingSourceFile, exportKeyword); changes.insertNodeAfter(exportingSourceFile, exportNode, ts.createExportDefault(ts.createIdentifier(exportName.text))); @@ -132205,18 +132872,18 @@ var ts; function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) { var parent = ref.parent; switch (parent.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: // `a.default` --> `a.foo` changes.replaceNode(importingSourceFile, ref, ts.createIdentifier(exportName)); break; - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: { + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: { var spec = parent; // `default as foo` --> `foo`, `default as bar` --> `foo as bar` changes.replaceNode(importingSourceFile, spec, makeImportSpecifier(exportName, spec.name.text)); break; } - case 255 /* ImportClause */: { + case 256 /* ImportClause */: { var clause = parent; ts.Debug.assert(clause.name === ref, "Import clause name should match provided ref"); var spec = makeImportSpecifier(exportName, ref.text); @@ -132225,7 +132892,7 @@ var ts; // `import foo from "./a";` --> `import { foo } from "./a";` changes.replaceNode(importingSourceFile, ref, ts.createNamedImports([spec])); } - else if (namedBindings.kind === 256 /* NamespaceImport */) { + else if (namedBindings.kind === 257 /* NamespaceImport */) { // `import foo, * as a from "./a";` --> `import * as a from ".a/"; import { foo } from "./a";` changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) }); var quotePreference = ts.isStringLiteral(clause.parent.moduleSpecifier) ? ts.quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : 1 /* Double */; @@ -132246,11 +132913,11 @@ var ts; function changeNamedToDefaultImport(importingSourceFile, ref, changes) { var parent = ref.parent; switch (parent.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: // `a.foo` --> `a.default` changes.replaceNode(importingSourceFile, ref, ts.createIdentifier("default")); break; - case 258 /* ImportSpecifier */: { + case 259 /* ImportSpecifier */: { // `import { foo } from "./a";` --> `import foo from "./a";` // `import { foo as bar } from "./a";` --> `import bar from "./a";` var defaultImport = ts.createIdentifier(parent.name.text); @@ -132263,7 +132930,7 @@ var ts; } break; } - case 263 /* ExportSpecifier */: { + case 264 /* ExportSpecifier */: { // `export { foo } from "./a";` --> `export { default as foo } from "./a";` // `export { foo as bar } from "./a";` --> `export { default as bar } from "./a";` // `export { foo as default } from "./a";` --> `export { default } from "./a";` @@ -132296,8 +132963,8 @@ var ts; var i = getImportToConvert(context); if (!i) return ts.emptyArray; - var description = i.kind === 256 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; - var actionName = i.kind === 256 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; + var description = i.kind === 257 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; + var actionName = i.kind === 257 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; return [{ name: refactorName, description: description, actions: [{ name: actionName, description: description }] }]; }, getEditsForAction: function (context, actionName) { @@ -132319,7 +132986,7 @@ var ts; } function doChange(sourceFile, program, changes, toConvert) { var checker = program.getTypeChecker(); - if (toConvert.kind === 256 /* NamespaceImport */) { + if (toConvert.kind === 257 /* NamespaceImport */) { doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())); } else { @@ -132666,20 +133333,20 @@ var ts; function checkForStaticContext(nodeToCheck, containingClass) { var current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 159 /* PropertyDeclaration */) { + if (current.kind === 160 /* PropertyDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 156 /* Parameter */) { + else if (current.kind === 157 /* Parameter */) { var ctorOrMethod = ts.getContainingFunction(current); - if (ctorOrMethod.kind === 162 /* Constructor */) { + if (ctorOrMethod.kind === 163 /* Constructor */) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 161 /* MethodDeclaration */) { + else if (current.kind === 162 /* MethodDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } @@ -132722,7 +133389,7 @@ var ts; return true; } if (ts.isDeclaration(node)) { - var declaringNode = (node.kind === 242 /* VariableDeclaration */) ? node.parent.parent : node; + var declaringNode = (node.kind === 243 /* VariableDeclaration */) ? node.parent.parent : node; if (ts.hasModifier(declaringNode, 1 /* Export */)) { // TODO: GH#18217 Silly to use `errors ||` since it's definitely not defined (see top of `visit`) // Also, if we're only pushing one error, just use `let error: Diagnostic | undefined`! @@ -132734,13 +133401,13 @@ var ts; } // Some things can't be extracted in certain situations switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractImport)); return true; case 102 /* SuperKeyword */: // For a super *constructor call*, we have to be extracting the entire class, // but a super *method call* simply implies a 'this' reference - if (node.parent.kind === 196 /* CallExpression */) { + if (node.parent.kind === 197 /* CallExpression */) { // Super constructor call var containingClass_1 = ts.getContainingClass(node); // TODO:GH#18217 if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { @@ -132755,8 +133422,8 @@ var ts; } if (ts.isFunctionLikeDeclaration(node) || ts.isClassLike(node)) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: if (ts.isSourceFile(node.parent) && node.parent.externalModuleIndicator === undefined) { // You cannot extract global declarations (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); @@ -132768,21 +133435,21 @@ var ts; } var savedPermittedJumps = permittedJumps; switch (node.kind) { - case 227 /* IfStatement */: + case 228 /* IfStatement */: permittedJumps = 0 /* None */; break; - case 240 /* TryStatement */: + case 241 /* TryStatement */: // forbid all jumps inside try blocks permittedJumps = 0 /* None */; break; - case 223 /* Block */: - if (node.parent && node.parent.kind === 240 /* TryStatement */ && node.parent.finallyBlock === node) { + case 224 /* Block */: + if (node.parent && node.parent.kind === 241 /* TryStatement */ && node.parent.finallyBlock === node) { // allow unconditional returns from finally blocks permittedJumps = 4 /* Return */; } break; - case 278 /* DefaultClause */: - case 277 /* CaseClause */: + case 279 /* DefaultClause */: + case 278 /* CaseClause */: // allow unlabeled break inside case clauses permittedJumps |= 1 /* Break */; break; @@ -132794,19 +133461,19 @@ var ts; break; } switch (node.kind) { - case 183 /* ThisType */: + case 184 /* ThisType */: case 104 /* ThisKeyword */: rangeFacts |= RangeFacts.UsesThis; break; - case 238 /* LabeledStatement */: { + case 239 /* LabeledStatement */: { var label = node.label; (seenLabels || (seenLabels = [])).push(label.escapedText); ts.forEachChild(node, visit); seenLabels.pop(); break; } - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: { + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: { var label = node.label; if (label) { if (!ts.contains(seenLabels, label.escapedText)) { @@ -132815,20 +133482,20 @@ var ts; } } else { - if (!(permittedJumps & (node.kind === 234 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + if (!(permittedJumps & (node.kind === 235 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { // attempt to break or continue in a forbidden context (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: rangeFacts |= RangeFacts.IsAsyncFunction; break; - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: rangeFacts |= RangeFacts.IsGenerator; break; - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: if (permittedJumps & 4 /* Return */) { rangeFacts |= RangeFacts.HasReturn; } @@ -132882,7 +133549,7 @@ var ts; while (true) { current = current.parent; // A function parameter's initializer is actually in the outer scope, not the function declaration - if (current.kind === 156 /* Parameter */) { + if (current.kind === 157 /* Parameter */) { // Skip all the way to the outer scope of the function that declared this parameter current = ts.findAncestor(current, function (parent) { return ts.isFunctionLikeDeclaration(parent); }).parent; } @@ -132893,7 +133560,7 @@ var ts; // * Module/namespace or source file if (isScope(current)) { scopes.push(current); - if (current.kind === 290 /* SourceFile */) { + if (current.kind === 291 /* SourceFile */) { return scopes; } } @@ -132983,32 +133650,32 @@ var ts; } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: return "constructor"; - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: return scope.name ? "function '" + scope.name.text + "'" : "anonymous function"; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return "arrow function"; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return "method '" + scope.name.getText() + "'"; - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: return "'get " + scope.name.getText() + "'"; - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: return "'set " + scope.name.getText() + "'"; default: throw ts.Debug.assertNever(scope, "Unexpected scope kind " + scope.kind); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 245 /* ClassDeclaration */ + return scope.kind === 246 /* ClassDeclaration */ ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration" : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 250 /* ModuleBlock */ + return scope.kind === 251 /* ModuleBlock */ ? "namespace '" + scope.parent.name.getText() + "'" : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } @@ -133228,9 +133895,9 @@ var ts; while (ts.isParenthesizedTypeNode(withoutParens)) { withoutParens = withoutParens.type; } - return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 146 /* UndefinedKeyword */; }) + return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 147 /* UndefinedKeyword */; }) ? clone - : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(146 /* UndefinedKeyword */)]); + : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(147 /* UndefinedKeyword */)]); } } /** @@ -133259,7 +133926,7 @@ var ts; if (rangeFacts & RangeFacts.InStaticRegion) { modifiers.push(ts.createToken(120 /* StaticKeyword */)); } - modifiers.push(ts.createToken(138 /* ReadonlyKeyword */)); + modifiers.push(ts.createToken(139 /* ReadonlyKeyword */)); var newVariable = ts.createProperty( /*decorators*/ undefined, modifiers, localNameText, /*questionToken*/ undefined, variableType, initializer); @@ -133288,7 +133955,7 @@ var ts; var localReference = ts.createIdentifier(localNameText); changeTracker.replaceNode(context.file, node, localReference); } - else if (node.parent.kind === 226 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { + else if (node.parent.kind === 227 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { // If the parent is an expression statement and the target scope is the immediately enclosing one, // replace the statement with the declaration. var newVariableStatement = ts.createVariableStatement( @@ -133307,7 +133974,7 @@ var ts; changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false); } // Consume - if (node.parent.kind === 226 /* ExpressionStatement */) { + if (node.parent.kind === 227 /* ExpressionStatement */) { // If the parent is an expression statement, delete it. changeTracker.delete(context.file, node.parent); } @@ -133451,7 +134118,7 @@ var ts; return { body: ts.createBlock(statements, /*multiLine*/ true), returnValueProperty: undefined }; } function visitor(node) { - if (!ignoreReturns && node.kind === 235 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { + if (!ignoreReturns && node.kind === 236 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { var assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); if (node.expression) { if (!returnValueProperty) { @@ -133629,7 +134296,7 @@ var ts; var scope = scopes_1[_i]; usagesPerScope.push({ usages: ts.createMap(), typeParameterUsages: ts.createMap(), substitutions: ts.createMap() }); substitutionsPerScope.push(ts.createMap()); - functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 244 /* FunctionDeclaration */ + functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 245 /* FunctionDeclaration */ ? [ts.createDiagnosticForNode(scope, Messages.cannotExtractToOtherFunctionLike)] : []); var constantErrors = []; @@ -133945,30 +134612,30 @@ var ts; function isExtractableExpression(node) { var parent = node.parent; switch (parent.kind) { - case 284 /* EnumMember */: + case 285 /* EnumMember */: return false; } switch (node.kind) { case 10 /* StringLiteral */: - return parent.kind !== 254 /* ImportDeclaration */ && - parent.kind !== 258 /* ImportSpecifier */; - case 213 /* SpreadElement */: - case 189 /* ObjectBindingPattern */: - case 191 /* BindingElement */: + return parent.kind !== 255 /* ImportDeclaration */ && + parent.kind !== 259 /* ImportSpecifier */; + case 214 /* SpreadElement */: + case 190 /* ObjectBindingPattern */: + case 192 /* BindingElement */: return false; case 75 /* Identifier */: - return parent.kind !== 191 /* BindingElement */ && - parent.kind !== 258 /* ImportSpecifier */ && - parent.kind !== 263 /* ExportSpecifier */; + return parent.kind !== 192 /* BindingElement */ && + parent.kind !== 259 /* ImportSpecifier */ && + parent.kind !== 264 /* ExportSpecifier */; } return true; } function isBlockLike(node) { switch (node.kind) { - case 223 /* Block */: - case 290 /* SourceFile */: - case 250 /* ModuleBlock */: - case 277 /* CaseClause */: + case 224 /* Block */: + case 291 /* SourceFile */: + case 251 /* ModuleBlock */: + case 278 /* CaseClause */: return true; default: return false; @@ -134132,7 +134799,7 @@ var ts; } function doTypedefChange(changes, file, name, info) { var firstStatement = info.firstStatement, selection = info.selection, typeParameters = info.typeParameters; - var node = ts.createNode(322 /* JSDocTypedefTag */); + var node = ts.createNode(323 /* JSDocTypedefTag */); node.tagName = ts.createIdentifier("typedef"); // TODO: jsdoc factory https://github.com/Microsoft/TypeScript/pull/29539 node.fullName = ts.createIdentifier(name); node.name = node.fullName; @@ -134140,10 +134807,10 @@ var ts; var templates = []; ts.forEach(typeParameters, function (typeParameter) { var constraint = ts.getEffectiveConstraintOfTypeParameter(typeParameter); - var template = ts.createNode(321 /* JSDocTemplateTag */); + var template = ts.createNode(322 /* JSDocTemplateTag */); template.tagName = ts.createIdentifier("template"); template.constraint = constraint && ts.cast(constraint, ts.isJSDocTypeExpression); - var parameter = ts.createNode(155 /* TypeParameter */); + var parameter = ts.createNode(156 /* TypeParameter */); parameter.name = typeParameter.name; template.typeParameters = ts.createNodeArray([parameter]); templates.push(template); @@ -134237,9 +134904,6 @@ var ts; var modifiers = ts.append(!isJS ? [ts.createToken(accessModifier)] : undefined, isStatic ? ts.createToken(120 /* StaticKeyword */) : undefined); return modifiers && ts.createNodeArray(modifiers); } - function startsWithUnderscore(name) { - return name.charCodeAt(0) === 95 /* _ */; - } function getConvertibleFieldAtPosition(context) { var file = context.file, startPosition = context.startPosition, endPosition = context.endPosition; var node = ts.getTokenAtPosition(file, startPosition); @@ -134250,14 +134914,14 @@ var ts; || !isConvertibleName(declaration.name) || (ts.getModifierFlags(declaration) | meaning) !== meaning) return undefined; var name = declaration.name.text; - var startWithUnderscore = startsWithUnderscore(name); + var startWithUnderscore = ts.startsWithUnderscore(name); var fieldName = createPropertyName(startWithUnderscore ? name : ts.getUniqueName("_" + name, file), declaration.name); var accessorName = createPropertyName(startWithUnderscore ? ts.getUniqueName(name.substring(1), file) : name, declaration.name); return { isStatic: ts.hasStaticModifier(declaration), isReadonly: ts.hasReadonlyModifier(declaration), type: ts.getTypeAnnotationNode(declaration), - container: declaration.kind === 156 /* Parameter */ ? declaration.parent.parent : declaration.parent, + container: declaration.kind === 157 /* Parameter */ ? declaration.parent.parent : declaration.parent, originalName: declaration.name.text, declaration: declaration, fieldName: fieldName, @@ -134400,11 +135064,11 @@ var ts; } function isPureImport(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return true; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return !ts.hasModifier(node, 1 /* Export */); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return node.declarationList.declarations.every(function (d) { return !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ true); }); default: return false; @@ -134492,12 +135156,12 @@ var ts; } function getNamespaceLikeImport(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 256 /* NamespaceImport */ ? + case 255 /* ImportDeclaration */: + return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 257 /* NamespaceImport */ ? node.importClause.namedBindings.name : undefined; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return node.name; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ts.tryCast(node.name, ts.isIdentifier); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); @@ -134528,20 +135192,20 @@ var ts; var newNamespaceId = ts.createIdentifier(newNamespaceName); var newModuleString = ts.createLiteral(newModuleSpecifier); switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(newNamespaceId)), newModuleString); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return ts.createImportEqualsDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, newNamespaceId, ts.createExternalModuleReference(newModuleString)); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ts.createVariableDeclaration(newNamespaceId, /*type*/ undefined, createRequireCall(newModuleString)); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); } } function moduleSpecifierFromImport(i) { - return (i.kind === 254 /* ImportDeclaration */ ? i.moduleSpecifier - : i.kind === 253 /* ImportEqualsDeclaration */ ? i.moduleReference.expression + return (i.kind === 255 /* ImportDeclaration */ ? i.moduleSpecifier + : i.kind === 254 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0]); } function forEachImportInStatement(statement, cb) { @@ -134611,15 +135275,15 @@ var ts; } function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) { switch (importDecl.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused); break; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: if (isUnused(importDecl.name)) { changes.delete(sourceFile, importDecl); } break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused); break; default: @@ -134632,7 +135296,7 @@ var ts; var _a = importDecl.importClause, name = _a.name, namedBindings = _a.namedBindings; var defaultUnused = !name || isUnused(name); var namedBindingsUnused = !namedBindings || - (namedBindings.kind === 256 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); + (namedBindings.kind === 257 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); if (defaultUnused && namedBindingsUnused) { changes.delete(sourceFile, importDecl); } @@ -134644,7 +135308,7 @@ var ts; if (namedBindingsUnused) { changes.replaceNode(sourceFile, importDecl.importClause, ts.updateImportClause(importDecl.importClause, name, /*namedBindings*/ undefined, importDecl.importClause.isTypeOnly)); } - else if (namedBindings.kind === 257 /* NamedImports */) { + else if (namedBindings.kind === 258 /* NamedImports */) { for (var _i = 0, _b = namedBindings.elements; _i < _b.length; _i++) { var element = _b[_i]; if (isUnused(element.name)) @@ -134662,9 +135326,9 @@ var ts; changes.delete(sourceFile, name); } break; - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: break; - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: if (name.elements.every(function (e) { return ts.isIdentifier(e.name) && isUnused(e.name); })) { changes.delete(sourceFile, ts.isVariableDeclarationList(varDecl.parent) && varDecl.parent.declarations.length === 1 ? varDecl.parent.parent : varDecl); } @@ -134791,13 +135455,13 @@ var ts; // Below should all be utilities function isInImport(decl) { switch (decl.kind) { - case 253 /* ImportEqualsDeclaration */: - case 258 /* ImportSpecifier */: - case 255 /* ImportClause */: + case 254 /* ImportEqualsDeclaration */: + case 259 /* ImportSpecifier */: + case 256 /* ImportClause */: return true; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return isVariableDeclarationInImport(decl); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return ts.isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent); default: return false; @@ -134809,7 +135473,7 @@ var ts; } function filterImport(i, moduleSpecifier, keep) { switch (i.kind) { - case 254 /* ImportDeclaration */: { + case 255 /* ImportDeclaration */: { var clause = i.importClause; if (!clause) return undefined; @@ -134819,9 +135483,9 @@ var ts; ? ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(defaultImport, namedBindings), moduleSpecifier) : undefined; } - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return keep(i.name) ? i : undefined; - case 242 /* VariableDeclaration */: { + case 243 /* VariableDeclaration */: { var name = filterBindingName(i.name, keep); return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : undefined; } @@ -134830,7 +135494,7 @@ var ts; } } function filterNamedBindings(namedBindings, keep) { - if (namedBindings.kind === 256 /* NamespaceImport */) { + if (namedBindings.kind === 257 /* NamespaceImport */) { return keep(namedBindings.name) ? namedBindings : undefined; } else { @@ -134842,9 +135506,9 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return keep(name) ? name : undefined; - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: return name; - case 189 /* ObjectBindingPattern */: { + case 190 /* ObjectBindingPattern */: { // We can't handle nested destructurings or property names well here, so just copy them all. var newElements = name.elements.filter(function (prop) { return prop.propertyName || !ts.isIdentifier(prop.name) || keep(prop.name); }); return newElements.length ? ts.createObjectBindingPattern(newElements) : undefined; @@ -134901,13 +135565,13 @@ var ts; } function isNonVariableTopLevelDeclaration(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 254 /* ImportEqualsDeclaration */: return true; default: return false; @@ -134915,17 +135579,17 @@ var ts; } function forEachTopLevelDeclaration(statement, cb) { switch (statement.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 254 /* ImportEqualsDeclaration */: return cb(statement); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return ts.firstDefined(statement.declarationList.declarations, function (decl) { return forEachTopLevelDeclarationInBindingName(decl.name, cb); }); - case 226 /* ExpressionStatement */: { + case 227 /* ExpressionStatement */: { var expression = statement.expression; return ts.isBinaryExpression(expression) && ts.getAssignmentDeclarationKind(expression) === 1 /* ExportsProperty */ ? cb(statement) @@ -134937,8 +135601,8 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return cb(ts.cast(name.parent, function (x) { return ts.isVariableDeclaration(x) || ts.isBindingElement(x); })); - case 190 /* ArrayBindingPattern */: - case 189 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: return ts.firstDefined(name.elements, function (em) { return ts.isOmittedExpression(em) ? undefined : forEachTopLevelDeclarationInBindingName(em.name, cb); }); default: return ts.Debug.assertNever(name, "Unexpected name kind " + name.kind); @@ -134949,9 +135613,9 @@ var ts; } function getTopLevelDeclarationStatement(d) { switch (d.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return d.parent.parent; - case 191 /* BindingElement */: + case 192 /* BindingElement */: return getTopLevelDeclarationStatement(ts.cast(d.parent.parent, function (p) { return ts.isVariableDeclaration(p) || ts.isBindingElement(p); })); default: return d; @@ -134984,23 +135648,23 @@ var ts; function addEs6Export(d) { var modifiers = ts.concatenate([ts.createModifier(89 /* ExportKeyword */)], d.modifiers); switch (d.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(d, d.decorators, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return ts.updateClassDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return ts.updateVariableStatement(d, modifiers, d.declarationList); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return ts.updateModuleDeclaration(d, d.decorators, modifiers, d.name, d.body); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return ts.updateEnumDeclaration(d, d.decorators, modifiers, d.name, d.members); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.type); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(d, d.decorators, modifiers, d.name, d.moduleReference); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return ts.Debug.fail(); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(d, "Unexpected declaration kind " + d.kind); @@ -135011,18 +135675,18 @@ var ts; } function getNamesToExportInCommonJS(decl) { switch (decl.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: return [decl.name.text]; // TODO: GH#18217 - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return ts.mapDefined(decl.declarationList.declarations, function (d) { return ts.isIdentifier(d.name) ? d.name.text : undefined; }); - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 254 /* ImportEqualsDeclaration */: return ts.emptyArray; - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return ts.Debug.fail("Can't export an ExpressionStatement"); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(decl, "Unexpected decl kind " + decl.kind); @@ -135292,15 +135956,15 @@ var ts; var parent = functionReference.parent; switch (parent.kind) { // foo(...) or super(...) or new Foo(...) - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: var callOrNewExpression = ts.tryCast(parent, ts.isCallOrNewExpression); if (callOrNewExpression && callOrNewExpression.expression === functionReference) { return callOrNewExpression; } break; // x.foo(...) - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) { var callOrNewExpression_1 = ts.tryCast(propertyAccessExpression.parent, ts.isCallOrNewExpression); @@ -135310,7 +135974,7 @@ var ts; } break; // x["foo"](...) - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) { var callOrNewExpression_2 = ts.tryCast(elementAccessExpression.parent, ts.isCallOrNewExpression); @@ -135329,14 +135993,14 @@ var ts; var parent = reference.parent; switch (parent.kind) { // `C.foo` - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.expression === reference) { return propertyAccessExpression; } break; // `C["foo"]` - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.expression === reference) { return elementAccessExpression; @@ -135378,11 +136042,11 @@ var ts; if (!isValidParameterNodeArray(functionDeclaration.parameters, checker)) return false; switch (functionDeclaration.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return isSingleImplementation(functionDeclaration, checker); - case 162 /* Constructor */: + case 163 /* Constructor */: if (ts.isClassDeclaration(functionDeclaration.parent)) { return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker); } @@ -135390,8 +136054,8 @@ var ts; return isValidVariableDeclaration(functionDeclaration.parent.parent) && isSingleImplementation(functionDeclaration, checker); } - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return isValidVariableDeclaration(functionDeclaration.parent); } return false; @@ -135562,7 +136226,7 @@ var ts; } function getClassNames(constructorDeclaration) { switch (constructorDeclaration.parent.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: var classDeclaration = constructorDeclaration.parent; if (classDeclaration.name) return [classDeclaration.name]; @@ -135570,7 +136234,7 @@ var ts; // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(classDeclaration, 84 /* DefaultKeyword */), "Nameless class declaration should be a default export"); return [defaultModifier]; - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: var classExpression = constructorDeclaration.parent; var variableDeclaration = constructorDeclaration.parent.parent; var className = classExpression.name; @@ -135581,25 +136245,25 @@ var ts; } function getFunctionNames(functionDeclaration) { switch (functionDeclaration.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: if (functionDeclaration.name) return [functionDeclaration.name]; // If the function declaration doesn't have a name, it should have a default modifier. // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(functionDeclaration, 84 /* DefaultKeyword */), "Nameless function declaration should be a default export"); return [defaultModifier]; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return [functionDeclaration.name]; - case 162 /* Constructor */: - var ctrKeyword = ts.Debug.checkDefined(ts.findChildOfKind(functionDeclaration, 129 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); - if (functionDeclaration.parent.kind === 214 /* ClassExpression */) { + case 163 /* Constructor */: + var ctrKeyword = ts.Debug.checkDefined(ts.findChildOfKind(functionDeclaration, 130 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); + if (functionDeclaration.parent.kind === 215 /* ClassExpression */) { var variableDeclaration = functionDeclaration.parent.parent; return [variableDeclaration.name, ctrKeyword]; } return [ctrKeyword]; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return [functionDeclaration.parent.name]; - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: if (functionDeclaration.name) return [functionDeclaration.name, functionDeclaration.parent.name]; return [functionDeclaration.parent.name]; @@ -135850,8 +136514,8 @@ var ts; if (!children.length) { return undefined; } - var child = ts.find(children, function (kid) { return kid.kind < 294 /* FirstJSDocNode */ || kid.kind > 323 /* LastJSDocNode */; }); - return child.kind < 153 /* FirstNode */ ? + var child = ts.find(children, function (kid) { return kid.kind < 295 /* FirstJSDocNode */ || kid.kind > 324 /* LastJSDocNode */; }); + return child.kind < 154 /* FirstNode */ ? child : child.getFirstToken(sourceFile); }; @@ -135862,7 +136526,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 153 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 154 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { return ts.forEachChild(this, cbNode, cbNodeArray); @@ -135920,7 +136584,7 @@ var ts; } } function createSyntaxList(nodes, parent) { - var list = createNode(324 /* SyntaxList */, nodes.pos, nodes.end, parent); + var list = createNode(325 /* SyntaxList */, nodes.pos, nodes.end, parent); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { @@ -136234,7 +136898,7 @@ var ts; __extends(SourceFileObject, _super); function SourceFileObject(kind, pos, end) { var _this = _super.call(this, kind, pos, end) || this; - _this.kind = 290 /* SourceFile */; + _this.kind = 291 /* SourceFile */; return _this; } SourceFileObject.prototype.update = function (newText, textChangeRange) { @@ -136293,10 +136957,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -136316,31 +136980,31 @@ var ts; } ts.forEachChild(node, visit); break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 248 /* EnumDeclaration */: - case 249 /* ModuleDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 263 /* ExportSpecifier */: - case 258 /* ImportSpecifier */: - case 255 /* ImportClause */: - case 256 /* NamespaceImport */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 173 /* TypeLiteral */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: + case 250 /* ModuleDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 264 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 256 /* ImportClause */: + case 257 /* NamespaceImport */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 174 /* TypeLiteral */: addDeclaration(node); ts.forEachChild(node, visit); break; - case 156 /* Parameter */: + case 157 /* Parameter */: // Only consider parameter properties if (!ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { break; } // falls through - case 242 /* VariableDeclaration */: - case 191 /* BindingElement */: { + case 243 /* VariableDeclaration */: + case 192 /* BindingElement */: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -136351,12 +137015,12 @@ var ts; } } // falls through - case 284 /* EnumMember */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 285 /* EnumMember */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: addDeclaration(node); break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; var exportDeclaration = node; @@ -136369,7 +137033,7 @@ var ts; } } break; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -136381,7 +137045,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 256 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 257 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -136390,7 +137054,7 @@ var ts; } } break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) !== 0 /* None */) { addDeclaration(node); } @@ -136716,6 +137380,7 @@ var ts; return sourceFile; } function synchronizeHostData() { + var _a; ts.Debug.assert(!syntaxOnly); // perform fast check if host supports it if (host.getProjectVersion) { @@ -136797,12 +137462,10 @@ var ts; return host.resolveTypeReferenceDirectives.apply(host, args); }; } - if (host.setResolvedProjectReferenceCallbacks) { - compilerHost.setResolvedProjectReferenceCallbacks = function (callbacks) { return host.setResolvedProjectReferenceCallbacks(callbacks); }; - } if (host.useSourceOfProjectReferenceRedirect) { compilerHost.useSourceOfProjectReferenceRedirect = function () { return host.useSourceOfProjectReferenceRedirect(); }; } + (_a = host.setCompilerHost) === null || _a === void 0 ? void 0 : _a.call(host, compilerHost); var documentRegistryBucketKey = documentRegistry.getKeyForCompilationSettings(newSettings); var options = { rootNames: rootFileNames, @@ -136888,7 +137551,7 @@ var ts; // We do not support the scenario where a host can modify a registered // file's script kind, i.e. in one project some file is treated as ".ts" // and in another as ".js" - ts.Debug.assertEqual(hostFileInformation.scriptKind, oldSourceFile.scriptKind, "Registered script kind should match new script kind.", path); + ts.Debug.assertEqual(hostFileInformation.scriptKind, oldSourceFile.scriptKind, "Registered script kind should match new script kind."); return documentRegistry.updateDocumentWithKey(fileName, path, newSettings, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind); } // We didn't already have the file. Fall through and acquire it from the registry. @@ -137010,12 +137673,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return !ts.isLabelName(node) && !ts.isTagName(node); - case 194 /* PropertyAccessExpression */: - case 153 /* QualifiedName */: + case 195 /* PropertyAccessExpression */: + case 154 /* QualifiedName */: // Don't return quickInfo if inside the comment in `a/**/.b` return !ts.isInComment(sourceFile, position); case 104 /* ThisKeyword */: - case 183 /* ThisType */: + case 184 /* ThisType */: case 102 /* SuperKeyword */: return true; default: @@ -137117,15 +137780,15 @@ var ts; return undefined; } switch (node.kind) { - case 194 /* PropertyAccessExpression */: - case 153 /* QualifiedName */: + case 195 /* PropertyAccessExpression */: + case 154 /* QualifiedName */: case 10 /* StringLiteral */: case 91 /* FalseKeyword */: case 106 /* TrueKeyword */: case 100 /* NullKeyword */: case 102 /* SuperKeyword */: case 104 /* ThisKeyword */: - case 183 /* ThisType */: + case 184 /* ThisType */: case 75 /* Identifier */: break; // Cant create the text span @@ -137142,7 +137805,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 249 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 250 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -137619,7 +138282,7 @@ var ts; */ function literalIsName(node) { return ts.isDeclarationName(node) || - node.parent.kind === 265 /* ExternalModuleReference */ || + node.parent.kind === 266 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node); } @@ -137637,13 +138300,13 @@ var ts; case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: - if (node.parent.kind === 154 /* ComputedPropertyName */) { + if (node.parent.kind === 155 /* ComputedPropertyName */) { return ts.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; } // falls through case 75 /* Identifier */: return ts.isObjectLiteralElement(node.parent) && - (node.parent.parent.kind === 193 /* ObjectLiteralExpression */ || node.parent.parent.kind === 274 /* JsxAttributes */) && + (node.parent.parent.kind === 194 /* ObjectLiteralExpression */ || node.parent.parent.kind === 275 /* JsxAttributes */) && node.parent.name === node ? node.parent : undefined; } return undefined; @@ -137685,7 +138348,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 195 /* ElementAccessExpression */ && + node.parent.kind === 196 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /** @@ -137765,114 +138428,114 @@ var ts; if (node) { var parent = node.parent; switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 242 /* VariableDeclaration */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 243 /* VariableDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return spanInVariableDeclaration(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return spanInParameterDeclaration(node); - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 162 /* Constructor */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 163 /* Constructor */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 223 /* Block */: + case 224 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // falls through - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return spanInBlock(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return spanInBlock(node.block); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: // Span on while(...) return textSpanEndingAtNextToken(node, node.expression); - case 228 /* DoStatement */: + case 229 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 241 /* DebuggerStatement */: + case 242 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 227 /* IfStatement */: + case 228 /* IfStatement */: // set on if(..) span return textSpanEndingAtNextToken(node, node.expression); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return spanInForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: // span of for (a in ...) return textSpanEndingAtNextToken(node, node.expression); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: // span in initializer return spanInInitializerOfForLike(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: // span on switch(...) return textSpanEndingAtNextToken(node, node.expression); - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 240 /* TryStatement */: + case 241 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } // falls through - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 191 /* BindingElement */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 192 /* BindingElement */: // span on complete node return textSpan(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 157 /* Decorator */: + case 158 /* Decorator */: return spanInNodeArray(parent.decorators); - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: return undefined; // Tokens: case 26 /* SemicolonToken */: @@ -137902,7 +138565,7 @@ var ts; case 79 /* CatchKeyword */: case 92 /* FinallyKeyword */: return spanInNextNode(node); - case 152 /* OfKeyword */: + case 153 /* OfKeyword */: return spanInOfKeyword(node); default: // Destructuring pattern in destructuring assignment @@ -137915,13 +138578,13 @@ var ts; // `a` or `...c` or `d: x` from // `[a, b, ...c]` or `{ a, b }` or `{ d: x }` from destructuring pattern if ((node.kind === 75 /* Identifier */ || - node.kind === 213 /* SpreadElement */ || - node.kind === 281 /* PropertyAssignment */ || - node.kind === 282 /* ShorthandPropertyAssignment */) && + node.kind === 214 /* SpreadElement */ || + node.kind === 282 /* PropertyAssignment */ || + node.kind === 283 /* ShorthandPropertyAssignment */) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(parent)) { return textSpan(node); } - if (node.kind === 209 /* BinaryExpression */) { + if (node.kind === 210 /* BinaryExpression */) { var _a = node, left = _a.left, operatorToken = _a.operatorToken; // Set breakpoint in destructuring pattern if its destructuring assignment // [a, b, c] or {a, b, c} of @@ -137943,22 +138606,22 @@ var ts; } if (ts.isExpressionNode(node)) { switch (parent.kind) { - case 228 /* DoStatement */: + case 229 /* DoStatement */: // Set span as if on while keyword return spanInPreviousNode(node); - case 157 /* Decorator */: + case 158 /* Decorator */: // Set breakpoint on the decorator emit return spanInNode(node.parent); - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: return textSpan(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (node.parent.operatorToken.kind === 27 /* CommaToken */) { // If this is a comma expression, the breakpoint is possible in this expression return textSpan(node); } break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: if (node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); @@ -137967,21 +138630,21 @@ var ts; } } switch (node.parent.kind) { - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // If this is name of property assignment, set breakpoint in the initializer if (node.parent.name === node && !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } break; - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: // Breakpoint in type assertion goes to its operand if (node.parent.type === node) { return spanInNextNode(node.parent.type); } break; - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: { + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: { // initializer of variable/parameter declaration go to previous node var _b = node.parent, initializer = _b.initializer, type = _b.type; if (initializer === node || type === node || ts.isAssignmentOperator(node.kind)) { @@ -137989,7 +138652,7 @@ var ts; } break; } - case 209 /* BinaryExpression */: { + case 210 /* BinaryExpression */: { var left = node.parent.left; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { // If initializer of destructuring assignment move to previous token @@ -138019,7 +138682,7 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 231 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 232 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } var parent = variableDeclaration.parent; @@ -138031,7 +138694,7 @@ var ts; // or its declaration from 'for of' if (variableDeclaration.initializer || ts.hasModifier(variableDeclaration, 1 /* Export */) || - parent.parent.kind === 232 /* ForOfStatement */) { + parent.parent.kind === 233 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } if (ts.isVariableDeclarationList(variableDeclaration.parent) && @@ -138072,7 +138735,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasModifier(functionDeclaration, 1 /* Export */) || - (functionDeclaration.parent.kind === 245 /* ClassDeclaration */ && functionDeclaration.kind !== 162 /* Constructor */); + (functionDeclaration.parent.kind === 246 /* ClassDeclaration */ && functionDeclaration.kind !== 163 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -138095,26 +138758,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // Set on parent if on same line otherwise on first statement // falls through - case 229 /* WhileStatement */: - case 227 /* IfStatement */: - case 231 /* ForInStatement */: + case 230 /* WhileStatement */: + case 228 /* IfStatement */: + case 232 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 243 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 244 /* VariableDeclarationList */) { // Declaration list - set breakpoint in first declaration var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -138139,21 +138802,21 @@ var ts; } function spanInBindingPattern(bindingPattern) { // Set breakpoint in first binding element - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 215 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 216 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } // Empty binding pattern of binding element, set breakpoint on binding element - if (bindingPattern.parent.kind === 191 /* BindingElement */) { + if (bindingPattern.parent.kind === 192 /* BindingElement */) { return textSpan(bindingPattern.parent); } // Variable declaration is used as the span return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 190 /* ArrayBindingPattern */ && node.kind !== 189 /* ObjectBindingPattern */); - var elements = node.kind === 192 /* ArrayLiteralExpression */ ? node.elements : node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 215 /* OmittedExpression */ ? element : undefined; }); + ts.Debug.assert(node.kind !== 191 /* ArrayBindingPattern */ && node.kind !== 190 /* ObjectBindingPattern */); + var elements = node.kind === 193 /* ArrayLiteralExpression */ ? node.elements : node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 216 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } @@ -138161,18 +138824,18 @@ var ts; // just nested element in another destructuring assignment // set breakpoint on assignment when parent is destructuring assignment // Otherwise set breakpoint for this element - return textSpan(node.parent.kind === 209 /* BinaryExpression */ ? node.parent : node); + return textSpan(node.parent.kind === 210 /* BinaryExpression */ ? node.parent : node); } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -138180,25 +138843,25 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: // If this is not an instantiated module block, no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } // falls through - case 248 /* EnumDeclaration */: - case 245 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 246 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 223 /* Block */: + case 224 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // falls through - case 280 /* CatchClause */: + case 281 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -138206,7 +138869,7 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -138222,7 +138885,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -138237,12 +138900,12 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 228 /* DoStatement */ || // Go to while keyword and do action instead - node.parent.kind === 196 /* CallExpression */ || - node.parent.kind === 197 /* NewExpression */) { + if (node.parent.kind === 229 /* DoStatement */ || // Go to while keyword and do action instead + node.parent.kind === 197 /* CallExpression */ || + node.parent.kind === 198 /* NewExpression */) { return spanInPreviousNode(node); } - if (node.parent.kind === 200 /* ParenthesizedExpression */) { + if (node.parent.kind === 201 /* ParenthesizedExpression */) { return spanInNextNode(node); } // Default to parent node @@ -138251,21 +138914,21 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 162 /* Constructor */: - case 229 /* WhileStatement */: - case 228 /* DoStatement */: - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 200 /* ParenthesizedExpression */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 163 /* Constructor */: + case 230 /* WhileStatement */: + case 229 /* DoStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 201 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -138275,20 +138938,20 @@ var ts; function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration if (ts.isFunctionLike(node.parent) || - node.parent.kind === 281 /* PropertyAssignment */ || - node.parent.kind === 156 /* Parameter */) { + node.parent.kind === 282 /* PropertyAssignment */ || + node.parent.kind === 157 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 199 /* TypeAssertionExpression */) { + if (node.parent.kind === 200 /* TypeAssertionExpression */) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 228 /* DoStatement */) { + if (node.parent.kind === 229 /* DoStatement */) { // Set span on while expression return textSpanEndingAtNextToken(node, node.parent.expression); } @@ -138296,7 +138959,7 @@ var ts; return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 232 /* ForOfStatement */) { + if (node.parent.kind === 233 /* ForOfStatement */) { // Set using next token return spanInNextNode(node); } @@ -140322,7 +140985,7 @@ var ts; var Project = /** @class */ (function () { /*@internal*/ function Project( - /*@internal*/ projectName, projectKind, projectService, documentRegistry, hasExplicitListOfFiles, lastFileExceededProgramSize, compilerOptions, compileOnSaveEnabled, watchOptions, directoryStructureHost, currentDirectory, customRealpath) { + /*@internal*/ projectName, projectKind, projectService, documentRegistry, hasExplicitListOfFiles, lastFileExceededProgramSize, compilerOptions, compileOnSaveEnabled, watchOptions, directoryStructureHost, currentDirectory) { var _this = this; this.projectName = projectName; this.projectKind = projectKind; @@ -140392,9 +141055,7 @@ var ts; else if (host.trace) { this.trace = function (s) { return host.trace(s); }; } - if (host.realpath) { - this.realpath = customRealpath || (function (path) { return host.realpath(path); }); - } + this.realpath = ts.maybeBind(host, host.realpath); // Use the current directory as resolution root only if the project created using current directory string this.resolutionCache = ts.createResolutionCache(this, currentDirectory && this.currentDirectory, /*logChangesWhenResolvingModule*/ true); this.languageService = ts.createLanguageService(this, this.documentRegistry, projectService.syntaxOnly); @@ -140531,10 +141192,6 @@ var ts; return this.projectService.host.writeFile(fileName, content); }; Project.prototype.fileExists = function (file) { - return this.fileExistsWithCache(file); - }; - /* @internal */ - Project.prototype.fileExistsWithCache = function (file) { // As an optimization, don't hit the disks for files we already know don't exist // (because we're watching for their creation). var path = this.toPath(file); @@ -141111,7 +141768,7 @@ var ts; this.projectService.sendUpdateGraphPerformanceEvent(elapsed); this.writeLog("Finishing updateGraphWorker: Project: " + this.getProjectName() + " Version: " + this.getProjectVersion() + " structureChanged: " + hasNewProgram + " Elapsed: " + elapsed + "ms"); if (this.hasAddedorRemovedFiles) { - this.print(); + this.print(/*writeProjectFileNames*/ true); } else if (this.program !== oldProgram) { this.writeLog("Different program with same set of files:: oldProgram.structureIsReused:: " + (oldProgram && oldProgram.structureIsReused)); @@ -141268,9 +141925,9 @@ var ts; return strBuilder; }; /*@internal*/ - Project.prototype.print = function (counter) { - this.writeLog("Project '" + this.projectName + "' (" + ProjectKind[this.projectKind] + ") " + (counter === undefined ? "" : counter)); - this.writeLog(this.filesToString(this.projectService.logger.hasLevel(server.LogLevel.verbose))); + Project.prototype.print = function (writeProjectFileNames) { + this.writeLog("Project '" + this.projectName + "' (" + ProjectKind[this.projectKind] + ")"); + this.writeLog(this.filesToString(writeProjectFileNames && this.projectService.logger.hasLevel(server.LogLevel.verbose))); this.writeLog("-----------------------------------------------"); }; Project.prototype.setCompilerOptions = function (compilerOptions) { @@ -141686,7 +142343,7 @@ var ts; /*lastFileExceededProgramSize*/ undefined, /*compilerOptions*/ {}, /*compileOnSaveEnabled*/ false, - /*watchOptions*/ undefined, cachedDirectoryStructureHost, ts.getDirectoryPath(configFileName), projectService.host.realpath && (function (s) { return _this.getRealpath(s); })) || this; + /*watchOptions*/ undefined, cachedDirectoryStructureHost, ts.getDirectoryPath(configFileName)) || this; /* @internal */ _this.openFileWatchTriggered = ts.createMap(); /*@internal*/ @@ -141697,150 +142354,20 @@ var ts; _this.isInitialLoadPending = ts.returnTrue; /*@internal*/ _this.sendLoadingProjectFinish = false; - /* @internal */ - _this.useSourceOfProjectReferenceRedirect = function () { return !!_this.languageServiceEnabled && - !_this.getCompilerOptions().disableSourceOfProjectReferenceRedirect; }; _this.canonicalConfigFilePath = server.asNormalizedPath(projectService.toCanonicalFileName(configFileName)); return _this; } /* @internal */ - ConfiguredProject.prototype.setResolvedProjectReferenceCallbacks = function (projectReferenceCallbacks) { - this.projectReferenceCallbacks = projectReferenceCallbacks; - }; - ConfiguredProject.prototype.fileExistsIfProjectReferenceDts = function (file) { - var source = this.projectReferenceCallbacks.getSourceOfProjectReferenceRedirect(file); - return source !== undefined ? - ts.isString(source) ? _super.prototype.fileExists.call(this, source) : true : - undefined; - }; - /** - * This implementation of fileExists checks if the file being requested is - * .d.ts file for the referenced Project. - * If it is it returns true irrespective of whether that file exists on host - */ - ConfiguredProject.prototype.fileExists = function (file) { - if (_super.prototype.fileExists.call(this, file)) - return true; - if (!this.useSourceOfProjectReferenceRedirect() || !this.projectReferenceCallbacks) - return false; - if (!ts.isDeclarationFileName(file)) - return false; - // Project references go to source file instead of .d.ts file - return this.fileOrDirectoryExistsUsingSource(file, /*isFile*/ true); - }; - ConfiguredProject.prototype.directoryExistsIfProjectReferenceDeclDir = function (dir) { - var dirPath = this.toPath(dir); - var dirPathWithTrailingDirectorySeparator = "" + dirPath + ts.directorySeparator; - return ts.forEachKey(this.mapOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath || - // Any parent directory of declaration dir - ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) || - // Any directory inside declaration dir - ts.startsWith(dirPath, declDirPath + "/"); }); - }; - /** - * This implementation of directoryExists checks if the directory being requested is - * directory of .d.ts file for the referenced Project. - * If it is it returns true irrespective of whether that directory exists on host - */ - ConfiguredProject.prototype.directoryExists = function (path) { - var _this = this; - if (_super.prototype.directoryExists.call(this, path)) { - this.handleDirectoryCouldBeSymlink(path); - return true; - } - if (!this.useSourceOfProjectReferenceRedirect() || !this.projectReferenceCallbacks) - return false; - if (!this.mapOfDeclarationDirectories) { - this.mapOfDeclarationDirectories = ts.createMap(); - this.projectReferenceCallbacks.forEachResolvedProjectReference(function (ref) { - if (!ref) - return; - var out = ref.commandLine.options.outFile || ref.commandLine.options.out; - if (out) { - _this.mapOfDeclarationDirectories.set(ts.getDirectoryPath(_this.toPath(out)), true); - } - else { - // Set declaration's in different locations only, if they are next to source the directory present doesnt change - var declarationDir = ref.commandLine.options.declarationDir || ref.commandLine.options.outDir; - if (declarationDir) { - _this.mapOfDeclarationDirectories.set(_this.toPath(declarationDir), true); - } - } - }); - } - return this.fileOrDirectoryExistsUsingSource(path, /*isFile*/ false); + ConfiguredProject.prototype.setCompilerHost = function (host) { + this.compilerHost = host; }; - /** - * Call super.getDirectories only if directory actually present on the host - * This is needed to ensure that we arent getting directories that we fake about presence for - */ - ConfiguredProject.prototype.getDirectories = function (path) { - return !this.useSourceOfProjectReferenceRedirect() || !this.projectReferenceCallbacks || _super.prototype.directoryExists.call(this, path) ? - _super.prototype.getDirectories.call(this, path) : - []; - }; - ConfiguredProject.prototype.realpathIfSymlinkedProjectReferenceDts = function (s) { - return this.symlinkedFiles && this.symlinkedFiles.get(this.toPath(s)); - }; - ConfiguredProject.prototype.getRealpath = function (s) { - return this.realpathIfSymlinkedProjectReferenceDts(s) || - this.projectService.host.realpath(s); - }; - ConfiguredProject.prototype.handleDirectoryCouldBeSymlink = function (directory) { - if (!this.useSourceOfProjectReferenceRedirect() || !this.projectReferenceCallbacks) - return; - // Because we already watch node_modules, handle symlinks in there - if (!this.realpath || !ts.stringContains(directory, ts.nodeModulesPathPart)) - return; - if (!this.symlinkedDirectories) - this.symlinkedDirectories = ts.createMap(); - var directoryPath = ts.ensureTrailingDirectorySeparator(this.toPath(directory)); - if (this.symlinkedDirectories.has(directoryPath)) - return; - var real = ts.normalizePath(this.projectService.host.realpath(directory)); - var realPath; - if (real === directory || - (realPath = ts.ensureTrailingDirectorySeparator(this.toPath(real))) === directoryPath) { - // not symlinked - this.symlinkedDirectories.set(directoryPath, false); - return; - } - this.symlinkedDirectories.set(directoryPath, { - real: ts.ensureTrailingDirectorySeparator(real), - realPath: realPath - }); + /* @internal */ + ConfiguredProject.prototype.getCompilerHost = function () { + return this.compilerHost; }; - ConfiguredProject.prototype.fileOrDirectoryExistsUsingSource = function (fileOrDirectory, isFile) { - var _this = this; - var fileOrDirectoryExistsUsingSource = isFile ? - function (file) { return _this.fileExistsIfProjectReferenceDts(file); } : - function (dir) { return _this.directoryExistsIfProjectReferenceDeclDir(dir); }; - // Check current directory or file - var result = fileOrDirectoryExistsUsingSource(fileOrDirectory); - if (result !== undefined) - return result; - if (!this.symlinkedDirectories) - return false; - var fileOrDirectoryPath = this.toPath(fileOrDirectory); - if (!ts.stringContains(fileOrDirectoryPath, ts.nodeModulesPathPart)) - return false; - if (isFile && this.symlinkedFiles && this.symlinkedFiles.has(fileOrDirectoryPath)) - return true; - // If it contains node_modules check if its one of the symlinked path we know of - return ts.firstDefinedIterator(this.symlinkedDirectories.entries(), function (_a) { - var directoryPath = _a[0], symlinkedDirectory = _a[1]; - if (!symlinkedDirectory || !ts.startsWith(fileOrDirectoryPath, directoryPath)) - return undefined; - var result = fileOrDirectoryExistsUsingSource(fileOrDirectoryPath.replace(directoryPath, symlinkedDirectory.realPath)); - if (isFile && result) { - if (!_this.symlinkedFiles) - _this.symlinkedFiles = ts.createMap(); - // Store the real path for the file' - var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, _this.currentDirectory); - _this.symlinkedFiles.set(fileOrDirectoryPath, "" + symlinkedDirectory.real + absolutePath.replace(new RegExp(directoryPath, "i"), "")); - } - return result; - }) || false; + /* @internal */ + ConfiguredProject.prototype.useSourceOfProjectReferenceRedirect = function () { + return this.languageServiceEnabled; }; /* @internal */ ConfiguredProject.prototype.setWatchOptions = function (watchOptions) { @@ -141868,10 +142395,6 @@ var ts; this.isInitialLoadPending = ts.returnFalse; var reloadLevel = this.pendingReload; this.pendingReload = ts.ConfigFileProgramReloadLevel.None; - this.projectReferenceCallbacks = undefined; - this.mapOfDeclarationDirectories = undefined; - this.symlinkedDirectories = undefined; - this.symlinkedFiles = undefined; var result; switch (reloadLevel) { case ts.ConfigFileProgramReloadLevel.Partial: @@ -141888,6 +142411,7 @@ var ts; default: result = _super.prototype.updateGraph.call(this); } + this.compilerHost = undefined; this.projectService.sendProjectLoadingFinishEvent(this); this.projectService.sendProjectTelemetry(this); return result; @@ -141983,11 +142507,8 @@ var ts; this.stopWatchingWildCards(); this.projectErrors = undefined; this.configFileSpecs = undefined; - this.projectReferenceCallbacks = undefined; - this.mapOfDeclarationDirectories = undefined; - this.symlinkedDirectories = undefined; - this.symlinkedFiles = undefined; this.openFileWatchTriggered.clear(); + this.compilerHost = undefined; _super.prototype.close.call(this); }; /* @internal */ @@ -141998,6 +142519,19 @@ var ts; ConfiguredProject.prototype.deleteExternalProjectReference = function () { this.externalProjectRefCount--; }; + /* @internal */ + ConfiguredProject.prototype.isSolution = function () { + return this.getRootFilesMap().size === 0 && + !this.canConfigFileJsonReportNoInputFiles; + }; + /* @internal */ + /** Find the configured project from the project references in this solution which contains the info directly */ + ConfiguredProject.prototype.getDefaultChildProjectFromSolution = function (info) { + ts.Debug.assert(this.isSolution()); + return server.forEachResolvedProjectReferenceProject(this, function (child) { return server.projectContainsInfoDirectly(child, info) ? + child : + undefined; }, server.ProjectReferenceProjectLoadKind.Find); + }; /** Returns true if the project is needed by any of the open script info/external project */ /* @internal */ ConfiguredProject.prototype.hasOpenRef = function () { @@ -142016,10 +142550,13 @@ var ts; // In that case keep the project alive if there are open files impacted by this project return !!configFileExistenceInfo.openFilesImpactedByConfigFile.size; } + var isSolution = this.isSolution(); // If there is no pending update for this project, // We know exact set of open files that get impacted by this configured project as the files in the project // The project is referenced only if open files impacted by this project are present in this project - return ts.forEachEntry(configFileExistenceInfo.openFilesImpactedByConfigFile, function (_value, infoPath) { return _this.containsScriptInfo(_this.projectService.getScriptInfoForPath(infoPath)); }) || false; + return ts.forEachEntry(configFileExistenceInfo.openFilesImpactedByConfigFile, function (_value, infoPath) { return isSolution ? + !!_this.getDefaultChildProjectFromSolution(_this.projectService.getScriptInfoForPath(infoPath)) : + _this.containsScriptInfo(_this.projectService.getScriptInfoForPath(infoPath)); }) || false; }; /*@internal*/ ConfiguredProject.prototype.hasExternalProjectRef = function () { @@ -142278,10 +142815,37 @@ var ts; function isAncestorConfigFileInfo(infoOrFileNameOrConfig) { return !!infoOrFileNameOrConfig.configFileInfo; } + /*@internal*/ + /** Kind of operation to perform to get project reference project */ + var ProjectReferenceProjectLoadKind; + (function (ProjectReferenceProjectLoadKind) { + /** Find existing project for project reference */ + ProjectReferenceProjectLoadKind[ProjectReferenceProjectLoadKind["Find"] = 0] = "Find"; + /** Find existing project or create one for the project reference */ + ProjectReferenceProjectLoadKind[ProjectReferenceProjectLoadKind["FindCreate"] = 1] = "FindCreate"; + /** Find existing project or create and load it for the project reference */ + ProjectReferenceProjectLoadKind[ProjectReferenceProjectLoadKind["FindCreateLoad"] = 2] = "FindCreateLoad"; + })(ProjectReferenceProjectLoadKind = server.ProjectReferenceProjectLoadKind || (server.ProjectReferenceProjectLoadKind = {})); + function forEachResolvedProjectReferenceProject(project, cb, projectReferenceProjectLoadKind, reason) { + return forEachResolvedProjectReference(project, function (ref) { + if (!ref) + return undefined; + var configFileName = server.toNormalizedPath(ref.sourceFile.fileName); + var child = project.projectService.findConfiguredProjectByProjectName(configFileName) || (projectReferenceProjectLoadKind === ProjectReferenceProjectLoadKind.FindCreate ? + project.projectService.createConfiguredProject(configFileName) : + projectReferenceProjectLoadKind === ProjectReferenceProjectLoadKind.FindCreateLoad ? + project.projectService.createAndLoadConfiguredProject(configFileName, reason) : + undefined); + return child && cb(child, configFileName); + }); + } + server.forEachResolvedProjectReferenceProject = forEachResolvedProjectReferenceProject; + /*@internal*/ function forEachResolvedProjectReference(project, cb) { var program = project.getCurrentProgram(); return program && program.forEachResolvedProjectReference(cb); } + server.forEachResolvedProjectReference = forEachResolvedProjectReference; function forEachPotentialProjectReference(project, cb) { return project.potentialProjectReferences && ts.forEachKey(project.potentialProjectReferences, cb); @@ -142307,6 +142871,13 @@ var ts; return !info.isScriptOpen() && info.mTime !== undefined; } /*@internal*/ + /** true if script info is part of project and is not in project because it is referenced from project reference source */ + function projectContainsInfoDirectly(project, info) { + return project.containsScriptInfo(info) && + !project.isSourceOfProjectReferenceRedirect(info.path); + } + server.projectContainsInfoDirectly = projectContainsInfoDirectly; + /*@internal*/ function updateProjectIfDirty(project) { return project.dirty && project.updateGraph(); } @@ -142509,7 +143080,7 @@ var ts; ProjectService.prototype.delayEnsureProjectForOpenFiles = function () { var _this = this; this.pendingEnsureProjectForOpenFiles = true; - this.throttledOperations.schedule("*ensureProjectForOpenFiles*", /*delay*/ 250, function () { + this.throttledOperations.schedule("*ensureProjectForOpenFiles*", /*delay*/ 2500, function () { if (_this.pendingProjectUpdates.size !== 0) { _this.delayEnsureProjectForOpenFiles(); } @@ -142894,7 +143465,7 @@ var ts; ProjectService.prototype.removeProject = function (project) { var _this = this; this.logger.info("`remove Project::"); - project.print(); + project.print(/*writeProjectFileNames*/ true); project.close(); if (ts.Debug.shouldAssert(1 /* Normal */)) { this.filenameToScriptInfo.forEach(function (info) { return ts.Debug.assert(!info.isAttached(project), "Found script Info still attached to project", function () { return project.projectName + ": ScriptInfos still attached: " + JSON.stringify(ts.arrayFrom(ts.mapDefinedIterator(_this.filenameToScriptInfo.values(), function (info) { return info.isAttached(project) ? @@ -143285,6 +143856,12 @@ var ts; result = action(jsconfigFileName, ts.combinePaths(canonicalSearchPath, "jsconfig.json")); if (result) return jsconfigFileName; + // If we started within node_modules, don't look outside node_modules. + // Otherwise, we might pick up a very large project and pull in the world, + // causing an editor delay. + if (ts.isNodeModulesDirectory(canonicalSearchPath)) { + break; + } } var parentPath = server.asNormalizedPath(ts.getDirectoryPath(searchPath)); if (parentPath === searchPath) @@ -143299,8 +143876,11 @@ var ts; if (!info.isScriptOpen()) return undefined; var configFileName = this.getConfigFileNameForFile(info); - return configFileName && + var project = configFileName && this.findConfiguredProjectByProjectName(configFileName); + return (project === null || project === void 0 ? void 0 : project.isSolution()) ? + project.getDefaultChildProjectFromSolution(info) : + project; }; /** * This function tries to search for a tsconfig.json for the given file. @@ -143333,21 +143913,19 @@ var ts; if (!this.logger.hasLevel(server.LogLevel.normal)) { return; } - var writeProjectFileNames = this.logger.hasLevel(server.LogLevel.verbose); this.logger.startGroup(); - var counter = printProjectsWithCounter(this.externalProjects, 0); - counter = printProjectsWithCounter(ts.arrayFrom(this.configuredProjects.values()), counter); - printProjectsWithCounter(this.inferredProjects, counter); + this.externalProjects.forEach(printProjectWithoutFileNames); + this.configuredProjects.forEach(printProjectWithoutFileNames); + this.inferredProjects.forEach(printProjectWithoutFileNames); this.logger.info("Open files: "); this.openFiles.forEach(function (projectRootPath, path) { var info = _this.getScriptInfoForPath(path); _this.logger.info("\tFileName: " + info.fileName + " ProjectRootPath: " + projectRootPath); - if (writeProjectFileNames) { - _this.logger.info("\t\tProjects: " + info.containingProjects.map(function (p) { return p.getProjectName(); })); - } + _this.logger.info("\t\tProjects: " + info.containingProjects.map(function (p) { return p.getProjectName(); })); }); this.logger.endGroup(); }; + /*@internal*/ ProjectService.prototype.findConfiguredProjectByProjectName = function (configFileName) { // make sure that casing of config file name is consistent var canonicalConfigFilePath = server.asNormalizedPath(this.toCanonicalFileName(configFileName)); @@ -143455,6 +144033,7 @@ var ts; this.updateNonInferredProjectFiles(project, files, propertyReader); project.setTypeAcquisition(typeAcquisition); }; + /* @internal */ ProjectService.prototype.createConfiguredProject = function (configFileName) { var cachedDirectoryStructureHost = ts.createCachedDirectoryStructureHost(this.host, this.host.getCurrentDirectory(), this.host.useCaseSensitiveFileNames); // TODO: GH#18217 this.logger.info("Opened configuration file " + configFileName); @@ -143550,7 +144129,7 @@ var ts; var isDynamic = server.isDynamicFileName(fileName); var path = void 0; // Use the project's fileExists so that it can use caching instead of reaching to disk for the query - if (!isDynamic && !project.fileExistsWithCache(newRootFile)) { + if (!isDynamic && !project.fileExists(newRootFile)) { path = server.normalizedPathToPath(fileName, this.currentDirectory, this.toCanonicalFileName); var existingValue = projectRootFilesMap.get(path); if (existingValue) { @@ -143592,7 +144171,7 @@ var ts; projectRootFilesMap.forEach(function (value, path) { if (!newRootScriptInfoMap.has(path)) { if (value.info) { - project.removeFile(value.info, project.fileExistsWithCache(path), /*detachFromProject*/ true); + project.removeFile(value.info, project.fileExists(path), /*detachFromProject*/ true); } else { projectRootFilesMap.delete(path); @@ -144196,7 +144775,8 @@ var ts; var configFileName = _this.getConfigFileNameForFile(info); if (configFileName) { var project = _this.findConfiguredProjectByProjectName(configFileName) || _this.createConfiguredProject(configFileName); - if (!updatedProjects.has(configFileName)) { + if (!updatedProjects.has(project.canonicalConfigFilePath)) { + updatedProjects.set(project.canonicalConfigFilePath, true); if (delayReload) { project.pendingReload = ts.ConfigFileProgramReloadLevel.Full; project.pendingReloadReason = reason; @@ -144205,8 +144785,17 @@ var ts; else { // reload from the disk _this.reloadConfiguredProject(project, reason); + // If this is solution, reload the project till the reloaded project contains the script info directly + if (!project.containsScriptInfo(info) && project.isSolution()) { + forEachResolvedProjectReferenceProject(project, function (child) { + if (!updatedProjects.has(child.canonicalConfigFilePath)) { + updatedProjects.set(child.canonicalConfigFilePath, true); + _this.reloadConfiguredProject(child, reason); + } + return projectContainsInfoDirectly(child, info); + }, ProjectReferenceProjectLoadKind.FindCreate); + } } - updatedProjects.set(configFileName, true); } } }); @@ -144246,7 +144835,7 @@ var ts; */ ProjectService.prototype.ensureProjectForOpenFiles = function () { var _this = this; - this.logger.info("Structure before ensureProjectForOpenFiles:"); + this.logger.info("Before ensureProjectForOpenFiles:"); this.printProjects(); this.openFiles.forEach(function (projectRootPath, path) { var info = _this.getScriptInfoForPath(path); @@ -144261,7 +144850,7 @@ var ts; }); this.pendingEnsureProjectForOpenFiles = false; this.inferredProjects.forEach(updateProjectIfDirty); - this.logger.info("Structure after ensureProjectForOpenFiles:"); + this.logger.info("After ensureProjectForOpenFiles:"); this.printProjects(); }; /** @@ -144274,6 +144863,7 @@ var ts; }; /*@internal*/ ProjectService.prototype.getOriginalLocationEnsuringConfiguredProject = function (project, location) { + var _this = this; var originalLocation = project.isSourceOfProjectReferenceRedirect(location.fileName) ? location : project.getSourceMapper().tryGetSourcePosition(location); @@ -144288,9 +144878,19 @@ var ts; return undefined; var configuredProject = this.findConfiguredProjectByProjectName(configFileName) || this.createAndLoadConfiguredProject(configFileName, "Creating project for original file: " + originalFileInfo.fileName + (location !== originalLocation ? " for location: " + location.fileName : "")); - if (configuredProject === project) - return originalLocation; updateProjectIfDirty(configuredProject); + if (configuredProject.isSolution()) { + // Find the project that is referenced from this solution that contains the script info directly + configuredProject = forEachResolvedProjectReferenceProject(configuredProject, function (child) { + updateProjectIfDirty(child); + var info = _this.getScriptInfo(fileName); + return info && projectContainsInfoDirectly(child, info) ? child : undefined; + }, ProjectReferenceProjectLoadKind.FindCreateLoad, "Creating project referenced in solution " + configuredProject.projectName + " to find possible configured project for original file: " + originalFileInfo.fileName + (location !== originalLocation ? " for location: " + location.fileName : "")); + if (!configuredProject) + return undefined; + if (configuredProject === project) + return originalLocation; + } // Keep this configured project as referenced from project addOriginalConfiguredProject(configuredProject); var originalScriptInfo = this.getScriptInfo(fileName); @@ -144327,10 +144927,12 @@ var ts; return info; }; ProjectService.prototype.assignProjectToOpenedScriptInfo = function (info) { + var _this = this; var configFileName; var configFileErrors; var project = this.findExternalProjectContainingOpenScriptInfo(info); var defaultConfigProject; + var retainProjects; if (!project && !this.syntaxOnly) { // Checking syntaxOnly is an optimization configFileName = this.getConfigFileNameForFile(info); if (configFileName) { @@ -144352,8 +144954,32 @@ var ts; updateProjectIfDirty(project); } defaultConfigProject = project; - // Create ancestor configured project - this.createAncestorProjects(info, defaultConfigProject); + retainProjects = defaultConfigProject; + // If this configured project doesnt contain script info but + // it is solution with project references, try those project references + if (!project.containsScriptInfo(info) && project.isSolution()) { + forEachResolvedProjectReferenceProject(project, function (child, childConfigFileName) { + updateProjectIfDirty(child); + // Retain these projects + if (!ts.isArray(retainProjects)) { + retainProjects = [project, child]; + } + else { + retainProjects.push(child); + } + // If script info belongs to this child project, use this as default config project + if (projectContainsInfoDirectly(child, info)) { + configFileName = childConfigFileName; + configFileErrors = child.getAllProjectErrors(); + _this.sendConfigFileDiagEvent(child, info.fileName); + return child; + } + }, ProjectReferenceProjectLoadKind.FindCreateLoad, "Creating project referenced in solution " + project.projectName + " to find possible configured project for " + info.fileName + " to open"); + } + else { + // Create ancestor configured project + this.createAncestorProjects(info, defaultConfigProject || project); + } } } // Project we have at this point is going to be updated since its either found through @@ -144370,7 +144996,7 @@ var ts; this.assignOrphanScriptInfoToInferredProject(info, this.openFiles.get(info.path)); } ts.Debug.assert(!info.isOrphan()); - return { configFileName: configFileName, configFileErrors: configFileErrors, defaultConfigProject: defaultConfigProject }; + return { configFileName: configFileName, configFileErrors: configFileErrors, retainProjects: retainProjects }; }; ProjectService.prototype.createAncestorProjects = function (info, project) { // Skip if info is not part of default configured project @@ -144410,7 +145036,7 @@ var ts; var project = _a[_i]; // If this project has potential project reference for any of the project we are loading ancestor tree for // we need to load this project tree - if (forEachPotentialProjectReference(project, function (potentialRefPath) { return forProjects.has(potentialRefPath); })) { + if (forEachPotentialProjectReference(project, function (potentialRefPath) { return forProjects.has(potentialRefPath); }) || (project.isSolution() && forEachResolvedProjectReference(project, function (_ref, resolvedPath) { return forProjects.has(resolvedPath); }))) { // Load children this.ensureProjectChildren(project, seenProjects); } @@ -144423,14 +145049,7 @@ var ts; // Update the project updateProjectIfDirty(project); // Create tree because project is uptodate we only care of resolved references - forEachResolvedProjectReference(project, function (ref) { - if (!ref) - return; - var configFileName = server.toNormalizedPath(ref.sourceFile.fileName); - var child = _this.findConfiguredProjectByProjectName(configFileName) || - _this.createAndLoadConfiguredProject(configFileName, "Creating project for reference of project: " + project.projectName); - _this.ensureProjectChildren(child, seenProjects); - }); + forEachResolvedProjectReferenceProject(project, function (child) { return _this.ensureProjectChildren(child, seenProjects); }, ProjectReferenceProjectLoadKind.FindCreateLoad, "Creating project for reference of project: " + project.projectName); }; ProjectService.prototype.cleanupAfterOpeningFile = function (toRetainConfigProjects) { // This was postponed from closeOpenFile to after opening next file, @@ -144452,8 +145071,8 @@ var ts; }; ProjectService.prototype.openClientFileWithNormalizedPath = function (fileName, fileContent, scriptKind, hasMixedContent, projectRootPath) { var info = this.getOrCreateOpenScriptInfo(fileName, fileContent, scriptKind, hasMixedContent, projectRootPath); - var _a = this.assignProjectToOpenedScriptInfo(info), defaultConfigProject = _a.defaultConfigProject, result = __rest(_a, ["defaultConfigProject"]); - this.cleanupAfterOpeningFile(defaultConfigProject); + var _a = this.assignProjectToOpenedScriptInfo(info), retainProjects = _a.retainProjects, result = __rest(_a, ["retainProjects"]); + this.cleanupAfterOpeningFile(retainProjects); this.telemetryOnOpenFile(info); this.printProjects(); return result; @@ -144629,9 +145248,9 @@ var ts; } } // All the script infos now exist, so ok to go update projects for open files - var defaultConfigProjects; + var retainProjects; if (openScriptInfos) { - defaultConfigProjects = ts.mapDefined(openScriptInfos, function (info) { return _this.assignProjectToOpenedScriptInfo(info).defaultConfigProject; }); + retainProjects = ts.flatMap(openScriptInfos, function (info) { return _this.assignProjectToOpenedScriptInfo(info).retainProjects; }); } // While closing files there could be open files that needed assigning new inferred projects, do it now if (assignOrphanScriptInfosToInferredProject) { @@ -144639,7 +145258,7 @@ var ts; } if (openScriptInfos) { // Cleanup projects - this.cleanupAfterOpeningFile(defaultConfigProjects); + this.cleanupAfterOpeningFile(retainProjects); // Telemetry openScriptInfos.forEach(function (info) { return _this.telemetryOnOpenFile(info); }); this.printProjects(); @@ -144975,13 +145594,8 @@ var ts; return config.kind !== undefined; } server.isConfigFile = isConfigFile; - function printProjectsWithCounter(projects, counter) { - for (var _i = 0, projects_4 = projects; _i < projects_4.length; _i++) { - var project = projects_4[_i]; - project.print(counter); - counter++; - } - return counter; + function printProjectWithoutFileNames(project) { + project.print(/*writeProjectFileNames*/ false); } })(server = ts.server || (ts.server = {})); })(ts || (ts = {})); @@ -145335,11 +145949,17 @@ var ts; if (initialLocation) { var defaultDefinition_1 = getDefinitionLocation(defaultProject, initialLocation); if (defaultDefinition_1) { + var getGeneratedDefinition_1 = ts.memoize(function () { return defaultProject.isSourceOfProjectReferenceRedirect(defaultDefinition_1.fileName) ? + defaultDefinition_1 : + defaultProject.getLanguageService().getSourceMapper().tryGetGeneratedPosition(defaultDefinition_1); }); + var getSourceDefinition_1 = ts.memoize(function () { return defaultProject.isSourceOfProjectReferenceRedirect(defaultDefinition_1.fileName) ? + defaultDefinition_1 : + defaultProject.getLanguageService().getSourceMapper().tryGetSourcePosition(defaultDefinition_1); }); projectService.loadAncestorProjectTree(seenProjects); projectService.forEachEnabledProject(function (project) { if (!addToSeen(seenProjects, project)) return; - var definition = mapDefinitionInProject(defaultDefinition_1, defaultProject, project); + var definition = mapDefinitionInProject(defaultDefinition_1, project, getGeneratedDefinition_1, getSourceDefinition_1); if (definition) { toDo = callbackProjectAndLocation({ project: project, location: definition }, projectService, toDo, seenProjects, cb); } @@ -145350,17 +145970,17 @@ var ts; toDo = callbackProjectAndLocation(ts.Debug.checkDefined(toDo.pop()), projectService, toDo, seenProjects, cb); } } - function mapDefinitionInProject(definition, definingProject, project) { + function mapDefinitionInProject(definition, project, getGeneratedDefinition, getSourceDefinition) { // If the definition is actually from the project, definition is correct as is - if (!definition || - project.containsFile(server.toNormalizedPath(definition.fileName)) && - !isLocationProjectReferenceRedirect(project, definition)) { + if (project.containsFile(server.toNormalizedPath(definition.fileName)) && + !isLocationProjectReferenceRedirect(project, definition)) { return definition; } - var mappedDefinition = definingProject.isSourceOfProjectReferenceRedirect(definition.fileName) ? - definition : - definingProject.getLanguageService().getSourceMapper().tryGetGeneratedPosition(definition); - return mappedDefinition && project.containsFile(server.toNormalizedPath(mappedDefinition.fileName)) ? mappedDefinition : undefined; + var generatedDefinition = getGeneratedDefinition(); + if (generatedDefinition && project.containsFile(server.toNormalizedPath(generatedDefinition.fileName))) + return generatedDefinition; + var sourceDefinition = getSourceDefinition(); + return sourceDefinition && project.containsFile(server.toNormalizedPath(sourceDefinition.fileName)) ? sourceDefinition : undefined; } function isLocationProjectReferenceRedirect(project, location) { if (!location) @@ -146102,8 +146722,8 @@ var ts; return; } this.logger.info("cleaning " + caption); - for (var _i = 0, projects_5 = projects; _i < projects_5.length; _i++) { - var p = projects_5[_i]; + for (var _i = 0, projects_4 = projects; _i < projects_4.length; _i++) { + var p = projects_4[_i]; p.getLanguageService(/*ensureSynchronized*/ false).cleanupSemanticCache(); } }; diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts index 91eafc2894e1c..9353a249515fc 100644 --- a/lib/typescript.d.ts +++ b/lib/typescript.d.ts @@ -71,7 +71,7 @@ declare namespace ts { end: number; } export type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind; - export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.OfKeyword; + export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.AwaitedKeyword | SyntaxKind.OfKeyword; export type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; export enum SyntaxKind { Unknown = 0, @@ -203,210 +203,211 @@ declare namespace ts { AnyKeyword = 125, AsyncKeyword = 126, AwaitKeyword = 127, - BooleanKeyword = 128, - ConstructorKeyword = 129, - DeclareKeyword = 130, - GetKeyword = 131, - InferKeyword = 132, - IsKeyword = 133, - KeyOfKeyword = 134, - ModuleKeyword = 135, - NamespaceKeyword = 136, - NeverKeyword = 137, - ReadonlyKeyword = 138, - RequireKeyword = 139, - NumberKeyword = 140, - ObjectKeyword = 141, - SetKeyword = 142, - StringKeyword = 143, - SymbolKeyword = 144, - TypeKeyword = 145, - UndefinedKeyword = 146, - UniqueKeyword = 147, - UnknownKeyword = 148, - FromKeyword = 149, - GlobalKeyword = 150, - BigIntKeyword = 151, - OfKeyword = 152, - QualifiedName = 153, - ComputedPropertyName = 154, - TypeParameter = 155, - Parameter = 156, - Decorator = 157, - PropertySignature = 158, - PropertyDeclaration = 159, - MethodSignature = 160, - MethodDeclaration = 161, - Constructor = 162, - GetAccessor = 163, - SetAccessor = 164, - CallSignature = 165, - ConstructSignature = 166, - IndexSignature = 167, - TypePredicate = 168, - TypeReference = 169, - FunctionType = 170, - ConstructorType = 171, - TypeQuery = 172, - TypeLiteral = 173, - ArrayType = 174, - TupleType = 175, - OptionalType = 176, - RestType = 177, - UnionType = 178, - IntersectionType = 179, - ConditionalType = 180, - InferType = 181, - ParenthesizedType = 182, - ThisType = 183, - TypeOperator = 184, - IndexedAccessType = 185, - MappedType = 186, - LiteralType = 187, - ImportType = 188, - ObjectBindingPattern = 189, - ArrayBindingPattern = 190, - BindingElement = 191, - ArrayLiteralExpression = 192, - ObjectLiteralExpression = 193, - PropertyAccessExpression = 194, - ElementAccessExpression = 195, - CallExpression = 196, - NewExpression = 197, - TaggedTemplateExpression = 198, - TypeAssertionExpression = 199, - ParenthesizedExpression = 200, - FunctionExpression = 201, - ArrowFunction = 202, - DeleteExpression = 203, - TypeOfExpression = 204, - VoidExpression = 205, - AwaitExpression = 206, - PrefixUnaryExpression = 207, - PostfixUnaryExpression = 208, - BinaryExpression = 209, - ConditionalExpression = 210, - TemplateExpression = 211, - YieldExpression = 212, - SpreadElement = 213, - ClassExpression = 214, - OmittedExpression = 215, - ExpressionWithTypeArguments = 216, - AsExpression = 217, - NonNullExpression = 218, - MetaProperty = 219, - SyntheticExpression = 220, - TemplateSpan = 221, - SemicolonClassElement = 222, - Block = 223, - EmptyStatement = 224, - VariableStatement = 225, - ExpressionStatement = 226, - IfStatement = 227, - DoStatement = 228, - WhileStatement = 229, - ForStatement = 230, - ForInStatement = 231, - ForOfStatement = 232, - ContinueStatement = 233, - BreakStatement = 234, - ReturnStatement = 235, - WithStatement = 236, - SwitchStatement = 237, - LabeledStatement = 238, - ThrowStatement = 239, - TryStatement = 240, - DebuggerStatement = 241, - VariableDeclaration = 242, - VariableDeclarationList = 243, - FunctionDeclaration = 244, - ClassDeclaration = 245, - InterfaceDeclaration = 246, - TypeAliasDeclaration = 247, - EnumDeclaration = 248, - ModuleDeclaration = 249, - ModuleBlock = 250, - CaseBlock = 251, - NamespaceExportDeclaration = 252, - ImportEqualsDeclaration = 253, - ImportDeclaration = 254, - ImportClause = 255, - NamespaceImport = 256, - NamedImports = 257, - ImportSpecifier = 258, - ExportAssignment = 259, - ExportDeclaration = 260, - NamedExports = 261, - NamespaceExport = 262, - ExportSpecifier = 263, - MissingDeclaration = 264, - ExternalModuleReference = 265, - JsxElement = 266, - JsxSelfClosingElement = 267, - JsxOpeningElement = 268, - JsxClosingElement = 269, - JsxFragment = 270, - JsxOpeningFragment = 271, - JsxClosingFragment = 272, - JsxAttribute = 273, - JsxAttributes = 274, - JsxSpreadAttribute = 275, - JsxExpression = 276, - CaseClause = 277, - DefaultClause = 278, - HeritageClause = 279, - CatchClause = 280, - PropertyAssignment = 281, - ShorthandPropertyAssignment = 282, - SpreadAssignment = 283, - EnumMember = 284, - UnparsedPrologue = 285, - UnparsedPrepend = 286, - UnparsedText = 287, - UnparsedInternalText = 288, - UnparsedSyntheticReference = 289, - SourceFile = 290, - Bundle = 291, - UnparsedSource = 292, - InputFiles = 293, - JSDocTypeExpression = 294, - JSDocAllType = 295, - JSDocUnknownType = 296, - JSDocNullableType = 297, - JSDocNonNullableType = 298, - JSDocOptionalType = 299, - JSDocFunctionType = 300, - JSDocVariadicType = 301, - JSDocNamepathType = 302, - JSDocComment = 303, - JSDocTypeLiteral = 304, - JSDocSignature = 305, - JSDocTag = 306, - JSDocAugmentsTag = 307, - JSDocImplementsTag = 308, - JSDocAuthorTag = 309, - JSDocClassTag = 310, - JSDocPublicTag = 311, - JSDocPrivateTag = 312, - JSDocProtectedTag = 313, - JSDocReadonlyTag = 314, - JSDocCallbackTag = 315, - JSDocEnumTag = 316, - JSDocParameterTag = 317, - JSDocReturnTag = 318, - JSDocThisTag = 319, - JSDocTypeTag = 320, - JSDocTemplateTag = 321, - JSDocTypedefTag = 322, - JSDocPropertyTag = 323, - SyntaxList = 324, - NotEmittedStatement = 325, - PartiallyEmittedExpression = 326, - CommaListExpression = 327, - MergeDeclarationMarker = 328, - EndOfDeclarationMarker = 329, - SyntheticReferenceExpression = 330, - Count = 331, + AwaitedKeyword = 128, + BooleanKeyword = 129, + ConstructorKeyword = 130, + DeclareKeyword = 131, + GetKeyword = 132, + InferKeyword = 133, + IsKeyword = 134, + KeyOfKeyword = 135, + ModuleKeyword = 136, + NamespaceKeyword = 137, + NeverKeyword = 138, + ReadonlyKeyword = 139, + RequireKeyword = 140, + NumberKeyword = 141, + ObjectKeyword = 142, + SetKeyword = 143, + StringKeyword = 144, + SymbolKeyword = 145, + TypeKeyword = 146, + UndefinedKeyword = 147, + UniqueKeyword = 148, + UnknownKeyword = 149, + FromKeyword = 150, + GlobalKeyword = 151, + BigIntKeyword = 152, + OfKeyword = 153, + QualifiedName = 154, + ComputedPropertyName = 155, + TypeParameter = 156, + Parameter = 157, + Decorator = 158, + PropertySignature = 159, + PropertyDeclaration = 160, + MethodSignature = 161, + MethodDeclaration = 162, + Constructor = 163, + GetAccessor = 164, + SetAccessor = 165, + CallSignature = 166, + ConstructSignature = 167, + IndexSignature = 168, + TypePredicate = 169, + TypeReference = 170, + FunctionType = 171, + ConstructorType = 172, + TypeQuery = 173, + TypeLiteral = 174, + ArrayType = 175, + TupleType = 176, + OptionalType = 177, + RestType = 178, + UnionType = 179, + IntersectionType = 180, + ConditionalType = 181, + InferType = 182, + ParenthesizedType = 183, + ThisType = 184, + TypeOperator = 185, + IndexedAccessType = 186, + MappedType = 187, + LiteralType = 188, + ImportType = 189, + ObjectBindingPattern = 190, + ArrayBindingPattern = 191, + BindingElement = 192, + ArrayLiteralExpression = 193, + ObjectLiteralExpression = 194, + PropertyAccessExpression = 195, + ElementAccessExpression = 196, + CallExpression = 197, + NewExpression = 198, + TaggedTemplateExpression = 199, + TypeAssertionExpression = 200, + ParenthesizedExpression = 201, + FunctionExpression = 202, + ArrowFunction = 203, + DeleteExpression = 204, + TypeOfExpression = 205, + VoidExpression = 206, + AwaitExpression = 207, + PrefixUnaryExpression = 208, + PostfixUnaryExpression = 209, + BinaryExpression = 210, + ConditionalExpression = 211, + TemplateExpression = 212, + YieldExpression = 213, + SpreadElement = 214, + ClassExpression = 215, + OmittedExpression = 216, + ExpressionWithTypeArguments = 217, + AsExpression = 218, + NonNullExpression = 219, + MetaProperty = 220, + SyntheticExpression = 221, + TemplateSpan = 222, + SemicolonClassElement = 223, + Block = 224, + EmptyStatement = 225, + VariableStatement = 226, + ExpressionStatement = 227, + IfStatement = 228, + DoStatement = 229, + WhileStatement = 230, + ForStatement = 231, + ForInStatement = 232, + ForOfStatement = 233, + ContinueStatement = 234, + BreakStatement = 235, + ReturnStatement = 236, + WithStatement = 237, + SwitchStatement = 238, + LabeledStatement = 239, + ThrowStatement = 240, + TryStatement = 241, + DebuggerStatement = 242, + VariableDeclaration = 243, + VariableDeclarationList = 244, + FunctionDeclaration = 245, + ClassDeclaration = 246, + InterfaceDeclaration = 247, + TypeAliasDeclaration = 248, + EnumDeclaration = 249, + ModuleDeclaration = 250, + ModuleBlock = 251, + CaseBlock = 252, + NamespaceExportDeclaration = 253, + ImportEqualsDeclaration = 254, + ImportDeclaration = 255, + ImportClause = 256, + NamespaceImport = 257, + NamedImports = 258, + ImportSpecifier = 259, + ExportAssignment = 260, + ExportDeclaration = 261, + NamedExports = 262, + NamespaceExport = 263, + ExportSpecifier = 264, + MissingDeclaration = 265, + ExternalModuleReference = 266, + JsxElement = 267, + JsxSelfClosingElement = 268, + JsxOpeningElement = 269, + JsxClosingElement = 270, + JsxFragment = 271, + JsxOpeningFragment = 272, + JsxClosingFragment = 273, + JsxAttribute = 274, + JsxAttributes = 275, + JsxSpreadAttribute = 276, + JsxExpression = 277, + CaseClause = 278, + DefaultClause = 279, + HeritageClause = 280, + CatchClause = 281, + PropertyAssignment = 282, + ShorthandPropertyAssignment = 283, + SpreadAssignment = 284, + EnumMember = 285, + UnparsedPrologue = 286, + UnparsedPrepend = 287, + UnparsedText = 288, + UnparsedInternalText = 289, + UnparsedSyntheticReference = 290, + SourceFile = 291, + Bundle = 292, + UnparsedSource = 293, + InputFiles = 294, + JSDocTypeExpression = 295, + JSDocAllType = 296, + JSDocUnknownType = 297, + JSDocNullableType = 298, + JSDocNonNullableType = 299, + JSDocOptionalType = 300, + JSDocFunctionType = 301, + JSDocVariadicType = 302, + JSDocNamepathType = 303, + JSDocComment = 304, + JSDocTypeLiteral = 305, + JSDocSignature = 306, + JSDocTag = 307, + JSDocAugmentsTag = 308, + JSDocImplementsTag = 309, + JSDocAuthorTag = 310, + JSDocClassTag = 311, + JSDocPublicTag = 312, + JSDocPrivateTag = 313, + JSDocProtectedTag = 314, + JSDocReadonlyTag = 315, + JSDocCallbackTag = 316, + JSDocEnumTag = 317, + JSDocParameterTag = 318, + JSDocReturnTag = 319, + JSDocThisTag = 320, + JSDocTypeTag = 321, + JSDocTemplateTag = 322, + JSDocTypedefTag = 323, + JSDocPropertyTag = 324, + SyntaxList = 325, + NotEmittedStatement = 326, + PartiallyEmittedExpression = 327, + CommaListExpression = 328, + MergeDeclarationMarker = 329, + EndOfDeclarationMarker = 330, + SyntheticReferenceExpression = 331, + Count = 332, FirstAssignment = 62, LastAssignment = 74, FirstCompoundAssignment = 63, @@ -414,15 +415,15 @@ declare namespace ts { FirstReservedWord = 77, LastReservedWord = 112, FirstKeyword = 77, - LastKeyword = 152, + LastKeyword = 153, FirstFutureReservedWord = 113, LastFutureReservedWord = 121, - FirstTypeNode = 168, - LastTypeNode = 188, + FirstTypeNode = 169, + LastTypeNode = 189, FirstPunctuation = 18, LastPunctuation = 74, FirstToken = 0, - LastToken = 152, + LastToken = 153, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -431,13 +432,13 @@ declare namespace ts { LastTemplateToken = 17, FirstBinaryOperator = 29, LastBinaryOperator = 74, - FirstStatement = 225, - LastStatement = 241, - FirstNode = 153, - FirstJSDocNode = 294, - LastJSDocNode = 323, - FirstJSDocTagNode = 306, - LastJSDocTagNode = 323, + FirstStatement = 226, + LastStatement = 242, + FirstNode = 154, + FirstJSDocNode = 295, + LastJSDocNode = 324, + FirstJSDocTagNode = 307, + LastJSDocTagNode = 324, } export enum NodeFlags { None = 0, @@ -844,7 +845,7 @@ declare namespace ts { } export interface TypeOperatorNode extends TypeNode { kind: SyntaxKind.TypeOperator; - operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword; + operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.AwaitedKeyword; type: TypeNode; } export interface IndexedAccessTypeNode extends TypeNode { @@ -1924,7 +1925,8 @@ declare namespace ts { /** @throws OperationCanceledException if isCancellationRequested is true */ throwIfCancellationRequested(): void; } - export interface Program extends ScriptReferenceHost { + export interface Program extends ScriptReferenceHost, ModuleSpecifierResolutionHost { + getCurrentDirectory(): string; /** * Get a list of root file names that were passed to a 'createProgram' */ @@ -2359,6 +2361,7 @@ declare namespace ts { Conditional = 16777216, Substitution = 33554432, NonPrimitive = 67108864, + Awaited = 134217728, Literal = 2944, Unit = 109440, StringOrNumberLiteral = 384, @@ -2373,11 +2376,11 @@ declare namespace ts { UnionOrIntersection = 3145728, StructuredType = 3670016, TypeVariable = 8650752, - InstantiableNonPrimitive = 58982400, + InstantiableNonPrimitive = 193200128, InstantiablePrimitive = 4194304, - Instantiable = 63176704, - StructuredOrInstantiable = 66846720, - Narrowable = 133970943, + Instantiable = 197394432, + StructuredOrInstantiable = 201064448, + Narrowable = 268188671, NotUnionOrUnit = 67637251, } export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; @@ -2522,9 +2525,12 @@ declare namespace ts { resolvedFalseType: Type; } export interface SubstitutionType extends InstantiableType { - typeVariable: TypeVariable; + baseType: Type; substitute: Type; } + export interface AwaitedType extends InstantiableType { + awaitedType: Type; + } export enum SignatureKind { Call = 0, Construct = 1 @@ -2917,7 +2923,7 @@ declare namespace ts { } export interface ResolvedTypeReferenceDirectiveWithFailedLookupLocations { readonly resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective | undefined; - readonly failedLookupLocations: readonly string[]; + readonly failedLookupLocations: string[]; } export interface CompilerHost extends ModuleResolutionHost { getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean): SourceFile | undefined; @@ -4070,7 +4076,7 @@ declare namespace ts { function updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode; function createThisTypeNode(): ThisTypeNode; function createTypeOperatorNode(type: TypeNode): TypeOperatorNode; - function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode; + function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.AwaitedKeyword, type: TypeNode): TypeOperatorNode; function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; function updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; @@ -4757,6 +4763,8 @@ declare namespace ts { resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[]; } interface WatchCompilerHost extends ProgramHost, WatchHost { + /** Instead of using output d.ts file from project reference, use its source file */ + useSourceOfProjectReferenceRedirect?(): boolean; /** If provided, callback to invoke after every new program creation */ afterProgramCreate?(program: T): void; } @@ -5136,25 +5144,88 @@ declare namespace ts { metadata?: unknown; }; interface LanguageService { + /** This is used as a part of restarting the language service. */ cleanupSemanticCache(): void; + /** + * Gets errors indicating invalid syntax in a file. + * + * In English, "this cdeo have, erorrs" is syntactically invalid because it has typos, + * grammatical errors, and misplaced punctuation. Likewise, examples of syntax + * errors in TypeScript are missing parentheses in an `if` statement, mismatched + * curly braces, and using a reserved keyword as a variable name. + * + * These diagnostics are inexpensive to compute and don't require knowledge of + * other files. Note that a non-empty result increases the likelihood of false positives + * from `getSemanticDiagnostics`. + * + * While these represent the majority of syntax-related diagnostics, there are some + * that require the type system, which will be present in `getSemanticDiagnostics`. + * + * @param fileName A path to the file you want syntactic diagnostics for + */ getSyntacticDiagnostics(fileName: string): DiagnosticWithLocation[]; - /** The first time this is called, it will return global diagnostics (no location). */ + /** + * Gets warnings or errors indicating type system issues in a given file. + * Requesting semantic diagnostics may start up the type system and + * run deferred work, so the first call may take longer than subsequent calls. + * + * Unlike the other get*Diagnostics functions, these diagnostics can potentially not + * include a reference to a source file. Specifically, the first time this is called, + * it will return global diagnostics with no associated location. + * + * To contrast the differences between semantic and syntactic diagnostics, consider the + * sentence: "The sun is green." is syntactically correct; those are real English words with + * correct sentence structure. However, it is semantically invalid, because it is not true. + * + * @param fileName A path to the file you want semantic diagnostics for + */ getSemanticDiagnostics(fileName: string): Diagnostic[]; - getSuggestionDiagnostics(fileName: string): DiagnosticWithLocation[]; - getCompilerOptionsDiagnostics(): Diagnostic[]; /** - * @deprecated Use getEncodedSyntacticClassifications instead. + * Gets suggestion diagnostics for a specific file. These diagnostics tend to + * proactively suggest refactors, as opposed to diagnostics that indicate + * potentially incorrect runtime behavior. + * + * @param fileName A path to the file you want semantic diagnostics for */ - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; + getSuggestionDiagnostics(fileName: string): DiagnosticWithLocation[]; /** - * @deprecated Use getEncodedSemanticClassifications instead. + * Gets global diagnostics related to the program configuration and compiler options. */ + getCompilerOptionsDiagnostics(): Diagnostic[]; + /** @deprecated Use getEncodedSyntacticClassifications instead. */ + getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; + /** @deprecated Use getEncodedSemanticClassifications instead. */ getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications; getEncodedSemanticClassifications(fileName: string, span: TextSpan): Classifications; + /** + * Gets completion entries at a particular position in a file. + * + * @param fileName The path to the file + * @param position A zero-based index of the character where you want the entries + * @param options An object describing how the request was triggered and what kinds + * of code actions can be returned with the completions. + */ getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined): WithMetadata | undefined; - getCompletionEntryDetails(fileName: string, position: number, name: string, formatOptions: FormatCodeOptions | FormatCodeSettings | undefined, source: string | undefined, preferences: UserPreferences | undefined): CompletionEntryDetails | undefined; + /** + * Gets the extended details for a completion entry retrieved from `getCompletionsAtPosition`. + * + * @param fileName The path to the file + * @param position A zero based index of the character where you want the entries + * @param entryName The name from an existing completion which came from `getCompletionsAtPosition` + * @param formatOptions How should code samples in the completions be formatted, can be undefined for backwards compatibility + * @param source Source code for the current file, can be undefined for backwards compatibility + * @param preferences User settings, can be undefined for backwards compatibility + */ + getCompletionEntryDetails(fileName: string, position: number, entryName: string, formatOptions: FormatCodeOptions | FormatCodeSettings | undefined, source: string | undefined, preferences: UserPreferences | undefined): CompletionEntryDetails | undefined; getCompletionEntrySymbol(fileName: string, position: number, name: string, source: string | undefined): Symbol | undefined; + /** + * Gets semantic information about the identifier at a particular position in a + * file. Quick info is what you typically see when you hover in an editor. + * + * @param fileName The path to the file + * @param position A zero-based index of the character where you want the quick info + */ getQuickInfoAtPosition(fileName: string, position: number): QuickInfo | undefined; getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan | undefined; getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan | undefined; @@ -5509,6 +5580,7 @@ declare namespace ts { newLineCharacter?: string; convertTabsToSpaces?: boolean; indentStyle?: IndentStyle; + trimTrailingWhitespace?: boolean; } interface FormatCodeOptions extends EditorOptions { InsertSpaceAfterCommaDelimiter: boolean; @@ -5538,6 +5610,7 @@ declare namespace ts { readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean; readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean; readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean; + readonly insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean; readonly insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean; readonly insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean; readonly insertSpaceAfterTypeAssertion?: boolean; diff --git a/lib/typescript.js b/lib/typescript.js index e88bb827fd18d..7a4b6c9d8d8bd 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -3203,233 +3203,234 @@ var ts; SyntaxKind[SyntaxKind["AnyKeyword"] = 125] = "AnyKeyword"; SyntaxKind[SyntaxKind["AsyncKeyword"] = 126] = "AsyncKeyword"; SyntaxKind[SyntaxKind["AwaitKeyword"] = 127] = "AwaitKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 128] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 129] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 130] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 131] = "GetKeyword"; - SyntaxKind[SyntaxKind["InferKeyword"] = 132] = "InferKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 133] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 134] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 135] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 136] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 137] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 138] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 139] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 140] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 141] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 142] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 143] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 144] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 145] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 146] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 147] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["UnknownKeyword"] = 148] = "UnknownKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 149] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 150] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["BigIntKeyword"] = 151] = "BigIntKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 152] = "OfKeyword"; + SyntaxKind[SyntaxKind["AwaitedKeyword"] = 128] = "AwaitedKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 129] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 130] = "ConstructorKeyword"; + SyntaxKind[SyntaxKind["DeclareKeyword"] = 131] = "DeclareKeyword"; + SyntaxKind[SyntaxKind["GetKeyword"] = 132] = "GetKeyword"; + SyntaxKind[SyntaxKind["InferKeyword"] = 133] = "InferKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 134] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 135] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 136] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 137] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 138] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 139] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 140] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 141] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 142] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 143] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 144] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 145] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 146] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 147] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 148] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["UnknownKeyword"] = 149] = "UnknownKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 150] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 151] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["BigIntKeyword"] = 152] = "BigIntKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 153] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 153] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 154] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 154] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 155] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 155] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 156] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 157] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 156] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 157] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 158] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 158] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 159] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 160] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 161] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 162] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 163] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 164] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 165] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 166] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 167] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 159] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 160] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 161] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 162] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 163] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 164] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 165] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 166] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 167] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 168] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 168] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 169] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 170] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 171] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 172] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 173] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 174] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 175] = "TupleType"; - SyntaxKind[SyntaxKind["OptionalType"] = 176] = "OptionalType"; - SyntaxKind[SyntaxKind["RestType"] = 177] = "RestType"; - SyntaxKind[SyntaxKind["UnionType"] = 178] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 179] = "IntersectionType"; - SyntaxKind[SyntaxKind["ConditionalType"] = 180] = "ConditionalType"; - SyntaxKind[SyntaxKind["InferType"] = 181] = "InferType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 182] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 183] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 184] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 185] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 186] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 187] = "LiteralType"; - SyntaxKind[SyntaxKind["ImportType"] = 188] = "ImportType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 169] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 170] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 171] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 172] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 173] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 174] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 175] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 176] = "TupleType"; + SyntaxKind[SyntaxKind["OptionalType"] = 177] = "OptionalType"; + SyntaxKind[SyntaxKind["RestType"] = 178] = "RestType"; + SyntaxKind[SyntaxKind["UnionType"] = 179] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 180] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 181] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 182] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 183] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 184] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 185] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 186] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 187] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 188] = "LiteralType"; + SyntaxKind[SyntaxKind["ImportType"] = 189] = "ImportType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 189] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 190] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 191] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 190] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 191] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 192] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 192] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 193] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 194] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 195] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 196] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 197] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 198] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 199] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 200] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 201] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 202] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 203] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 204] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 205] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 206] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 207] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 208] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 209] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 210] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 211] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 212] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 213] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 214] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 215] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 216] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 217] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 218] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 219] = "MetaProperty"; - SyntaxKind[SyntaxKind["SyntheticExpression"] = 220] = "SyntheticExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 193] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 194] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 195] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 196] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 197] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 198] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 199] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 200] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 201] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 202] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 203] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 204] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 205] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 206] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 207] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 208] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 209] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 210] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 211] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 212] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 213] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 214] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 215] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 216] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 217] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 218] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 219] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 220] = "MetaProperty"; + SyntaxKind[SyntaxKind["SyntheticExpression"] = 221] = "SyntheticExpression"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 221] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 222] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 222] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 223] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 223] = "Block"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 224] = "EmptyStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 225] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 226] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 227] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 228] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 229] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 230] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 231] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 232] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 233] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 234] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 235] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 236] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 237] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 238] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 239] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 240] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 241] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 242] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 243] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 244] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 245] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 246] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 247] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 248] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 249] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 250] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 251] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 252] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 253] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 254] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 255] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 256] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 257] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 258] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 259] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 260] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 261] = "NamedExports"; - SyntaxKind[SyntaxKind["NamespaceExport"] = 262] = "NamespaceExport"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 263] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 264] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 224] = "Block"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 225] = "EmptyStatement"; + SyntaxKind[SyntaxKind["VariableStatement"] = 226] = "VariableStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 227] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 228] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 229] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 230] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 231] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 232] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 233] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 234] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 235] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 236] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 237] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 238] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 239] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 240] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 241] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 242] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 243] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 244] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 245] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 246] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 247] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 248] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 249] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 250] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 251] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 252] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 253] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 254] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 255] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 256] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 257] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 258] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 259] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 260] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 261] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 262] = "NamedExports"; + SyntaxKind[SyntaxKind["NamespaceExport"] = 263] = "NamespaceExport"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 264] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 265] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 265] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 266] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 266] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 267] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 268] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 269] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 270] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 271] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 272] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 273] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 274] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 275] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 276] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 267] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 268] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 269] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 270] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 271] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 272] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 273] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 274] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 275] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 276] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 277] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 277] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 278] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 279] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 280] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 278] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 279] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 280] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 281] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 281] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 282] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 283] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 282] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 283] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 284] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 284] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 285] = "EnumMember"; // Unparsed - SyntaxKind[SyntaxKind["UnparsedPrologue"] = 285] = "UnparsedPrologue"; - SyntaxKind[SyntaxKind["UnparsedPrepend"] = 286] = "UnparsedPrepend"; - SyntaxKind[SyntaxKind["UnparsedText"] = 287] = "UnparsedText"; - SyntaxKind[SyntaxKind["UnparsedInternalText"] = 288] = "UnparsedInternalText"; - SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 289] = "UnparsedSyntheticReference"; + SyntaxKind[SyntaxKind["UnparsedPrologue"] = 286] = "UnparsedPrologue"; + SyntaxKind[SyntaxKind["UnparsedPrepend"] = 287] = "UnparsedPrepend"; + SyntaxKind[SyntaxKind["UnparsedText"] = 288] = "UnparsedText"; + SyntaxKind[SyntaxKind["UnparsedInternalText"] = 289] = "UnparsedInternalText"; + SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 290] = "UnparsedSyntheticReference"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 290] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 291] = "Bundle"; - SyntaxKind[SyntaxKind["UnparsedSource"] = 292] = "UnparsedSource"; - SyntaxKind[SyntaxKind["InputFiles"] = 293] = "InputFiles"; + SyntaxKind[SyntaxKind["SourceFile"] = 291] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 292] = "Bundle"; + SyntaxKind[SyntaxKind["UnparsedSource"] = 293] = "UnparsedSource"; + SyntaxKind[SyntaxKind["InputFiles"] = 294] = "InputFiles"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 294] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 295] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 295] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 296] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 296] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 297] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 298] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 299] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 300] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 301] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 297] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 298] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 299] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 300] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 301] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 302] = "JSDocVariadicType"; // https://jsdoc.app/about-namepaths.html - SyntaxKind[SyntaxKind["JSDocNamepathType"] = 302] = "JSDocNamepathType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 303] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 304] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocSignature"] = 305] = "JSDocSignature"; - SyntaxKind[SyntaxKind["JSDocTag"] = 306] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 307] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 308] = "JSDocImplementsTag"; - SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 309] = "JSDocAuthorTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 310] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocPublicTag"] = 311] = "JSDocPublicTag"; - SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 312] = "JSDocPrivateTag"; - SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 313] = "JSDocProtectedTag"; - SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 314] = "JSDocReadonlyTag"; - SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 315] = "JSDocCallbackTag"; - SyntaxKind[SyntaxKind["JSDocEnumTag"] = 316] = "JSDocEnumTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 317] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 318] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocThisTag"] = 319] = "JSDocThisTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 320] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 321] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 322] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 323] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocNamepathType"] = 303] = "JSDocNamepathType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 304] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 305] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocSignature"] = 306] = "JSDocSignature"; + SyntaxKind[SyntaxKind["JSDocTag"] = 307] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 308] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 309] = "JSDocImplementsTag"; + SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 310] = "JSDocAuthorTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 311] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocPublicTag"] = 312] = "JSDocPublicTag"; + SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 313] = "JSDocPrivateTag"; + SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 314] = "JSDocProtectedTag"; + SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 315] = "JSDocReadonlyTag"; + SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 316] = "JSDocCallbackTag"; + SyntaxKind[SyntaxKind["JSDocEnumTag"] = 317] = "JSDocEnumTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 318] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 319] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocThisTag"] = 320] = "JSDocThisTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 321] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 322] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 323] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 324] = "JSDocPropertyTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 324] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 325] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 325] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 326] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 327] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 328] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 329] = "EndOfDeclarationMarker"; - SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 330] = "SyntheticReferenceExpression"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 326] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 327] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 328] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 329] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 330] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 331] = "SyntheticReferenceExpression"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 331] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 332] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 62] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 74] = "LastAssignment"; @@ -3438,15 +3439,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 77] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 112] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 77] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 152] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 153] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 113] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 121] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 168] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 188] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 169] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 189] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 18] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 74] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 152] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 153] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -3455,15 +3456,15 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 17] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 29] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 74] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstStatement"] = 225] = "FirstStatement"; - SyntaxKind[SyntaxKind["LastStatement"] = 241] = "LastStatement"; - SyntaxKind[SyntaxKind["FirstNode"] = 153] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 294] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 323] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 306] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 323] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstStatement"] = 226] = "FirstStatement"; + SyntaxKind[SyntaxKind["LastStatement"] = 242] = "LastStatement"; + SyntaxKind[SyntaxKind["FirstNode"] = 154] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 295] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 324] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 307] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 324] = "LastJSDocTagNode"; /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 122] = "FirstContextualKeyword"; - /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 152] = "LastContextualKeyword"; + /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 153] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -3619,6 +3620,12 @@ var ts; FlowFlags[FlowFlags["Label"] = 12] = "Label"; FlowFlags[FlowFlags["Condition"] = 96] = "Condition"; })(FlowFlags = ts.FlowFlags || (ts.FlowFlags = {})); + /* @internal */ + var CommentDirectiveType; + (function (CommentDirectiveType) { + CommentDirectiveType[CommentDirectiveType["ExpectError"] = 0] = "ExpectError"; + CommentDirectiveType[CommentDirectiveType["Ignore"] = 1] = "Ignore"; + })(CommentDirectiveType = ts.CommentDirectiveType || (ts.CommentDirectiveType = {})); var OperationCanceledException = /** @class */ (function () { function OperationCanceledException() { } @@ -4003,6 +4010,7 @@ var ts; TypeFlags[TypeFlags["Conditional"] = 16777216] = "Conditional"; TypeFlags[TypeFlags["Substitution"] = 33554432] = "Substitution"; TypeFlags[TypeFlags["NonPrimitive"] = 67108864] = "NonPrimitive"; + TypeFlags[TypeFlags["Awaited"] = 134217728] = "Awaited"; /* @internal */ TypeFlags[TypeFlags["AnyOrUnknown"] = 3] = "AnyOrUnknown"; /* @internal */ @@ -4031,10 +4039,10 @@ var ts; TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType"; TypeFlags[TypeFlags["TypeVariable"] = 8650752] = "TypeVariable"; - TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 58982400] = "InstantiableNonPrimitive"; + TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 193200128] = "InstantiableNonPrimitive"; TypeFlags[TypeFlags["InstantiablePrimitive"] = 4194304] = "InstantiablePrimitive"; - TypeFlags[TypeFlags["Instantiable"] = 63176704] = "Instantiable"; - TypeFlags[TypeFlags["StructuredOrInstantiable"] = 66846720] = "StructuredOrInstantiable"; + TypeFlags[TypeFlags["Instantiable"] = 197394432] = "Instantiable"; + TypeFlags[TypeFlags["StructuredOrInstantiable"] = 201064448] = "StructuredOrInstantiable"; /* @internal */ TypeFlags[TypeFlags["ObjectFlagsType"] = 3899393] = "ObjectFlagsType"; /* @internal */ @@ -4043,10 +4051,10 @@ var ts; TypeFlags[TypeFlags["Substructure"] = 66584576] = "Substructure"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 133970943] = "Narrowable"; + TypeFlags[TypeFlags["Narrowable"] = 268188671] = "Narrowable"; TypeFlags[TypeFlags["NotUnionOrUnit"] = 67637251] = "NotUnionOrUnit"; /* @internal */ - TypeFlags[TypeFlags["NotPrimitiveUnion"] = 66994211] = "NotPrimitiveUnion"; + TypeFlags[TypeFlags["NotPrimitiveUnion"] = 201211939] = "NotPrimitiveUnion"; // The following flags are aggregated during union and intersection type construction /* @internal */ TypeFlags[TypeFlags["IncludesMask"] = 71041023] = "IncludesMask"; @@ -4145,6 +4153,7 @@ var ts; SignatureFlags[SignatureFlags["HasLiteralTypes"] = 2] = "HasLiteralTypes"; SignatureFlags[SignatureFlags["IsInnerCallChain"] = 4] = "IsInnerCallChain"; SignatureFlags[SignatureFlags["IsOuterCallChain"] = 8] = "IsOuterCallChain"; + SignatureFlags[SignatureFlags["IsUntypedSignatureInJSFile"] = 16] = "IsUntypedSignatureInJSFile"; // We do not propagate `IsInnerCallChain` to instantiated signatures, as that would result in us // attempting to add `| undefined` on each recursive call to `getReturnTypeOfSignature` when // instantiating the return type. @@ -4156,6 +4165,15 @@ var ts; IndexKind[IndexKind["String"] = 0] = "String"; IndexKind[IndexKind["Number"] = 1] = "Number"; })(IndexKind = ts.IndexKind || (ts.IndexKind = {})); + /* @internal */ + var TypeMapKind; + (function (TypeMapKind) { + TypeMapKind[TypeMapKind["Simple"] = 0] = "Simple"; + TypeMapKind[TypeMapKind["Array"] = 1] = "Array"; + TypeMapKind[TypeMapKind["Function"] = 2] = "Function"; + TypeMapKind[TypeMapKind["Composite"] = 3] = "Composite"; + TypeMapKind[TypeMapKind["Merged"] = 4] = "Merged"; + })(TypeMapKind = ts.TypeMapKind || (ts.TypeMapKind = {})); var InferencePriority; (function (InferencePriority) { InferencePriority[InferencePriority["NakedTypeVariable"] = 1] = "NakedTypeVariable"; @@ -6749,6 +6767,10 @@ var ts; } } ts.forEachAncestorDirectory = forEachAncestorDirectory; + function isNodeModulesDirectory(dirPath) { + return ts.endsWith(dirPath, "/node_modules"); + } + ts.isNodeModulesDirectory = isNodeModulesDirectory; })(ts || (ts = {})); // // generated from './diagnosticInformationMap.generated.ts' by 'src/compiler' @@ -7059,7 +7081,7 @@ var ts; Cannot_find_name_0: diag(2304, ts.DiagnosticCategory.Error, "Cannot_find_name_0_2304", "Cannot find name '{0}'."), Module_0_has_no_exported_member_1: diag(2305, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_2305", "Module '{0}' has no exported member '{1}'."), File_0_is_not_a_module: diag(2306, ts.DiagnosticCategory.Error, "File_0_is_not_a_module_2306", "File '{0}' is not a module."), - Cannot_find_module_0: diag(2307, ts.DiagnosticCategory.Error, "Cannot_find_module_0_2307", "Cannot find module '{0}'."), + Cannot_find_module_0_or_its_corresponding_type_declarations: diag(2307, ts.DiagnosticCategory.Error, "Cannot_find_module_0_or_its_corresponding_type_declarations_2307", "Cannot find module '{0}' or its corresponding type declarations."), Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: diag(2308, ts.DiagnosticCategory.Error, "Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308", "Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."), An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: diag(2309, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", "An export assignment cannot be used in a module with other exported elements."), Type_0_recursively_references_itself_as_a_base_type: diag(2310, ts.DiagnosticCategory.Error, "Type_0_recursively_references_itself_as_a_base_type_2310", "Type '{0}' recursively references itself as a base type."), @@ -7319,6 +7341,7 @@ var ts; No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments: diag(2575, ts.DiagnosticCategory.Error, "No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575", "No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."), Property_0_is_a_static_member_of_type_1: diag(2576, ts.DiagnosticCategory.Error, "Property_0_is_a_static_member_of_type_1_2576", "Property '{0}' is a static member of type '{1}'"), Return_type_annotation_circularly_references_itself: diag(2577, ts.DiagnosticCategory.Error, "Return_type_annotation_circularly_references_itself_2577", "Return type annotation circularly references itself."), + Unused_ts_expect_error_directive: diag(2578, ts.DiagnosticCategory.Error, "Unused_ts_expect_error_directive_2578", "Unused '@ts-expect-error' directive."), Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`."), Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`."), Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`."), @@ -7447,7 +7470,7 @@ var ts; This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided: diag(2746, ts.DiagnosticCategory.Error, "This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746", "This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."), _0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2: diag(2747, ts.DiagnosticCategory.Error, "_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747", "'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."), Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided: diag(2748, ts.DiagnosticCategory.Error, "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748", "Cannot access ambient const enums when the '--isolatedModules' flag is provided."), - _0_refers_to_a_value_but_is_being_used_as_a_type_here: diag(2749, ts.DiagnosticCategory.Error, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_2749", "'{0}' refers to a value, but is being used as a type here."), + _0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0: diag(2749, ts.DiagnosticCategory.Error, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749", "'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"), The_implementation_signature_is_declared_here: diag(2750, ts.DiagnosticCategory.Error, "The_implementation_signature_is_declared_here_2750", "The implementation signature is declared here."), Circularity_originates_in_type_at_this_location: diag(2751, ts.DiagnosticCategory.Error, "Circularity_originates_in_type_at_this_location_2751", "Circularity originates in type at this location."), The_first_export_default_is_here: diag(2752, ts.DiagnosticCategory.Error, "The_first_export_default_is_here_2752", "The first export default is here."), @@ -7482,6 +7505,7 @@ var ts; The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access: diag(2781, ts.DiagnosticCategory.Error, "The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781", "The left-hand side of a 'for...of' statement may not be an optional property access."), _0_needs_an_explicit_type_annotation: diag(2782, ts.DiagnosticCategory.Message, "_0_needs_an_explicit_type_annotation_2782", "'{0}' needs an explicit type annotation."), _0_is_specified_more_than_once_so_this_usage_will_be_overwritten: diag(2783, ts.DiagnosticCategory.Error, "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783", "'{0}' is specified more than once, so this usage will be overwritten."), + get_and_set_accessors_cannot_declare_this_parameters: diag(2784, ts.DiagnosticCategory.Error, "get_and_set_accessors_cannot_declare_this_parameters_2784", "'get' and 'set' accessors cannot declare 'this' parameters."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -7616,6 +7640,7 @@ var ts; Unknown_watch_option_0_Did_you_mean_1: diag(5079, ts.DiagnosticCategory.Error, "Unknown_watch_option_0_Did_you_mean_1_5079", "Unknown watch option '{0}'. Did you mean '{1}'?"), Watch_option_0_requires_a_value_of_type_1: diag(5080, ts.DiagnosticCategory.Error, "Watch_option_0_requires_a_value_of_type_1_5080", "Watch option '{0}' requires a value of type {1}."), Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0: diag(5081, ts.DiagnosticCategory.Error, "Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081", "Cannot find a tsconfig.json file at the current directory: {0}."), + _0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1: diag(5082, ts.DiagnosticCategory.Error, "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082", "'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6000, ts.DiagnosticCategory.Message, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, ts.DiagnosticCategory.Message, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, ts.DiagnosticCategory.Message, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -8028,6 +8053,7 @@ var ts; Import_default_0_from_module_1: diag(90032, ts.DiagnosticCategory.Message, "Import_default_0_from_module_1_90032", "Import default '{0}' from module \"{1}\""), Add_default_import_0_to_existing_import_declaration_from_1: diag(90033, ts.DiagnosticCategory.Message, "Add_default_import_0_to_existing_import_declaration_from_1_90033", "Add default import '{0}' to existing import declaration from \"{1}\""), Add_parameter_name: diag(90034, ts.DiagnosticCategory.Message, "Add_parameter_name_90034", "Add parameter name"), + Declare_private_property_0: diag(90035, ts.DiagnosticCategory.Message, "Declare_private_property_0_90035", "Declare private property '{0}'"), Declare_a_private_field_named_0: diag(90053, ts.DiagnosticCategory.Message, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), @@ -8093,6 +8119,8 @@ var ts; Add_all_missing_imports: diag(95064, ts.DiagnosticCategory.Message, "Add_all_missing_imports_95064", "Add all missing imports"), Convert_to_async_function: diag(95065, ts.DiagnosticCategory.Message, "Convert_to_async_function_95065", "Convert to async function"), Convert_all_to_async_functions: diag(95066, ts.DiagnosticCategory.Message, "Convert_all_to_async_functions_95066", "Convert all to async functions"), + Add_missing_call_parentheses: diag(95067, ts.DiagnosticCategory.Message, "Add_missing_call_parentheses_95067", "Add missing call parentheses"), + Add_all_missing_call_parentheses: diag(95068, ts.DiagnosticCategory.Message, "Add_all_missing_call_parentheses_95068", "Add all missing call parentheses"), Add_unknown_conversion_for_non_overlapping_types: diag(95069, ts.DiagnosticCategory.Message, "Add_unknown_conversion_for_non_overlapping_types_95069", "Add 'unknown' conversion for non-overlapping types"), Add_unknown_to_all_conversions_of_non_overlapping_types: diag(95070, ts.DiagnosticCategory.Message, "Add_unknown_to_all_conversions_of_non_overlapping_types_95070", "Add 'unknown' to all conversions of non-overlapping types"), Add_missing_new_operator_to_call: diag(95071, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_call_95071", "Add missing 'new' operator to call"), @@ -8168,8 +8196,8 @@ var ts; any: 125 /* AnyKeyword */, as: 123 /* AsKeyword */, asserts: 124 /* AssertsKeyword */, - bigint: 151 /* BigIntKeyword */, - boolean: 128 /* BooleanKeyword */, + bigint: 152 /* BigIntKeyword */, + boolean: 129 /* BooleanKeyword */, break: 77 /* BreakKeyword */, case: 78 /* CaseKeyword */, catch: 79 /* CatchKeyword */, @@ -8177,9 +8205,9 @@ var ts; continue: 82 /* ContinueKeyword */, const: 81 /* ConstKeyword */ }, - _a["" + "constructor"] = 129 /* ConstructorKeyword */, + _a["" + "constructor"] = 130 /* ConstructorKeyword */, _a.debugger = 83 /* DebuggerKeyword */, - _a.declare = 130 /* DeclareKeyword */, + _a.declare = 131 /* DeclareKeyword */, _a.default = 84 /* DefaultKeyword */, _a.delete = 85 /* DeleteKeyword */, _a.do = 86 /* DoKeyword */, @@ -8190,49 +8218,49 @@ var ts; _a.false = 91 /* FalseKeyword */, _a.finally = 92 /* FinallyKeyword */, _a.for = 93 /* ForKeyword */, - _a.from = 149 /* FromKeyword */, + _a.from = 150 /* FromKeyword */, _a.function = 94 /* FunctionKeyword */, - _a.get = 131 /* GetKeyword */, + _a.get = 132 /* GetKeyword */, _a.if = 95 /* IfKeyword */, _a.implements = 113 /* ImplementsKeyword */, _a.import = 96 /* ImportKeyword */, _a.in = 97 /* InKeyword */, - _a.infer = 132 /* InferKeyword */, + _a.infer = 133 /* InferKeyword */, _a.instanceof = 98 /* InstanceOfKeyword */, _a.interface = 114 /* InterfaceKeyword */, - _a.is = 133 /* IsKeyword */, - _a.keyof = 134 /* KeyOfKeyword */, + _a.is = 134 /* IsKeyword */, + _a.keyof = 135 /* KeyOfKeyword */, _a.let = 115 /* LetKeyword */, - _a.module = 135 /* ModuleKeyword */, - _a.namespace = 136 /* NamespaceKeyword */, - _a.never = 137 /* NeverKeyword */, + _a.module = 136 /* ModuleKeyword */, + _a.namespace = 137 /* NamespaceKeyword */, + _a.never = 138 /* NeverKeyword */, _a.new = 99 /* NewKeyword */, _a.null = 100 /* NullKeyword */, - _a.number = 140 /* NumberKeyword */, - _a.object = 141 /* ObjectKeyword */, + _a.number = 141 /* NumberKeyword */, + _a.object = 142 /* ObjectKeyword */, _a.package = 116 /* PackageKeyword */, _a.private = 117 /* PrivateKeyword */, _a.protected = 118 /* ProtectedKeyword */, _a.public = 119 /* PublicKeyword */, - _a.readonly = 138 /* ReadonlyKeyword */, - _a.require = 139 /* RequireKeyword */, - _a.global = 150 /* GlobalKeyword */, + _a.readonly = 139 /* ReadonlyKeyword */, + _a.require = 140 /* RequireKeyword */, + _a.global = 151 /* GlobalKeyword */, _a.return = 101 /* ReturnKeyword */, - _a.set = 142 /* SetKeyword */, + _a.set = 143 /* SetKeyword */, _a.static = 120 /* StaticKeyword */, - _a.string = 143 /* StringKeyword */, + _a.string = 144 /* StringKeyword */, _a.super = 102 /* SuperKeyword */, _a.switch = 103 /* SwitchKeyword */, - _a.symbol = 144 /* SymbolKeyword */, + _a.symbol = 145 /* SymbolKeyword */, _a.this = 104 /* ThisKeyword */, _a.throw = 105 /* ThrowKeyword */, _a.true = 106 /* TrueKeyword */, _a.try = 107 /* TryKeyword */, - _a.type = 145 /* TypeKeyword */, + _a.type = 146 /* TypeKeyword */, _a.typeof = 108 /* TypeOfKeyword */, - _a.undefined = 146 /* UndefinedKeyword */, - _a.unique = 147 /* UniqueKeyword */, - _a.unknown = 148 /* UnknownKeyword */, + _a.undefined = 147 /* UndefinedKeyword */, + _a.unique = 148 /* UniqueKeyword */, + _a.unknown = 149 /* UnknownKeyword */, _a.var = 109 /* VarKeyword */, _a.void = 110 /* VoidKeyword */, _a.while = 111 /* WhileKeyword */, @@ -8240,7 +8268,8 @@ var ts; _a.yield = 121 /* YieldKeyword */, _a.async = 126 /* AsyncKeyword */, _a.await = 127 /* AwaitKeyword */, - _a.of = 152 /* OfKeyword */, + _a.awaited = 128 /* AwaitedKeyword */, + _a.of = 153 /* OfKeyword */, _a); var textToKeyword = ts.createMapFromTemplate(textToKeywordObj); var textToToken = ts.createMapFromTemplate(__assign(__assign({}, textToKeywordObj), { "{": 18 /* OpenBraceToken */, "}": 19 /* CloseBraceToken */, "(": 20 /* OpenParenToken */, ")": 21 /* CloseParenToken */, "[": 22 /* OpenBracketToken */, "]": 23 /* CloseBracketToken */, ".": 24 /* DotToken */, "...": 25 /* DotDotDotToken */, ";": 26 /* SemicolonToken */, ",": 27 /* CommaToken */, "<": 29 /* LessThanToken */, ">": 31 /* GreaterThanToken */, "<=": 32 /* LessThanEqualsToken */, ">=": 33 /* GreaterThanEqualsToken */, "==": 34 /* EqualsEqualsToken */, "!=": 35 /* ExclamationEqualsToken */, "===": 36 /* EqualsEqualsEqualsToken */, "!==": 37 /* ExclamationEqualsEqualsToken */, "=>": 38 /* EqualsGreaterThanToken */, "+": 39 /* PlusToken */, "-": 40 /* MinusToken */, "**": 42 /* AsteriskAsteriskToken */, "*": 41 /* AsteriskToken */, "/": 43 /* SlashToken */, "%": 44 /* PercentToken */, "++": 45 /* PlusPlusToken */, "--": 46 /* MinusMinusToken */, "<<": 47 /* LessThanLessThanToken */, ">": 48 /* GreaterThanGreaterThanToken */, ">>>": 49 /* GreaterThanGreaterThanGreaterThanToken */, "&": 50 /* AmpersandToken */, "|": 51 /* BarToken */, "^": 52 /* CaretToken */, "!": 53 /* ExclamationToken */, "~": 54 /* TildeToken */, "&&": 55 /* AmpersandAmpersandToken */, "||": 56 /* BarBarToken */, "?": 57 /* QuestionToken */, "??": 60 /* QuestionQuestionToken */, "?.": 28 /* QuestionDotToken */, ":": 58 /* ColonToken */, "=": 62 /* EqualsToken */, "+=": 63 /* PlusEqualsToken */, "-=": 64 /* MinusEqualsToken */, "*=": 65 /* AsteriskEqualsToken */, "**=": 66 /* AsteriskAsteriskEqualsToken */, "/=": 67 /* SlashEqualsToken */, "%=": 68 /* PercentEqualsToken */, "<<=": 69 /* LessThanLessThanEqualsToken */, ">>=": 70 /* GreaterThanGreaterThanEqualsToken */, ">>>=": 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */, "&=": 72 /* AmpersandEqualsToken */, "|=": 73 /* BarEqualsToken */, "^=": 74 /* CaretEqualsToken */, "@": 59 /* AtToken */, "`": 61 /* BacktickToken */ })); @@ -8298,6 +8327,10 @@ var ts; */ var unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 895, 895, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1488, 1514, 1519, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2144, 2154, 2208, 2228, 2230, 2237, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2432, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2556, 2556, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2809, 2809, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3133, 3160, 3162, 3168, 3169, 3200, 3200, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3412, 3414, 3423, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6264, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6430, 6480, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7401, 7404, 7406, 7411, 7413, 7414, 7418, 7418, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12443, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42653, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43261, 43262, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43488, 43492, 43494, 43503, 43514, 43518, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43646, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66335, 66349, 66378, 66384, 66421, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68096, 68112, 68115, 68117, 68119, 68121, 68149, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68324, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68899, 69376, 69404, 69415, 69415, 69424, 69445, 69600, 69622, 69635, 69687, 69763, 69807, 69840, 69864, 69891, 69926, 69956, 69956, 69968, 70002, 70006, 70006, 70019, 70066, 70081, 70084, 70106, 70106, 70108, 70108, 70144, 70161, 70163, 70187, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70366, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70461, 70461, 70480, 70480, 70493, 70497, 70656, 70708, 70727, 70730, 70751, 70751, 70784, 70831, 70852, 70853, 70855, 70855, 71040, 71086, 71128, 71131, 71168, 71215, 71236, 71236, 71296, 71338, 71352, 71352, 71424, 71450, 71680, 71723, 71840, 71903, 71935, 71935, 72096, 72103, 72106, 72144, 72161, 72161, 72163, 72163, 72192, 72192, 72203, 72242, 72250, 72250, 72272, 72272, 72284, 72329, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72750, 72768, 72768, 72818, 72847, 72960, 72966, 72968, 72969, 72971, 73008, 73030, 73030, 73056, 73061, 73063, 73064, 73066, 73097, 73112, 73112, 73440, 73458, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92880, 92909, 92928, 92975, 92992, 92995, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94032, 94032, 94099, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 123136, 123180, 123191, 123197, 123214, 123214, 123584, 123627, 124928, 125124, 125184, 125251, 125259, 125259, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101]; var unicodeESNextIdentifierPart = [48, 57, 65, 90, 95, 95, 97, 122, 170, 170, 181, 181, 183, 183, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 895, 895, 902, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1519, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2045, 2045, 2048, 2093, 2112, 2139, 2144, 2154, 2208, 2228, 2230, 2237, 2259, 2273, 2275, 2403, 2406, 2415, 2417, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2556, 2556, 2558, 2558, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2809, 2815, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3072, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3168, 3171, 3174, 3183, 3200, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3328, 3331, 3333, 3340, 3342, 3344, 3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3558, 3567, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4969, 4977, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6264, 6272, 6314, 6320, 6389, 6400, 6430, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6832, 6845, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418, 7424, 7673, 7675, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42737, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43047, 43072, 43123, 43136, 43205, 43216, 43225, 43232, 43255, 43259, 43259, 43261, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43488, 43518, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65071, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66045, 66045, 66176, 66204, 66208, 66256, 66272, 66272, 66304, 66335, 66349, 66378, 66384, 66426, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68099, 68101, 68102, 68108, 68115, 68117, 68119, 68121, 68149, 68152, 68154, 68159, 68159, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68326, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68903, 68912, 68921, 69376, 69404, 69415, 69415, 69424, 69456, 69600, 69622, 69632, 69702, 69734, 69743, 69759, 69818, 69840, 69864, 69872, 69881, 69888, 69940, 69942, 69951, 69956, 69958, 69968, 70003, 70006, 70006, 70016, 70084, 70089, 70092, 70096, 70106, 70108, 70108, 70144, 70161, 70163, 70199, 70206, 70206, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70378, 70384, 70393, 70400, 70403, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70459, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70730, 70736, 70745, 70750, 70751, 70784, 70853, 70855, 70855, 70864, 70873, 71040, 71093, 71096, 71104, 71128, 71133, 71168, 71232, 71236, 71236, 71248, 71257, 71296, 71352, 71360, 71369, 71424, 71450, 71453, 71467, 71472, 71481, 71680, 71738, 71840, 71913, 71935, 71935, 72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263, 72263, 72272, 72345, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72758, 72760, 72768, 72784, 72793, 72818, 72847, 72850, 72871, 72873, 72886, 72960, 72966, 72968, 72969, 72971, 73014, 73018, 73018, 73020, 73021, 73023, 73031, 73040, 73049, 73056, 73061, 73063, 73064, 73066, 73102, 73104, 73105, 73107, 73112, 73120, 73129, 73440, 73462, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 92880, 92909, 92912, 92916, 92928, 92982, 92992, 92995, 93008, 93017, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94031, 94087, 94095, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113821, 113822, 119141, 119145, 119149, 119154, 119163, 119170, 119173, 119179, 119210, 119213, 119362, 119364, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 120782, 120831, 121344, 121398, 121403, 121452, 121461, 121461, 121476, 121476, 121499, 121503, 121505, 121519, 122880, 122886, 122888, 122904, 122907, 122913, 122915, 122916, 122918, 122922, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123214, 123584, 123641, 124928, 125124, 125136, 125142, 125184, 125259, 125264, 125273, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 917760, 917999]; + /** + * Test for whether a comment's text contains a `@ts-expect-error` or `@ts-ignore` directive. + */ + var commentDirectiveRegEx = /^\s*\/\/\/?\s*@(ts-expect-error|ts-ignore)/; function lookupInUnicodeMap(code, map) { // Bail out quickly if it couldn't possibly be in the map. if (code < map[0]) { @@ -8864,6 +8897,7 @@ var ts; var token; var tokenValue; var tokenFlags; + var commentDirectives; var inJSDocType = 0; setText(text, start, length); var scanner = { @@ -8879,6 +8913,7 @@ var ts; isIdentifier: function () { return token === 75 /* Identifier */ || token > 112 /* LastReservedWord */; }, isReservedWord: function () { return token >= 77 /* FirstReservedWord */ && token <= 112 /* LastReservedWord */; }, isUnterminated: function () { return (tokenFlags & 4 /* Unterminated */) !== 0; }, + getCommentDirectives: function () { return commentDirectives; }, getTokenFlags: function () { return tokenFlags; }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, @@ -8894,6 +8929,7 @@ var ts; scanJsDocToken: scanJsDocToken, scan: scan, getText: getText, + clearCommentDirectives: clearCommentDirectives, setText: setText, setScriptTarget: setScriptTarget, setLanguageVariant: setLanguageVariant, @@ -9623,6 +9659,13 @@ var ts; } pos++; } + var type = getDirectiveFromComment(text.slice(tokenPos, pos)); + if (type !== undefined) { + commentDirectives = ts.append(commentDirectives, { + range: { pos: tokenPos, end: pos }, + type: type, + }); + } if (skipTrivia) { continue; } @@ -9977,6 +10020,19 @@ var ts; } return token; } + function getDirectiveFromComment(text) { + var match = commentDirectiveRegEx.exec(text); + if (!match) { + return undefined; + } + switch (match[1]) { + case "ts-expect-error": + return 0 /* ExpectError */; + case "ts-ignore": + return 1 /* Ignore */; + } + return undefined; + } /** * Unconditionally back up and scan a template expression portion. */ @@ -10216,6 +10272,7 @@ var ts; var saveToken = token; var saveTokenValue = tokenValue; var saveTokenFlags = tokenFlags; + var saveErrorExpectations = commentDirectives; setText(text, start, length); var result = callback(); end = saveEnd; @@ -10225,6 +10282,7 @@ var ts; token = saveToken; tokenValue = saveTokenValue; tokenFlags = saveTokenFlags; + commentDirectives = saveErrorExpectations; return result; } function lookAhead(callback) { @@ -10236,6 +10294,9 @@ var ts; function getText() { return text; } + function clearCommentDirectives() { + commentDirectives = undefined; + } function setText(newText, start, length) { text = newText || ""; end = length === undefined ? text.length : start + length; @@ -10543,9 +10604,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 155 /* TypeParameter */) { + if (d && d.kind === 156 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 246 /* InterfaceDeclaration */) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 247 /* InterfaceDeclaration */) { return current; } } @@ -10553,7 +10614,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node, parent) { - return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 162 /* Constructor */; + return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 163 /* Constructor */; } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -10583,14 +10644,14 @@ var ts; node = walkUpBindingElementsAndPatterns(node); } var flags = getFlags(node); - if (node.kind === 242 /* VariableDeclaration */) { + if (node.kind === 243 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 243 /* VariableDeclarationList */) { + if (node && node.kind === 244 /* VariableDeclarationList */) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 225 /* VariableStatement */) { + if (node && node.kind === 226 /* VariableStatement */) { flags |= getFlags(node); } return flags; @@ -10739,30 +10800,30 @@ var ts; } // Covers remaining cases (returning undefined if none match). switch (hostNode.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: var expr = hostNode.expression; - if (expr.kind === 209 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { + if (expr.kind === 210 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { expr = expr.left; } switch (expr.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return expr.name; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: var arg = expr.argumentExpression; if (isIdentifier(arg)) { return arg; } } break; - case 200 /* ParenthesizedExpression */: { + case 201 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 238 /* LabeledStatement */: { + case 239 /* LabeledStatement */: { if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -10799,16 +10860,16 @@ var ts; switch (declaration.kind) { case 75 /* Identifier */: return declaration; - case 323 /* JSDocPropertyTag */: - case 317 /* JSDocParameterTag */: { + case 324 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: { var name = declaration.name; - if (name.kind === 153 /* QualifiedName */) { + if (name.kind === 154 /* QualifiedName */) { return name.right; } break; } - case 196 /* CallExpression */: - case 209 /* BinaryExpression */: { + case 197 /* CallExpression */: + case 210 /* BinaryExpression */: { var expr_1 = declaration; switch (ts.getAssignmentDeclarationKind(expr_1)) { case 1 /* ExportsProperty */: @@ -10824,15 +10885,15 @@ var ts; return undefined; } } - case 322 /* JSDocTypedefTag */: + case 323 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 316 /* JSDocEnumTag */: + case 317 /* JSDocEnumTag */: return nameForNamelessJSDocTypedef(declaration); - case 259 /* ExportAssignment */: { + case 260 /* ExportAssignment */: { var expression = declaration.expression; return isIdentifier(expression) ? expression : undefined; } - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: var expr = declaration; if (ts.isBindableStaticElementAccessExpression(expr)) { return expr.argumentExpression; @@ -11068,7 +11129,7 @@ var ts; return ts.emptyArray; } if (ts.isJSDocTypeAlias(node)) { - ts.Debug.assert(node.parent.kind === 303 /* JSDocComment */); + ts.Debug.assert(node.parent.kind === 304 /* JSDocComment */); return ts.flatMap(node.parent.tags, function (tag) { return isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; }); } if (node.typeParameters) { @@ -11139,11 +11200,11 @@ var ts; ts.isIdentifier = isIdentifier; // Names function isQualifiedName(node) { - return node.kind === 153 /* QualifiedName */; + return node.kind === 154 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 154 /* ComputedPropertyName */; + return node.kind === 155 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; function isPrivateIdentifier(node) { @@ -11156,164 +11217,164 @@ var ts; ts.isIdentifierOrPrivateIdentifier = isIdentifierOrPrivateIdentifier; // Signature elements function isTypeParameterDeclaration(node) { - return node.kind === 155 /* TypeParameter */; + return node.kind === 156 /* TypeParameter */; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 156 /* Parameter */; + return node.kind === 157 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 157 /* Decorator */; + return node.kind === 158 /* Decorator */; } ts.isDecorator = isDecorator; // TypeMember function isPropertySignature(node) { - return node.kind === 158 /* PropertySignature */; + return node.kind === 159 /* PropertySignature */; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 159 /* PropertyDeclaration */; + return node.kind === 160 /* PropertyDeclaration */; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 160 /* MethodSignature */; + return node.kind === 161 /* MethodSignature */; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 161 /* MethodDeclaration */; + return node.kind === 162 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 162 /* Constructor */; + return node.kind === 163 /* Constructor */; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 163 /* GetAccessor */; + return node.kind === 164 /* GetAccessor */; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 164 /* SetAccessor */; + return node.kind === 165 /* SetAccessor */; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 165 /* CallSignature */; + return node.kind === 166 /* CallSignature */; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 166 /* ConstructSignature */; + return node.kind === 167 /* ConstructSignature */; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 167 /* IndexSignature */; + return node.kind === 168 /* IndexSignature */; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; /* @internal */ function isGetOrSetAccessorDeclaration(node) { - return node.kind === 164 /* SetAccessor */ || node.kind === 163 /* GetAccessor */; + return node.kind === 165 /* SetAccessor */ || node.kind === 164 /* GetAccessor */; } ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration; // Type function isTypePredicateNode(node) { - return node.kind === 168 /* TypePredicate */; + return node.kind === 169 /* TypePredicate */; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 169 /* TypeReference */; + return node.kind === 170 /* TypeReference */; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 170 /* FunctionType */; + return node.kind === 171 /* FunctionType */; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 171 /* ConstructorType */; + return node.kind === 172 /* ConstructorType */; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 172 /* TypeQuery */; + return node.kind === 173 /* TypeQuery */; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 173 /* TypeLiteral */; + return node.kind === 174 /* TypeLiteral */; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 174 /* ArrayType */; + return node.kind === 175 /* ArrayType */; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 175 /* TupleType */; + return node.kind === 176 /* TupleType */; } ts.isTupleTypeNode = isTupleTypeNode; function isUnionTypeNode(node) { - return node.kind === 178 /* UnionType */; + return node.kind === 179 /* UnionType */; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 179 /* IntersectionType */; + return node.kind === 180 /* IntersectionType */; } ts.isIntersectionTypeNode = isIntersectionTypeNode; function isConditionalTypeNode(node) { - return node.kind === 180 /* ConditionalType */; + return node.kind === 181 /* ConditionalType */; } ts.isConditionalTypeNode = isConditionalTypeNode; function isInferTypeNode(node) { - return node.kind === 181 /* InferType */; + return node.kind === 182 /* InferType */; } ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 182 /* ParenthesizedType */; + return node.kind === 183 /* ParenthesizedType */; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 183 /* ThisType */; + return node.kind === 184 /* ThisType */; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 184 /* TypeOperator */; + return node.kind === 185 /* TypeOperator */; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 185 /* IndexedAccessType */; + return node.kind === 186 /* IndexedAccessType */; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 186 /* MappedType */; + return node.kind === 187 /* MappedType */; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 187 /* LiteralType */; + return node.kind === 188 /* LiteralType */; } ts.isLiteralTypeNode = isLiteralTypeNode; function isImportTypeNode(node) { - return node.kind === 188 /* ImportType */; + return node.kind === 189 /* ImportType */; } ts.isImportTypeNode = isImportTypeNode; // Binding patterns function isObjectBindingPattern(node) { - return node.kind === 189 /* ObjectBindingPattern */; + return node.kind === 190 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 190 /* ArrayBindingPattern */; + return node.kind === 191 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 191 /* BindingElement */; + return node.kind === 192 /* BindingElement */; } ts.isBindingElement = isBindingElement; // Expression function isArrayLiteralExpression(node) { - return node.kind === 192 /* ArrayLiteralExpression */; + return node.kind === 193 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 193 /* ObjectLiteralExpression */; + return node.kind === 194 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 194 /* PropertyAccessExpression */; + return node.kind === 195 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isPropertyAccessChain(node) { @@ -11321,7 +11382,7 @@ var ts; } ts.isPropertyAccessChain = isPropertyAccessChain; function isElementAccessExpression(node) { - return node.kind === 195 /* ElementAccessExpression */; + return node.kind === 196 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isElementAccessChain(node) { @@ -11329,7 +11390,7 @@ var ts; } ts.isElementAccessChain = isElementAccessChain; function isCallExpression(node) { - return node.kind === 196 /* CallExpression */; + return node.kind === 197 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isCallChain(node) { @@ -11339,9 +11400,9 @@ var ts; function isOptionalChain(node) { var kind = node.kind; return !!(node.flags & 32 /* OptionalChain */) && - (kind === 194 /* PropertyAccessExpression */ - || kind === 195 /* ElementAccessExpression */ - || kind === 196 /* CallExpression */); + (kind === 195 /* PropertyAccessExpression */ + || kind === 196 /* ElementAccessExpression */ + || kind === 197 /* CallExpression */); } ts.isOptionalChain = isOptionalChain; /* @internal */ @@ -11375,19 +11436,19 @@ var ts; } ts.isOutermostOptionalChain = isOutermostOptionalChain; function isNullishCoalesce(node) { - return node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; + return node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; } ts.isNullishCoalesce = isNullishCoalesce; function isNewExpression(node) { - return node.kind === 197 /* NewExpression */; + return node.kind === 198 /* NewExpression */; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 198 /* TaggedTemplateExpression */; + return node.kind === 199 /* TaggedTemplateExpression */; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertion(node) { - return node.kind === 199 /* TypeAssertionExpression */; + return node.kind === 200 /* TypeAssertionExpression */; } ts.isTypeAssertion = isTypeAssertion; function isConstTypeReference(node) { @@ -11396,384 +11457,384 @@ var ts; } ts.isConstTypeReference = isConstTypeReference; function isParenthesizedExpression(node) { - return node.kind === 200 /* ParenthesizedExpression */; + return node.kind === 201 /* ParenthesizedExpression */; } ts.isParenthesizedExpression = isParenthesizedExpression; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 326 /* PartiallyEmittedExpression */) { + while (node.kind === 327 /* PartiallyEmittedExpression */) { node = node.expression; } return node; } ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; function isFunctionExpression(node) { - return node.kind === 201 /* FunctionExpression */; + return node.kind === 202 /* FunctionExpression */; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 202 /* ArrowFunction */; + return node.kind === 203 /* ArrowFunction */; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 203 /* DeleteExpression */; + return node.kind === 204 /* DeleteExpression */; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 204 /* TypeOfExpression */; + return node.kind === 205 /* TypeOfExpression */; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 205 /* VoidExpression */; + return node.kind === 206 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 206 /* AwaitExpression */; + return node.kind === 207 /* AwaitExpression */; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 207 /* PrefixUnaryExpression */; + return node.kind === 208 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 208 /* PostfixUnaryExpression */; + return node.kind === 209 /* PostfixUnaryExpression */; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 209 /* BinaryExpression */; + return node.kind === 210 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 210 /* ConditionalExpression */; + return node.kind === 211 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 211 /* TemplateExpression */; + return node.kind === 212 /* TemplateExpression */; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 212 /* YieldExpression */; + return node.kind === 213 /* YieldExpression */; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 213 /* SpreadElement */; + return node.kind === 214 /* SpreadElement */; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 214 /* ClassExpression */; + return node.kind === 215 /* ClassExpression */; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 215 /* OmittedExpression */; + return node.kind === 216 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 216 /* ExpressionWithTypeArguments */; + return node.kind === 217 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 217 /* AsExpression */; + return node.kind === 218 /* AsExpression */; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 218 /* NonNullExpression */; + return node.kind === 219 /* NonNullExpression */; } ts.isNonNullExpression = isNonNullExpression; function isMetaProperty(node) { - return node.kind === 219 /* MetaProperty */; + return node.kind === 220 /* MetaProperty */; } ts.isMetaProperty = isMetaProperty; // Misc function isTemplateSpan(node) { - return node.kind === 221 /* TemplateSpan */; + return node.kind === 222 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 222 /* SemicolonClassElement */; + return node.kind === 223 /* SemicolonClassElement */; } ts.isSemicolonClassElement = isSemicolonClassElement; // Block function isBlock(node) { - return node.kind === 223 /* Block */; + return node.kind === 224 /* Block */; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 225 /* VariableStatement */; + return node.kind === 226 /* VariableStatement */; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 224 /* EmptyStatement */; + return node.kind === 225 /* EmptyStatement */; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 226 /* ExpressionStatement */; + return node.kind === 227 /* ExpressionStatement */; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 227 /* IfStatement */; + return node.kind === 228 /* IfStatement */; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 228 /* DoStatement */; + return node.kind === 229 /* DoStatement */; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 229 /* WhileStatement */; + return node.kind === 230 /* WhileStatement */; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 230 /* ForStatement */; + return node.kind === 231 /* ForStatement */; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 231 /* ForInStatement */; + return node.kind === 232 /* ForInStatement */; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 232 /* ForOfStatement */; + return node.kind === 233 /* ForOfStatement */; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 233 /* ContinueStatement */; + return node.kind === 234 /* ContinueStatement */; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 234 /* BreakStatement */; + return node.kind === 235 /* BreakStatement */; } ts.isBreakStatement = isBreakStatement; function isBreakOrContinueStatement(node) { - return node.kind === 234 /* BreakStatement */ || node.kind === 233 /* ContinueStatement */; + return node.kind === 235 /* BreakStatement */ || node.kind === 234 /* ContinueStatement */; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isReturnStatement(node) { - return node.kind === 235 /* ReturnStatement */; + return node.kind === 236 /* ReturnStatement */; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 236 /* WithStatement */; + return node.kind === 237 /* WithStatement */; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 237 /* SwitchStatement */; + return node.kind === 238 /* SwitchStatement */; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 238 /* LabeledStatement */; + return node.kind === 239 /* LabeledStatement */; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 239 /* ThrowStatement */; + return node.kind === 240 /* ThrowStatement */; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 240 /* TryStatement */; + return node.kind === 241 /* TryStatement */; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 241 /* DebuggerStatement */; + return node.kind === 242 /* DebuggerStatement */; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 242 /* VariableDeclaration */; + return node.kind === 243 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 243 /* VariableDeclarationList */; + return node.kind === 244 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 244 /* FunctionDeclaration */; + return node.kind === 245 /* FunctionDeclaration */; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 245 /* ClassDeclaration */; + return node.kind === 246 /* ClassDeclaration */; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 246 /* InterfaceDeclaration */; + return node.kind === 247 /* InterfaceDeclaration */; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 247 /* TypeAliasDeclaration */; + return node.kind === 248 /* TypeAliasDeclaration */; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 248 /* EnumDeclaration */; + return node.kind === 249 /* EnumDeclaration */; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 249 /* ModuleDeclaration */; + return node.kind === 250 /* ModuleDeclaration */; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 250 /* ModuleBlock */; + return node.kind === 251 /* ModuleBlock */; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 251 /* CaseBlock */; + return node.kind === 252 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 252 /* NamespaceExportDeclaration */; + return node.kind === 253 /* NamespaceExportDeclaration */; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */; + return node.kind === 254 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 254 /* ImportDeclaration */; + return node.kind === 255 /* ImportDeclaration */; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 255 /* ImportClause */; + return node.kind === 256 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 256 /* NamespaceImport */; + return node.kind === 257 /* NamespaceImport */; } ts.isNamespaceImport = isNamespaceImport; function isNamespaceExport(node) { - return node.kind === 262 /* NamespaceExport */; + return node.kind === 263 /* NamespaceExport */; } ts.isNamespaceExport = isNamespaceExport; function isNamedExportBindings(node) { - return node.kind === 262 /* NamespaceExport */ || node.kind === 261 /* NamedExports */; + return node.kind === 263 /* NamespaceExport */ || node.kind === 262 /* NamedExports */; } ts.isNamedExportBindings = isNamedExportBindings; function isNamedImports(node) { - return node.kind === 257 /* NamedImports */; + return node.kind === 258 /* NamedImports */; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 258 /* ImportSpecifier */; + return node.kind === 259 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 259 /* ExportAssignment */; + return node.kind === 260 /* ExportAssignment */; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 260 /* ExportDeclaration */; + return node.kind === 261 /* ExportDeclaration */; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 261 /* NamedExports */; + return node.kind === 262 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 263 /* ExportSpecifier */; + return node.kind === 264 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 264 /* MissingDeclaration */; + return node.kind === 265 /* MissingDeclaration */; } ts.isMissingDeclaration = isMissingDeclaration; // Module References function isExternalModuleReference(node) { - return node.kind === 265 /* ExternalModuleReference */; + return node.kind === 266 /* ExternalModuleReference */; } ts.isExternalModuleReference = isExternalModuleReference; // JSX function isJsxElement(node) { - return node.kind === 266 /* JsxElement */; + return node.kind === 267 /* JsxElement */; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 267 /* JsxSelfClosingElement */; + return node.kind === 268 /* JsxSelfClosingElement */; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 268 /* JsxOpeningElement */; + return node.kind === 269 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 269 /* JsxClosingElement */; + return node.kind === 270 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 270 /* JsxFragment */; + return node.kind === 271 /* JsxFragment */; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 271 /* JsxOpeningFragment */; + return node.kind === 272 /* JsxOpeningFragment */; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 272 /* JsxClosingFragment */; + return node.kind === 273 /* JsxClosingFragment */; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 273 /* JsxAttribute */; + return node.kind === 274 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 274 /* JsxAttributes */; + return node.kind === 275 /* JsxAttributes */; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 275 /* JsxSpreadAttribute */; + return node.kind === 276 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 276 /* JsxExpression */; + return node.kind === 277 /* JsxExpression */; } ts.isJsxExpression = isJsxExpression; // Clauses function isCaseClause(node) { - return node.kind === 277 /* CaseClause */; + return node.kind === 278 /* CaseClause */; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 278 /* DefaultClause */; + return node.kind === 279 /* DefaultClause */; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 279 /* HeritageClause */; + return node.kind === 280 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 280 /* CatchClause */; + return node.kind === 281 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 281 /* PropertyAssignment */; + return node.kind === 282 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 282 /* ShorthandPropertyAssignment */; + return node.kind === 283 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 283 /* SpreadAssignment */; + return node.kind === 284 /* SpreadAssignment */; } ts.isSpreadAssignment = isSpreadAssignment; // Enum function isEnumMember(node) { - return node.kind === 284 /* EnumMember */; + return node.kind === 285 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Top-level nodes function isSourceFile(node) { - return node.kind === 290 /* SourceFile */; + return node.kind === 291 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 291 /* Bundle */; + return node.kind === 292 /* Bundle */; } ts.isBundle = isBundle; function isUnparsedSource(node) { - return node.kind === 292 /* UnparsedSource */; + return node.kind === 293 /* UnparsedSource */; } ts.isUnparsedSource = isUnparsedSource; function isUnparsedPrepend(node) { - return node.kind === 286 /* UnparsedPrepend */; + return node.kind === 287 /* UnparsedPrepend */; } ts.isUnparsedPrepend = isUnparsedPrepend; function isUnparsedTextLike(node) { switch (node.kind) { - case 287 /* UnparsedText */: - case 288 /* UnparsedInternalText */: + case 288 /* UnparsedText */: + case 289 /* UnparsedInternalText */: return true; default: return false; @@ -11782,125 +11843,125 @@ var ts; ts.isUnparsedTextLike = isUnparsedTextLike; function isUnparsedNode(node) { return isUnparsedTextLike(node) || - node.kind === 285 /* UnparsedPrologue */ || - node.kind === 289 /* UnparsedSyntheticReference */; + node.kind === 286 /* UnparsedPrologue */ || + node.kind === 290 /* UnparsedSyntheticReference */; } ts.isUnparsedNode = isUnparsedNode; // JSDoc function isJSDocTypeExpression(node) { - return node.kind === 294 /* JSDocTypeExpression */; + return node.kind === 295 /* JSDocTypeExpression */; } ts.isJSDocTypeExpression = isJSDocTypeExpression; function isJSDocAllType(node) { - return node.kind === 295 /* JSDocAllType */; + return node.kind === 296 /* JSDocAllType */; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 296 /* JSDocUnknownType */; + return node.kind === 297 /* JSDocUnknownType */; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 297 /* JSDocNullableType */; + return node.kind === 298 /* JSDocNullableType */; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 298 /* JSDocNonNullableType */; + return node.kind === 299 /* JSDocNonNullableType */; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 299 /* JSDocOptionalType */; + return node.kind === 300 /* JSDocOptionalType */; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 300 /* JSDocFunctionType */; + return node.kind === 301 /* JSDocFunctionType */; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 301 /* JSDocVariadicType */; + return node.kind === 302 /* JSDocVariadicType */; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDoc(node) { - return node.kind === 303 /* JSDocComment */; + return node.kind === 304 /* JSDocComment */; } ts.isJSDoc = isJSDoc; function isJSDocAuthorTag(node) { - return node.kind === 309 /* JSDocAuthorTag */; + return node.kind === 310 /* JSDocAuthorTag */; } ts.isJSDocAuthorTag = isJSDocAuthorTag; function isJSDocAugmentsTag(node) { - return node.kind === 307 /* JSDocAugmentsTag */; + return node.kind === 308 /* JSDocAugmentsTag */; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocImplementsTag(node) { - return node.kind === 308 /* JSDocImplementsTag */; + return node.kind === 309 /* JSDocImplementsTag */; } ts.isJSDocImplementsTag = isJSDocImplementsTag; function isJSDocClassTag(node) { - return node.kind === 310 /* JSDocClassTag */; + return node.kind === 311 /* JSDocClassTag */; } ts.isJSDocClassTag = isJSDocClassTag; function isJSDocPublicTag(node) { - return node.kind === 311 /* JSDocPublicTag */; + return node.kind === 312 /* JSDocPublicTag */; } ts.isJSDocPublicTag = isJSDocPublicTag; function isJSDocPrivateTag(node) { - return node.kind === 312 /* JSDocPrivateTag */; + return node.kind === 313 /* JSDocPrivateTag */; } ts.isJSDocPrivateTag = isJSDocPrivateTag; function isJSDocProtectedTag(node) { - return node.kind === 313 /* JSDocProtectedTag */; + return node.kind === 314 /* JSDocProtectedTag */; } ts.isJSDocProtectedTag = isJSDocProtectedTag; function isJSDocReadonlyTag(node) { - return node.kind === 314 /* JSDocReadonlyTag */; + return node.kind === 315 /* JSDocReadonlyTag */; } ts.isJSDocReadonlyTag = isJSDocReadonlyTag; function isJSDocEnumTag(node) { - return node.kind === 316 /* JSDocEnumTag */; + return node.kind === 317 /* JSDocEnumTag */; } ts.isJSDocEnumTag = isJSDocEnumTag; function isJSDocThisTag(node) { - return node.kind === 319 /* JSDocThisTag */; + return node.kind === 320 /* JSDocThisTag */; } ts.isJSDocThisTag = isJSDocThisTag; function isJSDocParameterTag(node) { - return node.kind === 317 /* JSDocParameterTag */; + return node.kind === 318 /* JSDocParameterTag */; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 318 /* JSDocReturnTag */; + return node.kind === 319 /* JSDocReturnTag */; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocTypeTag(node) { - return node.kind === 320 /* JSDocTypeTag */; + return node.kind === 321 /* JSDocTypeTag */; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 321 /* JSDocTemplateTag */; + return node.kind === 322 /* JSDocTemplateTag */; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 322 /* JSDocTypedefTag */; + return node.kind === 323 /* JSDocTypedefTag */; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocPropertyTag(node) { - return node.kind === 323 /* JSDocPropertyTag */; + return node.kind === 324 /* JSDocPropertyTag */; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocPropertyLikeTag(node) { - return node.kind === 323 /* JSDocPropertyTag */ || node.kind === 317 /* JSDocParameterTag */; + return node.kind === 324 /* JSDocPropertyTag */ || node.kind === 318 /* JSDocParameterTag */; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isJSDocTypeLiteral(node) { - return node.kind === 304 /* JSDocTypeLiteral */; + return node.kind === 305 /* JSDocTypeLiteral */; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; function isJSDocCallbackTag(node) { - return node.kind === 315 /* JSDocCallbackTag */; + return node.kind === 316 /* JSDocCallbackTag */; } ts.isJSDocCallbackTag = isJSDocCallbackTag; function isJSDocSignature(node) { - return node.kind === 305 /* JSDocSignature */; + return node.kind === 306 /* JSDocSignature */; } ts.isJSDocSignature = isJSDocSignature; // #endregion @@ -11911,7 +11972,7 @@ var ts; // they may be used with transformations. /* @internal */ function isSyntaxList(n) { - return n.kind === 324 /* SyntaxList */; + return n.kind === 325 /* SyntaxList */; } ts.isSyntaxList = isSyntaxList; /* @internal */ @@ -11921,7 +11982,7 @@ var ts; ts.isNode = isNode; /* @internal */ function isNodeKind(kind) { - return kind >= 153 /* FirstNode */; + return kind >= 154 /* FirstNode */; } ts.isNodeKind = isNodeKind; /** @@ -11930,7 +11991,7 @@ var ts; * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 152 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 153 /* LastToken */; } ts.isToken = isToken; // Node Arrays @@ -11971,12 +12032,12 @@ var ts; ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isTypeOnlyImportOrExportDeclaration(node) { switch (node.kind) { - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return node.parent.isTypeOnly; - case 255 /* ImportClause */: + case 256 /* ImportClause */: return node.isTypeOnly; default: return false; @@ -12011,13 +12072,13 @@ var ts; case 122 /* AbstractKeyword */: case 126 /* AsyncKeyword */: case 81 /* ConstKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 84 /* DefaultKeyword */: case 89 /* ExportKeyword */: case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: case 120 /* StaticKeyword */: return true; } @@ -12040,23 +12101,24 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 153 /* QualifiedName */ + return kind === 154 /* QualifiedName */ || kind === 75 /* Identifier */; } ts.isEntityName = isEntityName; function isPropertyName(node) { var kind = node.kind; return kind === 75 /* Identifier */ + || kind === 76 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 154 /* ComputedPropertyName */; + || kind === 155 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 75 /* Identifier */ - || kind === 189 /* ObjectBindingPattern */ - || kind === 190 /* ArrayBindingPattern */; + || kind === 190 /* ObjectBindingPattern */ + || kind === 191 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Functions @@ -12071,13 +12133,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return true; default: return false; @@ -12086,14 +12148,14 @@ var ts; /* @internal */ function isFunctionLikeKind(kind) { switch (kind) { - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 305 /* JSDocSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 170 /* FunctionType */: - case 300 /* JSDocFunctionType */: - case 171 /* ConstructorType */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 306 /* JSDocSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 171 /* FunctionType */: + case 301 /* JSDocFunctionType */: + case 172 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -12108,29 +12170,29 @@ var ts; // Classes function isClassElement(node) { var kind = node.kind; - return kind === 162 /* Constructor */ - || kind === 159 /* PropertyDeclaration */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */ - || kind === 167 /* IndexSignature */ - || kind === 222 /* SemicolonClassElement */; + return kind === 163 /* Constructor */ + || kind === 160 /* PropertyDeclaration */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */ + || kind === 168 /* IndexSignature */ + || kind === 223 /* SemicolonClassElement */; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */); + return node && (node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 163 /* GetAccessor */ || node.kind === 164 /* SetAccessor */); + return node && (node.kind === 164 /* GetAccessor */ || node.kind === 165 /* SetAccessor */); } ts.isAccessor = isAccessor; /* @internal */ function isMethodOrAccessor(node) { switch (node.kind) { - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return true; default: return false; @@ -12140,11 +12202,11 @@ var ts; // Type members function isTypeElement(node) { var kind = node.kind; - return kind === 166 /* ConstructSignature */ - || kind === 165 /* CallSignature */ - || kind === 158 /* PropertySignature */ - || kind === 160 /* MethodSignature */ - || kind === 167 /* IndexSignature */; + return kind === 167 /* ConstructSignature */ + || kind === 166 /* CallSignature */ + || kind === 159 /* PropertySignature */ + || kind === 161 /* MethodSignature */ + || kind === 168 /* IndexSignature */; } ts.isTypeElement = isTypeElement; function isClassOrTypeElement(node) { @@ -12153,12 +12215,12 @@ var ts; ts.isClassOrTypeElement = isClassOrTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 281 /* PropertyAssignment */ - || kind === 282 /* ShorthandPropertyAssignment */ - || kind === 283 /* SpreadAssignment */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */; + return kind === 282 /* PropertyAssignment */ + || kind === 283 /* ShorthandPropertyAssignment */ + || kind === 284 /* SpreadAssignment */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type @@ -12173,8 +12235,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 170 /* FunctionType */: - case 171 /* ConstructorType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: return true; } return false; @@ -12185,8 +12247,8 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 190 /* ArrayBindingPattern */ - || kind === 189 /* ObjectBindingPattern */; + return kind === 191 /* ArrayBindingPattern */ + || kind === 190 /* ObjectBindingPattern */; } return false; } @@ -12194,15 +12256,15 @@ var ts; /* @internal */ function isAssignmentPattern(node) { var kind = node.kind; - return kind === 192 /* ArrayLiteralExpression */ - || kind === 193 /* ObjectLiteralExpression */; + return kind === 193 /* ArrayLiteralExpression */ + || kind === 194 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; /* @internal */ function isArrayBindingElement(node) { var kind = node.kind; - return kind === 191 /* BindingElement */ - || kind === 215 /* OmittedExpression */; + return kind === 192 /* BindingElement */ + || kind === 216 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -12211,9 +12273,9 @@ var ts; /* @internal */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 191 /* BindingElement */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 192 /* BindingElement */: return true; } return false; @@ -12234,8 +12296,8 @@ var ts; /* @internal */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 189 /* ObjectBindingPattern */: - case 193 /* ObjectLiteralExpression */: + case 190 /* ObjectBindingPattern */: + case 194 /* ObjectLiteralExpression */: return true; } return false; @@ -12247,8 +12309,8 @@ var ts; /* @internal */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 190 /* ArrayBindingPattern */: - case 192 /* ArrayLiteralExpression */: + case 191 /* ArrayBindingPattern */: + case 193 /* ArrayLiteralExpression */: return true; } return false; @@ -12257,26 +12319,26 @@ var ts; /* @internal */ function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { var kind = node.kind; - return kind === 194 /* PropertyAccessExpression */ - || kind === 153 /* QualifiedName */ - || kind === 188 /* ImportType */; + return kind === 195 /* PropertyAccessExpression */ + || kind === 154 /* QualifiedName */ + || kind === 189 /* ImportType */; } ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode; // Expression function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 194 /* PropertyAccessExpression */ - || kind === 153 /* QualifiedName */; + return kind === 195 /* PropertyAccessExpression */ + || kind === 154 /* QualifiedName */; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 198 /* TaggedTemplateExpression */: - case 157 /* Decorator */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 199 /* TaggedTemplateExpression */: + case 158 /* Decorator */: return true; default: return false; @@ -12284,12 +12346,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 196 /* CallExpression */ || node.kind === 197 /* NewExpression */; + return node.kind === 197 /* CallExpression */ || node.kind === 198 /* NewExpression */; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 211 /* TemplateExpression */ + return kind === 212 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; @@ -12300,33 +12362,33 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: - case 197 /* NewExpression */: - case 196 /* CallExpression */: - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 270 /* JsxFragment */: - case 198 /* TaggedTemplateExpression */: - case 192 /* ArrayLiteralExpression */: - case 200 /* ParenthesizedExpression */: - case 193 /* ObjectLiteralExpression */: - case 214 /* ClassExpression */: - case 201 /* FunctionExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: + case 198 /* NewExpression */: + case 197 /* CallExpression */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 271 /* JsxFragment */: + case 199 /* TaggedTemplateExpression */: + case 193 /* ArrayLiteralExpression */: + case 201 /* ParenthesizedExpression */: + case 194 /* ObjectLiteralExpression */: + case 215 /* ClassExpression */: + case 202 /* FunctionExpression */: case 75 /* Identifier */: case 13 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: case 91 /* FalseKeyword */: case 100 /* NullKeyword */: case 104 /* ThisKeyword */: case 106 /* TrueKeyword */: case 102 /* SuperKeyword */: - case 218 /* NonNullExpression */: - case 219 /* MetaProperty */: + case 219 /* NonNullExpression */: + case 220 /* MetaProperty */: case 96 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression return true; default: @@ -12340,13 +12402,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: - case 203 /* DeleteExpression */: - case 204 /* TypeOfExpression */: - case 205 /* VoidExpression */: - case 206 /* AwaitExpression */: - case 199 /* TypeAssertionExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: + case 204 /* DeleteExpression */: + case 205 /* TypeOfExpression */: + case 206 /* VoidExpression */: + case 207 /* AwaitExpression */: + case 200 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -12355,9 +12417,9 @@ var ts; /* @internal */ function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return true; - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; default: @@ -12376,15 +12438,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 210 /* ConditionalExpression */: - case 212 /* YieldExpression */: - case 202 /* ArrowFunction */: - case 209 /* BinaryExpression */: - case 213 /* SpreadElement */: - case 217 /* AsExpression */: - case 215 /* OmittedExpression */: - case 327 /* CommaListExpression */: - case 326 /* PartiallyEmittedExpression */: + case 211 /* ConditionalExpression */: + case 213 /* YieldExpression */: + case 203 /* ArrowFunction */: + case 210 /* BinaryExpression */: + case 214 /* SpreadElement */: + case 218 /* AsExpression */: + case 216 /* OmittedExpression */: + case 328 /* CommaListExpression */: + case 327 /* PartiallyEmittedExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -12392,23 +12454,23 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 199 /* TypeAssertionExpression */ - || kind === 217 /* AsExpression */; + return kind === 200 /* TypeAssertionExpression */ + || kind === 218 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; /* @internal */ function isPartiallyEmittedExpression(node) { - return node.kind === 326 /* PartiallyEmittedExpression */; + return node.kind === 327 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; /* @internal */ function isNotEmittedStatement(node) { - return node.kind === 325 /* NotEmittedStatement */; + return node.kind === 326 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; /* @internal */ function isSyntheticReference(node) { - return node.kind === 330 /* SyntheticReferenceExpression */; + return node.kind === 331 /* SyntheticReferenceExpression */; } ts.isSyntheticReference = isSyntheticReference; /* @internal */ @@ -12419,13 +12481,13 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return true; - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -12454,7 +12516,7 @@ var ts; ts.isExternalModuleIndicator = isExternalModuleIndicator; /* @internal */ function isForInOrOfStatement(node) { - return node.kind === 231 /* ForInStatement */ || node.kind === 232 /* ForOfStatement */; + return node.kind === 232 /* ForInStatement */ || node.kind === 233 /* ForOfStatement */; } ts.isForInOrOfStatement = isForInOrOfStatement; // Element @@ -12478,114 +12540,114 @@ var ts; /* @internal */ function isModuleBody(node) { var kind = node.kind; - return kind === 250 /* ModuleBlock */ - || kind === 249 /* ModuleDeclaration */ + return kind === 251 /* ModuleBlock */ + || kind === 250 /* ModuleDeclaration */ || kind === 75 /* Identifier */; } ts.isModuleBody = isModuleBody; /* @internal */ function isNamespaceBody(node) { var kind = node.kind; - return kind === 250 /* ModuleBlock */ - || kind === 249 /* ModuleDeclaration */; + return kind === 251 /* ModuleBlock */ + || kind === 250 /* ModuleDeclaration */; } ts.isNamespaceBody = isNamespaceBody; /* @internal */ function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 75 /* Identifier */ - || kind === 249 /* ModuleDeclaration */; + || kind === 250 /* ModuleDeclaration */; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; /* @internal */ function isNamedImportBindings(node) { var kind = node.kind; - return kind === 257 /* NamedImports */ - || kind === 256 /* NamespaceImport */; + return kind === 258 /* NamedImports */ + || kind === 257 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; /* @internal */ function isModuleOrEnumDeclaration(node) { - return node.kind === 249 /* ModuleDeclaration */ || node.kind === 248 /* EnumDeclaration */; + return node.kind === 250 /* ModuleDeclaration */ || node.kind === 249 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 202 /* ArrowFunction */ - || kind === 191 /* BindingElement */ - || kind === 245 /* ClassDeclaration */ - || kind === 214 /* ClassExpression */ - || kind === 162 /* Constructor */ - || kind === 248 /* EnumDeclaration */ - || kind === 284 /* EnumMember */ - || kind === 263 /* ExportSpecifier */ - || kind === 244 /* FunctionDeclaration */ - || kind === 201 /* FunctionExpression */ - || kind === 163 /* GetAccessor */ - || kind === 255 /* ImportClause */ - || kind === 253 /* ImportEqualsDeclaration */ - || kind === 258 /* ImportSpecifier */ - || kind === 246 /* InterfaceDeclaration */ - || kind === 273 /* JsxAttribute */ - || kind === 161 /* MethodDeclaration */ - || kind === 160 /* MethodSignature */ - || kind === 249 /* ModuleDeclaration */ - || kind === 252 /* NamespaceExportDeclaration */ - || kind === 256 /* NamespaceImport */ - || kind === 262 /* NamespaceExport */ - || kind === 156 /* Parameter */ - || kind === 281 /* PropertyAssignment */ - || kind === 159 /* PropertyDeclaration */ - || kind === 158 /* PropertySignature */ - || kind === 164 /* SetAccessor */ - || kind === 282 /* ShorthandPropertyAssignment */ - || kind === 247 /* TypeAliasDeclaration */ - || kind === 155 /* TypeParameter */ - || kind === 242 /* VariableDeclaration */ - || kind === 322 /* JSDocTypedefTag */ - || kind === 315 /* JSDocCallbackTag */ - || kind === 323 /* JSDocPropertyTag */; + return kind === 203 /* ArrowFunction */ + || kind === 192 /* BindingElement */ + || kind === 246 /* ClassDeclaration */ + || kind === 215 /* ClassExpression */ + || kind === 163 /* Constructor */ + || kind === 249 /* EnumDeclaration */ + || kind === 285 /* EnumMember */ + || kind === 264 /* ExportSpecifier */ + || kind === 245 /* FunctionDeclaration */ + || kind === 202 /* FunctionExpression */ + || kind === 164 /* GetAccessor */ + || kind === 256 /* ImportClause */ + || kind === 254 /* ImportEqualsDeclaration */ + || kind === 259 /* ImportSpecifier */ + || kind === 247 /* InterfaceDeclaration */ + || kind === 274 /* JsxAttribute */ + || kind === 162 /* MethodDeclaration */ + || kind === 161 /* MethodSignature */ + || kind === 250 /* ModuleDeclaration */ + || kind === 253 /* NamespaceExportDeclaration */ + || kind === 257 /* NamespaceImport */ + || kind === 263 /* NamespaceExport */ + || kind === 157 /* Parameter */ + || kind === 282 /* PropertyAssignment */ + || kind === 160 /* PropertyDeclaration */ + || kind === 159 /* PropertySignature */ + || kind === 165 /* SetAccessor */ + || kind === 283 /* ShorthandPropertyAssignment */ + || kind === 248 /* TypeAliasDeclaration */ + || kind === 156 /* TypeParameter */ + || kind === 243 /* VariableDeclaration */ + || kind === 323 /* JSDocTypedefTag */ + || kind === 316 /* JSDocCallbackTag */ + || kind === 324 /* JSDocPropertyTag */; } function isDeclarationStatementKind(kind) { - return kind === 244 /* FunctionDeclaration */ - || kind === 264 /* MissingDeclaration */ - || kind === 245 /* ClassDeclaration */ - || kind === 246 /* InterfaceDeclaration */ - || kind === 247 /* TypeAliasDeclaration */ - || kind === 248 /* EnumDeclaration */ - || kind === 249 /* ModuleDeclaration */ - || kind === 254 /* ImportDeclaration */ - || kind === 253 /* ImportEqualsDeclaration */ - || kind === 260 /* ExportDeclaration */ - || kind === 259 /* ExportAssignment */ - || kind === 252 /* NamespaceExportDeclaration */; + return kind === 245 /* FunctionDeclaration */ + || kind === 265 /* MissingDeclaration */ + || kind === 246 /* ClassDeclaration */ + || kind === 247 /* InterfaceDeclaration */ + || kind === 248 /* TypeAliasDeclaration */ + || kind === 249 /* EnumDeclaration */ + || kind === 250 /* ModuleDeclaration */ + || kind === 255 /* ImportDeclaration */ + || kind === 254 /* ImportEqualsDeclaration */ + || kind === 261 /* ExportDeclaration */ + || kind === 260 /* ExportAssignment */ + || kind === 253 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 234 /* BreakStatement */ - || kind === 233 /* ContinueStatement */ - || kind === 241 /* DebuggerStatement */ - || kind === 228 /* DoStatement */ - || kind === 226 /* ExpressionStatement */ - || kind === 224 /* EmptyStatement */ - || kind === 231 /* ForInStatement */ - || kind === 232 /* ForOfStatement */ - || kind === 230 /* ForStatement */ - || kind === 227 /* IfStatement */ - || kind === 238 /* LabeledStatement */ - || kind === 235 /* ReturnStatement */ - || kind === 237 /* SwitchStatement */ - || kind === 239 /* ThrowStatement */ - || kind === 240 /* TryStatement */ - || kind === 225 /* VariableStatement */ - || kind === 229 /* WhileStatement */ - || kind === 236 /* WithStatement */ - || kind === 325 /* NotEmittedStatement */ - || kind === 329 /* EndOfDeclarationMarker */ - || kind === 328 /* MergeDeclarationMarker */; + return kind === 235 /* BreakStatement */ + || kind === 234 /* ContinueStatement */ + || kind === 242 /* DebuggerStatement */ + || kind === 229 /* DoStatement */ + || kind === 227 /* ExpressionStatement */ + || kind === 225 /* EmptyStatement */ + || kind === 232 /* ForInStatement */ + || kind === 233 /* ForOfStatement */ + || kind === 231 /* ForStatement */ + || kind === 228 /* IfStatement */ + || kind === 239 /* LabeledStatement */ + || kind === 236 /* ReturnStatement */ + || kind === 238 /* SwitchStatement */ + || kind === 240 /* ThrowStatement */ + || kind === 241 /* TryStatement */ + || kind === 226 /* VariableStatement */ + || kind === 230 /* WhileStatement */ + || kind === 237 /* WithStatement */ + || kind === 326 /* NotEmittedStatement */ + || kind === 330 /* EndOfDeclarationMarker */ + || kind === 329 /* MergeDeclarationMarker */; } /* @internal */ function isDeclaration(node) { - if (node.kind === 155 /* TypeParameter */) { - return (node.parent && node.parent.kind !== 321 /* JSDocTemplateTag */) || ts.isInJSFile(node); + if (node.kind === 156 /* TypeParameter */) { + return (node.parent && node.parent.kind !== 322 /* JSDocTemplateTag */) || ts.isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -12612,10 +12674,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 223 /* Block */) + if (node.kind !== 224 /* Block */) return false; if (node.parent !== undefined) { - if (node.parent.kind === 240 /* TryStatement */ || node.parent.kind === 280 /* CatchClause */) { + if (node.parent.kind === 241 /* TryStatement */ || node.parent.kind === 281 /* CatchClause */) { return false; } } @@ -12625,8 +12687,8 @@ var ts; /* @internal */ function isModuleReference(node) { var kind = node.kind; - return kind === 265 /* ExternalModuleReference */ - || kind === 153 /* QualifiedName */ + return kind === 266 /* ExternalModuleReference */ + || kind === 154 /* QualifiedName */ || kind === 75 /* Identifier */; } ts.isModuleReference = isModuleReference; @@ -12636,70 +12698,70 @@ var ts; var kind = node.kind; return kind === 104 /* ThisKeyword */ || kind === 75 /* Identifier */ - || kind === 194 /* PropertyAccessExpression */; + || kind === 195 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; /* @internal */ function isJsxChild(node) { var kind = node.kind; - return kind === 266 /* JsxElement */ - || kind === 276 /* JsxExpression */ - || kind === 267 /* JsxSelfClosingElement */ + return kind === 267 /* JsxElement */ + || kind === 277 /* JsxExpression */ + || kind === 268 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ - || kind === 270 /* JsxFragment */; + || kind === 271 /* JsxFragment */; } ts.isJsxChild = isJsxChild; /* @internal */ function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 273 /* JsxAttribute */ - || kind === 275 /* JsxSpreadAttribute */; + return kind === 274 /* JsxAttribute */ + || kind === 276 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; /* @internal */ function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 10 /* StringLiteral */ - || kind === 276 /* JsxExpression */; + || kind === 277 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 268 /* JsxOpeningElement */ - || kind === 267 /* JsxSelfClosingElement */; + return kind === 269 /* JsxOpeningElement */ + || kind === 268 /* JsxSelfClosingElement */; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 277 /* CaseClause */ - || kind === 278 /* DefaultClause */; + return kind === 278 /* CaseClause */ + || kind === 279 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; // JSDoc /** True if node is of some JSDoc syntax kind. */ /* @internal */ function isJSDocNode(node) { - return node.kind >= 294 /* FirstJSDocNode */ && node.kind <= 323 /* LastJSDocNode */; + return node.kind >= 295 /* FirstJSDocNode */ && node.kind <= 324 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node) { - return node.kind === 303 /* JSDocComment */ || node.kind === 302 /* JSDocNamepathType */ || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); + return node.kind === 304 /* JSDocComment */ || node.kind === 303 /* JSDocNamepathType */ || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; // TODO: determine what this does before making it public. /* @internal */ function isJSDocTag(node) { - return node.kind >= 306 /* FirstJSDocTagNode */ && node.kind <= 323 /* LastJSDocTagNode */; + return node.kind >= 307 /* FirstJSDocTagNode */ && node.kind <= 324 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 164 /* SetAccessor */; + return node.kind === 165 /* SetAccessor */; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 163 /* GetAccessor */; + return node.kind === 164 /* GetAccessor */; } ts.isGetAccessor = isGetAccessor; /** True if has jsdoc nodes attached to it. */ @@ -12725,13 +12787,13 @@ var ts; /** True if has initializer node attached to it. */ function hasOnlyExpressionInitializer(node) { switch (node.kind) { - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 191 /* BindingElement */: - case 158 /* PropertySignature */: - case 159 /* PropertyDeclaration */: - case 281 /* PropertyAssignment */: - case 284 /* EnumMember */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 192 /* BindingElement */: + case 159 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 282 /* PropertyAssignment */: + case 285 /* EnumMember */: return true; default: return false; @@ -12739,12 +12801,12 @@ var ts; } ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; function isObjectLiteralElement(node) { - return node.kind === 273 /* JsxAttribute */ || node.kind === 275 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); + return node.kind === 274 /* JsxAttribute */ || node.kind === 276 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); } ts.isObjectLiteralElement = isObjectLiteralElement; /* @internal */ function isTypeReferenceType(node) { - return node.kind === 169 /* TypeReference */ || node.kind === 216 /* ExpressionWithTypeArguments */; + return node.kind === 170 /* TypeReference */ || node.kind === 217 /* ExpressionWithTypeArguments */; } ts.isTypeReferenceType = isTypeReferenceType; var MAX_SMI_X86 = 1073741823; @@ -13038,7 +13100,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 290 /* SourceFile */) { + while (node && node.kind !== 291 /* SourceFile */) { node = node.parent; } return node; @@ -13046,11 +13108,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 223 /* Block */: - case 251 /* CaseBlock */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 224 /* Block */: + case 252 /* CaseBlock */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: return true; } return false; @@ -13202,6 +13264,33 @@ var ts; text.charCodeAt(start + 2) === 33 /* exclamation */; } ts.isPinnedComment = isPinnedComment; + function createCommentDirectivesMap(sourceFile, commentDirectives) { + var directivesByLine = ts.createMapFromEntries(commentDirectives.map(function (commentDirective) { return ([ + "" + ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.pos).line, + commentDirective, + ]); })); + var usedLines = ts.createMap(); + return { getUnusedExpectations: getUnusedExpectations, markUsed: markUsed }; + function getUnusedExpectations() { + return ts.arrayFrom(directivesByLine.entries()) + .filter(function (_a) { + var line = _a[0], directive = _a[1]; + return directive.type === 0 /* ExpectError */ && !usedLines.get(line); + }) + .map(function (_a) { + var _ = _a[0], directive = _a[1]; + return directive; + }); + } + function markUsed(line) { + if (!directivesByLine.has("" + line)) { + return false; + } + usedLines.set("" + line, true); + return true; + } + } + ts.createCommentDirectivesMap = createCommentDirectivesMap; function getTokenPosOfNode(node, sourceFile, includeJsDoc) { // With nodes that have no width (i.e. 'Missing' nodes), we actually *don't* // want to skip trivia because this will launch us forward to the next token. @@ -13218,7 +13307,7 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 324 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 325 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -13343,7 +13432,7 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 242 /* VariableDeclaration */ && node.parent.kind === 280 /* CatchClause */; + return node.kind === 243 /* VariableDeclaration */ && node.parent.kind === 281 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { @@ -13375,11 +13464,11 @@ var ts; ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { // The only kind of module that can be missing a body is a shorthand ambient module. - return node && node.kind === 249 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 250 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 290 /* SourceFile */ || - node.kind === 249 /* ModuleDeclaration */ || + return node.kind === 291 /* SourceFile */ || + node.kind === 250 /* ModuleDeclaration */ || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -13396,9 +13485,9 @@ var ts; // - defined in the top level scope and source file is an external module // - defined inside ambient module declaration located in the top level scope and source file not an external module switch (node.parent.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: return ts.isExternalModule(node.parent); - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -13451,22 +13540,22 @@ var ts; ts.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile; function isBlockScope(node, parentNode) { switch (node.kind) { - case 290 /* SourceFile */: - case 251 /* CaseBlock */: - case 280 /* CatchClause */: - case 249 /* ModuleDeclaration */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 291 /* SourceFile */: + case 252 /* CaseBlock */: + case 281 /* CatchClause */: + case 250 /* ModuleDeclaration */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return true; - case 223 /* Block */: + case 224 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return !ts.isFunctionLike(parentNode); @@ -13476,9 +13565,9 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: - case 305 /* JSDocSignature */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: + case 306 /* JSDocSignature */: return true; default: ts.assertType(node); @@ -13488,25 +13577,25 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isDeclarationWithTypeParameterChildren(node) { switch (node.kind) { - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 160 /* MethodSignature */: - case 167 /* IndexSignature */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 300 /* JSDocFunctionType */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 321 /* JSDocTemplateTag */: - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 161 /* MethodSignature */: + case 168 /* IndexSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 301 /* JSDocFunctionType */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 322 /* JSDocTemplateTag */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return true; default: ts.assertType(node); @@ -13516,8 +13605,8 @@ var ts; ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren; function isAnyImportSyntax(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: return true; default: return false; @@ -13526,15 +13615,15 @@ var ts; ts.isAnyImportSyntax = isAnyImportSyntax; function isLateVisibilityPaintedStatement(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 225 /* VariableStatement */: - case 245 /* ClassDeclaration */: - case 244 /* FunctionDeclaration */: - case 249 /* ModuleDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 226 /* VariableStatement */: + case 246 /* ClassDeclaration */: + case 245 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: return true; default: return false; @@ -13571,7 +13660,7 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: if (isStringOrNumericLiteralLike(name.expression)) return ts.escapeLeadingUnderscores(name.expression.text); return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames"); @@ -13587,9 +13676,9 @@ var ts; case 76 /* PrivateIdentifier */: case 75 /* Identifier */: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: if (ts.isIdentifier(name.name) || ts.isPrivateIdentifier(name.name)) { return entityNameToString(name.expression) + "." + entityNameToString(name.name); } @@ -13630,6 +13719,17 @@ var ts; }; } ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; + function createDiagnosticForRange(sourceFile, range, message) { + return { + file: sourceFile, + start: range.pos, + length: range.end - range.pos, + code: message.code, + category: message.category, + messageText: message.message, + }; + } + ts.createDiagnosticForRange = createDiagnosticForRange; function getSpanOfTokenAtPosition(sourceFile, pos) { var scanner = ts.createScanner(sourceFile.languageVersion, /*skipTrivia*/ true, sourceFile.languageVariant, sourceFile.text, /*onError:*/ undefined, pos); scanner.scan(); @@ -13639,7 +13739,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 223 /* Block */) { + if (node.body && node.body.kind === 224 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -13653,7 +13753,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -13662,28 +13762,28 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 242 /* VariableDeclaration */: - case 191 /* BindingElement */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 247 /* TypeAliasDeclaration */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 243 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 248 /* TypeAliasDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: errorNode = node.name; break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: var start = ts.skipTrivia(sourceFile.text, node.pos); var end = node.statements.length > 0 ? node.statements[0].pos : node.end; return ts.createTextSpanFromBounds(start, end); @@ -13735,11 +13835,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 196 /* CallExpression */ && n.expression.kind === 102 /* SuperKeyword */; + return n.kind === 197 /* CallExpression */ && n.expression.kind === 102 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 196 /* CallExpression */ && n.expression.kind === 96 /* ImportKeyword */; + return n.kind === 197 /* CallExpression */ && n.expression.kind === 96 /* ImportKeyword */; } ts.isImportCall = isImportCall; function isImportMeta(n) { @@ -13753,7 +13853,7 @@ var ts; } ts.isLiteralImportTypeNode = isLiteralImportTypeNode; function isPrologueDirective(node) { - return node.kind === 226 /* ExpressionStatement */ + return node.kind === 227 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -13762,11 +13862,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 156 /* Parameter */ || - node.kind === 155 /* TypeParameter */ || - node.kind === 201 /* FunctionExpression */ || - node.kind === 202 /* ArrowFunction */ || - node.kind === 200 /* ParenthesizedExpression */) ? + var commentRanges = (node.kind === 157 /* Parameter */ || + node.kind === 156 /* TypeParameter */ || + node.kind === 202 /* FunctionExpression */ || + node.kind === 203 /* ArrowFunction */ || + node.kind === 201 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' @@ -13782,48 +13882,48 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (168 /* FirstTypeNode */ <= node.kind && node.kind <= 188 /* LastTypeNode */) { + if (169 /* FirstTypeNode */ <= node.kind && node.kind <= 189 /* LastTypeNode */) { return true; } switch (node.kind) { case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 143 /* StringKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: - case 141 /* ObjectKeyword */: - case 146 /* UndefinedKeyword */: - case 137 /* NeverKeyword */: + case 149 /* UnknownKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 144 /* StringKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: + case 142 /* ObjectKeyword */: + case 147 /* UndefinedKeyword */: + case 138 /* NeverKeyword */: return true; case 110 /* VoidKeyword */: - return node.parent.kind !== 205 /* VoidExpression */; - case 216 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 206 /* VoidExpression */; + case 217 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); - case 155 /* TypeParameter */: - return node.parent.kind === 186 /* MappedType */ || node.parent.kind === 181 /* InferType */; + case 156 /* TypeParameter */: + return node.parent.kind === 187 /* MappedType */ || node.parent.kind === 182 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 75 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 153 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 154 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 75 /* Identifier */ || node.kind === 153 /* QualifiedName */ || node.kind === 194 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + ts.Debug.assert(node.kind === 75 /* Identifier */ || node.kind === 154 /* QualifiedName */ || node.kind === 195 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 153 /* QualifiedName */: - case 194 /* PropertyAccessExpression */: + case 154 /* QualifiedName */: + case 195 /* PropertyAccessExpression */: case 104 /* ThisKeyword */: { var parent = node.parent; - if (parent.kind === 172 /* TypeQuery */) { + if (parent.kind === 173 /* TypeQuery */) { return false; } - if (parent.kind === 188 /* ImportType */) { + if (parent.kind === 189 /* ImportType */) { return !parent.isTypeOf; } // Do not recursively call isPartOfTypeNode on the parent. In the example: @@ -13832,40 +13932,40 @@ var ts; // // Calling isPartOfTypeNode would consider the qualified name A.B a type node. // Only C and A.B.C are type nodes. - if (168 /* FirstTypeNode */ <= parent.kind && parent.kind <= 188 /* LastTypeNode */) { + if (169 /* FirstTypeNode */ <= parent.kind && parent.kind <= 189 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return node === parent.constraint; - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return node === parent.constraint; - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 156 /* Parameter */: - case 242 /* VariableDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 157 /* Parameter */: + case 243 /* VariableDeclaration */: return node === parent.type; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return node === parent.type; - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: return node === parent.type; - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: return node === parent.type; - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: return ts.contains(parent.typeArguments, node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -13890,23 +13990,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitor(node); - case 251 /* CaseBlock */: - case 223 /* Block */: - case 227 /* IfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 236 /* WithStatement */: - case 237 /* SwitchStatement */: - case 277 /* CaseClause */: - case 278 /* DefaultClause */: - case 238 /* LabeledStatement */: - case 240 /* TryStatement */: - case 280 /* CatchClause */: + case 252 /* CaseBlock */: + case 224 /* Block */: + case 228 /* IfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 237 /* WithStatement */: + case 238 /* SwitchStatement */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: + case 239 /* LabeledStatement */: + case 241 /* TryStatement */: + case 281 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -13916,23 +14016,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 248 /* EnumDeclaration */: - case 246 /* InterfaceDeclaration */: - case 249 /* ModuleDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: + case 247 /* InterfaceDeclaration */: + case 250 /* ModuleDeclaration */: + case 248 /* TypeAliasDeclaration */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, skip them to avoid the work. return; default: if (ts.isFunctionLike(node)) { - if (node.name && node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 155 /* ComputedPropertyName */) { // Note that we will not include methods/accessors of a class because they would require // first descending into the class. This is by design. traverse(node.name.expression); @@ -13955,10 +14055,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 174 /* ArrayType */) { + if (node && node.kind === 175 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 169 /* TypeReference */) { + else if (node && node.kind === 170 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -13968,12 +14068,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 246 /* InterfaceDeclaration */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 173 /* TypeLiteral */: + case 247 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 174 /* TypeLiteral */: return node.members; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return node.properties; } } @@ -13981,14 +14081,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 191 /* BindingElement */: - case 284 /* EnumMember */: - case 156 /* Parameter */: - case 281 /* PropertyAssignment */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 282 /* ShorthandPropertyAssignment */: - case 242 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 285 /* EnumMember */: + case 157 /* Parameter */: + case 282 /* PropertyAssignment */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 283 /* ShorthandPropertyAssignment */: + case 243 /* VariableDeclaration */: return true; } } @@ -14000,8 +14100,8 @@ var ts; } ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 243 /* VariableDeclarationList */ - && node.parent.parent.kind === 225 /* VariableStatement */; + return node.parent.kind === 244 /* VariableDeclarationList */ + && node.parent.parent.kind === 226 /* VariableStatement */; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -14012,13 +14112,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return true; } return false; @@ -14029,7 +14129,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 238 /* LabeledStatement */) { + if (node.statement.kind !== 239 /* LabeledStatement */) { return node.statement; } node = node.statement; @@ -14037,17 +14137,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 223 /* Block */ && ts.isFunctionLike(node.parent); + return node && node.kind === 224 /* Block */ && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 161 /* MethodDeclaration */ && node.parent.kind === 193 /* ObjectLiteralExpression */; + return node && node.kind === 162 /* MethodDeclaration */ && node.parent.kind === 194 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 161 /* MethodDeclaration */ && - (node.parent.kind === 193 /* ObjectLiteralExpression */ || - node.parent.kind === 214 /* ClassExpression */); + return node.kind === 162 /* MethodDeclaration */ && + (node.parent.kind === 194 /* ObjectLiteralExpression */ || + node.parent.kind === 215 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -14060,7 +14160,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return objectLiteral.properties.filter(function (property) { - if (property.kind === 281 /* PropertyAssignment */) { + if (property.kind === 282 /* PropertyAssignment */) { var propName = getTextOfPropertyName(property.name); return key === propName || (!!key2 && key2 === propName); } @@ -14101,14 +14201,14 @@ var ts; } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { - ts.Debug.assert(node.kind !== 290 /* SourceFile */); + ts.Debug.assert(node.kind !== 291 /* SourceFile */); while (true) { node = node.parent; if (!node) { return ts.Debug.fail(); // If we never pass in a SourceFile, this should be unreachable, since we'll stop when we reach that. } switch (node.kind) { - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: // If the grandparent node is an object literal (as opposed to a class), // then the computed property is not a 'this' container. // A computed property name in a class needs to be a this container @@ -14123,9 +14223,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 157 /* Decorator */: + case 158 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 156 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 157 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -14136,26 +14236,26 @@ var ts; node = node.parent; } break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 249 /* ModuleDeclaration */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 248 /* EnumDeclaration */: - case 290 /* SourceFile */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 250 /* ModuleDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 249 /* EnumDeclaration */: + case 291 /* SourceFile */: return node; } } @@ -14165,9 +14265,9 @@ var ts; var container = getThisContainer(node, /*includeArrowFunctions*/ false); if (container) { switch (container.kind) { - case 162 /* Constructor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 163 /* Constructor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return container; } } @@ -14189,27 +14289,27 @@ var ts; return node; } switch (node.kind) { - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: node = node.parent; break; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return node; - case 157 /* Decorator */: + case 158 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 156 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 157 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -14225,14 +14325,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 201 /* FunctionExpression */ || func.kind === 202 /* ArrowFunction */) { + if (func.kind === 202 /* FunctionExpression */ || func.kind === 203 /* ArrowFunction */) { var prev = func; var parent = func.parent; - while (parent.kind === 200 /* ParenthesizedExpression */) { + while (parent.kind === 201 /* ParenthesizedExpression */) { prev = parent; parent = parent.parent; } - if (parent.kind === 196 /* CallExpression */ && parent.expression === prev) { + if (parent.kind === 197 /* CallExpression */ && parent.expression === prev) { return parent; } } @@ -14248,7 +14348,7 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 194 /* PropertyAccessExpression */ || kind === 195 /* ElementAccessExpression */) + return (kind === 195 /* PropertyAccessExpression */ || kind === 196 /* ElementAccessExpression */) && node.expression.kind === 102 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; @@ -14257,20 +14357,20 @@ var ts; */ function isThisProperty(node) { var kind = node.kind; - return (kind === 194 /* PropertyAccessExpression */ || kind === 195 /* ElementAccessExpression */) + return (kind === 195 /* PropertyAccessExpression */ || kind === 196 /* ElementAccessExpression */) && node.expression.kind === 104 /* ThisKeyword */; } ts.isThisProperty = isThisProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return node.typeName; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 75 /* Identifier */: - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return node; } return undefined; @@ -14278,10 +14378,10 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { switch (node.kind) { - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return node.tag; - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: return node.tagName; default: return node.expression; @@ -14294,25 +14394,25 @@ var ts; return false; } switch (node.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: // classes are valid targets return true; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return parent.kind === 245 /* ClassDeclaration */; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 161 /* MethodDeclaration */: + return parent.kind === 246 /* ClassDeclaration */; + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 162 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && parent.kind === 245 /* ClassDeclaration */; - case 156 /* Parameter */: + && parent.kind === 246 /* ClassDeclaration */; + case 157 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return parent.body !== undefined - && (parent.kind === 162 /* Constructor */ - || parent.kind === 161 /* MethodDeclaration */ - || parent.kind === 164 /* SetAccessor */) - && grandparent.kind === 245 /* ClassDeclaration */; + && (parent.kind === 163 /* Constructor */ + || parent.kind === 162 /* MethodDeclaration */ + || parent.kind === 165 /* SetAccessor */) + && grandparent.kind === 246 /* ClassDeclaration */; } return false; } @@ -14328,10 +14428,10 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); // TODO: GH#18217 - case 161 /* MethodDeclaration */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 165 /* SetAccessor */: return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); // TODO: GH#18217 default: return false; @@ -14340,9 +14440,9 @@ var ts; ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 268 /* JsxOpeningElement */ || - parent.kind === 267 /* JsxSelfClosingElement */ || - parent.kind === 269 /* JsxClosingElement */) { + if (parent.kind === 269 /* JsxOpeningElement */ || + parent.kind === 268 /* JsxSelfClosingElement */ || + parent.kind === 270 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -14355,44 +14455,44 @@ var ts; case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: case 13 /* RegularExpressionLiteral */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 198 /* TaggedTemplateExpression */: - case 217 /* AsExpression */: - case 199 /* TypeAssertionExpression */: - case 218 /* NonNullExpression */: - case 200 /* ParenthesizedExpression */: - case 201 /* FunctionExpression */: - case 214 /* ClassExpression */: - case 202 /* ArrowFunction */: - case 205 /* VoidExpression */: - case 203 /* DeleteExpression */: - case 204 /* TypeOfExpression */: - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: - case 209 /* BinaryExpression */: - case 210 /* ConditionalExpression */: - case 213 /* SpreadElement */: - case 211 /* TemplateExpression */: - case 215 /* OmittedExpression */: - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 270 /* JsxFragment */: - case 212 /* YieldExpression */: - case 206 /* AwaitExpression */: - case 219 /* MetaProperty */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 199 /* TaggedTemplateExpression */: + case 218 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 219 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: + case 202 /* FunctionExpression */: + case 215 /* ClassExpression */: + case 203 /* ArrowFunction */: + case 206 /* VoidExpression */: + case 204 /* DeleteExpression */: + case 205 /* TypeOfExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: + case 210 /* BinaryExpression */: + case 211 /* ConditionalExpression */: + case 214 /* SpreadElement */: + case 212 /* TemplateExpression */: + case 216 /* OmittedExpression */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 271 /* JsxFragment */: + case 213 /* YieldExpression */: + case 207 /* AwaitExpression */: + case 220 /* MetaProperty */: return true; - case 153 /* QualifiedName */: - while (node.parent.kind === 153 /* QualifiedName */) { + case 154 /* QualifiedName */: + while (node.parent.kind === 154 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 172 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 173 /* TypeQuery */ || isJSXTagName(node); case 75 /* Identifier */: - if (node.parent.kind === 172 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 173 /* TypeQuery */ || isJSXTagName(node)) { return true; } // falls through @@ -14410,49 +14510,49 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 284 /* EnumMember */: - case 281 /* PropertyAssignment */: - case 191 /* BindingElement */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 285 /* EnumMember */: + case 282 /* PropertyAssignment */: + case 192 /* BindingElement */: return parent.initializer === node; - case 226 /* ExpressionStatement */: - case 227 /* IfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 235 /* ReturnStatement */: - case 236 /* WithStatement */: - case 237 /* SwitchStatement */: - case 277 /* CaseClause */: - case 239 /* ThrowStatement */: + case 227 /* ExpressionStatement */: + case 228 /* IfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 236 /* ReturnStatement */: + case 237 /* WithStatement */: + case 238 /* SwitchStatement */: + case 278 /* CaseClause */: + case 240 /* ThrowStatement */: return parent.expression === node; - case 230 /* ForStatement */: + case 231 /* ForStatement */: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 243 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 244 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 243 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 244 /* VariableDeclarationList */) || forInStatement.expression === node; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: return node === parent.expression; - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return node === parent.expression; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return node === parent.expression; - case 157 /* Decorator */: - case 276 /* JsxExpression */: - case 275 /* JsxSpreadAttribute */: - case 283 /* SpreadAssignment */: + case 158 /* Decorator */: + case 277 /* JsxExpression */: + case 276 /* JsxSpreadAttribute */: + case 284 /* SpreadAssignment */: return true; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return parent.objectAssignmentInitializer === node; default: return isExpressionNode(parent); @@ -14460,14 +14560,14 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isPartOfTypeQuery(node) { - while (node.kind === 153 /* QualifiedName */ || node.kind === 75 /* Identifier */) { + while (node.kind === 154 /* QualifiedName */ || node.kind === 75 /* Identifier */) { node = node.parent; } - return node.kind === 172 /* TypeQuery */; + return node.kind === 173 /* TypeQuery */; } ts.isPartOfTypeQuery = isPartOfTypeQuery; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 265 /* ExternalModuleReference */; + return node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 266 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -14476,7 +14576,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 265 /* ExternalModuleReference */; + return node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 266 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJS(file) { @@ -14508,11 +14608,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 143 /* StringKeyword */ || node.typeArguments[0].kind === 140 /* NumberKeyword */); + (node.typeArguments[0].kind === 144 /* StringKeyword */ || node.typeArguments[0].kind === 141 /* NumberKeyword */); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, requireStringLiteralLikeArgument) { - if (callExpression.kind !== 196 /* CallExpression */) { + if (callExpression.kind !== 197 /* CallExpression */) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -14644,11 +14744,11 @@ var ts; function getExpandoInitializer(initializer, isPrototypeAssignment) { if (ts.isCallExpression(initializer)) { var e = skipParentheses(initializer.expression); - return e.kind === 201 /* FunctionExpression */ || e.kind === 202 /* ArrowFunction */ ? initializer : undefined; + return e.kind === 202 /* FunctionExpression */ || e.kind === 203 /* ArrowFunction */ ? initializer : undefined; } - if (initializer.kind === 201 /* FunctionExpression */ || - initializer.kind === 214 /* ClassExpression */ || - initializer.kind === 202 /* ArrowFunction */) { + if (initializer.kind === 202 /* FunctionExpression */ || + initializer.kind === 215 /* ClassExpression */ || + initializer.kind === 203 /* ArrowFunction */) { return initializer; } if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -14874,7 +14974,7 @@ var ts; // exports.name = expr OR module.exports.name = expr OR exports["name"] = expr ... return 1 /* ExportsProperty */; } - if (isBindableStaticNameExpression(lhs, /*excludeThisKeyword*/ true) || (ts.isElementAccessExpression(lhs) && isDynamicName(lhs) && lhs.expression.kind !== 104 /* ThisKeyword */)) { + if (isBindableStaticNameExpression(lhs, /*excludeThisKeyword*/ true) || (ts.isElementAccessExpression(lhs) && isDynamicName(lhs))) { // F.G...x = expr return 5 /* Property */; } @@ -14895,7 +14995,7 @@ var ts; ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment; function isSpecialPropertyDeclaration(expr) { return isInJSFile(expr) && - expr.parent && expr.parent.kind === 226 /* ExpressionStatement */ && + expr.parent && expr.parent.kind === 227 /* ExpressionStatement */ && (!ts.isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!ts.getJSDocTypeTag(expr.parent); } @@ -14905,7 +15005,7 @@ var ts; return false; } var decl = symbol.valueDeclaration; - return decl.kind === 244 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); + return decl.kind === 245 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); } ts.isFunctionSymbol = isFunctionSymbol; function importFromModuleSpecifier(node) { @@ -14914,14 +15014,14 @@ var ts; ts.importFromModuleSpecifier = importFromModuleSpecifier; function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: return node.parent; - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: return node.parent.parent; - case 196 /* CallExpression */: + case 197 /* CallExpression */: return isImportCall(node.parent) || isRequireCall(node.parent, /*checkArg*/ false) ? node.parent : undefined; - case 187 /* LiteralType */: + case 188 /* LiteralType */: ts.Debug.assert(ts.isStringLiteral(node)); return ts.tryCast(node.parent.parent, ts.isImportTypeNode); default: @@ -14931,12 +15031,12 @@ var ts; ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier; function getExternalModuleName(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: return node.moduleSpecifier; - case 253 /* ImportEqualsDeclaration */: - return node.moduleReference.kind === 265 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; - case 188 /* ImportType */: + case 254 /* ImportEqualsDeclaration */: + return node.moduleReference.kind === 266 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; + case 189 /* ImportType */: return isLiteralImportTypeNode(node) ? node.argument.literal : undefined; default: return ts.Debug.assertNever(node); @@ -14945,11 +15045,11 @@ var ts; ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return node; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return node.exportClause && ts.tryCast(node.exportClause, ts.isNamespaceExport); default: return ts.Debug.assertNever(node); @@ -14957,7 +15057,7 @@ var ts; } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 254 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; + return node.kind === 255 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function forEachImportClauseDeclaration(node, action) { @@ -14978,13 +15078,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 156 /* Parameter */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 282 /* ShorthandPropertyAssignment */: - case 281 /* PropertyAssignment */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 157 /* Parameter */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 283 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -14998,7 +15098,7 @@ var ts; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function isJSDocTypeAlias(node) { - return node.kind === 322 /* JSDocTypedefTag */ || node.kind === 315 /* JSDocCallbackTag */ || node.kind === 316 /* JSDocEnumTag */; + return node.kind === 323 /* JSDocTypedefTag */ || node.kind === 316 /* JSDocCallbackTag */ || node.kind === 317 /* JSDocEnumTag */; } ts.isJSDocTypeAlias = isJSDocTypeAlias; function isTypeAlias(node) { @@ -15023,12 +15123,12 @@ var ts; } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: var v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return node.initializer; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return node.initializer; } } @@ -15039,7 +15139,7 @@ var ts; function getNestedModuleDeclaration(node) { return ts.isModuleDeclaration(node) && node.body && - node.body.kind === 249 /* ModuleDeclaration */ + node.body.kind === 250 /* ModuleDeclaration */ ? node.body : undefined; } @@ -15054,11 +15154,11 @@ var ts; if (ts.hasJSDocNodes(node)) { result = ts.append(result, ts.last(node.jsDoc)); } - if (node.kind === 156 /* Parameter */) { + if (node.kind === 157 /* Parameter */) { result = ts.addRange(result, ts.getJSDocParameterTags(node)); break; } - if (node.kind === 155 /* TypeParameter */) { + if (node.kind === 156 /* TypeParameter */) { result = ts.addRange(result, ts.getJSDocTypeParameterTags(node)); break; } @@ -15069,10 +15169,10 @@ var ts; ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags; function getNextJSDocCommentLocation(node) { var parent = node.parent; - if (parent.kind === 281 /* PropertyAssignment */ || - parent.kind === 259 /* ExportAssignment */ || - parent.kind === 159 /* PropertyDeclaration */ || - parent.kind === 226 /* ExpressionStatement */ && node.kind === 194 /* PropertyAccessExpression */ || + if (parent.kind === 282 /* PropertyAssignment */ || + parent.kind === 260 /* ExportAssignment */ || + parent.kind === 160 /* PropertyDeclaration */ || + parent.kind === 227 /* ExpressionStatement */ && node.kind === 195 /* PropertyAccessExpression */ || getNestedModuleDeclaration(parent) || ts.isBinaryExpression(node) && node.operatorToken.kind === 62 /* EqualsToken */) { return parent; @@ -15146,7 +15246,7 @@ var ts; ts.hasRestParameter = hasRestParameter; function isRestParameter(node) { var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type; - return node.dotDotDotToken !== undefined || !!type && type.kind === 301 /* JSDocVariadicType */; + return node.dotDotDotToken !== undefined || !!type && type.kind === 302 /* JSDocVariadicType */; } ts.isRestParameter = isRestParameter; function hasTypeArguments(node) { @@ -15163,31 +15263,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 62 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 200 /* ParenthesizedExpression */: - case 192 /* ArrayLiteralExpression */: - case 213 /* SpreadElement */: - case 218 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: + case 193 /* ArrayLiteralExpression */: + case 214 /* SpreadElement */: + case 219 /* NonNullExpression */: node = parent; break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } node = parent.parent; break; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: if (parent.name === node) { return 0 /* None */; } @@ -15214,22 +15314,22 @@ var ts; */ function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 223 /* Block */: - case 225 /* VariableStatement */: - case 236 /* WithStatement */: - case 227 /* IfStatement */: - case 237 /* SwitchStatement */: - case 251 /* CaseBlock */: - case 277 /* CaseClause */: - case 278 /* DefaultClause */: - case 238 /* LabeledStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 240 /* TryStatement */: - case 280 /* CatchClause */: + case 224 /* Block */: + case 226 /* VariableStatement */: + case 237 /* WithStatement */: + case 228 /* IfStatement */: + case 238 /* SwitchStatement */: + case 252 /* CaseBlock */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: + case 239 /* LabeledStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 241 /* TryStatement */: + case 281 /* CatchClause */: return true; } return false; @@ -15246,33 +15346,33 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 182 /* ParenthesizedType */); + return walkUp(node, 183 /* ParenthesizedType */); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 200 /* ParenthesizedExpression */); + return walkUp(node, 201 /* ParenthesizedExpression */); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; function skipParentheses(node) { - while (node.kind === 200 /* ParenthesizedExpression */) { + while (node.kind === 201 /* ParenthesizedExpression */) { node = node.expression; } return node; } ts.skipParentheses = skipParentheses; function skipParenthesesUp(node) { - while (node.kind === 200 /* ParenthesizedExpression */) { + while (node.kind === 201 /* ParenthesizedExpression */) { node = node.parent; } return node; } // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped function isDeleteTarget(node) { - if (node.kind !== 194 /* PropertyAccessExpression */ && node.kind !== 195 /* ElementAccessExpression */) { + if (node.kind !== 195 /* PropertyAccessExpression */ && node.kind !== 196 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 203 /* DeleteExpression */; + return node && node.kind === 204 /* DeleteExpression */; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -15325,7 +15425,7 @@ var ts; ts.getDeclarationFromName = getDeclarationFromName; function isLiteralComputedPropertyDeclarationName(node) { return isStringOrNumericLiteralLike(node) && - node.parent.kind === 154 /* ComputedPropertyName */ && + node.parent.kind === 155 /* ComputedPropertyName */ && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -15333,32 +15433,32 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 284 /* EnumMember */: - case 281 /* PropertyAssignment */: - case 194 /* PropertyAccessExpression */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 285 /* EnumMember */: + case 282 /* PropertyAssignment */: + case 195 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: // Name on right hand side of dot in a type query or type reference if (parent.right === node) { - while (parent.kind === 153 /* QualifiedName */) { + while (parent.kind === 154 /* QualifiedName */) { parent = parent.parent; } - return parent.kind === 172 /* TypeQuery */ || parent.kind === 169 /* TypeReference */; + return parent.kind === 173 /* TypeQuery */ || parent.kind === 170 /* TypeReference */; } return false; - case 191 /* BindingElement */: - case 258 /* ImportSpecifier */: + case 192 /* BindingElement */: + case 259 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 263 /* ExportSpecifier */: - case 273 /* JsxAttribute */: + case 264 /* ExportSpecifier */: + case 274 /* JsxAttribute */: // Any name in an export specifier or JSX Attribute return true; } @@ -15378,33 +15478,33 @@ var ts; // {} // {name: } function isAliasSymbolDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */ || - node.kind === 252 /* NamespaceExportDeclaration */ || - node.kind === 255 /* ImportClause */ && !!node.name || - node.kind === 256 /* NamespaceImport */ || - node.kind === 262 /* NamespaceExport */ || - node.kind === 258 /* ImportSpecifier */ || - node.kind === 263 /* ExportSpecifier */ || - node.kind === 259 /* ExportAssignment */ && exportAssignmentIsAlias(node) || + return node.kind === 254 /* ImportEqualsDeclaration */ || + node.kind === 253 /* NamespaceExportDeclaration */ || + node.kind === 256 /* ImportClause */ && !!node.name || + node.kind === 257 /* NamespaceImport */ || + node.kind === 263 /* NamespaceExport */ || + node.kind === 259 /* ImportSpecifier */ || + node.kind === 264 /* ExportSpecifier */ || + node.kind === 260 /* ExportAssignment */ && exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableExpression(node.parent.right) || - node.kind === 282 /* ShorthandPropertyAssignment */ || - node.kind === 281 /* PropertyAssignment */ && isAliasableExpression(node.initializer); + node.kind === 283 /* ShorthandPropertyAssignment */ || + node.kind === 282 /* PropertyAssignment */ && isAliasableExpression(node.initializer); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getAliasDeclarationFromName(node) { switch (node.parent.kind) { - case 255 /* ImportClause */: - case 258 /* ImportSpecifier */: - case 256 /* NamespaceImport */: - case 263 /* ExportSpecifier */: - case 259 /* ExportAssignment */: - case 253 /* ImportEqualsDeclaration */: + case 256 /* ImportClause */: + case 259 /* ImportSpecifier */: + case 257 /* NamespaceImport */: + case 264 /* ExportSpecifier */: + case 260 /* ExportAssignment */: + case 254 /* ImportEqualsDeclaration */: return node.parent; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: do { node = node.parent; - } while (node.parent.kind === 153 /* QualifiedName */); + } while (node.parent.kind === 154 /* QualifiedName */); return getAliasDeclarationFromName(node); } } @@ -15423,7 +15523,7 @@ var ts; } ts.getExportAssignmentExpression = getExportAssignmentExpression; function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 282 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 281 /* PropertyAssignment */ ? node.initializer : + return node.kind === 283 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 282 /* PropertyAssignment */ ? node.initializer : node.parent.right; } ts.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression; @@ -15489,11 +15589,11 @@ var ts; } ts.getAncestor = getAncestor; function isKeyword(token) { - return 77 /* FirstKeyword */ <= token && token <= 152 /* LastKeyword */; + return 77 /* FirstKeyword */ <= token && token <= 153 /* LastKeyword */; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 122 /* FirstContextualKeyword */ <= token && token <= 152 /* LastContextualKeyword */; + return 122 /* FirstContextualKeyword */ <= token && token <= 153 /* LastContextualKeyword */; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -15537,14 +15637,14 @@ var ts; } var flags = 0 /* Normal */; switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } // falls through - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: if (hasModifier(node, 256 /* Async */)) { flags |= 2 /* Async */; } @@ -15558,10 +15658,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: return node.body !== undefined && node.asteriskToken === undefined && hasModifier(node, 256 /* Async */); @@ -15594,7 +15694,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - if (!(name.kind === 154 /* ComputedPropertyName */ || name.kind === 195 /* ElementAccessExpression */)) { + if (!(name.kind === 155 /* ComputedPropertyName */ || name.kind === 196 /* ElementAccessExpression */)) { return false; } var expr = ts.isElementAccessExpression(name) ? name.argumentExpression : name.expression; @@ -15620,7 +15720,7 @@ var ts; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -15683,11 +15783,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 156 /* Parameter */; + return root.kind === 157 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 191 /* BindingElement */) { + while (node.kind === 192 /* BindingElement */) { node = node.parent.parent; } return node; @@ -15695,15 +15795,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 162 /* Constructor */ - || kind === 201 /* FunctionExpression */ - || kind === 244 /* FunctionDeclaration */ - || kind === 202 /* ArrowFunction */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */ - || kind === 249 /* ModuleDeclaration */ - || kind === 290 /* SourceFile */; + return kind === 163 /* Constructor */ + || kind === 202 /* FunctionExpression */ + || kind === 245 /* FunctionDeclaration */ + || kind === 203 /* ArrowFunction */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */ + || kind === 250 /* ModuleDeclaration */ + || kind === 291 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -15722,23 +15822,23 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 197 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 198 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 197 /* NewExpression */: + case 198 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 207 /* PrefixUnaryExpression */: - case 204 /* TypeOfExpression */: - case 205 /* VoidExpression */: - case 203 /* DeleteExpression */: - case 206 /* AwaitExpression */: - case 210 /* ConditionalExpression */: - case 212 /* YieldExpression */: + case 208 /* PrefixUnaryExpression */: + case 205 /* TypeOfExpression */: + case 206 /* VoidExpression */: + case 204 /* DeleteExpression */: + case 207 /* AwaitExpression */: + case 211 /* ConditionalExpression */: + case 213 /* YieldExpression */: return 1 /* Right */; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (operator) { case 42 /* AsteriskAsteriskToken */: case 62 /* EqualsToken */: @@ -15762,15 +15862,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 197 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 198 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 209 /* BinaryExpression */) { + if (expression.kind === 210 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 207 /* PrefixUnaryExpression */ || expression.kind === 208 /* PostfixUnaryExpression */) { + else if (expression.kind === 208 /* PrefixUnaryExpression */ || expression.kind === 209 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -15780,15 +15880,15 @@ var ts; ts.getOperator = getOperator; function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: return 0; - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return 1; - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return 2; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return 4; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (operatorKind) { case 27 /* CommaToken */: return 0; @@ -15809,21 +15909,21 @@ var ts; default: return getBinaryOperatorPrecedence(operatorKind); } - case 207 /* PrefixUnaryExpression */: - case 204 /* TypeOfExpression */: - case 205 /* VoidExpression */: - case 203 /* DeleteExpression */: - case 206 /* AwaitExpression */: + case 208 /* PrefixUnaryExpression */: + case 205 /* TypeOfExpression */: + case 206 /* VoidExpression */: + case 204 /* DeleteExpression */: + case 207 /* AwaitExpression */: return 16; - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return 17; - case 196 /* CallExpression */: + case 197 /* CallExpression */: return 18; - case 197 /* NewExpression */: + case 198 /* NewExpression */: return hasArguments ? 19 : 18; - case 198 /* TaggedTemplateExpression */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 199 /* TaggedTemplateExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return 19; case 104 /* ThisKeyword */: case 102 /* SuperKeyword */: @@ -15834,19 +15934,19 @@ var ts; case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 214 /* ClassExpression */: - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 270 /* JsxFragment */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 215 /* ClassExpression */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 271 /* JsxFragment */: case 13 /* RegularExpressionLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 211 /* TemplateExpression */: - case 200 /* ParenthesizedExpression */: - case 215 /* OmittedExpression */: + case 212 /* TemplateExpression */: + case 201 /* ParenthesizedExpression */: + case 216 /* OmittedExpression */: return 20; default: return -1; @@ -16448,10 +16548,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 163 /* GetAccessor */) { + if (accessor.kind === 164 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 164 /* SetAccessor */) { + else if (accessor.kind === 165 /* SetAccessor */) { setAccessor = accessor; } else { @@ -16471,10 +16571,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 163 /* GetAccessor */ && !getAccessor) { + if (member.kind === 164 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 164 /* SetAccessor */ && !setAccessor) { + if (member.kind === 165 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -16523,7 +16623,7 @@ var ts; ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations; /** template tags are only available when a typedef isn't already using them */ function isNonTypeAliasTemplate(tag) { - return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 303 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); + return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 304 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); } /** * Gets the effective type annotation of the value parameter of a set accessor. If the node @@ -16747,7 +16847,7 @@ var ts; } ts.getSelectedModifierFlags = getSelectedModifierFlags; function getModifierFlags(node) { - if (node.kind >= 0 /* FirstToken */ && node.kind <= 152 /* LastToken */) { + if (node.kind >= 0 /* FirstToken */ && node.kind <= 153 /* LastToken */) { return 0 /* None */; } if (node.modifierFlagsCache & 536870912 /* HasComputedFlags */) { @@ -16789,11 +16889,11 @@ var ts; case 117 /* PrivateKeyword */: return 8 /* Private */; case 122 /* AbstractKeyword */: return 128 /* Abstract */; case 89 /* ExportKeyword */: return 1 /* Export */; - case 130 /* DeclareKeyword */: return 2 /* Ambient */; + case 131 /* DeclareKeyword */: return 2 /* Ambient */; case 81 /* ConstKeyword */: return 2048 /* Const */; case 84 /* DefaultKeyword */: return 512 /* Default */; case 126 /* AsyncKeyword */: return 256 /* Async */; - case 138 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 139 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } @@ -16833,8 +16933,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 193 /* ObjectLiteralExpression */ - || kind === 192 /* ArrayLiteralExpression */; + return kind === 194 /* ObjectLiteralExpression */ + || kind === 193 /* ArrayLiteralExpression */; } return false; } @@ -16851,12 +16951,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: do { node = node.left; } while (node.kind !== 75 /* Identifier */); return node; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 75 /* Identifier */); @@ -16866,14 +16966,19 @@ var ts; ts.getFirstIdentifier = getFirstIdentifier; function isDottedName(node) { return node.kind === 75 /* Identifier */ || node.kind === 104 /* ThisKeyword */ || node.kind === 102 /* SuperKeyword */ || - node.kind === 194 /* PropertyAccessExpression */ && isDottedName(node.expression) || - node.kind === 200 /* ParenthesizedExpression */ && isDottedName(node.expression); + node.kind === 195 /* PropertyAccessExpression */ && isDottedName(node.expression) || + node.kind === 201 /* ParenthesizedExpression */ && isDottedName(node.expression); } ts.isDottedName = isDottedName; function isPropertyAccessEntityNameExpression(node) { return ts.isPropertyAccessExpression(node) && isEntityNameExpression(node.expression); } ts.isPropertyAccessEntityNameExpression = isPropertyAccessEntityNameExpression; + function isConstructorAccessExpression(expr) { + return (ts.isPropertyAccessExpression(expr) && ts.idText(expr.name) === "constructor" || + ts.isElementAccessExpression(expr) && ts.isStringLiteralLike(expr.argumentExpression) && expr.argumentExpression.text === "constructor"); + } + ts.isConstructorAccessExpression = isConstructorAccessExpression; function tryGetPropertyAccessOrIdentifierToString(expr) { if (ts.isPropertyAccessExpression(expr)) { var baseStr = tryGetPropertyAccessOrIdentifierToString(expr.expression); @@ -16892,17 +16997,17 @@ var ts; } ts.isPrototypeAccess = isPrototypeAccess; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 153 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 154 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 193 /* ObjectLiteralExpression */ && + return expression.kind === 194 /* ObjectLiteralExpression */ && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 192 /* ArrayLiteralExpression */ && + return expression.kind === 193 /* ArrayLiteralExpression */ && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -17200,8 +17305,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 248 /* EnumDeclaration */: - case 249 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 250 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -17278,35 +17383,35 @@ var ts; if (!parent) return 0 /* Read */; switch (parent.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return accessKind(parent); - case 208 /* PostfixUnaryExpression */: - case 207 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: var operator = parent.operator; return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 62 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return parent.name !== node ? 0 /* Read */ : accessKind(parent); - case 281 /* PropertyAssignment */: { + case 282 /* PropertyAssignment */: { var parentAccess = accessKind(parent.parent); // In `({ x: varname }) = { x: 1 }`, the left `x` is a read, the right `x` is a write. return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess; } - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: // Assume it's the local variable being accessed, since we don't check public properties for --noUnusedLocals. return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return accessKind(parent); default: return 0 /* Read */; } function writeOrReadWrite() { // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect. - return parent.parent && skipParenthesesUp(parent.parent).kind === 226 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; + return parent.parent && skipParenthesesUp(parent.parent).kind === 227 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; } } function reverseAccessKind(a) { @@ -17455,39 +17560,39 @@ var ts; } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; function isTypeNodeKind(kind) { - return (kind >= 168 /* FirstTypeNode */ && kind <= 188 /* LastTypeNode */) + return (kind >= 169 /* FirstTypeNode */ && kind <= 189 /* LastTypeNode */) || kind === 125 /* AnyKeyword */ - || kind === 148 /* UnknownKeyword */ - || kind === 140 /* NumberKeyword */ - || kind === 151 /* BigIntKeyword */ - || kind === 141 /* ObjectKeyword */ - || kind === 128 /* BooleanKeyword */ - || kind === 143 /* StringKeyword */ - || kind === 144 /* SymbolKeyword */ + || kind === 149 /* UnknownKeyword */ + || kind === 141 /* NumberKeyword */ + || kind === 152 /* BigIntKeyword */ + || kind === 142 /* ObjectKeyword */ + || kind === 129 /* BooleanKeyword */ + || kind === 144 /* StringKeyword */ + || kind === 145 /* SymbolKeyword */ || kind === 104 /* ThisKeyword */ || kind === 110 /* VoidKeyword */ - || kind === 146 /* UndefinedKeyword */ + || kind === 147 /* UndefinedKeyword */ || kind === 100 /* NullKeyword */ - || kind === 137 /* NeverKeyword */ - || kind === 216 /* ExpressionWithTypeArguments */ - || kind === 295 /* JSDocAllType */ - || kind === 296 /* JSDocUnknownType */ - || kind === 297 /* JSDocNullableType */ - || kind === 298 /* JSDocNonNullableType */ - || kind === 299 /* JSDocOptionalType */ - || kind === 300 /* JSDocFunctionType */ - || kind === 301 /* JSDocVariadicType */; + || kind === 138 /* NeverKeyword */ + || kind === 217 /* ExpressionWithTypeArguments */ + || kind === 296 /* JSDocAllType */ + || kind === 297 /* JSDocUnknownType */ + || kind === 298 /* JSDocNullableType */ + || kind === 299 /* JSDocNonNullableType */ + || kind === 300 /* JSDocOptionalType */ + || kind === 301 /* JSDocFunctionType */ + || kind === 302 /* JSDocVariadicType */; } ts.isTypeNodeKind = isTypeNodeKind; function isAccessExpression(node) { - return node.kind === 194 /* PropertyAccessExpression */ || node.kind === 195 /* ElementAccessExpression */; + return node.kind === 195 /* PropertyAccessExpression */ || node.kind === 196 /* ElementAccessExpression */; } ts.isAccessExpression = isAccessExpression; function getNameOfAccessExpression(node) { - if (node.kind === 194 /* PropertyAccessExpression */) { + if (node.kind === 195 /* PropertyAccessExpression */) { return node.name; } - ts.Debug.assert(node.kind === 195 /* ElementAccessExpression */); + ts.Debug.assert(node.kind === 196 /* ElementAccessExpression */); return node.argumentExpression; } ts.getNameOfAccessExpression = getNameOfAccessExpression; @@ -17501,12 +17606,8 @@ var ts; } } ts.isBundleFileTextLike = isBundleFileTextLike; - function getDotOrQuestionDotToken(node) { - return node.questionDotToken || ts.createNode(24 /* DotToken */, node.expression.end, node.name.pos); - } - ts.getDotOrQuestionDotToken = getDotOrQuestionDotToken; function isNamedImportsOrExports(node) { - return node.kind === 257 /* NamedImports */ || node.kind === 261 /* NamedExports */; + return node.kind === 258 /* NamedImports */ || node.kind === 262 /* NamedExports */; } ts.isNamedImportsOrExports = isNamedImportsOrExports; function Symbol(flags, name) { @@ -18584,34 +18685,44 @@ var ts; function isValidTypeOnlyAliasUseSite(useSite) { return !!(useSite.flags & 8388608 /* Ambient */) || isPartOfTypeQuery(useSite) - || isFirstIdentifierOfNonEmittingHeritageClause(useSite) + || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !isExpressionNode(useSite); } ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite; function typeOnlyDeclarationIsExport(typeOnlyDeclaration) { - return typeOnlyDeclaration.kind === 263 /* ExportSpecifier */; + return typeOnlyDeclaration.kind === 264 /* ExportSpecifier */; } ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport; function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { - while (node.kind === 75 /* Identifier */ || node.kind === 194 /* PropertyAccessExpression */) { + while (node.kind === 75 /* Identifier */ || node.kind === 195 /* PropertyAccessExpression */) { node = node.parent; } - if (node.kind !== 154 /* ComputedPropertyName */) { + if (node.kind !== 155 /* ComputedPropertyName */) { return false; } if (hasModifier(node.parent, 128 /* Abstract */)) { return true; } var containerKind = node.parent.parent.kind; - return containerKind === 246 /* InterfaceDeclaration */ || containerKind === 173 /* TypeLiteral */; + return containerKind === 247 /* InterfaceDeclaration */ || containerKind === 174 /* TypeLiteral */; } - /** Returns true for the first identifier of 1) an `implements` clause, and 2) an `extends` clause of an interface. */ - function isFirstIdentifierOfNonEmittingHeritageClause(node) { - var _a, _b; - // Number of parents to climb from identifier is 2 for `implements I`, 3 for `implements x.I` - var heritageClause = (_a = ts.tryCast(node.parent.parent, ts.isHeritageClause)) !== null && _a !== void 0 ? _a : ts.tryCast((_b = node.parent.parent) === null || _b === void 0 ? void 0 : _b.parent, ts.isHeritageClause); - return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 246 /* InterfaceDeclaration */; + /** Returns true for an identifier in 1) an `implements` clause, and 2) an `extends` clause of an interface. */ + function isIdentifierInNonEmittingHeritageClause(node) { + if (node.kind !== 75 /* Identifier */) + return false; + var heritageClause = findAncestor(node.parent, function (parent) { + switch (parent.kind) { + case 280 /* HeritageClause */: + return true; + case 195 /* PropertyAccessExpression */: + case 217 /* ExpressionWithTypeArguments */: + return false; + default: + return "quit"; + } + }); + return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 247 /* InterfaceDeclaration */; } })(ts || (ts = {})); var ts; @@ -18631,7 +18742,7 @@ var ts; var PrivateIdentifierConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 290 /* SourceFile */) { + if (kind === 291 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 75 /* Identifier */) { @@ -18686,19 +18797,19 @@ var ts; * that they appear in the source code. The language service depends on this property to locate nodes by position. */ function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 152 /* LastToken */) { + if (!node || node.kind <= 153 /* LastToken */) { return; } switch (node.kind) { - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -18706,9 +18817,9 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 156 /* Parameter */: + case 157 /* Parameter */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || @@ -18716,7 +18827,7 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -18724,51 +18835,51 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.initializer); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -18780,359 +18891,359 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return visitNode(cbNode, node.assertsModifier) || visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return visitNodes(cbNode, cbNodes, node.members); - case 174 /* ArrayType */: + case 175 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 175 /* TupleType */: + case 176 /* TupleType */: return visitNodes(cbNode, cbNodes, node.elementTypes); - case 178 /* UnionType */: - case 179 /* IntersectionType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: return visitNodes(cbNode, cbNodes, node.types); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return visitNode(cbNode, node.checkType) || visitNode(cbNode, node.extendsType) || visitNode(cbNode, node.trueType) || visitNode(cbNode, node.falseType); - case 181 /* InferType */: + case 182 /* InferType */: return visitNode(cbNode, node.typeParameter); - case 188 /* ImportType */: + case 189 /* ImportType */: return visitNode(cbNode, node.argument) || visitNode(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 182 /* ParenthesizedType */: - case 184 /* TypeOperator */: + case 183 /* ParenthesizedType */: + case 185 /* TypeOperator */: return visitNode(cbNode, node.type); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 186 /* MappedType */: + case 187 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 187 /* LiteralType */: + case 188 /* LiteralType */: return visitNode(cbNode, node.literal); - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: return visitNodes(cbNode, cbNodes, node.elements); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return visitNodes(cbNode, cbNodes, node.properties); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.name); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.argumentExpression); - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.template); - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 217 /* AsExpression */: + case 218 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return visitNode(cbNode, node.name); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 223 /* Block */: - case 250 /* ModuleBlock */: + case 224 /* Block */: + case 251 /* ModuleBlock */: return visitNodes(cbNode, cbNodes, node.statements); - case 290 /* SourceFile */: + case 291 /* SourceFile */: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return visitNodes(cbNode, cbNodes, node.declarations); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 233 /* ContinueStatement */: - case 234 /* BreakStatement */: + case 234 /* ContinueStatement */: + case 235 /* BreakStatement */: return visitNode(cbNode, node.label); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return visitNodes(cbNode, cbNodes, node.clauses); - case 277 /* CaseClause */: + case 278 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: return visitNodes(cbNode, cbNodes, node.statements); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 157 /* Decorator */: + case 158 /* Decorator */: return visitNode(cbNode, node.expression); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 284 /* EnumMember */: + case 285 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: return visitNode(cbNode, node.name); - case 257 /* NamedImports */: - case 261 /* NamedExports */: + case 258 /* NamedImports */: + case 262 /* NamedExports */: return visitNodes(cbNode, cbNodes, node.elements); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: return visitNodes(cbNode, cbNodes, node.types); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 264 /* MissingDeclaration */: + case 265 /* MissingDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators); - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 266 /* JsxElement */: + case 267 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.attributes); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return visitNodes(cbNode, cbNodes, node.properties); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 275 /* JsxSpreadAttribute */: + case 276 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 176 /* OptionalType */: - case 177 /* RestType */: - case 294 /* JSDocTypeExpression */: - case 298 /* JSDocNonNullableType */: - case 297 /* JSDocNullableType */: - case 299 /* JSDocOptionalType */: - case 301 /* JSDocVariadicType */: + case 177 /* OptionalType */: + case 178 /* RestType */: + case 295 /* JSDocTypeExpression */: + case 299 /* JSDocNonNullableType */: + case 298 /* JSDocNullableType */: + case 300 /* JSDocOptionalType */: + case 302 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 303 /* JSDocComment */: + case 304 /* JSDocComment */: return visitNodes(cbNode, cbNodes, node.tags); - case 317 /* JSDocParameterTag */: - case 323 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: + case 324 /* JSDocPropertyTag */: return visitNode(cbNode, node.tagName) || (node.isNameFirst ? visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression) : visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name)); - case 309 /* JSDocAuthorTag */: + case 310 /* JSDocAuthorTag */: return visitNode(cbNode, node.tagName); - case 308 /* JSDocImplementsTag */: + case 309 /* JSDocImplementsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 307 /* JSDocAugmentsTag */: + case 308 /* JSDocAugmentsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); - case 322 /* JSDocTypedefTag */: + case 323 /* JSDocTypedefTag */: return visitNode(cbNode, node.tagName) || (node.typeExpression && - node.typeExpression.kind === 294 /* JSDocTypeExpression */ + node.typeExpression.kind === 295 /* JSDocTypeExpression */ ? visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) : visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression)); - case 315 /* JSDocCallbackTag */: + case 316 /* JSDocCallbackTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); - case 318 /* JSDocReturnTag */: - case 320 /* JSDocTypeTag */: - case 319 /* JSDocThisTag */: - case 316 /* JSDocEnumTag */: + case 319 /* JSDocReturnTag */: + case 321 /* JSDocTypeTag */: + case 320 /* JSDocThisTag */: + case 317 /* JSDocEnumTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.typeExpression); - case 305 /* JSDocSignature */: + case 306 /* JSDocSignature */: return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); - case 304 /* JSDocTypeLiteral */: + case 305 /* JSDocTypeLiteral */: return ts.forEach(node.jsDocPropertyTags, cbNode); - case 306 /* JSDocTag */: - case 310 /* JSDocClassTag */: - case 311 /* JSDocPublicTag */: - case 312 /* JSDocPrivateTag */: - case 313 /* JSDocProtectedTag */: - case 314 /* JSDocReadonlyTag */: + case 307 /* JSDocTag */: + case 311 /* JSDocClassTag */: + case 312 /* JSDocPublicTag */: + case 313 /* JSDocPrivateTag */: + case 314 /* JSDocProtectedTag */: + case 315 /* JSDocReadonlyTag */: return visitNode(cbNode, node.tagName); - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } } @@ -19421,7 +19532,7 @@ var ts; sourceFile.endOfFileToken = parseTokenNode(); } else { - var statement = createNode(226 /* ExpressionStatement */); + var statement = createNode(227 /* ExpressionStatement */); switch (token()) { case 22 /* OpenBracketToken */: statement.expression = parseArrayLiteralExpression(); @@ -19505,6 +19616,7 @@ var ts; } function clearState() { // Clear out the text the scanner is pointing at, so it doesn't keep anything alive unnecessarily. + scanner.clearCommentDirectives(); scanner.setText(""); scanner.setOnError(undefined); // Clear any data. We don't want to accidentally hold onto it for too long. @@ -19531,6 +19643,7 @@ var ts; ts.Debug.assert(token() === 1 /* EndOfFileToken */); sourceFile.endOfFileToken = addJSDocComment(parseTokenNode()); setExternalModuleIndicator(sourceFile); + sourceFile.commentDirectives = scanner.getCommentDirectives(); sourceFile.nodeCount = nodeCount; sourceFile.identifierCount = identifierCount; sourceFile.identifiers = identifiers; @@ -19571,7 +19684,7 @@ var ts; function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(290 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(291 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -19903,7 +20016,7 @@ var ts; } function createNodeWithJSDoc(kind, pos) { var node = createNode(kind, pos); - if (scanner.getTokenFlags() & 2 /* PrecedingJSDocComment */) { + if (scanner.getTokenFlags() & 2 /* PrecedingJSDocComment */ && (kind !== 227 /* ExpressionStatement */ || token() !== 20 /* OpenParenToken */)) { addJSDocComment(node); } return node; @@ -20015,7 +20128,7 @@ var ts; // PropertyName [Yield]: // LiteralPropertyName // ComputedPropertyName[?Yield] - var node = createNode(154 /* ComputedPropertyName */); + var node = createNode(155 /* ComputedPropertyName */); parseExpected(22 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -20057,15 +20170,15 @@ var ts; if (token() === 84 /* DefaultKeyword */) { return lookAhead(nextTokenCanFollowDefaultKeyword); } - if (token() === 145 /* TypeKeyword */) { + if (token() === 146 /* TypeKeyword */) { return lookAhead(nextTokenCanFollowExportModifier); } return canFollowExportModifier(); case 84 /* DefaultKeyword */: return nextTokenCanFollowDefaultKeyword(); case 120 /* StaticKeyword */: - case 131 /* GetKeyword */: - case 142 /* SetKeyword */: + case 132 /* GetKeyword */: + case 143 /* SetKeyword */: nextToken(); return canFollowModifier(); default: @@ -20475,20 +20588,20 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 162 /* Constructor */: - case 167 /* IndexSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 159 /* PropertyDeclaration */: - case 222 /* SemicolonClassElement */: + case 163 /* Constructor */: + case 168 /* IndexSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 223 /* SemicolonClassElement */: return true; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: // Method declarations are not necessarily reusable. An object-literal // may have a method calls "constructor(...)" and we must reparse that // into an actual .ConstructorDeclaration. var methodDeclaration = node; var nameIsConstructor = methodDeclaration.name.kind === 75 /* Identifier */ && - methodDeclaration.name.originalKeywordKind === 129 /* ConstructorKeyword */; + methodDeclaration.name.originalKeywordKind === 130 /* ConstructorKeyword */; return !nameIsConstructor; } } @@ -20497,8 +20610,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: return true; } } @@ -20507,58 +20620,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 225 /* VariableStatement */: - case 223 /* Block */: - case 227 /* IfStatement */: - case 226 /* ExpressionStatement */: - case 239 /* ThrowStatement */: - case 235 /* ReturnStatement */: - case 237 /* SwitchStatement */: - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 230 /* ForStatement */: - case 229 /* WhileStatement */: - case 236 /* WithStatement */: - case 224 /* EmptyStatement */: - case 240 /* TryStatement */: - case 238 /* LabeledStatement */: - case 228 /* DoStatement */: - case 241 /* DebuggerStatement */: - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 260 /* ExportDeclaration */: - case 259 /* ExportAssignment */: - case 249 /* ModuleDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 245 /* FunctionDeclaration */: + case 226 /* VariableStatement */: + case 224 /* Block */: + case 228 /* IfStatement */: + case 227 /* ExpressionStatement */: + case 240 /* ThrowStatement */: + case 236 /* ReturnStatement */: + case 238 /* SwitchStatement */: + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 231 /* ForStatement */: + case 230 /* WhileStatement */: + case 237 /* WithStatement */: + case 225 /* EmptyStatement */: + case 241 /* TryStatement */: + case 239 /* LabeledStatement */: + case 229 /* DoStatement */: + case 242 /* DebuggerStatement */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 261 /* ExportDeclaration */: + case 260 /* ExportAssignment */: + case 250 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 284 /* EnumMember */; + return node.kind === 285 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 166 /* ConstructSignature */: - case 160 /* MethodSignature */: - case 167 /* IndexSignature */: - case 158 /* PropertySignature */: - case 165 /* CallSignature */: + case 167 /* ConstructSignature */: + case 161 /* MethodSignature */: + case 168 /* IndexSignature */: + case 159 /* PropertySignature */: + case 166 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 242 /* VariableDeclaration */) { + if (node.kind !== 243 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -20579,7 +20692,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 156 /* Parameter */) { + if (node.kind !== 157 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -20718,7 +20831,7 @@ var ts; return entity; } function createQualifiedName(entity, name) { - var node = createNode(153 /* QualifiedName */, entity.pos); + var node = createNode(154 /* QualifiedName */, entity.pos); node.left = entity; node.right = name; return finishNode(node); @@ -20759,7 +20872,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression(isTaggedTemplate) { - var template = createNode(211 /* TemplateExpression */); + var template = createNode(212 /* TemplateExpression */); template.head = parseTemplateHead(isTaggedTemplate); ts.Debug.assert(template.head.kind === 15 /* TemplateHead */, "Template head has wrong token kind"); var list = []; @@ -20771,7 +20884,7 @@ var ts; return finishNode(template); } function parseTemplateSpan(isTaggedTemplate) { - var span = createNode(221 /* TemplateSpan */); + var span = createNode(222 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token() === 19 /* CloseBraceToken */) { @@ -20837,7 +20950,7 @@ var ts; } // TYPES function parseTypeReference() { - var node = createNode(169 /* TypeReference */); + var node = createNode(170 /* TypeReference */); node.typeName = parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29 /* LessThanToken */) { node.typeArguments = parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */); @@ -20847,14 +20960,14 @@ var ts; // If true, we should abort parsing an error function. function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return ts.nodeIsMissing(node.typeName); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: { + case 171 /* FunctionType */: + case 172 /* ConstructorType */: { var _a = node, parameters = _a.parameters, type = _a.type; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -20862,20 +20975,20 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(168 /* TypePredicate */, lhs.pos); + var node = createNode(169 /* TypePredicate */, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(183 /* ThisType */); + var node = createNode(184 /* ThisType */); nextToken(); return finishNode(node); } function parseJSDocAllType(postFixEquals) { - var result = createNode(295 /* JSDocAllType */); + var result = createNode(296 /* JSDocAllType */); if (postFixEquals) { - return createPostfixType(299 /* JSDocOptionalType */, result); + return createPostfixType(300 /* JSDocOptionalType */, result); } else { nextToken(); @@ -20883,7 +20996,7 @@ var ts; return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(298 /* JSDocNonNullableType */); + var result = createNode(299 /* JSDocNonNullableType */); nextToken(); result.type = parseNonArrayType(); return finishNode(result); @@ -20907,28 +21020,28 @@ var ts; token() === 31 /* GreaterThanToken */ || token() === 62 /* EqualsToken */ || token() === 51 /* BarToken */) { - var result = createNode(296 /* JSDocUnknownType */, pos); + var result = createNode(297 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(297 /* JSDocNullableType */, pos); + var result = createNode(298 /* JSDocNullableType */, pos); result.type = parseType(); return finishNode(result); } } function parseJSDocFunctionType() { if (lookAhead(nextTokenIsOpenParen)) { - var result = createNodeWithJSDoc(300 /* JSDocFunctionType */); + var result = createNodeWithJSDoc(301 /* JSDocFunctionType */); nextToken(); fillSignature(58 /* ColonToken */, 4 /* Type */ | 32 /* JSDoc */, result); return finishNode(result); } - var node = createNode(169 /* TypeReference */); + var node = createNode(170 /* TypeReference */); node.typeName = parseIdentifierName(); return finishNode(node); } function parseJSDocParameter() { - var parameter = createNode(156 /* Parameter */); + var parameter = createNode(157 /* Parameter */); if (token() === 104 /* ThisKeyword */ || token() === 99 /* NewKeyword */) { parameter.name = parseIdentifierName(); parseExpected(58 /* ColonToken */); @@ -20938,9 +21051,9 @@ var ts; } function parseJSDocType() { scanner.setInJSDocType(true); - var moduleSpecifier = parseOptionalToken(135 /* ModuleKeyword */); + var moduleSpecifier = parseOptionalToken(136 /* ModuleKeyword */); if (moduleSpecifier) { - var moduleTag = createNode(302 /* JSDocNamepathType */, moduleSpecifier.pos); + var moduleTag = createNode(303 /* JSDocNamepathType */, moduleSpecifier.pos); terminate: while (true) { switch (token()) { case 19 /* CloseBraceToken */: @@ -20959,23 +21072,23 @@ var ts; var type = parseTypeOrTypePredicate(); scanner.setInJSDocType(false); if (dotdotdot) { - var variadic = createNode(301 /* JSDocVariadicType */, dotdotdot.pos); + var variadic = createNode(302 /* JSDocVariadicType */, dotdotdot.pos); variadic.type = type; type = finishNode(variadic); } if (token() === 62 /* EqualsToken */) { - return createPostfixType(299 /* JSDocOptionalType */, type); + return createPostfixType(300 /* JSDocOptionalType */, type); } return type; } function parseTypeQuery() { - var node = createNode(172 /* TypeQuery */); + var node = createNode(173 /* TypeQuery */); parseExpected(108 /* TypeOfKeyword */); node.exprName = parseEntityName(/*allowReservedWords*/ true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(155 /* TypeParameter */); + var node = createNode(156 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(90 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the @@ -21020,7 +21133,7 @@ var ts; isStartOfType(/*inStartOfParameter*/ !isJSDocParameter); } function parseParameter() { - var node = createNodeWithJSDoc(156 /* Parameter */); + var node = createNodeWithJSDoc(157 /* Parameter */); if (token() === 104 /* ThisKeyword */) { node.name = createIdentifier(/*isIdentifier*/ true); node.type = parseParameterType(); @@ -21121,7 +21234,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 166 /* ConstructSignature */) { + if (kind === 167 /* ConstructSignature */) { parseExpected(99 /* NewKeyword */); } fillSignature(58 /* ColonToken */, 4 /* Type */, node); @@ -21182,7 +21295,7 @@ var ts; return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(node) { - node.kind = 167 /* IndexSignature */; + node.kind = 168 /* IndexSignature */; node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -21192,13 +21305,13 @@ var ts; node.name = parsePropertyName(); node.questionToken = parseOptionalToken(57 /* QuestionToken */); if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - node.kind = 160 /* MethodSignature */; + node.kind = 161 /* MethodSignature */; // Method signatures don't exist in expression contexts. So they have neither // [Yield] nor [Await] fillSignature(58 /* ColonToken */, 4 /* Type */, node); } else { - node.kind = 158 /* PropertySignature */; + node.kind = 159 /* PropertySignature */; node.type = parseTypeAnnotation(); if (token() === 62 /* EqualsToken */) { // Although type literal properties cannot not have initializers, we attempt @@ -21244,10 +21357,10 @@ var ts; } function parseTypeMember() { if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - return parseSignatureMember(165 /* CallSignature */); + return parseSignatureMember(166 /* CallSignature */); } if (token() === 99 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(166 /* ConstructSignature */); + return parseSignatureMember(167 /* ConstructSignature */); } var node = createNodeWithJSDoc(0 /* Unknown */); node.modifiers = parseModifiers(); @@ -21273,7 +21386,7 @@ var ts; return false; } function parseTypeLiteral() { - var node = createNode(173 /* TypeLiteral */); + var node = createNode(174 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -21291,27 +21404,27 @@ var ts; function isStartOfMappedType() { nextToken(); if (token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { - return nextToken() === 138 /* ReadonlyKeyword */; + return nextToken() === 139 /* ReadonlyKeyword */; } - if (token() === 138 /* ReadonlyKeyword */) { + if (token() === 139 /* ReadonlyKeyword */) { nextToken(); } return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 97 /* InKeyword */; } function parseMappedTypeParameter() { - var node = createNode(155 /* TypeParameter */); + var node = createNode(156 /* TypeParameter */); node.name = parseIdentifier(); parseExpected(97 /* InKeyword */); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(186 /* MappedType */); + var node = createNode(187 /* MappedType */); parseExpected(18 /* OpenBraceToken */); - if (token() === 138 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { + if (token() === 139 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { node.readonlyToken = parseTokenNode(); - if (node.readonlyToken.kind !== 138 /* ReadonlyKeyword */) { - parseExpectedToken(138 /* ReadonlyKeyword */); + if (node.readonlyToken.kind !== 139 /* ReadonlyKeyword */) { + parseExpectedToken(139 /* ReadonlyKeyword */); } } parseExpected(22 /* OpenBracketToken */); @@ -21331,23 +21444,23 @@ var ts; function parseTupleElementType() { var pos = getNodePos(); if (parseOptional(25 /* DotDotDotToken */)) { - var node = createNode(177 /* RestType */, pos); + var node = createNode(178 /* RestType */, pos); node.type = parseType(); return finishNode(node); } var type = parseType(); - if (!(contextFlags & 4194304 /* JSDoc */) && type.kind === 297 /* JSDocNullableType */ && type.pos === type.type.pos) { - type.kind = 176 /* OptionalType */; + if (!(contextFlags & 4194304 /* JSDoc */) && type.kind === 298 /* JSDocNullableType */ && type.pos === type.type.pos) { + type.kind = 177 /* OptionalType */; } return type; } function parseTupleType() { - var node = createNode(175 /* TupleType */); + var node = createNode(176 /* TupleType */); node.elementTypes = parseBracketedList(21 /* TupleElementTypes */, parseTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(182 /* ParenthesizedType */); + var node = createNode(183 /* ParenthesizedType */); parseExpected(20 /* OpenParenToken */); node.type = parseType(); parseExpected(21 /* CloseParenToken */); @@ -21355,7 +21468,7 @@ var ts; } function parseFunctionOrConstructorType() { var pos = getNodePos(); - var kind = parseOptional(99 /* NewKeyword */) ? 171 /* ConstructorType */ : 170 /* FunctionType */; + var kind = parseOptional(99 /* NewKeyword */) ? 172 /* ConstructorType */ : 171 /* FunctionType */; var node = createNodeWithJSDoc(kind, pos); fillSignature(38 /* EqualsGreaterThanToken */, 4 /* Type */, node); return finishNode(node); @@ -21365,10 +21478,10 @@ var ts; return token() === 24 /* DotToken */ ? undefined : node; } function parseLiteralTypeNode(negative) { - var node = createNode(187 /* LiteralType */); + var node = createNode(188 /* LiteralType */); var unaryMinusExpression; if (negative) { - unaryMinusExpression = createNode(207 /* PrefixUnaryExpression */); + unaryMinusExpression = createNode(208 /* PrefixUnaryExpression */); unaryMinusExpression.operator = 40 /* MinusToken */; nextToken(); } @@ -21389,7 +21502,7 @@ var ts; } function parseImportType() { sourceFile.flags |= 1048576 /* PossiblyContainsDynamicImport */; - var node = createNode(188 /* ImportType */); + var node = createNode(189 /* ImportType */); if (parseOptional(108 /* TypeOfKeyword */)) { node.isTypeOf = true; } @@ -21412,15 +21525,15 @@ var ts; function parseNonArrayType() { switch (token()) { case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 144 /* SymbolKeyword */: - case 128 /* BooleanKeyword */: - case 146 /* UndefinedKeyword */: - case 137 /* NeverKeyword */: - case 141 /* ObjectKeyword */: + case 149 /* UnknownKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 145 /* SymbolKeyword */: + case 129 /* BooleanKeyword */: + case 147 /* UndefinedKeyword */: + case 138 /* NeverKeyword */: + case 142 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 41 /* AsteriskToken */: @@ -21451,7 +21564,7 @@ var ts; return parseTokenNode(); case 104 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 133 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 134 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -21477,20 +21590,20 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 128 /* BooleanKeyword */: - case 138 /* ReadonlyKeyword */: - case 144 /* SymbolKeyword */: - case 147 /* UniqueKeyword */: + case 149 /* UnknownKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 129 /* BooleanKeyword */: + case 139 /* ReadonlyKeyword */: + case 145 /* SymbolKeyword */: + case 148 /* UniqueKeyword */: case 110 /* VoidKeyword */: - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: case 100 /* NullKeyword */: case 104 /* ThisKeyword */: case 108 /* TypeOfKeyword */: - case 137 /* NeverKeyword */: + case 138 /* NeverKeyword */: case 18 /* OpenBraceToken */: case 22 /* OpenBracketToken */: case 29 /* LessThanToken */: @@ -21502,12 +21615,12 @@ var ts; case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: - case 141 /* ObjectKeyword */: + case 142 /* ObjectKeyword */: case 41 /* AsteriskToken */: case 57 /* QuestionToken */: case 53 /* ExclamationToken */: case 25 /* DotDotDotToken */: - case 132 /* InferKeyword */: + case 133 /* InferKeyword */: case 96 /* ImportKeyword */: case 124 /* AssertsKeyword */: return true; @@ -21532,26 +21645,26 @@ var ts; while (!scanner.hasPrecedingLineBreak()) { switch (token()) { case 53 /* ExclamationToken */: - type = createPostfixType(298 /* JSDocNonNullableType */, type); + type = createPostfixType(299 /* JSDocNonNullableType */, type); break; case 57 /* QuestionToken */: // If not in JSDoc and next token is start of a type we have a conditional type if (!(contextFlags & 4194304 /* JSDoc */) && lookAhead(nextTokenIsStartOfType)) { return type; } - type = createPostfixType(297 /* JSDocNullableType */, type); + type = createPostfixType(298 /* JSDocNullableType */, type); break; case 22 /* OpenBracketToken */: parseExpected(22 /* OpenBracketToken */); if (isStartOfType()) { - var node = createNode(185 /* IndexedAccessType */, type.pos); + var node = createNode(186 /* IndexedAccessType */, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(23 /* CloseBracketToken */); type = finishNode(node); } else { - var node = createNode(174 /* ArrayType */, type.pos); + var node = createNode(175 /* ArrayType */, type.pos); node.elementType = type; parseExpected(23 /* CloseBracketToken */); type = finishNode(node); @@ -21570,16 +21683,16 @@ var ts; return finishNode(postfix); } function parseTypeOperator(operator) { - var node = createNode(184 /* TypeOperator */); + var node = createNode(185 /* TypeOperator */); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); return finishNode(node); } function parseInferType() { - var node = createNode(181 /* InferType */); - parseExpected(132 /* InferKeyword */); - var typeParameter = createNode(155 /* TypeParameter */); + var node = createNode(182 /* InferType */); + parseExpected(133 /* InferKeyword */); + var typeParameter = createNode(156 /* TypeParameter */); typeParameter.name = parseIdentifier(); node.typeParameter = finishNode(typeParameter); return finishNode(node); @@ -21587,11 +21700,12 @@ var ts; function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 134 /* KeyOfKeyword */: - case 147 /* UniqueKeyword */: - case 138 /* ReadonlyKeyword */: + case 135 /* KeyOfKeyword */: + case 148 /* UniqueKeyword */: + case 139 /* ReadonlyKeyword */: + case 128 /* AwaitedKeyword */: return parseTypeOperator(operator); - case 132 /* InferKeyword */: + case 133 /* InferKeyword */: return parseInferType(); } return parsePostfixTypeOrHigher(); @@ -21612,10 +21726,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(179 /* IntersectionType */, parseTypeOperatorOrHigher, 50 /* AmpersandToken */); + return parseUnionOrIntersectionType(180 /* IntersectionType */, parseTypeOperatorOrHigher, 50 /* AmpersandToken */); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(178 /* UnionType */, parseIntersectionTypeOrHigher, 51 /* BarToken */); + return parseUnionOrIntersectionType(179 /* UnionType */, parseIntersectionTypeOrHigher, 51 /* BarToken */); } function isStartOfFunctionType() { if (token() === 29 /* LessThanToken */) { @@ -21672,7 +21786,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(168 /* TypePredicate */, typePredicateVariable.pos); + var node = createNode(169 /* TypePredicate */, typePredicateVariable.pos); node.assertsModifier = undefined; node.parameterName = typePredicateVariable; node.type = type; @@ -21684,16 +21798,16 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 133 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 134 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } } function parseAssertsTypePredicate() { - var node = createNode(168 /* TypePredicate */); + var node = createNode(169 /* TypePredicate */); node.assertsModifier = parseExpectedToken(124 /* AssertsKeyword */); node.parameterName = token() === 104 /* ThisKeyword */ ? parseThisTypeNode() : parseIdentifier(); - node.type = parseOptional(133 /* IsKeyword */) ? parseType() : undefined; + node.type = parseOptional(134 /* IsKeyword */) ? parseType() : undefined; return finishNode(node); } function parseType() { @@ -21707,7 +21821,7 @@ var ts; } var type = parseUnionTypeOrHigher(); if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(90 /* ExtendsKeyword */)) { - var node = createNode(180 /* ConditionalType */, type.pos); + var node = createNode(181 /* ConditionalType */, type.pos); node.checkType = type; // The type following 'extends' is not permitted to be another conditional type node.extendsType = parseTypeWorker(/*noConditionalTypes*/ true); @@ -21902,7 +22016,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(212 /* YieldExpression */); + var node = createNode(213 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -21924,13 +22038,13 @@ var ts; ts.Debug.assert(token() === 38 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(202 /* ArrowFunction */, asyncModifier.pos); + node = createNode(203 /* ArrowFunction */, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(202 /* ArrowFunction */, identifier.pos); + node = createNode(203 /* ArrowFunction */, identifier.pos); } - var parameter = createNode(156 /* Parameter */, identifier.pos); + var parameter = createNode(157 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); @@ -22135,7 +22249,7 @@ var ts; return 0 /* False */; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNodeWithJSDoc(202 /* ArrowFunction */); + var node = createNodeWithJSDoc(203 /* ArrowFunction */); node.modifiers = parseModifiersForArrowFunction(); var isAsync = hasModifierOfKind(node, 126 /* AsyncKeyword */) ? 2 /* Await */ : 0 /* None */; // Arrow functions are never generators. @@ -22201,7 +22315,7 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(210 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(211 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -22216,7 +22330,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 97 /* InKeyword */ || t === 152 /* OfKeyword */; + return t === 97 /* InKeyword */ || t === 153 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -22281,39 +22395,39 @@ var ts; return ts.getBinaryOperatorPrecedence(token()) > 0; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(209 /* BinaryExpression */, left.pos); + var node = createNode(210 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(217 /* AsExpression */, left.pos); + var node = createNode(218 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(207 /* PrefixUnaryExpression */); + var node = createNode(208 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(203 /* DeleteExpression */); + var node = createNode(204 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(204 /* TypeOfExpression */); + var node = createNode(205 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(205 /* VoidExpression */); + var node = createNode(206 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -22329,7 +22443,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(206 /* AwaitExpression */); + var node = createNode(207 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -22373,7 +22487,7 @@ var ts; if (token() === 42 /* AsteriskAsteriskToken */) { var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); var end = simpleUnaryExpression.end; - if (simpleUnaryExpression.kind === 199 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 200 /* TypeAssertionExpression */) { parseErrorAt(pos, end, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -22470,7 +22584,7 @@ var ts; */ function parseUpdateExpression() { if (token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) { - var node = createNode(207 /* PrefixUnaryExpression */); + var node = createNode(208 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -22483,7 +22597,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(208 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(209 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -22539,7 +22653,7 @@ var ts; var fullStart = scanner.getStartPos(); nextToken(); // advance past the 'import' nextToken(); // advance past the dot - var node = createNode(219 /* MetaProperty */, fullStart); + var node = createNode(220 /* MetaProperty */, fullStart); node.keywordToken = 96 /* ImportKeyword */; node.name = parseIdentifierName(); expression = finishNode(node); @@ -22622,7 +22736,7 @@ var ts; } // If we have seen "super" it must be followed by '(' or '.'. // If it wasn't then just try to parse out a '.' and report an error. - var node = createNode(194 /* PropertyAccessExpression */, expression.pos); + var node = createNode(195 /* PropertyAccessExpression */, expression.pos); node.expression = expression; parseExpectedToken(24 /* DotToken */, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); // private names will never work with `super` (`super.#foo`), but that's a semantic error, not syntactic @@ -22632,8 +22746,8 @@ var ts; function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 268 /* JsxOpeningElement */) { - var node = createNode(266 /* JsxElement */, opening.pos); + if (opening.kind === 269 /* JsxOpeningElement */) { + var node = createNode(267 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -22642,15 +22756,15 @@ var ts; } result = finishNode(node); } - else if (opening.kind === 271 /* JsxOpeningFragment */) { - var node = createNode(270 /* JsxFragment */, opening.pos); + else if (opening.kind === 272 /* JsxOpeningFragment */) { + var node = createNode(271 /* JsxFragment */, opening.pos); node.openingFragment = opening; node.children = parseJsxChildren(node.openingFragment); node.closingFragment = parseJsxClosingFragment(inExpressionContext); result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 267 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 268 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -22665,7 +22779,7 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(209 /* BinaryExpression */, result.pos); + var badNode = createNode(210 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -22724,7 +22838,7 @@ var ts; return createNodeArray(list, listPos); } function parseJsxAttributes() { - var jsxAttributes = createNode(274 /* JsxAttributes */); + var jsxAttributes = createNode(275 /* JsxAttributes */); jsxAttributes.properties = parseList(13 /* JsxAttributes */, parseJsxAttribute); return finishNode(jsxAttributes); } @@ -22733,7 +22847,7 @@ var ts; parseExpected(29 /* LessThanToken */); if (token() === 31 /* GreaterThanToken */) { // See below for explanation of scanJsxText - var node_1 = createNode(271 /* JsxOpeningFragment */, fullStart); + var node_1 = createNode(272 /* JsxOpeningFragment */, fullStart); scanJsxText(); return finishNode(node_1); } @@ -22745,7 +22859,7 @@ var ts; // Closing tag, so scan the immediately-following text with the JSX scanning instead // of regular scanning to avoid treating illegal characters (e.g. '#') as immediate // scanning errors - node = createNode(268 /* JsxOpeningElement */, fullStart); + node = createNode(269 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -22757,7 +22871,7 @@ var ts; parseExpected(31 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(267 /* JsxSelfClosingElement */, fullStart); + node = createNode(268 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.typeArguments = typeArguments; @@ -22774,7 +22888,7 @@ var ts; var expression = token() === 104 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ false); expression = finishNode(propertyAccess); @@ -22782,7 +22896,7 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(276 /* JsxExpression */); + var node = createNode(277 /* JsxExpression */); if (!parseExpected(18 /* OpenBraceToken */)) { return undefined; } @@ -22808,7 +22922,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(273 /* JsxAttribute */); + var node = createNode(274 /* JsxAttribute */); node.name = parseIdentifierName(); if (token() === 62 /* EqualsToken */) { switch (scanJsxAttributeValue()) { @@ -22823,7 +22937,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(275 /* JsxSpreadAttribute */); + var node = createNode(276 /* JsxSpreadAttribute */); parseExpected(18 /* OpenBraceToken */); parseExpected(25 /* DotDotDotToken */); node.expression = parseExpression(); @@ -22831,7 +22945,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(269 /* JsxClosingElement */); + var node = createNode(270 /* JsxClosingElement */); parseExpected(30 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -22844,7 +22958,7 @@ var ts; return finishNode(node); } function parseJsxClosingFragment(inExpressionContext) { - var node = createNode(272 /* JsxClosingFragment */); + var node = createNode(273 /* JsxClosingFragment */); parseExpected(30 /* LessThanSlashToken */); if (ts.tokenIsIdentifierOrKeyword(token())) { parseErrorAtRange(parseJsxElementName(), ts.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment); @@ -22859,7 +22973,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(199 /* TypeAssertionExpression */); + var node = createNode(200 /* TypeAssertionExpression */); parseExpected(29 /* LessThanToken */); node.type = parseType(); parseExpected(31 /* GreaterThanToken */); @@ -22877,7 +22991,7 @@ var ts; && lookAhead(nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate); } function parsePropertyAccessExpressionRest(expression, questionDotToken) { - var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ true); @@ -22890,7 +23004,7 @@ var ts; return finishNode(propertyAccess); } function parseElementAccessExpressionRest(expression, questionDotToken) { - var indexedAccess = createNode(195 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(196 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; indexedAccess.questionDotToken = questionDotToken; if (token() === 23 /* CloseBracketToken */) { @@ -22926,7 +23040,7 @@ var ts; } if (!questionDotToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(218 /* NonNullExpression */, expression.pos); + var nonNullExpression = createNode(219 /* NonNullExpression */, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; @@ -22947,7 +23061,7 @@ var ts; return token() === 14 /* NoSubstitutionTemplateLiteral */ || token() === 15 /* TemplateHead */; } function parseTaggedTemplateRest(tag, questionDotToken, typeArguments) { - var tagExpression = createNode(198 /* TaggedTemplateExpression */, tag.pos); + var tagExpression = createNode(199 /* TaggedTemplateExpression */, tag.pos); tagExpression.tag = tag; tagExpression.questionDotToken = questionDotToken; tagExpression.typeArguments = typeArguments; @@ -22975,7 +23089,7 @@ var ts; expression = parseTaggedTemplateRest(expression, questionDotToken, typeArguments); continue; } - var callExpr = createNode(196 /* CallExpression */, expression.pos); + var callExpr = createNode(197 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.typeArguments = typeArguments; @@ -22988,7 +23102,7 @@ var ts; } } else if (token() === 20 /* OpenParenToken */) { - var callExpr = createNode(196 /* CallExpression */, expression.pos); + var callExpr = createNode(197 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.arguments = parseArgumentList(); @@ -23000,7 +23114,7 @@ var ts; } if (questionDotToken) { // We failed to parse anything, so report a missing identifier here. - var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = createMissingNode(75 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.Identifier_expected); @@ -23119,28 +23233,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNodeWithJSDoc(200 /* ParenthesizedExpression */); + var node = createNodeWithJSDoc(201 /* ParenthesizedExpression */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(213 /* SpreadElement */); + var node = createNode(214 /* SpreadElement */); parseExpected(25 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 25 /* DotDotDotToken */ ? parseSpreadElement() : - token() === 27 /* CommaToken */ ? createNode(215 /* OmittedExpression */) : + token() === 27 /* CommaToken */ ? createNode(216 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(192 /* ArrayLiteralExpression */); + var node = createNode(193 /* ArrayLiteralExpression */); parseExpected(22 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -23152,17 +23266,17 @@ var ts; function parseObjectLiteralElement() { var node = createNodeWithJSDoc(0 /* Unknown */); if (parseOptionalToken(25 /* DotDotDotToken */)) { - node.kind = 283 /* SpreadAssignment */; + node.kind = 284 /* SpreadAssignment */; node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); - if (parseContextualModifier(131 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 163 /* GetAccessor */); + if (parseContextualModifier(132 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 164 /* GetAccessor */); } - if (parseContextualModifier(142 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 164 /* SetAccessor */); + if (parseContextualModifier(143 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 165 /* SetAccessor */); } var asteriskToken = parseOptionalToken(41 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); @@ -23180,7 +23294,7 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 58 /* ColonToken */); if (isShorthandPropertyAssignment) { - node.kind = 282 /* ShorthandPropertyAssignment */; + node.kind = 283 /* ShorthandPropertyAssignment */; var equalsToken = parseOptionalToken(62 /* EqualsToken */); if (equalsToken) { node.equalsToken = equalsToken; @@ -23188,20 +23302,26 @@ var ts; } } else { - node.kind = 281 /* PropertyAssignment */; + node.kind = 282 /* PropertyAssignment */; parseExpected(58 /* ColonToken */); node.initializer = allowInAnd(parseAssignmentExpressionOrHigher); } return finishNode(node); } function parseObjectLiteralExpression() { - var node = createNode(193 /* ObjectLiteralExpression */); + var node = createNode(194 /* ObjectLiteralExpression */); + var openBracePosition = scanner.getTokenPos(); parseExpected(18 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; } node.properties = parseDelimitedList(12 /* ObjectLiteralMembers */, parseObjectLiteralElement, /*considerSemicolonAsDelimiter*/ true); - parseExpected(19 /* CloseBraceToken */); + if (!parseExpected(19 /* CloseBraceToken */)) { + var lastError = ts.lastOrUndefined(parseDiagnostics); + if (lastError && lastError.code === ts.Diagnostics._0_expected.code) { + ts.addRelatedInfo(lastError, ts.createFileDiagnostic(sourceFile, openBracePosition, 1, ts.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here)); + } + } return finishNode(node); } function parseFunctionExpression() { @@ -23214,7 +23334,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(/*val*/ false); } - var node = createNodeWithJSDoc(201 /* FunctionExpression */); + var node = createNodeWithJSDoc(202 /* FunctionExpression */); node.modifiers = parseModifiers(); parseExpected(94 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(41 /* AsteriskToken */); @@ -23239,7 +23359,7 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(99 /* NewKeyword */); if (parseOptional(24 /* DotToken */)) { - var node_2 = createNode(219 /* MetaProperty */, fullStart); + var node_2 = createNode(220 /* MetaProperty */, fullStart); node_2.keywordToken = 99 /* NewKeyword */; node_2.name = parseIdentifierName(); return finishNode(node_2); @@ -23256,7 +23376,7 @@ var ts; } break; } - var node = createNode(197 /* NewExpression */, fullStart); + var node = createNode(198 /* NewExpression */, fullStart); node.expression = expression; node.typeArguments = typeArguments; if (node.typeArguments || token() === 20 /* OpenParenToken */) { @@ -23266,7 +23386,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(223 /* Block */); + var node = createNode(224 /* Block */); var openBracePosition = scanner.getTokenPos(); if (parseExpected(18 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { @@ -23305,12 +23425,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(224 /* EmptyStatement */); + var node = createNode(225 /* EmptyStatement */); parseExpected(26 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(227 /* IfStatement */); + var node = createNode(228 /* IfStatement */); parseExpected(95 /* IfKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23320,7 +23440,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(228 /* DoStatement */); + var node = createNode(229 /* DoStatement */); parseExpected(86 /* DoKeyword */); node.statement = parseStatement(); parseExpected(111 /* WhileKeyword */); @@ -23335,7 +23455,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(229 /* WhileStatement */); + var node = createNode(230 /* WhileStatement */); parseExpected(111 /* WhileKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23358,8 +23478,8 @@ var ts; } } var forOrForInOrForOfStatement; - if (awaitToken ? parseExpected(152 /* OfKeyword */) : parseOptional(152 /* OfKeyword */)) { - var forOfStatement = createNode(232 /* ForOfStatement */, pos); + if (awaitToken ? parseExpected(153 /* OfKeyword */) : parseOptional(153 /* OfKeyword */)) { + var forOfStatement = createNode(233 /* ForOfStatement */, pos); forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); @@ -23367,14 +23487,14 @@ var ts; forOrForInOrForOfStatement = forOfStatement; } else if (parseOptional(97 /* InKeyword */)) { - var forInStatement = createNode(231 /* ForInStatement */, pos); + var forInStatement = createNode(232 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } else { - var forStatement = createNode(230 /* ForStatement */, pos); + var forStatement = createNode(231 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(26 /* SemicolonToken */); if (token() !== 26 /* SemicolonToken */ && token() !== 21 /* CloseParenToken */) { @@ -23392,7 +23512,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 234 /* BreakStatement */ ? 77 /* BreakKeyword */ : 82 /* ContinueKeyword */); + parseExpected(kind === 235 /* BreakStatement */ ? 77 /* BreakKeyword */ : 82 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -23400,7 +23520,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(235 /* ReturnStatement */); + var node = createNode(236 /* ReturnStatement */); parseExpected(101 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -23409,7 +23529,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(236 /* WithStatement */); + var node = createNode(237 /* WithStatement */); parseExpected(112 /* WithKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23418,7 +23538,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(277 /* CaseClause */); + var node = createNode(278 /* CaseClause */); parseExpected(78 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(58 /* ColonToken */); @@ -23426,7 +23546,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(278 /* DefaultClause */); + var node = createNode(279 /* DefaultClause */); parseExpected(84 /* DefaultKeyword */); parseExpected(58 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); @@ -23436,12 +23556,12 @@ var ts; return token() === 78 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(237 /* SwitchStatement */); + var node = createNode(238 /* SwitchStatement */); parseExpected(103 /* SwitchKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); - var caseBlock = createNode(251 /* CaseBlock */); + var caseBlock = createNode(252 /* CaseBlock */); parseExpected(18 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(19 /* CloseBraceToken */); @@ -23456,7 +23576,7 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(239 /* ThrowStatement */); + var node = createNode(240 /* ThrowStatement */); parseExpected(105 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -23464,7 +23584,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(240 /* TryStatement */); + var node = createNode(241 /* TryStatement */); parseExpected(107 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); node.catchClause = token() === 79 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -23477,7 +23597,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(280 /* CatchClause */); + var result = createNode(281 /* CatchClause */); parseExpected(79 /* CatchKeyword */); if (parseOptional(20 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -23491,7 +23611,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(241 /* DebuggerStatement */); + var node = createNode(242 /* DebuggerStatement */); parseExpected(83 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -23500,15 +23620,15 @@ var ts; // Avoiding having to do the lookahead for a labeled statement by just trying to parse // out an expression, seeing if it is identifier and then seeing if it is followed by // a colon. - var node = createNodeWithJSDoc(0 /* Unknown */); + var node = createNodeWithJSDoc(token() === 75 /* Identifier */ ? 0 /* Unknown */ : 227 /* ExpressionStatement */); var expression = allowInAnd(parseExpression); if (expression.kind === 75 /* Identifier */ && parseOptional(58 /* ColonToken */)) { - node.kind = 238 /* LabeledStatement */; + node.kind = 239 /* LabeledStatement */; node.label = expression; node.statement = parseStatement(); } else { - node.kind = 226 /* ExpressionStatement */; + node.kind = 227 /* ExpressionStatement */; node.expression = expression; parseSemicolon(); } @@ -23562,25 +23682,25 @@ var ts; // // could be legal, it would add complexity for very little gain. case 114 /* InterfaceKeyword */: - case 145 /* TypeKeyword */: + case 146 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 122 /* AbstractKeyword */: case 126 /* AsyncKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 119 /* PublicKeyword */: - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 150 /* GlobalKeyword */: + case 151 /* GlobalKeyword */: nextToken(); return token() === 18 /* OpenBraceToken */ || token() === 75 /* Identifier */ || token() === 89 /* ExportKeyword */; case 96 /* ImportKeyword */: @@ -23589,7 +23709,7 @@ var ts; token() === 18 /* OpenBraceToken */ || ts.tokenIsIdentifierOrKeyword(token()); case 89 /* ExportKeyword */: var currentToken_1 = nextToken(); - if (currentToken_1 === 145 /* TypeKeyword */) { + if (currentToken_1 === 146 /* TypeKeyword */) { currentToken_1 = lookAhead(nextToken); } if (currentToken_1 === 62 /* EqualsToken */ || currentToken_1 === 41 /* AsteriskToken */ || @@ -23643,19 +23763,19 @@ var ts; case 89 /* ExportKeyword */: return isStartOfDeclaration(); case 126 /* AsyncKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 114 /* InterfaceKeyword */: - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: - case 145 /* TypeKeyword */: - case 150 /* GlobalKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: + case 146 /* TypeKeyword */: + case 151 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 120 /* StaticKeyword */: - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: // When these don't start a declaration, they may be the start of a class member if an identifier // immediately follows. Otherwise they're an identifier in an expression statement. return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); @@ -23679,16 +23799,16 @@ var ts; case 18 /* OpenBraceToken */: return parseBlock(/*ignoreMissingOpenBrace*/ false); case 109 /* VarKeyword */: - return parseVariableStatement(createNodeWithJSDoc(242 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(243 /* VariableDeclaration */)); case 115 /* LetKeyword */: if (isLetDeclaration()) { - return parseVariableStatement(createNodeWithJSDoc(242 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(243 /* VariableDeclaration */)); } break; case 94 /* FunctionKeyword */: - return parseFunctionDeclaration(createNodeWithJSDoc(244 /* FunctionDeclaration */)); + return parseFunctionDeclaration(createNodeWithJSDoc(245 /* FunctionDeclaration */)); case 80 /* ClassKeyword */: - return parseClassDeclaration(createNodeWithJSDoc(245 /* ClassDeclaration */)); + return parseClassDeclaration(createNodeWithJSDoc(246 /* ClassDeclaration */)); case 95 /* IfKeyword */: return parseIfStatement(); case 86 /* DoKeyword */: @@ -23698,9 +23818,9 @@ var ts; case 93 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 82 /* ContinueKeyword */: - return parseBreakOrContinueStatement(233 /* ContinueStatement */); + return parseBreakOrContinueStatement(234 /* ContinueStatement */); case 77 /* BreakKeyword */: - return parseBreakOrContinueStatement(234 /* BreakStatement */); + return parseBreakOrContinueStatement(235 /* BreakStatement */); case 101 /* ReturnKeyword */: return parseReturnStatement(); case 112 /* WithKeyword */: @@ -23721,10 +23841,10 @@ var ts; return parseDeclaration(); case 126 /* AsyncKeyword */: case 114 /* InterfaceKeyword */: - case 145 /* TypeKeyword */: - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: - case 130 /* DeclareKeyword */: + case 146 /* TypeKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: + case 131 /* DeclareKeyword */: case 81 /* ConstKeyword */: case 88 /* EnumKeyword */: case 89 /* ExportKeyword */: @@ -23734,8 +23854,8 @@ var ts; case 119 /* PublicKeyword */: case 122 /* AbstractKeyword */: case 120 /* StaticKeyword */: - case 138 /* ReadonlyKeyword */: - case 150 /* GlobalKeyword */: + case 139 /* ReadonlyKeyword */: + case 151 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -23744,7 +23864,7 @@ var ts; return parseExpressionOrLabeledStatement(); } function isDeclareModifier(modifier) { - return modifier.kind === 130 /* DeclareKeyword */; + return modifier.kind === 131 /* DeclareKeyword */; } function parseDeclaration() { var modifiers = lookAhead(function () { return (parseDecorators(), parseModifiers()); }); @@ -23792,13 +23912,13 @@ var ts; return parseClassDeclaration(node); case 114 /* InterfaceKeyword */: return parseInterfaceDeclaration(node); - case 145 /* TypeKeyword */: + case 146 /* TypeKeyword */: return parseTypeAliasDeclaration(node); case 88 /* EnumKeyword */: return parseEnumDeclaration(node); - case 150 /* GlobalKeyword */: - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: + case 151 /* GlobalKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: return parseModuleDeclaration(node); case 96 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(node); @@ -23817,7 +23937,7 @@ var ts; if (node.decorators || node.modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var missing = createMissingNode(264 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(265 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; @@ -23840,16 +23960,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token() === 27 /* CommaToken */) { - return createNode(215 /* OmittedExpression */); + return createNode(216 /* OmittedExpression */); } - var node = createNode(191 /* BindingElement */); + var node = createNode(192 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(191 /* BindingElement */); + var node = createNode(192 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -23865,14 +23985,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(189 /* ObjectBindingPattern */); + var node = createNode(190 /* ObjectBindingPattern */); parseExpected(18 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(19 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(190 /* ArrayBindingPattern */); + var node = createNode(191 /* ArrayBindingPattern */); parseExpected(22 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(23 /* CloseBracketToken */); @@ -23897,7 +24017,7 @@ var ts; return parseVariableDeclaration(/*allowExclamation*/ true); } function parseVariableDeclaration(allowExclamation) { - var node = createNode(242 /* VariableDeclaration */); + var node = createNode(243 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(ts.Diagnostics.Private_identifiers_are_not_allowed_in_variable_declarations); if (allowExclamation && node.name.kind === 75 /* Identifier */ && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { @@ -23910,7 +24030,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(243 /* VariableDeclarationList */); + var node = createNode(244 /* VariableDeclarationList */); switch (token()) { case 109 /* VarKeyword */: break; @@ -23933,7 +24053,7 @@ var ts; // So we need to look ahead to determine if 'of' should be treated as a keyword in // this context. // The checker will then give an error that there is an empty declaration list. - if (token() === 152 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 153 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -23948,13 +24068,13 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; } function parseVariableStatement(node) { - node.kind = 225 /* VariableStatement */; + node.kind = 226 /* VariableStatement */; node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(node) { - node.kind = 244 /* FunctionDeclaration */; + node.kind = 245 /* FunctionDeclaration */; parseExpected(94 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(41 /* AsteriskToken */); node.name = hasModifierOfKind(node, 84 /* DefaultKeyword */) ? parseOptionalIdentifier() : parseIdentifier(); @@ -23965,8 +24085,8 @@ var ts; return finishNode(node); } function parseConstructorName() { - if (token() === 129 /* ConstructorKeyword */) { - return parseExpected(129 /* ConstructorKeyword */); + if (token() === 130 /* ConstructorKeyword */) { + return parseExpected(130 /* ConstructorKeyword */); } if (token() === 10 /* StringLiteral */ && lookAhead(nextToken) === 20 /* OpenParenToken */) { return tryParse(function () { @@ -23978,7 +24098,7 @@ var ts; function tryParseConstructorDeclaration(node) { return tryParse(function () { if (parseConstructorName()) { - node.kind = 162 /* Constructor */; + node.kind = 163 /* Constructor */; fillSignature(58 /* ColonToken */, 0 /* None */, node); node.body = parseFunctionBlockOrSemicolon(0 /* None */, ts.Diagnostics.or_expected); return finishNode(node); @@ -23986,7 +24106,7 @@ var ts; }); } function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) { - node.kind = 161 /* MethodDeclaration */; + node.kind = 162 /* MethodDeclaration */; node.asteriskToken = asteriskToken; var isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; var isAsync = hasModifierOfKind(node, 126 /* AsyncKeyword */) ? 2 /* Await */ : 0 /* None */; @@ -23995,7 +24115,7 @@ var ts; return finishNode(node); } function parsePropertyDeclaration(node) { - node.kind = 159 /* PropertyDeclaration */; + node.kind = 160 /* PropertyDeclaration */; if (!node.questionToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -24057,7 +24177,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 142 /* SetKeyword */ || idToken === 131 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 143 /* SetKeyword */ || idToken === 132 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -24089,7 +24209,7 @@ var ts; if (!parseOptional(59 /* AtToken */)) { break; } - var decorator = createNode(157 /* Decorator */, decoratorStart); + var decorator = createNode(158 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); (list || (list = [])).push(decorator); @@ -24139,20 +24259,20 @@ var ts; } function parseClassElement() { if (token() === 26 /* SemicolonToken */) { - var result = createNode(222 /* SemicolonClassElement */); + var result = createNode(223 /* SemicolonClassElement */); nextToken(); return finishNode(result); } var node = createNodeWithJSDoc(0 /* Unknown */); node.decorators = parseDecorators(); node.modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); - if (parseContextualModifier(131 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 163 /* GetAccessor */); + if (parseContextualModifier(132 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 164 /* GetAccessor */); } - if (parseContextualModifier(142 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 164 /* SetAccessor */); + if (parseContextualModifier(143 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 165 /* SetAccessor */); } - if (token() === 129 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { + if (token() === 130 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { var constructorDeclaration = tryParseConstructorDeclaration(node); if (constructorDeclaration) { return constructorDeclaration; @@ -24189,10 +24309,10 @@ var ts; return ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 214 /* ClassExpression */); + return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 215 /* ClassExpression */); } function parseClassDeclaration(node) { - return parseClassDeclarationOrExpression(node, 245 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(node, 246 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(node, kind) { node.kind = kind; @@ -24235,14 +24355,14 @@ var ts; function parseHeritageClause() { var tok = token(); ts.Debug.assert(tok === 90 /* ExtendsKeyword */ || tok === 113 /* ImplementsKeyword */); // isListElement() should ensure this. - var node = createNode(279 /* HeritageClause */); + var node = createNode(280 /* HeritageClause */); node.token = tok; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); return finishNode(node); } function parseExpressionWithTypeArguments() { - var node = createNode(216 /* ExpressionWithTypeArguments */); + var node = createNode(217 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); node.typeArguments = tryParseTypeArguments(); return finishNode(node); @@ -24258,7 +24378,7 @@ var ts; return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(node) { - node.kind = 246 /* InterfaceDeclaration */; + node.kind = 247 /* InterfaceDeclaration */; parseExpected(114 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); @@ -24267,8 +24387,8 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(node) { - node.kind = 247 /* TypeAliasDeclaration */; - parseExpected(145 /* TypeKeyword */); + node.kind = 248 /* TypeAliasDeclaration */; + parseExpected(146 /* TypeKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(62 /* EqualsToken */); @@ -24281,13 +24401,13 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNodeWithJSDoc(284 /* EnumMember */); + var node = createNodeWithJSDoc(285 /* EnumMember */); node.name = parsePropertyName(); node.initializer = allowInAnd(parseInitializer); return finishNode(node); } function parseEnumDeclaration(node) { - node.kind = 248 /* EnumDeclaration */; + node.kind = 249 /* EnumDeclaration */; parseExpected(88 /* EnumKeyword */); node.name = parseIdentifier(); if (parseExpected(18 /* OpenBraceToken */)) { @@ -24300,7 +24420,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(250 /* ModuleBlock */); + var node = createNode(251 /* ModuleBlock */); if (parseExpected(18 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(19 /* CloseBraceToken */); @@ -24311,7 +24431,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(node, flags) { - node.kind = 249 /* ModuleDeclaration */; + node.kind = 250 /* ModuleDeclaration */; // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 16 /* Namespace */; @@ -24323,8 +24443,8 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(node) { - node.kind = 249 /* ModuleDeclaration */; - if (token() === 150 /* GlobalKeyword */) { + node.kind = 250 /* ModuleDeclaration */; + if (token() === 151 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation node.name = parseIdentifier(); node.flags |= 1024 /* GlobalAugmentation */; @@ -24343,15 +24463,15 @@ var ts; } function parseModuleDeclaration(node) { var flags = 0; - if (token() === 150 /* GlobalKeyword */) { + if (token() === 151 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(node); } - else if (parseOptional(136 /* NamespaceKeyword */)) { + else if (parseOptional(137 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(135 /* ModuleKeyword */); + parseExpected(136 /* ModuleKeyword */); if (token() === 10 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(node); } @@ -24359,7 +24479,7 @@ var ts; return parseModuleOrNamespaceDeclaration(node, flags); } function isExternalModuleReference() { - return token() === 139 /* RequireKeyword */ && + return token() === 140 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -24369,9 +24489,9 @@ var ts; return nextToken() === 43 /* SlashToken */; } function parseNamespaceExportDeclaration(node) { - node.kind = 252 /* NamespaceExportDeclaration */; + node.kind = 253 /* NamespaceExportDeclaration */; parseExpected(123 /* AsKeyword */); - parseExpected(136 /* NamespaceKeyword */); + parseExpected(137 /* NamespaceKeyword */); node.name = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -24384,7 +24504,7 @@ var ts; identifier = parseIdentifier(); } var isTypeOnly = false; - if (token() !== 149 /* FromKeyword */ && + if (token() !== 150 /* FromKeyword */ && (identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) === "type" && (isIdentifier() || tokenAfterImportDefinitelyProducesImportDeclaration())) { isTypeOnly = true; @@ -24394,7 +24514,7 @@ var ts; return parseImportEqualsDeclaration(node, identifier, isTypeOnly); } // Import statement - node.kind = 254 /* ImportDeclaration */; + node.kind = 255 /* ImportDeclaration */; // ImportDeclaration: // import ImportClause from ModuleSpecifier ; // import ModuleSpecifier; @@ -24403,7 +24523,7 @@ var ts; token() === 18 /* OpenBraceToken */ // import { ) { node.importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); - parseExpected(149 /* FromKeyword */); + parseExpected(150 /* FromKeyword */); } node.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -24415,10 +24535,10 @@ var ts; function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { // In `import id ___`, the current token decides whether to produce // an ImportDeclaration or ImportEqualsDeclaration. - return token() === 27 /* CommaToken */ || token() === 149 /* FromKeyword */; + return token() === 27 /* CommaToken */ || token() === 150 /* FromKeyword */; } function parseImportEqualsDeclaration(node, identifier, isTypeOnly) { - node.kind = 253 /* ImportEqualsDeclaration */; + node.kind = 254 /* ImportEqualsDeclaration */; node.name = identifier; parseExpected(62 /* EqualsToken */); node.moduleReference = parseModuleReference(); @@ -24436,7 +24556,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(255 /* ImportClause */, fullStart); + var importClause = createNode(256 /* ImportClause */, fullStart); importClause.isTypeOnly = isTypeOnly; if (identifier) { // ImportedDefaultBinding: @@ -24447,7 +24567,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(27 /* CommaToken */)) { - importClause.namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(257 /* NamedImports */); + importClause.namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(258 /* NamedImports */); } return finishNode(importClause); } @@ -24457,8 +24577,8 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(265 /* ExternalModuleReference */); - parseExpected(139 /* RequireKeyword */); + var node = createNode(266 /* ExternalModuleReference */); + parseExpected(140 /* RequireKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = parseModuleSpecifier(); parseExpected(21 /* CloseParenToken */); @@ -24480,7 +24600,7 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(256 /* NamespaceImport */); + var namespaceImport = createNode(257 /* NamespaceImport */); parseExpected(41 /* AsteriskToken */); parseExpected(123 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -24495,14 +24615,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 257 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); + node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 258 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(263 /* ExportSpecifier */); + return parseImportOrExportSpecifier(264 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(258 /* ImportSpecifier */); + return parseImportOrExportSpecifier(259 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -24527,34 +24647,34 @@ var ts; else { node.name = identifierName; } - if (kind === 258 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 259 /* ImportSpecifier */ && checkIdentifierIsKeyword) { parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseNamespaceExport(pos) { - var node = createNode(262 /* NamespaceExport */, pos); + var node = createNode(263 /* NamespaceExport */, pos); node.name = parseIdentifier(); return finishNode(node); } function parseExportDeclaration(node) { - node.kind = 260 /* ExportDeclaration */; - node.isTypeOnly = parseOptional(145 /* TypeKeyword */); + node.kind = 261 /* ExportDeclaration */; + node.isTypeOnly = parseOptional(146 /* TypeKeyword */); var namespaceExportPos = scanner.getStartPos(); if (parseOptional(41 /* AsteriskToken */)) { if (parseOptional(123 /* AsKeyword */)) { node.exportClause = parseNamespaceExport(namespaceExportPos); } - parseExpected(149 /* FromKeyword */); + parseExpected(150 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(261 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(262 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 149 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(149 /* FromKeyword */); + if (token() === 150 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(150 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -24562,7 +24682,7 @@ var ts; return finishNode(node); } function parseExportAssignment(node) { - node.kind = 259 /* ExportAssignment */; + node.kind = 260 /* ExportAssignment */; if (parseOptional(62 /* EqualsToken */)) { node.isExportEquals = true; } @@ -24582,10 +24702,10 @@ var ts; } function isAnExternalModuleIndicatorNode(node) { return hasModifierOfKind(node, 89 /* ExportKeyword */) - || node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 265 /* ExternalModuleReference */ - || node.kind === 254 /* ImportDeclaration */ - || node.kind === 259 /* ExportAssignment */ - || node.kind === 260 /* ExportDeclaration */ ? node : undefined; + || node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 266 /* ExternalModuleReference */ + || node.kind === 255 /* ImportDeclaration */ + || node.kind === 260 /* ExportAssignment */ + || node.kind === 261 /* ExportDeclaration */ ? node : undefined; } function getImportMetaIfNecessary(sourceFile) { return sourceFile.flags & 2097152 /* PossiblyContainsImportMeta */ ? @@ -24651,7 +24771,7 @@ var ts; JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; // Parses out a JSDoc type expression. function parseJSDocTypeExpression(mayOmitBraces) { - var result = createNode(294 /* JSDocTypeExpression */); + var result = createNode(295 /* JSDocTypeExpression */); var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(18 /* OpenBraceToken */); result.type = doInsideOfContext(4194304 /* JSDoc */, parseJSDocType); if (!mayOmitBraces || hasBrace) { @@ -24814,7 +24934,7 @@ var ts; } } function createJSDocComment() { - var result = createNode(303 /* JSDocComment */, start); + var result = createNode(304 /* JSDocComment */, start); result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd); result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -24884,19 +25004,19 @@ var ts; break; case "class": case "constructor": - tag = parseSimpleTag(start, 310 /* JSDocClassTag */, tagName); + tag = parseSimpleTag(start, 311 /* JSDocClassTag */, tagName); break; case "public": - tag = parseSimpleTag(start, 311 /* JSDocPublicTag */, tagName); + tag = parseSimpleTag(start, 312 /* JSDocPublicTag */, tagName); break; case "private": - tag = parseSimpleTag(start, 312 /* JSDocPrivateTag */, tagName); + tag = parseSimpleTag(start, 313 /* JSDocPrivateTag */, tagName); break; case "protected": - tag = parseSimpleTag(start, 313 /* JSDocProtectedTag */, tagName); + tag = parseSimpleTag(start, 314 /* JSDocProtectedTag */, tagName); break; case "readonly": - tag = parseSimpleTag(start, 314 /* JSDocReadonlyTag */, tagName); + tag = parseSimpleTag(start, 315 /* JSDocReadonlyTag */, tagName); break; case "this": tag = parseThisTag(start, tagName); @@ -25031,7 +25151,7 @@ var ts; return comments.length === 0 ? undefined : comments.join(""); } function parseUnknownTag(start, tagName) { - var result = createNode(306 /* JSDocTag */, start); + var result = createNode(307 /* JSDocTag */, start); result.tagName = tagName; return finishNode(result); } @@ -25076,9 +25196,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 141 /* ObjectKeyword */: + case 142 /* ObjectKeyword */: return true; - case 174 /* ArrayType */: + case 175 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; @@ -25094,8 +25214,8 @@ var ts; typeExpression = tryParseTypeExpression(); } var result = target === 1 /* Property */ ? - createNode(323 /* JSDocPropertyTag */, start) : - createNode(317 /* JSDocParameterTag */, start); + createNode(324 /* JSDocPropertyTag */, start) : + createNode(318 /* JSDocParameterTag */, start); var comment = parseTagComments(indent + scanner.getStartPos() - start); var nestedTypeLiteral = target !== 4 /* CallbackParameter */ && parseNestedTypeLiteral(typeExpression, name, target, indent); if (nestedTypeLiteral) { @@ -25112,20 +25232,20 @@ var ts; } function parseNestedTypeLiteral(typeExpression, name, target, indent) { if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { - var typeLiteralExpression = createNode(294 /* JSDocTypeExpression */, scanner.getTokenPos()); + var typeLiteralExpression = createNode(295 /* JSDocTypeExpression */, scanner.getTokenPos()); var child = void 0; var jsdocTypeLiteral = void 0; var start_3 = scanner.getStartPos(); var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) { - if (child.kind === 317 /* JSDocParameterTag */ || child.kind === 323 /* JSDocPropertyTag */) { + if (child.kind === 318 /* JSDocParameterTag */ || child.kind === 324 /* JSDocPropertyTag */) { children = ts.append(children, child); } } if (children) { - jsdocTypeLiteral = createNode(304 /* JSDocTypeLiteral */, start_3); + jsdocTypeLiteral = createNode(305 /* JSDocTypeLiteral */, start_3); jsdocTypeLiteral.jsDocPropertyTags = children; - if (typeExpression.type.kind === 174 /* ArrayType */) { + if (typeExpression.type.kind === 175 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typeLiteralExpression.type = finishNode(jsdocTypeLiteral); @@ -25137,7 +25257,7 @@ var ts; if (ts.some(tags, ts.isJSDocReturnTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(318 /* JSDocReturnTag */, start); + var result = createNode(319 /* JSDocReturnTag */, start); result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); @@ -25146,13 +25266,13 @@ var ts; if (ts.some(tags, ts.isJSDocTypeTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(320 /* JSDocTypeTag */, start); + var result = createNode(321 /* JSDocTypeTag */, start); result.tagName = tagName; result.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); return finishNode(result); } function parseAuthorTag(start, tagName, indent) { - var result = createNode(309 /* JSDocAuthorTag */, start); + var result = createNode(310 /* JSDocAuthorTag */, start); result.tagName = tagName; var authorInfoWithEmail = tryParse(function () { return tryParseAuthorNameAndEmail(); }); if (!authorInfoWithEmail) { @@ -25206,20 +25326,20 @@ var ts; } } function parseImplementsTag(start, tagName) { - var result = createNode(308 /* JSDocImplementsTag */, start); + var result = createNode(309 /* JSDocImplementsTag */, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseAugmentsTag(start, tagName) { - var result = createNode(307 /* JSDocAugmentsTag */, start); + var result = createNode(308 /* JSDocAugmentsTag */, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseExpressionWithTypeArgumentsForAugments() { var usedBrace = parseOptional(18 /* OpenBraceToken */); - var node = createNode(216 /* ExpressionWithTypeArguments */); + var node = createNode(217 /* ExpressionWithTypeArguments */); node.expression = parsePropertyAccessEntityNameExpression(); node.typeArguments = tryParseTypeArguments(); var res = finishNode(node); @@ -25231,7 +25351,7 @@ var ts; function parsePropertyAccessEntityNameExpression() { var node = parseJSDocIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var prop = createNode(194 /* PropertyAccessExpression */, node.pos); + var prop = createNode(195 /* PropertyAccessExpression */, node.pos); prop.expression = node; prop.name = parseJSDocIdentifierName(); node = finishNode(prop); @@ -25244,14 +25364,14 @@ var ts; return finishNode(tag); } function parseThisTag(start, tagName) { - var tag = createNode(319 /* JSDocThisTag */, start); + var tag = createNode(320 /* JSDocThisTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); return finishNode(tag); } function parseEnumTag(start, tagName) { - var tag = createNode(316 /* JSDocEnumTag */, start); + var tag = createNode(317 /* JSDocEnumTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); @@ -25260,7 +25380,7 @@ var ts; function parseTypedefTag(start, tagName, indent) { var typeExpression = tryParseTypeExpression(); skipWhitespaceOrAsterisk(); - var typedefTag = createNode(322 /* JSDocTypedefTag */, start); + var typedefTag = createNode(323 /* JSDocTypedefTag */, start); typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(); typedefTag.name = getJSDocTypeAliasName(typedefTag.fullName); @@ -25274,9 +25394,9 @@ var ts; var childTypeTag = void 0; while (child = tryParse(function () { return parseChildPropertyTag(indent); })) { if (!jsdocTypeLiteral) { - jsdocTypeLiteral = createNode(304 /* JSDocTypeLiteral */, start); + jsdocTypeLiteral = createNode(305 /* JSDocTypeLiteral */, start); } - if (child.kind === 320 /* JSDocTypeTag */) { + if (child.kind === 321 /* JSDocTypeTag */) { if (childTypeTag) { break; } @@ -25289,7 +25409,7 @@ var ts; } } if (jsdocTypeLiteral) { - if (typeExpression && typeExpression.type.kind === 174 /* ArrayType */) { + if (typeExpression && typeExpression.type.kind === 175 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? @@ -25308,7 +25428,7 @@ var ts; } var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (parseOptional(24 /* DotToken */)) { - var jsDocNamespaceNode = createNode(249 /* ModuleDeclaration */, pos); + var jsDocNamespaceNode = createNode(250 /* ModuleDeclaration */, pos); if (nested) { jsDocNamespaceNode.flags |= 4 /* NestedNamespace */; } @@ -25322,14 +25442,14 @@ var ts; return typeNameOrNamespaceName; } function parseCallbackTag(start, tagName, indent) { - var callbackTag = createNode(315 /* JSDocCallbackTag */, start); + var callbackTag = createNode(316 /* JSDocCallbackTag */, start); callbackTag.tagName = tagName; callbackTag.fullName = parseJSDocTypeNameWithNamespace(); callbackTag.name = getJSDocTypeAliasName(callbackTag.fullName); skipWhitespace(); callbackTag.comment = parseTagComments(indent); var child; - var jsdocSignature = createNode(305 /* JSDocSignature */, start); + var jsdocSignature = createNode(306 /* JSDocSignature */, start); jsdocSignature.parameters = []; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent); })) { jsdocSignature.parameters = ts.append(jsdocSignature.parameters, child); @@ -25337,7 +25457,7 @@ var ts; var returnTag = tryParse(function () { if (parseOptionalJsdoc(59 /* AtToken */)) { var tag = parseTag(indent); - if (tag && tag.kind === 318 /* JSDocReturnTag */) { + if (tag && tag.kind === 319 /* JSDocReturnTag */) { return tag; } } @@ -25382,7 +25502,7 @@ var ts; case 59 /* AtToken */: if (canParseTag) { var child = tryParseChildTag(target, indent); - if (child && (child.kind === 317 /* JSDocParameterTag */ || child.kind === 323 /* JSDocPropertyTag */) && + if (child && (child.kind === 318 /* JSDocParameterTag */ || child.kind === 324 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; @@ -25446,13 +25566,13 @@ var ts; var typeParametersPos = getNodePos(); do { skipWhitespace(); - var typeParameter = createNode(155 /* TypeParameter */); + var typeParameter = createNode(156 /* TypeParameter */); typeParameter.name = parseJSDocIdentifierName(ts.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces); finishNode(typeParameter); skipWhitespaceOrAsterisk(); typeParameters.push(typeParameter); } while (parseOptionalJsdoc(27 /* CommaToken */)); - var result = createNode(321 /* JSDocTemplateTag */, start); + var result = createNode(322 /* JSDocTemplateTag */, start); result.tagName = tagName; result.constraint = constraint; result.typeParameters = createNodeArray(typeParameters, typeParametersPos); @@ -26259,7 +26379,9 @@ var ts; ["esnext.symbol", "lib.es2019.symbol.d.ts"], ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"], ["esnext.intl", "lib.esnext.intl.d.ts"], - ["esnext.bigint", "lib.es2020.bigint.d.ts"] + ["esnext.bigint", "lib.es2020.bigint.d.ts"], + ["esnext.string", "lib.esnext.string.d.ts"], + ["esnext.promise", "lib.esnext.promise.d.ts"] ]; /** * An array of supported "lib" reference file names used to determine the order for inclusion @@ -27759,7 +27881,7 @@ var ts; function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) { var result = returnValue ? {} : undefined; var _loop_3 = function (element) { - if (element.kind !== 281 /* PropertyAssignment */) { + if (element.kind !== 282 /* PropertyAssignment */) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); return "continue"; } @@ -27850,13 +27972,13 @@ var ts; case 8 /* NumericLiteral */: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { break; // not valid JSON syntax } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; // Currently having element option declaration in the tsconfig with type "object" @@ -27873,7 +27995,7 @@ var ts; return convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined); } - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -29058,7 +29180,12 @@ var ts; ts.Debug.assert(ts.extensionIsTS(resolved.extension)); return { fileName: resolved.path, packageId: resolved.packageId }; } - function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations) { + function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, resultFromCache) { + var _a; + if (resultFromCache) { + (_a = resultFromCache.failedLookupLocations).push.apply(_a, failedLookupLocations); + return resultFromCache; + } return { resolvedModule: resolved && { resolvedFileName: resolved.path, originalPath: resolved.originalPath === true ? undefined : resolved.originalPath, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, failedLookupLocations: failedLookupLocations @@ -29750,15 +29877,12 @@ var ts; } ts.nodeModuleNameResolver = nodeModuleNameResolver; function nodeModuleNameResolverWorker(moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference) { + var _a, _b; var traceEnabled = isTraceEnabled(compilerOptions, host); var failedLookupLocations = []; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations }; var result = ts.forEach(extensions, function (ext) { return tryResolve(ext); }); - if (result && result.value) { - var _a = result.value, resolved = _a.resolved, isExternalLibraryImport = _a.isExternalLibraryImport; - return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations); - } - return { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; + return createResolvedModuleWithFailedLookupLocations((_a = result === null || result === void 0 ? void 0 : result.value) === null || _a === void 0 ? void 0 : _a.resolved, (_b = result === null || result === void 0 ? void 0 : result.value) === null || _b === void 0 ? void 0 : _b.isExternalLibraryImport, failedLookupLocations, state.resultFromCache); function tryResolve(extensions) { var loader = function (extensions, candidate, onlyRecordFailures, state) { return nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, /*considerPackageJson*/ true); }; var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, state); @@ -30195,13 +30319,12 @@ var ts; } ts.unmangleScopedPackageName = unmangleScopedPackageName; function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, state) { - var _a; var result = cache && cache.get(containingDirectory); if (result) { if (state.traceEnabled) { trace(state.host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory); } - (_a = state.failedLookupLocations).push.apply(_a, result.failedLookupLocations); + state.resultFromCache = result; return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, originalPath: result.resolvedModule.originalPath || true, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId } }; } } @@ -30212,7 +30335,7 @@ var ts; var containingDirectory = ts.getDirectoryPath(containingFile); var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); // No originalPath because classic resolution doesn't resolve realPath - return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations); + return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations, state.resultFromCache); function tryResolve(extensions) { var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state); if (resolvedUsingSettings) { @@ -30257,7 +30380,7 @@ var ts; var failedLookupLocations = []; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations }; var resolved = loadModuleFromImmediateNodeModulesDirectory(Extensions.DtsOnly, moduleName, globalCache, state, /*typesScopeOnly*/ false); - return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations); + return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations, state.resultFromCache); } ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache; /** @@ -30300,26 +30423,26 @@ var ts; // A module is uninstantiated if it contains only switch (node.kind) { // 1. interface declarations, type alias declarations - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: if (ts.isEnumConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: if (!(ts.hasModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } break; // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: var exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 261 /* NamedExports */) { + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 262 /* NamedExports */) { var state = 0 /* NonInstantiated */; for (var _i = 0, _a = exportDeclaration.exportClause.elements; _i < _a.length; _i++) { var specifier = _a[_i]; @@ -30335,7 +30458,7 @@ var ts; } break; // 5. other uninstantiated module declarations. - case 250 /* ModuleBlock */: { + case 251 /* ModuleBlock */: { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateCached(n, visited); @@ -30357,7 +30480,7 @@ var ts; }); return state_1; } - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 75 /* Identifier */: // Only jsdoc typedef definition can exist in jsdoc namespace, and it should @@ -30565,7 +30688,7 @@ var ts; // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { - if (node.kind === 259 /* ExportAssignment */) { + if (node.kind === 260 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } var name = ts.getNameOfDeclaration(node); @@ -30574,7 +30697,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 154 /* ComputedPropertyName */) { + if (name.kind === 155 /* ComputedPropertyName */) { var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteralLike(nameExpression)) { @@ -30602,36 +30725,36 @@ var ts; return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: return "__constructor" /* Constructor */; - case 170 /* FunctionType */: - case 165 /* CallSignature */: - case 305 /* JSDocSignature */: + case 171 /* FunctionType */: + case 166 /* CallSignature */: + case 306 /* JSDocSignature */: return "__call" /* Call */; - case 171 /* ConstructorType */: - case 166 /* ConstructSignature */: + case 172 /* ConstructorType */: + case 167 /* ConstructSignature */: return "__new" /* New */; - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: return "__index" /* Index */; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 290 /* SourceFile */: + case 291 /* SourceFile */: // json file should behave as // module.exports = ... return "export=" /* ExportEquals */; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) { // module.exports = ... return "export=" /* ExportEquals */; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */); - case 156 /* Parameter */: + case 157 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 300 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); + ts.Debug.assert(node.parent.kind === 301 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); var functionType = node.parent; var index = functionType.parameters.indexOf(node); return "arg" + index; @@ -30731,7 +30854,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (node.kind === 259 /* ExportAssignment */ && !node.isExportEquals)) { + (node.kind === 260 /* ExportAssignment */ && !node.isExportEquals)) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName_1 = false; multipleDefaultExports_1 = true; @@ -30770,7 +30893,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 263 /* ExportSpecifier */ || (node.kind === 253 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 264 /* ExportSpecifier */ || (node.kind === 254 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -30837,7 +30960,7 @@ var ts; // for it. We must clear this so we don't accidentally move any stale data forward from // a previous compilation. if (containerFlags & 1 /* IsContainer */) { - if (node.kind !== 202 /* ArrowFunction */) { + if (node.kind !== 203 /* ArrowFunction */) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -30870,7 +30993,7 @@ var ts; } // We create a return control flow graph for IIFEs and constructors. For constructors // we use the return control flow graph in strict property initialization checks. - currentReturnTarget = isIIFE || node.kind === 162 /* Constructor */ ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 163 /* Constructor */ ? createBranchLabel() : undefined; currentExceptionTarget = undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; @@ -30885,13 +31008,13 @@ var ts; node.flags |= 512 /* HasExplicitReturn */; node.endFlowNode = currentFlow; } - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 162 /* Constructor */) { + if (node.kind === 163 /* Constructor */) { node.returnFlowNode = currentFlow; } } @@ -30935,8 +31058,8 @@ var ts; } } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, function (n) { return n.kind === 244 /* FunctionDeclaration */ ? bind(n) : undefined; }); - bindEach(nodes, function (n) { return n.kind !== 244 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind === 245 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind !== 245 /* FunctionDeclaration */ ? bind(n) : undefined; }); } function bindEach(nodes, bindFunction) { if (bindFunction === void 0) { bindFunction = bind; } @@ -30968,90 +31091,90 @@ var ts; bindJSDoc(node); return; } - if (node.kind >= 225 /* FirstStatement */ && node.kind <= 241 /* LastStatement */ && !options.allowUnreachableCode) { + if (node.kind >= 226 /* FirstStatement */ && node.kind <= 242 /* LastStatement */ && !options.allowUnreachableCode) { node.flowNode = currentFlow; } switch (node.kind) { - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: bindWhileStatement(node); break; - case 228 /* DoStatement */: + case 229 /* DoStatement */: bindDoStatement(node); break; - case 230 /* ForStatement */: + case 231 /* ForStatement */: bindForStatement(node); break; - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 227 /* IfStatement */: + case 228 /* IfStatement */: bindIfStatement(node); break; - case 235 /* ReturnStatement */: - case 239 /* ThrowStatement */: + case 236 /* ReturnStatement */: + case 240 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 240 /* TryStatement */: + case 241 /* TryStatement */: bindTryStatement(node); break; - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: bindSwitchStatement(node); break; - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: bindCaseBlock(node); break; - case 277 /* CaseClause */: + case 278 /* CaseClause */: bindCaseClause(node); break; - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: bindExpressionStatement(node); break; - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: bindLabeledStatement(node); break; - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: bindAccessExpressionFlow(node); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: bindCallExpressionFlow(node); break; - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: bindJSDocTypeAlias(node); break; // In source files and blocks, bind functions first to match hoisting that occurs at runtime - case 290 /* SourceFile */: { + case 291 /* SourceFile */: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 223 /* Block */: - case 250 /* ModuleBlock */: + case 224 /* Block */: + case 251 /* ModuleBlock */: bindEachFunctionsFirst(node.statements); break; default: @@ -31064,18 +31187,18 @@ var ts; switch (expr.kind) { case 75 /* Identifier */: case 104 /* ThisKeyword */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return containsNarrowableReference(expr); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return hasNarrowableArgument(expr); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return isNarrowingExpression(expr.expression); } return false; @@ -31097,7 +31220,7 @@ var ts; } } } - if (expr.expression.kind === 194 /* PropertyAccessExpression */ && + if (expr.expression.kind === 195 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { return true; } @@ -31130,9 +31253,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 62 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -31208,26 +31331,26 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 227 /* IfStatement */: - case 229 /* WhileStatement */: - case 228 /* DoStatement */: + case 228 /* IfStatement */: + case 230 /* WhileStatement */: + case 229 /* DoStatement */: return parent.expression === node; - case 230 /* ForStatement */: - case 210 /* ConditionalExpression */: + case 231 /* ForStatement */: + case 211 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 200 /* ParenthesizedExpression */) { + if (node.kind === 201 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 207 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { + else if (node.kind === 208 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 209 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || + return node.kind === 210 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */); } @@ -31269,7 +31392,7 @@ var ts; } function setContinueTarget(node, target) { var label = activeLabelList; - while (label && node.parent.kind === 238 /* LabeledStatement */) { + while (label && node.parent.kind === 239 /* LabeledStatement */) { label.continueTarget = target; label = label.next; node = node.parent; @@ -31320,12 +31443,12 @@ var ts; bind(node.expression); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 232 /* ForOfStatement */) { + if (node.kind === 233 /* ForOfStatement */) { bind(node.awaitModifier); } addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 243 /* VariableDeclarationList */) { + if (node.initializer.kind !== 244 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -31347,7 +31470,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 235 /* ReturnStatement */) { + if (node.kind === 236 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -31364,7 +31487,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 234 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 235 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -31464,7 +31587,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 278 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 279 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). Note, we no longer need // this property in control flow analysis, it's there only for backwards compatibility. @@ -31513,7 +31636,7 @@ var ts; bind(node.expression); // A top level call expression with a dotted function name and at least one argument // is potentially an assertion and is therefore included in the control flow. - if (node.expression.kind === 196 /* CallExpression */) { + if (node.expression.kind === 197 /* CallExpression */) { var call = node.expression; if (ts.isDottedName(call.expression)) { currentFlow = createFlowCall(currentFlow, call); @@ -31539,7 +31662,7 @@ var ts; currentFlow = finishFlowLabel(postStatementLabel); } function bindDestructuringTargetFlow(node) { - if (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { + if (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -31550,10 +31673,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); } - else if (node.kind === 192 /* ArrayLiteralExpression */) { + else if (node.kind === 193 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 213 /* SpreadElement */) { + if (e.kind === 214 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -31561,16 +31684,16 @@ var ts; } } } - else if (node.kind === 193 /* ObjectLiteralExpression */) { + else if (node.kind === 194 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 281 /* PropertyAssignment */) { + if (p.kind === 282 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 282 /* ShorthandPropertyAssignment */) { + else if (p.kind === 283 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 283 /* SpreadAssignment */) { + else if (p.kind === 284 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -31692,7 +31815,7 @@ var ts; var operator = node.operatorToken.kind; if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 62 /* EqualsToken */ && node.left.kind === 195 /* ElementAccessExpression */) { + if (operator === 62 /* EqualsToken */ && node.left.kind === 196 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -31754,7 +31877,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 194 /* PropertyAccessExpression */) { + if (node.expression.kind === 195 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -31793,14 +31916,14 @@ var ts; } function bindJSDocTypeAlias(node) { node.tagName.parent = node; - if (node.kind !== 316 /* JSDocEnumTag */ && node.fullName) { + if (node.kind !== 317 /* JSDocEnumTag */ && node.fullName) { setParentPointers(node, node.fullName); } } function bindJSDocClassTag(node) { bindEachChild(node); var host = ts.getHostSignatureFromJSDoc(node); - if (host && host.kind !== 161 /* MethodDeclaration */) { + if (host && host.kind !== 162 /* MethodDeclaration */) { addDeclarationToSymbol(host.symbol, host, 32 /* Class */); } } @@ -31814,13 +31937,13 @@ var ts; function bindOptionalChainRest(node) { bind(node.questionDotToken); switch (node.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: bind(node.name); break; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: bind(node.argumentExpression); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: bindEach(node.typeArguments); bindEach(node.arguments); break; @@ -31876,7 +31999,7 @@ var ts; // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = ts.skipParentheses(node.expression); - if (expr.kind === 201 /* FunctionExpression */ || expr.kind === 202 /* ArrowFunction */) { + if (expr.kind === 202 /* FunctionExpression */ || expr.kind === 203 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -31885,7 +32008,7 @@ var ts; bindEachChild(node); } } - if (node.expression.kind === 194 /* PropertyAccessExpression */) { + if (node.expression.kind === 195 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (ts.isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -31894,54 +32017,54 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 193 /* ObjectLiteralExpression */: - case 173 /* TypeLiteral */: - case 304 /* JSDocTypeLiteral */: - case 274 /* JsxAttributes */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 194 /* ObjectLiteralExpression */: + case 174 /* TypeLiteral */: + case 305 /* JSDocTypeLiteral */: + case 275 /* JsxAttributes */: return 1 /* IsContainer */; - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 249 /* ModuleDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 186 /* MappedType */: + case 250 /* ModuleDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 187 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 290 /* SourceFile */: + case 291 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } // falls through - case 162 /* Constructor */: - case 244 /* FunctionDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 165 /* CallSignature */: - case 305 /* JSDocSignature */: - case 300 /* JSDocFunctionType */: - case 170 /* FunctionType */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 171 /* ConstructorType */: + case 163 /* Constructor */: + case 245 /* FunctionDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 166 /* CallSignature */: + case 306 /* JSDocSignature */: + case 301 /* JSDocFunctionType */: + case 171 /* FunctionType */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 172 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 280 /* CatchClause */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 251 /* CaseBlock */: + case 281 /* CatchClause */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 252 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 223 /* Block */: + case 224 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -31974,45 +32097,45 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 290 /* SourceFile */: + case 291 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 173 /* TypeLiteral */: - case 304 /* JSDocTypeLiteral */: - case 193 /* ObjectLiteralExpression */: - case 246 /* InterfaceDeclaration */: - case 274 /* JsxAttributes */: + case 174 /* TypeLiteral */: + case 305 /* JSDocTypeLiteral */: + case 194 /* ObjectLiteralExpression */: + case 247 /* InterfaceDeclaration */: + case 275 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 305 /* JSDocSignature */: - case 167 /* IndexSignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 300 /* JSDocFunctionType */: - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 247 /* TypeAliasDeclaration */: - case 186 /* MappedType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 306 /* JSDocSignature */: + case 168 /* IndexSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 301 /* JSDocFunctionType */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 248 /* TypeAliasDeclaration */: + case 187 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -32113,7 +32236,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 283 /* SpreadAssignment */ || prop.name.kind !== 75 /* Identifier */) { + if (prop.kind === 284 /* SpreadAssignment */ || prop.name.kind !== 75 /* Identifier */) { continue; } var identifier = prop.name; @@ -32125,7 +32248,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 281 /* PropertyAssignment */ || prop.kind === 282 /* ShorthandPropertyAssignment */ || prop.kind === 161 /* MethodDeclaration */ + var currentKind = prop.kind === 282 /* PropertyAssignment */ || prop.kind === 283 /* ShorthandPropertyAssignment */ || prop.kind === 162 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen.get(identifier.escapedText); @@ -32157,10 +32280,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (ts.isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -32346,8 +32469,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 290 /* SourceFile */ && - blockScopeContainer.kind !== 249 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 291 /* SourceFile */ && + blockScopeContainer.kind !== 250 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -32442,7 +32565,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 152 /* LastToken */) { + if (node.kind > 153 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -32518,14 +32641,14 @@ var ts; } // falls through case 104 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 282 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 283 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); case 76 /* PrivateIdentifier */: return checkPrivateIdentifier(node); - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: var expr = node; if (currentFlow && isNarrowableReference(expr)) { expr.flowNode = currentFlow; @@ -32540,7 +32663,7 @@ var ts; declareSymbol(file.locals, /*parent*/ undefined, expr.expression, 1 /* FunctionScopedVariable */ | 134217728 /* ModuleExports */, 111550 /* FunctionScopedVariableExcludes */); } break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var specialKind = ts.getAssignmentDeclarationKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -32568,78 +32691,78 @@ var ts; ts.Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return checkStrictModeCatchClause(node); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return checkStrictModeWithStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return checkStrictModeLabeledStatement(node); - case 183 /* ThisType */: + case 184 /* ThisType */: seenThisKeyword = true; return; - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: break; // Binding the children will handle everything - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return bindTypeParameter(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return bindParameter(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 191 /* BindingElement */: + case 192 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return bindPropertyWorker(node); - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 284 /* EnumMember */: + case 285 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */); - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */); - case 170 /* FunctionType */: - case 300 /* JSDocFunctionType */: - case 305 /* JSDocSignature */: - case 171 /* ConstructorType */: + case 171 /* FunctionType */: + case 301 /* JSDocFunctionType */: + case 306 /* JSDocSignature */: + case 172 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 173 /* TypeLiteral */: - case 304 /* JSDocTypeLiteral */: - case 186 /* MappedType */: + case 174 /* TypeLiteral */: + case 305 /* JSDocTypeLiteral */: + case 187 /* MappedType */: return bindAnonymousTypeWorker(node); - case 310 /* JSDocClassTag */: + case 311 /* JSDocClassTag */: return bindJSDocClassTag(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return bindFunctionExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: var assignmentKind = ts.getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7 /* ObjectDefinePropertyValue */: @@ -32658,65 +32781,65 @@ var ts; } break; // Members of classes, interfaces, and modules - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return bindJsxAttributes(node); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 253 /* ImportEqualsDeclaration */: - case 256 /* NamespaceImport */: - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 254 /* ImportEqualsDeclaration */: + case 257 /* NamespaceImport */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return bindImportClause(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return bindExportDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return bindExportAssignment(node); - case 290 /* SourceFile */: + case 291 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 223 /* Block */: + case 224 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } // falls through - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 317 /* JSDocParameterTag */: - if (node.parent.kind === 305 /* JSDocSignature */) { + case 318 /* JSDocParameterTag */: + if (node.parent.kind === 306 /* JSDocSignature */) { return bindParameter(node); } - if (node.parent.kind !== 304 /* JSDocTypeLiteral */) { + if (node.parent.kind !== 305 /* JSDocTypeLiteral */) { break; } // falls through - case 323 /* JSDocPropertyTag */: + case 324 /* JSDocPropertyTag */: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 299 /* JSDocOptionalType */ ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 300 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); } } @@ -32872,8 +32995,8 @@ var ts; } var thisContainer = ts.getThisContainer(node, /*includeArrowFunctions*/ false); switch (thisContainer.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: var constructorSymbol = thisContainer.symbol; // For `f.prototype.m = function() { this.x = 0; }`, `this.x = 0` should modify `f`'s members, not the function expression. if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -32895,11 +33018,11 @@ var ts; addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */); } break; - case 162 /* Constructor */: - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 163 /* Constructor */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // this.foo assignment in a JavaScript class // Bind this property to the containing class var containingClass = thisContainer.parent; @@ -32911,7 +33034,7 @@ var ts; declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, /*isReplaceableByMethod*/ true); } break; - case 290 /* SourceFile */: + case 291 /* SourceFile */: // this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script if (ts.hasDynamicName(node)) { break; @@ -32941,7 +33064,7 @@ var ts; if (node.expression.kind === 104 /* ThisKeyword */) { bindThisPropertyAssignment(node); } - else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 290 /* SourceFile */) { + else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 291 /* SourceFile */) { if (ts.isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } @@ -32981,7 +33104,7 @@ var ts; } function bindObjectDefinePropertyAssignment(node) { var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - var isToplevel = node.parent.parent.kind === 290 /* SourceFile */; + var isToplevel = node.parent.parent.kind === 291 /* SourceFile */; namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, /*isPrototypeProperty*/ false, /*containerIsClass*/ false); bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, /*isPrototypeProperty*/ false); } @@ -33083,8 +33206,8 @@ var ts; } function isTopLevelNamespaceAssignment(propertyAccess) { return ts.isBinaryExpression(propertyAccess.parent) - ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 290 /* SourceFile */ - : propertyAccess.parent.parent.kind === 290 /* SourceFile */; + ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 291 /* SourceFile */ + : propertyAccess.parent.parent.kind === 291 /* SourceFile */; } function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { var namespaceSymbol = lookupSymbolForPropertyAccess(name); @@ -33163,7 +33286,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 245 /* ClassDeclaration */) { + if (node.kind === 246 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */); } else { @@ -33226,7 +33349,7 @@ var ts; } } function bindParameter(node) { - if (node.kind === 317 /* JSDocParameterTag */ && container.kind !== 305 /* JSDocSignature */) { + if (node.kind === 318 /* JSDocParameterTag */ && container.kind !== 306 /* JSDocSignature */) { return; } if (inStrictMode && !(node.flags & 8388608 /* Ambient */)) { @@ -33303,7 +33426,7 @@ var ts; declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); } } - else if (node.parent.kind === 181 /* InferType */) { + else if (node.parent.kind === 182 /* InferType */) { var container_2 = getInferTypeContainer(node.parent); if (container_2) { if (!container_2.locals) { @@ -33331,11 +33454,11 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 224 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 225 /* EmptyStatement */) || // report error on class declarations - node.kind === 245 /* ClassDeclaration */ || + node.kind === 246 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 249 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); + (node.kind === 250 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); if (reportError) { currentFlow = reportedUnreachableFlow; if (!options.allowUnreachableCode) { @@ -33379,12 +33502,12 @@ var ts; } function isPurelyTypeDeclaration(s) { switch (s.kind) { - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: return true; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return getModuleInstanceState(s) !== 1 /* Instantiated */; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return ts.hasModifier(s, 2048 /* Const */); default: return false; @@ -33433,58 +33556,58 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 196 /* CallExpression */: + case 197 /* CallExpression */: return computeCallExpression(node, subtreeFlags); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return computeNewExpression(node, subtreeFlags); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return computeModuleDeclaration(node, subtreeFlags); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return computeParenthesizedExpression(node, subtreeFlags); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return computeBinaryExpression(node, subtreeFlags); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return computeExpressionStatement(node, subtreeFlags); - case 156 /* Parameter */: + case 157 /* Parameter */: return computeParameter(node, subtreeFlags); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return computeArrowFunction(node, subtreeFlags); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return computeFunctionExpression(node, subtreeFlags); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return computeFunctionDeclaration(node, subtreeFlags); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return computeVariableDeclaration(node, subtreeFlags); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return computeVariableDeclarationList(node, subtreeFlags); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return computeVariableStatement(node, subtreeFlags); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return computeLabeledStatement(node, subtreeFlags); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return computeClassDeclaration(node, subtreeFlags); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return computeClassExpression(node, subtreeFlags); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: return computeHeritageClause(node, subtreeFlags); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return computeCatchClause(node, subtreeFlags); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 162 /* Constructor */: + case 163 /* Constructor */: return computeConstructor(node, subtreeFlags); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return computePropertyDeclaration(node, subtreeFlags); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return computeMethod(node, subtreeFlags); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return computeAccessor(node, subtreeFlags); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return computeImportEquals(node, subtreeFlags); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return computePropertyAccess(node, subtreeFlags); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return computeElementAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); @@ -33535,12 +33658,12 @@ var ts; if (operatorTokenKind === 60 /* QuestionQuestionToken */) { transformFlags |= 8 /* AssertES2020 */; } - else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 193 /* ObjectLiteralExpression */) { + else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 194 /* ObjectLiteralExpression */) { // Destructuring object assignments with are ES2015 syntax // and possibly ES2018 if they contain rest transformFlags |= 32 /* AssertES2018 */ | 256 /* AssertES2015 */ | 1024 /* AssertDestructuringAssignment */; } - else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 192 /* ArrayLiteralExpression */) { + else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 193 /* ArrayLiteralExpression */) { // Destructuring assignments are ES2015 syntax. transformFlags |= 256 /* AssertES2015 */ | 1024 /* AssertDestructuringAssignment */; } @@ -33588,8 +33711,8 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (expressionKind === 217 /* AsExpression */ - || expressionKind === 199 /* TypeAssertionExpression */) { + if (expressionKind === 218 /* AsExpression */ + || expressionKind === 200 /* TypeAssertionExpression */) { transformFlags |= 1 /* AssertTypeScript */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; @@ -33937,13 +34060,13 @@ var ts; // async is ES2017 syntax, but may be ES2018 syntax (for async generators) transformFlags |= 32 /* AssertES2018 */ | 64 /* AssertES2017 */; break; - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: // await is ES2017 syntax, but may be ES2018 syntax (for async generators) transformFlags |= 32 /* AssertES2018 */ | 64 /* AssertES2017 */ | 524288 /* ContainsAwait */; break; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: - case 326 /* PartiallyEmittedExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: + case 327 /* PartiallyEmittedExpression */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; excludeFlags = 536870912 /* OuterExpressionExcludes */; @@ -33952,27 +34075,27 @@ var ts; case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 122 /* AbstractKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 81 /* ConstKeyword */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 218 /* NonNullExpression */: - case 138 /* ReadonlyKeyword */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 219 /* NonNullExpression */: + case 139 /* ReadonlyKeyword */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; break; - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: case 11 /* JsxText */: - case 269 /* JsxClosingElement */: - case 270 /* JsxFragment */: - case 271 /* JsxOpeningFragment */: - case 272 /* JsxClosingFragment */: - case 273 /* JsxAttribute */: - case 274 /* JsxAttributes */: - case 275 /* JsxSpreadAttribute */: - case 276 /* JsxExpression */: + case 270 /* JsxClosingElement */: + case 271 /* JsxFragment */: + case 272 /* JsxOpeningFragment */: + case 273 /* JsxClosingFragment */: + case 274 /* JsxAttribute */: + case 275 /* JsxAttributes */: + case 276 /* JsxSpreadAttribute */: + case 277 /* JsxExpression */: // These nodes are Jsx syntax. transformFlags |= 2 /* AssertJsx */; break; @@ -33985,16 +34108,16 @@ var ts; break; } // falls through - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: if (ts.hasInvalidEscape(node.template)) { transformFlags |= 32 /* AssertES2018 */; break; } // falls through - case 211 /* TemplateExpression */: - case 282 /* ShorthandPropertyAssignment */: + case 212 /* TemplateExpression */: + case 283 /* ShorthandPropertyAssignment */: case 120 /* StaticKeyword */: - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: // These nodes are ES6 syntax. transformFlags |= 256 /* AssertES2015 */; break; @@ -34011,70 +34134,70 @@ var ts; case 9 /* BigIntLiteral */: transformFlags |= 4 /* AssertESNext */; break; - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: // This node is either ES2015 syntax or ES2017 syntax (if it is a for-await-of). if (node.awaitModifier) { transformFlags |= 32 /* AssertES2018 */; } transformFlags |= 256 /* AssertES2015 */; break; - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: // This node is either ES2015 syntax (in a generator) or ES2017 syntax (in an async // generator). transformFlags |= 32 /* AssertES2018 */ | 256 /* AssertES2015 */ | 262144 /* ContainsYield */; break; case 125 /* AnyKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 137 /* NeverKeyword */: - case 141 /* ObjectKeyword */: - case 143 /* StringKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 138 /* NeverKeyword */: + case 142 /* ObjectKeyword */: + case 144 /* StringKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: case 110 /* VoidKeyword */: - case 155 /* TypeParameter */: - case 158 /* PropertySignature */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 168 /* TypePredicate */: - case 169 /* TypeReference */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 172 /* TypeQuery */: - case 173 /* TypeLiteral */: - case 174 /* ArrayType */: - case 175 /* TupleType */: - case 176 /* OptionalType */: - case 177 /* RestType */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 180 /* ConditionalType */: - case 181 /* InferType */: - case 182 /* ParenthesizedType */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 183 /* ThisType */: - case 184 /* TypeOperator */: - case 185 /* IndexedAccessType */: - case 186 /* MappedType */: - case 187 /* LiteralType */: - case 252 /* NamespaceExportDeclaration */: + case 156 /* TypeParameter */: + case 159 /* PropertySignature */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 169 /* TypePredicate */: + case 170 /* TypeReference */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 173 /* TypeQuery */: + case 174 /* TypeLiteral */: + case 175 /* ArrayType */: + case 176 /* TupleType */: + case 177 /* OptionalType */: + case 178 /* RestType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 181 /* ConditionalType */: + case 182 /* InferType */: + case 183 /* ParenthesizedType */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 184 /* ThisType */: + case 185 /* TypeOperator */: + case 186 /* IndexedAccessType */: + case 187 /* MappedType */: + case 188 /* LiteralType */: + case 253 /* NamespaceExportDeclaration */: // Types and signatures are TypeScript syntax, and exclude all other facts. transformFlags = 1 /* AssertTypeScript */; excludeFlags = -2 /* TypeExcludes */; break; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: // Even though computed property names are ES6, we don't treat them as such. // This is so that they can flow through PropertyName transforms unaffected. // Instead, we mark the container as ES6, so that it can properly handle the transform. transformFlags |= 32768 /* ContainsComputedPropertyName */; break; - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: transformFlags |= 256 /* AssertES2015 */ | 8192 /* ContainsRestOrSpread */; break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: transformFlags |= 32 /* AssertES2018 */ | 16384 /* ContainsObjectRestOrSpread */; break; case 102 /* SuperKeyword */: @@ -34086,28 +34209,28 @@ var ts; // Mark this node and its ancestors as containing a lexical `this` keyword. transformFlags |= 4096 /* ContainsLexicalThis */; break; - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: transformFlags |= 256 /* AssertES2015 */ | 131072 /* ContainsBindingPattern */; if (subtreeFlags & 8192 /* ContainsRestOrSpread */) { transformFlags |= 32 /* AssertES2018 */ | 16384 /* ContainsObjectRestOrSpread */; } excludeFlags = 536879104 /* BindingPatternExcludes */; break; - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: transformFlags |= 256 /* AssertES2015 */ | 131072 /* ContainsBindingPattern */; excludeFlags = 536879104 /* BindingPatternExcludes */; break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: transformFlags |= 256 /* AssertES2015 */; if (node.dotDotDotToken) { transformFlags |= 8192 /* ContainsRestOrSpread */; } break; - case 157 /* Decorator */: + case 158 /* Decorator */: // This node is TypeScript syntax, and marks its container as also being TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */ | 2048 /* ContainsTypeScriptClassSyntax */; break; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: excludeFlags = 536922112 /* ObjectLiteralExcludes */; if (subtreeFlags & 32768 /* ContainsComputedPropertyName */) { // If an ObjectLiteralExpression contains a ComputedPropertyName, then it @@ -34120,29 +34243,29 @@ var ts; transformFlags |= 32 /* AssertES2018 */; } break; - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: excludeFlags = 536879104 /* ArrayLiteralOrCallOrNewExcludes */; break; - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: // A loop containing a block scoped binding *may* need to be transformed from ES6. if (subtreeFlags & 65536 /* ContainsBlockScopedBinding */) { transformFlags |= 256 /* AssertES2015 */; } break; - case 290 /* SourceFile */: + case 291 /* SourceFile */: break; - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: transformFlags |= 4 /* AssertESNext */; break; - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: // Return statements may require an `await` in ES2018. transformFlags |= 1048576 /* ContainsHoistedDeclarationOrCompletion */ | 32 /* AssertES2018 */; break; - case 233 /* ContinueStatement */: - case 234 /* BreakStatement */: + case 234 /* ContinueStatement */: + case 235 /* BreakStatement */: transformFlags |= 1048576 /* ContainsHoistedDeclarationOrCompletion */; break; case 76 /* PrivateIdentifier */: @@ -34163,67 +34286,67 @@ var ts; * than calling this function. */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 168 /* FirstTypeNode */ && kind <= 188 /* LastTypeNode */) { + if (kind >= 169 /* FirstTypeNode */ && kind <= 189 /* LastTypeNode */) { return -2 /* TypeExcludes */; } switch (kind) { - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 192 /* ArrayLiteralExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 193 /* ArrayLiteralExpression */: return 536879104 /* ArrayLiteralOrCallOrNewExcludes */; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return 537991168 /* ModuleExcludes */; - case 156 /* Parameter */: + case 157 /* Parameter */: return 536870912 /* ParameterExcludes */; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return 538920960 /* ArrowFunctionExcludes */; - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: return 538925056 /* FunctionExcludes */; - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return 537018368 /* VariableDeclarationListExcludes */; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return 536905728 /* ClassExcludes */; - case 162 /* Constructor */: + case 163 /* Constructor */: return 538923008 /* ConstructorExcludes */; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return 538923008 /* MethodOrAccessorExcludes */; case 125 /* AnyKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 137 /* NeverKeyword */: - case 143 /* StringKeyword */: - case 141 /* ObjectKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 138 /* NeverKeyword */: + case 144 /* StringKeyword */: + case 142 /* ObjectKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: case 110 /* VoidKeyword */: - case 155 /* TypeParameter */: - case 158 /* PropertySignature */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 156 /* TypeParameter */: + case 159 /* PropertySignature */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: return -2 /* TypeExcludes */; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return 536922112 /* ObjectLiteralExcludes */; - case 280 /* CatchClause */: + case 281 /* CatchClause */: return 536887296 /* CatchClauseExcludes */; - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: return 536879104 /* BindingPatternExcludes */; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: - case 326 /* PartiallyEmittedExpression */: - case 200 /* ParenthesizedExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: + case 327 /* PartiallyEmittedExpression */: + case 201 /* ParenthesizedExpression */: case 102 /* SuperKeyword */: return 536870912 /* OuterExpressionExcludes */; - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return 536870912 /* PropertyAccessExcludes */; default: return 536870912 /* NodeExcludes */; @@ -34398,7 +34521,7 @@ var ts; // (their type resolved directly to the member deeply referenced) // So to get the intervening symbols, we need to check if there's a type // query node on any of the symbol's declarations and get symbols there - if (d.type && d.type.kind === 172 /* TypeQuery */) { + if (d.type && d.type.kind === 173 /* TypeQuery */) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -34584,6 +34707,7 @@ var ts; IntersectionState[IntersectionState["None"] = 0] = "None"; IntersectionState[IntersectionState["Source"] = 1] = "Source"; IntersectionState[IntersectionState["Target"] = 2] = "Target"; + IntersectionState[IntersectionState["ExcessCheck"] = 4] = "ExcessCheck"; })(IntersectionState || (IntersectionState = {})); var MappedTypeModifiers; (function (MappedTypeModifiers) { @@ -34626,6 +34750,11 @@ var ts; DeclarationSpaces[DeclarationSpaces["ExportType"] = 2] = "ExportType"; DeclarationSpaces[DeclarationSpaces["ExportNamespace"] = 4] = "ExportNamespace"; })(DeclarationSpaces || (DeclarationSpaces = {})); + function SymbolLinks() { + } + function NodeLinks() { + this.flags = 0; + } function getNodeId(node) { if (!node.id) { node.id = nextNodeId; @@ -34685,7 +34814,6 @@ var ts; var constraintDepth = 0; var currentNode; var emptySymbols = ts.createSymbolTable(); - var identityMapper = ts.identity; var arrayVariances = [1 /* Covariant */]; var compilerOptions = host.getCompilerOptions(); var languageVersion = ts.getEmitScriptTarget(compilerOptions); @@ -35035,6 +35163,7 @@ var ts; var literalTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); var substitutionTypes = ts.createMap(); + var awaitedTypes = ts.createMap(); var evolvingArrayTypes = []; var undefinedProperties = ts.createMap(); var unknownSymbol = createSymbol(4 /* Property */, "unknown"); @@ -35082,6 +35211,8 @@ var ts; var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); var keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; var numberOrBigIntType = getUnionType([numberType, bigintType]); + var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t; }); + var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? wildcardType : t; }); var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var emptyJsxObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); emptyJsxObjectType.objectFlags |= 4096 /* JsxAttributes */; @@ -35591,14 +35722,14 @@ var ts; if (symbol.flags & 33554432 /* Transient */) return symbol; var id = getSymbolId(symbol); - return symbolLinks[id] || (symbolLinks[id] = {}); + return symbolLinks[id] || (symbolLinks[id] = new SymbolLinks()); } function getNodeLinks(node) { var nodeId = getNodeId(node); - return nodeLinks[nodeId] || (nodeLinks[nodeId] = { flags: 0 }); + return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); } function isGlobalSourceFile(node) { - return node.kind === 290 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 291 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -35656,17 +35787,17 @@ var ts; } if (declaration.pos <= usage.pos) { // declaration is before usage - if (declaration.kind === 191 /* BindingElement */) { + if (declaration.kind === 192 /* BindingElement */) { // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) - var errorBindingElement = ts.getAncestor(usage, 191 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 192 /* BindingElement */); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 242 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 243 /* VariableDeclaration */), usage); } - else if (declaration.kind === 242 /* VariableDeclaration */) { + else if (declaration.kind === 243 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } @@ -35697,12 +35828,12 @@ var ts; // or if usage is in a type context: // 1. inside a type query (typeof in type position) // 2. inside a jsdoc comment - if (usage.parent.kind === 263 /* ExportSpecifier */ || (usage.parent.kind === 259 /* ExportAssignment */ && usage.parent.isExportEquals)) { + if (usage.parent.kind === 264 /* ExportSpecifier */ || (usage.parent.kind === 260 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } // When resolving symbols for exports, the `usage` location passed in can be the export site directly - if (usage.kind === 259 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 260 /* ExportAssignment */ && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -35722,9 +35853,9 @@ var ts; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 225 /* VariableStatement */: - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: + case 226 /* VariableStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, container)) { @@ -35745,16 +35876,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 159 /* PropertyDeclaration */ && + current.parent.kind === 160 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasModifier(current.parent, 32 /* Static */)) { - if (declaration.kind === 161 /* MethodDeclaration */) { + if (declaration.kind === 162 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -35776,19 +35907,19 @@ var ts; return "quit"; } switch (node.kind) { - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return true; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // even when stopping at any property declaration, they need to come from the same class return stopAtAnyPropertyDeclaration && (ts.isPropertyDeclaration(declaration) && node.parent === declaration.parent || ts.isParameterPropertyDeclaration(declaration, declaration.parent) && node.parent === declaration.parent.parent) ? "quit" : true; - case 223 /* Block */: + case 224 /* Block */: switch (node.parent.kind) { - case 163 /* GetAccessor */: - case 161 /* MethodDeclaration */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 162 /* MethodDeclaration */: + case 165 /* SetAccessor */: return true; default: return false; @@ -35834,12 +35965,12 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 303 /* JSDocComment */) { + if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 304 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === location.type || - lastLocation.kind === 156 /* Parameter */ || - lastLocation.kind === 155 /* TypeParameter */ + lastLocation.kind === 157 /* Parameter */ || + lastLocation.kind === 156 /* TypeParameter */ // local types not visible outside the function body : false; } @@ -35856,13 +35987,13 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 156 /* Parameter */ || + lastLocation.kind === 157 /* Parameter */ || (lastLocation === location.type && !!ts.findAncestor(result.valueDeclaration, ts.isParameter)); } } } - else if (location.kind === 180 /* ConditionalType */) { + else if (location.kind === 181 /* ConditionalType */) { // A type parameter declared using 'infer T' in a conditional type is visible only in // the true branch of the conditional type. useResult = lastLocation === location.trueType; @@ -35877,14 +36008,14 @@ var ts; } withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; // falls through - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports || emptySymbols; - if (location.kind === 290 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { + if (location.kind === 291 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. if (result = moduleExports.get("default" /* Default */)) { @@ -35908,7 +36039,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && - (ts.getDeclarationOfKind(moduleExport, 263 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 262 /* NamespaceExport */))) { + (ts.getDeclarationOfKind(moduleExport, 264 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 263 /* NamespaceExport */))) { break; } } @@ -35922,12 +36053,12 @@ var ts; } } break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -35944,9 +36075,9 @@ var ts; } } break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: // The below is used to lookup type parameters within a class or interface, as they are added to the class/interface locals // These can never be latebound, so the symbol's raw members are sufficient. `getMembersOfNode` cannot be used, as it would // trigger resolving late-bound names, which we may already be in the process of doing while we're here! @@ -35965,7 +36096,7 @@ var ts; } break loop; } - if (location.kind === 214 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 215 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -35973,7 +36104,7 @@ var ts; } } break; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: // The type parameters of a class are not in scope in the base class expression. if (lastLocation === location.expression && location.parent.token === 90 /* ExtendsKeyword */) { var container = location.parent.parent; @@ -35993,9 +36124,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 246 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 247 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -36003,24 +36134,24 @@ var ts; } } break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: // when targeting ES6 or higher there is no 'arguments' in an arrow function // for lower compile targets the resolved symbol is used to emit an error if (compilerOptions.target >= 2 /* ES2015 */) { break; } // falls through - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -36033,7 +36164,7 @@ var ts; } } break; - case 157 /* Decorator */: + case 158 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -36042,7 +36173,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 156 /* Parameter */) { + if (location.parent && location.parent.kind === 157 /* Parameter */) { location = location.parent; } // @@ -36057,25 +36188,25 @@ var ts; // declare function y(x: T): any; // @param(1 as T) // <-- T should resolve to the type alias outside of class C // class C {} - if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 245 /* ClassDeclaration */)) { + if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 246 /* ClassDeclaration */)) { location = location.parent; } break; - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: // js type aliases do not resolve names from their host, so skip past it location = ts.getJSDocHost(location); break; - case 156 /* Parameter */: + case 157 /* Parameter */: if (lastLocation && lastLocation === location.initializer) { associatedDeclarationForContainingInitializer = location; } break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: if (lastLocation && lastLocation === location.initializer) { var root = ts.getRootDeclaration(location); - if (root.kind === 156 /* Parameter */) { + if (root.kind === 157 /* Parameter */) { associatedDeclarationForContainingInitializer = location; } } @@ -36095,7 +36226,7 @@ var ts; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 290 /* SourceFile */); + ts.Debug.assert(lastLocation.kind === 291 /* SourceFile */); if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) { return lastLocation.symbol; } @@ -36212,10 +36343,10 @@ var ts; } } function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 202 /* ArrowFunction */ && location.kind !== 201 /* FunctionExpression */) { + if (location.kind !== 203 /* ArrowFunction */ && location.kind !== 202 /* FunctionExpression */) { // initializers in instance property declaration of class like entities are executed in constructor and thus deferred return ts.isTypeQueryNode(location) || ((ts.isFunctionLikeDeclaration(location) || - (location.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred + (location.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred } if (lastLocation && lastLocation === location.name) { return false; @@ -36228,12 +36359,12 @@ var ts; } function isSelfReferenceLocation(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 249 /* ModuleDeclaration */: // For `namespace N { N; }` + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 250 /* ModuleDeclaration */: // For `namespace N { N; }` return true; default: return false; @@ -36245,7 +36376,7 @@ var ts; function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 155 /* TypeParameter */) { + if (decl.kind === 156 /* TypeParameter */) { var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent; if (parent === container) { return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias)); // TODO: GH#18217 @@ -36301,9 +36432,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 75 /* Identifier */: - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -36337,7 +36468,7 @@ var ts; if (meaning & (788968 /* Type */ & ~1920 /* Namespace */)) { var symbol = resolveSymbol(resolveName(errorLocation, name, ~788968 /* Type */ & 111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); if (symbol && !(symbol.flags & 1920 /* Namespace */)) { - error(errorLocation, ts.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here, ts.unescapeLeadingUnderscores(name)); + error(errorLocation, ts.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0, ts.unescapeLeadingUnderscores(name)); return true; } } @@ -36347,7 +36478,7 @@ var ts; return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; } function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 263 /* ExportSpecifier */) { + if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 264 /* ExportSpecifier */) { error(errorLocation, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); return true; } @@ -36406,7 +36537,7 @@ var ts; return; } // Block-scoped variables cannot be used before their definition - var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 248 /* EnumDeclaration */); }); + var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 249 /* EnumDeclaration */); }); if (declaration === undefined) return ts.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); if (!(declaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { @@ -36441,13 +36572,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return node; - case 255 /* ImportClause */: + case 256 /* ImportClause */: return node.parent; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return node.parent.parent; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return node.parent.parent.parent; default: return undefined; @@ -36471,28 +36602,28 @@ var ts; * {name: } */ function isAliasSymbolDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */ || - node.kind === 252 /* NamespaceExportDeclaration */ || - node.kind === 255 /* ImportClause */ && !!node.name || - node.kind === 256 /* NamespaceImport */ || - node.kind === 262 /* NamespaceExport */ || - node.kind === 258 /* ImportSpecifier */ || - node.kind === 263 /* ExportSpecifier */ || - node.kind === 259 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || + return node.kind === 254 /* ImportEqualsDeclaration */ || + node.kind === 253 /* NamespaceExportDeclaration */ || + node.kind === 256 /* ImportClause */ && !!node.name || + node.kind === 257 /* NamespaceImport */ || + node.kind === 263 /* NamespaceExport */ || + node.kind === 259 /* ImportSpecifier */ || + node.kind === 264 /* ExportSpecifier */ || + node.kind === 260 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || - node.kind === 282 /* ShorthandPropertyAssignment */ || - node.kind === 281 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); + node.kind === 283 /* ShorthandPropertyAssignment */ || + node.kind === 282 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); } function isAliasableOrJsExpression(e) { return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - if (node.moduleReference.kind === 265 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 266 /* ExternalModuleReference */) { var immediate = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var resolved_4 = resolveExternalModuleSymbol(immediate); markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved_4, /*overwriteEmpty*/ false); @@ -36793,28 +36924,28 @@ var ts; function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; } switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 259 /* ExportAssignment */: - case 209 /* BinaryExpression */: + case 260 /* ExportAssignment */: + case 210 /* BinaryExpression */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ true, dontRecursivelyResolve); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return getTargetOfPropertyAssignment(node, dontRecursivelyResolve); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve); default: return ts.Debug.fail(); @@ -36854,6 +36985,13 @@ var ts; } return links.target; } + function tryResolveAlias(symbol) { + var links = getSymbolLinks(symbol); + if (links.target !== resolvingSymbol) { + return resolveAlias(symbol); + } + return undefined; + } /** * Marks a symbol as type-only if its declaration is syntactically type-only. * If it is not itself marked type-only, but resolves to a type-only alias @@ -36959,13 +37097,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 75 /* Identifier */ || entityName.parent.kind === 153 /* QualifiedName */) { + if (entityName.kind === 75 /* Identifier */ || entityName.parent.kind === 154 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 253 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 254 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } @@ -36989,9 +37127,9 @@ var ts; return symbolFromJSPrototype; } } - else if (name.kind === 153 /* QualifiedName */ || name.kind === 194 /* PropertyAccessExpression */) { - var left = name.kind === 153 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 153 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 154 /* QualifiedName */ || name.kind === 195 /* PropertyAccessExpression */) { + var left = name.kind === 154 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 154 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -37026,7 +37164,7 @@ var ts; throw ts.Debug.assertNever(name, "Unknown entity name kind."); } ts.Debug.assert((ts.getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 259 /* ExportAssignment */)) { + if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 260 /* ExportAssignment */)) { markSymbolOfAliasDeclarationIfTypeOnly(ts.getAliasDeclarationFromName(name), symbol, /*finalTarget*/ undefined, /*overwriteEmpty*/ true); } return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); @@ -37105,7 +37243,7 @@ var ts; } } function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) { - return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : ts.Diagnostics.Cannot_find_module_0); + return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : ts.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations); } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } @@ -37248,7 +37386,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 290 /* SourceFile */)) { + if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 291 /* SourceFile */)) { var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; @@ -37535,7 +37673,7 @@ var ts; var members = node.members; for (var _i = 0, members_3 = members; _i < members_3.length; _i++) { var member = members_3[_i]; - if (member.kind === 162 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 163 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -37622,12 +37760,12 @@ var ts; } } switch (location.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } // falls through - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: var sym = getSymbolOfNode(location); // `sym` may not have exports if this module declaration is backed by the symbol for a `const` that's being rewritten // into a namespace - in such cases, it's best to just let the namespace appear empty (the const members couldn't have referred @@ -37636,9 +37774,9 @@ var ts; return { value: result }; } break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: // Type parameters are bound into `members` lists so they can merge across declarations // This is troublesome, since in all other respects, they behave like locals :cries: // TODO: the below is shared with similar code in `resolveName` - in fact, rephrasing all this symbol @@ -37721,7 +37859,7 @@ var ts; && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) // While exports are generally considered to be in scope, export-specifier declared symbols are _not_ // See similar comment in `resolveName` for details - && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 263 /* ExportSpecifier */))) { + && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 264 /* ExportSpecifier */))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); var candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); if (candidate) { @@ -37765,7 +37903,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 263 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 264 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -37780,10 +37918,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: continue; default: return false; @@ -37914,10 +38052,10 @@ var ts; return node && getSymbolOfNode(node); } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -37964,14 +38102,14 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 172 /* TypeQuery */ || + if (entityName.parent.kind === 173 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 154 /* ComputedPropertyName */) { + entityName.parent.kind === 155 /* ComputedPropertyName */) { // Typeof value meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 153 /* QualifiedName */ || entityName.kind === 194 /* PropertyAccessExpression */ || - entityName.parent.kind === 253 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 154 /* QualifiedName */ || entityName.kind === 195 /* PropertyAccessExpression */ || + entityName.parent.kind === 254 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -38020,10 +38158,10 @@ var ts; function signatureToStringWorker(writer) { var sigOutput; if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 171 /* ConstructorType */ : 170 /* FunctionType */; + sigOutput = kind === 1 /* Construct */ ? 172 /* ConstructorType */ : 171 /* FunctionType */; } else { - sigOutput = kind === 1 /* Construct */ ? 166 /* ConstructSignature */ : 165 /* CallSignature */; + sigOutput = kind === 1 /* Construct */ ? 167 /* ConstructSignature */ : 166 /* CallSignature */; } var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); @@ -38107,6 +38245,7 @@ var ts; getSourceFiles: function () { return host.getSourceFiles(); }, getCurrentDirectory: ts.maybeBind(host, host.getCurrentDirectory), getProbableSymlinks: ts.maybeBind(host, host.getProbableSymlinks), + useCaseSensitiveFileNames: ts.maybeBind(host, host.useCaseSensitiveFileNames) } : undefined }, encounteredError: false, visitedTypes: undefined, @@ -38138,23 +38277,23 @@ var ts; return ts.createKeywordTypeNode(125 /* AnyKeyword */); } if (type.flags & 2 /* Unknown */) { - return ts.createKeywordTypeNode(148 /* UnknownKeyword */); + return ts.createKeywordTypeNode(149 /* UnknownKeyword */); } if (type.flags & 4 /* String */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(143 /* StringKeyword */); + return ts.createKeywordTypeNode(144 /* StringKeyword */); } if (type.flags & 8 /* Number */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(140 /* NumberKeyword */); + return ts.createKeywordTypeNode(141 /* NumberKeyword */); } if (type.flags & 64 /* BigInt */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(151 /* BigIntKeyword */); + return ts.createKeywordTypeNode(152 /* BigIntKeyword */); } if (type.flags & 16 /* Boolean */) { context.approximateLength += 7; - return ts.createKeywordTypeNode(128 /* BooleanKeyword */); + return ts.createKeywordTypeNode(129 /* BooleanKeyword */); } if (type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */)) { var parentSymbol = getParentOfSymbol(type.symbol); @@ -38195,7 +38334,7 @@ var ts; } } context.approximateLength += 13; - return ts.createTypeOperatorNode(147 /* UniqueKeyword */, ts.createKeywordTypeNode(144 /* SymbolKeyword */)); + return ts.createTypeOperatorNode(148 /* UniqueKeyword */, ts.createKeywordTypeNode(145 /* SymbolKeyword */)); } if (type.flags & 16384 /* Void */) { context.approximateLength += 4; @@ -38203,7 +38342,7 @@ var ts; } if (type.flags & 32768 /* Undefined */) { context.approximateLength += 9; - return ts.createKeywordTypeNode(146 /* UndefinedKeyword */); + return ts.createKeywordTypeNode(147 /* UndefinedKeyword */); } if (type.flags & 65536 /* Null */) { context.approximateLength += 4; @@ -38211,15 +38350,15 @@ var ts; } if (type.flags & 131072 /* Never */) { context.approximateLength += 5; - return ts.createKeywordTypeNode(137 /* NeverKeyword */); + return ts.createKeywordTypeNode(138 /* NeverKeyword */); } if (type.flags & 4096 /* ESSymbol */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(144 /* SymbolKeyword */); + return ts.createKeywordTypeNode(145 /* SymbolKeyword */); } if (type.flags & 67108864 /* NonPrimitive */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(141 /* ObjectKeyword */); + return ts.createKeywordTypeNode(142 /* ObjectKeyword */); } if (isThisTypeParameter(type)) { if (context.flags & 4194304 /* InObjectTypeLiteral */) { @@ -38268,7 +38407,7 @@ var ts; } var typeNodes = mapToTypeNodes(types, context, /*isBareList*/ true); if (typeNodes && typeNodes.length > 0) { - var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 178 /* UnionType */ : 179 /* IntersectionType */, typeNodes); + var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 179 /* UnionType */ : 180 /* IntersectionType */, typeNodes); return unionOrIntersectionTypeNode; } else { @@ -38295,6 +38434,11 @@ var ts; context.approximateLength += 2; return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); } + if (type.flags & 134217728 /* Awaited */) { + var awaitedTypeNode = typeToTypeNodeHelper(type.awaitedType, context); + context.approximateLength += 9; + return ts.createTypeOperatorNode(128 /* AwaitedKeyword */, awaitedTypeNode); + } if (type.flags & 16777216 /* Conditional */) { var checkTypeNode = typeToTypeNodeHelper(type.checkType, context); var saveInferTypeParameters = context.inferTypeParameters; @@ -38307,7 +38451,7 @@ var ts; return ts.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode); } if (type.flags & 33554432 /* Substitution */) { - return typeToTypeNodeHelper(type.typeVariable, context); + return typeToTypeNodeHelper(type.baseType, context); } return ts.Debug.fail("Should be unreachable."); function createMappedTypeNodeFromType(type) { @@ -38339,7 +38483,7 @@ var ts; return symbolToTypeNode(symbol, context, isInstanceType); } // Always use 'typeof T' for type of class, enum, and module objects - else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 214 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || + else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 215 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { return symbolToTypeNode(symbol, context, 111551 /* Value */); @@ -38369,7 +38513,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 290 /* SourceFile */ || declaration.parent.kind === 250 /* ModuleBlock */; + return declaration.parent.kind === 291 /* SourceFile */ || declaration.parent.kind === 251 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -38420,12 +38564,12 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 170 /* FunctionType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 171 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 171 /* ConstructorType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 172 /* ConstructorType */, context); return signatureNode; } } @@ -38446,7 +38590,7 @@ var ts; } var elementType = typeToTypeNodeHelper(typeArguments[0], context); var arrayType = ts.createArrayTypeNode(elementType); - return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, arrayType); + return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, arrayType); } else if (type.target.objectFlags & 8 /* Tuple */) { if (typeArguments.length > 0) { @@ -38460,12 +38604,12 @@ var ts; ts.createOptionalTypeNode(tupleConstituentNodes[i]); } var tupleTypeNode = ts.createTupleTypeNode(tupleConstituentNodes); - return type.target.readonly ? ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } } if (context.encounteredError || (context.flags & 524288 /* AllowEmptyTuple */)) { var tupleTypeNode = ts.createTupleTypeNode([]); - return type.target.readonly ? ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } context.encounteredError = true; return undefined; // TODO: GH#18217 @@ -38560,11 +38704,11 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 165 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 166 /* CallSignature */, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 166 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 167 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { var indexSignature = void 0; @@ -38641,7 +38785,7 @@ var ts; var signatures = getSignaturesOfType(filterType(propertyType, function (t) { return !(t.flags & 32768 /* Undefined */); }), 0 /* Call */); for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) { var signature = signatures_1[_i]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 160 /* MethodSignature */, context); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 161 /* MethodSignature */, context); methodDeclaration.name = propertyName; methodDeclaration.questionToken = optionalToken; typeElements.push(preserveCommentsOn(methodDeclaration)); @@ -38658,7 +38802,7 @@ var ts; propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(125 /* AnyKeyword */); } context.flags = savedFlags; - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(138 /* ReadonlyKeyword */)] : undefined; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(139 /* ReadonlyKeyword */)] : undefined; if (modifiers) { context.approximateLength += 9; } @@ -38667,8 +38811,8 @@ var ts; typeElements.push(preserveCommentsOn(propertySignature)); } function preserveCommentsOn(node) { - if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 323 /* JSDocPropertyTag */; })) { - var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 323 /* JSDocPropertyTag */; }); + if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 324 /* JSDocPropertyTag */; })) { + var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 324 /* JSDocPropertyTag */; }); var commentText = d.comment; if (commentText) { ts.setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); @@ -38719,7 +38863,7 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 143 /* StringKeyword */ : 140 /* NumberKeyword */); + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 144 /* StringKeyword */ : 141 /* NumberKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -38732,7 +38876,7 @@ var ts; } context.approximateLength += (name.length + 4); return ts.createIndexSignature( - /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(138 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(139 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context) { var suppressAny = context.flags & 256 /* SuppressAnyReturnType */; @@ -38746,7 +38890,7 @@ var ts; else { typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); } - var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 162 /* Constructor */); }); + var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 163 /* Constructor */); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); @@ -38790,9 +38934,9 @@ var ts; return typeParameterToDeclarationWithConstraint(type, context, constraintNode); } function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 156 /* Parameter */); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 157 /* Parameter */); if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) { - parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 317 /* JSDocParameterTag */); + parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 318 /* JSDocParameterTag */); } var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { @@ -38804,7 +38948,7 @@ var ts; var dotDotDotToken = isRest ? ts.createToken(25 /* DotDotDotToken */) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 75 /* Identifier */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : - parameterDeclaration.name.kind === 153 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : + parameterDeclaration.name.kind === 154 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : ts.symbolName(parameterSymbol) : ts.symbolName(parameterSymbol); @@ -38823,7 +38967,7 @@ var ts; } var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags); var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited); - if (clone.kind === 191 /* BindingElement */) { + if (clone.kind === 192 /* BindingElement */) { clone.initializer = undefined; } return ts.setEmitFlags(clone, 1 /* SingleLine */ | 16777216 /* NoAsciiEscaping */); @@ -38943,10 +39087,10 @@ var ts; var typeParameterNodes; if (context.flags & 512 /* WriteTypeParametersInQualifiedName */ && index < (chain.length - 1)) { var parentSymbol = symbol; - var nextSymbol = chain[index + 1]; - if (ts.getCheckFlags(nextSymbol) & 1 /* Instantiated */) { + var nextSymbol_1 = chain[index + 1]; + if (ts.getCheckFlags(nextSymbol_1) & 1 /* Instantiated */) { var params = getTypeParametersOfClassOrInterface(parentSymbol.flags & 2097152 /* Alias */ ? resolveAlias(parentSymbol) : parentSymbol); - typeParameterNodes = mapToTypeNodes(ts.map(params, nextSymbol.mapper), context); + typeParameterNodes = mapToTypeNodes(ts.map(params, function (t) { return getMappedType(t, nextSymbol_1.mapper); }), context); } else { typeParameterNodes = typeParametersToTypeParameterDeclarations(symbol, context); @@ -38964,7 +39108,7 @@ var ts; return top; } function getSpecifierForModuleSymbol(symbol, context) { - var file = ts.getDeclarationOfKind(symbol, 290 /* SourceFile */); + var file = ts.getDeclarationOfKind(symbol, 291 /* SourceFile */); if (file && file.moduleName !== undefined) { // Use the amd name if it is available return file.moduleName; @@ -39270,8 +39414,8 @@ var ts; return initial; } function symbolTableToDeclarationStatements(symbolTable, context, bundled) { - var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 161 /* MethodDeclaration */, /*useAcessors*/ true); - var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 160 /* MethodSignature */, /*useAcessors*/ false); + var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 162 /* MethodDeclaration */, /*useAcessors*/ true); + var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 161 /* MethodSignature */, /*useAcessors*/ false); // TODO: Use `setOriginalNode` on original declaration names where possible so these declarations see some kind of // declaration mapping // We save the enclosing declaration off here so it's not adjusted by well-meaning declaration @@ -39610,8 +39754,8 @@ var ts; var baseTypes = getBaseTypes(interfaceType); var baseType = ts.length(baseTypes) ? getIntersectionType(baseTypes) : undefined; var members = ts.flatMap(getPropertiesOfType(interfaceType), function (p) { return serializePropertySymbolForInterface(p, baseType); }); - var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 165 /* CallSignature */); - var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 166 /* ConstructSignature */); + var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 166 /* CallSignature */); + var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 167 /* ConstructSignature */); var indexSignatures = serializeIndexSignatures(interfaceType, baseType); var heritageClauses = !ts.length(baseTypes) ? undefined : [ts.createHeritageClause(90 /* ExtendsKeyword */, ts.mapDefined(baseTypes, function (b) { return trySerializeAsTypeReference(b); }))]; addResult(ts.createInterfaceDeclaration( @@ -39726,7 +39870,7 @@ var ts; for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { var sig = signatures_2[_i]; // Each overload becomes a separate function declaration, in order - var decl = signatureToSignatureDeclarationHelper(sig, 244 /* FunctionDeclaration */, context); + var decl = signatureToSignatureDeclarationHelper(sig, 245 /* FunctionDeclaration */, context); decl.name = ts.createIdentifier(localName); addResult(ts.setTextRange(decl, sig.declaration), modifierFlags); } @@ -39819,7 +39963,7 @@ var ts; var staticMembers = symbol.flags & (16 /* Function */ | 512 /* ValueModule */) ? [] : ts.flatMap(ts.filter(getPropertiesOfType(staticType), function (p) { return !(p.flags & 4194304 /* Prototype */) && p.escapedName !== "prototype"; }), function (p) { return serializePropertySymbolForClass(p, /*isStatic*/ true, staticBaseType); }); - var constructors = serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 162 /* Constructor */); + var constructors = serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 163 /* Constructor */); for (var _i = 0, constructors_1 = constructors; _i < constructors_1.length; _i++) { var c = constructors_1[_i]; // A constructor's return type and type parameters are supposed to be controlled by the enclosing class declaration @@ -39851,7 +39995,7 @@ var ts; var targetName = getInternalSymbolName(target, verbatimTargetName); includePrivateSymbol(target); // the target may be within the same scope - attempt to serialize it first switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // Could be a local `import localName = ns.member` or // an external `import localName = require("whatever")` var isLocalImport = !(target.flags & 512 /* ValueModule */); @@ -39861,13 +40005,13 @@ var ts; ? symbolToName(target, context, 67108863 /* All */, /*expectsIdentifier*/ false) : ts.createExternalModuleReference(ts.createLiteral(getSpecifierForModuleSymbol(symbol, context)))), isLocalImport ? modifierFlags : 0 /* None */); break; - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: // export as namespace foo // TODO: Not part of a file's local or export symbol tables // Is bound into file.symbol.globalExports instead, which we don't currently traverse addResult(ts.createNamespaceExportDeclaration(ts.idText(node.name)), 0 /* None */); break; - case 255 /* ImportClause */: + case 256 /* ImportClause */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(ts.createIdentifier(localName), /*namedBindings*/ undefined), @@ -39876,24 +40020,24 @@ var ts; // In such cases, the `target` refers to the module itself already ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*importClause*/ undefined, ts.createNamespaceImport(ts.createIdentifier(localName))), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: addResult(ts.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createNamespaceExport(ts.createIdentifier(localName)), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*importClause*/ undefined, ts.createNamedImports([ ts.createImportSpecifier(localName !== verbatimTargetName ? ts.createIdentifier(verbatimTargetName) : undefined, ts.createIdentifier(localName)) ])), ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: // does not use localName because the symbol name in this case refers to the name in the exports table, // which we must exactly preserve var specifier = node.parent.parent.moduleSpecifier; @@ -39901,11 +40045,11 @@ var ts; // another file serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), specifier ? verbatimTargetName : targetName, specifier && ts.isStringLiteralLike(specifier) ? ts.createLiteral(specifier.text) : undefined); break; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: serializeMaybeAliasAssignment(symbol); break; - case 209 /* BinaryExpression */: - case 194 /* PropertyAccessExpression */: + case 210 /* BinaryExpression */: + case 195 /* PropertyAccessExpression */: // Could be best encoded as though an export specifier or as though an export assignment // If name is default or export=, do an export assignment // Otherwise do an export specifier @@ -40125,17 +40269,18 @@ var ts; context.flags = oldFlags; return result; function visitExistingNodeTreeSymbols(node) { - if (ts.isJSDocAllType(node)) { + // We don't _actually_ support jsdoc namepath types, emit `any` instead + if (ts.isJSDocAllType(node) || node.kind === 303 /* JSDocNamepathType */) { return ts.createKeywordTypeNode(125 /* AnyKeyword */); } if (ts.isJSDocUnknownType(node)) { - return ts.createKeywordTypeNode(148 /* UnknownKeyword */); + return ts.createKeywordTypeNode(149 /* UnknownKeyword */); } if (ts.isJSDocNullableType(node)) { return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(100 /* NullKeyword */)]); } if (ts.isJSDocOptionalType(node)) { - return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(146 /* UndefinedKeyword */)]); + return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(147 /* UndefinedKeyword */)]); } if (ts.isJSDocNonNullableType(node)) { return ts.visitNode(node.type, visitExistingNodeTreeSymbols); @@ -40404,8 +40549,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { - var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 182 /* ParenthesizedType */; }); - if (node.kind === 247 /* TypeAliasDeclaration */) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 183 /* ParenthesizedType */; }); + if (node.kind === 248 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -40413,11 +40558,11 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 250 /* ModuleBlock */ && + node.parent.kind === 251 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 290 /* SourceFile */ || ts.isAmbientModule(location); + return location.kind === 291 /* SourceFile */ || ts.isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { var nameType = getSymbolLinks(symbol).nameType; @@ -40476,17 +40621,17 @@ var ts; if (!declaration) { declaration = symbol.declarations[0]; // Declaration may be nameless, but we'll try anyway } - if (declaration.parent && declaration.parent.kind === 242 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 243 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 214 /* ClassExpression */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 215 /* ClassExpression */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } - return declaration.kind === 214 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 215 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; } } var name = getNameOfSymbolFromNameType(symbol, context); @@ -40503,28 +40648,28 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: - case 316 /* JSDocEnumTag */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: + case 317 /* JSDocEnumTag */: // Top-level jsdoc type aliases are considered exported // First parent is comment node, second is hosting declaration or token; we only care about those tokens or declarations whose parent is a source file return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent)); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // falls through - case 249 /* ModuleDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 244 /* FunctionDeclaration */: - case 248 /* EnumDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 250 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 245 /* FunctionDeclaration */: + case 249 /* EnumDeclaration */: + case 254 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; @@ -40532,54 +40677,54 @@ var ts; var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 253 /* ImportEqualsDeclaration */ && parent.kind !== 290 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { + !(node.kind !== 254 /* ImportEqualsDeclaration */ && parent.kind !== 291 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent); - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.hasModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 162 /* Constructor */: - case 166 /* ConstructSignature */: - case 165 /* CallSignature */: - case 167 /* IndexSignature */: - case 156 /* Parameter */: - case 250 /* ModuleBlock */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 173 /* TypeLiteral */: - case 169 /* TypeReference */: - case 174 /* ArrayType */: - case 175 /* TupleType */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 182 /* ParenthesizedType */: + case 163 /* Constructor */: + case 167 /* ConstructSignature */: + case 166 /* CallSignature */: + case 168 /* IndexSignature */: + case 157 /* Parameter */: + case 251 /* ModuleBlock */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 174 /* TypeLiteral */: + case 170 /* TypeReference */: + case 175 /* ArrayType */: + case 176 /* TupleType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 183 /* ParenthesizedType */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 255 /* ImportClause */: - case 256 /* NamespaceImport */: - case 258 /* ImportSpecifier */: + case 256 /* ImportClause */: + case 257 /* NamespaceImport */: + case 259 /* ImportSpecifier */: return false; // Type parameters are always visible - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: // Source file and namespace export are always visible // falls through - case 290 /* SourceFile */: - case 252 /* NamespaceExportDeclaration */: + case 291 /* SourceFile */: + case 253 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return false; default: return false; @@ -40588,10 +40733,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 259 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 260 /* ExportAssignment */) { exportSymbol = resolveName(node, node.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); } - else if (node.parent.kind === 263 /* ExportSpecifier */) { + else if (node.parent.kind === 264 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } var result; @@ -40694,12 +40839,12 @@ var ts; function getDeclarationContainer(node) { return ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 242 /* VariableDeclaration */: - case 243 /* VariableDeclarationList */: - case 258 /* ImportSpecifier */: - case 257 /* NamedImports */: - case 256 /* NamespaceImport */: - case 255 /* ImportClause */: + case 243 /* VariableDeclaration */: + case 244 /* VariableDeclarationList */: + case 259 /* ImportSpecifier */: + case 258 /* NamedImports */: + case 257 /* NamespaceImport */: + case 256 /* ImportClause */: return false; default: return true; @@ -40732,7 +40877,7 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false); } function isComputedNonLiteralName(name) { - return name.kind === 154 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); + return name.kind === 155 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); } function getRestType(source, properties, symbol) { source = filterType(source, function (t) { return !(t.flags & 98304 /* Nullable */); }); @@ -40786,7 +40931,7 @@ var ts; if (parentAccess && parentAccess.flowNode) { var propName = getDestructuringPropertyName(node); if (propName) { - var result = ts.createNode(195 /* ElementAccessExpression */, node.pos, node.end); + var result = ts.createNode(196 /* ElementAccessExpression */, node.pos, node.end); result.parent = node; result.expression = parentAccess; var literal = ts.createNode(10 /* StringLiteral */, node.pos, node.end); @@ -40801,23 +40946,23 @@ var ts; function getParentElementAccess(node) { var ancestor = node.parent.parent; switch (ancestor.kind) { - case 191 /* BindingElement */: - case 281 /* PropertyAssignment */: + case 192 /* BindingElement */: + case 282 /* PropertyAssignment */: return getSyntheticElementAccess(ancestor); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return getSyntheticElementAccess(node.parent); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ancestor.initializer; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return ancestor.right; } } function getDestructuringPropertyName(node) { var parent = node.parent; - if (node.kind === 191 /* BindingElement */ && parent.kind === 189 /* ObjectBindingPattern */) { + if (node.kind === 192 /* BindingElement */ && parent.kind === 190 /* ObjectBindingPattern */) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 281 /* PropertyAssignment */ || node.kind === 282 /* ShorthandPropertyAssignment */) { + if (node.kind === 282 /* PropertyAssignment */ || node.kind === 283 /* ShorthandPropertyAssignment */) { return getLiteralPropertyNameText(node.name); } return "" + parent.elements.indexOf(node); @@ -40838,8 +40983,12 @@ var ts; if (strictNullChecks && declaration.flags & 8388608 /* Ambient */ && ts.isParameterDeclaration(declaration)) { parentType = getNonNullableType(parentType); } + // Filter `undefined` from the type we check against if the parent has an initializer (which handles the `undefined` case implicitly) + else if (strictNullChecks && pattern.parent.initializer) { + parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */); + } var type; - if (pattern.kind === 189 /* ObjectBindingPattern */) { + if (pattern.kind === 190 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { parentType = getReducedType(parentType); if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) { @@ -40912,7 +41061,7 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 192 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 193 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } @@ -40922,11 +41071,11 @@ var ts; function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 231 /* ForInStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForInStatement */) { var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression))); return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType; } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 233 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -40945,7 +41094,7 @@ var ts; return addOptionality(declaredType, isOptional); } if ((noImplicitAny || ts.isInJSFile(declaration)) && - declaration.kind === 242 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && + declaration.kind === 243 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1 /* Export */) && !(declaration.flags & 8388608 /* Ambient */)) { // If --noImplicitAny is on or the declaration is in a Javascript file, // use control flow tracked 'any' type for non-ambient, non-exported var or let variables with no @@ -40959,11 +41108,11 @@ var ts; return autoArrayType; } } - if (declaration.kind === 156 /* Parameter */) { + if (declaration.kind === 157 /* Parameter */) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 164 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 163 /* GetAccessor */); + if (func.kind === 165 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 164 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -41178,9 +41327,9 @@ var ts; var thisContainer = ts.getThisContainer(expression, /*includeArrowFunctions*/ false); // Properties defined in a constructor (or base constructor, or javascript constructor function) don't get undefined added. // Function expressions that are assigned to the prototype count as methods. - return thisContainer.kind === 162 /* Constructor */ || - thisContainer.kind === 244 /* FunctionDeclaration */ || - (thisContainer.kind === 201 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); + return thisContainer.kind === 163 /* Constructor */ || + thisContainer.kind === 245 /* FunctionDeclaration */ || + (thisContainer.kind === 202 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { ts.Debug.assert(types.length === declarations.length); @@ -41264,7 +41413,7 @@ var ts; function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) { var elements = pattern.elements; var lastElement = ts.lastOrUndefined(elements); - var hasRestElement = !!(lastElement && lastElement.kind === 191 /* BindingElement */ && lastElement.dotDotDotToken); + var hasRestElement = !!(lastElement && lastElement.kind === 192 /* BindingElement */ && lastElement.dotDotDotToken); if (elements.length === 0 || elements.length === 1 && hasRestElement) { return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType; } @@ -41288,7 +41437,7 @@ var ts; function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { if (includePatternInType === void 0) { includePatternInType = false; } if (reportErrors === void 0) { reportErrors = false; } - return pattern.kind === 189 /* ObjectBindingPattern */ + return pattern.kind === 190 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -41327,7 +41476,7 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 156 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 157 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(declaration) { @@ -41385,7 +41534,7 @@ var ts; return reportCircularityError(symbol); } var type; - if (declaration.kind === 259 /* ExportAssignment */) { + if (declaration.kind === 260 /* ExportAssignment */) { type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration); } else if (ts.isBinaryExpression(declaration) || @@ -41456,7 +41605,7 @@ var ts; } function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { - if (accessor.kind === 163 /* GetAccessor */) { + if (accessor.kind === 164 /* GetAccessor */) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; } @@ -41490,15 +41639,15 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 163 /* GetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 164 /* GetAccessor */); error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } return type; } function resolveTypeOfAccessors(symbol) { - var getter = ts.getDeclarationOfKind(symbol, 163 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 164 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 164 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 165 /* SetAccessor */); if (getter && ts.isInJSFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -41566,9 +41715,9 @@ var ts; if (symbol.flags & 1536 /* Module */ && ts.isShorthandAmbientModuleSymbol(symbol)) { return anyType; } - else if (declaration.kind === 209 /* BinaryExpression */ || + else if (declaration.kind === 210 /* BinaryExpression */ || ts.isAccessExpression(declaration) && - declaration.parent.kind === 209 /* BinaryExpression */) { + declaration.parent.kind === 210 /* BinaryExpression */) { return getWidenedTypeForAssignmentDeclaration(symbol); } else if (symbol.flags & 512 /* ValueModule */ && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) { @@ -41635,7 +41784,7 @@ var ts; return errorType; } // Check if variable has initializer that circularly references the variable itself - if (noImplicitAny && (declaration.kind !== 156 /* Parameter */ || declaration.initializer)) { + if (noImplicitAny && (declaration.kind !== 157 /* Parameter */ || declaration.initializer)) { error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); } // Circularities could also result from parameters in function expressions that end up @@ -41734,36 +41883,36 @@ var ts; return undefined; } switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 160 /* MethodSignature */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 300 /* JSDocFunctionType */: - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 247 /* TypeAliasDeclaration */: - case 321 /* JSDocTemplateTag */: - case 322 /* JSDocTypedefTag */: - case 316 /* JSDocEnumTag */: - case 315 /* JSDocCallbackTag */: - case 186 /* MappedType */: - case 180 /* ConditionalType */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 161 /* MethodSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 301 /* JSDocFunctionType */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 248 /* TypeAliasDeclaration */: + case 322 /* JSDocTemplateTag */: + case 323 /* JSDocTypedefTag */: + case 317 /* JSDocEnumTag */: + case 316 /* JSDocCallbackTag */: + case 187 /* MappedType */: + case 181 /* ConditionalType */: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 186 /* MappedType */) { + if (node.kind === 187 /* MappedType */) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } - else if (node.kind === 180 /* ConditionalType */) { + else if (node.kind === 181 /* ConditionalType */) { return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node)); var thisType = includeThisTypes && - (node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */ || node.kind === 246 /* InterfaceDeclaration */ || isJSConstructor(node)) && + (node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */ || node.kind === 247 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } @@ -41771,7 +41920,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 246 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 247 /* InterfaceDeclaration */); ts.Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); } @@ -41781,9 +41930,9 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 246 /* InterfaceDeclaration */ || - node.kind === 245 /* ClassDeclaration */ || - node.kind === 214 /* ClassExpression */ || + if (node.kind === 247 /* InterfaceDeclaration */ || + node.kind === 246 /* ClassDeclaration */ || + node.kind === 215 /* ClassExpression */ || isJSConstructor(node) || ts.isTypeAlias(node)) { var declaration = node; @@ -42001,7 +42150,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 246 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 247 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getReducedType(getTypeFromTypeNode(node)); @@ -42037,7 +42186,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 246 /* InterfaceDeclaration */) { + if (declaration.kind === 247 /* InterfaceDeclaration */) { if (declaration.flags & 128 /* ContainsThis */) { return false; } @@ -42125,7 +42274,7 @@ var ts; if (ts.isStringLiteralLike(expr)) { return true; } - else if (expr.kind === 209 /* BinaryExpression */) { + else if (expr.kind === 210 /* BinaryExpression */) { return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right); } return false; @@ -42140,12 +42289,12 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return true; - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; case 75 /* Identifier */: return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return isStringConcatExpression(expr); default: return false; @@ -42159,7 +42308,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 248 /* EnumDeclaration */) { + if (declaration.kind === 249 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && ts.isStringLiteralLike(member.initializer)) { @@ -42186,7 +42335,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 248 /* EnumDeclaration */) { + if (declaration.kind === 249 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var value = getEnumMemberValue(member); @@ -42259,22 +42408,22 @@ var ts; function isThislessType(node) { switch (node.kind) { case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: - case 141 /* ObjectKeyword */: + case 149 /* UnknownKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: + case 142 /* ObjectKeyword */: case 110 /* VoidKeyword */: - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: case 100 /* NullKeyword */: - case 137 /* NeverKeyword */: - case 187 /* LiteralType */: + case 138 /* NeverKeyword */: + case 188 /* LiteralType */: return true; - case 174 /* ArrayType */: + case 175 /* ArrayType */: return isThislessType(node.elementType); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -42300,7 +42449,7 @@ var ts; function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - return (node.kind === 162 /* Constructor */ || (!!returnType && isThislessType(returnType))) && + return (node.kind === 163 /* Constructor */ || (!!returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } @@ -42316,14 +42465,14 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -42614,7 +42763,6 @@ var ts; var stringIndexInfo; var numberIndexInfo; if (ts.rangeEquals(typeParameters, typeArguments, 0, typeParameters.length)) { - mapper = identityMapper; members = source.symbol ? getMembersOfSymbol(source.symbol) : ts.createSymbolTable(source.declaredProperties); callSignatures = source.declaredCallSignatures; constructSignatures = source.declaredConstructSignatures; @@ -43118,8 +43266,7 @@ var ts; var checkType = type.checkType; var constraint = getLowerBoundOfKeyType(checkType); if (constraint !== checkType) { - var mapper = makeUnaryTypeMapper(type.root.checkType, constraint); - return getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); + return getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper)); } } return type; @@ -43168,7 +43315,7 @@ var ts; // Create a mapper from T to the current iteration type constituent. Then, if the // mapped type is itself an instantiated type, combine the iteration mapper with the // instantiation mapper. - var templateMapper = combineTypeMappers(type.mapper, createTypeMapper([typeParameter], [t])); + var templateMapper = appendTypeMapping(type.mapper, typeParameter, t); // If the current iteration type constituent is a string literal type, create a property. // Otherwise, for type string create a string index signature. if (isTypeUsableAsPropertyName(t)) { @@ -43218,6 +43365,7 @@ var ts; type = errorType; } symbol.type = type; + symbol.mapper = undefined; } return symbol.type; } @@ -43232,7 +43380,7 @@ var ts; function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? - instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), type.mapper || identityMapper) : + instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), type.mapper) : errorType); } function getConstraintDeclarationForMappedType(type) { @@ -43240,8 +43388,8 @@ var ts; } function isMappedTypeWithKeyofConstraintDeclaration(type) { var constraintDeclaration = getConstraintDeclarationForMappedType(type); // TODO: GH#18217 - return constraintDeclaration.kind === 184 /* TypeOperator */ && - constraintDeclaration.operator === 134 /* KeyOfKeyword */; + return constraintDeclaration.kind === 185 /* TypeOperator */ && + constraintDeclaration.operator === 135 /* KeyOfKeyword */; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { @@ -43249,7 +43397,7 @@ var ts; // If the constraint declaration is a 'keyof T' node, the modifiers type is T. We check // AST nodes here because, when T is a non-generic type, the logic below eagerly resolves // 'keyof T' to a literal union type and we can't recover T from that type. - type.modifiersType = instantiateType(getTypeFromTypeNode(getConstraintDeclarationForMappedType(type).type), type.mapper || identityMapper); + type.modifiersType = instantiateType(getTypeFromTypeNode(getConstraintDeclarationForMappedType(type).type), type.mapper); } else { // Otherwise, get the declared constraint type, and if the constraint type is a type parameter, @@ -43258,7 +43406,7 @@ var ts; var declaredType = getTypeFromMappedTypeNode(type.declaration); var constraint = getConstraintTypeFromMappedType(declaredType); var extendedConstraint = constraint && constraint.flags & 262144 /* TypeParameter */ ? getConstraintOfTypeParameter(constraint) : constraint; - type.modifiersType = extendedConstraint && extendedConstraint.flags & 4194304 /* Index */ ? instantiateType(extendedConstraint.type, type.mapper || identityMapper) : unknownType; + type.modifiersType = extendedConstraint && extendedConstraint.flags & 4194304 /* Index */ ? instantiateType(extendedConstraint.type, type.mapper) : unknownType; } } return type.modifiersType; @@ -43345,8 +43493,8 @@ var ts; } } // The properties of a union type are those that are present in all constituent types, so - // we only need to check the properties of the first type - if (type.flags & 1048576 /* Union */) { + // we only need to check the properties of the first type without index signature + if (type.flags & 1048576 /* Union */ && !getIndexInfoOfType(current, 0 /* String */) && !getIndexInfoOfType(current, 1 /* Number */)) { break; } } @@ -43447,8 +43595,7 @@ var ts; var simplified = getSimplifiedType(type.checkType, /*writing*/ false); var constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified; if (constraint && constraint !== type.checkType) { - var mapper = makeUnaryTypeMapper(type.root.checkType, constraint); - var instantiated = getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); + var instantiated = getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper)); if (!(instantiated.flags & 131072 /* Never */)) { return instantiated; } @@ -43467,7 +43614,7 @@ var ts; var hasDisjointDomainType = false; for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { var t = types_4[_i]; - if (t.flags & 63176704 /* Instantiable */) { + if (t.flags & 197394432 /* Instantiable */) { // We keep following constraints as long as we have an instantiable type that is known // not to be circular or infinite (hence we stop on index access types). var constraint = getConstraintOfType(t); @@ -43503,7 +43650,7 @@ var ts; return undefined; } function getBaseConstraintOfType(type) { - if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { + if (type.flags & (193200128 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { var constraint = getResolvedBaseConstraint(type); return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined; } @@ -43605,6 +43752,10 @@ var ts; constraintDepth--; return result; } + if (t.flags & 134217728 /* Awaited */) { + var basePromiseType = getBaseConstraint(t.awaitedType); + return basePromiseType ? getAwaitedType(basePromiseType) : undefined; + } if (t.flags & 33554432 /* Substitution */) { return getBaseConstraint(t.substitute); } @@ -43665,8 +43816,7 @@ var ts; if (typeVariable) { var constraint = getConstraintOfTypeParameter(typeVariable); if (constraint && (isArrayType(constraint) || isTupleType(constraint))) { - var mapper = makeUnaryTypeMapper(typeVariable, constraint); - return instantiateType(type, combineTypeMappers(mapper, type.mapper)); + return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper)); } } return type; @@ -43677,7 +43827,7 @@ var ts; * type itself. */ function getApparentType(type) { - var t = type.flags & 63176704 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; + var t = type.flags & 197394432 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; return ts.getObjectFlags(t) & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) : t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : t.flags & 132 /* StringLike */ ? globalStringType : @@ -43938,7 +44088,7 @@ var ts; ts.append(propTypes, getIndexTypeOfType(type, 1 /* Number */)); } if (propTypes.length) { - return getUnionType(propTypes, 2 /* Subtype */); + return getUnionType(propTypes); } } return undefined; @@ -43965,10 +44115,10 @@ var ts; function isJSDocOptionalParameter(node) { return ts.isInJSFile(node) && ( // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType - node.type && node.type.kind === 299 /* JSDocOptionalType */ + node.type && node.type.kind === 300 /* JSDocOptionalType */ || ts.getJSDocParameterTags(node).some(function (_a) { var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 299 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 300 /* JSDocOptionalType */; })); } function tryFindAmbientModule(moduleName, withAugmentations) { @@ -43987,7 +44137,7 @@ var ts; var signature = getSignatureFromDeclaration(node.parent); var parameterIndex = node.parent.parameters.indexOf(node); ts.Debug.assert(parameterIndex >= 0); - return parameterIndex >= getMinArgumentCount(signature); + return parameterIndex >= getMinArgumentCount(signature, /*strongArityForUntypedJS*/ true); } var iife = ts.getImmediatelyInvokedFunctionExpression(node.parent); if (iife) { @@ -44002,7 +44152,7 @@ var ts; return false; } var isBracketed = node.isBracketed, typeExpression = node.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 299 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 300 /* JSDocOptionalType */; } function createTypePredicate(kind, parameterName, parameterIndex, type) { return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; @@ -44062,6 +44212,9 @@ var ts; ts.isValueSignatureDeclaration(declaration) && !ts.hasJSDocParameterTags(declaration) && !ts.getJSDocType(declaration); + if (isUntypedSignatureInJSFile) { + flags |= 16 /* IsUntypedSignatureInJSFile */; + } // If this is a JSDoc construct signature, then skip the first parameter in the // parameter list. The first parameter represents the return type of the construct // signature. @@ -44081,30 +44234,29 @@ var ts; else { parameters.push(paramSymbol); } - if (type && type.kind === 187 /* LiteralType */) { + if (type && type.kind === 188 /* LiteralType */) { flags |= 2 /* HasLiteralTypes */; } // Record a new minimum argument count if this is not an optional parameter var isOptionalParameter_1 = isOptionalJSDocParameterTag(param) || param.initializer || param.questionToken || param.dotDotDotToken || iife && parameters.length > iife.arguments.length && !type || - isUntypedSignatureInJSFile || isJSDocOptionalParameter(param); if (!isOptionalParameter_1) { minArgumentCount = parameters.length; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 163 /* GetAccessor */ || declaration.kind === 164 /* SetAccessor */) && + if ((declaration.kind === 164 /* GetAccessor */ || declaration.kind === 165 /* SetAccessor */) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; + var otherKind = declaration.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 162 /* Constructor */ ? + var classType = declaration.kind === 163 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); @@ -44166,11 +44318,11 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - return node.name.kind === 154 /* ComputedPropertyName */ + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + return node.name.kind === 155 /* ComputedPropertyName */ && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse); @@ -44242,7 +44394,7 @@ var ts; function createTypePredicateFromTypePredicateNode(node, signature) { var parameterName = node.parameterName; var type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 183 /* ThisType */ ? + return parameterName.kind === 184 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, /*parameterName*/ undefined, /*parameterIndex*/ undefined, type) : createTypePredicate(node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */, parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type); } @@ -44285,7 +44437,7 @@ var ts; return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 162 /* Constructor */) { + if (declaration.kind === 163 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } if (ts.isJSDocConstructSignature(declaration)) { @@ -44295,12 +44447,12 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 163 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { + if (declaration.kind === 164 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 164 /* SetAccessor */); + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 165 /* SetAccessor */); var setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -44390,7 +44542,7 @@ var ts; // will result in a different declaration kind. if (!signature.isolatedSignatureType) { var kind = signature.declaration ? signature.declaration.kind : 0 /* Unknown */; - var isConstructor = kind === 162 /* Constructor */ || kind === 166 /* ConstructSignature */ || kind === 171 /* ConstructorType */; + var isConstructor = kind === 163 /* Constructor */ || kind === 167 /* ConstructSignature */ || kind === 172 /* ConstructorType */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -44404,7 +44556,7 @@ var ts; return symbol.members.get("__index" /* Index */); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 140 /* NumberKeyword */ : 143 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 141 /* NumberKeyword */ : 144 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -44438,13 +44590,13 @@ var ts; if (typeParameter.symbol) { for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.parent.kind === 181 /* InferType */) { + if (declaration.parent.kind === 182 /* InferType */) { // When an 'infer T' declaration is immediately contained in a type reference node // (such as 'Foo'), T's constraint is inferred from the constraint of the // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are // present, we form an intersection of the inferred constraint types. var grandParent = declaration.parent.parent; - if (grandParent.kind === 169 /* TypeReference */) { + if (grandParent.kind === 170 /* TypeReference */) { var typeReference = grandParent; var typeParameters = getTypeParametersForTypeReference(typeReference); if (typeParameters) { @@ -44469,7 +44621,7 @@ var ts; } // When an 'infer T' declaration is immediately contained in a rest parameter // declaration, we infer an 'unknown[]' constraint. - else if (grandParent.kind === 156 /* Parameter */ && grandParent.dotDotDotToken) { + else if (grandParent.kind === 157 /* Parameter */ && grandParent.dotDotDotToken) { inferences = ts.append(inferences, createArrayType(unknownType)); } } @@ -44486,14 +44638,24 @@ var ts; } else { var constraintDeclaration = getConstraintDeclaration(typeParameter); - typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : - getInferredTypeParameterConstraint(typeParameter) || noConstraintType; + if (!constraintDeclaration) { + typeParameter.constraint = getInferredTypeParameterConstraint(typeParameter) || noConstraintType; + } + else { + var type = getTypeFromTypeNode(constraintDeclaration); + if (type.flags & 1 /* Any */ && type !== errorType) { // Allow errorType to propegate to keep downstream errors suppressed + // use keyofConstraintType as the base constraint for mapped type key constraints (unknown isn;t assignable to that, but `any` was), + // use unknown otherwise + type = constraintDeclaration.parent.parent.kind === 187 /* MappedType */ ? keyofConstraintType : unknownType; + } + typeParameter.constraint = type; + } } } return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - var tp = ts.getDeclarationOfKind(typeParameter.symbol, 155 /* TypeParameter */); + var tp = ts.getDeclarationOfKind(typeParameter.symbol, 156 /* TypeParameter */); var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent; return host && getSymbolOfNode(host); } @@ -44573,8 +44735,8 @@ var ts; } var node = type.node; var typeArguments = !node ? ts.emptyArray : - node.kind === 169 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : - node.kind === 174 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : + node.kind === 170 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : + node.kind === 175 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments; @@ -44618,7 +44780,7 @@ var ts; return errorType; } } - if (node.kind === 169 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { + if (node.kind === 170 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { return createDeferredTypeReference(type, node, /*mapper*/ undefined); } // In a type reference, the outer type parameters of the referenced class or interface are automatically @@ -44663,9 +44825,9 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return node.typeName; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -44696,9 +44858,7 @@ var ts; // Get type from reference to named type that cannot be generic (enum or type parameter) var res = tryGetDeclaredTypeOfSymbol(symbol); if (res) { - return checkNoTypeArguments(node, symbol) ? - res.flags & 262144 /* TypeParameter */ ? getConstrainedTypeVariable(res, node) : getRegularTypeOfLiteralType(res) : - errorType; + return checkNoTypeArguments(node, symbol) ? getRegularTypeOfLiteralType(res) : errorType; } if (symbol.flags & 111551 /* Value */ && isJSDocTypeReference(node)) { var jsdocType = getTypeFromJSDocValueReference(node, symbol); @@ -44734,7 +44894,7 @@ var ts; } isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, /*requireStringLiteralLikeArgument*/ true) && !!valueType.symbol; } - var isImportTypeWithQualifier = node.kind === 188 /* ImportType */ && node.qualifier; + var isImportTypeWithQualifier = node.kind === 189 /* ImportType */ && node.qualifier; // valueType might not have a symbol, eg, {import('./b').STRING_LITERAL} if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier)) { typeType = getTypeReferenceType(node, valueType.symbol); @@ -44744,45 +44904,45 @@ var ts; } return links.resolvedJSDocType; } - function getSubstitutionType(typeVariable, substitute) { - if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === typeVariable) { - return typeVariable; + function getSubstitutionType(baseType, substitute) { + if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === baseType) { + return baseType; } - var id = getTypeId(typeVariable) + ">" + getTypeId(substitute); + var id = getTypeId(baseType) + ">" + getTypeId(substitute); var cached = substitutionTypes.get(id); if (cached) { return cached; } var result = createType(33554432 /* Substitution */); - result.typeVariable = typeVariable; + result.baseType = baseType; result.substitute = substitute; substitutionTypes.set(id, result); return result; } function isUnaryTupleTypeNode(node) { - return node.kind === 175 /* TupleType */ && node.elementTypes.length === 1; + return node.kind === 176 /* TupleType */ && node.elementTypes.length === 1; } - function getImpliedConstraint(typeVariable, checkNode, extendsNode) { - return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(typeVariable, checkNode.elementTypes[0], extendsNode.elementTypes[0]) : - getActualTypeVariable(getTypeFromTypeNode(checkNode)) === typeVariable ? getTypeFromTypeNode(extendsNode) : + function getImpliedConstraint(type, checkNode, extendsNode) { + return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elementTypes[0], extendsNode.elementTypes[0]) : + getActualTypeVariable(getTypeFromTypeNode(checkNode)) === type ? getTypeFromTypeNode(extendsNode) : undefined; } - function getConstrainedTypeVariable(typeVariable, node) { + function getConditionalFlowTypeOfType(type, node) { var constraints; - while (node && !ts.isStatement(node) && node.kind !== 303 /* JSDocComment */) { + while (node && !ts.isStatement(node) && node.kind !== 304 /* JSDocComment */) { var parent = node.parent; - if (parent.kind === 180 /* ConditionalType */ && node === parent.trueType) { - var constraint = getImpliedConstraint(typeVariable, parent.checkType, parent.extendsType); + if (parent.kind === 181 /* ConditionalType */ && node === parent.trueType) { + var constraint = getImpliedConstraint(type, parent.checkType, parent.extendsType); if (constraint) { constraints = ts.append(constraints, constraint); } } node = parent; } - return constraints ? getSubstitutionType(typeVariable, getIntersectionType(ts.append(constraints, typeVariable))) : typeVariable; + return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type; } function isJSDocTypeReference(node) { - return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 169 /* TypeReference */ || node.kind === 188 /* ImportType */); + return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 170 /* TypeReference */ || node.kind === 189 /* ImportType */); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { @@ -44895,9 +45055,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: return declaration; } } @@ -45018,19 +45178,19 @@ var ts; } function getArrayOrTupleTargetType(node) { var readonly = isReadonlyTypeOperator(node.parent); - if (node.kind === 174 /* ArrayType */ || node.elementTypes.length === 1 && node.elementTypes[0].kind === 177 /* RestType */) { + if (node.kind === 175 /* ArrayType */ || node.elementTypes.length === 1 && node.elementTypes[0].kind === 178 /* RestType */) { return readonly ? globalReadonlyArrayType : globalArrayType; } var lastElement = ts.lastOrUndefined(node.elementTypes); - var restElement = lastElement && lastElement.kind === 177 /* RestType */ ? lastElement : undefined; - var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 176 /* OptionalType */ && n !== restElement; }) + 1; + var restElement = lastElement && lastElement.kind === 178 /* RestType */ ? lastElement : undefined; + var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 177 /* OptionalType */ && n !== restElement; }) + 1; return getTupleTypeOfArity(node.elementTypes.length, minLength, !!restElement, readonly, /*associatedNames*/ undefined); } // Return true if the given type reference node is directly aliased or if it needs to be deferred // because it is possibly contained in a circular chain of eagerly resolved types. function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { - return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 174 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : - node.kind === 175 /* TupleType */ ? ts.some(node.elementTypes, mayResolveTypeAlias) : + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 175 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : + node.kind === 176 /* TupleType */ ? ts.some(node.elementTypes, mayResolveTypeAlias) : hasDefaultTypeArguments || ts.some(node.typeArguments, mayResolveTypeAlias)); } // Return true when the given node is transitively contained in type constructs that eagerly @@ -45039,15 +45199,15 @@ var ts; function isResolvedByTypeAlias(node) { var parent = node.parent; switch (parent.kind) { - case 182 /* ParenthesizedType */: - case 169 /* TypeReference */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 185 /* IndexedAccessType */: - case 180 /* ConditionalType */: - case 184 /* TypeOperator */: + case 183 /* ParenthesizedType */: + case 170 /* TypeReference */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 186 /* IndexedAccessType */: + case 181 /* ConditionalType */: + case 185 /* TypeOperator */: return isResolvedByTypeAlias(parent); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return true; } return false; @@ -45056,27 +45216,27 @@ var ts; // of a type alias. function mayResolveTypeAlias(node) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node.typeName, 788968 /* Type */).flags & 524288 /* TypeAlias */); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return true; - case 184 /* TypeOperator */: - return node.operator !== 147 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); - case 182 /* ParenthesizedType */: - case 176 /* OptionalType */: - case 299 /* JSDocOptionalType */: - case 297 /* JSDocNullableType */: - case 298 /* JSDocNonNullableType */: - case 294 /* JSDocTypeExpression */: + case 185 /* TypeOperator */: + return node.operator !== 148 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); + case 183 /* ParenthesizedType */: + case 177 /* OptionalType */: + case 300 /* JSDocOptionalType */: + case 298 /* JSDocNullableType */: + case 299 /* JSDocNonNullableType */: + case 295 /* JSDocTypeExpression */: return mayResolveTypeAlias(node.type); - case 177 /* RestType */: - return node.type.kind !== 174 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); - case 178 /* UnionType */: - case 179 /* IntersectionType */: + case 178 /* RestType */: + return node.type.kind !== 175 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); + case 179 /* UnionType */: + case 180 /* IntersectionType */: return ts.some(node.types, mayResolveTypeAlias); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); } @@ -45090,18 +45250,18 @@ var ts; links.resolvedType = emptyObjectType; } else if (isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 175 /* TupleType */ && node.elementTypes.length === 0 ? target : + links.resolvedType = node.kind === 176 /* TupleType */ && node.elementTypes.length === 0 ? target : createDeferredTypeReference(target, node, /*mapper*/ undefined); } else { - var elementTypes = node.kind === 174 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); + var elementTypes = node.kind === 175 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); links.resolvedType = createTypeReference(target, elementTypes); } } return links.resolvedType; } function isReadonlyTypeOperator(node) { - return ts.isTypeOperatorNode(node) && node.operator === 138 /* ReadonlyKeyword */; + return ts.isTypeOperatorNode(node) && node.operator === 139 /* ReadonlyKeyword */; } // We represent tuple types as type references to synthesized generic interface types created by // this function. The types are of the form: @@ -45206,7 +45366,7 @@ var ts; // We ignore 'never' types in unions if (!(flags & 131072 /* Never */)) { includes |= flags & 71041023 /* IncludesMask */; - if (flags & 66846720 /* StructuredOrInstantiable */) + if (flags & 201064448 /* StructuredOrInstantiable */) includes |= 262144 /* IncludesStructuredOrInstantiable */; if (type === wildcardType) includes |= 8388608 /* IncludesWildcard */; @@ -45338,7 +45498,7 @@ var ts; neverType; } } - var objectFlags = (includes & 66994211 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | + var objectFlags = (includes & 201211939 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 268435456 /* ContainsIntersections */ : 0); return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments); } @@ -45692,7 +45852,7 @@ var ts; type = getReducedType(type); return type.flags & 1048576 /* Union */ ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : - maybeTypeOfKind(type, 58982400 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) : + maybeTypeOfKind(type, 193200128 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) : ts.getObjectFlags(type) & 32 /* Mapped */ ? filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); }) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : @@ -45714,20 +45874,24 @@ var ts; return indexType.flags & 131072 /* Never */ ? stringType : indexType; } function getTypeFromTypeOperatorNode(node) { + var _a; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 134 /* KeyOfKeyword */: + case 135 /* KeyOfKeyword */: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 147 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 144 /* SymbolKeyword */ + case 148 /* UniqueKeyword */: + links.resolvedType = node.type.kind === 145 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : errorType; break; - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: links.resolvedType = getTypeFromTypeNode(node.type); break; + case 128 /* AwaitedKeyword */: + links.resolvedType = (_a = getAwaitedType(getTypeFromTypeNode(node.type))) !== null && _a !== void 0 ? _a : unknownType; + break; default: throw ts.Debug.assertNever(node.operator); } @@ -45762,13 +45926,13 @@ var ts; if (type.flags & 2097152 /* Intersection */) { return ts.some(type.types, isJSLiteralType); } - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { return isJSLiteralType(getResolvedBaseConstraint(type)); } return false; } function getPropertyNameFromIndex(indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode : undefined; return isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? @@ -45779,7 +45943,7 @@ var ts; undefined; } function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags) { - var accessExpression = accessNode && accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode : undefined; var propName = accessNode && ts.isPrivateIdentifier(accessNode) ? undefined : getPropertyNameFromIndex(indexType, accessNode); if (propName !== undefined) { var prop = getPropertyOfType(objectType, propName); @@ -45916,9 +46080,9 @@ var ts; } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode.argumentExpression : - accessNode.kind === 185 /* IndexedAccessType */ ? accessNode.indexType : - accessNode.kind === 154 /* ComputedPropertyName */ ? accessNode.expression : + return accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode.argumentExpression : + accessNode.kind === 186 /* IndexedAccessType */ ? accessNode.indexType : + accessNode.kind === 155 /* ComputedPropertyName */ ? accessNode.expression : accessNode; } function isGenericObjectType(type) { @@ -45929,7 +46093,7 @@ var ts; } return !!(type.objectFlags & 8388608 /* IsGenericObjectType */); } - return !!(type.flags & 58982400 /* InstantiableNonPrimitive */) || isGenericMappedType(type); + return !!(type.flags & 193200128 /* InstantiableNonPrimitive */) || isGenericMappedType(type); } function isGenericIndexType(type) { if (type.flags & 3145728 /* UnionOrIntersection */) { @@ -45939,7 +46103,7 @@ var ts; } return !!(type.objectFlags & 33554432 /* IsGenericIndexType */); } - return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); + return !!(type.flags & (193200128 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); } function isThisTypeParameter(type) { return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType); @@ -45992,7 +46156,7 @@ var ts; return type[cache] = distributedOverIndex; } // Only do the inner distributions if the index can no longer be instantiated to cause index distribution again - if (!(indexType.flags & 63176704 /* Instantiable */)) { + if (!(indexType.flags & 197394432 /* Instantiable */)) { // (T | U)[K] -> T[K] | U[K] (reading) // (T | U)[K] -> T[K] & U[K] (writing) // (T & U)[K] -> T[K] & U[K] @@ -46064,7 +46228,7 @@ var ts; // object type. Note that for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in // an expression. This is to preserve backwards compatibility. For example, an element access 'this["foo"]' // has always been resolved eagerly using the constraint type of 'this' at the given location. - if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 185 /* IndexedAccessType */) && isGenericObjectType(objectType)) { + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 186 /* IndexedAccessType */) && isGenericObjectType(objectType)) { if (objectType.flags & 3 /* AnyOrUnknown */) { return objectType; } @@ -46114,7 +46278,7 @@ var ts; links.resolvedType = resolved.flags & 8388608 /* IndexedAccess */ && resolved.objectType === objectType && resolved.indexType === indexType ? - getConstrainedTypeVariable(resolved, node) : resolved; + getConditionalFlowTypeOfType(resolved, node) : resolved; } return links.resolvedType; } @@ -46134,7 +46298,7 @@ var ts; } function getActualTypeVariable(type) { if (type.flags & 33554432 /* Substitution */) { - return type.typeVariable; + return type.baseType; } if (type.flags & 8388608 /* IndexedAccess */ && (type.objectType.flags & 33554432 /* Substitution */ || type.indexType.flags & 33554432 /* Substitution */)) { @@ -46162,7 +46326,7 @@ var ts; // types rules (i.e. proper contravariance) for inferences. inferTypes(context.inferences, checkType, extendsType, 128 /* NoConstraints */ | 256 /* AlwaysStrict */); } - combinedMapper = combineTypeMappers(mapper, context.mapper); + combinedMapper = mergeTypeMappers(mapper, context.mapper); } // Instantiate the extends type including inferences for 'infer T' type parameters var inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType; @@ -46353,7 +46517,7 @@ var ts; } function getAliasSymbolForTypeNode(node) { var host = node.parent; - while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 138 /* ReadonlyKeyword */) { + while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 139 /* ReadonlyKeyword */) { host = host.parent; } return ts.isTypeAlias(host) ? getSymbolOfNode(host) : undefined; @@ -46415,7 +46579,7 @@ var ts; * this function should be called in a left folding style, with left = previous result of getSpreadType * and right = the new element to be spread. */ - function getSpreadType(left, right, symbol, objectFlags, readonly, isParentTypeNullable) { + function getSpreadType(left, right, symbol, objectFlags, readonly) { if (left.flags & 1 /* Any */ || right.flags & 1 /* Any */) { return anyType; } @@ -46431,16 +46595,16 @@ var ts; if (left.flags & 1048576 /* Union */) { var merged = tryMergeUnionOfObjectTypeAndEmptyObject(left, readonly); if (merged) { - return getSpreadType(merged, right, symbol, objectFlags, readonly, isParentTypeNullable); + return getSpreadType(merged, right, symbol, objectFlags, readonly); } - return mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly, isParentTypeNullable); }); + return mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly); }); } if (right.flags & 1048576 /* Union */) { var merged = tryMergeUnionOfObjectTypeAndEmptyObject(right, readonly); if (merged) { - return getSpreadType(left, merged, symbol, objectFlags, readonly, maybeTypeOfKind(right, 98304 /* Nullable */)); + return getSpreadType(left, merged, symbol, objectFlags, readonly); } - return mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly, maybeTypeOfKind(right, 98304 /* Nullable */)); }); + return mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly); }); } if (right.flags & (528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 132 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)) { return left; @@ -46502,14 +46666,6 @@ var ts; result.nameType = getSymbolLinks(leftProp).nameType; members.set(leftProp.escapedName, result); } - else if (strictNullChecks && - !isParentTypeNullable && - symbol && - !isFromSpreadAssignment(leftProp, symbol) && - isFromSpreadAssignment(rightProp, symbol) && - !maybeTypeOfKind(rightType, 98304 /* Nullable */)) { - error(leftProp.valueDeclaration, ts.Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, ts.unescapeLeadingUnderscores(leftProp.escapedName)); - } } else { members.set(leftProp.escapedName, getSpreadSymbol(leftProp, readonly)); @@ -46608,7 +46764,7 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 246 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 247 /* InterfaceDeclaration */)) { if (!ts.hasModifier(container, 32 /* Static */) && (!ts.isConstructorDeclaration(container) || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -46639,90 +46795,93 @@ var ts; return links.resolvedType; } function getTypeFromTypeNode(node) { + return getConditionalFlowTypeOfType(getTypeFromTypeNodeWorker(node), node); + } + function getTypeFromTypeNodeWorker(node) { switch (node.kind) { case 125 /* AnyKeyword */: - case 295 /* JSDocAllType */: - case 296 /* JSDocUnknownType */: + case 296 /* JSDocAllType */: + case 297 /* JSDocUnknownType */: return anyType; - case 148 /* UnknownKeyword */: + case 149 /* UnknownKeyword */: return unknownType; - case 143 /* StringKeyword */: + case 144 /* StringKeyword */: return stringType; - case 140 /* NumberKeyword */: + case 141 /* NumberKeyword */: return numberType; - case 151 /* BigIntKeyword */: + case 152 /* BigIntKeyword */: return bigintType; - case 128 /* BooleanKeyword */: + case 129 /* BooleanKeyword */: return booleanType; - case 144 /* SymbolKeyword */: + case 145 /* SymbolKeyword */: return esSymbolType; case 110 /* VoidKeyword */: return voidType; - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: return undefinedType; case 100 /* NullKeyword */: return nullType; - case 137 /* NeverKeyword */: + case 138 /* NeverKeyword */: return neverType; - case 141 /* ObjectKeyword */: + case 142 /* ObjectKeyword */: return node.flags & 131072 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType; - case 183 /* ThisType */: + case 184 /* ThisType */: case 104 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 187 /* LiteralType */: + case 188 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return getTypeFromTypeReference(node); - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return node.assertsModifier ? voidType : booleanType; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 174 /* ArrayType */: - case 175 /* TupleType */: + case 175 /* ArrayType */: + case 176 /* TupleType */: return getTypeFromArrayOrTupleTypeNode(node); - case 176 /* OptionalType */: + case 177 /* OptionalType */: return getTypeFromOptionalTypeNode(node); - case 178 /* UnionType */: + case 179 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 179 /* IntersectionType */: + case 180 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 297 /* JSDocNullableType */: + case 298 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 299 /* JSDocOptionalType */: + case 300 /* JSDocOptionalType */: return addOptionality(getTypeFromTypeNode(node.type)); - case 182 /* ParenthesizedType */: - case 298 /* JSDocNonNullableType */: - case 294 /* JSDocTypeExpression */: + case 183 /* ParenthesizedType */: + case 299 /* JSDocNonNullableType */: + case 295 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 177 /* RestType */: + case 178 /* RestType */: return getElementTypeOfArrayType(getTypeFromTypeNode(node.type)) || errorType; - case 301 /* JSDocVariadicType */: + case 302 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 173 /* TypeLiteral */: - case 304 /* JSDocTypeLiteral */: - case 300 /* JSDocFunctionType */: - case 305 /* JSDocSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 174 /* TypeLiteral */: + case 305 /* JSDocTypeLiteral */: + case 301 /* JSDocFunctionType */: + case 306 /* JSDocSignature */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 184 /* TypeOperator */: + case 185 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 186 /* MappedType */: + case 187 /* MappedType */: return getTypeFromMappedTypeNode(node); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return getTypeFromConditionalTypeNode(node); - case 181 /* InferType */: + case 182 /* InferType */: return getTypeFromInferTypeNode(node); - case 188 /* ImportType */: + case 189 /* ImportType */: return getTypeFromImportTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode case 75 /* Identifier */: - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: var symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -46752,27 +46911,41 @@ var ts; function instantiateSignatures(signatures, mapper) { return instantiateList(signatures, mapper, instantiateSignature); } - function makeUnaryTypeMapper(source, target) { - return function (t) { return t === source ? target : t; }; + function createTypeMapper(sources, targets) { + return sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : makeArrayTypeMapper(sources, targets); + } + function getMappedType(type, mapper) { + switch (mapper.kind) { + case 0 /* Simple */: + return type === mapper.source ? mapper.target : type; + case 1 /* Array */: + var sources = mapper.sources; + var targets = mapper.targets; + for (var i = 0; i < sources.length; i++) { + if (type === sources[i]) { + return targets ? targets[i] : anyType; + } + } + return type; + case 2 /* Function */: + return mapper.func(type); + case 3 /* Composite */: + case 4 /* Merged */: + var t1 = getMappedType(type, mapper.mapper1); + return t1 !== type && mapper.kind === 3 /* Composite */ ? instantiateType(t1, mapper.mapper2) : getMappedType(t1, mapper.mapper2); + } } - function makeBinaryTypeMapper(source1, target1, source2, target2) { - return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; }; + function makeUnaryTypeMapper(source, target) { + return { kind: 0 /* Simple */, source: source, target: target }; } function makeArrayTypeMapper(sources, targets) { - return function (t) { - for (var i = 0; i < sources.length; i++) { - if (t === sources[i]) { - return targets ? targets[i] : anyType; - } - } - return t; - }; + return { kind: 1 /* Array */, sources: sources, targets: targets }; } - function createTypeMapper(sources, targets) { - ts.Debug.assert(targets === undefined || sources.length === targets.length); - return sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : - sources.length === 2 ? makeBinaryTypeMapper(sources[0], targets ? targets[0] : anyType, sources[1], targets ? targets[1] : anyType) : - makeArrayTypeMapper(sources, targets); + function makeFunctionTypeMapper(func) { + return { kind: 2 /* Function */, func: func }; + } + function makeCompositeTypeMapper(kind, mapper1, mapper2) { + return { kind: kind, mapper1: mapper1, mapper2: mapper2 }; } function createTypeEraser(sources) { return createTypeMapper(sources, /*targets*/ undefined); @@ -46782,29 +46955,25 @@ var ts; * This is used during inference when instantiating type parameter defaults. */ function createBackreferenceMapper(context, index) { - return function (t) { return ts.findIndex(context.inferences, function (info) { return info.typeParameter === t; }) >= index ? unknownType : t; }; + return makeFunctionTypeMapper(function (t) { return ts.findIndex(context.inferences, function (info) { return info.typeParameter === t; }) >= index ? unknownType : t; }); } function combineTypeMappers(mapper1, mapper2) { - if (!mapper1) - return mapper2; - if (!mapper2) - return mapper1; - return function (t) { return instantiateType(mapper1(t), mapper2); }; + return mapper1 ? makeCompositeTypeMapper(3 /* Composite */, mapper1, mapper2) : mapper2; + } + function mergeTypeMappers(mapper1, mapper2) { + return mapper1 ? makeCompositeTypeMapper(4 /* Merged */, mapper1, mapper2) : mapper2; } - function createReplacementMapper(source, target, baseMapper) { - return function (t) { return t === source ? target : baseMapper(t); }; + function prependTypeMapping(source, target, mapper) { + return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(4 /* Merged */, makeUnaryTypeMapper(source, target), mapper); } - function permissiveMapper(type) { - return type.flags & 262144 /* TypeParameter */ ? wildcardType : type; + function appendTypeMapping(mapper, source, target) { + return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(4 /* Merged */, mapper, makeUnaryTypeMapper(source, target)); } function getRestrictiveTypeParameter(tp) { return tp.constraint === unknownType ? tp : tp.restrictiveInstantiation || (tp.restrictiveInstantiation = createTypeParameter(tp.symbol), tp.restrictiveInstantiation.constraint = unknownType, tp.restrictiveInstantiation); } - function restrictiveMapper(type) { - return type.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(type) : type; - } function cloneTypeParameter(typeParameter) { var result = createTypeParameter(typeParameter.symbol); result.target = typeParameter; @@ -46838,7 +47007,7 @@ var ts; } function instantiateSymbol(symbol, mapper) { var links = getSymbolLinks(symbol); - if (links.type && !maybeTypeOfKind(links.type, 524288 /* Object */ | 63176704 /* Instantiable */)) { + if (links.type && !couldContainTypeVariables(links.type)) { // If the type of the symbol is already resolved, and if that type could not possibly // be affected by instantiation, simply return the symbol itself. return symbol; @@ -46904,7 +47073,8 @@ var ts; // We are instantiating an anonymous type that has one or more type parameters in scope. Apply the // mapper to the type parameters to produce the effective list of type arguments, and compute the // instantiation cache key from the type IDs of the type arguments. - var typeArguments = ts.map(typeParameters, combineTypeMappers(type.mapper, mapper)); + var combinedMapper_1 = combineTypeMappers(type.mapper, mapper); + var typeArguments = ts.map(typeParameters, function (t) { return getMappedType(t, combinedMapper_1); }); var id = getTypeListId(typeArguments); var result = links.instantiations.get(id); if (!result) { @@ -46919,9 +47089,9 @@ var ts; return type; } function maybeTypeParameterReference(node) { - return !(node.kind === 153 /* QualifiedName */ || - node.parent.kind === 169 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || - node.parent.kind === 188 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); + return !(node.kind === 154 /* QualifiedName */ || + node.parent.kind === 170 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || + node.parent.kind === 189 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); } function isTypeParameterPossiblyReferenced(tp, node) { // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks @@ -46930,7 +47100,7 @@ var ts; if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container = tp.symbol.declarations[0].parent; for (var n = node; n !== container; n = n.parent) { - if (!n || n.kind === 223 /* Block */ || n.kind === 180 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { + if (!n || n.kind === 224 /* Block */ || n.kind === 181 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { return true; } } @@ -46939,12 +47109,12 @@ var ts; return true; function containsReference(node) { switch (node.kind) { - case 183 /* ThisType */: + case 184 /* ThisType */: return !!tp.isThisType; case 75 /* Identifier */: return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) && - getTypeFromTypeNode(node) === tp; - case 172 /* TypeQuery */: + getTypeFromTypeNodeWorker(node) === tp; // use worker because we're looking for === equality + case 173 /* TypeQuery */: return true; } return !!ts.forEachChild(node, containsReference); @@ -46976,8 +47146,8 @@ var ts; var mappedTypeVariable = instantiateType(typeVariable, mapper); if (typeVariable !== mappedTypeVariable) { return mapType(getReducedType(mappedTypeVariable), function (t) { - if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { - var replacementMapper = createReplacementMapper(typeVariable, t, mapper); + if (t.flags & (3 /* AnyOrUnknown */ | 193200128 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { + var replacementMapper = prependTypeMapping(typeVariable, t, mapper); return isArrayType(t) ? instantiateMappedArrayType(t, type, replacementMapper) : isTupleType(t) ? instantiateMappedTupleType(t, type, replacementMapper) : instantiateAnonymousType(type, replacementMapper); @@ -47010,7 +47180,7 @@ var ts; createTupleType(elementTypes, newMinLength, tupleType.target.hasRestElement, newReadonly, tupleType.target.associatedNames); } function instantiateMappedTypeTemplate(type, key, isOptional, mapper) { - var templateMapper = combineTypeMappers(mapper, createTypeMapper([getTypeParameterFromMappedType(type)], [key])); + var templateMapper = appendTypeMapping(mapper, getTypeParameterFromMappedType(type), key); var propType = instantiateType(getTemplateTypeFromMappedType(type.target || type), templateMapper); var modifiers = getMappedTypeModifiers(type); return strictNullChecks && modifiers & 4 /* IncludeOptional */ && !maybeTypeOfKind(propType, 32768 /* Undefined */ | 16384 /* Void */) ? getOptionalType(propType) : @@ -47040,7 +47210,7 @@ var ts; // We are instantiating a conditional type that has one or more type parameters in scope. Apply the // mapper to the type parameters to produce the effective list of type arguments, and compute the // instantiation cache key from the type IDs of the type arguments. - var typeArguments = ts.map(root.outerTypeParameters, mapper); + var typeArguments = ts.map(root.outerTypeParameters, function (t) { return getMappedType(t, mapper); }); var id = getTypeListId(typeArguments); var result = root.instantiations.get(id); if (!result) { @@ -47058,15 +47228,15 @@ var ts; // type A | B, we produce (A extends U ? X : Y) | (B extends U ? X : Y). if (root.isDistributive) { var checkType_1 = root.checkType; - var instantiatedType = mapper(checkType_1); + var instantiatedType = getMappedType(checkType_1, mapper); if (checkType_1 !== instantiatedType && instantiatedType.flags & (1048576 /* Union */ | 131072 /* Never */)) { - return mapType(instantiatedType, function (t) { return getConditionalType(root, createReplacementMapper(checkType_1, t, mapper)); }); + return mapType(instantiatedType, function (t) { return getConditionalType(root, prependTypeMapping(checkType_1, t, mapper)); }); } } return getConditionalType(root, mapper); } function instantiateType(type, mapper) { - if (!type || !mapper || mapper === identityMapper) { + if (!type || !mapper) { return type; } if (instantiationDepth === 50 || instantiationCount >= 5000000) { @@ -47084,9 +47254,10 @@ var ts; return result; } function instantiateTypeWorker(type, mapper) { + var _a; var flags = type.flags; if (flags & 262144 /* TypeParameter */) { - return mapper(type); + return getMappedType(type, mapper); } if (flags & 524288 /* Object */) { var objectFlags = type.objectFlags; @@ -47131,8 +47302,11 @@ var ts; if (flags & 16777216 /* Conditional */) { return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper)); } + if (flags & 134217728 /* Awaited */) { + return (_a = getAwaitedType(instantiateType(type.awaitedType, mapper))) !== null && _a !== void 0 ? _a : unknownType; + } if (flags & 33554432 /* Substitution */) { - var maybeVariable = instantiateType(type.typeVariable, mapper); + var maybeVariable = instantiateType(type.baseType, mapper); if (maybeVariable.flags & 8650752 /* TypeVariable */) { return getSubstitutionType(maybeVariable, instantiateType(type.substitute, mapper)); } @@ -47172,35 +47346,35 @@ var ts; // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 244 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type return isContextSensitiveFunctionLikeDeclaration(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return ts.some(node.properties, isContextSensitive); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return ts.some(node.elements, isContextSensitive); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive); - case 273 /* JsxAttribute */: { + case 274 /* JsxAttribute */: { // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. var initializer = node.initializer; return !!initializer && isContextSensitive(initializer); } - case 276 /* JsxExpression */: { + case 277 /* JsxExpression */: { // It is possible to that node.expression is undefined (e.g
) var expression = node.expression; return !!expression && isContextSensitive(expression); @@ -47219,7 +47393,7 @@ var ts; if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 202 /* ArrowFunction */) { + if (node.kind !== 203 /* ArrowFunction */) { // If the first parameter is not an explicit 'this' parameter, then the function has // an implicit 'this' parameter which is subject to contextual typing. var parameter = ts.firstOrUndefined(node.parameters); @@ -47232,7 +47406,7 @@ var ts; } function hasContextSensitiveReturnExpression(node) { // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 223 /* Block */ && isContextSensitive(node.body); + return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 224 /* Block */ && isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && @@ -47285,7 +47459,7 @@ var ts; function isTypeDerivedFrom(source, target) { return source.flags & 1048576 /* Union */ ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) : target.flags & 1048576 /* Union */ ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) : - source.flags & 58982400 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : + source.flags & 193200128 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : target === globalObjectType ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) : target === globalFunctionType ? !!(source.flags & 524288 /* Object */) && isFunctionObjectType(source) : hasBaseType(source, getTargetType(target)); @@ -47335,23 +47509,23 @@ var ts; return true; } switch (node.kind) { - case 276 /* JsxExpression */: - case 200 /* ParenthesizedExpression */: + case 277 /* JsxExpression */: + case 201 /* ParenthesizedExpression */: return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: case 27 /* CommaToken */: return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); } return false; @@ -47542,7 +47716,7 @@ var ts; } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: // child is of the type of the expression return { errorNode: child, innerExpression: child.expression, nameType: nameType }; case 11 /* JsxText */: @@ -47551,9 +47725,9 @@ var ts; } // child is a string return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() }; - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 270 /* JsxFragment */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 271 /* JsxFragment */: // child is of type JSX.Element return { errorNode: child, innerExpression: child, nameType: nameType }; default: @@ -47704,11 +47878,11 @@ var ts; } _b = prop.kind; switch (_b) { - case 164 /* SetAccessor */: return [3 /*break*/, 2]; - case 163 /* GetAccessor */: return [3 /*break*/, 2]; - case 161 /* MethodDeclaration */: return [3 /*break*/, 2]; - case 282 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; - case 281 /* PropertyAssignment */: return [3 /*break*/, 4]; + case 165 /* SetAccessor */: return [3 /*break*/, 2]; + case 164 /* GetAccessor */: return [3 /*break*/, 2]; + case 162 /* MethodDeclaration */: return [3 /*break*/, 2]; + case 283 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; + case 282 /* PropertyAssignment */: return [3 /*break*/, 4]; } return [3 /*break*/, 6]; case 2: return [4 /*yield*/, { errorNode: prop.name, innerExpression: undefined, nameType: type }]; @@ -47785,8 +47959,8 @@ var ts; return 0 /* False */; } var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 161 /* MethodDeclaration */ && - kind !== 160 /* MethodSignature */ && kind !== 162 /* Constructor */; + var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 162 /* MethodDeclaration */ && + kind !== 161 /* MethodSignature */ && kind !== 163 /* Constructor */; var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -48047,7 +48221,7 @@ var ts; return !!(related & 1 /* Succeeded */); } } - if (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */) { + if (source.flags & 201064448 /* StructuredOrInstantiable */ || target.flags & 201064448 /* StructuredOrInstantiable */) { return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; @@ -48060,7 +48234,7 @@ var ts; var t = isFreshLiteralType(type) ? type.regularType : ts.getObjectFlags(type) & 4 /* Reference */ && type.node ? createTypeReference(type.target, getTypeArguments(type)) : type.flags & 3145728 /* UnionOrIntersection */ ? getReducedType(type) : - type.flags & 33554432 /* Substitution */ ? writing ? type.typeVariable : type.substitute : + type.flags & 33554432 /* Substitution */ ? writing ? type.baseType : type.substitute : type.flags & 25165824 /* Simplifiable */ ? getSimplifiedType(type, writing) : type; if (t === type) @@ -48280,8 +48454,15 @@ var ts; if (incompatibleStack.length) reportIncompatibleStack(); var _a = getTypeNamesForErrorDisplay(source, target), sourceType = _a[0], targetType = _a[1]; - if (target.flags & 262144 /* TypeParameter */ && target.immediateBaseConstraint !== undefined && isTypeAssignableTo(source, target.immediateBaseConstraint)) { - reportError(ts.Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2, sourceType, targetType, typeToString(target.immediateBaseConstraint)); + if (target.flags & 262144 /* TypeParameter */) { + var constraint = getBaseConstraintOfType(target); + var constraintElab = constraint && isTypeAssignableTo(source, constraint); + if (constraintElab) { + reportError(ts.Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2, sourceType, targetType, typeToString(constraint)); + } + else { + reportError(ts.Diagnostics._0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1, targetType, sourceType); + } } if (!message) { if (relation === comparableRelation) { @@ -48417,7 +48598,7 @@ var ts; if (source.flags & 1048576 /* Union */) { result = relation === comparableRelation ? someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState) : - eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */)); + eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState & 4 /* ExcessCheck */); } else { if (target.flags & 1048576 /* Union */) { @@ -48425,9 +48606,9 @@ var ts; } else if (target.flags & 2097152 /* Intersection */) { result = typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2 /* Target */); - if (result && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks)) { + if (result && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) && !(intersectionState & 4 /* ExcessCheck */)) { // Validate against excess props using the original `source` - if (!propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 0 /* None */)) { + if (!propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 4 /* ExcessCheck */)) { return 0 /* False */; } } @@ -48446,9 +48627,11 @@ var ts; // // - For a primitive type or type parameter (such as 'number = A & B') there is no point in // breaking the intersection apart. - result = someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */); + if (!isNonGenericObjectType(target) || !ts.every(source.types, function (t) { return isNonGenericObjectType(t) && !(ts.getObjectFlags(t) & 2097152 /* NonInferrableType */); })) { + result = someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */); + } } - if (!result && (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */)) { + if (!result && (source.flags & 201064448 /* StructuredOrInstantiable */ || target.flags & 201064448 /* StructuredOrInstantiable */)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) { resetErrorInfo(saveErrorInfo); } @@ -48678,12 +48861,12 @@ var ts; } return 0 /* False */; } - function eachTypeRelatedToType(source, target, reportErrors) { + function eachTypeRelatedToType(source, target, reportErrors, intersectionState) { var result = -1 /* True */; var sourceTypes = source.types; for (var _i = 0, sourceTypes_2 = sourceTypes; _i < sourceTypes_2.length; _i++) { var sourceType = sourceTypes_2[_i]; - var related = isRelatedTo(sourceType, target, reportErrors); + var related = isRelatedTo(sourceType, target, reportErrors, /*headMessage*/ undefined, intersectionState); if (!related) { return 0 /* False */; } @@ -48771,10 +48954,10 @@ var ts; // We're in the middle of variance checking - integrate any unmeasurable/unreliable flags from this cached component var saved = entry & 24 /* ReportsMask */; if (saved & 8 /* ReportsUnmeasurable */) { - instantiateType(source, reportUnmeasurableMarkers); + instantiateType(source, makeFunctionTypeMapper(reportUnmeasurableMarkers)); } if (saved & 16 /* ReportsUnreliable */) { - instantiateType(source, reportUnreliableMarkers); + instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers)); } } return entry & 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */; @@ -48813,7 +48996,8 @@ var ts; if (outofbandVarianceMarkerHandler) { originalHandler = outofbandVarianceMarkerHandler; outofbandVarianceMarkerHandler = function (onlyUnreliable) { - propagatingVarianceFlags |= onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */; + propagatingVarianceFlags |= + onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */; return originalHandler(onlyUnreliable); }; } @@ -48940,6 +49124,17 @@ var ts; } } } + else if (target.flags & 134217728 /* Awaited */ && source.flags & 134217728 /* Awaited */) { + var targetType = target.awaitedType; + var sourceType = instantiateType(source.awaitedType, makeFunctionTypeMapper(reportUnreliableMarkers)); + // An `awaited S` is related to an `awaited T` if `S` is related to `T`: + // + // S <: T ⇒ awaited S <: awaited T + // + if (result = isRelatedTo(sourceType, targetType, reportErrors)) { + return result; + } + } else if (isGenericMappedType(target)) { // A source type T is related to a target type { [P in X]: T[P] } var template = getTemplateTypeFromMappedType(target); @@ -49053,6 +49248,21 @@ var ts; } } } + else if (source.flags & 134217728 /* Awaited */) { + // An `awaited S` is related to `T` if `awaited C` is related to `T`, where `C` is the + // constraint of `S`: + // + // S <: C ^ awaited C <: T ⇒ awaited S <: T + // + // For example `awaited Promise` is assignable to `number`. + var constraint = getConstraintOfType(source.awaitedType); + var awaitedConstraint = constraint && getAwaitedType(constraint); + if (awaitedConstraint) { + if (result = isRelatedTo(awaitedConstraint, target, reportErrors)) { + return result; + } + } + } else { // An empty object type is related to any mapped type that includes a '?' modifier. if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target) && isEmptyObjectType(source)) { @@ -49212,7 +49422,7 @@ var ts; if (modifiersRelated) { var result_6; var targetConstraint = getConstraintTypeFromMappedType(target); - var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers); + var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers)); if (result_6 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) { var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); return result_6 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); @@ -49680,7 +49890,7 @@ var ts; * See signatureAssignableTo, compareSignaturesIdentical */ function signatureRelatedTo(source, target, erase, reportErrors, incompatibleReporter) { - return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0, reportErrors, reportError, incompatibleReporter, isRelatedTo, reportUnreliableMarkers); + return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0, reportErrors, reportError, incompatibleReporter, isRelatedTo, makeFunctionTypeMapper(reportUnreliableMarkers)); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -49831,10 +50041,6 @@ var ts; // make sure exactly 1 matches before returning it return match === -1 || discriminable.indexOf(/*searchElement*/ true, match + 1) !== -1 ? defaultValue : target.types[match]; } - function isFromSpreadAssignment(prop, container) { - var _a; - return ((_a = prop.valueDeclaration) === null || _a === void 0 ? void 0 : _a.parent) !== container.valueDeclaration; - } /** * A type is 'weak' if it is an object type with at least one optional property * and no required properties, call/construct signatures or index signatures @@ -49908,13 +50114,11 @@ var ts; variance = 4 /* Independent */; } outofbandVarianceMarkerHandler = oldHandler; - if (unmeasurable || unreliable) { - if (unmeasurable) { - variance |= 8 /* Unmeasurable */; - } - if (unreliable) { - variance |= 16 /* Unreliable */; - } + if (unmeasurable) { + variance |= 8 /* Unmeasurable */; + } + if (unreliable) { + variance |= 16 /* Unreliable */; } variances.push(variance); }; @@ -50687,12 +50891,12 @@ var ts; } var diagnostic; switch (declaration.kind) { - case 209 /* BinaryExpression */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 210 /* BinaryExpression */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 156 /* Parameter */: + case 157 /* Parameter */: var param = declaration; if (ts.isIdentifier(param.name) && (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && @@ -50707,23 +50911,23 @@ var ts; noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; if (!noImplicitAny) { // Don't issue a suggestion for binding elements since the codefix doesn't yet support them. return; } break; - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: if (noImplicitAny && !declaration.name) { if (wideningKind === 1 /* GeneratorYield */) { error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); @@ -50737,7 +50941,7 @@ var ts; wideningKind === 1 /* GeneratorYield */ ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 186 /* MappedType */: + case 187 /* MappedType */: if (noImplicitAny) { error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } @@ -50799,8 +51003,8 @@ var ts; signature: signature, flags: flags, compareTypes: compareTypes, - mapper: function (t) { return mapToInferredType(context, t, /*fix*/ true); }, - nonFixingMapper: function (t) { return mapToInferredType(context, t, /*fix*/ false); }, + mapper: makeFunctionTypeMapper(function (t) { return mapToInferredType(context, t, /*fix*/ true); }), + nonFixingMapper: makeFunctionTypeMapper(function (t) { return mapToInferredType(context, t, /*fix*/ false); }), }; return context; } @@ -50865,7 +51069,7 @@ var ts; if (objectFlags & 67108864 /* CouldContainTypeVariablesComputed */) { return !!(objectFlags & 134217728 /* CouldContainTypeVariables */); } - var result = !!(type.flags & 63176704 /* Instantiable */ || + var result = !!(type.flags & 197394432 /* Instantiable */ || objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 131072 /* ObjectRestType */) || @@ -51161,7 +51365,7 @@ var ts; var indexType = getSimplifiedType(target.indexType, /*writing*/ false); // Generally simplifications of instantiable indexes are avoided to keep relationship checking correct, however if our target is an access, we can consider // that key of that access to be "instantiated", since we're looking to find the infernce goal in any way we can. - if (indexType.flags & 63176704 /* Instantiable */) { + if (indexType.flags & 197394432 /* Instantiable */) { var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, /*writing*/ false), indexType, /*writing*/ false); if (simplified_1 && simplified_1 !== target) { invokeOnce(source, simplified_1, inferFromTypes); @@ -51196,6 +51400,9 @@ var ts; inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } + else if (source.flags & 134217728 /* Awaited */ && target.flags & 134217728 /* Awaited */) { + inferFromTypes(source.awaitedType, target.awaitedType); + } else if (target.flags & 16777216 /* Conditional */) { var savePriority = priority; priority |= contravariant ? 16 /* ContravariantConditional */ : 0; @@ -51203,6 +51410,10 @@ var ts; inferToMultipleTypes(source, targetTypes, target.flags); priority = savePriority; } + else if (target.flags & 134217728 /* Awaited */) { + var targetTypes = [target.awaitedType, createPromiseLikeType(target.awaitedType)]; + inferToMultipleTypes(source, targetTypes, target.flags); + } else if (target.flags & 3145728 /* UnionOrIntersection */) { inferToMultipleTypes(source, target.types, target.flags); } @@ -51216,7 +51427,7 @@ var ts; } else { source = getReducedType(source); - if (!(priority & 128 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 63176704 /* Instantiable */))) { + if (!(priority & 128 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 197394432 /* Instantiable */))) { var apparentSource = getApparentType(source); // getApparentType can return _any_ type, since an indexed access or conditional may simplify to any other type. // If that occurs and it doesn't simplify to an object or intersection, we'll need to restart `inferFromTypes` @@ -51498,6 +51709,32 @@ var ts; } // Infer from the members of source and target only if the two types are possibly related if (!typesDefinitelyUnrelated(source, target)) { + if (isArrayType(source) || isTupleType(source)) { + if (isTupleType(target)) { + var sourceLength = isTupleType(source) ? getLengthOfTupleType(source) : 0; + var targetLength = getLengthOfTupleType(target); + var sourceRestType = isTupleType(source) ? getRestTypeOfTupleType(source) : getElementTypeOfArrayType(source); + var targetRestType = getRestTypeOfTupleType(target); + var fixedLength = targetLength < sourceLength || sourceRestType ? targetLength : sourceLength; + for (var i = 0; i < fixedLength; i++) { + inferFromTypes(i < sourceLength ? getTypeArguments(source)[i] : sourceRestType, getTypeArguments(target)[i]); + } + if (targetRestType) { + var types = fixedLength < sourceLength ? getTypeArguments(source).slice(fixedLength, sourceLength) : []; + if (sourceRestType) { + types.push(sourceRestType); + } + if (types.length) { + inferFromTypes(getUnionType(types), targetRestType); + } + } + return; + } + if (isArrayType(target)) { + inferFromIndexTypes(source, target); + return; + } + } inferFromProperties(source, target); inferFromSignatures(source, target, 0 /* Call */); inferFromSignatures(source, target, 1 /* Construct */); @@ -51505,32 +51742,6 @@ var ts; } } function inferFromProperties(source, target) { - if (isArrayType(source) || isTupleType(source)) { - if (isTupleType(target)) { - var sourceLength = isTupleType(source) ? getLengthOfTupleType(source) : 0; - var targetLength = getLengthOfTupleType(target); - var sourceRestType = isTupleType(source) ? getRestTypeOfTupleType(source) : getElementTypeOfArrayType(source); - var targetRestType = getRestTypeOfTupleType(target); - var fixedLength = targetLength < sourceLength || sourceRestType ? targetLength : sourceLength; - for (var i = 0; i < fixedLength; i++) { - inferFromTypes(i < sourceLength ? getTypeArguments(source)[i] : sourceRestType, getTypeArguments(target)[i]); - } - if (targetRestType) { - var types = fixedLength < sourceLength ? getTypeArguments(source).slice(fixedLength, sourceLength) : []; - if (sourceRestType) { - types.push(sourceRestType); - } - if (types.length) { - inferFromTypes(getUnionType(types), targetRestType); - } - } - return; - } - if (isArrayType(target)) { - inferFromIndexTypes(source, target); - return; - } - } var properties = getPropertiesOfObjectType(target); for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { var targetProp = properties_3[_i]; @@ -51548,7 +51759,7 @@ var ts; var len = sourceLen < targetLen ? sourceLen : targetLen; var skipParameters = !!(ts.getObjectFlags(source) & 2097152 /* NonInferrableType */); for (var i = 0; i < len; i++) { - inferFromSignature(getBaseSignature(sourceSignatures[sourceLen - len + i]), getBaseSignature(targetSignatures[targetLen - len + i]), skipParameters); + inferFromSignature(getBaseSignature(sourceSignatures[sourceLen - len + i]), getErasedSignature(targetSignatures[targetLen - len + i]), skipParameters); } } function inferFromSignature(source, target, skipParameters) { @@ -51556,7 +51767,7 @@ var ts; var saveBivariant = bivariant; var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; // Once we descend into a bivariant signature we remain bivariant for all nested inferences - bivariant = bivariant || kind === 161 /* MethodDeclaration */ || kind === 160 /* MethodSignature */ || kind === 162 /* Constructor */; + bivariant = bivariant || kind === 162 /* MethodDeclaration */ || kind === 161 /* MethodSignature */ || kind === 163 /* Constructor */; applyToParameterTypes(source, target, inferFromContravariantTypes); bivariant = saveBivariant; } @@ -51664,7 +51875,7 @@ var ts; if (defaultType) { // Instantiate the default type. Any forward reference to a type // parameter should be instantiated to the empty object type. - inferredType = instantiateType(defaultType, combineTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper)); + inferredType = instantiateType(defaultType, mergeTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper)); } } } @@ -51726,7 +51937,7 @@ var ts; case "AsyncIterator": return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later; default: - if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; } else { @@ -51747,7 +51958,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - return !!ts.findAncestor(node, function (n) { return n.kind === 172 /* TypeQuery */ ? true : n.kind === 75 /* Identifier */ || n.kind === 153 /* QualifiedName */ ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 173 /* TypeQuery */ ? true : n.kind === 75 /* Identifier */ || n.kind === 154 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -51762,11 +51973,11 @@ var ts; return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; case 104 /* ThisKeyword */: return "0"; - case 218 /* NonNullExpression */: - case 200 /* ParenthesizedExpression */: + case 219 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: var propName = getAccessedPropertyName(node); if (propName !== undefined) { var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); @@ -51777,24 +51988,24 @@ var ts; } function isMatchingReference(source, target) { switch (target.kind) { - case 200 /* ParenthesizedExpression */: - case 218 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: + case 219 /* NonNullExpression */: return isMatchingReference(source, target.expression); } switch (source.kind) { case 75 /* Identifier */: return target.kind === 75 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 242 /* VariableDeclaration */ || target.kind === 191 /* BindingElement */) && + (target.kind === 243 /* VariableDeclaration */ || target.kind === 192 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 104 /* ThisKeyword */: return target.kind === 104 /* ThisKeyword */; case 102 /* SuperKeyword */: return target.kind === 102 /* SuperKeyword */; - case 218 /* NonNullExpression */: - case 200 /* ParenthesizedExpression */: + case 219 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: return isMatchingReference(source.expression, target); - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return ts.isAccessExpression(target) && getAccessedPropertyName(source) === getAccessedPropertyName(target) && isMatchingReference(source.expression, target.expression); @@ -51802,7 +52013,7 @@ var ts; return false; } function getAccessedPropertyName(access) { - return access.kind === 194 /* PropertyAccessExpression */ ? access.name.escapedText : + return access.kind === 195 /* PropertyAccessExpression */ ? access.name.escapedText : ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } @@ -51831,7 +52042,7 @@ var ts; if (prop.isDiscriminantProperty === undefined) { prop.isDiscriminantProperty = (prop.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && - !maybeTypeOfKind(getTypeOfSymbol(prop), 63176704 /* Instantiable */); + !maybeTypeOfKind(getTypeOfSymbol(prop), 197394432 /* Instantiable */); } return !!prop.isDiscriminantProperty; } @@ -51864,7 +52075,7 @@ var ts; } } } - if (callExpression.expression.kind === 194 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 195 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -51982,7 +52193,7 @@ var ts; if (flags & 67108864 /* NonPrimitive */) { return strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */; } - if (flags & 63176704 /* Instantiable */) { + if (flags & 197394432 /* Instantiable */) { return getTypeFacts(getBaseConstraintOfType(type) || unknownType); } if (flags & 3145728 /* UnionOrIntersection */) { @@ -52019,15 +52230,15 @@ var ts; return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 192 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 281 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 193 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 282 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 209 /* BinaryExpression */ && parent.parent.left === parent || - parent.parent.kind === 232 /* ForOfStatement */ && parent.parent.initializer === parent; + return parent.parent.kind === 210 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 233 /* ForOfStatement */ && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -52044,21 +52255,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return stringType; - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || errorType; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return undefinedType; - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return errorType; @@ -52066,7 +52277,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 189 /* ObjectBindingPattern */ ? + var type = pattern.kind === 190 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : @@ -52084,30 +52295,30 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 231 /* ForInStatement */) { + if (node.parent.parent.kind === 232 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 232 /* ForOfStatement */) { + if (node.parent.parent.kind === 233 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 242 /* VariableDeclaration */ ? + return node.kind === 243 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function isEmptyArrayAssignment(node) { - return node.kind === 242 /* VariableDeclaration */ && node.initializer && + return node.kind === 243 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 191 /* BindingElement */ && node.parent.kind === 209 /* BinaryExpression */ && + node.kind !== 192 /* BindingElement */ && node.parent.kind === 210 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: return getReferenceCandidate(node.left); @@ -52119,13 +52330,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 200 /* ParenthesizedExpression */ || - parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || - parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? + return parent.kind === 201 /* ParenthesizedExpression */ || + parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || + parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 277 /* CaseClause */) { + if (clause.kind === 278 /* CaseClause */) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -52141,20 +52352,19 @@ var ts; } return links.switchTypes; } - // Get the types from all cases in a switch on `typeof`. An - // `undefined` element denotes an explicit `default` clause. - function getSwitchClauseTypeOfWitnesses(switchStatement) { + function getSwitchClauseTypeOfWitnesses(switchStatement, retainDefault) { var witnesses = []; for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) { var clause = _a[_i]; - if (clause.kind === 277 /* CaseClause */) { + if (clause.kind === 278 /* CaseClause */) { if (ts.isStringLiteralLike(clause.expression)) { witnesses.push(clause.expression.text); continue; } return ts.emptyArray; } - witnesses.push(/*explicitDefaultStatement*/ undefined); + if (retainDefault) + witnesses.push(/*explicitDefaultStatement*/ undefined); } return witnesses; } @@ -52308,12 +52518,12 @@ var ts; var root = getReferenceRoot(node); var parent = root.parent; var isLengthPushOrUnshift = ts.isPropertyAccessExpression(parent) && (parent.name.escapedText === "length" || - parent.parent.kind === 196 /* CallExpression */ + parent.parent.kind === 197 /* CallExpression */ && ts.isIdentifier(parent.name) && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 195 /* ElementAccessExpression */ && + var isElementAssignment = parent.kind === 196 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 209 /* BinaryExpression */ && + parent.parent.kind === 210 /* BinaryExpression */ && parent.parent.operatorToken.kind === 62 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -52321,8 +52531,8 @@ var ts; return isLengthPushOrUnshift || isElementAssignment; } function isDeclarationWithExplicitTypeAnnotation(declaration) { - return !!(declaration && (declaration.kind === 242 /* VariableDeclaration */ || declaration.kind === 156 /* Parameter */ || - declaration.kind === 159 /* PropertyDeclaration */ || declaration.kind === 158 /* PropertySignature */) && + return !!(declaration && (declaration.kind === 243 /* VariableDeclaration */ || declaration.kind === 157 /* Parameter */ || + declaration.kind === 160 /* PropertyDeclaration */ || declaration.kind === 159 /* PropertySignature */) && ts.getEffectiveTypeAnnotationNode(declaration)); } function getExplicitTypeOfSymbol(symbol, diagnostic) { @@ -52352,11 +52562,11 @@ var ts; return getExplicitThisType(node); case 102 /* SuperKeyword */: return checkSuperExpression(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: var type = getTypeOfDottedName(node.expression, diagnostic); var prop = type && getPropertyOfType(type, node.name.escapedText); return prop && getExplicitTypeOfSymbol(prop, diagnostic); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return getTypeOfDottedName(node.expression, diagnostic); } } @@ -52370,7 +52580,7 @@ var ts; // circularities in control flow analysis, we use getTypeOfDottedName when resolving the call // target expression of an assertion. var funcType = void 0; - if (node.parent.kind === 226 /* ExpressionStatement */) { + if (node.parent.kind === 227 /* ExpressionStatement */) { funcType = getTypeOfDottedName(node.expression, /*diagnostic*/ undefined); } else if (node.expression.kind !== 102 /* SuperKeyword */) { @@ -52414,7 +52624,7 @@ var ts; } function isFalseExpression(expr) { var node = ts.skipParentheses(expr); - return node.kind === 91 /* FalseKeyword */ || node.kind === 209 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || + return node.kind === 91 /* FalseKeyword */ || node.kind === 210 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right)); } function isReachableFlowNodeWorker(flow, noCacheCheck) { @@ -52489,7 +52699,7 @@ var ts; if (flowAnalysisDisabled) { return errorType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 133970943 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 268188671 /* Narrowable */)) { return declaredType; } flowInvocationCount++; @@ -52501,7 +52711,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); - if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 218 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 219 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { return declaredType; } return resultType; @@ -52582,8 +52792,8 @@ var ts; // Check if we should continue with the control flow of the containing function. var container = flow.node; if (container && container !== flowContainer && - reference.kind !== 194 /* PropertyAccessExpression */ && - reference.kind !== 195 /* ElementAccessExpression */ && + reference.kind !== 195 /* PropertyAccessExpression */ && + reference.kind !== 196 /* ElementAccessExpression */ && reference.kind !== 104 /* ThisKeyword */) { flow = container.flowNode; continue; @@ -52608,7 +52818,7 @@ var ts; } function getInitialOrAssignedType(flow) { var node = flow.node; - return getConstraintForLocation(node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */ ? + return getConstraintForLocation(node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference); } @@ -52648,14 +52858,14 @@ var ts; // in which case we continue control flow analysis back to the function's declaration if (ts.isVariableDeclaration(node) && (ts.isInJSFile(node) || ts.isVarConst(node))) { var init = ts.getDeclaredExpandoInitializer(node); - if (init && (init.kind === 201 /* FunctionExpression */ || init.kind === 202 /* ArrowFunction */)) { + if (init && (init.kind === 202 /* FunctionExpression */ || init.kind === 203 /* ArrowFunction */)) { return getTypeAtFlowNode(flow.antecedent); } } return declaredType; } // for (const _ in ref) acts as a nonnull on ref - if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 231 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { + if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 232 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))); } // Assignment doesn't affect reference @@ -52666,7 +52876,7 @@ var ts; if (node.kind === 91 /* FalseKeyword */) { return unreachableNeverType; } - if (node.kind === 209 /* BinaryExpression */) { + if (node.kind === 210 /* BinaryExpression */) { if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) { return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); } @@ -52697,7 +52907,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 196 /* CallExpression */ ? + var expr = node.kind === 197 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -52705,7 +52915,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 196 /* CallExpression */) { + if (node.kind === 197 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -52755,7 +52965,7 @@ var ts; if (isMatchingReference(reference, expr)) { type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } - else if (expr.kind === 204 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { + else if (expr.kind === 205 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } else { @@ -52763,7 +52973,7 @@ var ts; if (optionalChainContainsReference(expr, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & (32768 /* Undefined */ | 131072 /* Never */)); }); } - else if (expr.kind === 204 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { + else if (expr.kind === 205 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined"); }); } } @@ -52975,12 +53185,18 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 204 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { + if (left_1.kind === 205 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 204 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { + if (right_1.kind === 205 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } + if (ts.isConstructorAccessExpression(left_1)) { + return narrowTypeByConstructor(type, left_1, operator_1, right_1, assumeTrue); + } + if (ts.isConstructorAccessExpression(right_1)) { + return narrowTypeByConstructor(type, right_1, operator_1, left_1, assumeTrue); + } if (isMatchingReference(reference, left_1)) { return narrowTypeByEquality(type, operator_1, right_1, assumeTrue); } @@ -53112,7 +53328,7 @@ var ts; if (isTypeSubtypeOf(targetType, type)) { return targetType; } - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(targetType, constraint)) { return getIntersectionType([type, targetType]); @@ -53182,7 +53398,7 @@ var ts; if (isTypeSubtypeOf(candidate, type)) { return candidate; } - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(candidate, constraint)) { return getIntersectionType([type, candidate]); @@ -53192,7 +53408,7 @@ var ts; }; } function narrowBySwitchOnTypeOf(type, switchStatement, clauseStart, clauseEnd) { - var switchWitnesses = getSwitchClauseTypeOfWitnesses(switchStatement); + var switchWitnesses = getSwitchClauseTypeOfWitnesses(switchStatement, /*retainDefault*/ true); if (!switchWitnesses.length) { return type; } @@ -53255,6 +53471,50 @@ var ts; } return getTypeWithFacts(mapType(type, narrowTypeForTypeofSwitch(impliedType)), switchFacts); } + function narrowTypeByConstructor(type, constructorAccessExpr, operator, identifier, assumeTrue) { + // Do not narrow when checking inequality. + if (assumeTrue ? (operator !== 34 /* EqualsEqualsToken */ && operator !== 36 /* EqualsEqualsEqualsToken */) : (operator !== 35 /* ExclamationEqualsToken */ && operator !== 37 /* ExclamationEqualsEqualsToken */)) { + return type; + } + // In the case of `x.y`, a `x.constructor === T` type guard resets the narrowed type of `y` to its declared type. + if (!isMatchingReference(reference, constructorAccessExpr.expression)) { + return declaredType; + } + // Get the type of the constructor identifier expression, if it is not a function then do not narrow. + var identifierType = getTypeOfExpression(identifier); + if (!isFunctionType(identifierType) && !isConstructorType(identifierType)) { + return type; + } + // Get the prototype property of the type identifier so we can find out its type. + var prototypeProperty = getPropertyOfType(identifierType, "prototype"); + if (!prototypeProperty) { + return type; + } + // Get the type of the prototype, if it is undefined, or the global `Object` or `Function` types then do not narrow. + var prototypeType = getTypeOfSymbol(prototypeProperty); + var candidate = !isTypeAny(prototypeType) ? prototypeType : undefined; + if (!candidate || candidate === globalObjectType || candidate === globalFunctionType) { + return type; + } + // If the type that is being narrowed is `any` then just return the `candidate` type since every type is a subtype of `any`. + if (isTypeAny(type)) { + return candidate; + } + // Filter out types that are not considered to be "constructed by" the `candidate` type. + return filterType(type, function (t) { return isConstructedBy(t, candidate); }); + function isConstructedBy(source, target) { + // If either the source or target type are a class type then we need to check that they are the same exact type. + // This is because you may have a class `A` that defines some set of properties, and another class `B` + // that defines the same set of properties as class `A`, in that case they are structurally the same + // type, but when you do something like `instanceOfA.constructor === B` it will return false. + if (source.flags & 524288 /* Object */ && ts.getObjectFlags(source) & 1 /* Class */ || + target.flags & 524288 /* Object */ && ts.getObjectFlags(target) & 1 /* Class */) { + return source.symbol === target.symbol; + } + // For all other types just check that the `source` type is a subtype of the `target` type. + return isTypeSubtypeOf(source, target); + } + } function narrowTypeByInstanceof(type, expr, assumeTrue) { var left = getReferenceCandidate(expr.left); if (!isMatchingReference(reference, left)) { @@ -53349,16 +53609,16 @@ var ts; case 75 /* Identifier */: case 104 /* ThisKeyword */: case 102 /* SuperKeyword */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return narrowTypeByCallExpression(type, expr, assumeTrue); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: if (expr.operator === 53 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -53403,9 +53663,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 250 /* ModuleBlock */ || - node.kind === 290 /* SourceFile */ || - node.kind === 159 /* PropertyDeclaration */; + node.kind === 251 /* ModuleBlock */ || + node.kind === 291 /* SourceFile */ || + node.kind === 160 /* PropertyDeclaration */; }); } // Check if a parameter is assigned anywhere within its declaring function. @@ -53427,7 +53687,7 @@ var ts; if (node.kind === 75 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 156 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 157 /* Parameter */) { symbol.isAssigned = true; } } @@ -53443,7 +53703,7 @@ var ts; function removeOptionalityFromDeclaredType(declaredType, declaration) { if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 156 /* Parameter */ && + declaration.kind === 157 /* Parameter */ && declaration.initializer && getFalsyFlags(declaredType) & 32768 /* Undefined */ && !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768 /* Undefined */); @@ -53457,13 +53717,13 @@ var ts; } function isConstraintPosition(node) { var parent = node.parent; - return parent.kind === 194 /* PropertyAccessExpression */ || - parent.kind === 196 /* CallExpression */ && parent.expression === node || - parent.kind === 195 /* ElementAccessExpression */ && parent.expression === node || - parent.kind === 191 /* BindingElement */ && parent.name === node && !!parent.initializer; + return parent.kind === 195 /* PropertyAccessExpression */ || + parent.kind === 197 /* CallExpression */ && parent.expression === node || + parent.kind === 196 /* ElementAccessExpression */ && parent.expression === node || + parent.kind === 192 /* BindingElement */ && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { - return type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); + return type.flags & 193200128 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); } function getConstraintForLocation(type, node) { // When a node is the left hand expression of a property access, element access, or call expression, @@ -53502,7 +53762,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 202 /* ArrowFunction */) { + if (container.kind === 203 /* ArrowFunction */) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasModifier(container, 256 /* Async */)) { @@ -53523,7 +53783,7 @@ var ts; // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration.kind === 245 /* ClassDeclaration */ + if (declaration.kind === 246 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -53535,14 +53795,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 214 /* ClassExpression */) { + else if (declaration.kind === 215 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); - while (container.kind !== 290 /* SourceFile */) { + while (container.kind !== 291 /* SourceFile */) { if (container.parent === declaration) { - if (container.kind === 159 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { + if (container.kind === 160 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 33554432 /* ConstructorReferenceInClass */; } @@ -53591,7 +53851,7 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 156 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 157 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; @@ -53600,8 +53860,8 @@ var ts; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 201 /* FunctionExpression */ || - flowContainer.kind === 202 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 202 /* FunctionExpression */ || + flowContainer.kind === 203 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } @@ -53610,9 +53870,9 @@ var ts; // declaration container are the same). var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || - isInTypeQuery(node) || node.parent.kind === 263 /* ExportSpecifier */) || - node.parent.kind === 218 /* NonNullExpression */ || - declaration.kind === 242 /* VariableDeclaration */ && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 264 /* ExportSpecifier */) || + node.parent.kind === 219 /* NonNullExpression */ || + declaration.kind === 243 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 8388608 /* Ambient */; var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : @@ -53647,7 +53907,7 @@ var ts; if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || ts.isSourceFile(symbol.valueDeclaration) || - symbol.valueDeclaration.parent.kind === 280 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 281 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -53670,7 +53930,7 @@ var ts; // mark iteration statement as containing block-scoped binding captured in some function var capturesBlockScopeBindingInLoopBody = true; if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container) { var part = getPartOfForStatementContainingNode(node.parent, container); if (part) { @@ -53691,7 +53951,7 @@ var ts; // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */; } @@ -53710,7 +53970,7 @@ var ts; function isAssignedInBodyOfForStatement(node, container) { // skip parenthesized nodes var current = node; - while (current.parent.kind === 200 /* ParenthesizedExpression */) { + while (current.parent.kind === 201 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -53718,7 +53978,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 207 /* PrefixUnaryExpression */ || current.parent.kind === 208 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 208 /* PrefixUnaryExpression */ || current.parent.kind === 209 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; } @@ -53731,7 +53991,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 159 /* PropertyDeclaration */ || container.kind === 162 /* Constructor */) { + if (container.kind === 160 /* PropertyDeclaration */ || container.kind === 163 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -53799,37 +54059,37 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var capturedByArrowFunction = false; - if (container.kind === 162 /* Constructor */) { + if (container.kind === 163 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 202 /* ArrowFunction */) { + if (container.kind === 203 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); capturedByArrowFunction = true; } switch (container.kind) { - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 162 /* Constructor */: + case 163 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: if (ts.hasModifier(container, 32 /* Static */) && !(compilerOptions.target === 99 /* ESNext */ && compilerOptions.useDefineForClassFields)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -53869,7 +54129,9 @@ var ts; var classSymbol = checkExpression(className).symbol; if (classSymbol && classSymbol.members && (classSymbol.flags & 16 /* Function */)) { var classType = getDeclaredTypeOfSymbol(classSymbol).thisType; - return getFlowTypeOfReference(node, classType); + if (classType) { + return getFlowTypeOfReference(node, classType); + } } } // Check if it's a constructor definition, can be either a variable decl or function decl @@ -53877,7 +54139,7 @@ var ts; // * /** @constructor */ function [name]() { ... } // * /** @constructor */ var x = function() { ... } else if (isInJS && - (container.kind === 201 /* FunctionExpression */ || container.kind === 244 /* FunctionDeclaration */) && + (container.kind === 202 /* FunctionExpression */ || container.kind === 245 /* FunctionDeclaration */) && ts.getJSDocClassTag(container)) { var classType = getDeclaredTypeOfSymbol(getMergedSymbol(container.symbol)).thisType; return getFlowTypeOfReference(node, classType); @@ -53924,7 +54186,7 @@ var ts; } function getClassNameFromPrototypeMethod(container) { // Check if it's the RHS of a x.prototype.y = function [name]() { .... } - if (container.kind === 201 /* FunctionExpression */ && + if (container.kind === 202 /* FunctionExpression */ && ts.isBinaryExpression(container.parent) && ts.getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = container' @@ -53934,16 +54196,16 @@ var ts; .expression; // x } // x.prototype = { method() { } } - else if (container.kind === 161 /* MethodDeclaration */ && - container.parent.kind === 193 /* ObjectLiteralExpression */ && + else if (container.kind === 162 /* MethodDeclaration */ && + container.parent.kind === 194 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { return container.parent.parent.left.expression; } // x.prototype = { method: function() { } } - else if (container.kind === 201 /* FunctionExpression */ && - container.parent.kind === 281 /* PropertyAssignment */ && - container.parent.parent.kind === 193 /* ObjectLiteralExpression */ && + else if (container.kind === 202 /* FunctionExpression */ && + container.parent.kind === 282 /* PropertyAssignment */ && + container.parent.parent.kind === 194 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { return container.parent.parent.parent.left.expression; @@ -53951,7 +54213,7 @@ var ts; // Object.defineProperty(x, "method", { value: function() { } }); // Object.defineProperty(x, "method", { set: (x: () => void) => void }); // Object.defineProperty(x, "method", { get: () => function() { }) }); - else if (container.kind === 201 /* FunctionExpression */ && + else if (container.kind === 202 /* FunctionExpression */ && ts.isPropertyAssignment(container.parent) && ts.isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && @@ -53976,7 +54238,7 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 300 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 301 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -53990,15 +54252,15 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 156 /* Parameter */ && n.parent === constructorDecl; }); + return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 157 /* Parameter */ && n.parent === constructorDecl; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 196 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 197 /* CallExpression */ && node.parent.expression === node; var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 202 /* ArrowFunction */) { + while (container && container.kind === 203 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -54011,14 +54273,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 154 /* ComputedPropertyName */; }); - if (current && current.kind === 154 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 155 /* ComputedPropertyName */; }); + if (current && current.kind === 155 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 193 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 194 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -54026,7 +54288,7 @@ var ts; } return errorType; } - if (!isCallExpression && container.kind === 162 /* Constructor */) { + if (!isCallExpression && container.kind === 163 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasModifier(container, 32 /* Static */) || isCallExpression) { @@ -54095,7 +54357,7 @@ var ts; // as a call expression cannot be used as the target of a destructuring assignment while a property access can. // // For element access expressions (`super[x]`), we emit a generic helper that forwards the element access in both situations. - if (container.kind === 161 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { + if (container.kind === 162 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -54109,7 +54371,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 193 /* ObjectLiteralExpression */) { + if (container.parent.kind === 194 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return errorType; @@ -54130,7 +54392,7 @@ var ts; if (!baseClassType) { return errorType; } - if (container.kind === 162 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 163 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return errorType; @@ -54145,7 +54407,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 162 /* Constructor */; + return container.kind === 163 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -54153,21 +54415,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 193 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 194 /* ObjectLiteralExpression */) { if (ts.hasModifier(container, 32 /* Static */)) { - return container.kind === 161 /* MethodDeclaration */ || - container.kind === 160 /* MethodSignature */ || - container.kind === 163 /* GetAccessor */ || - container.kind === 164 /* SetAccessor */; + return container.kind === 162 /* MethodDeclaration */ || + container.kind === 161 /* MethodSignature */ || + container.kind === 164 /* GetAccessor */ || + container.kind === 165 /* SetAccessor */; } else { - return container.kind === 161 /* MethodDeclaration */ || - container.kind === 160 /* MethodSignature */ || - container.kind === 163 /* GetAccessor */ || - container.kind === 164 /* SetAccessor */ || - container.kind === 159 /* PropertyDeclaration */ || - container.kind === 158 /* PropertySignature */ || - container.kind === 162 /* Constructor */; + return container.kind === 162 /* MethodDeclaration */ || + container.kind === 161 /* MethodSignature */ || + container.kind === 164 /* GetAccessor */ || + container.kind === 165 /* SetAccessor */ || + container.kind === 160 /* PropertyDeclaration */ || + container.kind === 159 /* PropertySignature */ || + container.kind === 163 /* Constructor */; } } } @@ -54175,10 +54437,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 161 /* MethodDeclaration */ || - func.kind === 163 /* GetAccessor */ || - func.kind === 164 /* SetAccessor */) && func.parent.kind === 193 /* ObjectLiteralExpression */ ? func.parent : - func.kind === 201 /* FunctionExpression */ && func.parent.kind === 281 /* PropertyAssignment */ ? func.parent.parent : + return (func.kind === 162 /* MethodDeclaration */ || + func.kind === 164 /* GetAccessor */ || + func.kind === 165 /* SetAccessor */) && func.parent.kind === 194 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 202 /* FunctionExpression */ && func.parent.kind === 282 /* PropertyAssignment */ ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -54190,7 +54452,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 202 /* ArrowFunction */) { + if (func.kind === 203 /* ArrowFunction */) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -54217,7 +54479,7 @@ var ts; if (thisType) { return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); } - if (literal.parent.kind !== 281 /* PropertyAssignment */) { + if (literal.parent.kind !== 282 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -54231,7 +54493,7 @@ var ts; // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. var parent = ts.walkUpParenthesizedExpressions(func.parent); - if (parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { + if (parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { var target = parent.left; if (ts.isAccessExpression(target)) { var expression = target.expression; @@ -54284,9 +54546,9 @@ var ts; return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 156 /* Parameter */: + case 157 /* Parameter */: return getContextuallyTypedParameterType(declaration); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return getContextualTypeForBindingElement(declaration); // By default, do nothing and return undefined - only parameters and binding elements have context implied by a parent } @@ -54295,7 +54557,7 @@ var ts; var parent = declaration.parent.parent; var name = declaration.propertyName || declaration.name; var parentType = getContextualTypeForVariableLikeDeclaration(parent) || - parent.kind !== 191 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); + parent.kind !== 192 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); if (parentType && !ts.isBindingPattern(name) && !isComputedNonLiteralName(name)) { var nameType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(nameType)) { @@ -54336,6 +54598,9 @@ var ts; if (contextualReturnType) { if (functionFlags & 2 /* Async */) { // Async function var contextualAwaitedType = getAwaitedTypeOfPromise(contextualReturnType); + if (contextualAwaitedType && contextualAwaitedType.flags & 134217728 /* Awaited */) { + contextualAwaitedType = contextualAwaitedType.awaitedType; + } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return contextualReturnType; // Regular function @@ -54347,6 +54612,9 @@ var ts; var contextualType = getContextualType(node); if (contextualType) { var contextualAwaitedType = getAwaitedType(contextualType); + if (contextualAwaitedType && contextualAwaitedType.flags & 134217728 /* Awaited */) { + contextualAwaitedType = contextualAwaitedType.awaitedType; + } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return undefined; @@ -54417,7 +54685,7 @@ var ts; return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 198 /* TaggedTemplateExpression */) { + if (template.parent.kind === 199 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -54653,21 +54921,21 @@ var ts; case 91 /* FalseKeyword */: case 100 /* NullKeyword */: case 75 /* Identifier */: - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: return true; - case 194 /* PropertyAccessExpression */: - case 200 /* ParenthesizedExpression */: + case 195 /* PropertyAccessExpression */: + case 201 /* ParenthesizedExpression */: return isPossiblyDiscriminantValue(node.expression); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return !node.expression || isPossiblyDiscriminantValue(node.expression); } return false; } function discriminateContextualTypeByObjectMembers(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 281 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 282 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } function discriminateContextualTypeByJSXAttributes(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 273 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 274 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. @@ -54692,7 +54960,7 @@ var ts; // If the given contextual type contains instantiable types and if a mapper representing // return type inferences is available, instantiate those types using that mapper. function instantiateContextualType(contextualType, node, contextFlags) { - if (contextualType && maybeTypeOfKind(contextualType, 63176704 /* Instantiable */)) { + if (contextualType && maybeTypeOfKind(contextualType, 197394432 /* Instantiable */)) { var inferenceContext = getInferenceContext(node); // If no inferences have been made, nothing is gained from instantiating as type parameters // would just be replaced with their defaults similar to the apparent type. @@ -54715,7 +54983,7 @@ var ts; // are classified as instantiable (i.e. it doesn't instantiate object types), and (b) it performs // no reductions on instantiated union types. function instantiateInstantiableTypes(type, mapper) { - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { return instantiateType(type, mapper); } if (type.flags & 1048576 /* Union */) { @@ -54753,58 +55021,58 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 191 /* BindingElement */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 192 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 202 /* ArrowFunction */: - case 235 /* ReturnStatement */: + case 203 /* ArrowFunction */: + case 236 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return getContextualTypeForAwaitOperand(parent); - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (parent.expression.kind === 96 /* ImportKeyword */) { return stringType; } /* falls through */ - case 197 /* NewExpression */: + case 198 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: return ts.isConstTypeReference(parent.type) ? undefined : getTypeFromTypeNode(parent.type); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node, contextFlags); - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent, contextFlags); - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: return getApparentTypeOfContextualType(parent.parent, contextFlags); - case 192 /* ArrayLiteralExpression */: { + case 193 /* ArrayLiteralExpression */: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); - case 221 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 211 /* TemplateExpression */); + case 222 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 212 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 200 /* ParenthesizedExpression */: { + case 201 /* ParenthesizedExpression */: { // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast. var tag = ts.isInJSFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent, contextFlags); } - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return getContextualTypeForJsxExpression(parent); - case 273 /* JsxAttribute */: - case 275 /* JsxSpreadAttribute */: + case 274 /* JsxAttribute */: + case 276 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: return getContextualJsxElementAttributesType(parent, contextFlags); } return undefined; @@ -54961,7 +55229,7 @@ var ts; return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 201 /* FunctionExpression */ || node.kind === 202 /* ArrowFunction */; + return node.kind === 202 /* FunctionExpression */ || node.kind === 203 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -54975,7 +55243,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; @@ -55020,8 +55288,8 @@ var ts; return checkIteratedTypeOrElementType(33 /* Spread */, arrayOrIterableType, undefinedType, node.expression); } function hasDefaultValue(node) { - return (node.kind === 191 /* BindingElement */ && !!node.initializer) || - (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); + return (node.kind === 192 /* BindingElement */ && !!node.initializer) || + (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); } function checkArrayLiteral(node, checkMode, forceTuple) { var elements = node.elements; @@ -55034,7 +55302,7 @@ var ts; var inConstContext = isConstContext(node); for (var i = 0; i < elementCount; i++) { var e = elements[i]; - var spread = e.kind === 213 /* SpreadElement */ && e.expression; + var spread = e.kind === 214 /* SpreadElement */ && e.expression; var spreadType = spread && checkExpression(spread, checkMode, forceTuple); if (spreadType && isTupleType(spreadType)) { elementTypes.push.apply(elementTypes, getTypeArguments(spreadType)); @@ -55120,7 +55388,7 @@ var ts; } function isNumericName(name) { switch (name.kind) { - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return isNumericComputedName(name); case 75 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -55206,11 +55474,12 @@ var ts; // Grammar checking checkGrammarObjectLiteralExpression(node, inDestructuringPattern); var propertiesTable; + var allPropertiesTable = ts.createSymbolTable(); var propertiesArray = []; var spread = emptyObjectType; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 189 /* ObjectBindingPattern */ || contextualType.pattern.kind === 193 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 190 /* ObjectBindingPattern */ || contextualType.pattern.kind === 194 /* ObjectLiteralExpression */); var inConstContext = isConstContext(node); var checkFlags = inConstContext ? 8 /* Readonly */ : 0; var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node); @@ -55225,13 +55494,13 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = getSymbolOfNode(memberDecl); - var computedNameType = memberDecl.name && memberDecl.name.kind === 154 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? + var computedNameType = memberDecl.name && memberDecl.name.kind === 155 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? checkComputedPropertyName(memberDecl.name) : undefined; - if (memberDecl.kind === 281 /* PropertyAssignment */ || - memberDecl.kind === 282 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 282 /* PropertyAssignment */ || + memberDecl.kind === 283 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { - var type = memberDecl.kind === 281 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : - memberDecl.kind === 282 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : + var type = memberDecl.kind === 282 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : + memberDecl.kind === 283 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode); if (isInJavascript) { var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -55254,8 +55523,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 281 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 282 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 282 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 283 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -55279,8 +55548,9 @@ var ts; prop.type = type; prop.target = member; member = prop; + allPropertiesTable.set(prop.escapedName, prop); } - else if (memberDecl.kind === 283 /* SpreadAssignment */) { + else if (memberDecl.kind === 284 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } @@ -55296,6 +55566,16 @@ var ts; error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); return errorType; } + for (var _i = 0, _a = getPropertiesOfType(type); _i < _a.length; _i++) { + var right = _a[_i]; + var rightType = getTypeOfSymbol(right); + var left = allPropertiesTable.get(right.escapedName); + if (strictNullChecks && + left && + !maybeTypeOfKind(rightType, 98304 /* Nullable */)) { + error(left.valueDeclaration, ts.Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, ts.unescapeLeadingUnderscores(left.escapedName)); + } + } spread = getSpreadType(spread, type, node.symbol, objectFlags, inConstContext); offset = i + 1; continue; @@ -55306,7 +55586,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 163 /* GetAccessor */ || memberDecl.kind === 164 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 164 /* GetAccessor */ || memberDecl.kind === 165 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) { @@ -55331,9 +55611,9 @@ var ts; // type with those properties for which the binding pattern specifies a default value. // If the object literal is spread into another object literal, skip this step and let the top-level object // literal handle it instead. - if (contextualTypeHasPattern && node.parent.kind !== 283 /* SpreadAssignment */) { - for (var _i = 0, _a = getPropertiesOfType(contextualType); _i < _a.length; _i++) { - var prop = _a[_i]; + if (contextualTypeHasPattern && node.parent.kind !== 284 /* SpreadAssignment */) { + for (var _b = 0, _c = getPropertiesOfType(contextualType); _b < _c.length; _b++) { + var prop = _c[_b]; if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) { if (!(prop.flags & 16777216 /* Optional */)) { error(prop.valueDeclaration || prop.bindingElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); @@ -55373,13 +55653,13 @@ var ts; } } function isValidSpreadType(type) { - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { var constraint = getBaseConstraintOfType(type); if (constraint !== undefined) { return isValidSpreadType(constraint); } } - return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */) || + return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 193200128 /* InstantiableNonPrimitive */) || getFalsyFlags(type) & 117632 /* DefinitelyFalsy */ && isValidSpreadType(removeDefinitelyFalsyTypes(type)) || type.flags & 3145728 /* UnionOrIntersection */ && ts.every(type.types, isValidSpreadType)); } @@ -55473,7 +55753,7 @@ var ts; } } else { - ts.Debug.assert(attributeDecl.kind === 275 /* JsxSpreadAttribute */); + ts.Debug.assert(attributeDecl.kind === 276 /* JsxSpreadAttribute */); if (attributesTable.size > 0) { spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, /*readonly*/ false); attributesTable = ts.createSymbolTable(); @@ -55496,7 +55776,7 @@ var ts; } } // Handle children attribute - var parent = openingLikeElement.parent.kind === 266 /* JsxElement */ ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 267 /* JsxElement */ ? openingLikeElement.parent : undefined; // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); @@ -55916,7 +56196,7 @@ var ts; */ function checkPropertyAccessibility(node, isSuper, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 153 /* QualifiedName */ ? node.right : node.kind === 188 /* ImportType */ ? node : node.name; + var errorNode = node.kind === 154 /* QualifiedName */ ? node.right : node.kind === 189 /* ImportType */ ? node : node.name; if (ts.getCheckFlags(prop) & 1024 /* ContainsPrivate */) { // Synthetic property with private constituent property error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type)); @@ -56075,7 +56355,7 @@ var ts; return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right); } function isMethodAccessForCall(node) { - while (node.parent.kind === 200 /* ParenthesizedExpression */) { + while (node.parent.kind === 201 /* ParenthesizedExpression */) { node = node.parent; } return ts.isCallOrNewExpression(node.parent) && node.parent.expression === node; @@ -56228,7 +56508,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 162 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { + if (flowContainer.kind === 163 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { assumeUninitialized = true; } } @@ -56260,8 +56540,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName); } - else if (valueDeclaration.kind === 245 /* ClassDeclaration */ && - node.parent.kind !== 169 /* TypeReference */ && + else if (valueDeclaration.kind === 246 /* ClassDeclaration */ && + node.parent.kind !== 170 /* TypeReference */ && !(valueDeclaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName); @@ -56273,22 +56553,22 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return true; - case 281 /* PropertyAssignment */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 283 /* SpreadAssignment */: - case 154 /* ComputedPropertyName */: - case 221 /* TemplateSpan */: - case 276 /* JsxExpression */: - case 273 /* JsxAttribute */: - case 274 /* JsxAttributes */: - case 275 /* JsxSpreadAttribute */: - case 268 /* JsxOpeningElement */: - case 216 /* ExpressionWithTypeArguments */: - case 279 /* HeritageClause */: + case 282 /* PropertyAssignment */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 284 /* SpreadAssignment */: + case 155 /* ComputedPropertyName */: + case 222 /* TemplateSpan */: + case 277 /* JsxExpression */: + case 274 /* JsxAttribute */: + case 275 /* JsxAttributes */: + case 276 /* JsxSpreadAttribute */: + case 269 /* JsxOpeningElement */: + case 217 /* ExpressionWithTypeArguments */: + case 280 /* HeritageClause */: return false; default: return ts.isExpressionNode(node) ? false : "quit"; @@ -56438,7 +56718,19 @@ var ts; return ts.getSpellingSuggestion(name, symbols, getCandidateName); function getCandidateName(candidate) { var candidateName = ts.symbolName(candidate); - return !ts.startsWith(candidateName, "\"") && candidate.flags & meaning ? candidateName : undefined; + if (ts.startsWith(candidateName, "\"")) { + return undefined; + } + if (candidate.flags & meaning) { + return candidateName; + } + if (candidate.flags & 2097152 /* Alias */) { + var alias = tryResolveAlias(candidate); + if (alias && alias.flags & meaning) { + return candidateName; + } + } + return undefined; } } function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isThisAccess) { @@ -56451,7 +56743,7 @@ var ts; if (!hasPrivateModifier && !hasPrivateIdentifier) { return; } - if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */))) { + if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */)) { return; } if (isThisAccess) { @@ -56465,16 +56757,16 @@ var ts; } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return isValidPropertyAccessWithType(node, node.expression.kind === 102 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression))); - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getWidenedType(checkExpression(node.left))); - case 188 /* ImportType */: + case 189 /* ImportType */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getTypeFromTypeNode(node)); } } function isValidPropertyAccessForCompletions(node, type, property) { - return isValidPropertyAccessWithType(node, node.kind === 194 /* PropertyAccessExpression */ && node.expression.kind === 102 /* SuperKeyword */, property.escapedName, type); + return isValidPropertyAccessWithType(node, node.kind === 195 /* PropertyAccessExpression */ && node.expression.kind === 102 /* SuperKeyword */, property.escapedName, type); // Previously we validated the 'this' type of methods but this adversely affected performance. See #31377 for more context. } function isValidPropertyAccessWithType(node, isSuper, propertyName, type) { @@ -56497,7 +56789,7 @@ var ts; */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 243 /* VariableDeclarationList */) { + if (initializer.kind === 244 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -56526,7 +56818,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 231 /* ForInStatement */ && + if (node.kind === 232 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -56610,13 +56902,13 @@ var ts; // This gets us diagnostics for the type arguments and marks them as referenced. ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 198 /* TaggedTemplateExpression */) { + if (node.kind === 199 /* TaggedTemplateExpression */) { checkExpression(node.template); } else if (ts.isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); } - else if (node.kind !== 157 /* Decorator */) { + else if (node.kind !== 158 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -56680,7 +56972,7 @@ var ts; } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 213 /* SpreadElement */ || arg.kind === 220 /* SyntheticExpression */ && arg.isSpread); + return !!arg && (arg.kind === 214 /* SpreadElement */ || arg.kind === 221 /* SyntheticExpression */ && arg.isSpread); } function getSpreadArgumentIndex(args) { return ts.findIndex(args, isSpreadArgument); @@ -56694,9 +56986,9 @@ var ts; var callIsIncomplete = false; // In incomplete call we want to be lenient when we have too few arguments var effectiveParameterCount = getParameterCount(signature); var effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 198 /* TaggedTemplateExpression */) { + if (node.kind === 199 /* TaggedTemplateExpression */) { argCount = args.length; - if (node.template.kind === 211 /* TemplateExpression */) { + if (node.template.kind === 212 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. var lastSpan = ts.last(node.template.templateSpans); // we should always have at least one span. @@ -56711,7 +57003,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 157 /* Decorator */) { + else if (node.kind === 158 /* Decorator */) { argCount = getDecoratorArgumentCount(node, signature); } else if (ts.isJsxOpeningLikeElement(node)) { @@ -56726,7 +57018,7 @@ var ts; else { if (!node.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(node.kind === 197 /* NewExpression */); + ts.Debug.assert(node.kind === 198 /* NewExpression */); return getMinArgumentCount(signature) === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; @@ -56819,7 +57111,7 @@ var ts; // example, given a 'function wrap(cb: (x: T) => U): (x: T) => U' and a call expression // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the // return type of 'wrap'. - if (node.kind !== 157 /* Decorator */) { + if (node.kind !== 158 /* Decorator */) { var contextualType = getContextualType(node); if (contextualType) { // We clone the inference context to avoid disturbing a resolution in progress for an @@ -56862,7 +57154,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 215 /* OmittedExpression */) { + if (arg.kind !== 216 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); inferTypes(context.inferences, argType, paramType); @@ -56876,7 +57168,7 @@ var ts; } function getArrayifiedType(type) { return type.flags & 1048576 /* Union */ ? mapType(type, getArrayifiedType) : - type.flags & (1 /* Any */ | 63176704 /* Instantiable */) || isMutableArrayOrTuple(type) ? type : + type.flags & (1 /* Any */ | 197394432 /* Instantiable */) || isMutableArrayOrTuple(type) ? type : isTupleType(type) ? createTupleType(getTypeArguments(type), type.target.minLength, type.target.hasRestElement, /*readonly*/ false, type.target.associatedNames) : createArrayType(getIndexedAccessType(type, numberType)); } @@ -56886,7 +57178,7 @@ var ts; if (isSpreadArgument(arg)) { // We are inferring from a spread expression in the last argument position, i.e. both the parameter // and the argument are ...x forms. - return arg.kind === 220 /* SyntheticExpression */ ? + return arg.kind === 221 /* SyntheticExpression */ ? createArrayType(arg.type) : getArrayifiedType(checkExpressionWithContextualType(arg.expression, restType, context, 0 /* Normal */)); } @@ -57041,7 +57333,7 @@ var ts; return undefined; } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 197 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 198 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -57071,7 +57363,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 215 /* OmittedExpression */) { + if (arg.kind !== 216 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, /*inferenceContext*/ undefined, checkMode); // If one or more arguments are still excluded (as indicated by CheckMode.SkipContextSensitive), @@ -57112,7 +57404,7 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 196 /* CallExpression */) { + if (node.kind === 197 /* CallExpression */) { var callee = ts.skipOuterExpressions(node.expression); if (ts.isAccessExpression(callee)) { return callee.expression; @@ -57120,7 +57412,7 @@ var ts; } } function createSyntheticExpression(parent, type, isSpread) { - var result = ts.createNode(220 /* SyntheticExpression */, parent.pos, parent.end); + var result = ts.createNode(221 /* SyntheticExpression */, parent.pos, parent.end); result.parent = parent; result.type = type; result.isSpread = isSpread || false; @@ -57130,17 +57422,17 @@ var ts; * Returns the effective arguments for an expression that works like a function invocation. */ function getEffectiveCallArguments(node) { - if (node.kind === 198 /* TaggedTemplateExpression */) { + if (node.kind === 199 /* TaggedTemplateExpression */) { var template = node.template; var args_3 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 211 /* TemplateExpression */) { + if (template.kind === 212 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args_3.push(span.expression); }); } return args_3; } - if (node.kind === 157 /* Decorator */) { + if (node.kind === 158 /* Decorator */) { return getEffectiveDecoratorArguments(node); } if (ts.isJsxOpeningLikeElement(node)) { @@ -57170,30 +57462,30 @@ var ts; var parent = node.parent; var expr = node.expression; switch (parent.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class). return [ createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent))) ]; - case 156 /* Parameter */: + case 157 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts). var func = parent.parent; return [ - createSyntheticExpression(expr, parent.parent.kind === 162 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), + createSyntheticExpression(expr, parent.parent.kind === 163 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), createSyntheticExpression(expr, anyType), createSyntheticExpression(expr, numberType) ]; - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts). If we are emitting decorators // for ES3, we will only pass two arguments. - var hasPropDesc = parent.kind !== 159 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; + var hasPropDesc = parent.kind !== 160 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; return [ createSyntheticExpression(expr, getParentTypeOfClassElement(parent)), createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)), @@ -57207,17 +57499,17 @@ var ts; */ function getDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return 1; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return 2; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // For ES3 or decorators with only two parameters we supply only two arguments return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3; - case 156 /* Parameter */: + case 157 /* Parameter */: return 3; default: return ts.Debug.fail(); @@ -57342,8 +57634,8 @@ var ts; return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { - var isTaggedTemplate = node.kind === 198 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 157 /* Decorator */; + var isTaggedTemplate = node.kind === 199 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 158 /* Decorator */; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var reportErrors = !candidatesOutArray; var typeArguments; @@ -57405,7 +57697,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 196 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 197 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -57921,7 +58213,7 @@ var ts; var declaration = signature.declaration; var modifiers = ts.getSelectedModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */); // (1) Public constructors and (2) constructor functions are always accessible. - if (!modifiers || declaration.kind !== 162 /* Constructor */) { + if (!modifiers || declaration.kind !== 163 /* Constructor */) { return true; } var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -58052,16 +58344,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 156 /* Parameter */: + case 157 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return ts.Debug.fail(); @@ -58152,16 +58444,16 @@ var ts; } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 196 /* CallExpression */: + case 197 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray, checkMode); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray, checkMode); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 157 /* Decorator */: + case 158 /* Decorator */: return resolveDecorator(node, candidatesOutArray, checkMode); - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); } throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -58250,7 +58542,7 @@ var ts; return false; } var parent = node.parent; - while (parent && parent.kind === 194 /* PropertyAccessExpression */) { + while (parent && parent.kind === 195 /* PropertyAccessExpression */) { parent = parent.parent; } if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -58275,12 +58567,12 @@ var ts; if (node.expression.kind === 102 /* SuperKeyword */) { return voidType; } - if (node.kind === 197 /* NewExpression */) { + if (node.kind === 198 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 162 /* Constructor */ && - declaration.kind !== 166 /* ConstructSignature */ && - declaration.kind !== 171 /* ConstructorType */ && + declaration.kind !== 163 /* Constructor */ && + declaration.kind !== 167 /* ConstructSignature */ && + declaration.kind !== 172 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any @@ -58300,7 +58592,7 @@ var ts; if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) { return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent)); } - if (node.kind === 196 /* CallExpression */ && node.parent.kind === 226 /* ExpressionStatement */ && + if (node.kind === 197 /* CallExpression */ && node.parent.kind === 227 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { if (!ts.isDottedName(node.expression)) { error(node.expression, ts.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); @@ -58407,9 +58699,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 244 /* FunctionDeclaration */ + ? 245 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 242 /* VariableDeclaration */ + ? 243 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -58437,18 +58729,18 @@ var ts; case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return true; - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isValidConstAssertionArgument(node.expression); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: var op = node.operator; var arg = node.operand; return op === 40 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) || op === 39 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */; - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: var expr = node.expression; if (ts.isIdentifier(expr)) { var symbol = getSymbolAtLocation(expr); @@ -58498,7 +58790,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return errorType; } - else if (container.kind === 162 /* Constructor */) { + else if (container.kind === 163 /* Constructor */) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -58591,7 +58883,7 @@ var ts; } return length; } - function getMinArgumentCount(signature) { + function getMinArgumentCount(signature, strongArityForUntypedJS) { if (signatureHasRestParameter(signature)) { var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); if (isTupleType(restType)) { @@ -58601,6 +58893,9 @@ var ts; } } } + if (!strongArityForUntypedJS && signature.flags & 16 /* IsUntypedSignatureInJSFile */) { + return 0; + } return signature.minArgumentCount; } function hasEffectiveRestParameter(signature) { @@ -58762,7 +59057,7 @@ var ts; var yieldType; var nextType; var fallbackReturnType = voidType; - if (func.body.kind !== 223 /* Block */) { // Async or normal arrow function + if (func.body.kind !== 224 /* Block */) { // Async or normal arrow function returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */); if (isAsync) { // From within an async function you can return either a non-promise value or a promise. Any @@ -58949,10 +59244,9 @@ var ts; return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node)); } function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 204 /* TypeOfExpression */) { + if (node.expression.kind === 205 /* TypeOfExpression */) { var operandType = getTypeOfExpression(node.expression.expression); - // This cast is safe because the switch is possibly exhaustive and does not contain a default case, so there can be no undefined. - var witnesses = getSwitchClauseTypeOfWitnesses(node); + var witnesses = getSwitchClauseTypeOfWitnesses(node, /*retainDefault*/ false); // notEqualFacts states that the type of the switched value is not equal to every type in the switch. var notEqualFacts_1 = getFactsFromTypeofSwitch(0, 0, witnesses, /*hasDefault*/ true); var type_3 = getBaseConstraintOfType(operandType) || operandType; @@ -59009,11 +59303,11 @@ var ts; } function mayReturnNever(func) { switch (func.kind) { - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return true; - case 161 /* MethodDeclaration */: - return func.parent.kind === 193 /* ObjectLiteralExpression */; + case 162 /* MethodDeclaration */: + return func.parent.kind === 194 /* ObjectLiteralExpression */; default: return false; } @@ -59039,7 +59333,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (func.kind === 160 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 223 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 161 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 224 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */; @@ -59072,7 +59366,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); checkNodeDeferred(node); // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode && checkMode & 4 /* SkipContextSensitive */ && isContextSensitive(node)) { @@ -59096,7 +59390,7 @@ var ts; } // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 201 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 202 /* FunctionExpression */) { checkGrammarForGenerator(node); } contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -59149,7 +59443,7 @@ var ts; type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnType = getReturnTypeFromAnnotation(node); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); @@ -59162,7 +59456,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 223 /* Block */) { + if (node.body.kind === 224 /* Block */) { checkSourceElement(node.body); } else { @@ -59252,7 +59546,7 @@ var ts; expr.expression.kind === 104 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var ctor = ts.getContainingFunction(expr); - if (!(ctor && ctor.kind === 162 /* Constructor */)) { + if (!(ctor && ctor.kind === 163 /* Constructor */)) { return true; } if (symbol.valueDeclaration) { @@ -59277,7 +59571,7 @@ var ts; var symbol_2 = getNodeLinks(node).resolvedSymbol; if (symbol_2.flags & 2097152 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol_2); - return !!declaration && declaration.kind === 256 /* NamespaceImport */; + return !!declaration && declaration.kind === 257 /* NamespaceImport */; } } } @@ -59303,7 +59597,7 @@ var ts; error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); return booleanType; } - if (expr.kind === 194 /* PropertyAccessExpression */ && ts.isPrivateIdentifier(expr.name)) { + if (expr.kind === 195 /* PropertyAccessExpression */ && ts.isPrivateIdentifier(expr.name)) { error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier); } var links = getNodeLinks(expr); @@ -59353,7 +59647,7 @@ var ts; var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos); var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); var func = ts.getContainingFunction(node); - if (func && func.kind !== 162 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { + if (func && func.kind !== 163 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); } @@ -59525,7 +59819,7 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 296 /* NumberLike */ | 12288 /* ESSymbolLike */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { + if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 193200128 /* InstantiableNonPrimitive */)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -59545,7 +59839,7 @@ var ts; if (rightIsThis === void 0) { rightIsThis = false; } var properties = node.properties; var property = properties[propertyIndex]; - if (property.kind === 281 /* PropertyAssignment */ || property.kind === 282 /* ShorthandPropertyAssignment */) { + if (property.kind === 282 /* PropertyAssignment */ || property.kind === 283 /* ShorthandPropertyAssignment */) { var name = property.name; var exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -59558,9 +59852,9 @@ var ts; } var elementType = getIndexedAccessType(objectLiteralType, exprType, name); var type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 282 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); + return checkDestructuringAssignment(property.kind === 283 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); } - else if (property.kind === 283 /* SpreadAssignment */) { + else if (property.kind === 284 /* SpreadAssignment */) { if (propertyIndex < properties.length - 1) { error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } @@ -59603,8 +59897,8 @@ var ts; function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 215 /* OmittedExpression */) { - if (element.kind !== 213 /* SpreadElement */) { + if (element.kind !== 216 /* OmittedExpression */) { + if (element.kind !== 214 /* SpreadElement */) { var indexType = getLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { // We create a synthetic expression so that getIndexedAccessType doesn't get confused @@ -59622,7 +59916,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 209 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { + if (restExpression.kind === 210 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -59638,7 +59932,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { var target; - if (exprOrAssignment.kind === 282 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 283 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -59654,24 +59948,24 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 209 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { + if (target.kind === 210 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 193 /* ObjectLiteralExpression */) { + if (target.kind === 194 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 192 /* ArrayLiteralExpression */) { + if (target.kind === 193 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 283 /* SpreadAssignment */ ? + var error = target.parent.kind === 284 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; - var optionalError = target.parent.kind === 283 /* SpreadAssignment */ ? + var optionalError = target.parent.kind === 284 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; if (checkReferenceExpression(target, error, optionalError)) { @@ -59696,36 +59990,36 @@ var ts; case 75 /* Identifier */: case 10 /* StringLiteral */: case 13 /* RegularExpressionLiteral */: - case 198 /* TaggedTemplateExpression */: - case 211 /* TemplateExpression */: + case 199 /* TaggedTemplateExpression */: + case 212 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: case 100 /* NullKeyword */: - case 146 /* UndefinedKeyword */: - case 201 /* FunctionExpression */: - case 214 /* ClassExpression */: - case 202 /* ArrowFunction */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: - case 204 /* TypeOfExpression */: - case 218 /* NonNullExpression */: - case 267 /* JsxSelfClosingElement */: - case 266 /* JsxElement */: + case 147 /* UndefinedKeyword */: + case 202 /* FunctionExpression */: + case 215 /* ClassExpression */: + case 203 /* ArrowFunction */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 205 /* TypeOfExpression */: + case 219 /* NonNullExpression */: + case 268 /* JsxSelfClosingElement */: + case 267 /* JsxElement */: return true; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -59737,9 +60031,9 @@ var ts; } return false; // Some forms listed here for clarity - case 205 /* VoidExpression */: // Explicit opt-out - case 199 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 217 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 206 /* VoidExpression */: // Explicit opt-out + case 200 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 218 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -59771,7 +60065,7 @@ var ts; } checkGrammarNullishCoalesceWithLogicalExpression(node); var operator = node.operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (node.left.kind === 193 /* ObjectLiteralExpression */ || node.left.kind === 192 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (node.left.kind === 194 /* ObjectLiteralExpression */ || node.left.kind === 193 /* ArrayLiteralExpression */)) { finishInvocation(checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 104 /* ThisKeyword */)); break; } @@ -59838,7 +60132,7 @@ var ts; // expression-wide checks and does not use a work stack to fold nested binary expressions into the same callstack frame function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (left.kind === 193 /* ObjectLiteralExpression */ || left.kind === 192 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (left.kind === 194 /* ObjectLiteralExpression */ || left.kind === 193 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 104 /* ThisKeyword */); } var leftType; @@ -60243,7 +60537,7 @@ var ts; return stringType; } function getContextNode(node) { - if (node.kind === 274 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { + if (node.kind === 275 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes) } return node; @@ -60292,13 +60586,13 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 199 /* TypeAssertionExpression */ || node.kind === 217 /* AsExpression */; + return node.kind === 200 /* TypeAssertionExpression */ || node.kind === 218 /* AsExpression */; } function checkDeclarationInitializer(declaration, contextualType) { var initializer = ts.getEffectiveInitializer(declaration); var type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, 0 /* Normal */) : checkExpressionCached(initializer)); - return ts.isParameter(declaration) && declaration.name.kind === 190 /* ArrayBindingPattern */ && + return ts.isParameter(declaration) && declaration.name.kind === 191 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type; } @@ -60308,7 +60602,7 @@ var ts; var elementTypes = arity ? getTypeArguments(type).slice() : []; for (var i = arity; i < patternElements.length; i++) { var e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === 191 /* BindingElement */ && e.dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === 192 /* BindingElement */ && e.dotDotDotToken)) { elementTypes.push(!ts.isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, /*includePatternInType*/ false, /*reportErrors*/ false) : anyType); if (!ts.isOmittedExpression(e) && !hasDefaultValue(e)) { reportImplicitAny(e, anyType); @@ -60337,7 +60631,7 @@ var ts; var types = contextualType.types; return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); }); } - if (contextualType.flags & 58982400 /* InstantiableNonPrimitive */) { + if (contextualType.flags & 193200128 /* InstantiableNonPrimitive */) { // If the contextual type is a type variable constrained to a primitive type, consider // this a literal context for literals of that primitive type. For example, given a // type parameter 'T extends string', infer string literal types for T. @@ -60374,7 +60668,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); @@ -60385,7 +60679,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -60619,11 +60913,11 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 195 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 75 /* Identifier */ || node.kind === 153 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || - (node.parent.kind === 172 /* TypeQuery */ && node.parent.exprName === node)) || - (node.parent.kind === 263 /* ExportSpecifier */); // We allow reexporting const enums + var ok = (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 196 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 75 /* Identifier */ || node.kind === 154 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 173 /* TypeQuery */ && node.parent.exprName === node)) || + (node.parent.kind === 264 /* ExportSpecifier */); // We allow reexporting const enums if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } @@ -60648,9 +60942,9 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 214 /* ClassExpression */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 215 /* ClassExpression */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -60676,78 +60970,78 @@ var ts; return trueType; case 91 /* FalseKeyword */: return falseType; - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: return checkTemplateExpression(node); case 13 /* RegularExpressionLiteral */: return globalRegExpType; - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode, forceTuple); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return checkQualifiedName(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (node.expression.kind === 96 /* ImportKeyword */) { return checkImportCallExpression(node); } // falls through - case 197 /* NewExpression */: + case 198 /* NewExpression */: return checkCallExpression(node, checkMode); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return checkClassExpression(node); - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: return checkAssertion(node); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: return checkNonNullAssertion(node); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return checkMetaProperty(node); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return checkDeleteExpression(node); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return checkVoidExpression(node); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return checkAwaitExpression(node); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 215 /* OmittedExpression */: + case 216 /* OmittedExpression */: return undefinedWideningType; - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return checkYieldExpression(node); - case 220 /* SyntheticExpression */: + case 221 /* SyntheticExpression */: return node.type; - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 266 /* JsxElement */: + case 267 /* JsxElement */: return checkJsxElement(node, checkMode); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node, checkMode); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return checkJsxFragment(node); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 268 /* JsxOpeningElement */: + case 269 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -60784,7 +61078,7 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { - if (!(func.kind === 162 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 163 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -60795,12 +61089,15 @@ var ts; if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 162 /* Constructor */ || func.kind === 166 /* ConstructSignature */ || func.kind === 171 /* ConstructorType */) { + if (func.kind === 163 /* Constructor */ || func.kind === 167 /* ConstructSignature */ || func.kind === 172 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 202 /* ArrowFunction */) { + if (func.kind === 203 /* ArrowFunction */) { error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } + if (func.kind === 164 /* GetAccessor */ || func.kind === 165 /* SetAccessor */) { + error(node, ts.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); + } } // Only check rest parameter type if it's not a binding pattern. Since binding patterns are // not allowed in a rest parameter, we already have an error from checkGrammarParameterList. @@ -60856,13 +61153,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 202 /* ArrowFunction */: - case 165 /* CallSignature */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 170 /* FunctionType */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 203 /* ArrowFunction */: + case 166 /* CallSignature */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 171 /* FunctionType */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: var parent = node.parent; if (node === parent.type) { return parent; @@ -60880,7 +61177,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 190 /* ArrayBindingPattern */ || name.kind === 189 /* ObjectBindingPattern */) { + else if (name.kind === 191 /* ArrayBindingPattern */ || name.kind === 190 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -60889,13 +61186,13 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 167 /* IndexSignature */) { + if (node.kind === 168 /* IndexSignature */) { checkGrammarIndexSignature(node); } // TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled - else if (node.kind === 170 /* FunctionType */ || node.kind === 244 /* FunctionDeclaration */ || node.kind === 171 /* ConstructorType */ || - node.kind === 165 /* CallSignature */ || node.kind === 162 /* Constructor */ || - node.kind === 166 /* ConstructSignature */) { + else if (node.kind === 171 /* FunctionType */ || node.kind === 245 /* FunctionDeclaration */ || node.kind === 172 /* ConstructorType */ || + node.kind === 166 /* CallSignature */ || node.kind === 163 /* Constructor */ || + node.kind === 167 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -60925,10 +61222,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 165 /* CallSignature */: + case 166 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -60958,7 +61255,7 @@ var ts; checkAsyncFunctionReturnType(node, returnTypeNode); } } - if (node.kind !== 167 /* IndexSignature */ && node.kind !== 300 /* JSDocFunctionType */) { + if (node.kind !== 168 /* IndexSignature */ && node.kind !== 301 /* JSDocFunctionType */) { registerForUnusedIdentifiersCheck(node); } } @@ -60970,7 +61267,7 @@ var ts; var privateIdentifiers = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 162 /* Constructor */) { + if (member.kind === 163 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param, member) && !ts.isBindingPattern(param.name)) { @@ -60990,16 +61287,16 @@ var ts; var memberName = name && ts.getPropertyNameForPropertyNameNode(name); if (memberName) { switch (member.kind) { - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: addName(names, name, memberName, 1 /* GetAccessor */); break; - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: addName(names, name, memberName, 2 /* SetAccessor */); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: addName(names, name, memberName, 3 /* GetOrSetAccessor */); break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: addName(names, name, memberName, 8 /* Method */); break; } @@ -61062,7 +61359,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 158 /* PropertySignature */) { + if (member.kind === 159 /* PropertySignature */) { var memberName = void 0; var name = member.name; switch (name.kind) { @@ -61087,7 +61384,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 246 /* InterfaceDeclaration */) { + if (node.kind === 247 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -61107,7 +61404,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 143 /* StringKeyword */: + case 144 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -61115,7 +61412,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 140 /* NumberKeyword */: + case 141 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -61157,7 +61454,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 161 /* MethodDeclaration */ && node.body) { + if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 162 /* MethodDeclaration */ && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -61185,7 +61482,7 @@ var ts; if (ts.isPrivateIdentifierPropertyDeclaration(n)) { return true; } - return n.kind === 159 /* PropertyDeclaration */ && + return n.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(n, 32 /* Static */) && !!n.initializer; } @@ -61215,7 +61512,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_3 = statements; _i < statements_3.length; _i++) { var statement = statements_3[_i]; - if (statement.kind === 226 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 227 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -61240,7 +61537,7 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 163 /* GetAccessor */) { + if (node.kind === 164 /* GetAccessor */) { if (!(node.flags & 8388608 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 256 /* HasImplicitReturn */)) { if (!(node.flags & 512 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -61250,7 +61547,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (ts.isPrivateIdentifier(node.name)) { @@ -61259,7 +61556,7 @@ var ts; if (!hasNonBindableDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; + var otherKind = node.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getModifierFlags(node); @@ -61277,7 +61574,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 163 /* GetAccessor */) { + if (node.kind === 164 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -61325,7 +61622,7 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 169 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 170 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } ts.forEach(node.typeArguments, checkSourceElement); @@ -61370,7 +61667,7 @@ var ts; var seenOptionalElement = false; for (var i = 0; i < elementTypes.length; i++) { var e = elementTypes[i]; - if (e.kind === 177 /* RestType */) { + if (e.kind === 178 /* RestType */) { if (i !== elementTypes.length - 1) { grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); break; @@ -61379,7 +61676,7 @@ var ts; error(e, ts.Diagnostics.A_rest_element_type_must_be_an_array_type); } } - else if (e.kind === 176 /* OptionalType */) { + else if (e.kind === 177 /* OptionalType */) { seenOptionalElement = true; } else if (seenOptionalElement) { @@ -61400,7 +61697,7 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType, /*stringsOnly*/ false))) { - if (accessNode.kind === 195 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && + if (accessNode.kind === 196 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } @@ -61451,7 +61748,7 @@ var ts; ts.forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 180 /* ConditionalType */ && n.parent.extendsType === n; })) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 181 /* ConditionalType */ && n.parent.extendsType === n; })) { grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); @@ -61468,9 +61765,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 246 /* InterfaceDeclaration */ && - n.parent.kind !== 245 /* ClassDeclaration */ && - n.parent.kind !== 214 /* ClassExpression */ && + if (n.parent.kind !== 247 /* InterfaceDeclaration */ && + n.parent.kind !== 246 /* ClassDeclaration */ && + n.parent.kind !== 215 /* ClassExpression */ && n.flags & 8388608 /* Ambient */) { if (!(flags & 2 /* Ambient */) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) { // It is nested in an ambient context, which means it is automatically exported @@ -61566,7 +61863,7 @@ var ts; // Both are literal property names that are the same. ts.isPropertyNameLiteral(node.name) && ts.isPropertyNameLiteral(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 161 /* MethodDeclaration */ || node.kind === 160 /* MethodSignature */) && + var reportError = (node.kind === 162 /* MethodDeclaration */ || node.kind === 161 /* MethodSignature */) && ts.hasModifier(node, 32 /* Static */) !== ts.hasModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -61606,7 +61903,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 8388608 /* Ambient */; - var inAmbientContextOrInterface = node.parent.kind === 246 /* InterfaceDeclaration */ || node.parent.kind === 173 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 247 /* InterfaceDeclaration */ || node.parent.kind === 174 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -61617,10 +61914,10 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if ((node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */) && !inAmbientContext) { + if ((node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */) && !inAmbientContext) { hasNonAmbientClass = true; } - if (node.kind === 244 /* FunctionDeclaration */ || node.kind === 161 /* MethodDeclaration */ || node.kind === 160 /* MethodSignature */ || node.kind === 162 /* Constructor */) { + if (node.kind === 245 /* FunctionDeclaration */ || node.kind === 162 /* MethodDeclaration */ || node.kind === 161 /* MethodSignature */ || node.kind === 163 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -61751,25 +62048,25 @@ var ts; function getDeclarationSpaces(decl) { var d = decl; switch (d.kind) { - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: // A jsdoc typedef and callback are, by definition, type aliases. // falls through - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: return 2 /* ExportType */; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: return 2 /* ExportType */ | 1 /* ExportValue */; - case 290 /* SourceFile */: + case 291 /* SourceFile */: return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: // Export assigned entity name expressions act as aliases and should fall through, otherwise they export values if (!ts.isEntityNameExpression(d.expression)) { return 1 /* ExportValue */; @@ -61777,17 +62074,17 @@ var ts; d = d.expression; // The below options all declare an Alias, which is allowed to merge with other values within the importing module. // falls through - case 253 /* ImportEqualsDeclaration */: - case 256 /* NamespaceImport */: - case 255 /* ImportClause */: + case 254 /* ImportEqualsDeclaration */: + case 257 /* NamespaceImport */: + case 256 /* ImportClause */: var result_8 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_8 |= getDeclarationSpaces(d); }); return result_8; - case 242 /* VariableDeclaration */: - case 191 /* BindingElement */: - case 244 /* FunctionDeclaration */: - case 258 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 + case 243 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 245 /* FunctionDeclaration */: + case 259 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 case 75 /* Identifier */: // https://github.com/microsoft/TypeScript/issues/36098 // Identifiers are used as declarations of assignment declarations whose parents may be // SyntaxKind.CallExpression - `Object.defineProperty(thing, "aField", {value: 42});` @@ -61810,9 +62107,9 @@ var ts; * @param type The type of the promise. * @remarks The "promised type" of a type is the type of the "value" parameter of the "onfulfilled" callback. */ - function getPromisedTypeOfPromise(promise, errorNode) { + function getPromisedTypeOfPromise(type, errorNode) { // - // { // promise + // { // type // then( // thenFunction // onfulfilled: ( // onfulfilledParameterType // value: T // valueParameterType @@ -61820,17 +62117,18 @@ var ts; // ): any; // } // - if (isTypeAny(promise)) { + if (isTypeAny(type)) { return undefined; } - var typeAsPromise = promise; + var typeAsPromise = type; if (typeAsPromise.promisedTypeOfPromise) { return typeAsPromise.promisedTypeOfPromise; } - if (isReferenceToType(promise, getGlobalPromiseType(/*reportErrors*/ false))) { - return typeAsPromise.promisedTypeOfPromise = getTypeArguments(promise)[0]; + if (isReferenceToType(type, getGlobalPromiseType(/*reportErrors*/ false)) || + isReferenceToType(type, getGlobalPromiseLikeType(/*reportErrors*/ false))) { + return typeAsPromise.promisedTypeOfPromise = getAwaitedType(getTypeArguments(type)[0], errorNode); } - var thenFunction = getTypeOfPropertyOfType(promise, "then"); // TODO: GH#18217 + var thenFunction = getTypeOfPropertyOfType(type, "then"); // TODO: GH#18217 if (isTypeAny(thenFunction)) { return undefined; } @@ -61865,28 +62163,127 @@ var ts; var awaitedType = getAwaitedType(type, errorNode, diagnosticMessage, arg0); return awaitedType || errorType; } + /** + * Gets or creates an `awaited T` type for a generic type. + * + * The "awaited type" of a generic type cannot be determined until it is instantiated. As + * a result, an `AwaitedType` for the generic type is created that can be instantiated + * or related later. + */ + function getAwaitedTypeForGenericType(type) { + var typeId = "" + type.id; + var awaitedType = awaitedTypes.get(typeId); + if (!awaitedType) { + awaitedType = createType(134217728 /* Awaited */); + awaitedType.awaitedType = type; + awaitedTypes.set(typeId, awaitedType); + } + return awaitedType; + } + function unwrapAwaitedType(type) { + return type.flags & 1048576 /* Union */ ? + mapType(type, unwrapAwaitedType) : + type.flags & 134217728 /* Awaited */ ? type.awaitedType : type; + } + /** + * Determines whether a type has a callable `then` member. + */ + function isThenableType(type) { + var thenFunction = getTypeOfPropertyOfType(type, "then"); + return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, 2097152 /* NEUndefinedOrNull */), 0 /* Call */).length > 0; + } + /** + * Determines whether a type is a generic type whose base constraint could possibly resolve to a different + * type when awaited. A type is a generic "thenable" type when all of the following conditions are met: + * - The type is a generic object type, + * - AND one of the following conditions are met + * - The type has no base constraint, + * - OR The base constraint of the type is `any`, `unknown`, `object`, or the empty object `{}`, + * - OR The base constraint has a callable `then` member. + */ + function isGenericAwaitableType(type) { + if (isGenericObjectType(type)) { + if (type.flags & 2097152 /* Intersection */) { + return ts.some(type.types, isGenericAwaitableType); + } + var baseConstraint = getBaseConstraintOfType(type); + return !baseConstraint || + !!(baseConstraint.flags & (3 /* AnyOrUnknown */ | 67108864 /* NonPrimitive */)) || + baseConstraint === emptyObjectType || + baseConstraint === emptyGenericType || + isThenableType(baseConstraint); + } + return false; + } + /** + * Gets the "awaited type" of a type. + * + * The "awaited type" of an expression is its "promised type" if the expression is a + * Promise-like type; otherwise, it is the type of the expression. If the "promised + * type" is itself a Promise-like, the "promised type" is recursively unwrapped until a + * non-promise type is found. + * + * This is used to reflect the runtime behavior of the `await` keyword and the `awaited T` + * type. + */ function getAwaitedType(type, errorNode, diagnosticMessage, arg0) { + if (isTypeAny(type)) { + return type; + } + // If the type is already an awaited type, return it. + // + // For example: + // + // awaited T -> awaited T + // + if (type.flags & 134217728 /* Awaited */) { + return type; + } var typeAsAwaitable = type; if (typeAsAwaitable.awaitedTypeOfType) { return typeAsAwaitable.awaitedTypeOfType; } - if (isTypeAny(type)) { - return typeAsAwaitable.awaitedTypeOfType = type; + // For a union, get a union of the awaited types of each constituent. + // + // For example: + // + // awaited (number | string) -> number | string + // awaited (number | Promise) -> number | string + // awaited (T | string) -> awaited T | string + // awaited (T | Promise) -> awaited T | string + // awaited (T | Promise) -> awaited T + // awaited (T | U) -> awaited T | awaited U + // + return typeAsAwaitable.awaitedTypeOfType = + mapType(type, errorNode ? function (constituentType) { return getAwaitedTypeWorker(constituentType, errorNode, diagnosticMessage, arg0); } : getAwaitedTypeWorker); + } + function getAwaitedTypeWorker(type, errorNode, diagnosticMessage, arg0) { + // If the type is already an awaited type, return it. + // + // For example: + // + // awaited T -> awaited T + // + if (type.flags & 134217728 /* Awaited */) { + return type; } - if (type.flags & 1048576 /* Union */) { - var types = void 0; - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var constituentType = _a[_i]; - types = ts.append(types, getAwaitedType(constituentType, errorNode, diagnosticMessage, arg0)); - } - if (!types) { - return undefined; - } - return typeAsAwaitable.awaitedTypeOfType = getUnionType(types); + // We cannot resolve the awaited type for a type variable until it is instantiated. As + // such, we create an `awaited T` type that can either be instantiated or related later. + // + // For example: + // + // T -> awaited T + // + if (isGenericAwaitableType(type)) { + return getAwaitedTypeForGenericType(type); + } + var typeAsAwaitable = type; + if (typeAsAwaitable.awaitedTypeOfType) { + return typeAsAwaitable.awaitedTypeOfType; } var promisedType = getPromisedTypeOfPromise(type); if (promisedType) { - if (type.id === promisedType.id || awaitedTypeStack.indexOf(promisedType.id) >= 0) { + if (type.id === promisedType.id || awaitedTypeStack.lastIndexOf(promisedType.id) >= 0) { // Verify that we don't have a bad actor in the form of a promise whose // promised type is the same as the promise type, or a mutually recursive // promise. If so, we return undefined as we cannot guess the shape. If this @@ -61900,6 +62297,7 @@ var ts; // onfulfilled: (value: BadPromise) => any, // onrejected: (error: any) => any): BadPromise; // } + // // The above interface will pass the PromiseLike check, and return a // promised type of `BadPromise`. Since this is a self reference, we // don't want to keep recursing ad infinitum. @@ -61936,8 +62334,8 @@ var ts; } // The type was not a promise, so it could not be unwrapped any further. // As long as the type does not have a callable "then" property, it is - // safe to return the type; otherwise, an error will be reported in - // the call to getNonThenableType and we will return undefined. + // safe to return the type; otherwise, an error is reported and we return + // undefined. // // An example of a non-promise "thenable" might be: // @@ -61949,8 +62347,7 @@ var ts; // of a runtime problem. If the user wants to return this value from an async // function, they would need to wrap it in some other value. If they want it to // be treated as a promise, they can cast to . - var thenFunction = getTypeOfPropertyOfType(type, "then"); - if (thenFunction && getSignaturesOfType(thenFunction, 0 /* Call */).length > 0) { + if (isThenableType(type)) { if (errorNode) { if (!diagnosticMessage) return ts.Debug.fail(); @@ -62063,24 +62460,24 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 156 /* Parameter */: + case 157 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -62127,14 +62524,14 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 179 /* IntersectionType */: - case 178 /* UnionType */: + case 180 /* IntersectionType */: + case 179 /* UnionType */: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return getEntityNameForDecoratorMetadata(node.type); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return node.typeName; } } @@ -62143,13 +62540,13 @@ var ts; var commonEntityName; for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { var typeNode = types_19[_i]; - while (typeNode.kind === 182 /* ParenthesizedType */) { + while (typeNode.kind === 183 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 137 /* NeverKeyword */) { + if (typeNode.kind === 138 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 146 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 147 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -62195,14 +62592,14 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 156 /* Parameter */) { + if (node.kind === 157 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -62211,23 +62608,23 @@ var ts; } } break; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - var otherKind = node.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + var otherKind = node.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 156 /* Parameter */: + case 157 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -62290,7 +62687,7 @@ var ts; else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && node.typeExpression && node.typeExpression.type && !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 153 /* QualifiedName */ ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 154 /* QualifiedName */ ? node.name.right : node.name)); } } } @@ -62331,7 +62728,7 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return node.name; default: return undefined; @@ -62344,7 +62741,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 155 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -62373,7 +62770,7 @@ var ts; } } } - var body = node.kind === 160 /* MethodSignature */ ? undefined : node.body; + var body = node.kind === 161 /* MethodSignature */ ? undefined : node.body; checkSourceElement(body); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); if (produceDiagnostics && !ts.getEffectiveReturnTypeNode(node)) { @@ -62415,42 +62812,42 @@ var ts; for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) { var node = potentiallyUnusedIdentifiers_1[_i]; switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 290 /* SourceFile */: - case 249 /* ModuleDeclaration */: - case 223 /* Block */: - case 251 /* CaseBlock */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 291 /* SourceFile */: + case 250 /* ModuleDeclaration */: + case 224 /* Block */: + case 252 /* CaseBlock */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 162 /* Constructor */: - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 163 /* Constructor */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; - case 181 /* InferType */: + case 182 /* InferType */: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -62470,11 +62867,11 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 161 /* MethodDeclaration */: - case 159 /* PropertyDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - if (member.kind === 164 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + case 162 /* MethodDeclaration */: + case 160 /* PropertyDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + if (member.kind === 165 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { // Already would have reported an error on the getter. break; } @@ -62485,7 +62882,7 @@ var ts; addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); } break; - case 162 /* Constructor */: + case 163 /* Constructor */: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { @@ -62493,8 +62890,8 @@ var ts; } } break; - case 167 /* IndexSignature */: - case 222 /* SemicolonClassElement */: + case 168 /* IndexSignature */: + case 223 /* SemicolonClassElement */: // Can't be private break; default: @@ -62521,7 +62918,7 @@ var ts; continue; var name = ts.idText(typeParameter.name); var parent = typeParameter.parent; - if (parent.kind !== 181 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { + if (parent.kind !== 182 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { if (seenParentsWithEveryUnused.tryAdd(parent)) { var range = ts.isJSDocTemplateTag(parent) // Whole @template tag @@ -62604,7 +63001,7 @@ var ts; var importDecl = importClause.parent; var nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? - (importClause.namedBindings.kind === 256 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) + (importClause.namedBindings.kind === 257 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) : 0); if (nDeclarations === unuseds.length) { addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 @@ -62622,7 +63019,7 @@ var ts; var bindingPattern = _a[0], bindingElements = _a[1]; var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */; if (bindingPattern.elements.length === bindingElements.length) { - if (bindingElements.length === 1 && bindingPattern.parent.kind === 242 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 243 /* VariableDeclarationList */) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 243 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 244 /* VariableDeclarationList */) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { @@ -62643,7 +63040,7 @@ var ts; if (declarationList.declarations.length === declarations.length) { addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? ts.createDiagnosticForNode(ts.first(declarations).name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(declarations).name)) - : ts.createDiagnosticForNode(declarationList.parent.kind === 225 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); + : ts.createDiagnosticForNode(declarationList.parent.kind === 226 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); } else { for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { @@ -62657,22 +63054,22 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return ts.idText(name); - case 190 /* ArrayBindingPattern */: - case 189 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name); default: return ts.Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 255 /* ImportClause */ || node.kind === 258 /* ImportSpecifier */ || node.kind === 256 /* NamespaceImport */; + return node.kind === 256 /* ImportClause */ || node.kind === 259 /* ImportSpecifier */ || node.kind === 257 /* NamespaceImport */; } function importClauseFromImported(decl) { - return decl.kind === 255 /* ImportClause */ ? decl : decl.kind === 256 /* NamespaceImport */ ? decl.parent : decl.parent.parent; + return decl.kind === 256 /* ImportClause */ ? decl : decl.kind === 257 /* NamespaceImport */ ? decl.parent : decl.parent.parent; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 223 /* Block */) { + if (node.kind === 224 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -62702,12 +63099,12 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 159 /* PropertyDeclaration */ || - node.kind === 158 /* PropertySignature */ || - node.kind === 161 /* MethodDeclaration */ || - node.kind === 160 /* MethodSignature */ || - node.kind === 163 /* GetAccessor */ || - node.kind === 164 /* SetAccessor */) { + if (node.kind === 160 /* PropertyDeclaration */ || + node.kind === 159 /* PropertySignature */ || + node.kind === 162 /* MethodDeclaration */ || + node.kind === 161 /* MethodSignature */ || + node.kind === 164 /* GetAccessor */ || + node.kind === 165 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -62716,7 +63113,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 156 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 157 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -62773,7 +63170,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -62788,7 +63185,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { + if (parent.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -62823,7 +63220,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 242 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 243 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -62835,17 +63232,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 243 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 225 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 244 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 226 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 223 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 250 /* ModuleBlock */ || - container.kind === 249 /* ModuleDeclaration */ || - container.kind === 290 /* SourceFile */); + (container.kind === 224 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 251 /* ModuleBlock */ || + container.kind === 250 /* ModuleDeclaration */ || + container.kind === 291 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -62875,18 +63272,18 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 191 /* BindingElement */) { - if (node.parent.kind === 189 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { + if (node.kind === 192 /* BindingElement */) { + if (node.parent.kind === 190 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 154 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access @@ -62907,19 +63304,19 @@ var ts; } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 190 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 191 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.getRootDeclaration(node).kind === 156 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 157 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { - var needCheckInitializer = node.initializer && node.parent.parent.kind !== 231 /* ForInStatement */; + var needCheckInitializer = node.initializer && node.parent.parent.kind !== 232 /* ForInStatement */; var needCheckWidenedType = node.name.elements.length === 0; if (needCheckInitializer || needCheckWidenedType) { // Don't validate for-in initializer as it is already an error @@ -62956,7 +63353,7 @@ var ts; ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) && ts.hasEntries(symbol.exports); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 231 /* ForInStatement */) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 232 /* ForInStatement */) { checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, /*headMessage*/ undefined); } } @@ -62982,10 +63379,10 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 159 /* PropertyDeclaration */ && node.kind !== 158 /* PropertySignature */) { + if (node.kind !== 160 /* PropertyDeclaration */ && node.kind !== 159 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { + if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -62997,7 +63394,7 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 159 /* PropertyDeclaration */ || nextDeclaration.kind === 158 /* PropertySignature */ + var message = nextDeclaration.kind === 160 /* PropertyDeclaration */ || nextDeclaration.kind === 159 /* PropertySignature */ ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; var declName = ts.declarationNameToString(nextDeclarationName); @@ -63007,8 +63404,8 @@ var ts; } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 156 /* Parameter */ && right.kind === 242 /* VariableDeclaration */) || - (left.kind === 242 /* VariableDeclaration */ && right.kind === 156 /* Parameter */)) { + if ((left.kind === 157 /* Parameter */ && right.kind === 243 /* VariableDeclaration */) || + (left.kind === 243 /* VariableDeclaration */ && right.kind === 157 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -63048,7 +63445,7 @@ var ts; var type = checkTruthinessExpression(node.expression); checkTestingKnownTruthyCallableType(node.expression, node.thenStatement, type); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 224 /* EmptyStatement */) { + if (node.thenStatement.kind === 225 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -63119,12 +63516,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 243 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 244 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 243 /* VariableDeclarationList */) { + if (node.initializer.kind === 244 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -63158,14 +63555,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 243 /* VariableDeclarationList */) { + if (node.initializer.kind === 244 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier); // There may be a destructuring assignment on the left side - if (varExpr.kind === 192 /* ArrayLiteralExpression */ || varExpr.kind === 193 /* ObjectLiteralExpression */) { + if (varExpr.kind === 193 /* ArrayLiteralExpression */ || varExpr.kind === 194 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -63197,7 +63594,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 243 /* VariableDeclarationList */) { + if (node.initializer.kind === 244 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -63211,7 +63608,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 192 /* ArrayLiteralExpression */ || varExpr.kind === 193 /* ObjectLiteralExpression */) { + if (varExpr.kind === 193 /* ArrayLiteralExpression */ || varExpr.kind === 194 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -63224,7 +63621,7 @@ var ts; } // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { + if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 193200128 /* InstantiableNonPrimitive */)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, typeToString(rightType)); } checkSourceElement(node.statement); @@ -63862,7 +64259,7 @@ var ts; var isGenerator = !!(functionFlags & 1 /* Generator */); var isAsync = !!(functionFlags & 2 /* Async */); return isGenerator ? getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, isAsync) || errorType : - isAsync ? getPromisedTypeOfPromise(returnType) || errorType : + isAsync ? unwrapAwaitedType(getAwaitedType(returnType) || errorType) : returnType; } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { @@ -63884,12 +64281,12 @@ var ts; var functionFlags = ts.getFunctionFlags(func); if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 164 /* SetAccessor */) { + if (func.kind === 165 /* SetAccessor */) { if (node.expression) { error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 162 /* Constructor */) { + else if (func.kind === 163 /* Constructor */) { if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -63897,7 +64294,7 @@ var ts; else if (getReturnTypeFromAnnotation(func)) { var unwrappedReturnType = unwrapReturnType(returnType, functionFlags); var unwrappedExprType = functionFlags & 2 /* Async */ - ? checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) + ? unwrapAwaitedType(checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)) : exprType; if (unwrappedReturnType) { // If the function has a return type, but promisedType is @@ -63907,7 +64304,7 @@ var ts; } } } - else if (func.kind !== 162 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 163 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { // The function has a return type, but the return statement doesn't have an expression. error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } @@ -63936,7 +64333,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 278 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 279 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -63945,7 +64342,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 277 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 278 /* CaseClause */) { // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable // to or from the type of the 'switch' expression. @@ -63977,7 +64374,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 238 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 239 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label)); return true; } @@ -64084,8 +64481,8 @@ var ts; // this allows us to rule out cases when both property and indexer are inherited from the base class var errorNode; if (propDeclaration && name && - (propDeclaration.kind === 209 /* BinaryExpression */ || - name.kind === 154 /* ComputedPropertyName */ || + (propDeclaration.kind === 210 /* BinaryExpression */ || + name.kind === 155 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -64162,7 +64559,7 @@ var ts; function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 169 /* TypeReference */) { + if (node.kind === 170 /* TypeReference */) { var type = getTypeFromTypeReference(node); if (type.flags & 262144 /* TypeParameter */) { for (var i = index; i < typeParameters.length; i++) { @@ -64408,7 +64805,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 245 /* ClassDeclaration */ || d.kind === 246 /* InterfaceDeclaration */; + return d.kind === 246 /* ClassDeclaration */ || d.kind === 247 /* InterfaceDeclaration */; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -64463,7 +64860,7 @@ var ts; continue basePropertyCheck; } } - if (derivedClassDecl.kind === 214 /* ClassExpression */) { + if (derivedClassDecl.kind === 215 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -64485,7 +64882,7 @@ var ts; // property/accessor is overridden with property/accessor if (!compilerOptions.useDefineForClassFields || baseDeclarationFlags & 128 /* Abstract */ && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer) - || base.valueDeclaration && base.valueDeclaration.parent.kind === 246 /* InterfaceDeclaration */ + || base.valueDeclaration && base.valueDeclaration.parent.kind === 247 /* InterfaceDeclaration */ || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) { // when the base property is abstract or from an interface, base/derived flags don't need to match // same when the derived property is from an assignment @@ -64500,7 +64897,7 @@ var ts; error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type)); } else { - var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 159 /* PropertyDeclaration */ && !d.initializer; }); + var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 160 /* PropertyDeclaration */ && !d.initializer; }); if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 128 /* Abstract */) @@ -64597,7 +64994,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 159 /* PropertyDeclaration */ && + return node.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(node, 32 /* Static */ | 128 /* Abstract */) && !node.exclamationToken && !node.initializer; @@ -64621,7 +65018,7 @@ var ts; var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 246 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 247 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -64727,7 +65124,7 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: var value_2 = evaluate(expr.operand); if (typeof value_2 === "number") { switch (expr.operator) { @@ -64737,7 +65134,7 @@ var ts; } } break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -64766,7 +65163,7 @@ var ts; case 8 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return evaluate(expr.expression); case 75 /* Identifier */: var identifier = expr; @@ -64774,14 +65171,14 @@ var ts; return +(identifier.escapedText); } return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText); - case 195 /* ElementAccessExpression */: - case 194 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384 /* Enum */) { var name = void 0; - if (ex.kind === 194 /* PropertyAccessExpression */) { + if (ex.kind === 195 /* PropertyAccessExpression */) { name = ex.name.escapedText; } else { @@ -64811,8 +65208,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 75 /* Identifier */ || - node.kind === 194 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || - node.kind === 195 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && + node.kind === 195 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || + node.kind === 196 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && ts.isStringLiteralLike(node.argumentExpression); } function checkEnumDeclaration(node) { @@ -64848,7 +65245,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 248 /* EnumDeclaration */) { + if (declaration.kind !== 249 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -64876,8 +65273,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { var declaration = declarations_8[_i]; - if ((declaration.kind === 245 /* ClassDeclaration */ || - (declaration.kind === 244 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 246 /* ClassDeclaration */ || + (declaration.kind === 245 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 8388608 /* Ambient */)) { return declaration; } @@ -64940,7 +65337,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 245 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 246 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -64990,23 +65387,23 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 259 /* ExportAssignment */: - case 260 /* ExportDeclaration */: + case 260 /* ExportAssignment */: + case 261 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 253 /* ImportEqualsDeclaration */: - case 254 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 191 /* BindingElement */: - case 242 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 243 /* VariableDeclaration */: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -65017,12 +65414,12 @@ var ts; break; } // falls through - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 244 /* FunctionDeclaration */: - case 246 /* InterfaceDeclaration */: - case 249 /* ModuleDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 245 /* FunctionDeclaration */: + case 247 /* InterfaceDeclaration */: + case 250 /* ModuleDeclaration */: + case 248 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -65045,12 +65442,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: do { node = node.left; } while (node.kind !== 75 /* Identifier */); return node; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: do { if (ts.isModuleExportsAccessExpression(node.expression) && !ts.isPrivateIdentifier(node.name)) { return node.name; @@ -65070,9 +65467,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 250 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 290 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 260 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 251 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 291 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 261 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -65107,14 +65504,14 @@ var ts; (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 263 /* ExportSpecifier */ ? + var message = node.kind === 264 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } // Don't allow to re-export something with no value side when `--isolatedModules` is set. if (compilerOptions.isolatedModules - && node.kind === 263 /* ExportSpecifier */ + && node.kind === 264 /* ExportSpecifier */ && !node.parent.parent.isTypeOnly && !(target.flags & 111551 /* Value */) && !(node.flags & 8388608 /* Ambient */)) { @@ -65142,7 +65539,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 256 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 257 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -65166,7 +65563,7 @@ var ts; if (ts.hasModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 265 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 266 /* ExternalModuleReference */) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 111551 /* Value */) { @@ -65211,10 +65608,10 @@ var ts; else if (!ts.isNamespaceExport(node.exportClause)) { checkImportBinding(node.exportClause); } - var inAmbientExternalModule = node.parent.kind === 250 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 250 /* ModuleBlock */ && + var inAmbientExternalModule = node.parent.kind === 251 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 251 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 8388608 /* Ambient */; - if (node.parent.kind !== 290 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 291 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -65232,14 +65629,14 @@ var ts; } function checkGrammarExportDeclaration(node) { var _a; - var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 261 /* NamedExports */; + var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 262 /* NamedExports */; if (isTypeOnlyExportStar) { grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type); } return !isTypeOnlyExportStar; } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 290 /* SourceFile */ || node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 249 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 291 /* SourceFile */ || node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 250 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -65295,8 +65692,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 290 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 249 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 291 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 250 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -65410,165 +65807,165 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 249 /* ModuleDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 244 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 245 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } - if (kind >= 225 /* FirstStatement */ && kind <= 241 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { + if (kind >= 226 /* FirstStatement */ && kind <= 242 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, ts.Diagnostics.Unreachable_code_detected); } switch (kind) { - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return checkTypeParameter(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return checkParameter(node); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return checkPropertyDeclaration(node); - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: return checkPropertySignature(node); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: return checkSignatureDeclaration(node); - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: return checkMethodDeclaration(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return checkConstructorDeclaration(node); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return checkAccessorDeclaration(node); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return checkTypeReferenceNode(node); - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return checkTypePredicate(node); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return checkTypeQuery(node); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return checkTypeLiteral(node); - case 174 /* ArrayType */: + case 175 /* ArrayType */: return checkArrayType(node); - case 175 /* TupleType */: + case 176 /* TupleType */: return checkTupleType(node); - case 178 /* UnionType */: - case 179 /* IntersectionType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 182 /* ParenthesizedType */: - case 176 /* OptionalType */: - case 177 /* RestType */: + case 183 /* ParenthesizedType */: + case 177 /* OptionalType */: + case 178 /* RestType */: return checkSourceElement(node.type); - case 183 /* ThisType */: + case 184 /* ThisType */: return checkThisType(node); - case 184 /* TypeOperator */: + case 185 /* TypeOperator */: return checkTypeOperator(node); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return checkConditionalType(node); - case 181 /* InferType */: + case 182 /* InferType */: return checkInferType(node); - case 188 /* ImportType */: + case 189 /* ImportType */: return checkImportType(node); - case 307 /* JSDocAugmentsTag */: + case 308 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 308 /* JSDocImplementsTag */: + case 309 /* JSDocImplementsTag */: return checkJSDocImplementsTag(node); - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: return checkJSDocTypeAliasTag(node); - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return checkJSDocTemplateTag(node); - case 320 /* JSDocTypeTag */: + case 321 /* JSDocTypeTag */: return checkJSDocTypeTag(node); - case 317 /* JSDocParameterTag */: + case 318 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: checkJSDocFunctionType(node); // falls through - case 298 /* JSDocNonNullableType */: - case 297 /* JSDocNullableType */: - case 295 /* JSDocAllType */: - case 296 /* JSDocUnknownType */: - case 304 /* JSDocTypeLiteral */: + case 299 /* JSDocNonNullableType */: + case 298 /* JSDocNullableType */: + case 296 /* JSDocAllType */: + case 297 /* JSDocUnknownType */: + case 305 /* JSDocTypeLiteral */: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 301 /* JSDocVariadicType */: + case 302 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 294 /* JSDocTypeExpression */: + case 295 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 186 /* MappedType */: + case 187 /* MappedType */: return checkMappedType(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 223 /* Block */: - case 250 /* ModuleBlock */: + case 224 /* Block */: + case 251 /* ModuleBlock */: return checkBlock(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return checkVariableStatement(node); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return checkExpressionStatement(node); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return checkIfStatement(node); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return checkDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return checkWhileStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return checkForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return checkForInStatement(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return checkForOfStatement(node); - case 233 /* ContinueStatement */: - case 234 /* BreakStatement */: + case 234 /* ContinueStatement */: + case 235 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return checkReturnStatement(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return checkWithStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return checkSwitchStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return checkLabeledStatement(node); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return checkThrowStatement(node); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return checkTryStatement(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return checkBindingElement(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return checkClassDeclaration(node); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return checkImportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return checkExportDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return checkExportAssignment(node); - case 224 /* EmptyStatement */: - case 241 /* DebuggerStatement */: + case 225 /* EmptyStatement */: + case 242 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 264 /* MissingDeclaration */: + case 265 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -65663,33 +66060,33 @@ var ts; currentNode = node; instantiationCount = 0; switch (node.kind) { - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 198 /* TaggedTemplateExpression */: - case 157 /* Decorator */: - case 268 /* JsxOpeningElement */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 199 /* TaggedTemplateExpression */: + case 158 /* Decorator */: + case 269 /* JsxOpeningElement */: // These node kinds are deferred checked when overload resolution fails // To save on work, we ensure the arguments are checked just once, in // a deferred way resolveUntypedCall(node); break; - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: checkClassExpressionDeferred(node); break; - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: checkJsxSelfClosingElementDeferred(node); break; - case 266 /* JsxElement */: + case 267 /* JsxElement */: checkJsxElementDeferred(node); break; } @@ -65832,17 +66229,17 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; // falls through - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -65850,8 +66247,8 @@ var ts; // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration. // falls through - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -65860,7 +66257,7 @@ var ts; copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968 /* Type */); } break; - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -65908,16 +66305,16 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 155 /* TypeParameter */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 248 /* EnumDeclaration */: + case 156 /* TypeParameter */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: return true; - case 255 /* ImportClause */: + case 256 /* ImportClause */: return node.isTypeOnly; - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; default: return false; @@ -65925,16 +66322,16 @@ var ts; } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 153 /* QualifiedName */) { + while (node.parent.kind === 154 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 169 /* TypeReference */; + return node.parent.kind === 170 /* TypeReference */; } function isHeritageClauseElementIdentifier(node) { - while (node.parent.kind === 194 /* PropertyAccessExpression */) { + while (node.parent.kind === 195 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent.kind === 216 /* ExpressionWithTypeArguments */; + return node.parent.kind === 217 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -65962,13 +66359,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 153 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 154 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 253 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 254 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } - if (nodeOnRightSide.parent.kind === 259 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 260 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } return undefined; @@ -65994,7 +66391,7 @@ var ts; node = parent; parent = parent.parent; } - if (parent && parent.kind === 188 /* ImportType */ && parent.qualifier === node) { + if (parent && parent.kind === 189 /* ImportType */ && parent.qualifier === node) { return parent; } return undefined; @@ -66004,7 +66401,7 @@ var ts; return getSymbolOfNode(name.parent); } if (ts.isInJSFile(name) && - name.parent.kind === 194 /* PropertyAccessExpression */ && + name.parent.kind === 195 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { // Check if this is a special property assignment if (!ts.isPrivateIdentifier(name)) { @@ -66014,7 +66411,7 @@ var ts; } } } - if (name.parent.kind === 259 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { + if (name.parent.kind === 260 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { // Even an entity name expression that doesn't resolve as an entityname may still typecheck as a property access expression var success = resolveEntityName(name, /*all meanings*/ 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*ignoreErrors*/ true); @@ -66024,7 +66421,7 @@ var ts; } else if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name) && isInRightSideOfImportOrExportAssignment(name)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(name, 253 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(name, 254 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(name, /*dontResolveAlias*/ true); } @@ -66042,7 +66439,7 @@ var ts; if (isHeritageClauseElementIdentifier(name)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (name.parent.kind === 216 /* ExpressionWithTypeArguments */) { + if (name.parent.kind === 217 /* ExpressionWithTypeArguments */) { meaning = 788968 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { @@ -66058,10 +66455,10 @@ var ts; return entityNameSymbol; } } - if (name.parent.kind === 317 /* JSDocParameterTag */) { + if (name.parent.kind === 318 /* JSDocParameterTag */) { return ts.getParameterSymbolFromJSDoc(name.parent); } - if (name.parent.kind === 155 /* TypeParameter */ && name.parent.parent.kind === 321 /* JSDocTemplateTag */) { + if (name.parent.kind === 156 /* TypeParameter */ && name.parent.parent.kind === 322 /* JSDocTemplateTag */) { ts.Debug.assert(!ts.isInJSFile(name)); // Otherwise `isDeclarationName` would have been true. var typeParameter = ts.getTypeParameterFromJsDoc(name.parent); return typeParameter && typeParameter.symbol; @@ -66078,12 +66475,12 @@ var ts; } return resolveEntityName(name, 111551 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (name.kind === 194 /* PropertyAccessExpression */ || name.kind === 153 /* QualifiedName */) { + else if (name.kind === 195 /* PropertyAccessExpression */ || name.kind === 154 /* QualifiedName */) { var links = getNodeLinks(name); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (name.kind === 194 /* PropertyAccessExpression */) { + if (name.kind === 195 /* PropertyAccessExpression */) { checkPropertyAccessExpression(name); } else { @@ -66093,17 +66490,17 @@ var ts; } } else if (isTypeReferenceIdentifier(name)) { - var meaning = name.parent.kind === 169 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; + var meaning = name.parent.kind === 170 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - if (name.parent.kind === 168 /* TypePredicate */) { + if (name.parent.kind === 169 /* TypePredicate */) { return resolveEntityName(name, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node, ignoreErrors) { - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } var parent = node.parent; @@ -66126,8 +66523,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); } - else if (parent.kind === 191 /* BindingElement */ && - grandParent.kind === 189 /* ObjectBindingPattern */ && + else if (parent.kind === 192 /* BindingElement */ && + grandParent.kind === 190 /* ObjectBindingPattern */ && node === parent.propertyName) { var typeOfPattern = getTypeOfNode(grandParent); var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); @@ -66139,8 +66536,8 @@ var ts; switch (node.kind) { case 75 /* Identifier */: case 76 /* PrivateIdentifier */: - case 194 /* PropertyAccessExpression */: - case 153 /* QualifiedName */: + case 195 /* PropertyAccessExpression */: + case 154 /* QualifiedName */: return getSymbolOfNameOrPropertyAccessExpression(node); case 104 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -66154,14 +66551,14 @@ var ts; return checkExpression(node).symbol; } // falls through - case 183 /* ThisType */: + case 184 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 102 /* SuperKeyword */: return checkExpression(node).symbol; - case 129 /* ConstructorKeyword */: + case 130 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 162 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 163 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -66172,7 +66569,7 @@ var ts; // 3). Dynamic import call or require in javascript // 4). type A = import("./f/*gotToDefinitionHere*/oo") if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 254 /* ImportDeclaration */ || node.parent.kind === 260 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 255 /* ImportDeclaration */ || node.parent.kind === 261 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || ((ts.isInJSFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteralLike*/ false)) || ts.isImportCall(node.parent)) || (ts.isLiteralTypeNode(node.parent) && ts.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent)) { return resolveExternalModuleName(node, node, ignoreErrors); @@ -66194,7 +66591,7 @@ var ts; case 38 /* EqualsGreaterThanToken */: case 80 /* ClassKeyword */: return getSymbolOfNode(node.parent); - case 188 /* ImportType */: + case 189 /* ImportType */: return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : undefined; case 89 /* ExportKeyword */: return ts.isExportAssignment(node.parent) ? ts.Debug.checkDefined(node.parent.symbol) : undefined; @@ -66203,7 +66600,7 @@ var ts; } } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 282 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 283 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */); } return undefined; @@ -66274,23 +66671,23 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfAssignmentPattern(expr) { - ts.Debug.assert(expr.kind === 193 /* ObjectLiteralExpression */ || expr.kind === 192 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 194 /* ObjectLiteralExpression */ || expr.kind === 193 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 232 /* ForOfStatement */) { + if (expr.parent.kind === 233 /* ForOfStatement */) { var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 209 /* BinaryExpression */) { + if (expr.parent.kind === 210 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 281 /* PropertyAssignment */) { + if (expr.parent.kind === 282 /* PropertyAssignment */) { var node_4 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression); var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_4) || errorType; var propertyIndex = ts.indexOfNode(node_4.properties, expr.parent); @@ -66338,7 +66735,7 @@ var ts; case 8 /* NumericLiteral */: case 10 /* StringLiteral */: return getLiteralType(name.text); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType; default: @@ -66394,7 +66791,7 @@ var ts; if (!ts.isGeneratedIdentifier(nodeIn)) { var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier); if (node) { - var isPropertyName_1 = node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node; + var isPropertyName_1 = node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node; return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } @@ -66450,7 +66847,7 @@ var ts; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 290 /* SourceFile */) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 291 /* SourceFile */) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. @@ -66478,7 +66875,7 @@ var ts; } function isSymbolOfDestructuredElementOfCatchBinding(symbol) { return ts.isBindingElement(symbol.valueDeclaration) - && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 280 /* CatchClause */; + && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 281 /* CatchClause */; } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 /* BlockScoped */ && !ts.isSourceFile(symbol.valueDeclaration)) { @@ -66509,7 +66906,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 524288 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 223 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 224 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -66550,19 +66947,19 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 255 /* ImportClause */: - case 256 /* NamespaceImport */: - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 256 /* ImportClause */: + case 257 /* NamespaceImport */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: var symbol = getSymbolOfNode(node) || unknownSymbol; return isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: var exportClause = node.exportClause; return !!exportClause && (ts.isNamespaceExport(exportClause) || ts.some(exportClause.elements, isValueAliasDeclaration)); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return node.expression && node.expression.kind === 75 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) : true; @@ -66571,7 +66968,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 290 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 291 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -66673,15 +67070,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 284 /* EnumMember */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 285 /* EnumMember */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return true; } return false; } function getConstantValue(node) { - if (node.kind === 284 /* EnumMember */) { + if (node.kind === 285 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -66860,9 +67257,11 @@ var ts; return; } var file = host.getSourceFile(resolvedDirective.resolvedFileName); - // Add the transitive closure of path references loaded by this file (as long as they are not) - // part of an existing type reference. - addReferencedFilesToTypeDirective(file, key); + if (file) { + // Add the transitive closure of path references loaded by this file (as long as they are not) + // part of an existing type reference. + addReferencedFilesToTypeDirective(file, key); + } }); } return { @@ -66920,12 +67319,12 @@ var ts; getJsxFactoryEntity: getJsxFactoryEntity, getAllAccessorDeclarations: function (accessor) { accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration); // TODO: GH#18217 - var otherKind = accessor.kind === 164 /* SetAccessor */ ? 163 /* GetAccessor */ : 164 /* SetAccessor */; + var otherKind = accessor.kind === 165 /* SetAccessor */ ? 164 /* GetAccessor */ : 165 /* SetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind); var firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor; var secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor; - var setAccessor = accessor.kind === 164 /* SetAccessor */ ? accessor : otherAccessor; - var getAccessor = accessor.kind === 163 /* GetAccessor */ ? accessor : otherAccessor; + var setAccessor = accessor.kind === 165 /* SetAccessor */ ? accessor : otherAccessor; + var getAccessor = accessor.kind === 164 /* GetAccessor */ ? accessor : otherAccessor; return { firstAccessor: firstAccessor, secondAccessor: secondAccessor, @@ -66941,7 +67340,7 @@ var ts; }, getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) { var n = ts.getParseTreeNode(node); - ts.Debug.assert(n && n.kind === 290 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + ts.Debug.assert(n && n.kind === 291 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); var sym = getSymbolOfNode(node); if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); @@ -66950,7 +67349,7 @@ var ts; } }; function isInHeritageClause(node) { - return node.parent && node.parent.kind === 216 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 279 /* HeritageClause */; + return node.parent && node.parent.kind === 217 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 280 /* HeritageClause */; } // defined here to avoid outer scope pollution function getTypeReferenceDirectivesForEntityName(node) { @@ -66962,7 +67361,7 @@ var ts; // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries var meaning = 788968 /* Type */ | 1920 /* Namespace */; - if ((node.kind === 75 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 194 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { + if ((node.kind === 75 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 195 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -67013,7 +67412,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 290 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 291 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -67041,12 +67440,12 @@ var ts; } } function getExternalModuleFileFromDeclaration(declaration) { - var specifier = declaration.kind === 249 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); + var specifier = declaration.kind === 250 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, /*moduleNotFoundError*/ undefined); // TODO: GH#18217 if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 290 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 291 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -67238,14 +67637,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 161 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 162 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 163 /* GetAccessor */ || node.kind === 164 /* SetAccessor */) { + else if (node.kind === 164 /* GetAccessor */ || node.kind === 165 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -67262,17 +67661,17 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 138 /* ReadonlyKeyword */) { - if (node.kind === 158 /* PropertySignature */ || node.kind === 160 /* MethodSignature */) { + if (modifier.kind !== 139 /* ReadonlyKeyword */) { + if (node.kind === 159 /* PropertySignature */ || node.kind === 161 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 167 /* IndexSignature */) { + if (node.kind === 168 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 81 /* ConstKeyword */: - if (node.kind !== 248 /* EnumDeclaration */) { + if (node.kind !== 249 /* EnumDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(81 /* ConstKeyword */)); } break; @@ -67292,7 +67691,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { + else if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -67318,10 +67717,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { + else if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 156 /* Parameter */) { + else if (node.kind === 157 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -67333,11 +67732,11 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 159 /* PropertyDeclaration */ && node.kind !== 158 /* PropertySignature */ && node.kind !== 167 /* IndexSignature */ && node.kind !== 156 /* Parameter */) { + else if (node.kind !== 160 /* PropertyDeclaration */ && node.kind !== 159 /* PropertySignature */ && node.kind !== 168 /* IndexSignature */ && node.kind !== 157 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -67360,19 +67759,19 @@ var ts; else if (ts.isClassLike(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 156 /* Parameter */) { + else if (node.kind === 157 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; case 84 /* DefaultKeyword */: - var container = node.parent.kind === 290 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 249 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 291 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 250 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512 /* Default */; break; - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: if (flags & 2 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } @@ -67382,10 +67781,10 @@ var ts; else if (ts.isClassLike(node.parent) && !ts.isPropertyDeclaration(node)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 156 /* Parameter */) { + else if (node.kind === 157 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 250 /* ModuleBlock */) { + else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 251 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } else if (ts.isPrivateIdentifierPropertyDeclaration(node)) { @@ -67398,14 +67797,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 245 /* ClassDeclaration */) { - if (node.kind !== 161 /* MethodDeclaration */ && - node.kind !== 159 /* PropertyDeclaration */ && - node.kind !== 163 /* GetAccessor */ && - node.kind !== 164 /* SetAccessor */) { + if (node.kind !== 246 /* ClassDeclaration */) { + if (node.kind !== 162 /* MethodDeclaration */ && + node.kind !== 160 /* PropertyDeclaration */ && + node.kind !== 164 /* GetAccessor */ && + node.kind !== 165 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 245 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { + if (!(node.parent.kind === 246 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -67427,7 +67826,7 @@ var ts; else if (flags & 2 /* Ambient */ || node.parent.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 156 /* Parameter */) { + else if (node.kind === 157 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256 /* Async */; @@ -67435,7 +67834,7 @@ var ts; break; } } - if (node.kind === 162 /* Constructor */) { + if (node.kind === 163 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -67450,13 +67849,13 @@ var ts; } return false; } - else if ((node.kind === 254 /* ImportDeclaration */ || node.kind === 253 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 255 /* ImportDeclaration */ || node.kind === 254 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 156 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 157 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 156 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 157 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -67477,37 +67876,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 162 /* Constructor */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 167 /* IndexSignature */: - case 249 /* ModuleDeclaration */: - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 260 /* ExportDeclaration */: - case 259 /* ExportAssignment */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 156 /* Parameter */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 163 /* Constructor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 168 /* IndexSignature */: + case 250 /* ModuleDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 261 /* ExportDeclaration */: + case 260 /* ExportAssignment */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 157 /* Parameter */: return false; default: - if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { + if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { return false; } switch (node.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 126 /* AsyncKeyword */); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 122 /* AbstractKeyword */); - case 246 /* InterfaceDeclaration */: - case 225 /* VariableStatement */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 226 /* VariableStatement */: + case 248 /* TypeAliasDeclaration */: return true; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 81 /* ConstKeyword */); default: ts.Debug.fail(); @@ -67520,10 +67919,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 161 /* MethodDeclaration */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -67638,7 +68037,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 143 /* StringKeyword */ && parameter.type.kind !== 140 /* NumberKeyword */) { + if (parameter.type.kind !== 144 /* StringKeyword */ && parameter.type.kind !== 141 /* NumberKeyword */) { var type = getTypeFromTypeNode(parameter.type); if (type.flags & 4 /* String */ || type.flags & 8 /* Number */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType)); @@ -67680,7 +68079,7 @@ var ts; if (args) { for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 215 /* OmittedExpression */) { + if (arg.kind === 216 /* OmittedExpression */) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -67757,20 +68156,20 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 154 /* ComputedPropertyName */) { + if (node.kind !== 155 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 209 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { + if (computedPropertyName.expression.kind === 210 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } return false; } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 244 /* FunctionDeclaration */ || - node.kind === 201 /* FunctionExpression */ || - node.kind === 161 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 245 /* FunctionDeclaration */ || + node.kind === 202 /* FunctionExpression */ || + node.kind === 162 /* MethodDeclaration */); if (node.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -67789,7 +68188,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 283 /* SpreadAssignment */) { + if (prop.kind === 284 /* SpreadAssignment */) { if (inDestructuring) { // a rest property cannot be destructured any further var expression = ts.skipParentheses(prop.expression); @@ -67800,11 +68199,11 @@ var ts; continue; } var name = prop.name; - if (name.kind === 154 /* ComputedPropertyName */) { + if (name.kind === 155 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name); } - if (prop.kind === 282 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 283 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); @@ -67817,7 +68216,7 @@ var ts; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { // TODO: GH#19955 var mod = _c[_b]; - if (mod.kind !== 126 /* AsyncKeyword */ || prop.kind !== 161 /* MethodDeclaration */) { + if (mod.kind !== 126 /* AsyncKeyword */ || prop.kind !== 162 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -67832,10 +68231,10 @@ var ts; // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; switch (prop.kind) { - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); // falls through - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8 /* NumericLiteral */) { @@ -67843,13 +68242,13 @@ var ts; } currentKind = 4 /* PropertyAssignment */; break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: currentKind = 8 /* Method */; break; - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: currentKind = 1 /* GetAccessor */; break; - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: currentKind = 2 /* SetAccessor */; break; default: @@ -67888,7 +68287,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 275 /* JsxSpreadAttribute */) { + if (attr.kind === 276 /* JsxSpreadAttribute */) { continue; } var name = attr.name, initializer = attr.initializer; @@ -67898,7 +68297,7 @@ var ts; else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 276 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 277 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -67912,14 +68311,14 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 232 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 233 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 32768 /* AwaitContext */) === 0 /* None */) { // use of 'for-await-of' in non-async function var sourceFile = ts.getSourceFileOfNode(forInOrOfStatement); if (!hasParseDiagnostics(sourceFile)) { var diagnostic = ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); var func = ts.getContainingFunction(forInOrOfStatement); - if (func && func.kind !== 162 /* Constructor */) { + if (func && func.kind !== 163 /* Constructor */) { ts.Debug.assert((ts.getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function."); var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); @@ -67930,7 +68329,7 @@ var ts; return false; } } - if (forInOrOfStatement.initializer.kind === 243 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 244 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -67945,20 +68344,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 232 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 232 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 232 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -67983,11 +68382,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, accessor.kind === 163 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, accessor.kind === 164 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - if (accessor.kind === 164 /* SetAccessor */) { + if (accessor.kind === 165 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -68009,21 +68408,21 @@ var ts; * A set accessor has one parameter or a `this` parameter and one more parameter. */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 163 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 164 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 163 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 164 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 147 /* UniqueKeyword */) { - if (node.type.kind !== 144 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(144 /* SymbolKeyword */)); + if (node.operator === 148 /* UniqueKeyword */) { + if (node.type.kind !== 145 /* SymbolKeyword */) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(145 /* SymbolKeyword */)); } var parent = ts.walkUpParenthesizedTypes(node.parent); switch (parent.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: var decl = parent; if (decl.name.kind !== 75 /* Identifier */) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -68035,13 +68434,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: if (!ts.hasModifier(parent, 32 /* Static */) || !ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: if (!ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -68050,9 +68449,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_not_allowed_here); } } - else if (node.operator === 138 /* ReadonlyKeyword */) { - if (node.type.kind !== 174 /* ArrayType */ && node.type.kind !== 175 /* TupleType */) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(144 /* SymbolKeyword */)); + else if (node.operator === 139 /* ReadonlyKeyword */) { + if (node.type.kind !== 175 /* ArrayType */ && node.type.kind !== 176 /* TupleType */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(145 /* SymbolKeyword */)); } } } @@ -68065,8 +68464,8 @@ var ts; if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 161 /* MethodDeclaration */) { - if (node.parent.kind === 193 /* ObjectLiteralExpression */) { + if (node.kind === 162 /* MethodDeclaration */) { + if (node.parent.kind === 194 /* ObjectLiteralExpression */) { // We only disallow modifier on a method declaration if it is a property of object-literal-expression if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 126 /* AsyncKeyword */)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -68094,14 +68493,14 @@ var ts; if (node.flags & 8388608 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.kind === 161 /* MethodDeclaration */ && !node.body) { + else if (node.kind === 162 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 246 /* InterfaceDeclaration */) { + else if (node.parent.kind === 247 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 173 /* TypeLiteral */) { + else if (node.parent.kind === 174 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -68112,11 +68511,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 233 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 234 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -68124,8 +68523,8 @@ var ts; return false; } break; - case 237 /* SwitchStatement */: - if (node.kind === 234 /* BreakStatement */ && !node.label) { + case 238 /* SwitchStatement */: + if (node.kind === 235 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -68140,13 +68539,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 234 /* BreakStatement */ + var message = node.kind === 235 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 234 /* BreakStatement */ + var message = node.kind === 235 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -68170,12 +68569,12 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return ts.isStringOrNumericLiteralLike(expr) || - expr.kind === 207 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 208 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function isBigIntLiteralExpression(expr) { return expr.kind === 9 /* BigIntLiteral */ || - expr.kind === 207 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 208 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */; } function isSimpleLiteralEnumReference(expr) { @@ -68206,7 +68605,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 231 /* ForInStatement */ && node.parent.parent.kind !== 232 /* ForOfStatement */) { + if (node.parent.parent.kind !== 232 /* ForInStatement */ && node.parent.parent.kind !== 233 /* ForOfStatement */) { if (node.flags & 8388608 /* Ambient */) { checkAmbientInitializer(node); } @@ -68219,7 +68618,7 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 225 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { + if (node.exclamationToken && (node.parent.parent.kind !== 226 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation); } var moduleKind = ts.getEmitModuleKind(compilerOptions); @@ -68282,15 +68681,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 227 /* IfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 236 /* WithStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 228 /* IfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 237 /* WithStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: return false; - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -68374,7 +68773,7 @@ var ts; return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } } - else if (node.parent.kind === 246 /* InterfaceDeclaration */) { + else if (node.parent.kind === 247 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -68382,7 +68781,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 173 /* TypeLiteral */) { + else if (node.parent.kind === 174 /* TypeLiteral */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -68411,13 +68810,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 246 /* InterfaceDeclaration */ || - node.kind === 247 /* TypeAliasDeclaration */ || - node.kind === 254 /* ImportDeclaration */ || - node.kind === 253 /* ImportEqualsDeclaration */ || - node.kind === 260 /* ExportDeclaration */ || - node.kind === 259 /* ExportAssignment */ || - node.kind === 252 /* NamespaceExportDeclaration */ || + if (node.kind === 247 /* InterfaceDeclaration */ || + node.kind === 248 /* TypeAliasDeclaration */ || + node.kind === 255 /* ImportDeclaration */ || + node.kind === 254 /* ImportEqualsDeclaration */ || + node.kind === 261 /* ExportDeclaration */ || + node.kind === 260 /* ExportAssignment */ || + node.kind === 253 /* NamespaceExportDeclaration */ || ts.hasModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -68426,7 +68825,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 225 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 226 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -68449,7 +68848,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 223 /* Block */ || node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { + if (node.parent.kind === 224 /* Block */ || node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { var links_2 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_2.hasReportedStatementInAmbientContext) { @@ -68471,10 +68870,10 @@ var ts; if (languageVersion >= 1 /* ES5 */) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 187 /* LiteralType */)) { + else if (ts.isChildOfNodeWithKind(node, 188 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 284 /* EnumMember */)) { + else if (ts.isChildOfNodeWithKind(node, 285 /* EnumMember */)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -68649,14 +69048,14 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 244 /* FunctionDeclaration */ && declaration.kind !== 161 /* MethodDeclaration */) || + return (declaration.kind !== 245 /* FunctionDeclaration */ && declaration.kind !== 162 /* MethodDeclaration */) || !!declaration.body; } /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */ function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return ts.isIdentifier(name); default: return ts.isDeclarationName(name); @@ -68664,14 +69063,14 @@ var ts; } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 255 /* ImportClause */: // For default import - case 253 /* ImportEqualsDeclaration */: - case 256 /* NamespaceImport */: - case 258 /* ImportSpecifier */: // For rename import `x as y` + case 256 /* ImportClause */: // For default import + case 254 /* ImportEqualsDeclaration */: + case 257 /* NamespaceImport */: + case 259 /* ImportSpecifier */: // For rename import `x as y` return true; case 75 /* Identifier */: // For regular import, `decl` is an Identifier under the ImportSpecifier. - return decl.parent.kind === 258 /* ImportSpecifier */; + return decl.parent.kind === 259 /* ImportSpecifier */; default: return false; } @@ -68934,7 +69333,7 @@ var ts; result.push(createModifier(89 /* ExportKeyword */)); } if (flags & 2 /* Ambient */) { - result.push(createModifier(130 /* DeclareKeyword */)); + result.push(createModifier(131 /* DeclareKeyword */)); } if (flags & 512 /* Default */) { result.push(createModifier(84 /* DefaultKeyword */)); @@ -68958,7 +69357,7 @@ var ts; result.push(createModifier(120 /* StaticKeyword */)); } if (flags & 64 /* Readonly */) { - result.push(createModifier(138 /* ReadonlyKeyword */)); + result.push(createModifier(139 /* ReadonlyKeyword */)); } if (flags & 256 /* Async */) { result.push(createModifier(126 /* AsyncKeyword */)); @@ -68968,7 +69367,7 @@ var ts; ts.createModifiersFromModifierFlags = createModifiersFromModifierFlags; // Names function createQualifiedName(left, right) { - var node = createSynthesizedNode(153 /* QualifiedName */); + var node = createSynthesizedNode(154 /* QualifiedName */); node.left = left; node.right = asName(right); return node; @@ -68987,7 +69386,7 @@ var ts; : expression; } function createComputedPropertyName(expression) { - var node = createSynthesizedNode(154 /* ComputedPropertyName */); + var node = createSynthesizedNode(155 /* ComputedPropertyName */); node.expression = parenthesizeForComputedName(expression); return node; } @@ -69000,7 +69399,7 @@ var ts; ts.updateComputedPropertyName = updateComputedPropertyName; // Signature elements function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createSynthesizedNode(155 /* TypeParameter */); + var node = createSynthesizedNode(156 /* TypeParameter */); node.name = asName(name); node.constraint = constraint; node.default = defaultType; @@ -69016,7 +69415,7 @@ var ts; } ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createSynthesizedNode(156 /* Parameter */); + var node = createSynthesizedNode(157 /* Parameter */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; @@ -69040,7 +69439,7 @@ var ts; } ts.updateParameter = updateParameter; function createDecorator(expression) { - var node = createSynthesizedNode(157 /* Decorator */); + var node = createSynthesizedNode(158 /* Decorator */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -69053,7 +69452,7 @@ var ts; ts.updateDecorator = updateDecorator; // Type Elements function createPropertySignature(modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(158 /* PropertySignature */); + var node = createSynthesizedNode(159 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -69073,7 +69472,7 @@ var ts; } ts.updatePropertySignature = updatePropertySignature; function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - var node = createSynthesizedNode(159 /* PropertyDeclaration */); + var node = createSynthesizedNode(160 /* PropertyDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69097,7 +69496,7 @@ var ts; } ts.updateProperty = updateProperty; function createMethodSignature(typeParameters, parameters, type, name, questionToken) { - var node = createSignatureDeclaration(160 /* MethodSignature */, typeParameters, parameters, type); + var node = createSignatureDeclaration(161 /* MethodSignature */, typeParameters, parameters, type); node.name = asName(name); node.questionToken = questionToken; return node; @@ -69114,7 +69513,7 @@ var ts; } ts.updateMethodSignature = updateMethodSignature; function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(161 /* MethodDeclaration */); + var node = createSynthesizedNode(162 /* MethodDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -69174,7 +69573,7 @@ var ts; } ts.updateMethod = updateMethod; function createConstructor(decorators, modifiers, parameters, body) { - var node = createSynthesizedNode(162 /* Constructor */); + var node = createSynthesizedNode(163 /* Constructor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; @@ -69194,7 +69593,7 @@ var ts; } ts.updateConstructor = updateConstructor; function createGetAccessor(decorators, modifiers, name, parameters, type, body) { - var node = createSynthesizedNode(163 /* GetAccessor */); + var node = createSynthesizedNode(164 /* GetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69217,7 +69616,7 @@ var ts; } ts.updateGetAccessor = updateGetAccessor; function createSetAccessor(decorators, modifiers, name, parameters, body) { - var node = createSynthesizedNode(164 /* SetAccessor */); + var node = createSynthesizedNode(165 /* SetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69238,7 +69637,7 @@ var ts; } ts.updateSetAccessor = updateSetAccessor; function createCallSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(165 /* CallSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(166 /* CallSignature */, typeParameters, parameters, type); } ts.createCallSignature = createCallSignature; function updateCallSignature(node, typeParameters, parameters, type) { @@ -69246,7 +69645,7 @@ var ts; } ts.updateCallSignature = updateCallSignature; function createConstructSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(166 /* ConstructSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(167 /* ConstructSignature */, typeParameters, parameters, type); } ts.createConstructSignature = createConstructSignature; function updateConstructSignature(node, typeParameters, parameters, type) { @@ -69254,7 +69653,7 @@ var ts; } ts.updateConstructSignature = updateConstructSignature; function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createSynthesizedNode(167 /* IndexSignature */); + var node = createSynthesizedNode(168 /* IndexSignature */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); @@ -69298,7 +69697,7 @@ var ts; } ts.createTypePredicateNode = createTypePredicateNode; function createTypePredicateNodeWithModifier(assertsModifier, parameterName, type) { - var node = createSynthesizedNode(168 /* TypePredicate */); + var node = createSynthesizedNode(169 /* TypePredicate */); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); node.type = type; @@ -69318,7 +69717,7 @@ var ts; } ts.updateTypePredicateNodeWithModifier = updateTypePredicateNodeWithModifier; function createTypeReferenceNode(typeName, typeArguments) { - var node = createSynthesizedNode(169 /* TypeReference */); + var node = createSynthesizedNode(170 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments); return node; @@ -69332,7 +69731,7 @@ var ts; } ts.updateTypeReferenceNode = updateTypeReferenceNode; function createFunctionTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(170 /* FunctionType */, typeParameters, parameters, type); + return createSignatureDeclaration(171 /* FunctionType */, typeParameters, parameters, type); } ts.createFunctionTypeNode = createFunctionTypeNode; function updateFunctionTypeNode(node, typeParameters, parameters, type) { @@ -69340,7 +69739,7 @@ var ts; } ts.updateFunctionTypeNode = updateFunctionTypeNode; function createConstructorTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(171 /* ConstructorType */, typeParameters, parameters, type); + return createSignatureDeclaration(172 /* ConstructorType */, typeParameters, parameters, type); } ts.createConstructorTypeNode = createConstructorTypeNode; function updateConstructorTypeNode(node, typeParameters, parameters, type) { @@ -69348,7 +69747,7 @@ var ts; } ts.updateConstructorTypeNode = updateConstructorTypeNode; function createTypeQueryNode(exprName) { - var node = createSynthesizedNode(172 /* TypeQuery */); + var node = createSynthesizedNode(173 /* TypeQuery */); node.exprName = exprName; return node; } @@ -69360,7 +69759,7 @@ var ts; } ts.updateTypeQueryNode = updateTypeQueryNode; function createTypeLiteralNode(members) { - var node = createSynthesizedNode(173 /* TypeLiteral */); + var node = createSynthesizedNode(174 /* TypeLiteral */); node.members = createNodeArray(members); return node; } @@ -69372,7 +69771,7 @@ var ts; } ts.updateTypeLiteralNode = updateTypeLiteralNode; function createArrayTypeNode(elementType) { - var node = createSynthesizedNode(174 /* ArrayType */); + var node = createSynthesizedNode(175 /* ArrayType */); node.elementType = ts.parenthesizeArrayTypeMember(elementType); return node; } @@ -69384,7 +69783,7 @@ var ts; } ts.updateArrayTypeNode = updateArrayTypeNode; function createTupleTypeNode(elementTypes) { - var node = createSynthesizedNode(175 /* TupleType */); + var node = createSynthesizedNode(176 /* TupleType */); node.elementTypes = createNodeArray(elementTypes); return node; } @@ -69396,7 +69795,7 @@ var ts; } ts.updateTupleTypeNode = updateTupleTypeNode; function createOptionalTypeNode(type) { - var node = createSynthesizedNode(176 /* OptionalType */); + var node = createSynthesizedNode(177 /* OptionalType */); node.type = ts.parenthesizeArrayTypeMember(type); return node; } @@ -69408,7 +69807,7 @@ var ts; } ts.updateOptionalTypeNode = updateOptionalTypeNode; function createRestTypeNode(type) { - var node = createSynthesizedNode(177 /* RestType */); + var node = createSynthesizedNode(178 /* RestType */); node.type = type; return node; } @@ -69420,7 +69819,7 @@ var ts; } ts.updateRestTypeNode = updateRestTypeNode; function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(178 /* UnionType */, types); + return createUnionOrIntersectionTypeNode(179 /* UnionType */, types); } ts.createUnionTypeNode = createUnionTypeNode; function updateUnionTypeNode(node, types) { @@ -69428,7 +69827,7 @@ var ts; } ts.updateUnionTypeNode = updateUnionTypeNode; function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(179 /* IntersectionType */, types); + return createUnionOrIntersectionTypeNode(180 /* IntersectionType */, types); } ts.createIntersectionTypeNode = createIntersectionTypeNode; function updateIntersectionTypeNode(node, types) { @@ -69447,7 +69846,7 @@ var ts; : node; } function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - var node = createSynthesizedNode(180 /* ConditionalType */); + var node = createSynthesizedNode(181 /* ConditionalType */); node.checkType = ts.parenthesizeConditionalTypeMember(checkType); node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType); node.trueType = trueType; @@ -69465,7 +69864,7 @@ var ts; } ts.updateConditionalTypeNode = updateConditionalTypeNode; function createInferTypeNode(typeParameter) { - var node = createSynthesizedNode(181 /* InferType */); + var node = createSynthesizedNode(182 /* InferType */); node.typeParameter = typeParameter; return node; } @@ -69477,7 +69876,7 @@ var ts; } ts.updateInferTypeNode = updateInferTypeNode; function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) { - var node = createSynthesizedNode(188 /* ImportType */); + var node = createSynthesizedNode(189 /* ImportType */); node.argument = argument; node.qualifier = qualifier; node.typeArguments = ts.parenthesizeTypeParameters(typeArguments); @@ -69495,7 +69894,7 @@ var ts; } ts.updateImportTypeNode = updateImportTypeNode; function createParenthesizedType(type) { - var node = createSynthesizedNode(182 /* ParenthesizedType */); + var node = createSynthesizedNode(183 /* ParenthesizedType */); node.type = type; return node; } @@ -69507,12 +69906,12 @@ var ts; } ts.updateParenthesizedType = updateParenthesizedType; function createThisTypeNode() { - return createSynthesizedNode(183 /* ThisType */); + return createSynthesizedNode(184 /* ThisType */); } ts.createThisTypeNode = createThisTypeNode; function createTypeOperatorNode(operatorOrType, type) { - var node = createSynthesizedNode(184 /* TypeOperator */); - node.operator = typeof operatorOrType === "number" ? operatorOrType : 134 /* KeyOfKeyword */; + var node = createSynthesizedNode(185 /* TypeOperator */); + node.operator = typeof operatorOrType === "number" ? operatorOrType : 135 /* KeyOfKeyword */; node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); return node; } @@ -69522,7 +69921,7 @@ var ts; } ts.updateTypeOperatorNode = updateTypeOperatorNode; function createIndexedAccessTypeNode(objectType, indexType) { - var node = createSynthesizedNode(185 /* IndexedAccessType */); + var node = createSynthesizedNode(186 /* IndexedAccessType */); node.objectType = ts.parenthesizeElementTypeMember(objectType); node.indexType = indexType; return node; @@ -69536,7 +69935,7 @@ var ts; } ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { - var node = createSynthesizedNode(186 /* MappedType */); + var node = createSynthesizedNode(187 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.questionToken = questionToken; @@ -69554,7 +69953,7 @@ var ts; } ts.updateMappedTypeNode = updateMappedTypeNode; function createLiteralTypeNode(literal) { - var node = createSynthesizedNode(187 /* LiteralType */); + var node = createSynthesizedNode(188 /* LiteralType */); node.literal = literal; return node; } @@ -69567,7 +69966,7 @@ var ts; ts.updateLiteralTypeNode = updateLiteralTypeNode; // Binding Patterns function createObjectBindingPattern(elements) { - var node = createSynthesizedNode(189 /* ObjectBindingPattern */); + var node = createSynthesizedNode(190 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -69579,7 +69978,7 @@ var ts; } ts.updateObjectBindingPattern = updateObjectBindingPattern; function createArrayBindingPattern(elements) { - var node = createSynthesizedNode(190 /* ArrayBindingPattern */); + var node = createSynthesizedNode(191 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -69591,7 +69990,7 @@ var ts; } ts.updateArrayBindingPattern = updateArrayBindingPattern; function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createSynthesizedNode(191 /* BindingElement */); + var node = createSynthesizedNode(192 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -69610,7 +70009,7 @@ var ts; ts.updateBindingElement = updateBindingElement; // Expression function createArrayLiteral(elements, multiLine) { - var node = createSynthesizedNode(192 /* ArrayLiteralExpression */); + var node = createSynthesizedNode(193 /* ArrayLiteralExpression */); node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) node.multiLine = true; @@ -69624,7 +70023,7 @@ var ts; } ts.updateArrayLiteral = updateArrayLiteral; function createObjectLiteral(properties, multiLine) { - var node = createSynthesizedNode(193 /* ObjectLiteralExpression */); + var node = createSynthesizedNode(194 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); if (multiLine) node.multiLine = true; @@ -69638,7 +70037,7 @@ var ts; } ts.updateObjectLiteral = updateObjectLiteral; function createPropertyAccess(expression, name) { - var node = createSynthesizedNode(194 /* PropertyAccessExpression */); + var node = createSynthesizedNode(195 /* PropertyAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.name = asName(name); setEmitFlags(node, 131072 /* NoIndentation */); @@ -69660,7 +70059,7 @@ var ts; } ts.updatePropertyAccess = updatePropertyAccess; function createPropertyAccessChain(expression, questionDotToken, name) { - var node = createSynthesizedNode(194 /* PropertyAccessExpression */); + var node = createSynthesizedNode(195 /* PropertyAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -69681,7 +70080,7 @@ var ts; } ts.updatePropertyAccessChain = updatePropertyAccessChain; function createElementAccess(expression, index) { - var node = createSynthesizedNode(195 /* ElementAccessExpression */); + var node = createSynthesizedNode(196 /* ElementAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.argumentExpression = asExpression(index); return node; @@ -69698,7 +70097,7 @@ var ts; } ts.updateElementAccess = updateElementAccess; function createElementAccessChain(expression, questionDotToken, index) { - var node = createSynthesizedNode(195 /* ElementAccessExpression */); + var node = createSynthesizedNode(196 /* ElementAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -69716,7 +70115,7 @@ var ts; } ts.updateElementAccessChain = updateElementAccessChain; function createCall(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(196 /* CallExpression */); + var node = createSynthesizedNode(197 /* CallExpression */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); @@ -69735,7 +70134,7 @@ var ts; } ts.updateCall = updateCall; function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { - var node = createSynthesizedNode(196 /* CallExpression */); + var node = createSynthesizedNode(197 /* CallExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -69755,7 +70154,7 @@ var ts; } ts.updateCallChain = updateCallChain; function createNew(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(197 /* NewExpression */); + var node = createSynthesizedNode(198 /* NewExpression */); node.expression = ts.parenthesizeForNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; @@ -69771,7 +70170,7 @@ var ts; } ts.updateNew = updateNew; function createTaggedTemplate(tag, typeArgumentsOrTemplate, template) { - var node = createSynthesizedNode(198 /* TaggedTemplateExpression */); + var node = createSynthesizedNode(199 /* TaggedTemplateExpression */); node.tag = ts.parenthesizeForAccess(tag); if (template) { node.typeArguments = asNodeArray(typeArgumentsOrTemplate); @@ -69794,7 +70193,7 @@ var ts; } ts.updateTaggedTemplate = updateTaggedTemplate; function createTypeAssertion(type, expression) { - var node = createSynthesizedNode(199 /* TypeAssertionExpression */); + var node = createSynthesizedNode(200 /* TypeAssertionExpression */); node.type = type; node.expression = ts.parenthesizePrefixOperand(expression); return node; @@ -69808,7 +70207,7 @@ var ts; } ts.updateTypeAssertion = updateTypeAssertion; function createParen(expression) { - var node = createSynthesizedNode(200 /* ParenthesizedExpression */); + var node = createSynthesizedNode(201 /* ParenthesizedExpression */); node.expression = expression; return node; } @@ -69820,7 +70219,7 @@ var ts; } ts.updateParen = updateParen; function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(201 /* FunctionExpression */); + var node = createSynthesizedNode(202 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -69844,7 +70243,7 @@ var ts; } ts.updateFunctionExpression = updateFunctionExpression; function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createSynthesizedNode(202 /* ArrowFunction */); + var node = createSynthesizedNode(203 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -69866,7 +70265,7 @@ var ts; } ts.updateArrowFunction = updateArrowFunction; function createDelete(expression) { - var node = createSynthesizedNode(203 /* DeleteExpression */); + var node = createSynthesizedNode(204 /* DeleteExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -69878,7 +70277,7 @@ var ts; } ts.updateDelete = updateDelete; function createTypeOf(expression) { - var node = createSynthesizedNode(204 /* TypeOfExpression */); + var node = createSynthesizedNode(205 /* TypeOfExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -69890,7 +70289,7 @@ var ts; } ts.updateTypeOf = updateTypeOf; function createVoid(expression) { - var node = createSynthesizedNode(205 /* VoidExpression */); + var node = createSynthesizedNode(206 /* VoidExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -69902,7 +70301,7 @@ var ts; } ts.updateVoid = updateVoid; function createAwait(expression) { - var node = createSynthesizedNode(206 /* AwaitExpression */); + var node = createSynthesizedNode(207 /* AwaitExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -69914,7 +70313,7 @@ var ts; } ts.updateAwait = updateAwait; function createPrefix(operator, operand) { - var node = createSynthesizedNode(207 /* PrefixUnaryExpression */); + var node = createSynthesizedNode(208 /* PrefixUnaryExpression */); node.operator = operator; node.operand = ts.parenthesizePrefixOperand(operand); return node; @@ -69927,7 +70326,7 @@ var ts; } ts.updatePrefix = updatePrefix; function createPostfix(operand, operator) { - var node = createSynthesizedNode(208 /* PostfixUnaryExpression */); + var node = createSynthesizedNode(209 /* PostfixUnaryExpression */); node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; @@ -69940,7 +70339,7 @@ var ts; } ts.updatePostfix = updatePostfix; function createBinary(left, operator, right) { - var node = createSynthesizedNode(209 /* BinaryExpression */); + var node = createSynthesizedNode(210 /* BinaryExpression */); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = ts.parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); @@ -69957,7 +70356,7 @@ var ts; } ts.updateBinary = updateBinary; function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - var node = createSynthesizedNode(210 /* ConditionalExpression */); + var node = createSynthesizedNode(211 /* ConditionalExpression */); node.condition = ts.parenthesizeForConditionalHead(condition); node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(57 /* QuestionToken */); node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); @@ -69977,7 +70376,7 @@ var ts; } ts.updateConditional = updateConditional; function createTemplateExpression(head, templateSpans) { - var node = createSynthesizedNode(211 /* TemplateExpression */); + var node = createSynthesizedNode(212 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; @@ -70074,7 +70473,7 @@ var ts; } ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral; function createYield(asteriskTokenOrExpression, expression) { - var node = createSynthesizedNode(212 /* YieldExpression */); + var node = createSynthesizedNode(213 /* YieldExpression */); node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 41 /* AsteriskToken */ ? asteriskTokenOrExpression : undefined; node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 41 /* AsteriskToken */ ? asteriskTokenOrExpression : expression; return node; @@ -70088,7 +70487,7 @@ var ts; } ts.updateYield = updateYield; function createSpread(expression) { - var node = createSynthesizedNode(213 /* SpreadElement */); + var node = createSynthesizedNode(214 /* SpreadElement */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -70100,7 +70499,7 @@ var ts; } ts.updateSpread = updateSpread; function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(214 /* ClassExpression */); + var node = createSynthesizedNode(215 /* ClassExpression */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70121,11 +70520,11 @@ var ts; } ts.updateClassExpression = updateClassExpression; function createOmittedExpression() { - return createSynthesizedNode(215 /* OmittedExpression */); + return createSynthesizedNode(216 /* OmittedExpression */); } ts.createOmittedExpression = createOmittedExpression; function createExpressionWithTypeArguments(typeArguments, expression) { - var node = createSynthesizedNode(216 /* ExpressionWithTypeArguments */); + var node = createSynthesizedNode(217 /* ExpressionWithTypeArguments */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); return node; @@ -70139,7 +70538,7 @@ var ts; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; function createAsExpression(expression, type) { - var node = createSynthesizedNode(217 /* AsExpression */); + var node = createSynthesizedNode(218 /* AsExpression */); node.expression = expression; node.type = type; return node; @@ -70153,7 +70552,7 @@ var ts; } ts.updateAsExpression = updateAsExpression; function createNonNullExpression(expression) { - var node = createSynthesizedNode(218 /* NonNullExpression */); + var node = createSynthesizedNode(219 /* NonNullExpression */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -70165,7 +70564,7 @@ var ts; } ts.updateNonNullExpression = updateNonNullExpression; function createMetaProperty(keywordToken, name) { - var node = createSynthesizedNode(219 /* MetaProperty */); + var node = createSynthesizedNode(220 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; return node; @@ -70179,7 +70578,7 @@ var ts; ts.updateMetaProperty = updateMetaProperty; // Misc function createTemplateSpan(expression, literal) { - var node = createSynthesizedNode(221 /* TemplateSpan */); + var node = createSynthesizedNode(222 /* TemplateSpan */); node.expression = expression; node.literal = literal; return node; @@ -70193,12 +70592,12 @@ var ts; } ts.updateTemplateSpan = updateTemplateSpan; function createSemicolonClassElement() { - return createSynthesizedNode(222 /* SemicolonClassElement */); + return createSynthesizedNode(223 /* SemicolonClassElement */); } ts.createSemicolonClassElement = createSemicolonClassElement; // Element function createBlock(statements, multiLine) { - var block = createSynthesizedNode(223 /* Block */); + var block = createSynthesizedNode(224 /* Block */); block.statements = createNodeArray(statements); if (multiLine) block.multiLine = multiLine; @@ -70212,7 +70611,7 @@ var ts; } ts.updateBlock = updateBlock; function createVariableStatement(modifiers, declarationList) { - var node = createSynthesizedNode(225 /* VariableStatement */); + var node = createSynthesizedNode(226 /* VariableStatement */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; @@ -70227,11 +70626,11 @@ var ts; } ts.updateVariableStatement = updateVariableStatement; function createEmptyStatement() { - return createSynthesizedNode(224 /* EmptyStatement */); + return createSynthesizedNode(225 /* EmptyStatement */); } ts.createEmptyStatement = createEmptyStatement; function createExpressionStatement(expression) { - var node = createSynthesizedNode(226 /* ExpressionStatement */); + var node = createSynthesizedNode(227 /* ExpressionStatement */); node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } @@ -70247,7 +70646,7 @@ var ts; /** @deprecated Use `updateExpressionStatement` instead. */ ts.updateStatement = updateExpressionStatement; function createIf(expression, thenStatement, elseStatement) { - var node = createSynthesizedNode(227 /* IfStatement */); + var node = createSynthesizedNode(228 /* IfStatement */); node.expression = expression; node.thenStatement = asEmbeddedStatement(thenStatement); node.elseStatement = asEmbeddedStatement(elseStatement); @@ -70263,7 +70662,7 @@ var ts; } ts.updateIf = updateIf; function createDo(statement, expression) { - var node = createSynthesizedNode(228 /* DoStatement */); + var node = createSynthesizedNode(229 /* DoStatement */); node.statement = asEmbeddedStatement(statement); node.expression = expression; return node; @@ -70277,7 +70676,7 @@ var ts; } ts.updateDo = updateDo; function createWhile(expression, statement) { - var node = createSynthesizedNode(229 /* WhileStatement */); + var node = createSynthesizedNode(230 /* WhileStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -70291,7 +70690,7 @@ var ts; } ts.updateWhile = updateWhile; function createFor(initializer, condition, incrementor, statement) { - var node = createSynthesizedNode(230 /* ForStatement */); + var node = createSynthesizedNode(231 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -70309,7 +70708,7 @@ var ts; } ts.updateFor = updateFor; function createForIn(initializer, expression, statement) { - var node = createSynthesizedNode(231 /* ForInStatement */); + var node = createSynthesizedNode(232 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = asEmbeddedStatement(statement); @@ -70325,7 +70724,7 @@ var ts; } ts.updateForIn = updateForIn; function createForOf(awaitModifier, initializer, expression, statement) { - var node = createSynthesizedNode(232 /* ForOfStatement */); + var node = createSynthesizedNode(233 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = ts.isCommaSequence(expression) ? createParen(expression) : expression; @@ -70343,7 +70742,7 @@ var ts; } ts.updateForOf = updateForOf; function createContinue(label) { - var node = createSynthesizedNode(233 /* ContinueStatement */); + var node = createSynthesizedNode(234 /* ContinueStatement */); node.label = asName(label); return node; } @@ -70355,7 +70754,7 @@ var ts; } ts.updateContinue = updateContinue; function createBreak(label) { - var node = createSynthesizedNode(234 /* BreakStatement */); + var node = createSynthesizedNode(235 /* BreakStatement */); node.label = asName(label); return node; } @@ -70367,7 +70766,7 @@ var ts; } ts.updateBreak = updateBreak; function createReturn(expression) { - var node = createSynthesizedNode(235 /* ReturnStatement */); + var node = createSynthesizedNode(236 /* ReturnStatement */); node.expression = expression; return node; } @@ -70379,7 +70778,7 @@ var ts; } ts.updateReturn = updateReturn; function createWith(expression, statement) { - var node = createSynthesizedNode(236 /* WithStatement */); + var node = createSynthesizedNode(237 /* WithStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -70393,7 +70792,7 @@ var ts; } ts.updateWith = updateWith; function createSwitch(expression, caseBlock) { - var node = createSynthesizedNode(237 /* SwitchStatement */); + var node = createSynthesizedNode(238 /* SwitchStatement */); node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; @@ -70407,7 +70806,7 @@ var ts; } ts.updateSwitch = updateSwitch; function createLabel(label, statement) { - var node = createSynthesizedNode(238 /* LabeledStatement */); + var node = createSynthesizedNode(239 /* LabeledStatement */); node.label = asName(label); node.statement = asEmbeddedStatement(statement); return node; @@ -70421,7 +70820,7 @@ var ts; } ts.updateLabel = updateLabel; function createThrow(expression) { - var node = createSynthesizedNode(239 /* ThrowStatement */); + var node = createSynthesizedNode(240 /* ThrowStatement */); node.expression = expression; return node; } @@ -70433,7 +70832,7 @@ var ts; } ts.updateThrow = updateThrow; function createTry(tryBlock, catchClause, finallyBlock) { - var node = createSynthesizedNode(240 /* TryStatement */); + var node = createSynthesizedNode(241 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -70449,12 +70848,12 @@ var ts; } ts.updateTry = updateTry; function createDebuggerStatement() { - return createSynthesizedNode(241 /* DebuggerStatement */); + return createSynthesizedNode(242 /* DebuggerStatement */); } ts.createDebuggerStatement = createDebuggerStatement; function createVariableDeclaration(name, type, initializer) { /* Internally, one should probably use createTypeScriptVariableDeclaration instead and handle definite assignment assertions */ - var node = createSynthesizedNode(242 /* VariableDeclaration */); + var node = createSynthesizedNode(243 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -70472,7 +70871,7 @@ var ts; ts.updateVariableDeclaration = updateVariableDeclaration; /* @internal */ function createTypeScriptVariableDeclaration(name, exclaimationToken, type, initializer) { - var node = createSynthesizedNode(242 /* VariableDeclaration */); + var node = createSynthesizedNode(243 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -70492,7 +70891,7 @@ var ts; ts.updateTypeScriptVariableDeclaration = updateTypeScriptVariableDeclaration; function createVariableDeclarationList(declarations, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(243 /* VariableDeclarationList */); + var node = createSynthesizedNode(244 /* VariableDeclarationList */); node.flags |= flags & 3 /* BlockScoped */; node.declarations = createNodeArray(declarations); return node; @@ -70505,7 +70904,7 @@ var ts; } ts.updateVariableDeclarationList = updateVariableDeclarationList; function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(244 /* FunctionDeclaration */); + var node = createSynthesizedNode(245 /* FunctionDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -70531,7 +70930,7 @@ var ts; } ts.updateFunctionDeclaration = updateFunctionDeclaration; function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(245 /* ClassDeclaration */); + var node = createSynthesizedNode(246 /* ClassDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70553,7 +70952,7 @@ var ts; } ts.updateClassDeclaration = updateClassDeclaration; function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(246 /* InterfaceDeclaration */); + var node = createSynthesizedNode(247 /* InterfaceDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70575,7 +70974,7 @@ var ts; } ts.updateInterfaceDeclaration = updateInterfaceDeclaration; function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createSynthesizedNode(247 /* TypeAliasDeclaration */); + var node = createSynthesizedNode(248 /* TypeAliasDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70595,7 +70994,7 @@ var ts; } ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration; function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createSynthesizedNode(248 /* EnumDeclaration */); + var node = createSynthesizedNode(249 /* EnumDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70614,7 +71013,7 @@ var ts; ts.updateEnumDeclaration = updateEnumDeclaration; function createModuleDeclaration(decorators, modifiers, name, body, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(249 /* ModuleDeclaration */); + var node = createSynthesizedNode(250 /* ModuleDeclaration */); node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); @@ -70633,7 +71032,7 @@ var ts; } ts.updateModuleDeclaration = updateModuleDeclaration; function createModuleBlock(statements) { - var node = createSynthesizedNode(250 /* ModuleBlock */); + var node = createSynthesizedNode(251 /* ModuleBlock */); node.statements = createNodeArray(statements); return node; } @@ -70645,7 +71044,7 @@ var ts; } ts.updateModuleBlock = updateModuleBlock; function createCaseBlock(clauses) { - var node = createSynthesizedNode(251 /* CaseBlock */); + var node = createSynthesizedNode(252 /* CaseBlock */); node.clauses = createNodeArray(clauses); return node; } @@ -70657,7 +71056,7 @@ var ts; } ts.updateCaseBlock = updateCaseBlock; function createNamespaceExportDeclaration(name) { - var node = createSynthesizedNode(252 /* NamespaceExportDeclaration */); + var node = createSynthesizedNode(253 /* NamespaceExportDeclaration */); node.name = asName(name); return node; } @@ -70669,7 +71068,7 @@ var ts; } ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration; function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createSynthesizedNode(253 /* ImportEqualsDeclaration */); + var node = createSynthesizedNode(254 /* ImportEqualsDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70687,7 +71086,7 @@ var ts; } ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createSynthesizedNode(254 /* ImportDeclaration */); + var node = createSynthesizedNode(255 /* ImportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -70706,7 +71105,7 @@ var ts; ts.updateImportDeclaration = updateImportDeclaration; function createImportClause(name, namedBindings, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(255 /* ImportClause */); + var node = createSynthesizedNode(256 /* ImportClause */); node.name = name; node.namedBindings = namedBindings; node.isTypeOnly = isTypeOnly; @@ -70722,13 +71121,13 @@ var ts; } ts.updateImportClause = updateImportClause; function createNamespaceImport(name) { - var node = createSynthesizedNode(256 /* NamespaceImport */); + var node = createSynthesizedNode(257 /* NamespaceImport */); node.name = name; return node; } ts.createNamespaceImport = createNamespaceImport; function createNamespaceExport(name) { - var node = createSynthesizedNode(262 /* NamespaceExport */); + var node = createSynthesizedNode(263 /* NamespaceExport */); node.name = name; return node; } @@ -70746,7 +71145,7 @@ var ts; } ts.updateNamespaceExport = updateNamespaceExport; function createNamedImports(elements) { - var node = createSynthesizedNode(257 /* NamedImports */); + var node = createSynthesizedNode(258 /* NamedImports */); node.elements = createNodeArray(elements); return node; } @@ -70758,7 +71157,7 @@ var ts; } ts.updateNamedImports = updateNamedImports; function createImportSpecifier(propertyName, name) { - var node = createSynthesizedNode(258 /* ImportSpecifier */); + var node = createSynthesizedNode(259 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; return node; @@ -70772,7 +71171,7 @@ var ts; } ts.updateImportSpecifier = updateImportSpecifier; function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createSynthesizedNode(259 /* ExportAssignment */); + var node = createSynthesizedNode(260 /* ExportAssignment */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -70790,7 +71189,7 @@ var ts; ts.updateExportAssignment = updateExportAssignment; function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(260 /* ExportDeclaration */); + var node = createSynthesizedNode(261 /* ExportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isTypeOnly = isTypeOnly; @@ -70815,7 +71214,7 @@ var ts; } ts.createEmptyExports = createEmptyExports; function createNamedExports(elements) { - var node = createSynthesizedNode(261 /* NamedExports */); + var node = createSynthesizedNode(262 /* NamedExports */); node.elements = createNodeArray(elements); return node; } @@ -70827,7 +71226,7 @@ var ts; } ts.updateNamedExports = updateNamedExports; function createExportSpecifier(propertyName, name) { - var node = createSynthesizedNode(263 /* ExportSpecifier */); + var node = createSynthesizedNode(264 /* ExportSpecifier */); node.propertyName = asName(propertyName); node.name = asName(name); return node; @@ -70842,7 +71241,7 @@ var ts; ts.updateExportSpecifier = updateExportSpecifier; // Module references function createExternalModuleReference(expression) { - var node = createSynthesizedNode(265 /* ExternalModuleReference */); + var node = createSynthesizedNode(266 /* ExternalModuleReference */); node.expression = expression; return node; } @@ -70856,14 +71255,14 @@ var ts; // JSDoc /* @internal */ function createJSDocTypeExpression(type) { - var node = createSynthesizedNode(294 /* JSDocTypeExpression */); + var node = createSynthesizedNode(295 /* JSDocTypeExpression */); node.type = type; return node; } ts.createJSDocTypeExpression = createJSDocTypeExpression; /* @internal */ function createJSDocTypeTag(typeExpression, comment) { - var tag = createJSDocTag(320 /* JSDocTypeTag */, "type"); + var tag = createJSDocTag(321 /* JSDocTypeTag */, "type"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -70871,7 +71270,7 @@ var ts; ts.createJSDocTypeTag = createJSDocTypeTag; /* @internal */ function createJSDocReturnTag(typeExpression, comment) { - var tag = createJSDocTag(318 /* JSDocReturnTag */, "returns"); + var tag = createJSDocTag(319 /* JSDocReturnTag */, "returns"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -70879,14 +71278,14 @@ var ts; ts.createJSDocReturnTag = createJSDocReturnTag; /** @internal */ function createJSDocThisTag(typeExpression) { - var tag = createJSDocTag(319 /* JSDocThisTag */, "this"); + var tag = createJSDocTag(320 /* JSDocThisTag */, "this"); tag.typeExpression = typeExpression; return tag; } ts.createJSDocThisTag = createJSDocThisTag; /* @internal */ function createJSDocParamTag(name, isBracketed, typeExpression, comment) { - var tag = createJSDocTag(317 /* JSDocParameterTag */, "param"); + var tag = createJSDocTag(318 /* JSDocParameterTag */, "param"); tag.typeExpression = typeExpression; tag.name = name; tag.isBracketed = isBracketed; @@ -70896,7 +71295,7 @@ var ts; ts.createJSDocParamTag = createJSDocParamTag; /* @internal */ function createJSDocComment(comment, tags) { - var node = createSynthesizedNode(303 /* JSDocComment */); + var node = createSynthesizedNode(304 /* JSDocComment */); node.comment = comment; node.tags = tags; return node; @@ -70910,7 +71309,7 @@ var ts; } // JSX function createJsxElement(openingElement, children, closingElement) { - var node = createSynthesizedNode(266 /* JsxElement */); + var node = createSynthesizedNode(267 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -70926,7 +71325,7 @@ var ts; } ts.updateJsxElement = updateJsxElement; function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(267 /* JsxSelfClosingElement */); + var node = createSynthesizedNode(268 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -70942,7 +71341,7 @@ var ts; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; function createJsxOpeningElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(268 /* JsxOpeningElement */); + var node = createSynthesizedNode(269 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -70958,7 +71357,7 @@ var ts; } ts.updateJsxOpeningElement = updateJsxOpeningElement; function createJsxClosingElement(tagName) { - var node = createSynthesizedNode(269 /* JsxClosingElement */); + var node = createSynthesizedNode(270 /* JsxClosingElement */); node.tagName = tagName; return node; } @@ -70970,7 +71369,7 @@ var ts; } ts.updateJsxClosingElement = updateJsxClosingElement; function createJsxFragment(openingFragment, children, closingFragment) { - var node = createSynthesizedNode(270 /* JsxFragment */); + var node = createSynthesizedNode(271 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -70992,11 +71391,11 @@ var ts; } ts.updateJsxText = updateJsxText; function createJsxOpeningFragment() { - return createSynthesizedNode(271 /* JsxOpeningFragment */); + return createSynthesizedNode(272 /* JsxOpeningFragment */); } ts.createJsxOpeningFragment = createJsxOpeningFragment; function createJsxJsxClosingFragment() { - return createSynthesizedNode(272 /* JsxClosingFragment */); + return createSynthesizedNode(273 /* JsxClosingFragment */); } ts.createJsxJsxClosingFragment = createJsxJsxClosingFragment; function updateJsxFragment(node, openingFragment, children, closingFragment) { @@ -71008,7 +71407,7 @@ var ts; } ts.updateJsxFragment = updateJsxFragment; function createJsxAttribute(name, initializer) { - var node = createSynthesizedNode(273 /* JsxAttribute */); + var node = createSynthesizedNode(274 /* JsxAttribute */); node.name = name; node.initializer = initializer; return node; @@ -71022,7 +71421,7 @@ var ts; } ts.updateJsxAttribute = updateJsxAttribute; function createJsxAttributes(properties) { - var node = createSynthesizedNode(274 /* JsxAttributes */); + var node = createSynthesizedNode(275 /* JsxAttributes */); node.properties = createNodeArray(properties); return node; } @@ -71034,7 +71433,7 @@ var ts; } ts.updateJsxAttributes = updateJsxAttributes; function createJsxSpreadAttribute(expression) { - var node = createSynthesizedNode(275 /* JsxSpreadAttribute */); + var node = createSynthesizedNode(276 /* JsxSpreadAttribute */); node.expression = expression; return node; } @@ -71046,7 +71445,7 @@ var ts; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; function createJsxExpression(dotDotDotToken, expression) { - var node = createSynthesizedNode(276 /* JsxExpression */); + var node = createSynthesizedNode(277 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; @@ -71060,7 +71459,7 @@ var ts; ts.updateJsxExpression = updateJsxExpression; // Clauses function createCaseClause(expression, statements) { - var node = createSynthesizedNode(277 /* CaseClause */); + var node = createSynthesizedNode(278 /* CaseClause */); node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; @@ -71074,7 +71473,7 @@ var ts; } ts.updateCaseClause = updateCaseClause; function createDefaultClause(statements) { - var node = createSynthesizedNode(278 /* DefaultClause */); + var node = createSynthesizedNode(279 /* DefaultClause */); node.statements = createNodeArray(statements); return node; } @@ -71086,7 +71485,7 @@ var ts; } ts.updateDefaultClause = updateDefaultClause; function createHeritageClause(token, types) { - var node = createSynthesizedNode(279 /* HeritageClause */); + var node = createSynthesizedNode(280 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); return node; @@ -71099,7 +71498,7 @@ var ts; } ts.updateHeritageClause = updateHeritageClause; function createCatchClause(variableDeclaration, block) { - var node = createSynthesizedNode(280 /* CatchClause */); + var node = createSynthesizedNode(281 /* CatchClause */); node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -71114,7 +71513,7 @@ var ts; ts.updateCatchClause = updateCatchClause; // Property assignments function createPropertyAssignment(name, initializer) { - var node = createSynthesizedNode(281 /* PropertyAssignment */); + var node = createSynthesizedNode(282 /* PropertyAssignment */); node.name = asName(name); node.questionToken = undefined; node.initializer = ts.parenthesizeExpressionForList(initializer); @@ -71129,7 +71528,7 @@ var ts; } ts.updatePropertyAssignment = updatePropertyAssignment; function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createSynthesizedNode(282 /* ShorthandPropertyAssignment */); + var node = createSynthesizedNode(283 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; @@ -71143,7 +71542,7 @@ var ts; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; function createSpreadAssignment(expression) { - var node = createSynthesizedNode(283 /* SpreadAssignment */); + var node = createSynthesizedNode(284 /* SpreadAssignment */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -71156,7 +71555,7 @@ var ts; ts.updateSpreadAssignment = updateSpreadAssignment; // Enum function createEnumMember(name, initializer) { - var node = createSynthesizedNode(284 /* EnumMember */); + var node = createSynthesizedNode(285 /* EnumMember */); node.name = asName(name); node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); return node; @@ -71177,7 +71576,7 @@ var ts; (typeReferences !== undefined && node.typeReferenceDirectives !== typeReferences) || (libReferences !== undefined && node.libReferenceDirectives !== libReferences) || (hasNoDefaultLib !== undefined && node.hasNoDefaultLib !== hasNoDefaultLib)) { - var updated = createSynthesizedNode(290 /* SourceFile */); + var updated = createSynthesizedNode(291 /* SourceFile */); updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; @@ -71261,7 +71660,7 @@ var ts; * @param original The original statement. */ function createNotEmittedStatement(original) { - var node = createSynthesizedNode(325 /* NotEmittedStatement */); + var node = createSynthesizedNode(326 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; @@ -71273,7 +71672,7 @@ var ts; */ /* @internal */ function createEndOfDeclarationMarker(original) { - var node = createSynthesizedNode(329 /* EndOfDeclarationMarker */); + var node = createSynthesizedNode(330 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -71285,7 +71684,7 @@ var ts; */ /* @internal */ function createMergeDeclarationMarker(original) { - var node = createSynthesizedNode(328 /* MergeDeclarationMarker */); + var node = createSynthesizedNode(329 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -71300,7 +71699,7 @@ var ts; * @param location The location for the expression. Defaults to the positions from "original" if provided. */ function createPartiallyEmittedExpression(expression, original) { - var node = createSynthesizedNode(326 /* PartiallyEmittedExpression */); + var node = createSynthesizedNode(327 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; setTextRange(node, original); @@ -71316,7 +71715,7 @@ var ts; ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; function flattenCommaElements(node) { if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { - if (node.kind === 327 /* CommaListExpression */) { + if (node.kind === 328 /* CommaListExpression */) { return node.elements; } if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) { @@ -71326,7 +71725,7 @@ var ts; return node; } function createCommaList(elements) { - var node = createSynthesizedNode(327 /* CommaListExpression */); + var node = createSynthesizedNode(328 /* CommaListExpression */); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); return node; } @@ -71339,7 +71738,7 @@ var ts; ts.updateCommaList = updateCommaList; /* @internal */ function createSyntheticReferenceExpression(expression, thisArg) { - var node = createSynthesizedNode(330 /* SyntheticReferenceExpression */); + var node = createSynthesizedNode(331 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; return node; @@ -71355,7 +71754,7 @@ var ts; ts.updateSyntheticReferenceExpression = updateSyntheticReferenceExpression; function createBundle(sourceFiles, prepends) { if (prepends === void 0) { prepends = ts.emptyArray; } - var node = ts.createNode(291 /* Bundle */); + var node = ts.createNode(292 /* Bundle */); node.prepends = prepends; node.sourceFiles = sourceFiles; return node; @@ -71390,7 +71789,7 @@ var ts; ], function (helper) { return helper.name; })); } function createUnparsedSource() { - var node = ts.createNode(292 /* UnparsedSource */); + var node = ts.createNode(293 /* UnparsedSource */); node.prologues = ts.emptyArray; node.referencedFiles = ts.emptyArray; node.libReferenceDirectives = ts.emptyArray; @@ -71525,10 +71924,10 @@ var ts; } function mapBundleFileSectionKindToSyntaxKind(kind) { switch (kind) { - case "prologue" /* Prologue */: return 285 /* UnparsedPrologue */; - case "prepend" /* Prepend */: return 286 /* UnparsedPrepend */; - case "internal" /* Internal */: return 288 /* UnparsedInternalText */; - case "text" /* Text */: return 287 /* UnparsedText */; + case "prologue" /* Prologue */: return 286 /* UnparsedPrologue */; + case "prepend" /* Prepend */: return 287 /* UnparsedPrepend */; + case "internal" /* Internal */: return 289 /* UnparsedInternalText */; + case "text" /* Text */: return 288 /* UnparsedText */; case "emitHelpers" /* EmitHelpers */: case "no-default-lib" /* NoDefaultLib */: case "reference" /* Reference */: @@ -71546,14 +71945,14 @@ var ts; return node; } function createUnparsedSyntheticReference(section, parent) { - var node = ts.createNode(289 /* UnparsedSyntheticReference */, section.pos, section.end); + var node = ts.createNode(290 /* UnparsedSyntheticReference */, section.pos, section.end); node.parent = parent; node.data = section.data; node.section = section; return node; } function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapTextOrBuildInfoPath, javascriptPath, declarationPath, buildInfoPath, buildInfo, oldFileOfCurrentEmit) { - var node = ts.createNode(293 /* InputFiles */); + var node = ts.createNode(294 /* InputFiles */); if (!ts.isString(javascriptTextOrReadFileText)) { var cache_1 = ts.createMap(); var textGetter_1 = function (path) { @@ -71750,7 +72149,7 @@ var ts; // To avoid holding onto transformation artifacts, we keep track of any // parse tree node we are annotating. This allows us to clean them up after // all transformations have completed. - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node))); @@ -72291,7 +72690,7 @@ var ts; if (!outermostLabeledStatement) { return node; } - var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 238 /* LabeledStatement */ + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 239 /* LabeledStatement */ ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node); if (afterRestoreLabelCallback) { @@ -72310,13 +72709,13 @@ var ts; case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: return false; - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -72343,7 +72742,7 @@ var ts; } else { switch (callee.kind) { - case 194 /* PropertyAccessExpression */: { + case 195 /* PropertyAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a.b()` target is `(_a = a).b` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -72356,7 +72755,7 @@ var ts; } break; } - case 195 /* ElementAccessExpression */: { + case 196 /* ElementAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -72416,14 +72815,14 @@ var ts; ts.Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); } switch (property.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return createExpressionForAccessorDeclaration(node.properties, property, receiver, !!node.multiLine); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return createExpressionForPropertyAssignment(property, receiver); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return createExpressionForMethodDeclaration(property, receiver); } } @@ -72749,7 +73148,7 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 200 /* ParenthesizedExpression */) { + if (skipped.kind === 201 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -72783,10 +73182,10 @@ var ts; // // If `a ** d` is on the left of operator `**`, we need to parenthesize to preserve // the intended order of operations: `(a ** b) ** c` - var binaryOperatorPrecedence = ts.getOperatorPrecedence(209 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(209 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(210 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(210 /* BinaryExpression */, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 202 /* ArrowFunction */ && binaryOperatorPrecedence > 3) { + if (!isLeftSideOfBinary && operand.kind === 203 /* ArrowFunction */ && binaryOperatorPrecedence > 3) { // We need to parenthesize arrow functions on the right side to avoid it being // parsed as parenthesized expression: `a && (() => {})` return true; @@ -72798,7 +73197,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 212 /* YieldExpression */) { + && operand.kind === 213 /* YieldExpression */) { return false; } return true; @@ -72886,7 +73285,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { + if (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -72899,7 +73298,7 @@ var ts; return 0 /* Unknown */; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(210 /* ConditionalExpression */, 57 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(211 /* ConditionalExpression */, 57 /* QuestionToken */); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) { @@ -72934,8 +73333,8 @@ var ts; var needsParens = isCommaSequence(check); if (!needsParens) { switch (getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) { - case 214 /* ClassExpression */: - case 201 /* FunctionExpression */: + case 215 /* ClassExpression */: + case 202 /* FunctionExpression */: needsParens = true; } } @@ -72951,9 +73350,9 @@ var ts; function parenthesizeForNew(expression) { var leftmostExpr = getLeftmostExpression(expression, /*stopAtCallExpressions*/ true); switch (leftmostExpr.kind) { - case 196 /* CallExpression */: + case 197 /* CallExpression */: return ts.createParen(expression); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return !leftmostExpr.arguments ? ts.createParen(expression) : expression; @@ -72976,7 +73375,7 @@ var ts; // var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 197 /* NewExpression */ || emittedExpression.arguments)) { + && (emittedExpression.kind !== 198 /* NewExpression */ || emittedExpression.arguments)) { return expression; } return ts.setTextRange(ts.createParen(expression), expression); @@ -73014,7 +73413,7 @@ var ts; function parenthesizeExpressionForList(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(209 /* BinaryExpression */, 27 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(210 /* BinaryExpression */, 27 /* CommaToken */); return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(ts.createParen(expression), expression); @@ -73025,29 +73424,29 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 201 /* FunctionExpression */ || kind === 202 /* ArrowFunction */) { + if (kind === 202 /* FunctionExpression */ || kind === 203 /* ArrowFunction */) { var mutableCall = ts.getMutableClone(emittedExpression); mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); return recreateOuterExpressions(expression, mutableCall, 4 /* PartiallyEmittedExpressions */); } } var leftmostExpressionKind = getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind; - if (leftmostExpressionKind === 193 /* ObjectLiteralExpression */ || leftmostExpressionKind === 201 /* FunctionExpression */) { + if (leftmostExpressionKind === 194 /* ObjectLiteralExpression */ || leftmostExpressionKind === 202 /* FunctionExpression */) { return ts.setTextRange(ts.createParen(expression), expression); } return expression; } ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; function parenthesizeConditionalTypeMember(member) { - return member.kind === 180 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; + return member.kind === 181 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; } ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember; function parenthesizeElementTypeMember(member) { switch (member.kind) { - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: return ts.createParenthesizedType(member); } return parenthesizeConditionalTypeMember(member); @@ -73055,9 +73454,9 @@ var ts; ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember; function parenthesizeArrayTypeMember(member) { switch (member.kind) { - case 172 /* TypeQuery */: - case 184 /* TypeOperator */: - case 181 /* InferType */: + case 173 /* TypeQuery */: + case 185 /* TypeOperator */: + case 182 /* InferType */: return ts.createParenthesizedType(member); } return parenthesizeElementTypeMember(member); @@ -73083,28 +73482,28 @@ var ts; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: node = node.operand; continue; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: node = node.left; continue; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: node = node.condition; continue; - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: node = node.tag; continue; - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 217 /* AsExpression */: - case 195 /* ElementAccessExpression */: - case 194 /* PropertyAccessExpression */: - case 218 /* NonNullExpression */: - case 326 /* PartiallyEmittedExpression */: + case 218 /* AsExpression */: + case 196 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 219 /* NonNullExpression */: + case 327 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -73113,15 +73512,15 @@ var ts; } ts.getLeftmostExpression = getLeftmostExpression; function parenthesizeConciseBody(body) { - if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 193 /* ObjectLiteralExpression */)) { + if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 194 /* ObjectLiteralExpression */)) { return ts.setTextRange(ts.createParen(body), body); } return body; } ts.parenthesizeConciseBody = parenthesizeConciseBody; function isCommaSequence(node) { - return node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || - node.kind === 327 /* CommaListExpression */; + return node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || + node.kind === 328 /* CommaListExpression */; } ts.isCommaSequence = isCommaSequence; var OuterExpressionKinds; @@ -73134,13 +73533,13 @@ var ts; function isOuterExpression(node, kinds) { if (kinds === void 0) { kinds = 7 /* All */; } switch (node.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return (kinds & 1 /* Parentheses */) !== 0; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: - case 218 /* NonNullExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: + case 219 /* NonNullExpression */: return (kinds & 2 /* Assertions */) !== 0; - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: return (kinds & 4 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -73165,7 +73564,7 @@ var ts; } ts.skipOuterExpressions = skipOuterExpressions; function skipAssertions(node) { - while (ts.isAssertionExpression(node) || node.kind === 218 /* NonNullExpression */) { + while (ts.isAssertionExpression(node) || node.kind === 219 /* NonNullExpression */) { node = node.expression; } return node; @@ -73173,11 +73572,11 @@ var ts; ts.skipAssertions = skipAssertions; function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 200 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); - case 199 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 217 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); - case 218 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); - case 326 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); + case 201 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); + case 200 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 218 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); + case 219 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); + case 327 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); } } /** @@ -73195,7 +73594,7 @@ var ts; * the containing expression is created/updated. */ function isIgnorableParen(node) { - return node.kind === 200 /* ParenthesizedExpression */ + return node.kind === 201 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node) && ts.nodeIsSynthesized(ts.getSourceMapRange(node)) && ts.nodeIsSynthesized(ts.getCommentRange(node)) @@ -73313,10 +73712,10 @@ var ts; var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 254 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 255 /* ImportDeclaration */ && node.importClause) { return ts.getGeneratedNameForNode(node); } - if (node.kind === 260 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 261 /* ExportDeclaration */ && node.moduleSpecifier) { return ts.getGeneratedNameForNode(node); } return undefined; @@ -73435,7 +73834,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -73447,11 +73846,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -73483,12 +73882,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 156 /* Parameter */: - case 191 /* BindingElement */: + case 157 /* Parameter */: + case 192 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 213 /* SpreadElement */: - case 283 /* SpreadAssignment */: + case 214 /* SpreadElement */: + case 284 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -73506,7 +73905,7 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 191 /* BindingElement */: + case 192 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -73521,7 +73920,7 @@ var ts; : propertyName; } break; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -73536,7 +73935,7 @@ var ts; : propertyName; } break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` if (bindingElement.name && ts.isPrivateIdentifier(bindingElement.name)) { return ts.Debug.failBadSyntaxKind(bindingElement.name); @@ -73559,13 +73958,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: - case 192 /* ArrayLiteralExpression */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: + case 193 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -73605,11 +74004,11 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 190 /* ArrayBindingPattern */: - case 192 /* ArrayLiteralExpression */: + case 191 /* ArrayBindingPattern */: + case 193 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 189 /* ObjectBindingPattern */: - case 193 /* ObjectLiteralExpression */: + case 190 /* ObjectBindingPattern */: + case 194 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -73768,289 +74167,289 @@ var ts; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 152 /* LastToken */) || kind === 183 /* ThisType */) { + if ((kind > 0 /* FirstToken */ && kind <= 153 /* LastToken */) || kind === 184 /* ThisType */) { return node; } switch (kind) { // Names case 75 /* Identifier */: return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); // Signature elements - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); - case 156 /* Parameter */: + case 157 /* Parameter */: return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 157 /* Decorator */: + case 158 /* Decorator */: return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); // Type elements - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), // QuestionToken and ExclamationToken is uniqued in Property Declaration and the signature of 'updateProperty' is that too visitNode(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 160 /* MethodSignature */: + case 161 /* MethodSignature */: return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 162 /* Constructor */: + case 163 /* Constructor */: return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 165 /* CallSignature */: + case 166 /* CallSignature */: return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); // Types - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return ts.updateTypePredicateNodeWithModifier(node, visitNode(node.assertsModifier, visitor), visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 170 /* FunctionType */: + case 171 /* FunctionType */: return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 171 /* ConstructorType */: + case 172 /* ConstructorType */: return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 174 /* ArrayType */: + case 175 /* ArrayType */: return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); - case 175 /* TupleType */: + case 176 /* TupleType */: return ts.updateTupleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); - case 176 /* OptionalType */: + case 177 /* OptionalType */: return ts.updateOptionalTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 177 /* RestType */: + case 178 /* RestType */: return ts.updateRestTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 178 /* UnionType */: + case 179 /* UnionType */: return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 179 /* IntersectionType */: + case 180 /* IntersectionType */: return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode)); - case 181 /* InferType */: + case 182 /* InferType */: return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); - case 188 /* ImportType */: + case 189 /* ImportType */: return ts.updateImportTypeNode(node, visitNode(node.argument, visitor, ts.isTypeNode), visitNode(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf); - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 184 /* TypeOperator */: + case 185 /* TypeOperator */: return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); - case 186 /* MappedType */: + case 187 /* MappedType */: return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 187 /* LiteralType */: + case 188 /* LiteralType */: return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); // Binding patterns - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); // Expression - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: if (node.flags & 32 /* OptionalChain */) { - return ts.updatePropertyAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, visitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier)); + return ts.updatePropertyAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier)); } return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifierOrPrivateIdentifier)); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: if (node.flags & 32 /* OptionalChain */) { - return ts.updateElementAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, visitor, ts.isToken), visitNode(node.argumentExpression, visitor, ts.isExpression)); + return ts.updateElementAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.argumentExpression, visitor, ts.isExpression)); } return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { - return ts.updateCallChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, visitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + return ts.updateCallChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); } return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 202 /* ArrowFunction */: - return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, visitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); - case 203 /* DeleteExpression */: + case 203 /* ArrowFunction */: + return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, tokenVisitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); + case 204 /* DeleteExpression */: return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 209 /* BinaryExpression */: - return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, visitor, ts.isToken)); - case 210 /* ConditionalExpression */: - return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, visitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 211 /* TemplateExpression */: + case 210 /* BinaryExpression */: + return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, tokenVisitor, ts.isToken)); + case 211 /* ConditionalExpression */: + return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, tokenVisitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); + case 212 /* TemplateExpression */: return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 217 /* AsExpression */: + case 218 /* AsExpression */: return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); // Misc - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 223 /* Block */: + case 224 /* Block */: return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return ts.updateExpressionStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 232 /* ForOfStatement */: - return ts.updateForOf(node, visitNode(node.awaitModifier, visitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 233 /* ContinueStatement */: + case 233 /* ForOfStatement */: + return ts.updateForOf(node, visitNode(node.awaitModifier, tokenVisitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 234 /* ContinueStatement */: return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 234 /* BreakStatement */: + case 235 /* BreakStatement */: return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ts.updateTypeScriptVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings), node.isTypeOnly); - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: return ts.updateNamespaceExport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 257 /* NamedImports */: + case 258 /* NamedImports */: return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExportBindings), visitNode(node.moduleSpecifier, visitor, ts.isExpression), node.isTypeOnly); - case 261 /* NamedExports */: + case 262 /* NamedExports */: return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); // Module references - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); // JSX - case 266 /* JsxElement */: + case 267 /* JsxElement */: return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 268 /* JsxOpeningElement */: + case 269 /* JsxOpeningElement */: return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 275 /* JsxSpreadAttribute */: + case 276 /* JsxSpreadAttribute */: return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Clauses - case 277 /* CaseClause */: + case 278 /* CaseClause */: return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); // Property assignments - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); // Enum - case 284 /* EnumMember */: + case 285 /* EnumMember */: return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 290 /* SourceFile */: + case 291 /* SourceFile */: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: // No need to visit nodes with no children. @@ -74093,58 +74492,58 @@ var ts; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 152 /* LastToken */)) { + if ((kind > 0 /* FirstToken */ && kind <= 153 /* LastToken */)) { return initial; } // We do not yet support types. - if ((kind >= 168 /* TypePredicate */ && kind <= 187 /* LiteralType */)) { + if ((kind >= 169 /* TypePredicate */ && kind <= 188 /* LiteralType */)) { return initial; } var result = initial; switch (node.kind) { // Leaf nodes - case 222 /* SemicolonClassElement */: - case 224 /* EmptyStatement */: - case 215 /* OmittedExpression */: - case 241 /* DebuggerStatement */: - case 325 /* NotEmittedStatement */: + case 223 /* SemicolonClassElement */: + case 225 /* EmptyStatement */: + case 216 /* OmittedExpression */: + case 242 /* DebuggerStatement */: + case 326 /* NotEmittedStatement */: // No need to visit nodes with no children. break; // Names - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: result = reduceNode(node.expression, cbNode, result); break; // Signature elements - case 156 /* Parameter */: + case 157 /* Parameter */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 157 /* Decorator */: + case 158 /* Decorator */: result = reduceNode(node.expression, cbNode, result); break; // Type member - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.questionToken, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74153,12 +74552,12 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 162 /* Constructor */: + case 163 /* Constructor */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74166,7 +74565,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74174,50 +74573,50 @@ var ts; result = reduceNode(node.body, cbNode, result); break; // Binding patterns - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: result = reduceNodes(node.elements, cbNodes, result); break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Expression - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: result = reduceNodes(node.elements, cbNodes, result); break; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: result = reduceNodes(node.properties, cbNodes, result); break; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.argumentExpression, cbNode, result); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 197 /* NewExpression */: + case 198 /* NewExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: result = reduceNode(node.tag, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNode(node.template, cbNode, result); break; - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: result = reduceNode(node.type, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -74225,123 +74624,123 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 200 /* ParenthesizedExpression */: - case 203 /* DeleteExpression */: - case 204 /* TypeOfExpression */: - case 205 /* VoidExpression */: - case 206 /* AwaitExpression */: - case 212 /* YieldExpression */: - case 213 /* SpreadElement */: - case 218 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: + case 204 /* DeleteExpression */: + case 205 /* TypeOfExpression */: + case 206 /* VoidExpression */: + case 207 /* AwaitExpression */: + case 213 /* YieldExpression */: + case 214 /* SpreadElement */: + case 219 /* NonNullExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: result = reduceNode(node.operand, cbNode, result); break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; - case 217 /* AsExpression */: + case 218 /* AsExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.type, cbNode, result); break; // Misc - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; // Element - case 223 /* Block */: + case 224 /* Block */: result = reduceNodes(node.statements, cbNodes, result); break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 227 /* IfStatement */: + case 228 /* IfStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 228 /* DoStatement */: + case 229 /* DoStatement */: result = reduceNode(node.statement, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 229 /* WhileStatement */: - case 236 /* WithStatement */: + case 230 /* WhileStatement */: + case 237 /* WithStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 230 /* ForStatement */: + case 231 /* ForStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 235 /* ReturnStatement */: - case 239 /* ThrowStatement */: + case 236 /* ReturnStatement */: + case 240 /* ThrowStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 240 /* TryStatement */: + case 241 /* TryStatement */: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: result = reduceNodes(node.declarations, cbNodes, result); break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74350,7 +74749,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74358,143 +74757,143 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.members, cbNodes, result); break; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: result = reduceNodes(node.statements, cbNodes, result); break; - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: result = reduceNodes(node.clauses, cbNodes, result); break; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.moduleReference, cbNode, result); break; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 255 /* ImportClause */: + case 256 /* ImportClause */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: result = reduceNode(node.name, cbNode, result); break; - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: result = reduceNode(node.name, cbNode, result); break; - case 257 /* NamedImports */: - case 261 /* NamedExports */: + case 258 /* NamedImports */: + case 262 /* NamedExports */: result = reduceNodes(node.elements, cbNodes, result); break; - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; // Module references - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: result = reduceNode(node.expression, cbNode, result); break; // JSX - case 266 /* JsxElement */: + case 267 /* JsxElement */: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: result = reduceNode(node.openingFragment, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingFragment, cbNode, result); break; - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: result = reduceNode(node.tagName, cbNode, result); result = reduceNodes(node.typeArguments, cbNode, result); result = reduceNode(node.attributes, cbNode, result); break; - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: result = reduceNodes(node.properties, cbNodes, result); break; - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: result = reduceNode(node.tagName, cbNode, result); break; - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 275 /* JsxSpreadAttribute */: + case 276 /* JsxSpreadAttribute */: result = reduceNode(node.expression, cbNode, result); break; - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: result = reduceNode(node.expression, cbNode, result); break; // Clauses - case 277 /* CaseClause */: + case 278 /* CaseClause */: result = reduceNode(node.expression, cbNode, result); // falls through - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: result = reduceNodes(node.statements, cbNodes, result); break; - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: result = reduceNodes(node.types, cbNodes, result); break; - case 280 /* CatchClause */: + case 281 /* CatchClause */: result = reduceNode(node.variableDeclaration, cbNode, result); result = reduceNode(node.block, cbNode, result); break; // Property assignments - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: result = reduceNode(node.expression, cbNode, result); break; // Enum - case 284 /* EnumMember */: + case 285 /* EnumMember */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Top-level nodes - case 290 /* SourceFile */: + case 291 /* SourceFile */: result = reduceNodes(node.statements, cbNodes, result); break; // Transformation nodes - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: result = reduceNodes(node.elements, cbNodes, result); break; default: @@ -74567,7 +74966,7 @@ var ts; function aggregateTransformFlagsForSubtree(node) { // We do not transform ambient declarations or types, so there is no need to // recursively aggregate transform flags. - if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 216 /* ExpressionWithTypeArguments */)) { + if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 217 /* ExpressionWithTypeArguments */)) { return 0 /* None */; } // Aggregate the transform flags of each child. @@ -75241,7 +75640,7 @@ var ts; function chainBundle(transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 290 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 291 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return ts.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends); @@ -75292,7 +75691,7 @@ var ts; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" @@ -75305,13 +75704,13 @@ var ts; hasImportDefault = true; } break; - case 253 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 265 /* ExternalModuleReference */) { + case 254 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 266 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -75342,13 +75741,13 @@ var ts; } } break; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: if (ts.hasModifier(node, 1 /* Export */)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -75356,7 +75755,7 @@ var ts; } } break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default function() { } @@ -75376,7 +75775,7 @@ var ts; } } break; - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default class { } @@ -75555,7 +75954,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member) { - return member.kind === 159 /* PropertyDeclaration */ + return member.kind === 160 /* PropertyDeclaration */ && member.initializer !== undefined; } ts.isInitializedProperty = isInitializedProperty; @@ -76184,8 +76583,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(194 /* PropertyAccessExpression */); - context.enableSubstitution(195 /* ElementAccessExpression */); + context.enableSubstitution(195 /* PropertyAccessExpression */); + context.enableSubstitution(196 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -76211,14 +76610,14 @@ var ts; var applicableSubstitutions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 291 /* Bundle */) { + if (node.kind === 292 /* Bundle */) { return transformBundle(node); } return transformSourceFile(node); } function transformBundle(node) { return ts.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 293 /* InputFiles */) { + if (prepend.kind === 294 /* InputFiles */) { return ts.createUnparsedSourceFile(prepend, "js"); } return prepend; @@ -76269,16 +76668,16 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 290 /* SourceFile */: - case 251 /* CaseBlock */: - case 250 /* ModuleBlock */: - case 223 /* Block */: + case 291 /* SourceFile */: + case 252 /* CaseBlock */: + case 251 /* ModuleBlock */: + case 224 /* Block */: currentLexicalScope = node; currentNameScope = undefined; currentScopeFirstDeclarationsOfName = undefined; break; - case 245 /* ClassDeclaration */: - case 244 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 245 /* FunctionDeclaration */: if (ts.hasModifier(node, 2 /* Ambient */)) { break; } @@ -76290,7 +76689,7 @@ var ts; // These nodes should always have names unless they are default-exports; // however, class declaration parsing allows for undefined names, so syntactically invalid // programs may also have an undefined name. - ts.Debug.assert(node.kind === 245 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); + ts.Debug.assert(node.kind === 246 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); } if (ts.isClassDeclaration(node)) { // XXX: should probably also cover interfaces and type aliases that can have type variables? @@ -76333,10 +76732,10 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 259 /* ExportAssignment */: - case 260 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 260 /* ExportAssignment */: + case 261 /* ExportDeclaration */: return visitEllidableStatement(node); default: return visitorWorker(node); @@ -76357,13 +76756,13 @@ var ts; return node; } switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return visitImportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitExportAssignment(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -76383,11 +76782,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 260 /* ExportDeclaration */ || - node.kind === 254 /* ImportDeclaration */ || - node.kind === 255 /* ImportClause */ || - (node.kind === 253 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 265 /* ExternalModuleReference */)) { + if (node.kind === 261 /* ExportDeclaration */ || + node.kind === 255 /* ImportDeclaration */ || + node.kind === 256 /* ImportClause */ || + (node.kind === 254 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 266 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -76411,19 +76810,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: return visitConstructor(node); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // Property declarations are not TypeScript syntax, but they must be visited // for the decorator transformation. return visitPropertyDeclaration(node); - case 167 /* IndexSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 161 /* MethodDeclaration */: + case 168 /* IndexSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 162 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 222 /* SemicolonClassElement */: + case 223 /* SemicolonClassElement */: return node; default: return ts.Debug.failBadSyntaxKind(node); @@ -76459,62 +76858,62 @@ var ts; case 118 /* ProtectedKeyword */: case 122 /* AbstractKeyword */: case 81 /* ConstKeyword */: - case 130 /* DeclareKeyword */: - case 138 /* ReadonlyKeyword */: + case 131 /* DeclareKeyword */: + case 139 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided // falls through - case 174 /* ArrayType */: - case 175 /* TupleType */: - case 176 /* OptionalType */: - case 177 /* RestType */: - case 173 /* TypeLiteral */: - case 168 /* TypePredicate */: - case 155 /* TypeParameter */: + case 175 /* ArrayType */: + case 176 /* TupleType */: + case 177 /* OptionalType */: + case 178 /* RestType */: + case 174 /* TypeLiteral */: + case 169 /* TypePredicate */: + case 156 /* TypeParameter */: case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 128 /* BooleanKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 137 /* NeverKeyword */: + case 149 /* UnknownKeyword */: + case 129 /* BooleanKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 138 /* NeverKeyword */: case 110 /* VoidKeyword */: - case 144 /* SymbolKeyword */: - case 171 /* ConstructorType */: - case 170 /* FunctionType */: - case 172 /* TypeQuery */: - case 169 /* TypeReference */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 180 /* ConditionalType */: - case 182 /* ParenthesizedType */: - case 183 /* ThisType */: - case 184 /* TypeOperator */: - case 185 /* IndexedAccessType */: - case 186 /* MappedType */: - case 187 /* LiteralType */: + case 145 /* SymbolKeyword */: + case 172 /* ConstructorType */: + case 171 /* FunctionType */: + case 173 /* TypeQuery */: + case 170 /* TypeReference */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 181 /* ConditionalType */: + case 183 /* ParenthesizedType */: + case 184 /* ThisType */: + case 185 /* TypeOperator */: + case 186 /* IndexedAccessType */: + case 187 /* MappedType */: + case 188 /* LiteralType */: // TypeScript type nodes are elided. // falls through - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: // TypeScript index signatures are elided. // falls through - case 157 /* Decorator */: + case 158 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. // falls through - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. return undefined; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects return visitPropertyDeclaration(node); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: // TypeScript namespace export declarations are elided. return undefined; - case 162 /* Constructor */: + case 163 /* Constructor */: return visitConstructor(node); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return ts.createNotEmittedStatement(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: // This may be a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -76524,7 +76923,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: // This may be a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -76534,35 +76933,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: // This may be a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 156 /* Parameter */: + case 157 /* Parameter */: // This may be a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -76572,35 +76971,35 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return visitCallExpression(node); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return visitNewExpression(node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); default: @@ -77013,12 +77412,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -77171,7 +77570,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 159 /* PropertyDeclaration */ + ? member.kind === 160 /* PropertyDeclaration */ // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it // should not invoke `Object.getOwnPropertyDescriptor`. ? ts.createVoidZero() @@ -77294,10 +77693,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */ - || kind === 159 /* PropertyDeclaration */; + return kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */ + || kind === 160 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -77307,7 +77706,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 161 /* MethodDeclaration */; + return node.kind === 162 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -77318,12 +77717,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return true; } return false; @@ -77340,15 +77739,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 159 /* PropertyDeclaration */: - case 156 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 157 /* Parameter */: return serializeTypeNode(node.type); - case 164 /* SetAccessor */: - case 163 /* GetAccessor */: + case 165 /* SetAccessor */: + case 164 /* GetAccessor */: return serializeTypeNode(getAccessorTypeNode(node)); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 161 /* MethodDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 162 /* MethodDeclaration */: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); @@ -77385,7 +77784,7 @@ var ts; return ts.createArrayLiteral(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 163 /* GetAccessor */) { + if (container && node.kind === 164 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -77431,30 +77830,30 @@ var ts; } switch (node.kind) { case 110 /* VoidKeyword */: - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: case 100 /* NullKeyword */: - case 137 /* NeverKeyword */: + case 138 /* NeverKeyword */: return ts.createVoidZero(); - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: return ts.createIdentifier("Function"); - case 174 /* ArrayType */: - case 175 /* TupleType */: + case 175 /* ArrayType */: + case 176 /* TupleType */: return ts.createIdentifier("Array"); - case 168 /* TypePredicate */: - case 128 /* BooleanKeyword */: + case 169 /* TypePredicate */: + case 129 /* BooleanKeyword */: return ts.createIdentifier("Boolean"); - case 143 /* StringKeyword */: + case 144 /* StringKeyword */: return ts.createIdentifier("String"); - case 141 /* ObjectKeyword */: + case 142 /* ObjectKeyword */: return ts.createIdentifier("Object"); - case 187 /* LiteralType */: + case 188 /* LiteralType */: switch (node.literal.kind) { case 10 /* StringLiteral */: return ts.createIdentifier("String"); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: case 8 /* NumericLiteral */: return ts.createIdentifier("Number"); case 9 /* BigIntLiteral */: @@ -77465,34 +77864,34 @@ var ts; default: return ts.Debug.failBadSyntaxKind(node.literal); } - case 140 /* NumberKeyword */: + case 141 /* NumberKeyword */: return ts.createIdentifier("Number"); - case 151 /* BigIntKeyword */: + case 152 /* BigIntKeyword */: return getGlobalBigIntNameWithFallback(); - case 144 /* SymbolKeyword */: + case 145 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return serializeTypeReferenceNode(node); - case 179 /* IntersectionType */: - case 178 /* UnionType */: + case 180 /* IntersectionType */: + case 179 /* UnionType */: return serializeTypeList(node.types); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return serializeTypeList([node.trueType, node.falseType]); - case 184 /* TypeOperator */: - if (node.operator === 138 /* ReadonlyKeyword */) { + case 185 /* TypeOperator */: + if (node.operator === 139 /* ReadonlyKeyword */) { return serializeTypeNode(node.type); } break; - case 172 /* TypeQuery */: - case 185 /* IndexedAccessType */: - case 186 /* MappedType */: - case 173 /* TypeLiteral */: + case 173 /* TypeQuery */: + case 186 /* IndexedAccessType */: + case 187 /* MappedType */: + case 174 /* TypeLiteral */: case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 183 /* ThisType */: - case 188 /* ImportType */: + case 149 /* UnknownKeyword */: + case 184 /* ThisType */: + case 189 /* ImportType */: break; default: return ts.Debug.failBadSyntaxKind(node); @@ -77505,13 +77904,13 @@ var ts; var serializedUnion; for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { var typeNode = types_20[_i]; - while (typeNode.kind === 182 /* ParenthesizedType */) { + while (typeNode.kind === 183 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 137 /* NeverKeyword */) { + if (typeNode.kind === 138 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 146 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 147 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var serializedIndividual = serializeTypeNode(typeNode); @@ -77620,7 +78019,7 @@ var ts; name.original = undefined; name.parent = ts.getParseTreeNode(currentLexicalScope); // ensure the parent is set to a parse tree node. return name; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return serializeQualifiedNameAsExpression(node); } } @@ -78180,12 +78579,12 @@ var ts; // enums in any other scope are emitted as a `let` declaration. var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)) - ], currentLexicalScope.kind === 290 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); + ], currentLexicalScope.kind === 291 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 248 /* EnumDeclaration */) { + if (node.kind === 249 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -78310,7 +78709,7 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 250 /* ModuleBlock */) { + if (body.kind === 251 /* ModuleBlock */) { saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; @@ -78356,13 +78755,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (body.kind !== 250 /* ModuleBlock */) { + if (body.kind !== 251 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 249 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 250 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -78412,7 +78811,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 256 /* NamespaceImport */) { + if (node.kind === 257 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -78660,16 +79059,16 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(75 /* Identifier */); - context.enableSubstitution(282 /* ShorthandPropertyAssignment */); + context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(249 /* ModuleDeclaration */); + context.enableEmitNotification(250 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 249 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 250 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 248 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 249 /* EnumDeclaration */; } /** * Hook for node emit. @@ -78730,9 +79129,9 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -78770,9 +79169,9 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 290 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 249 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 248 /* EnumDeclaration */); + if (container && container.kind !== 291 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 250 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 249 /* EnumDeclaration */); if (substitute) { return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), /*location*/ node); @@ -78923,40 +79322,40 @@ var ts; if (!(node.transformFlags & 4194304 /* ContainsClassFields */)) return node; switch (node.kind) { - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: return visitClassLike(node); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return visitPropertyAccessExpression(node); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return visitPrefixUnaryExpression(node); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return visitPostfixUnaryExpression(node, /*valueIsDiscarded*/ false); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return visitCallExpression(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node); case 76 /* PrivateIdentifier */: return visitPrivateIdentifier(node); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return visitExpressionStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); } return ts.visitEachChild(node, visitor, context); } function visitorDestructuringTarget(node) { switch (node.kind) { - case 193 /* ObjectLiteralExpression */: - case 192 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return visitAssignmentPattern(node); default: return visitor(node); @@ -78979,20 +79378,20 @@ var ts; */ function classElementVisitor(node) { switch (node.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: // Constructors for classes using class fields are transformed in // `visitClassDeclaration` or `visitClassExpression`. return undefined; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 161 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 162 /* MethodDeclaration */: // Visit the name of the member (if it's a computed property name). return ts.visitEachChild(node, classElementVisitor, context); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 222 /* SemicolonClassElement */: + case 223 /* SemicolonClassElement */: return node; default: return visitor(node); @@ -79758,31 +80157,31 @@ var ts; case 126 /* AsyncKeyword */: // ES2017 async modifier should be elided for targets < ES2017 return undefined; - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return visitAwaitExpression(node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 102 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 162 /* Constructor */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 163 /* Constructor */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -79791,27 +80190,27 @@ var ts; function asyncBodyVisitor(node) { if (ts.isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatementInAsyncBody(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatementInAsyncBody(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatementInAsyncBody(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatementInAsyncBody(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClauseInAsyncBody(node); - case 223 /* Block */: - case 237 /* SwitchStatement */: - case 251 /* CaseBlock */: - case 277 /* CaseClause */: - case 278 /* DefaultClause */: - case 240 /* TryStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 227 /* IfStatement */: - case 236 /* WithStatement */: - case 238 /* LabeledStatement */: + case 224 /* Block */: + case 238 /* SwitchStatement */: + case 252 /* CaseBlock */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: + case 241 /* TryStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 228 /* IfStatement */: + case 237 /* WithStatement */: + case 239 /* LabeledStatement */: return ts.visitEachChild(node, asyncBodyVisitor, context); default: return ts.Debug.assertNever(node, "Unhandled node."); @@ -80016,7 +80415,7 @@ var ts; var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 202 /* ArrowFunction */; + var isArrowFunction = node.kind === 203 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current @@ -80107,17 +80506,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(196 /* CallExpression */); - context.enableSubstitution(194 /* PropertyAccessExpression */); - context.enableSubstitution(195 /* ElementAccessExpression */); + context.enableSubstitution(197 /* CallExpression */); + context.enableSubstitution(195 /* PropertyAccessExpression */); + context.enableSubstitution(196 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(245 /* ClassDeclaration */); - context.enableEmitNotification(161 /* MethodDeclaration */); - context.enableEmitNotification(163 /* GetAccessor */); - context.enableEmitNotification(164 /* SetAccessor */); - context.enableEmitNotification(162 /* Constructor */); + context.enableEmitNotification(246 /* ClassDeclaration */); + context.enableEmitNotification(162 /* MethodDeclaration */); + context.enableEmitNotification(164 /* GetAccessor */); + context.enableEmitNotification(165 /* SetAccessor */); + context.enableEmitNotification(163 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(225 /* VariableStatement */); + context.enableEmitNotification(226 /* VariableStatement */); } } /** @@ -80165,11 +80564,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -80201,11 +80600,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 245 /* ClassDeclaration */ - || kind === 162 /* Constructor */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */; + return kind === 246 /* ClassDeclaration */ + || kind === 163 /* Constructor */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -80373,64 +80772,64 @@ var ts; return node; } switch (node.kind) { - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return visitAwaitExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return visitYieldExpression(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitReturnStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitLabeledStatement(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node, noDestructuringValue); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClause(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return visitVoidExpression(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return doWithLexicalThis(visitConstructorDeclaration, node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return doWithLexicalThis(visitMethodDeclaration, node); - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: return doWithLexicalThis(visitGetAccessorDeclaration, node); - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: return doWithLexicalThis(visitSetAccessorDeclaration, node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return doWithLexicalThis(visitFunctionDeclaration, node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return doWithLexicalThis(visitFunctionExpression, node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return visitArrowFunction(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return visitParameter(node); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return visitExpressionStatement(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, noDestructuringValue); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 102 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return doWithLexicalThis(visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -80464,7 +80863,7 @@ var ts; function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2 /* Async */) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 232 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 233 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node); @@ -80476,7 +80875,7 @@ var ts; var objects = []; for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { var e = elements_4[_i]; - if (e.kind === 283 /* SpreadAssignment */) { + if (e.kind === 284 /* SpreadAssignment */) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -80485,7 +80884,7 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - chunkObject = ts.append(chunkObject, e.kind === 281 /* PropertyAssignment */ + chunkObject = ts.append(chunkObject, e.kind === 282 /* PropertyAssignment */ ? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } @@ -80519,7 +80918,7 @@ var ts; // If we translate the above to `__assign({}, k, l)`, the `l` will evaluate before `k` is spread and we // end up with `{ a: 1, b: 2, c: 3 }` var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 193 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 194 /* ObjectLiteralExpression */) { objects.unshift(ts.createObjectLiteral()); } var expression = objects[0]; @@ -80897,17 +81296,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(196 /* CallExpression */); - context.enableSubstitution(194 /* PropertyAccessExpression */); - context.enableSubstitution(195 /* ElementAccessExpression */); + context.enableSubstitution(197 /* CallExpression */); + context.enableSubstitution(195 /* PropertyAccessExpression */); + context.enableSubstitution(196 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(245 /* ClassDeclaration */); - context.enableEmitNotification(161 /* MethodDeclaration */); - context.enableEmitNotification(163 /* GetAccessor */); - context.enableEmitNotification(164 /* SetAccessor */); - context.enableEmitNotification(162 /* Constructor */); + context.enableEmitNotification(246 /* ClassDeclaration */); + context.enableEmitNotification(162 /* MethodDeclaration */); + context.enableEmitNotification(164 /* GetAccessor */); + context.enableEmitNotification(165 /* SetAccessor */); + context.enableEmitNotification(163 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(225 /* VariableStatement */); + context.enableEmitNotification(226 /* VariableStatement */); } } /** @@ -80955,11 +81354,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -80991,11 +81390,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 245 /* ClassDeclaration */ - || kind === 162 /* Constructor */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */; + return kind === 246 /* ClassDeclaration */ + || kind === 163 /* Constructor */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -81093,7 +81492,7 @@ var ts; return node; } switch (node.kind) { - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -81125,21 +81524,21 @@ var ts; return node; } switch (node.kind) { - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: - case 196 /* CallExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: + case 197 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { var updated = visitOptionalExpression(node, /*captureThisArg*/ false, /*isDelete*/ false); ts.Debug.assertNotNode(updated, ts.isSyntheticReference); return updated; } return ts.visitEachChild(node, visitor, context); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (node.operatorToken.kind === 60 /* QuestionQuestionToken */) { return transformNullishCoalescingExpression(node); } return ts.visitEachChild(node, visitor, context); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return visitDeleteExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -81179,7 +81578,7 @@ var ts; thisArg = expression; } } - expression = node.kind === 194 /* PropertyAccessExpression */ + expression = node.kind === 195 /* PropertyAccessExpression */ ? ts.updatePropertyAccess(node, expression, ts.visitNode(node.name, visitor, ts.isIdentifier)) : ts.updateElementAccess(node, expression, ts.visitNode(node.argumentExpression, visitor, ts.isExpression)); return thisArg ? ts.createSyntheticReferenceExpression(expression, thisArg) : expression; @@ -81193,10 +81592,10 @@ var ts; } function visitNonOptionalExpression(node, captureThisArg, isDelete) { switch (node.kind) { - case 200 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 196 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); + case 201 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); + case 197 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); default: return ts.visitNode(node, visitor, ts.isExpression); } } @@ -81215,8 +81614,8 @@ var ts; for (var i = 0; i < chain.length; i++) { var segment = chain[i]; switch (segment.kind) { - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: if (i === chain.length - 1 && captureThisArg) { if (shouldCaptureInTempVariable(rightExpression)) { thisArg = ts.createTempVariable(hoistVariableDeclaration); @@ -81226,11 +81625,11 @@ var ts; thisArg = rightExpression; } } - rightExpression = segment.kind === 194 /* PropertyAccessExpression */ + rightExpression = segment.kind === 195 /* PropertyAccessExpression */ ? ts.createPropertyAccess(rightExpression, ts.visitNode(segment.name, visitor, ts.isIdentifier)) : ts.createElementAccess(rightExpression, ts.visitNode(segment.argumentExpression, visitor, ts.isExpression)); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (i === 0 && leftThisArg) { rightExpression = ts.createFunctionCall(rightExpression, leftThisArg.kind === 102 /* SuperKeyword */ ? ts.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression)); } @@ -81328,13 +81727,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 266 /* JsxElement */: + case 267 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ false); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -81344,13 +81743,13 @@ var ts; switch (node.kind) { case 11 /* JsxText */: return visitJsxText(node); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return visitJsxExpression(node); - case 266 /* JsxElement */: + case 267 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ true); default: return ts.Debug.failBadSyntaxKind(node); @@ -81425,7 +81824,7 @@ var ts; literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile); return ts.setTextRange(literal, node); } - else if (node.kind === 276 /* JsxExpression */) { + else if (node.kind === 277 /* JsxExpression */) { if (node.expression === undefined) { return ts.createTrue(); } @@ -81519,7 +81918,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 266 /* JsxElement */) { + if (node.kind === 267 /* JsxElement */) { return getTagName(node.openingElement); } else { @@ -81825,7 +82224,7 @@ var ts; return node; } switch (node.kind) { - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -82038,13 +82437,13 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 - && node.kind === 235 /* ReturnStatement */ + && node.kind === 236 /* ReturnStatement */ && !node.expression; } function shouldVisitNode(node) { return (node.transformFlags & 256 /* ContainsES2015 */) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 223 /* Block */))) + || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 224 /* Block */))) || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatement(node)) || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0; } @@ -82066,63 +82465,63 @@ var ts; switch (node.kind) { case 120 /* StaticKeyword */: return undefined; // elide static keyword - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return visitClassDeclaration(node); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return visitClassExpression(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return visitParameter(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return visitArrowFunction(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return visitFunctionExpression(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return visitVariableDeclaration(node); case 75 /* Identifier */: return visitIdentifier(node); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return visitSwitchStatement(node); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return visitCaseBlock(node); - case 223 /* Block */: + case 224 /* Block */: return visitBlock(node, /*isFunctionBody*/ false); - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitLabeledStatement(node); - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node, /*outermostLabeledStatement*/ undefined); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return visitExpressionStatement(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClause(node); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return visitCallExpression(node); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return visitNewExpression(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 14 /* NoSubstitutionTemplateLiteral */: case 15 /* TemplateHead */: @@ -82133,28 +82532,28 @@ var ts; return visitStringLiteral(node); case 8 /* NumericLiteral */: return visitNumericLiteral(node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: return visitTemplateExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return visitYieldExpression(node); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return visitSpreadElement(node); case 102 /* SuperKeyword */: return visitSuperKeyword(/*isExpressionOfCall*/ false); case 104 /* ThisKeyword */: return visitThisKeyword(node); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return visitMetaProperty(node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return visitAccessorDeclaration(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitReturnStatement(node); default: return ts.visitEachChild(node, visitor, context); @@ -82245,14 +82644,14 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 234 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 235 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; var label = node.label; if (!label) { - if (node.kind === 234 /* BreakStatement */) { + if (node.kind === 235 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -82263,7 +82662,7 @@ var ts; } } else { - if (node.kind === 234 /* BreakStatement */) { + if (node.kind === 235 /* BreakStatement */) { labelMarker = "break-" + label.escapedText; setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker); } @@ -82659,11 +83058,11 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 235 /* ReturnStatement */) { + if (statement.kind === 236 /* ReturnStatement */) { return true; } // An if-statement with two covered branches is covered. - else if (statement.kind === 227 /* IfStatement */) { + else if (statement.kind === 228 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && @@ -82671,7 +83070,7 @@ var ts; } } // A block is covered if it has a last statement which is covered. - else if (statement.kind === 223 /* Block */) { + else if (statement.kind === 224 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -82869,7 +83268,7 @@ var ts; * @param node A node. */ function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 202 /* ArrowFunction */) { + if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 203 /* ArrowFunction */) { insertCaptureThisForNode(statements, node, ts.createThis()); return true; } @@ -82890,22 +83289,22 @@ var ts; if (hierarchyFacts & 16384 /* NewTarget */) { var newTarget = void 0; switch (node.kind) { - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return statements; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // Methods and accessors cannot be constructors, so 'new.target' will // always return 'undefined'. newTarget = ts.createVoidZero(); break; - case 162 /* Constructor */: + case 163 /* Constructor */: // Class constructors can only be called with `new`, so `this.constructor` // should be relatively safe to use. newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"); break; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: // Functions can be called or constructed, and may have a `this` due to // being a member or when calling an imported function via `other_1.f()`. newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), 98 /* InstanceOfKeyword */, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"), ts.createVoidZero()); @@ -82937,20 +83336,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 222 /* SemicolonClassElement */: + case 223 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 162 /* Constructor */: + case 163 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -83152,7 +83551,7 @@ var ts; : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 244 /* FunctionDeclaration */ || node.kind === 201 /* FunctionExpression */)) { + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 245 /* FunctionDeclaration */ || node.kind === 202 /* FunctionExpression */)) { name = ts.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */); @@ -83196,7 +83595,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 202 /* ArrowFunction */); + ts.Debug.assert(node.kind === 203 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -83264,9 +83663,9 @@ var ts; function visitExpressionStatement(node) { // If we are here it is most likely because our expression is a destructuring assignment. switch (node.expression.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return ts.updateExpressionStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return ts.updateExpressionStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } return ts.visitEachChild(node, visitor, context); @@ -83285,9 +83684,9 @@ var ts; // expression. If we are in a state where we do not need the destructuring value, // we pass that information along to the children that care about it. switch (node.expression.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return ts.updateParen(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return ts.updateParen(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } } @@ -83501,14 +83900,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -83696,7 +84095,7 @@ var ts; && i < numInitialPropertiesWithoutYield) { numInitialPropertiesWithoutYield = i; } - if (property.name.kind === 154 /* ComputedPropertyName */) { + if (property.name.kind === 155 /* ComputedPropertyName */) { numInitialProperties = i; break; } @@ -83817,11 +84216,11 @@ var ts; } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 230 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 231 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); - case 232 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); - case 228 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); - case 229 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); + case 231 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); + case 232 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); + case 233 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); + case 229 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); + case 230 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); default: return ts.Debug.failBadSyntaxKind(node, "IterationStatement expected"); } } @@ -83846,11 +84245,11 @@ var ts; function createConvertedLoopState(node) { var loopInitializer; switch (node.kind) { - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 243 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 244 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -84249,20 +84648,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -84369,7 +84768,7 @@ var ts; var updated; var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 163 /* GetAccessor */) { + if (node.kind === 164 /* GetAccessor */) { updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -84861,13 +85260,13 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(104 /* ThisKeyword */); - context.enableEmitNotification(162 /* Constructor */); - context.enableEmitNotification(161 /* MethodDeclaration */); - context.enableEmitNotification(163 /* GetAccessor */); - context.enableEmitNotification(164 /* SetAccessor */); - context.enableEmitNotification(202 /* ArrowFunction */); - context.enableEmitNotification(201 /* FunctionExpression */); - context.enableEmitNotification(244 /* FunctionDeclaration */); + context.enableEmitNotification(163 /* Constructor */); + context.enableEmitNotification(162 /* MethodDeclaration */); + context.enableEmitNotification(164 /* GetAccessor */); + context.enableEmitNotification(165 /* SetAccessor */); + context.enableEmitNotification(203 /* ArrowFunction */); + context.enableEmitNotification(202 /* FunctionExpression */); + context.enableEmitNotification(245 /* FunctionDeclaration */); } } /** @@ -84908,10 +85307,10 @@ var ts; */ function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 191 /* BindingElement */: - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 242 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 243 /* VariableDeclaration */: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } @@ -84993,11 +85392,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 226 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 227 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 196 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 197 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -85005,7 +85404,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 213 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 214 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -85045,15 +85444,15 @@ var ts; if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(268 /* JsxOpeningElement */); - context.enableEmitNotification(269 /* JsxClosingElement */); - context.enableEmitNotification(267 /* JsxSelfClosingElement */); + context.enableEmitNotification(269 /* JsxOpeningElement */); + context.enableEmitNotification(270 /* JsxClosingElement */); + context.enableEmitNotification(268 /* JsxSelfClosingElement */); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(194 /* PropertyAccessExpression */); - context.enableSubstitution(281 /* PropertyAssignment */); + context.enableSubstitution(195 /* PropertyAccessExpression */); + context.enableSubstitution(282 /* PropertyAssignment */); return ts.chainBundle(transformSourceFile); /** * Transforms an ES5 source file to ES3. @@ -85072,9 +85471,9 @@ var ts; */ function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 268 /* JsxOpeningElement */: - case 269 /* JsxClosingElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 270 /* JsxClosingElement */: + case 268 /* JsxSelfClosingElement */: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -85409,13 +85808,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 228 /* DoStatement */: + case 229 /* DoStatement */: return visitDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return visitWhileStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return visitSwitchStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -85428,24 +85827,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return visitFunctionExpression(node); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return visitAccessorDeclaration(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatement(node); - case 234 /* BreakStatement */: + case 235 /* BreakStatement */: return visitBreakStatement(node); - case 233 /* ContinueStatement */: + case 234 /* ContinueStatement */: return visitContinueStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 262144 /* ContainsYield */) { @@ -85466,21 +85865,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return visitConditionalExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return visitYieldExpression(node); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return visitCallExpression(node); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -85493,9 +85892,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return visitFunctionExpression(node); default: return ts.Debug.failBadSyntaxKind(node); @@ -85703,7 +86102,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -85715,7 +86114,7 @@ var ts; // _a.b = %sent%; target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -86091,35 +86490,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 223 /* Block */: + case 224 /* Block */: return transformAndEmitBlock(node); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return transformAndEmitIfStatement(node); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return transformAndEmitDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return transformAndEmitForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 233 /* ContinueStatement */: + case 234 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 234 /* BreakStatement */: + case 235 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return transformAndEmitWithStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -86549,7 +86948,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 278 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 279 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -86562,7 +86961,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 277 /* CaseClause */) { + if (clause.kind === 278 /* CaseClause */) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -87791,11 +88190,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(209 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(207 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(208 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(290 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(210 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(208 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(209 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(291 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var currentSourceFile; // The current file. @@ -88119,23 +88518,23 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return visitImportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return visitExportDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitExportAssignment(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return visitClassDeclaration(node); - case 328 /* MergeDeclarationMarker */: + case 329 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 329 /* EndOfDeclarationMarker */: + case 330 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, moduleExpressionElementVisitor, context); @@ -88162,24 +88561,24 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var elem = _a[_i]; switch (elem.kind) { - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return false; default: ts.Debug.assertNever(elem, "Unhandled object member kind"); } @@ -88679,7 +89078,7 @@ var ts; // // To balance the declaration, add the exports of the elided variable // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -88734,10 +89133,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 257 /* NamedImports */: + case 258 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding, /* liveBinding */ true); @@ -88950,7 +89349,7 @@ var ts; * @param emit A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -89014,10 +89413,10 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return substituteBinaryExpression(node); - case 208 /* PostfixUnaryExpression */: - case 207 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -89038,7 +89437,7 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 290 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 291 /* SourceFile */) { return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), /*location*/ node); } @@ -89113,7 +89512,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 208 /* PostfixUnaryExpression */ + var expression = node.kind === 209 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 45 /* PlusPlusToken */ ? 63 /* PlusEqualsToken */ : 64 /* MinusEqualsToken */), ts.createLiteral(1)), /*location*/ node) : node; @@ -89212,12 +89611,12 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols - context.enableSubstitution(209 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(207 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(208 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(219 /* MetaProperty */); // Substitutes 'import.meta' - context.enableEmitNotification(290 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols + context.enableSubstitution(210 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(208 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(209 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(220 /* MetaProperty */); // Substitutes 'import.meta' + context.enableEmitNotification(291 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var exportFunctionsMap = []; // The export function associated with a source file. @@ -89441,7 +89840,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 260 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 261 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -89466,7 +89865,7 @@ var ts; } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 260 /* ExportDeclaration */) { + if (externalImport.kind !== 261 /* ExportDeclaration */) { continue; } if (!externalImport.exportClause) { @@ -89549,19 +89948,19 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); // TODO: GH#18217 switch (entry.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // falls through - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(ts.createExpressionStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { if (ts.isNamedExports(entry.exportClause)) { @@ -89620,13 +90019,13 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return visitImportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return visitExportDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -89806,7 +90205,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 290 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 291 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -89870,7 +90269,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -89932,10 +90331,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 257 /* NamedImports */: + case 258 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -90115,43 +90514,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return visitClassDeclaration(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatement(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatement(node); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return visitDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return visitWhileStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitLabeledStatement(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return visitWithStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return visitSwitchStatement(node); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return visitCaseBlock(node); - case 277 /* CaseClause */: + case 278 /* CaseClause */: return visitCaseClause(node); - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: return visitDefaultClause(node); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return visitTryStatement(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClause(node); - case 223 /* Block */: + case 224 /* Block */: return visitBlock(node); - case 328 /* MergeDeclarationMarker */: + case 329 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 329 /* EndOfDeclarationMarker */: + case 330 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -90398,7 +90797,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 290 /* SourceFile */; + return container !== undefined && container.kind === 291 /* SourceFile */; } else { return false; @@ -90431,7 +90830,7 @@ var ts; * @param emitCallback A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -90481,7 +90880,7 @@ var ts; */ function substituteUnspecified(node) { switch (node.kind) { - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return substituteShorthandPropertyAssignment(node); } return node; @@ -90517,12 +90916,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return substituteBinaryExpression(node); - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return substituteMetaProperty(node); } return node; @@ -90615,14 +91014,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 208 /* PostfixUnaryExpression */ + var expression = node.kind === 209 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) { var exportName = exportedNames_5[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 208 /* PostfixUnaryExpression */) { + if (node.kind === 209 /* PostfixUnaryExpression */) { expression = node.operator === 45 /* PlusPlusToken */ ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -90650,7 +91049,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 290 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 291 /* SourceFile */) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -90689,7 +91088,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(290 /* SourceFile */); + context.enableEmitNotification(291 /* SourceFile */); context.enableSubstitution(75 /* Identifier */); var helperNameSubstitutions; return ts.chainBundle(transformSourceFile); @@ -90714,12 +91113,12 @@ var ts; } function visitor(node) { switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // Elide `import=` as it is not legal with --module ES6 return undefined; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitExportAssignment(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: var exportDecl = node; return visitExportDeclaration(exportDecl); } @@ -90850,7 +91249,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.kind === 246 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90879,7 +91278,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.kind === 246 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90926,7 +91325,7 @@ var ts; return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]); } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { + if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90935,8 +91334,8 @@ var ts; } // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit // The only exception here is if the constructor was marked as private. we are not emitting the constructor parameters at all. - else if (node.kind === 159 /* PropertyDeclaration */ || node.kind === 194 /* PropertyAccessExpression */ || node.kind === 158 /* PropertySignature */ || - (node.kind === 156 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { + else if (node.kind === 160 /* PropertyDeclaration */ || node.kind === 195 /* PropertyAccessExpression */ || node.kind === 159 /* PropertySignature */ || + (node.kind === 157 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -90945,7 +91344,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 245 /* ClassDeclaration */ || node.kind === 156 /* Parameter */) { + else if (node.parent.kind === 246 /* ClassDeclaration */ || node.kind === 157 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90970,7 +91369,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (node.kind === 164 /* SetAccessor */) { + if (node.kind === 165 /* SetAccessor */) { // Getters can infer the return type from the returned expression, but setters cannot, so the // "_from_external_module_1_but_cannot_be_named" case cannot occur. if (ts.hasModifier(node, 32 /* Static */)) { @@ -91009,26 +91408,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 165 /* CallSignature */: + case 166 /* CallSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.hasModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -91036,7 +91435,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.kind === 246 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -91050,7 +91449,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -91075,30 +91474,30 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 166 /* ConstructSignature */: - case 171 /* ConstructorType */: + case 167 /* ConstructSignature */: + case 172 /* ConstructorType */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 165 /* CallSignature */: + case 166 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -91106,7 +91505,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 246 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91119,15 +91518,15 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 244 /* FunctionDeclaration */: - case 170 /* FunctionType */: + case 245 /* FunctionDeclaration */: + case 171 /* FunctionType */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - case 164 /* SetAccessor */: - case 163 /* GetAccessor */: + case 165 /* SetAccessor */: + case 164 /* GetAccessor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91141,39 +91540,39 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 186 /* MappedType */: + case 187 /* MappedType */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 171 /* ConstructorType */: - case 166 /* ConstructSignature */: + case 172 /* ConstructorType */: + case 167 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 165 /* CallSignature */: + case 166 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 246 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 170 /* FunctionType */: - case 244 /* FunctionDeclaration */: + case 171 /* FunctionType */: + case 245 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -91188,7 +91587,7 @@ var ts; function getHeritageClauseVisibilityError() { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 245 /* ClassDeclaration */) { + if (node.parent.parent.kind === 246 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible diagnosticMessage = ts.isHeritageClause(node.parent) && node.parent.token === 113 /* ImplementsKeyword */ ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : @@ -91239,7 +91638,7 @@ var ts; } function isInternalDeclaration(node, currentSourceFile) { var parseTreeNode = ts.getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 156 /* Parameter */) { + if (parseTreeNode && parseTreeNode.kind === 157 /* Parameter */) { var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : undefined; var text = currentSourceFile.text; @@ -91398,10 +91797,10 @@ var ts; return result; } function transformRoot(node) { - if (node.kind === 290 /* SourceFile */ && node.isDeclarationFile) { + if (node.kind === 291 /* SourceFile */ && node.isDeclarationFile) { return node; } - if (node.kind === 291 /* Bundle */) { + if (node.kind === 292 /* Bundle */) { isBundledEmit = true; refs = ts.createMap(); libs = ts.createMap(); @@ -91424,14 +91823,14 @@ var ts; resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules) needsDeclare = false; var statements = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile, /*bundled*/ true)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); - var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(130 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); + var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(131 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); return newFile; } needsDeclare = true; var updated = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); return ts.updateSourceFileNode(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); }), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 293 /* InputFiles */) { + if (prepend.kind === 294 /* InputFiles */) { var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal); hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib; collectReferences(sourceFile, refs); @@ -91572,7 +91971,7 @@ var ts; return name; } else { - if (name.kind === 190 /* ArrayBindingPattern */) { + if (name.kind === 191 /* ArrayBindingPattern */) { return ts.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement)); } else { @@ -91580,7 +91979,7 @@ var ts; } } function visitBindingElement(elem) { - if (elem.kind === 215 /* OmittedExpression */) { + if (elem.kind === 216 /* OmittedExpression */) { return elem; } return ts.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined); @@ -91618,7 +92017,7 @@ var ts; // Literal const declarations will have an initializer ensured rather than a type return; } - var shouldUseResolverType = node.kind === 156 /* Parameter */ && + var shouldUseResolverType = node.kind === 157 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { @@ -91627,7 +92026,7 @@ var ts; if (!ts.getParseTreeNode(node)) { return type ? ts.visitNode(type, visitDeclarationSubtree) : ts.createKeywordTypeNode(125 /* AnyKeyword */); } - if (node.kind === 164 /* SetAccessor */) { + if (node.kind === 165 /* SetAccessor */) { // Set accessors with no associated type node (from it's param or get accessor return) are `any` since they are never contextually typed right now // (The inferred type here will be void, but the old declaration emitter printed `any`, so this replicates that) return ts.createKeywordTypeNode(125 /* AnyKeyword */); @@ -91638,12 +92037,12 @@ var ts; oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node); } - if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { + if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); } - if (node.kind === 156 /* Parameter */ - || node.kind === 159 /* PropertyDeclaration */ - || node.kind === 158 /* PropertySignature */) { + if (node.kind === 157 /* Parameter */ + || node.kind === 160 /* PropertyDeclaration */ + || node.kind === 159 /* PropertySignature */) { if (!node.initializer) return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType)); return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); @@ -91660,20 +92059,20 @@ var ts; function isDeclarationAndNotVisible(node) { node = ts.getParseTreeNode(node); switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 249 /* ModuleDeclaration */: - case 246 /* InterfaceDeclaration */: - case 245 /* ClassDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 248 /* EnumDeclaration */: + case 245 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 247 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: return !resolver.isDeclarationVisible(node); // The following should be doing their own visibility checks based on filtering their members - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return !getBindingNameVisible(node); - case 253 /* ImportEqualsDeclaration */: - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: - case 259 /* ExportAssignment */: + case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 260 /* ExportAssignment */: return false; } return false; @@ -91754,7 +92153,7 @@ var ts; function rewriteModuleSpecifier(parent, input) { if (!input) return undefined; // TODO: GH#18217 - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 249 /* ModuleDeclaration */ && parent.kind !== 188 /* ImportType */); + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 250 /* ModuleDeclaration */ && parent.kind !== 189 /* ImportType */); if (ts.isStringLiteralLike(input)) { if (isBundledEmit) { var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent); @@ -91774,7 +92173,7 @@ var ts; function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 265 /* ExternalModuleReference */) { + if (decl.moduleReference.kind === 266 /* ExternalModuleReference */) { // Rewrite external module names if necessary var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl); return ts.updateImportEqualsDeclaration(decl, @@ -91801,7 +92200,7 @@ var ts; return visibleDefaultBinding && ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, /*namedBindings*/ undefined, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)); } - if (decl.importClause.namedBindings.kind === 256 /* NamespaceImport */) { + if (decl.importClause.namedBindings.kind === 257 /* NamespaceImport */) { // Namespace import (optionally with visible default) var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : /*namedBindings*/ undefined; return visibleDefaultBinding || namedBindings ? ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, namedBindings, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined; @@ -91890,7 +92289,7 @@ var ts; // We'd see a TDZ violation at runtime var canProduceDiagnostic = ts.canProduceDiagnostics(input); var oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 173 /* TypeLiteral */ || input.kind === 186 /* MappedType */) && input.parent.kind !== 247 /* TypeAliasDeclaration */); + var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 174 /* TypeLiteral */ || input.kind === 187 /* MappedType */) && input.parent.kind !== 248 /* TypeAliasDeclaration */); // Emit methods which are private as properties with no type information if (ts.isMethodDeclaration(input) || ts.isMethodSignature(input)) { if (ts.hasModifier(input, 8 /* Private */)) { @@ -91911,38 +92310,38 @@ var ts; } if (isProcessedComponent(input)) { switch (input.kind) { - case 216 /* ExpressionWithTypeArguments */: { + case 217 /* ExpressionWithTypeArguments */: { if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateExpressionWithTypeArguments(node, ts.parenthesizeTypeParameters(node.typeArguments), node.expression)); } - case 169 /* TypeReference */: { + case 170 /* TypeReference */: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateTypeReferenceNode(node, node.typeName, ts.parenthesizeTypeParameters(node.typeArguments))); } - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: return cleanup(ts.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); - case 162 /* Constructor */: { + case 163 /* Constructor */: { // A constructor declaration may not have a type annotation - var ctor = ts.createSignatureDeclaration(162 /* Constructor */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0 /* None */), + var ctor = ts.createSignatureDeclaration(163 /* Constructor */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0 /* None */), /*type*/ undefined); ctor.modifiers = ts.createNodeArray(ensureModifiers(input)); return cleanup(ctor); } - case 161 /* MethodDeclaration */: { + case 162 /* MethodDeclaration */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } - var sig = ts.createSignatureDeclaration(160 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); + var sig = ts.createSignatureDeclaration(161 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); sig.name = input.name; sig.modifiers = ts.createNodeArray(ensureModifiers(input)); sig.questionToken = input.questionToken; return cleanup(sig); } - case 163 /* GetAccessor */: { + case 164 /* GetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -91951,7 +92350,7 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8 /* Private */)), ensureType(input, accessorType), /*body*/ undefined)); } - case 164 /* SetAccessor */: { + case 165 /* SetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -91959,31 +92358,31 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8 /* Private */)), /*body*/ undefined)); } - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updateProperty(input, /*decorators*/ undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 160 /* MethodSignature */: { + case 161 /* MethodSignature */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updateMethodSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), input.name, input.questionToken)); } - case 165 /* CallSignature */: { + case 166 /* CallSignature */: { return cleanup(ts.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 167 /* IndexSignature */: { + case 168 /* IndexSignature */: { return cleanup(ts.updateIndexSignature(input, /*decorators*/ undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || ts.createKeywordTypeNode(125 /* AnyKeyword */))); } - case 242 /* VariableDeclaration */: { + case 243 /* VariableDeclaration */: { if (ts.isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -91991,13 +92390,13 @@ var ts; suppressNewDiagnosticContexts = true; // Variable declaration types also suppress new diagnostic contexts, provided the contexts wouldn't be made for binding pattern types return cleanup(ts.updateTypeScriptVariableDeclaration(input, input.name, /*exclaimationToken*/ undefined, ensureType(input, input.type), ensureNoInitializer(input))); } - case 155 /* TypeParameter */: { + case 156 /* TypeParameter */: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(ts.updateTypeParameterDeclaration(input, input.name, /*constraint*/ undefined, /*defaultType*/ undefined)); } return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context)); } - case 180 /* ConditionalType */: { + case 181 /* ConditionalType */: { // We have to process conditional types in a special way because for visibility purposes we need to push a new enclosingDeclaration // just for the `infer` types in the true branch. It's an implicit declaration scope that only applies to _part_ of the type. var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree); @@ -92009,13 +92408,13 @@ var ts; var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree); return cleanup(ts.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 170 /* FunctionType */: { + case 171 /* FunctionType */: { return cleanup(ts.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 171 /* ConstructorType */: { + case 172 /* ConstructorType */: { return cleanup(ts.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 188 /* ImportType */: { + case 189 /* ImportType */: { if (!ts.isLiteralImportTypeNode(input)) return cleanup(input); return cleanup(ts.updateImportTypeNode(input, ts.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf)); @@ -92044,7 +92443,7 @@ var ts; } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 161 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); + return node.parent.kind === 162 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -92054,7 +92453,7 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 260 /* ExportDeclaration */: { + case 261 /* ExportDeclaration */: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -92064,7 +92463,7 @@ var ts; return ts.updateExportDeclaration(input, /*decorators*/ undefined, input.modifiers, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier), input.isTypeOnly); } - case 259 /* ExportAssignment */: { + case 260 /* ExportAssignment */: { // Always visible if the parent node isn't dropped for being not visible if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; @@ -92080,7 +92479,7 @@ var ts; errorNode: input }); }; var varDecl = ts.createVariableDeclaration(newId, resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); return [statement, ts.updateExportAssignment(input, input.decorators, input.modifiers, newId)]; } } @@ -92105,10 +92504,10 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 253 /* ImportEqualsDeclaration */: { + case 254 /* ImportEqualsDeclaration */: { return transformImportEqualsDeclaration(input); } - case 254 /* ImportDeclaration */: { + case 255 /* ImportDeclaration */: { return transformImportDeclaration(input); } } @@ -92129,14 +92528,14 @@ var ts; } var previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 247 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all + case 248 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all return cleanup(ts.updateTypeAliasDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode))); - case 246 /* InterfaceDeclaration */: { + case 247 /* InterfaceDeclaration */: { return cleanup(ts.updateInterfaceDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree))); } - case 244 /* FunctionDeclaration */: { + case 245 /* FunctionDeclaration */: { // Generators lose their generator-ness, excepting their return type var clean = cleanup(ts.updateFunctionDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), @@ -92184,10 +92583,10 @@ var ts; return clean; } } - case 249 /* ModuleDeclaration */: { + case 250 /* ModuleDeclaration */: { needsDeclare = false; var inner = input.body; - if (inner && inner.kind === 250 /* ModuleBlock */) { + if (inner && inner.kind === 251 /* ModuleBlock */) { var oldNeedsScopeFix = needsScopeFixMarker; var oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; @@ -92230,7 +92629,7 @@ var ts; /*decorators*/ undefined, mods, input.name, body)); } } - case 245 /* ClassDeclaration */: { + case 246 /* ClassDeclaration */: { var modifiers = ts.createNodeArray(ensureModifiers(input)); var typeParameters = ensureTypeParams(input, input.typeParameters); var ctor = ts.getFirstConstructorWithBody(input); @@ -92291,7 +92690,7 @@ var ts; typeName: input.name }); }; var varDecl = ts.createVariableDeclaration(newId_1, resolver.createTypeOfExpression(extendsClause_1.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); var heritageClauses = ts.createNodeArray(ts.map(input.heritageClauses, function (clause) { if (clause.token === 90 /* ExtendsKeyword */) { var oldDiag_2 = getSymbolAccessibilityDiagnostic; @@ -92311,10 +92710,10 @@ var ts; /*decorators*/ undefined, modifiers, input.name, typeParameters, heritageClauses, members)); } } - case 225 /* VariableStatement */: { + case 226 /* VariableStatement */: { return cleanup(transformVariableStatement(input)); } - case 248 /* EnumDeclaration */: { + case 249 /* EnumDeclaration */: { return cleanup(ts.updateEnumDeclaration(input, /*decorators*/ undefined, ts.createNodeArray(ensureModifiers(input)), input.name, ts.createNodeArray(ts.mapDefined(input.members, function (m) { if (shouldStripInternal(m)) return; @@ -92333,7 +92732,7 @@ var ts; if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 249 /* ModuleDeclaration */) { + if (input.kind === 250 /* ModuleDeclaration */) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -92354,7 +92753,7 @@ var ts; return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); })); } function recreateBindingElement(e) { - if (e.kind === 215 /* OmittedExpression */) { + if (e.kind === 216 /* OmittedExpression */) { return; } if (e.name) { @@ -92404,7 +92803,7 @@ var ts; function ensureModifierFlags(node) { var mask = 3071 /* All */ ^ (4 /* Public */ | 256 /* Async */); // No async modifiers in declaration files var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */; - var parentIsFile = node.parent.kind === 290 /* SourceFile */; + var parentIsFile = node.parent.kind === 291 /* SourceFile */; if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) { mask ^= 2 /* Ambient */; additions = 0 /* None */; @@ -92433,7 +92832,7 @@ var ts; } ts.transformDeclarations = transformDeclarations; function isAlwaysType(node) { - if (node.kind === 246 /* InterfaceDeclaration */) { + if (node.kind === 247 /* InterfaceDeclaration */) { return true; } return false; @@ -92458,7 +92857,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 163 /* GetAccessor */ + return accessor.kind === 164 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -92467,52 +92866,52 @@ var ts; } function canHaveLiteralInitializer(node) { switch (node.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return !ts.hasModifier(node, 8 /* Private */); - case 156 /* Parameter */: - case 242 /* VariableDeclaration */: + case 157 /* Parameter */: + case 243 /* VariableDeclaration */: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 249 /* ModuleDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 246 /* InterfaceDeclaration */: - case 245 /* ClassDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 248 /* EnumDeclaration */: - case 225 /* VariableStatement */: - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: - case 259 /* ExportAssignment */: + case 245 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 247 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: + case 226 /* VariableStatement */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 260 /* ExportAssignment */: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 166 /* ConstructSignature */: - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 167 /* IndexSignature */: - case 242 /* VariableDeclaration */: - case 155 /* TypeParameter */: - case 216 /* ExpressionWithTypeArguments */: - case 169 /* TypeReference */: - case 180 /* ConditionalType */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 188 /* ImportType */: + case 167 /* ConstructSignature */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 168 /* IndexSignature */: + case 243 /* VariableDeclaration */: + case 156 /* TypeParameter */: + case 217 /* ExpressionWithTypeArguments */: + case 170 /* TypeReference */: + case 181 /* ConditionalType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 189 /* ImportType */: return true; } return false; @@ -92645,7 +93044,7 @@ var ts; * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(331 /* Count */); + var enabledSyntaxKindFeatures = new Array(332 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -93009,7 +93408,7 @@ var ts; /*@internal*/ function getOutputPathsFor(sourceFile, host, forceDtsPaths) { var options = host.getCompilerOptions(); - if (sourceFile.kind === 291 /* Bundle */) { + if (sourceFile.kind === 292 /* Bundle */) { return getOutputPathsForBundle(options, forceDtsPaths); } else { @@ -93339,7 +93738,7 @@ var ts; mapRoot: compilerOptions.mapRoot, extendedDiagnostics: compilerOptions.extendedDiagnostics, }); - if (forceDtsEmit && declarationTransform.transformed[0].kind === 290 /* SourceFile */) { + if (forceDtsEmit && declarationTransform.transformed[0].kind === 291 /* SourceFile */) { var sourceFile = declarationTransform.transformed[0]; exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit; } @@ -93362,8 +93761,8 @@ var ts; ts.forEachChild(node, collectLinkedAliases); } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) { - var bundle = sourceFileOrBundle.kind === 291 /* Bundle */ ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 290 /* SourceFile */ ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 292 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 291 /* SourceFile */ ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; var sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -93404,7 +93803,7 @@ var ts; } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { return (mapOptions.sourceMap || mapOptions.inlineSourceMap) - && (sourceFileOrBundle.kind !== 290 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); + && (sourceFileOrBundle.kind !== 291 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); } function getSourceRoot(mapOptions) { // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the @@ -93515,7 +93914,7 @@ var ts; }; function createSourceFilesFromBundleBuildInfo(bundle, buildInfoDirectory, host) { var sourceFiles = bundle.sourceFiles.map(function (fileName) { - var sourceFile = ts.createNode(290 /* SourceFile */, 0, 0); + var sourceFile = ts.createNode(291 /* SourceFile */, 0, 0); sourceFile.fileName = ts.getRelativePathFromDirectory(host.getCurrentDirectory(), ts.getNormalizedAbsolutePath(fileName, buildInfoDirectory), !host.useCaseSensitiveFileNames()); sourceFile.text = ""; sourceFile.statements = ts.createNodeArray(); @@ -93527,7 +93926,7 @@ var ts; sourceFile.text = prologueInfo.text; sourceFile.end = prologueInfo.text.length; sourceFile.statements = ts.createNodeArray(prologueInfo.directives.map(function (directive) { - var statement = ts.createNode(226 /* ExpressionStatement */, directive.pos, directive.end); + var statement = ts.createNode(227 /* ExpressionStatement */, directive.pos, directive.end); statement.expression = ts.createNode(10 /* StringLiteral */, directive.expression.pos, directive.expression.end); statement.expression.text = directive.expression.text; return statement; @@ -93704,9 +94103,9 @@ var ts; break; } switch (node.kind) { - case 290 /* SourceFile */: return printFile(node); - case 291 /* Bundle */: return printBundle(node); - case 292 /* UnparsedSource */: return printUnparsedSource(node); + case 291 /* SourceFile */: return printFile(node); + case 292 /* Bundle */: return printBundle(node); + case 293 /* UnparsedSource */: return printUnparsedSource(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); @@ -93957,12 +94356,12 @@ var ts; } // falls through case 2 /* Comments */: - if (!commentsDisabled && node.kind !== 290 /* SourceFile */) { + if (!commentsDisabled && node.kind !== 291 /* SourceFile */) { return pipelineEmitWithComments; } // falls through case 3 /* SourceMaps */: - if (!sourceMapsDisabled && node.kind !== 290 /* SourceFile */ && !ts.isInJsonFile(node)) { + if (!sourceMapsDisabled && node.kind !== 291 /* SourceFile */ && !ts.isInJsonFile(node)) { return pipelineEmitWithSourceMap; } // falls through @@ -94004,15 +94403,15 @@ var ts; case 16 /* TemplateMiddle */: case 17 /* TemplateTail */: return emitLiteral(node, /*jsxAttributeEscape*/ false); - case 292 /* UnparsedSource */: - case 286 /* UnparsedPrepend */: + case 293 /* UnparsedSource */: + case 287 /* UnparsedPrepend */: return emitUnparsedSourceOrPrepend(node); - case 285 /* UnparsedPrologue */: + case 286 /* UnparsedPrologue */: return writeUnparsedNode(node); - case 287 /* UnparsedText */: - case 288 /* UnparsedInternalText */: + case 288 /* UnparsedText */: + case 289 /* UnparsedInternalText */: return emitUnparsedTextLike(node); - case 289 /* UnparsedSyntheticReference */: + case 290 /* UnparsedSyntheticReference */: return emitUnparsedSyntheticReference(node); // Identifiers case 75 /* Identifier */: @@ -94022,260 +94421,260 @@ var ts; return emitPrivateIdentifier(node); // Parse tree nodes // Names - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return emitQualifiedName(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return emitTypeParameter(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return emitParameter(node); - case 157 /* Decorator */: + case 158 /* Decorator */: return emitDecorator(node); // Type members - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: return emitPropertySignature(node); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 160 /* MethodSignature */: + case 161 /* MethodSignature */: return emitMethodSignature(node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return emitConstructor(node); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return emitAccessorDeclaration(node); - case 165 /* CallSignature */: + case 166 /* CallSignature */: return emitCallSignature(node); - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: return emitConstructSignature(node); - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: return emitIndexSignature(node); // Types - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return emitTypePredicate(node); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return emitTypeReference(node); - case 170 /* FunctionType */: + case 171 /* FunctionType */: return emitFunctionType(node); - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 171 /* ConstructorType */: + case 172 /* ConstructorType */: return emitConstructorType(node); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return emitTypeQuery(node); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return emitTypeLiteral(node); - case 174 /* ArrayType */: + case 175 /* ArrayType */: return emitArrayType(node); - case 175 /* TupleType */: + case 176 /* TupleType */: return emitTupleType(node); - case 176 /* OptionalType */: + case 177 /* OptionalType */: return emitOptionalType(node); - case 178 /* UnionType */: + case 179 /* UnionType */: return emitUnionType(node); - case 179 /* IntersectionType */: + case 180 /* IntersectionType */: return emitIntersectionType(node); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return emitConditionalType(node); - case 181 /* InferType */: + case 182 /* InferType */: return emitInferType(node); - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return emitParenthesizedType(node); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 183 /* ThisType */: + case 184 /* ThisType */: return emitThisType(); - case 184 /* TypeOperator */: + case 185 /* TypeOperator */: return emitTypeOperator(node); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 186 /* MappedType */: + case 187 /* MappedType */: return emitMappedType(node); - case 187 /* LiteralType */: + case 188 /* LiteralType */: return emitLiteralType(node); - case 188 /* ImportType */: + case 189 /* ImportType */: return emitImportTypeNode(node); - case 295 /* JSDocAllType */: + case 296 /* JSDocAllType */: writePunctuation("*"); return; - case 296 /* JSDocUnknownType */: + case 297 /* JSDocUnknownType */: writePunctuation("?"); return; - case 297 /* JSDocNullableType */: + case 298 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 298 /* JSDocNonNullableType */: + case 299 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 299 /* JSDocOptionalType */: + case 300 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 177 /* RestType */: - case 301 /* JSDocVariadicType */: + case 178 /* RestType */: + case 302 /* JSDocVariadicType */: return emitRestOrJSDocVariadicType(node); // Binding patterns - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return emitBindingElement(node); // Misc - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return emitTemplateSpan(node); - case 222 /* SemicolonClassElement */: + case 223 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 223 /* Block */: + case 224 /* Block */: return emitBlock(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return emitVariableStatement(node); - case 224 /* EmptyStatement */: + case 225 /* EmptyStatement */: return emitEmptyStatement(/*isEmbeddedStatement*/ false); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return emitExpressionStatement(node); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return emitIfStatement(node); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return emitDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return emitWhileStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return emitForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return emitForInStatement(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return emitForOfStatement(node); - case 233 /* ContinueStatement */: + case 234 /* ContinueStatement */: return emitContinueStatement(node); - case 234 /* BreakStatement */: + case 235 /* BreakStatement */: return emitBreakStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return emitReturnStatement(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return emitWithStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return emitSwitchStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return emitLabeledStatement(node); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return emitThrowStatement(node); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return emitTryStatement(node); - case 241 /* DebuggerStatement */: + case 242 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return emitClassDeclaration(node); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return emitModuleBlock(node); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return emitCaseBlock(node); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return emitImportDeclaration(node); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return emitImportClause(node); - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return emitNamespaceImport(node); - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: return emitNamespaceExport(node); - case 257 /* NamedImports */: + case 258 /* NamedImports */: return emitNamedImports(node); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return emitImportSpecifier(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return emitExportAssignment(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return emitExportDeclaration(node); - case 261 /* NamedExports */: + case 262 /* NamedExports */: return emitNamedExports(node); - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: return emitExportSpecifier(node); - case 264 /* MissingDeclaration */: + case 265 /* MissingDeclaration */: return; // Module references - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 11 /* JsxText */: return emitJsxText(node); - case 268 /* JsxOpeningElement */: - case 271 /* JsxOpeningFragment */: + case 269 /* JsxOpeningElement */: + case 272 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 269 /* JsxClosingElement */: - case 272 /* JsxClosingFragment */: + case 270 /* JsxClosingElement */: + case 273 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return emitJsxAttribute(node); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return emitJsxAttributes(node); - case 275 /* JsxSpreadAttribute */: + case 276 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 277 /* CaseClause */: + case 278 /* CaseClause */: return emitCaseClause(node); - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: return emitDefaultClause(node); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: return emitHeritageClause(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 284 /* EnumMember */: + case 285 /* EnumMember */: return emitEnumMember(node); // JSDoc nodes (only used in codefixes currently) - case 317 /* JSDocParameterTag */: - case 323 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: + case 324 /* JSDocPropertyTag */: return emitJSDocPropertyLikeTag(node); - case 318 /* JSDocReturnTag */: - case 320 /* JSDocTypeTag */: - case 319 /* JSDocThisTag */: - case 316 /* JSDocEnumTag */: + case 319 /* JSDocReturnTag */: + case 321 /* JSDocTypeTag */: + case 320 /* JSDocThisTag */: + case 317 /* JSDocEnumTag */: return emitJSDocSimpleTypedTag(node); - case 308 /* JSDocImplementsTag */: - case 307 /* JSDocAugmentsTag */: + case 309 /* JSDocImplementsTag */: + case 308 /* JSDocAugmentsTag */: return emitJSDocHeritageTag(node); - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); - case 322 /* JSDocTypedefTag */: + case 323 /* JSDocTypedefTag */: return emitJSDocTypedefTag(node); - case 315 /* JSDocCallbackTag */: + case 316 /* JSDocCallbackTag */: return emitJSDocCallbackTag(node); - case 305 /* JSDocSignature */: + case 306 /* JSDocSignature */: return emitJSDocSignature(node); - case 304 /* JSDocTypeLiteral */: + case 305 /* JSDocTypeLiteral */: return emitJSDocTypeLiteral(node); - case 310 /* JSDocClassTag */: - case 306 /* JSDocTag */: + case 311 /* JSDocClassTag */: + case 307 /* JSDocTag */: return emitJSDocSimpleTag(node); - case 303 /* JSDocComment */: + case 304 /* JSDocComment */: return emitJSDoc(node); // Transformation nodes (ignored) } @@ -94312,71 +94711,71 @@ var ts; writeTokenNode(node, writeKeyword); return; // Expressions - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return emitCallExpression(node); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return emitNewExpression(node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return emitFunctionExpression(node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return emitArrowFunction(node); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return emitDeleteExpression(node); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return emitVoidExpression(node); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return emitAwaitExpression(node); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return emitBinaryExpression(node); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return emitConditionalExpression(node); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: return emitTemplateExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return emitYieldExpression(node); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return emitSpreadExpression(node); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return emitClassExpression(node); - case 215 /* OmittedExpression */: + case 216 /* OmittedExpression */: return; - case 217 /* AsExpression */: + case 218 /* AsExpression */: return emitAsExpression(node); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: return emitNonNullExpression(node); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return emitMetaProperty(node); // JSX - case 266 /* JsxElement */: + case 267 /* JsxElement */: return emitJsxElement(node); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return emitJsxFragment(node); // Transformation nodes - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: return emitCommaList(node); } } @@ -94418,7 +94817,7 @@ var ts; } function emitHelpers(node) { var helpersEmitted = false; - var bundle = node.kind === 291 /* Bundle */ ? node : undefined; + var bundle = node.kind === 292 /* Bundle */ ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -94518,7 +94917,7 @@ var ts; var pos = getTextPosWithWriteLine(); writeUnparsedNode(unparsed); if (bundleFileInfo) { - updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 287 /* UnparsedText */ ? + updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 288 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */); } @@ -94591,7 +94990,7 @@ var ts; emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 300 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 301 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { @@ -94653,7 +95052,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - writeKeyword(node.kind === 163 /* GetAccessor */ ? "get" : "set"); + writeKeyword(node.kind === 164 /* GetAccessor */ ? "get" : "set"); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -94836,7 +95235,7 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - if (node.readonlyToken.kind !== 138 /* ReadonlyKeyword */) { + if (node.readonlyToken.kind !== 139 /* ReadonlyKeyword */) { writeKeyword("readonly"); } writeSpace(); @@ -94927,7 +95326,7 @@ var ts; } function emitPropertyAccessExpression(node) { var expression = ts.cast(emitExpression(node.expression), ts.isExpression); - var token = ts.getDotOrQuestionDotToken(node); + var token = node.questionDotToken || ts.createNode(24 /* DotToken */, node.expression.end, node.name.pos); var indentBeforeDot = needsIndentation(node, node.expression, token); var indentAfterDot = needsIndentation(node, token, node.name); increaseIndentIf(indentBeforeDot, /*writeSpaceIfNotIndenting*/ false); @@ -94938,7 +95337,12 @@ var ts; if (shouldEmitDotDot) { writePunctuation("."); } - emitTokenWithComment(token.kind, node.expression.end, writePunctuation, node); + if (node.questionDotToken) { + emit(token); + } + else { + emitTokenWithComment(token.kind, node.expression.end, writePunctuation, node); + } increaseIndentIf(indentAfterDot, /*writeSpaceIfNotIndenting*/ false); emit(node.name); decreaseIndentIf(indentBeforeDot, indentAfterDot); @@ -95056,7 +95460,7 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 207 /* PrefixUnaryExpression */ + return operand.kind === 208 /* PrefixUnaryExpression */ && ((node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */)) || (node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */))); } @@ -95244,7 +95648,7 @@ var ts; if (node.elseStatement) { writeLineOrSpace(node); emitTokenWithComment(87 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 227 /* IfStatement */) { + if (node.elseStatement.kind === 228 /* IfStatement */) { writeSpace(); emit(node.elseStatement); } @@ -95307,7 +95711,7 @@ var ts; emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - emitTokenWithComment(152 /* OfKeyword */, node.initializer.end, writeKeyword, node); + emitTokenWithComment(153 /* OfKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); @@ -95315,7 +95719,7 @@ var ts; } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 243 /* VariableDeclarationList */) { + if (node.kind === 244 /* VariableDeclarationList */) { emit(node); } else { @@ -95611,7 +96015,7 @@ var ts; var body = node.body; if (!body) return writeTrailingSemicolon(); - while (body.kind === 249 /* ModuleDeclaration */) { + while (body.kind === 250 /* ModuleDeclaration */) { writePunctuation("."); emit(body.name); body = body.body; @@ -95656,7 +96060,7 @@ var ts; if (node.importClause) { emit(node.importClause); writeSpace(); - emitTokenWithComment(149 /* FromKeyword */, node.importClause.end, writeKeyword, node); + emitTokenWithComment(150 /* FromKeyword */, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -95664,7 +96068,7 @@ var ts; } function emitImportClause(node) { if (node.isTypeOnly) { - emitTokenWithComment(145 /* TypeKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(146 /* TypeKeyword */, node.pos, writeKeyword, node); writeSpace(); } emit(node.name); @@ -95704,7 +96108,7 @@ var ts; var nextPos = emitTokenWithComment(89 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { - nextPos = emitTokenWithComment(145 /* TypeKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(146 /* TypeKeyword */, nextPos, writeKeyword, node); writeSpace(); } if (node.exportClause) { @@ -95716,7 +96120,7 @@ var ts; if (node.moduleSpecifier) { writeSpace(); var fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(149 /* FromKeyword */, fromPos, writeKeyword, node); + emitTokenWithComment(150 /* FromKeyword */, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } @@ -95727,7 +96131,7 @@ var ts; writeSpace(); nextPos = emitTokenWithComment(123 /* AsKeyword */, nextPos, writeKeyword, node); writeSpace(); - nextPos = emitTokenWithComment(136 /* NamespaceKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(137 /* NamespaceKeyword */, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeTrailingSemicolon(); @@ -95947,7 +96351,7 @@ var ts; } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 320 /* JSDocTypeTag */ && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 321 /* JSDocTypeTag */ && !node.comment) { writeSpace(); emit(node.tags[0]); } @@ -95981,7 +96385,7 @@ var ts; function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 294 /* JSDocTypeExpression */) { + if (tag.typeExpression.kind === 295 /* JSDocTypeExpression */) { emitJSDocTypeExpression(tag.typeExpression); } else { @@ -96000,7 +96404,7 @@ var ts; emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 304 /* JSDocTypeLiteral */) { + if (tag.typeExpression && tag.typeExpression.kind === 305 /* JSDocTypeLiteral */) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -96780,7 +97184,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 200 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 201 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -96845,84 +97249,84 @@ var ts; if (!node) return; switch (node.kind) { - case 223 /* Block */: + case 224 /* Block */: ts.forEach(node.statements, generateNames); break; - case 238 /* LabeledStatement */: - case 236 /* WithStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 239 /* LabeledStatement */: + case 237 /* WithStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: generateNames(node.statement); break; - case 227 /* IfStatement */: + case 228 /* IfStatement */: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: - case 231 /* ForInStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: + case 232 /* ForInStatement */: generateNames(node.initializer); generateNames(node.statement); break; - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: generateNames(node.caseBlock); break; - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: ts.forEach(node.clauses, generateNames); break; - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: ts.forEach(node.statements, generateNames); break; - case 240 /* TryStatement */: + case 241 /* TryStatement */: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 280 /* CatchClause */: + case 281 /* CatchClause */: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: generateNames(node.declarationList); break; - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: ts.forEach(node.declarations, generateNames); break; - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 191 /* BindingElement */: - case 245 /* ClassDeclaration */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 192 /* BindingElement */: + case 246 /* ClassDeclaration */: generateNameIfNeeded(node.name); break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: generateNameIfNeeded(node.name); if (ts.getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) { ts.forEach(node.parameters, generateNames); generateNames(node.body); } break; - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: ts.forEach(node.elements, generateNames); break; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: generateNames(node.importClause); break; - case 255 /* ImportClause */: + case 256 /* ImportClause */: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: generateNameIfNeeded(node.name); break; - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: generateNameIfNeeded(node.name); break; - case 257 /* NamedImports */: + case 258 /* NamedImports */: ts.forEach(node.elements, generateNames); break; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -96931,12 +97335,12 @@ var ts; if (!node) return; switch (node.kind) { - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: generateNameIfNeeded(node.name); break; } @@ -97118,23 +97522,23 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16 /* Optimistic */), !!(flags & 8 /* ReservedInNestedScopes */)); - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 259 /* ExportAssignment */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 260 /* ExportAssignment */: return generateNameForExportDefault(); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return generateNameForClassExpression(); - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return generateNameForMethodOrAccessor(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return makeTempVariableName(0 /* Auto */, /*reserveInNestedScopes*/ true); default: return makeTempVariableName(0 /* Auto */); @@ -97182,7 +97586,7 @@ var ts; hasWrittenComment = false; var emitFlags = ts.getEmitFlags(node); var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var isEmittedNode = node.kind !== 325 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 326 /* NotEmittedStatement */; // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is "preserve" we will not do any transformation. // It is expensive to walk entire tree just to set one kind of node to have no comments. var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 11 /* JsxText */; @@ -97206,7 +97610,7 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 243 /* VariableDeclarationList */) { + if (node.kind === 244 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -97465,7 +97869,7 @@ var ts; else { var _a = ts.getSourceMapRange(node), pos = _a.pos, end = _a.end, _b = _a.source, source = _b === void 0 ? sourceMapSource : _b; var emitFlags = ts.getEmitFlags(node); - if (node.kind !== 325 /* NotEmittedStatement */ + if (node.kind !== 326 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitSourcePos(source, skipSourceTrivia(source, pos)); @@ -97478,7 +97882,7 @@ var ts; else { pipelinePhase(hint, node); } - if (node.kind !== 325 /* NotEmittedStatement */ + if (node.kind !== 326 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitSourcePos(source, end); @@ -97938,7 +98342,6 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var ignoreDiagnosticCommentRegEx = /(^\s*$)|(^\s*\/\/\/?\s*(@ts-ignore)?)/; function findConfigFile(searchPath, fileExists, configName) { if (configName === void 0) { configName = "tsconfig.json"; } return ts.forEachAncestorDirectory(searchPath, function (ancestor) { @@ -98508,6 +98911,7 @@ var ts; }; } function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) { + var _a; var createProgramOptions = ts.isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions; // TODO: GH#18217 var rootNames = createProgramOptions.rootNames, options = createProgramOptions.options, configFileParsingDiagnostics = createProgramOptions.configFileParsingDiagnostics, projectReferences = createProgramOptions.projectReferences; var oldProgram = createProgramOptions.oldProgram; @@ -98604,7 +99008,16 @@ var ts; var projectReferenceRedirects; var mapFromFileToProjectReferenceRedirects; var mapFromToProjectReferenceRedirectSource; - var useSourceOfProjectReferenceRedirect = !!host.useSourceOfProjectReferenceRedirect && host.useSourceOfProjectReferenceRedirect(); + var useSourceOfProjectReferenceRedirect = !!((_a = host.useSourceOfProjectReferenceRedirect) === null || _a === void 0 ? void 0 : _a.call(host)) && + !options.disableSourceOfProjectReferenceRedirect; + var onProgramCreateComplete = updateHostForUseSourceOfProjectReferenceRedirect({ + compilerHost: host, + useSourceOfProjectReferenceRedirect: useSourceOfProjectReferenceRedirect, + toPath: toPath, + getResolvedProjectReferences: getResolvedProjectReferences, + getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, + forEachResolvedProjectReference: forEachResolvedProjectReference + }); var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); // We set `structuralIsReused` to `undefined` because `tryReuseStructureFromOldProgram` calls `tryReuseStructureFromOldProgram` which checks // `structuralIsReused`, which would be a TDZ violation if it was not set in advance to `undefined`. @@ -98617,12 +99030,6 @@ var ts; if (!resolvedProjectReferences) { resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); } - if (host.setResolvedProjectReferenceCallbacks) { - host.setResolvedProjectReferenceCallbacks({ - getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, - forEachResolvedProjectReference: forEachResolvedProjectReference - }); - } if (rootNames.length) { for (var _i = 0, resolvedProjectReferences_1 = resolvedProjectReferences; _i < resolvedProjectReferences_1.length; _i++) { var parsedRef = resolvedProjectReferences_1[_i]; @@ -98631,8 +99038,8 @@ var ts; var out = parsedRef.commandLine.options.outFile || parsedRef.commandLine.options.out; if (useSourceOfProjectReferenceRedirect) { if (out || ts.getEmitModuleKind(parsedRef.commandLine.options) === ts.ModuleKind.None) { - for (var _a = 0, _b = parsedRef.commandLine.fileNames; _a < _b.length; _a++) { - var fileName = _b[_a]; + for (var _b = 0, _c = parsedRef.commandLine.fileNames; _b < _c.length; _b++) { + var fileName = _c[_b]; processSourceFile(fileName, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined); } } @@ -98642,8 +99049,8 @@ var ts; processSourceFile(ts.changeExtension(out, ".d.ts"), /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined); } else if (ts.getEmitModuleKind(parsedRef.commandLine.options) === ts.ModuleKind.None) { - for (var _c = 0, _d = parsedRef.commandLine.fileNames; _c < _d.length; _c++) { - var fileName = _d[_c]; + for (var _d = 0, _e = parsedRef.commandLine.fileNames; _d < _e.length; _d++) { + var fileName = _e[_d]; if (!ts.fileExtensionIs(fileName, ".d.ts" /* Dts */) && !ts.fileExtensionIs(fileName, ".json" /* Json */)) { processSourceFile(ts.getOutputDeclarationFileName(fileName, parsedRef.commandLine, !host.useCaseSensitiveFileNames()), /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined); } @@ -98695,8 +99102,8 @@ var ts; // not part of the new program. if (oldProgram && host.onReleaseOldSourceFile) { var oldSourceFiles = oldProgram.getSourceFiles(); - for (var _e = 0, oldSourceFiles_1 = oldSourceFiles; _e < oldSourceFiles_1.length; _e++) { - var oldSourceFile = oldSourceFiles_1[_e]; + for (var _f = 0, oldSourceFiles_1 = oldSourceFiles; _f < oldSourceFiles_1.length; _f++) { + var oldSourceFile = oldSourceFiles_1[_f]; var newFile = getSourceFileByPath(oldSourceFile.resolvedPath); if (shouldCreateNewSourceFile || !newFile || // old file wasnt redirect but new file is @@ -98761,8 +99168,10 @@ var ts; forEachResolvedProjectReference: forEachResolvedProjectReference, isSourceOfProjectReferenceRedirect: isSourceOfProjectReferenceRedirect, emitBuildInfo: emitBuildInfo, - getProbableSymlinks: getProbableSymlinks + getProbableSymlinks: getProbableSymlinks, + useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); }, }; + onProgramCreateComplete(); verifyCompilerOptions(); ts.performance.mark("afterProgram"); ts.performance.measure("Program", "beforeProgram", "afterProgram"); @@ -99008,12 +99417,6 @@ var ts; } if (projectReferences) { resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); - if (host.setResolvedProjectReferenceCallbacks) { - host.setResolvedProjectReferenceCallbacks({ - getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, - forEachResolvedProjectReference: forEachResolvedProjectReference - }); - } } // check if program source files has changed in the way that can affect structure of the program var newSourceFiles = []; @@ -99337,19 +99740,19 @@ var ts; } var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName); var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName); - var diagnostics; - for (var _i = 0, _a = [fileProcessingDiagnosticsInFile, programDiagnosticsInFile]; _i < _a.length; _i++) { - var diags = _a[_i]; - if (diags) { - for (var _b = 0, diags_4 = diags; _b < diags_4.length; _b++) { - var diag = diags_4[_b]; - if (shouldReportDiagnostic(diag)) { - diagnostics = ts.append(diagnostics, diag); - } - } - } + return getMergedProgramDiagnostics(sourceFile, fileProcessingDiagnosticsInFile, programDiagnosticsInFile); + } + function getMergedProgramDiagnostics(sourceFile) { + var allDiagnostics = []; + for (var _i = 1; _i < arguments.length; _i++) { + allDiagnostics[_i - 1] = arguments[_i]; } - return diagnostics || ts.emptyArray; + var _a; + var flatDiagnostics = ts.flatten(allDiagnostics); + if (!((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { + return flatDiagnostics; + } + return getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics).diagnostics; } function getDeclarationDiagnostics(sourceFile, cancellationToken) { var options = program.getCompilerOptions(); @@ -99413,49 +99816,66 @@ var ts; sourceFile.scriptKind === 5 /* External */ || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */); var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray; var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray; - var diagnostics; - for (var _i = 0, _a = [bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined]; _i < _a.length; _i++) { - var diags = _a[_i]; - if (diags) { - for (var _b = 0, diags_5 = diags; _b < diags_5.length; _b++) { - var diag = diags_5[_b]; - if (shouldReportDiagnostic(diag)) { - diagnostics = ts.append(diagnostics, diag); - } - } - } - } - return diagnostics || ts.emptyArray; + return getMergedBindAndCheckDiagnostics(sourceFile, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined); }); } + function getMergedBindAndCheckDiagnostics(sourceFile) { + var allDiagnostics = []; + for (var _i = 1; _i < arguments.length; _i++) { + allDiagnostics[_i - 1] = arguments[_i]; + } + var _a; + var flatDiagnostics = ts.flatten(allDiagnostics); + if (!((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { + return flatDiagnostics; + } + var _b = getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics), diagnostics = _b.diagnostics, directives = _b.directives; + for (var _c = 0, _d = directives.getUnusedExpectations(); _c < _d.length; _c++) { + var errorExpectation = _d[_c]; + diagnostics.push(ts.createDiagnosticForRange(sourceFile, errorExpectation.range, ts.Diagnostics.Unused_ts_expect_error_directive)); + } + return diagnostics; + } + /** + * Creates a map of comment directives along with the diagnostics immediately preceded by one of them. + * Comments that match to any of those diagnostics are marked as used. + */ + function getDiagnosticsWithPrecedingDirectives(sourceFile, commentDirectives, flatDiagnostics) { + // Diagnostics are only reported if there is no comment directive preceding them + // This will modify the directives map by marking "used" ones with a corresponding diagnostic + var directives = ts.createCommentDirectivesMap(sourceFile, commentDirectives); + var diagnostics = flatDiagnostics.filter(function (diagnostic) { return markPrecedingCommentDirectiveLine(diagnostic, directives) === -1; }); + return { diagnostics: diagnostics, directives: directives }; + } function getSuggestionDiagnostics(sourceFile, cancellationToken) { return runWithCancellationToken(function () { return getDiagnosticsProducingTypeChecker().getSuggestionDiagnostics(sourceFile, cancellationToken); }); } /** - * Skip errors if previous line start with '// @ts-ignore' comment, not counting non-empty non-comment lines + * @returns The line index marked as preceding the diagnostic, or -1 if none was. */ - function shouldReportDiagnostic(diagnostic) { + function markPrecedingCommentDirectiveLine(diagnostic, directives) { var file = diagnostic.file, start = diagnostic.start; - if (file) { - var lineStarts = ts.getLineStarts(file); - var line = ts.computeLineAndCharacterOfPosition(lineStarts, start).line; // TODO: GH#18217 - while (line > 0) { - var previousLineText = file.text.slice(lineStarts[line - 1], lineStarts[line]); - var result = ignoreDiagnosticCommentRegEx.exec(previousLineText); - if (!result) { - // non-empty line - return true; - } - if (result[3]) { - // @ts-ignore - return false; - } - line--; + if (!file) { + return -1; + } + // Start out with the line just before the text + var lineStarts = ts.getLineStarts(file); + var line = ts.computeLineAndCharacterOfPosition(lineStarts, start).line - 1; // TODO: GH#18217 + while (line >= 0) { + // As soon as that line is known to have a comment directive, use that + if (directives.markUsed(line)) { + return line; + } + // Stop searching if the line is not empty and not a comment + var lineText = file.text.slice(lineStarts[line - 1], lineStarts[line]).trim(); + if (lineText !== "" && !/^(\s*)\/\/(.*)$/.test(lineText)) { + return -1; } + line--; } - return true; + return -1; } function getJSSyntacticDiagnosticsForFile(sourceFile) { return runWithCancellationToken(function () { @@ -99467,22 +99887,22 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 156 /* Parameter */: - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: + case 157 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); return "skip"; } // falls through - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: - case 242 /* VariableDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: + case 243 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); @@ -99490,58 +99910,58 @@ var ts; } } switch (node.kind) { - case 255 /* ImportClause */: + case 256 /* ImportClause */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node.parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); return "skip"; } break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); return "skip"; } break; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_TypeScript_files)); return "skip"; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 113 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: var interfaceKeyword = ts.tokenToString(114 /* InterfaceKeyword */); ts.Debug.assertIsDefined(interfaceKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); return "skip"; - case 249 /* ModuleDeclaration */: - var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(136 /* NamespaceKeyword */) : ts.tokenToString(135 /* ModuleKeyword */); + case 250 /* ModuleDeclaration */: + var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(137 /* NamespaceKeyword */) : ts.tokenToString(136 /* ModuleKeyword */); ts.Debug.assertIsDefined(moduleKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); return "skip"; - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); return "skip"; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: var enumKeyword = ts.Debug.checkDefined(ts.tokenToString(88 /* EnumKeyword */)); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); return "skip"; - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 217 /* AsExpression */: + case 218 /* AsExpression */: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } } @@ -99550,29 +99970,29 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); } switch (parent.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } // falls through - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - checkModifiers(parent.modifiers, parent.kind === 225 /* VariableStatement */); + checkModifiers(parent.modifiers, parent.kind === 226 /* VariableStatement */); return "skip"; } break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -99584,19 +100004,19 @@ var ts; return "skip"; } break; - case 156 /* Parameter */: + case 157 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 216 /* ExpressionWithTypeArguments */: - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: - case 198 /* TaggedTemplateExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 217 /* ExpressionWithTypeArguments */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 199 /* TaggedTemplateExpression */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); @@ -99618,8 +100038,8 @@ var ts; case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - case 138 /* ReadonlyKeyword */: - case 130 /* DeclareKeyword */: + case 139 /* ReadonlyKeyword */: + case 131 /* DeclareKeyword */: case 122 /* AbstractKeyword */: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind))); break; @@ -100861,6 +101281,155 @@ var ts; } } ts.createProgram = createProgram; + function updateHostForUseSourceOfProjectReferenceRedirect(host) { + var mapOfDeclarationDirectories; + var symlinkedDirectories; + var symlinkedFiles; + var originalFileExists = host.compilerHost.fileExists; + var originalDirectoryExists = host.compilerHost.directoryExists; + var originalGetDirectories = host.compilerHost.getDirectories; + var originalRealpath = host.compilerHost.realpath; + if (!host.useSourceOfProjectReferenceRedirect) + return ts.noop; + // This implementation of fileExists checks if the file being requested is + // .d.ts file for the referenced Project. + // If it is it returns true irrespective of whether that file exists on host + host.compilerHost.fileExists = function (file) { + if (originalFileExists.call(host.compilerHost, file)) + return true; + if (!host.getResolvedProjectReferences()) + return false; + if (!ts.isDeclarationFileName(file)) + return false; + // Project references go to source file instead of .d.ts file + return fileOrDirectoryExistsUsingSource(file, /*isFile*/ true); + }; + if (originalDirectoryExists) { + // This implementation of directoryExists checks if the directory being requested is + // directory of .d.ts file for the referenced Project. + // If it is it returns true irrespective of whether that directory exists on host + host.compilerHost.directoryExists = function (path) { + if (originalDirectoryExists.call(host.compilerHost, path)) { + handleDirectoryCouldBeSymlink(path); + return true; + } + if (!host.getResolvedProjectReferences()) + return false; + if (!mapOfDeclarationDirectories) { + mapOfDeclarationDirectories = ts.createMap(); + host.forEachResolvedProjectReference(function (ref) { + if (!ref) + return; + var out = ref.commandLine.options.outFile || ref.commandLine.options.out; + if (out) { + mapOfDeclarationDirectories.set(ts.getDirectoryPath(host.toPath(out)), true); + } + else { + // Set declaration's in different locations only, if they are next to source the directory present doesnt change + var declarationDir = ref.commandLine.options.declarationDir || ref.commandLine.options.outDir; + if (declarationDir) { + mapOfDeclarationDirectories.set(host.toPath(declarationDir), true); + } + } + }); + } + return fileOrDirectoryExistsUsingSource(path, /*isFile*/ false); + }; + } + if (originalGetDirectories) { + // Call getDirectories only if directory actually present on the host + // This is needed to ensure that we arent getting directories that we fake about presence for + host.compilerHost.getDirectories = function (path) { + return !host.getResolvedProjectReferences() || (originalDirectoryExists && originalDirectoryExists.call(host.compilerHost, path)) ? + originalGetDirectories.call(host.compilerHost, path) : + []; + }; + } + // This is something we keep for life time of the host + if (originalRealpath) { + host.compilerHost.realpath = function (s) { + return (symlinkedFiles === null || symlinkedFiles === void 0 ? void 0 : symlinkedFiles.get(host.toPath(s))) || + originalRealpath.call(host.compilerHost, s); + }; + } + return onProgramCreateComplete; + function onProgramCreateComplete() { + host.compilerHost.fileExists = originalFileExists; + host.compilerHost.directoryExists = originalDirectoryExists; + host.compilerHost.getDirectories = originalGetDirectories; + // DO not revert realpath as it could be used later + } + function fileExistsIfProjectReferenceDts(file) { + var source = host.getSourceOfProjectReferenceRedirect(file); + return source !== undefined ? + ts.isString(source) ? originalFileExists.call(host.compilerHost, source) : true : + undefined; + } + function directoryExistsIfProjectReferenceDeclDir(dir) { + var dirPath = host.toPath(dir); + var dirPathWithTrailingDirectorySeparator = "" + dirPath + ts.directorySeparator; + return ts.forEachKey(mapOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath || + // Any parent directory of declaration dir + ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) || + // Any directory inside declaration dir + ts.startsWith(dirPath, declDirPath + "/"); }); + } + function handleDirectoryCouldBeSymlink(directory) { + if (!host.getResolvedProjectReferences()) + return; + // Because we already watch node_modules, handle symlinks in there + if (!originalRealpath || !ts.stringContains(directory, ts.nodeModulesPathPart)) + return; + if (!symlinkedDirectories) + symlinkedDirectories = ts.createMap(); + var directoryPath = ts.ensureTrailingDirectorySeparator(host.toPath(directory)); + if (symlinkedDirectories.has(directoryPath)) + return; + var real = ts.normalizePath(originalRealpath.call(host.compilerHost, directory)); + var realPath; + if (real === directory || + (realPath = ts.ensureTrailingDirectorySeparator(host.toPath(real))) === directoryPath) { + // not symlinked + symlinkedDirectories.set(directoryPath, false); + return; + } + symlinkedDirectories.set(directoryPath, { + real: ts.ensureTrailingDirectorySeparator(real), + realPath: realPath + }); + } + function fileOrDirectoryExistsUsingSource(fileOrDirectory, isFile) { + var fileOrDirectoryExistsUsingSource = isFile ? + function (file) { return fileExistsIfProjectReferenceDts(file); } : + function (dir) { return directoryExistsIfProjectReferenceDeclDir(dir); }; + // Check current directory or file + var result = fileOrDirectoryExistsUsingSource(fileOrDirectory); + if (result !== undefined) + return result; + if (!symlinkedDirectories) + return false; + var fileOrDirectoryPath = host.toPath(fileOrDirectory); + if (!ts.stringContains(fileOrDirectoryPath, ts.nodeModulesPathPart)) + return false; + if (isFile && symlinkedFiles && symlinkedFiles.has(fileOrDirectoryPath)) + return true; + // If it contains node_modules check if its one of the symlinked path we know of + return ts.firstDefinedIterator(symlinkedDirectories.entries(), function (_a) { + var directoryPath = _a[0], symlinkedDirectory = _a[1]; + if (!symlinkedDirectory || !ts.startsWith(fileOrDirectoryPath, directoryPath)) + return undefined; + var result = fileOrDirectoryExistsUsingSource(fileOrDirectoryPath.replace(directoryPath, symlinkedDirectory.realPath)); + if (isFile && result) { + if (!symlinkedFiles) + symlinkedFiles = ts.createMap(); + // Store the real path for the file' + var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory()); + symlinkedFiles.set(fileOrDirectoryPath, "" + symlinkedDirectory.real + absolutePath.replace(new RegExp(directoryPath, "i"), "")); + } + return result; + }) || false; + } + } /*@internal*/ function handleNoEmitOptions(program, sourceFile, cancellationToken) { var options = program.getCompilerOptions(); @@ -101481,6 +102050,7 @@ var ts; state.affectedFilesPendingEmit = oldState.affectedFilesPendingEmit.slice(); state.affectedFilesPendingEmitKind = ts.cloneMapOrUndefined(oldState.affectedFilesPendingEmitKind); state.affectedFilesPendingEmitIndex = oldState.affectedFilesPendingEmitIndex; + state.seenAffectedFiles = ts.createMap(); } } // Update changed files and copy semantic diagnostics if we can @@ -101526,8 +102096,8 @@ var ts; if (oldCompilerOptions && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) { // Add all files to affectedFilesPendingEmit since emit changed newProgram.getSourceFiles().forEach(function (f) { return addToAffectedFilesPendingEmit(state, f.resolvedPath, 1 /* Full */); }); - ts.Debug.assert(state.seenAffectedFiles === undefined); - state.seenAffectedFiles = ts.createMap(); + ts.Debug.assert(!state.seenAffectedFiles || !state.seenAffectedFiles.size); + state.seenAffectedFiles = state.seenAffectedFiles || ts.createMap(); } state.emittedBuildInfo = !state.changedFilesSet.size && !state.affectedFilesPendingEmit; return state; @@ -102407,13 +102977,13 @@ var ts; return true; } ts.canWatchDirectory = canWatchDirectory; - ts.maxNumberOfFilesToIterateForInvalidation = 256; function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) { var filesWithChangedSetOfUnresolvedImports; var filesWithInvalidatedResolutions; var filesWithInvalidatedNonRelativeUnresolvedImports; - var allFilesHaveInvalidatedResolution = false; var nonRelativeExternalModuleResolutions = ts.createMultiMap(); + var resolutionsWithFailedLookups = []; + var resolvedFileToResolution = ts.createMultiMap(); var getCurrentDirectory = ts.memoize(function () { return resolutionHost.getCurrentDirectory(); }); // TODO: GH#18217 var cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost(); // The resolvedModuleNames and resolvedTypeReferenceDirectives are the cache of resolutions per file. @@ -102477,7 +103047,8 @@ var ts; closeTypeRootsWatch(); resolvedModuleNames.clear(); resolvedTypeReferenceDirectives.clear(); - allFilesHaveInvalidatedResolution = false; + resolvedFileToResolution.clear(); + resolutionsWithFailedLookups.length = 0; // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update // (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution) clearPerDirectoryResolutions(); @@ -102499,7 +103070,7 @@ var ts; return !!value && !!value.length; } function createHasInvalidatedResolution(forceAllFilesAsInvalidated) { - if (allFilesHaveInvalidatedResolution || forceAllFilesAsInvalidated) { + if (forceAllFilesAsInvalidated) { // Any file asked would have invalidated resolution filesWithInvalidatedResolutions = undefined; return ts.returnTrue; @@ -102517,7 +103088,6 @@ var ts; nonRelativeExternalModuleResolutions.clear(); } function finishCachingPerDirectoryResolution() { - allFilesHaveInvalidatedResolution = false; filesWithInvalidatedNonRelativeUnresolvedImports = undefined; clearPerDirectoryResolutions(); directoryWatchesOfFailedLookups.forEach(function (watcher, path) { @@ -102528,6 +103098,7 @@ var ts; }); } function resolveModuleName(moduleName, containingFile, compilerOptions, host, redirectedReference) { + var _a; var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference); // return result immediately only if global cache support is not enabled or if it is .ts, .tsx or .d.ts if (!resolutionHost.getGlobalCache) { @@ -102538,15 +103109,20 @@ var ts; if (globalCache !== undefined && !ts.isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && ts.extensionIsTS(primaryResult.resolvedModule.extension))) { // create different collection of failed lookup locations for second pass // if it will fail and we've already found something during the first pass - we don't want to pollute its results - var _a = ts.loadModuleFromGlobalCache(ts.Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName), resolutionHost.projectName, compilerOptions, host, globalCache), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations; + var _b = ts.loadModuleFromGlobalCache(ts.Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName), resolutionHost.projectName, compilerOptions, host, globalCache), resolvedModule = _b.resolvedModule, failedLookupLocations = _b.failedLookupLocations; if (resolvedModule) { - return { resolvedModule: resolvedModule, failedLookupLocations: ts.addRange(primaryResult.failedLookupLocations, failedLookupLocations) }; + // Modify existing resolution so its saved in the directory cache as well + primaryResult.resolvedModule = resolvedModule; + (_a = primaryResult.failedLookupLocations).push.apply(_a, failedLookupLocations); + return primaryResult; } } // Default return the result from the first pass return primaryResult; } - function resolveNamesWithLocalCache(names, containingFile, redirectedReference, cache, perDirectoryCacheWithRedirects, loader, getResolutionWithResolvedFileName, shouldRetryResolution, reusedNames, logChanges) { + function resolveNamesWithLocalCache(_a) { + var names = _a.names, containingFile = _a.containingFile, redirectedReference = _a.redirectedReference, cache = _a.cache, perDirectoryCacheWithRedirects = _a.perDirectoryCacheWithRedirects, loader = _a.loader, getResolutionWithResolvedFileName = _a.getResolutionWithResolvedFileName, shouldRetryResolution = _a.shouldRetryResolution, reusedNames = _a.reusedNames, logChanges = _a.logChanges; + var _b; var path = resolutionHost.toPath(containingFile); var resolutionsInFile = cache.get(path) || cache.set(path, ts.createMap()).get(path); var dirPath = ts.getDirectoryPath(path); @@ -102571,7 +103147,7 @@ var ts; var resolution = resolutionsInFile.get(name); // Resolution is valid if it is present and not invalidated if (!seenNamesInFile.has(name) && - allFilesHaveInvalidatedResolution || unmatchedRedirects || !resolution || resolution.isInvalidated || + unmatchedRedirects || !resolution || resolution.isInvalidated || // If the name is unresolved import that was invalidated, recalculate (hasInvalidatedNonRelativeUnresolvedImport && !ts.isExternalModuleNameRelative(name) && shouldRetryResolution(resolution))) { var existingResolution = resolution; @@ -102580,13 +103156,13 @@ var ts; resolution = resolutionInDirectory; } else { - resolution = loader(name, containingFile, compilerOptions, resolutionHost, redirectedReference); + resolution = loader(name, containingFile, compilerOptions, ((_b = resolutionHost.getCompilerHost) === null || _b === void 0 ? void 0 : _b.call(resolutionHost)) || resolutionHost, redirectedReference); perDirectoryResolution.set(name, resolution); } resolutionsInFile.set(name, resolution); - watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution); + watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName); if (existingResolution) { - stopWatchFailedLookupLocationOfResolution(existingResolution); + stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName); } if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) { filesWithChangedSetOfUnresolvedImports.push(path); @@ -102601,7 +103177,7 @@ var ts; // Stop watching and remove the unused name resolutionsInFile.forEach(function (resolution, name) { if (!seenNamesInFile.has(name) && !ts.contains(reusedNames, name)) { - stopWatchFailedLookupLocationOfResolution(resolution); + stopWatchFailedLookupLocationOfResolution(resolution, path, getResolutionWithResolvedFileName); resolutionsInFile.delete(name); } }); @@ -102625,21 +103201,35 @@ var ts; } } function resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference) { - return resolveNamesWithLocalCache(typeDirectiveNames, containingFile, redirectedReference, resolvedTypeReferenceDirectives, perDirectoryResolvedTypeReferenceDirectives, ts.resolveTypeReferenceDirective, getResolvedTypeReferenceDirective, - /*shouldRetryResolution*/ function (resolution) { return resolution.resolvedTypeReferenceDirective === undefined; }, - /*reusedNames*/ undefined, /*logChanges*/ false); + return resolveNamesWithLocalCache({ + names: typeDirectiveNames, + containingFile: containingFile, + redirectedReference: redirectedReference, + cache: resolvedTypeReferenceDirectives, + perDirectoryCacheWithRedirects: perDirectoryResolvedTypeReferenceDirectives, + loader: ts.resolveTypeReferenceDirective, + getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective, + shouldRetryResolution: function (resolution) { return resolution.resolvedTypeReferenceDirective === undefined; }, + }); } function resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference) { - return resolveNamesWithLocalCache(moduleNames, containingFile, redirectedReference, resolvedModuleNames, perDirectoryResolvedModuleNames, resolveModuleName, getResolvedModule, - /*shouldRetryResolution*/ function (resolution) { return !resolution.resolvedModule || !ts.resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension); }, reusedNames, logChangesWhenResolvingModule); + return resolveNamesWithLocalCache({ + names: moduleNames, + containingFile: containingFile, + redirectedReference: redirectedReference, + cache: resolvedModuleNames, + perDirectoryCacheWithRedirects: perDirectoryResolvedModuleNames, + loader: resolveModuleName, + getResolutionWithResolvedFileName: getResolvedModule, + shouldRetryResolution: function (resolution) { return !resolution.resolvedModule || !ts.resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension); }, + reusedNames: reusedNames, + logChanges: logChangesWhenResolvingModule + }); } function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName, containingFile) { var cache = resolvedModuleNames.get(resolutionHost.toPath(containingFile)); return cache && cache.get(moduleName); } - function isNodeModulesDirectory(dirPath) { - return ts.endsWith(dirPath, "/node_modules"); - } function isNodeModulesAtTypesDirectory(dirPath) { return ts.endsWith(dirPath, "/node_modules/@types"); } @@ -102675,7 +103265,7 @@ var ts; dirPath = ts.getDirectoryPath(dirPath); } // If the directory is node_modules use it to watch, always watch it recursively - if (isNodeModulesDirectory(dirPath)) { + if (ts.isNodeModulesDirectory(dirPath)) { return canWatchDirectory(ts.getDirectoryPath(dirPath)) ? { dir: dir, dirPath: dirPath } : undefined; } var nonRecursive = true; @@ -102699,26 +103289,33 @@ var ts; function isPathWithDefaultFailedLookupExtension(path) { return ts.fileExtensionIsOneOf(path, failedLookupDefaultExtensions); } - function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution) { - // No need to set the resolution refCount - if (resolution.failedLookupLocations && resolution.failedLookupLocations.length) { - if (resolution.refCount) { - resolution.refCount++; + function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName) { + if (resolution.refCount) { + resolution.refCount++; + ts.Debug.assertDefined(resolution.files); + } + else { + resolution.refCount = 1; + ts.Debug.assert(resolution.files === undefined); + if (ts.isExternalModuleNameRelative(name)) { + watchFailedLookupLocationOfResolution(resolution); } else { - resolution.refCount = 1; - if (ts.isExternalModuleNameRelative(name)) { - watchFailedLookupLocationOfResolution(resolution); - } - else { - nonRelativeExternalModuleResolutions.add(name, resolution); - } + nonRelativeExternalModuleResolutions.add(name, resolution); + } + var resolved = getResolutionWithResolvedFileName(resolution); + if (resolved && resolved.resolvedFileName) { + resolvedFileToResolution.add(resolutionHost.toPath(resolved.resolvedFileName), resolution); } } + (resolution.files || (resolution.files = [])).push(filePath); } function watchFailedLookupLocationOfResolution(resolution) { ts.Debug.assert(!!resolution.refCount); var failedLookupLocations = resolution.failedLookupLocations; + if (!failedLookupLocations.length) + return; + resolutionsWithFailedLookups.push(resolution); var setAtRoot = false; for (var _i = 0, failedLookupLocations_1 = failedLookupLocations; _i < failedLookupLocations_1.length; _i++) { var failedLookupLocation = failedLookupLocations_1[_i]; @@ -102746,14 +103343,11 @@ var ts; setDirectoryWatcher(rootDir, rootPath, /*nonRecursive*/ true); // TODO: GH#18217 } } - function setRefCountToUndefined(resolution) { - resolution.refCount = undefined; - } function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name) { var program = resolutionHost.getCurrentProgram(); - var updateResolution = program && program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name) ? - setRefCountToUndefined : watchFailedLookupLocationOfResolution; - resolutions.forEach(updateResolution); + if (!program || !program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name)) { + resolutions.forEach(watchFailedLookupLocationOfResolution); + } } function setDirectoryWatcher(dir, dirPath, nonRecursive) { var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); @@ -102765,14 +103359,20 @@ var ts; directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath, nonRecursive), refCount: 1, nonRecursive: nonRecursive }); } } - function stopWatchFailedLookupLocationOfResolution(resolution) { - if (!resolution.refCount) { - return; - } + function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName) { + ts.unorderedRemoveItem(ts.Debug.assertDefined(resolution.files), filePath); resolution.refCount--; if (resolution.refCount) { return; } + var resolved = getResolutionWithResolvedFileName(resolution); + if (resolved && resolved.resolvedFileName) { + resolvedFileToResolution.remove(resolutionHost.toPath(resolved.resolvedFileName), resolution); + } + if (!ts.unorderedRemoveItem(resolutionsWithFailedLookups, resolution)) { + // If not watching failed lookups, it wont be there in resolutionsWithFailedLookups + return; + } var failedLookupLocations = resolution.failedLookupLocations; var removeAtRoot = false; for (var _i = 0, failedLookupLocations_2 = failedLookupLocations; _i < failedLookupLocations_2.length; _i++) { @@ -102815,16 +103415,16 @@ var ts; // Since the file existence changed, update the sourceFiles cache cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); } - if (!allFilesHaveInvalidatedResolution && invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath)) { + if (invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath)) { resolutionHost.onInvalidatedResolution(); } }, nonRecursive ? 0 /* None */ : 1 /* Recursive */); } - function removeResolutionsOfFileFromCache(cache, filePath) { + function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName) { // Deleted file, stop watching failed lookups for all the resolutions in the file var resolutions = cache.get(filePath); if (resolutions) { - resolutions.forEach(stopWatchFailedLookupLocationOfResolution); + resolutions.forEach(function (resolution) { return stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName); }); cache.delete(filePath); } } @@ -102845,57 +103445,26 @@ var ts; resolvedProjectReference.commandLine.fileNames.forEach(function (f) { return removeResolutionsOfFile(resolutionHost.toPath(f)); }); } function removeResolutionsOfFile(filePath) { - removeResolutionsOfFileFromCache(resolvedModuleNames, filePath); - removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath); - } - function invalidateResolutionCache(cache, isInvalidatedResolution, getResolutionWithResolvedFileName) { - var seen = ts.createMap(); - cache.forEach(function (resolutions, containingFilePath) { - var dirPath = ts.getDirectoryPath(containingFilePath); - var seenInDir = seen.get(dirPath); - if (!seenInDir) { - seenInDir = ts.createMap(); - seen.set(dirPath, seenInDir); - } - resolutions.forEach(function (resolution, name) { - if (seenInDir.has(name)) { - return; - } - seenInDir.set(name, true); - if (!resolution.isInvalidated && isInvalidatedResolution(resolution, getResolutionWithResolvedFileName)) { - // Mark the file as needing re-evaluation of module resolution instead of using it blindly. - resolution.isInvalidated = true; - (filesWithInvalidatedResolutions || (filesWithInvalidatedResolutions = ts.createMap())).set(containingFilePath, true); - // When its a file with inferred types resolution, invalidate type reference directive resolution - if (ts.endsWith(containingFilePath, ts.inferredTypesContainingFile)) { - resolutionHost.onChangedAutomaticTypeDirectiveNames(); - } - } - }); - }); - } - function hasReachedResolutionIterationLimit() { - var maxSize = resolutionHost.maxNumberOfFilesToIterateForInvalidation || ts.maxNumberOfFilesToIterateForInvalidation; - return resolvedModuleNames.size > maxSize || resolvedTypeReferenceDirectives.size > maxSize; - } - function invalidateResolutions(isInvalidatedResolution) { - // If more than maxNumberOfFilesToIterateForInvalidation present, - // just invalidated all files and recalculate the resolutions for files instead - if (hasReachedResolutionIterationLimit()) { - allFilesHaveInvalidatedResolution = true; - return; + removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule); + removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective); + } + function invalidateResolution(resolution) { + resolution.isInvalidated = true; + var changedInAutoTypeReferenced = false; + for (var _i = 0, _a = ts.Debug.assertDefined(resolution.files); _i < _a.length; _i++) { + var containingFilePath = _a[_i]; + (filesWithInvalidatedResolutions || (filesWithInvalidatedResolutions = ts.createMap())).set(containingFilePath, true); + // When its a file with inferred types resolution, invalidate type reference directive resolution + changedInAutoTypeReferenced = changedInAutoTypeReferenced || containingFilePath.endsWith(ts.inferredTypesContainingFile); + } + if (changedInAutoTypeReferenced) { + resolutionHost.onChangedAutomaticTypeDirectiveNames(); } - invalidateResolutionCache(resolvedModuleNames, isInvalidatedResolution, getResolvedModule); - invalidateResolutionCache(resolvedTypeReferenceDirectives, isInvalidatedResolution, getResolvedTypeReferenceDirective); } function invalidateResolutionOfFile(filePath) { removeResolutionsOfFile(filePath); - invalidateResolutions( // Resolution is invalidated if the resulting file name is same as the deleted file path - function (resolution, getResolutionWithResolvedFileName) { - var result = getResolutionWithResolvedFileName(resolution); - return !!result && resolutionHost.toPath(result.resolvedFileName) === filePath; // TODO: GH#18217 - }); + ts.forEach(resolvedFileToResolution.get(filePath), invalidateResolution); } function setFilesWithInvalidatedNonRelativeUnresolvedImports(filesMap) { ts.Debug.assert(filesWithInvalidatedNonRelativeUnresolvedImports === filesMap || filesWithInvalidatedNonRelativeUnresolvedImports === undefined); @@ -102921,8 +103490,8 @@ var ts; // Some file or directory in the watching directory is created // Return early if it does not have any of the watching extension or not the custom failed lookup path var dirOfFileOrDirectory = ts.getDirectoryPath(fileOrDirectoryPath); - if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || isNodeModulesDirectory(fileOrDirectoryPath) || - isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || isNodeModulesDirectory(dirOfFileOrDirectory)) { + if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || ts.isNodeModulesDirectory(fileOrDirectoryPath) || + isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || ts.isNodeModulesDirectory(dirOfFileOrDirectory)) { // Invalidate any resolution from this directory isChangedFailedLookupLocation = function (location) { var locationPath = resolutionHost.toPath(location); @@ -102941,20 +103510,21 @@ var ts; isChangedFailedLookupLocation = function (location) { return resolutionHost.toPath(location) === fileOrDirectoryPath; }; } } - var hasChangedFailedLookupLocation = function (resolution) { return ts.some(resolution.failedLookupLocations, isChangedFailedLookupLocation); }; - var invalidatedFilesCount = filesWithInvalidatedResolutions && filesWithInvalidatedResolutions.size; - invalidateResolutions( + var invalidated = false; // Resolution is invalidated if the resulting file name is same as the deleted file path - hasChangedFailedLookupLocation); - return allFilesHaveInvalidatedResolution || filesWithInvalidatedResolutions && filesWithInvalidatedResolutions.size !== invalidatedFilesCount; + for (var _i = 0, resolutionsWithFailedLookups_1 = resolutionsWithFailedLookups; _i < resolutionsWithFailedLookups_1.length; _i++) { + var resolution = resolutionsWithFailedLookups_1[_i]; + if (resolution.failedLookupLocations.some(isChangedFailedLookupLocation)) { + invalidateResolution(resolution); + invalidated = true; + } + } + return invalidated; } function closeTypeRootsWatch() { ts.clearMap(typeRootsWatches, ts.closeFileWatcher); } function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath) { - if (allFilesHaveInvalidatedResolution) { - return undefined; - } if (isInDirectoryPath(rootPath, typeRootPath)) { return rootPath; } @@ -103153,38 +103723,52 @@ var ts; function comparePathsByNumberOfDirectorySeparators(a, b) { return ts.compareValues(numberOfDirectorySeparators(a), numberOfDirectorySeparators(b)); } - /** - * Looks for existing imports that use symlinks to this module. - * Symlinks will be returned first so they are preferred over the real path. - */ - function getAllModulePaths(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap) { + function forEachFileNameOfModule(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap, preferSymlinks, cb) { var redirects = redirectTargetsMap.get(importedFileName); var importedFileNames = redirects ? __spreadArrays(redirects, [importedFileName]) : [importedFileName]; var cwd = host.getCurrentDirectory ? host.getCurrentDirectory() : ""; var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); }); + if (!preferSymlinks) { + var result_10 = ts.forEach(targets, cb); + if (result_10) + return result_10; + } var links = host.getProbableSymlinks ? host.getProbableSymlinks(files) : ts.discoverProbableSymlinks(files, getCanonicalFileName, cwd); - var result = []; var compareStrings = (!host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames()) ? ts.compareStringsCaseSensitive : ts.compareStringsCaseInsensitive; - links.forEach(function (resolved, path) { + var result = ts.forEachEntry(links, function (resolved, path) { if (ts.startsWithDirectory(importingFileName, resolved, getCanonicalFileName)) { - return; // Don't want to a package to globally import from itself + return undefined; // Don't want to a package to globally import from itself } var target = ts.find(targets, function (t) { return compareStrings(t.slice(0, resolved.length + 1), resolved + "/") === 0 /* EqualTo */; }); if (target === undefined) - return; + return undefined; var relative = ts.getRelativePathFromDirectory(resolved, target, getCanonicalFileName); var option = ts.resolvePath(path, relative); if (!host.fileExists || host.fileExists(option)) { - result.push(option); + var result_11 = cb(option); + if (result_11) + return result_11; } }); - result.push.apply(result, targets); - if (result.length < 2) - return result; + return result || + (preferSymlinks ? ts.forEach(targets, cb) : undefined); + } + moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule; + /** + * Looks for existing imports that use symlinks to this module. + * Symlinks will be returned first so they are preferred over the real path. + */ + function getAllModulePaths(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap) { + var cwd = host.getCurrentDirectory ? host.getCurrentDirectory() : ""; + var allFileNames = ts.createMap(); + forEachFileNameOfModule(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap, + /*preferSymlinks*/ true, function (path) { + // dont return value, so we collect everything + allFileNames.set(path, getCanonicalFileName(path)); + }); // Sort by paths closest to importing file Name directory - var allFileNames = ts.arrayToMap(result, ts.identity, getCanonicalFileName); var sortedPaths = []; var _loop_18 = function (directory) { var directoryStart = ts.ensureTrailingDirectorySeparator(directory); @@ -103719,10 +104303,6 @@ var ts; */ function createProgramHost(system, createProgram) { var getDefaultLibLocation = ts.memoize(function () { return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath())); }); - var host = system; - // TODO: `host` is unused! - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - host; return { useCaseSensitiveFileNames: function () { return system.useCaseSensitiveFileNames; }, getNewLine: function () { return system.newLine; }, @@ -103739,7 +104319,6 @@ var ts; trace: function (s) { return system.write(s + system.newLine); }, createDirectory: function (path) { return system.createDirectory(path); }, writeFile: function (path, data, writeByteOrderMark) { return system.writeFile(path, data, writeByteOrderMark); }, - onCachedDirectoryStructureHostCreate: function (cacheHost) { return host = cacheHost || system; }, createHash: ts.maybeBind(system, system.createHash), createProgram: createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram }; @@ -103867,9 +104446,6 @@ var ts; var canConfigFileJsonReportNoInputFiles = false; var hasChangedConfigFileParsingErrors = false; var cachedDirectoryStructureHost = configFileName === undefined ? undefined : ts.createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames); - if (cachedDirectoryStructureHost && host.onCachedDirectoryStructureHostCreate) { - host.onCachedDirectoryStructureHostCreate(cachedDirectoryStructureHost); - } var directoryStructureHost = cachedDirectoryStructureHost || host; var parseConfigFileHost = ts.parseConfigHostFromCompilerHostLike(host, directoryStructureHost); // From tsc we want to get already parsed result and hence check for rootFileNames @@ -103910,6 +104486,7 @@ var ts; // Members for ResolutionCacheHost compilerHost.toPath = toPath; compilerHost.getCompilationSettings = function () { return compilerOptions; }; + compilerHost.useSourceOfProjectReferenceRedirect = ts.maybeBind(host, host.useSourceOfProjectReferenceRedirect); compilerHost.watchDirectoryOfFailedLookupLocation = function (dir, cb, flags) { return watchDirectory(host, dir, cb, flags, watchOptions, ts.WatchType.FailedLookupLocations); }; compilerHost.watchTypeRootsDirectory = function (dir, cb, flags) { return watchDirectory(host, dir, cb, flags, watchOptions, ts.WatchType.TypeRoots); }; compilerHost.getCachedDirectoryStructureHost = function () { return cachedDirectoryStructureHost; }; @@ -103919,7 +104496,6 @@ var ts; scheduleProgramUpdate(); }; compilerHost.fileIsOpen = ts.returnFalse; - compilerHost.maxNumberOfFilesToIterateForInvalidation = host.maxNumberOfFilesToIterateForInvalidation; compilerHost.getCurrentProgram = getCurrentProgram; compilerHost.writeLog = writeLog; // Cache for the module resolution @@ -103952,8 +104528,8 @@ var ts; // Update the wild card directory watch watchConfigFileWildCardDirectories(); return configFileName ? - { getCurrentProgram: getCurrentBuilderProgram, getProgram: synchronizeProgram, close: close } : - { getCurrentProgram: getCurrentBuilderProgram, getProgram: synchronizeProgram, updateRootFileNames: updateRootFileNames, close: close }; + { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close: close } : + { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames: updateRootFileNames, close: close }; function close() { resolutionCache.clear(); ts.clearMap(sourceFilesCache, function (value) { @@ -104001,7 +104577,7 @@ var ts; else { createNewProgram(hasInvalidatedResolution); } - if (host.afterProgramCreate) { + if (host.afterProgramCreate && program !== builderProgram) { host.afterProgramCreate(builderProgram); } return builderProgram; @@ -104017,6 +104593,7 @@ var ts; resolutionCache.startCachingPerDirectoryResolution(); compilerHost.hasInvalidatedResolution = hasInvalidatedResolution; compilerHost.hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames; + hasChangedAutomaticTypeDirectiveNames = false; builderProgram = createProgram(rootFileNames, compilerOptions, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences); resolutionCache.finishCachingPerDirectoryResolution(); // Update watches @@ -104061,7 +104638,7 @@ var ts; // If file is missing on host from cache, we can definitely say file doesnt exist // otherwise we need to ensure from the disk if (isFileMissingOnHost(sourceFilesCache.get(path))) { - return true; + return false; } return directoryStructureHost.fileExists(fileName); } @@ -104158,16 +104735,19 @@ var ts; host.clearTimeout(timerToUpdateProgram); } writeLog("Scheduling update"); - timerToUpdateProgram = host.setTimeout(updateProgram, 250); + timerToUpdateProgram = host.setTimeout(updateProgramWithWatchStatus, 250); } function scheduleProgramReload() { ts.Debug.assert(!!configFileName); reloadLevel = ts.ConfigFileProgramReloadLevel.Full; scheduleProgramUpdate(); } - function updateProgram() { + function updateProgramWithWatchStatus() { timerToUpdateProgram = undefined; reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation); + updateProgram(); + } + function updateProgram() { switch (reloadLevel) { case ts.ConfigFileProgramReloadLevel.Partial: ts.perfLogger.logStartUpdateProgram("PartialConfigReload"); @@ -104183,6 +104763,7 @@ var ts; break; } ts.perfLogger.logStopUpdateProgram("Done"); + return getCurrentBuilderProgram(); } function reloadFileNamesFromConfigFile() { writeLog("Reloading new file names and options"); @@ -106257,6 +106838,7 @@ var ts; placeOpenBraceOnNewLineForFunctions: false, placeOpenBraceOnNewLineForControlBlocks: false, semicolons: SemicolonPreference.Ignore, + trimTrailingWhitespace: true }; } ts.getDefaultFormatCodeSettings = getDefaultFormatCodeSettings; @@ -106487,37 +107069,37 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ts.isInJSFile(node) && ts.getJSDocEnumTag(node) ? 7 /* All */ : 1 /* Value */; - case 156 /* Parameter */: - case 191 /* BindingElement */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 280 /* CatchClause */: - case 273 /* JsxAttribute */: + case 157 /* Parameter */: + case 192 /* BindingElement */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 281 /* CatchClause */: + case 274 /* JsxAttribute */: return 1 /* Value */; - case 155 /* TypeParameter */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 173 /* TypeLiteral */: + case 156 /* TypeParameter */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 174 /* TypeLiteral */: return 2 /* Type */; - case 322 /* JSDocTypedefTag */: + case 323 /* JSDocTypedefTag */: // If it has no name node, it shares the name with the value declaration below it. return node.name === undefined ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */; - case 284 /* EnumMember */: - case 245 /* ClassDeclaration */: + case 285 /* EnumMember */: + case 246 /* ClassDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } @@ -106527,16 +107109,16 @@ var ts; else { return 4 /* Namespace */; } - case 248 /* EnumDeclaration */: - case 257 /* NamedImports */: - case 258 /* ImportSpecifier */: - case 253 /* ImportEqualsDeclaration */: - case 254 /* ImportDeclaration */: - case 259 /* ExportAssignment */: - case 260 /* ExportDeclaration */: + case 249 /* EnumDeclaration */: + case 258 /* NamedImports */: + case 259 /* ImportSpecifier */: + case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 260 /* ExportAssignment */: + case 261 /* ExportDeclaration */: return 7 /* All */; // An external module can be a Value - case 290 /* SourceFile */: + case 291 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 7 /* All */; @@ -106544,10 +107126,10 @@ var ts; ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { node = getAdjustedReferenceLocation(node); - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { return 1 /* Value */; } - else if (node.parent.kind === 259 /* ExportAssignment */ || node.parent.kind === 265 /* ExternalModuleReference */) { + else if (node.parent.kind === 260 /* ExportAssignment */ || node.parent.kind === 266 /* ExternalModuleReference */) { return 7 /* All */; } else if (isInRightSideOfInternalImportEqualsDeclaration(node)) { @@ -106579,11 +107161,11 @@ var ts; // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - var name = node.kind === 153 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; - return name && name.parent.kind === 253 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; + var name = node.kind === 154 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; + return name && name.parent.kind === 254 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 153 /* QualifiedName */) { + while (node.parent.kind === 154 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -106595,27 +107177,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 153 /* QualifiedName */) { - while (root.parent && root.parent.kind === 153 /* QualifiedName */) { + if (root.parent.kind === 154 /* QualifiedName */) { + while (root.parent && root.parent.kind === 154 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 169 /* TypeReference */ && !isLastClause; + return root.parent.kind === 170 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 194 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 194 /* PropertyAccessExpression */) { + if (root.parent.kind === 195 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 195 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 216 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 279 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 217 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 280 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 245 /* ClassDeclaration */ && root.parent.parent.token === 113 /* ImplementsKeyword */) || - (decl.kind === 246 /* InterfaceDeclaration */ && root.parent.parent.token === 90 /* ExtendsKeyword */); + return (decl.kind === 246 /* ClassDeclaration */ && root.parent.parent.token === 113 /* ImplementsKeyword */) || + (decl.kind === 247 /* InterfaceDeclaration */ && root.parent.parent.token === 90 /* ExtendsKeyword */); } return false; } @@ -106626,15 +107208,15 @@ var ts; switch (node.kind) { case 104 /* ThisKeyword */: return !ts.isExpressionNode(node); - case 183 /* ThisType */: + case 184 /* ThisType */: return true; } switch (node.parent.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return true; - case 188 /* ImportType */: + case 189 /* ImportType */: return !node.parent.isTypeOf; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent); } return false; @@ -106701,7 +107283,7 @@ var ts; ts.climbPastPropertyOrElementAccess = climbPastPropertyOrElementAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 238 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 239 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -106762,22 +107344,22 @@ var ts; ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 281 /* PropertyAssignment */: - case 284 /* EnumMember */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 249 /* ModuleDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 282 /* PropertyAssignment */: + case 285 /* EnumMember */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 250 /* ModuleDeclaration */: return ts.getNameOfDeclaration(node.parent) === node; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return true; - case 187 /* LiteralType */: - return node.parent.parent.kind === 185 /* IndexedAccessType */; + case 188 /* LiteralType */: + return node.parent.parent.kind === 186 /* IndexedAccessType */; default: return false; } @@ -106801,17 +107383,17 @@ var ts; return undefined; } switch (node.kind) { - case 290 /* SourceFile */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 249 /* ModuleDeclaration */: + case 291 /* SourceFile */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 250 /* ModuleDeclaration */: return node; } } @@ -106819,54 +107401,54 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: return ts.isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return "module" /* moduleElement */; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return "class" /* classElement */; - case 246 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; - case 247 /* TypeAliasDeclaration */: - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: + case 247 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; + case 248 /* TypeAliasDeclaration */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: return "type" /* typeElement */; - case 248 /* EnumDeclaration */: return "enum" /* enumElement */; - case 242 /* VariableDeclaration */: + case 249 /* EnumDeclaration */: return "enum" /* enumElement */; + case 243 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 202 /* ArrowFunction */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return "function" /* functionElement */; - case 163 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; - case 164 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 164 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; + case 165 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: return "method" /* memberFunctionElement */; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: var initializer = node.initializer; return ts.isFunctionLike(initializer) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */; - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 282 /* ShorthandPropertyAssignment */: - case 283 /* SpreadAssignment */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 283 /* ShorthandPropertyAssignment */: + case 284 /* SpreadAssignment */: return "property" /* memberVariableElement */; - case 167 /* IndexSignature */: return "index" /* indexSignatureElement */; - case 166 /* ConstructSignature */: return "construct" /* constructSignatureElement */; - case 165 /* CallSignature */: return "call" /* callSignatureElement */; - case 162 /* Constructor */: return "constructor" /* constructorImplementationElement */; - case 155 /* TypeParameter */: return "type parameter" /* typeParameterElement */; - case 284 /* EnumMember */: return "enum member" /* enumMemberElement */; - case 156 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 253 /* ImportEqualsDeclaration */: - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: - case 256 /* NamespaceImport */: - case 262 /* NamespaceExport */: + case 168 /* IndexSignature */: return "index" /* indexSignatureElement */; + case 167 /* ConstructSignature */: return "construct" /* constructSignatureElement */; + case 166 /* CallSignature */: return "call" /* callSignatureElement */; + case 163 /* Constructor */: return "constructor" /* constructorImplementationElement */; + case 156 /* TypeParameter */: return "type parameter" /* typeParameterElement */; + case 285 /* EnumMember */: return "enum member" /* enumMemberElement */; + case 157 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; + case 254 /* ImportEqualsDeclaration */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: + case 257 /* NamespaceImport */: + case 263 /* NamespaceExport */: return "alias" /* alias */; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var kind = ts.getAssignmentDeclarationKind(node); var right = node.right; switch (kind) { @@ -106895,7 +107477,7 @@ var ts; } case 75 /* Identifier */: return ts.isImportClause(node.parent) ? "alias" /* alias */ : "" /* unknown */; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: var scriptKind = getNodeKind(node.expression); // If the expression didn't come back with something (like it does for an identifiers) return scriptKind === "" /* unknown */ ? "const" /* constElement */ : scriptKind; @@ -106918,7 +107500,7 @@ var ts; return true; case 75 /* Identifier */: // 'this' as a parameter - return ts.identifierIsThisKeyword(node) && node.parent.kind === 156 /* Parameter */; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 157 /* Parameter */; default: return false; } @@ -106983,42 +107565,42 @@ var ts; return false; } switch (n.kind) { - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 193 /* ObjectLiteralExpression */: - case 189 /* ObjectBindingPattern */: - case 173 /* TypeLiteral */: - case 223 /* Block */: - case 250 /* ModuleBlock */: - case 251 /* CaseBlock */: - case 257 /* NamedImports */: - case 261 /* NamedExports */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 194 /* ObjectLiteralExpression */: + case 190 /* ObjectBindingPattern */: + case 174 /* TypeLiteral */: + case 224 /* Block */: + case 251 /* ModuleBlock */: + case 252 /* CaseBlock */: + case 258 /* NamedImports */: + case 262 /* NamedExports */: return nodeEndsWith(n, 19 /* CloseBraceToken */, sourceFile); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 197 /* NewExpression */: + case 198 /* NewExpression */: if (!n.arguments) { return true; } // falls through - case 196 /* CallExpression */: - case 200 /* ParenthesizedExpression */: - case 182 /* ParenthesizedType */: + case 197 /* CallExpression */: + case 201 /* ParenthesizedExpression */: + case 183 /* ParenthesizedType */: return nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 166 /* ConstructSignature */: - case 165 /* CallSignature */: - case 202 /* ArrowFunction */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 167 /* ConstructSignature */: + case 166 /* CallSignature */: + case 203 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -107028,65 +107610,65 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 21 /* CloseParenToken */, sourceFile); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return !!n.body && isCompletedNode(n.body, sourceFile); - case 227 /* IfStatement */: + case 228 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 26 /* SemicolonToken */, sourceFile); - case 192 /* ArrayLiteralExpression */: - case 190 /* ArrayBindingPattern */: - case 195 /* ElementAccessExpression */: - case 154 /* ComputedPropertyName */: - case 175 /* TupleType */: + case 193 /* ArrayLiteralExpression */: + case 191 /* ArrayBindingPattern */: + case 196 /* ElementAccessExpression */: + case 155 /* ComputedPropertyName */: + case 176 /* TupleType */: return nodeEndsWith(n, 23 /* CloseBracketToken */, sourceFile); - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 23 /* CloseBracketToken */, sourceFile); - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicity always consider them non-completed return false; - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 229 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 230 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 228 /* DoStatement */: + case 229 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; return hasChildOfKind(n, 111 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 204 /* TypeOfExpression */: - case 203 /* DeleteExpression */: - case 205 /* VoidExpression */: - case 212 /* YieldExpression */: - case 213 /* SpreadElement */: + case 205 /* TypeOfExpression */: + case 204 /* DeleteExpression */: + case 206 /* VoidExpression */: + case 213 /* YieldExpression */: + case 214 /* SpreadElement */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 260 /* ExportDeclaration */: - case 254 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: return ts.nodeIsPresent(n.moduleSpecifier); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -107193,11 +107775,11 @@ var ts; function getAdjustedLocationForDeclaration(node, forRename) { if (!forRename) { switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return getAdjustedLocationForClass(node); - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return getAdjustedLocationForFunction(node); } } @@ -107292,11 +107874,11 @@ var ts; node.kind === 94 /* FunctionKeyword */ ? ts.isFunctionDeclaration(parent) || ts.isFunctionExpression(node) : node.kind === 114 /* InterfaceKeyword */ ? ts.isInterfaceDeclaration(parent) : node.kind === 88 /* EnumKeyword */ ? ts.isEnumDeclaration(parent) : - node.kind === 145 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : - node.kind === 136 /* NamespaceKeyword */ || node.kind === 135 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : + node.kind === 146 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : + node.kind === 137 /* NamespaceKeyword */ || node.kind === 136 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : node.kind === 96 /* ImportKeyword */ ? ts.isImportEqualsDeclaration(parent) : - node.kind === 131 /* GetKeyword */ ? ts.isGetAccessorDeclaration(parent) : - node.kind === 142 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { + node.kind === 132 /* GetKeyword */ ? ts.isGetAccessorDeclaration(parent) : + node.kind === 143 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { var location = getAdjustedLocationForDeclaration(parent, forRename); if (location) { return location; @@ -107310,7 +107892,7 @@ var ts; return decl.name; } } - if (node.kind === 145 /* TypeKeyword */) { + if (node.kind === 146 /* TypeKeyword */) { // import /**/type [|name|] from ...; // import /**/type { [|name|] } from ...; // import /**/type { propertyName as [|name|] } from ...; @@ -107377,12 +107959,12 @@ var ts; } } // import name = /**/require("[|module|]"); - if (node.kind === 139 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { + if (node.kind === 140 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { return parent.expression; } // import ... /**/from "[|module|]"; // export ... /**/from "[|module|]"; - if (node.kind === 149 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { + if (node.kind === 150 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { return parent.moduleSpecifier; } // class ... /**/extends [|name|] ... @@ -107407,7 +107989,7 @@ var ts; } } // ... T extends /**/infer [|U|] ? ... - if (node.kind === 132 /* InferKeyword */ && ts.isInferTypeNode(parent)) { + if (node.kind === 133 /* InferKeyword */ && ts.isInferTypeNode(parent)) { return parent.typeParameter.name; } // { [ [|K|] /**/in keyof T]: ... } @@ -107415,12 +107997,12 @@ var ts; return parent.name; } // /**/keyof [|T|] - if (node.kind === 134 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 134 /* KeyOfKeyword */ && + if (node.kind === 135 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 135 /* KeyOfKeyword */ && ts.isTypeReferenceNode(parent.type)) { return parent.type.typeName; } // /**/readonly [|name|][] - if (node.kind === 138 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 138 /* ReadonlyKeyword */ && + if (node.kind === 139 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 139 /* ReadonlyKeyword */ && ts.isArrayTypeNode(parent.type) && ts.isTypeReferenceNode(parent.type.elementType)) { return parent.type.elementType.typeName; } @@ -107457,7 +108039,7 @@ var ts; // for (... /**/in [|name|]) // for (... /**/of [|name|]) if (node.kind === 97 /* InKeyword */ && ts.isForInStatement(parent) || - node.kind === 152 /* OfKeyword */ && ts.isForOfStatement(parent)) { + node.kind === 153 /* OfKeyword */ && ts.isForOfStatement(parent)) { return ts.skipOuterExpressions(parent.expression); } } @@ -107598,7 +108180,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 290 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); + ts.Debug.assert(startNode !== undefined || n.kind === 291 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. @@ -107668,17 +108250,17 @@ var ts; return true; } //
{ |
or
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 276 /* JsxExpression */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 277 /* JsxExpression */) { return true; } //
{ // | // } < /div> - if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 276 /* JsxExpression */) { + if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 277 /* JsxExpression */) { return true; } //
|
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 269 /* JsxClosingElement */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 270 /* JsxClosingElement */) { return true; } return false; @@ -107819,7 +108401,7 @@ var ts; // falls through case 108 /* TypeOfKeyword */: case 90 /* ExtendsKeyword */: - case 134 /* KeyOfKeyword */: + case 135 /* KeyOfKeyword */: case 24 /* DotToken */: case 51 /* BarToken */: case 57 /* QuestionToken */: @@ -107874,16 +108456,16 @@ var ts; result.push("export" /* exportedModifier */); if (node.flags & 8388608 /* Ambient */) result.push("declare" /* ambientModifier */); - if (node.kind === 259 /* ExportAssignment */) + if (node.kind === 260 /* ExportAssignment */) result.push("export" /* exportedModifier */); return result.length > 0 ? result.join(",") : "" /* none */; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 169 /* TypeReference */ || node.kind === 196 /* CallExpression */) { + if (node.kind === 170 /* TypeReference */ || node.kind === 197 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 245 /* ClassDeclaration */ || node.kind === 246 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 246 /* ClassDeclaration */ || node.kind === 247 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -107928,18 +108510,18 @@ var ts; } ts.cloneCompilerOptions = cloneCompilerOptions; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 192 /* ArrayLiteralExpression */ || - node.kind === 193 /* ObjectLiteralExpression */) { + if (node.kind === 193 /* ArrayLiteralExpression */ || + node.kind === 194 /* ObjectLiteralExpression */) { // [a,b,c] from: // [a, b, c] = someExpression; - if (node.parent.kind === 209 /* BinaryExpression */ && + if (node.parent.kind === 210 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */) { return true; } // [a, b, c] from: // for([a, b, c] of expression) - if (node.parent.kind === 232 /* ForOfStatement */ && + if (node.parent.kind === 233 /* ForOfStatement */ && node.parent.initializer === node) { return true; } @@ -107947,7 +108529,7 @@ var ts; // [x, [a, b, c] ] = someExpression // or // {x, a: {a, b, c} } = someExpression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 281 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 282 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -107993,29 +108575,29 @@ var ts; ts.typeKeywords = [ 125 /* AnyKeyword */, 124 /* AssertsKeyword */, - 151 /* BigIntKeyword */, - 128 /* BooleanKeyword */, + 152 /* BigIntKeyword */, + 129 /* BooleanKeyword */, 91 /* FalseKeyword */, - 134 /* KeyOfKeyword */, - 137 /* NeverKeyword */, + 135 /* KeyOfKeyword */, + 138 /* NeverKeyword */, 100 /* NullKeyword */, - 140 /* NumberKeyword */, - 141 /* ObjectKeyword */, - 138 /* ReadonlyKeyword */, - 143 /* StringKeyword */, - 144 /* SymbolKeyword */, + 141 /* NumberKeyword */, + 142 /* ObjectKeyword */, + 139 /* ReadonlyKeyword */, + 144 /* StringKeyword */, + 145 /* SymbolKeyword */, 106 /* TrueKeyword */, 110 /* VoidKeyword */, - 146 /* UndefinedKeyword */, - 147 /* UniqueKeyword */, - 148 /* UnknownKeyword */, + 147 /* UndefinedKeyword */, + 148 /* UniqueKeyword */, + 149 /* UnknownKeyword */, ]; function isTypeKeyword(kind) { return ts.contains(ts.typeKeywords, kind); } ts.isTypeKeyword = isTypeKeyword; function isTypeKeywordToken(node) { - return node.kind === 145 /* TypeKeyword */; + return node.kind === 146 /* TypeKeyword */; } ts.isTypeKeywordToken = isTypeKeywordToken; /** True if the symbol is for an external module, as opposed to a namespace. */ @@ -108048,7 +108630,7 @@ var ts; } ts.skipConstraint = skipConstraint; function getNameFromPropertyName(name) { - return name.kind === 154 /* ComputedPropertyName */ + return name.kind === 155 /* ComputedPropertyName */ // treat computed property names where expression is string/numeric literal as just string/numeric literal ? ts.isStringOrNumericLiteralLike(name.expression) ? name.expression.text : undefined : ts.isPrivateIdentifier(name) ? ts.idText(name) : ts.getTextOfIdentifierOrLiteral(name); @@ -108195,7 +108777,7 @@ var ts; } ts.findModifier = findModifier; function insertImport(changes, sourceFile, importDecl, blankLineBetween) { - var importKindPredicate = importDecl.kind === 225 /* VariableStatement */ ? ts.isRequireVariableDeclarationStatement : ts.isAnyImportSyntax; + var importKindPredicate = importDecl.kind === 226 /* VariableStatement */ ? ts.isRequireVariableDeclarationStatement : ts.isAnyImportSyntax; var lastImportDeclaration = ts.findLast(sourceFile.statements, function (statement) { return importKindPredicate(statement); }); if (lastImportDeclaration) { changes.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl); @@ -108241,7 +108823,7 @@ var ts; // Display-part writer helpers // #region function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 156 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 157 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -108538,14 +109120,14 @@ var ts; var symbol = checker.getSymbolAtLocation(node.name); var renameInfo = symbol && renameMap.get(String(ts.getSymbolId(symbol))); if (renameInfo && renameInfo.text !== (node.name || node.propertyName).getText()) { - clone = ts.createBindingElement(node.dotDotDotToken, node.propertyName || node.name, renameInfo, node.initializer); + clone = ts.setOriginalNode(ts.createBindingElement(node.dotDotDotToken, node.propertyName || node.name, renameInfo, node.initializer), node); } } else if (renameMap && checker && ts.isIdentifier(node)) { var symbol = checker.getSymbolAtLocation(node); var renameInfo = symbol && renameMap.get(String(ts.getSymbolId(symbol))); if (renameInfo) { - clone = ts.createIdentifier(renameInfo.text); + clone = ts.setOriginalNode(ts.createIdentifier(renameInfo.text), node); } } if (!clone) { @@ -108705,15 +109287,15 @@ var ts; function getContextualTypeFromParent(node, checker) { var parent = node.parent; switch (parent.kind) { - case 197 /* NewExpression */: + case 198 /* NewExpression */: return checker.getContextualType(parent); - case 209 /* BinaryExpression */: { + case 210 /* BinaryExpression */: { var _a = parent, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node); } - case 277 /* CaseClause */: + case 278 /* CaseClause */: return parent.expression === node ? getSwitchedType(parent, checker) : undefined; default: return checker.getContextualType(node); @@ -108752,8 +109334,8 @@ var ts; switch (node.kind) { case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 211 /* TemplateExpression */: - case 198 /* TaggedTemplateExpression */: + case 212 /* TemplateExpression */: + case 199 /* TaggedTemplateExpression */: return true; default: return false; @@ -108792,41 +109374,41 @@ var ts; } ts.getTypeNodeIfAccessible = getTypeNodeIfAccessible; function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) { - return kind === 165 /* CallSignature */ - || kind === 166 /* ConstructSignature */ - || kind === 167 /* IndexSignature */ - || kind === 158 /* PropertySignature */ - || kind === 160 /* MethodSignature */; + return kind === 166 /* CallSignature */ + || kind === 167 /* ConstructSignature */ + || kind === 168 /* IndexSignature */ + || kind === 159 /* PropertySignature */ + || kind === 161 /* MethodSignature */; } ts.syntaxRequiresTrailingCommaOrSemicolonOrASI = syntaxRequiresTrailingCommaOrSemicolonOrASI; function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) { - return kind === 244 /* FunctionDeclaration */ - || kind === 162 /* Constructor */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */; + return kind === 245 /* FunctionDeclaration */ + || kind === 163 /* Constructor */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */; } ts.syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI = syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI; function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) { - return kind === 249 /* ModuleDeclaration */; + return kind === 250 /* ModuleDeclaration */; } ts.syntaxRequiresTrailingModuleBlockOrSemicolonOrASI = syntaxRequiresTrailingModuleBlockOrSemicolonOrASI; function syntaxRequiresTrailingSemicolonOrASI(kind) { - return kind === 225 /* VariableStatement */ - || kind === 226 /* ExpressionStatement */ - || kind === 228 /* DoStatement */ - || kind === 233 /* ContinueStatement */ - || kind === 234 /* BreakStatement */ - || kind === 235 /* ReturnStatement */ - || kind === 239 /* ThrowStatement */ - || kind === 241 /* DebuggerStatement */ - || kind === 159 /* PropertyDeclaration */ - || kind === 247 /* TypeAliasDeclaration */ - || kind === 254 /* ImportDeclaration */ - || kind === 253 /* ImportEqualsDeclaration */ - || kind === 260 /* ExportDeclaration */ - || kind === 252 /* NamespaceExportDeclaration */ - || kind === 259 /* ExportAssignment */; + return kind === 226 /* VariableStatement */ + || kind === 227 /* ExpressionStatement */ + || kind === 229 /* DoStatement */ + || kind === 234 /* ContinueStatement */ + || kind === 235 /* BreakStatement */ + || kind === 236 /* ReturnStatement */ + || kind === 240 /* ThrowStatement */ + || kind === 242 /* DebuggerStatement */ + || kind === 160 /* PropertyDeclaration */ + || kind === 248 /* TypeAliasDeclaration */ + || kind === 255 /* ImportDeclaration */ + || kind === 254 /* ImportEqualsDeclaration */ + || kind === 261 /* ExportDeclaration */ + || kind === 253 /* NamespaceExportDeclaration */ + || kind === 260 /* ExportAssignment */; } ts.syntaxRequiresTrailingSemicolonOrASI = syntaxRequiresTrailingSemicolonOrASI; ts.syntaxMayBeASICandidate = ts.or(syntaxRequiresTrailingCommaOrSemicolonOrASI, syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI, syntaxRequiresTrailingModuleBlockOrSemicolonOrASI, syntaxRequiresTrailingSemicolonOrASI); @@ -108856,7 +109438,7 @@ var ts; return false; } // See comment in parser’s `parseDoStatement` - if (node.kind === 228 /* DoStatement */) { + if (node.kind === 229 /* DoStatement */) { return true; } var topNode = ts.findAncestor(node, function (ancestor) { return !ancestor.parent; }); @@ -109116,6 +109698,10 @@ var ts; return symbol.name; } ts.getNameForExportedSymbol = getNameForExportedSymbol; + function startsWithUnderscore(name) { + return name.charCodeAt(0) === 95 /* _ */; + } + ts.startsWithUnderscore = startsWithUnderscore; // #endregion })(ts || (ts = {})); var ts; @@ -109219,10 +109805,10 @@ var ts; } break; case 125 /* AnyKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: if (angleBracketStack > 0 && !syntacticClassifierAbsent) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, @@ -109411,9 +109997,9 @@ var ts; return true; } switch (keyword2) { - case 131 /* GetKeyword */: - case 142 /* SetKeyword */: - case 129 /* ConstructorKeyword */: + case 132 /* GetKeyword */: + case 143 /* SetKeyword */: + case 130 /* ConstructorKeyword */: case 120 /* StaticKeyword */: return true; // Allow things like "public get", "public constructor" and "public static". default: @@ -109554,10 +110140,10 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 249 /* ModuleDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 244 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 245 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -109777,18 +110363,18 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); // e.g. "param" pos = tag.tagName.end; switch (tag.kind) { - case 317 /* JSDocParameterTag */: + case 318 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); pos = tag.end; break; - case 320 /* JSDocTypeTag */: + case 321 /* JSDocTypeTag */: processElement(tag.typeExpression); pos = tag.end; break; - case 318 /* JSDocReturnTag */: + case 319 /* JSDocReturnTag */: processElement(tag.typeExpression); pos = tag.end; break; @@ -109939,22 +110525,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 268 /* JsxOpeningElement */: + case 269 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -109983,17 +110569,17 @@ var ts; var parent = token.parent; if (tokenKind === 62 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (parent.kind === 242 /* VariableDeclaration */ || - parent.kind === 159 /* PropertyDeclaration */ || - parent.kind === 156 /* Parameter */ || - parent.kind === 273 /* JsxAttribute */) { + if (parent.kind === 243 /* VariableDeclaration */ || + parent.kind === 160 /* PropertyDeclaration */ || + parent.kind === 157 /* Parameter */ || + parent.kind === 274 /* JsxAttribute */) { return 5 /* operator */; } } - if (parent.kind === 209 /* BinaryExpression */ || - parent.kind === 207 /* PrefixUnaryExpression */ || - parent.kind === 208 /* PostfixUnaryExpression */ || - parent.kind === 210 /* ConditionalExpression */) { + if (parent.kind === 210 /* BinaryExpression */ || + parent.kind === 208 /* PrefixUnaryExpression */ || + parent.kind === 209 /* PostfixUnaryExpression */ || + parent.kind === 211 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -110006,7 +110592,7 @@ var ts; return 25 /* bigintLiteral */; } else if (tokenKind === 10 /* StringLiteral */) { - return token && token.parent.kind === 273 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token && token.parent.kind === 274 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 13 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -110022,32 +110608,32 @@ var ts; else if (tokenKind === 75 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 156 /* Parameter */: + case 157 /* Parameter */: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -110171,11 +110757,11 @@ var ts; function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host) { var parent = node.parent; switch (parent.kind) { - case 187 /* LiteralType */: + case 188 /* LiteralType */: switch (parent.parent.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(parent)), isNewIdentifier: false }; - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: // Get all apparent property names // i.e. interface Foo { // foo: string; @@ -110183,9 +110769,9 @@ var ts; // } // let x: Foo["/*completion position*/"] return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(parent.parent.objectType)); - case 188 /* ImportType */: + case 189 /* ImportType */: return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) }; - case 178 /* UnionType */: { + case 179 /* UnionType */: { if (!ts.isTypeReferenceNode(parent.parent.parent)) return undefined; var alreadyUsedTypes_1 = getAlreadyUsedTypesInStringLiteralUnion(parent.parent, parent); @@ -110195,7 +110781,7 @@ var ts; default: return undefined; } - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: if (ts.isObjectLiteralExpression(parent.parent) && parent.name === node) { // Get quoted name of properties of the object literal expression // i.e. interface ConfigFiles { @@ -110212,7 +110798,7 @@ var ts; return stringLiteralCompletionsFromProperties(typeChecker.getContextualType(parent.parent)); } return fromContextualType(); - case 195 /* ElementAccessExpression */: { + case 196 /* ElementAccessExpression */: { var _a = parent, expression = _a.expression, argumentExpression = _a.argumentExpression; if (node === argumentExpression) { // Get all names of properties on the expression @@ -110225,8 +110811,8 @@ var ts; } return undefined; } - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: if (!ts.isRequireCall(parent, /*checkArgumentIsStringLiteralLike*/ false) && !ts.isImportCall(parent)) { var argumentInfo = ts.SignatureHelp.getArgumentInfoForCompletions(node, position, sourceFile); // Get string literal completions from specialized signatures of the target @@ -110235,9 +110821,9 @@ var ts; return argumentInfo ? getStringLiteralCompletionsFromSignature(argumentInfo, typeChecker) : fromContextualType(); } // falls through (is `require("")` or `import("")`) - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: - case 265 /* ExternalModuleReference */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 266 /* ExternalModuleReference */: // Get all known external module names or complete a path to a module // i.e. import * as ns from "/*completion position*/"; // var y = import("/*completion position*/"); @@ -111188,11 +111774,11 @@ var ts; return ts.getContextualTypeFromParent(previousToken, checker); case 62 /* EqualsToken */: switch (parent.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return checker.getContextualType(parent.initializer); // TODO: GH#18217 - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return checker.getTypeAtLocation(parent.left); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return checker.getContextualTypeForJsxAttribute(parent); default: return undefined; @@ -111202,7 +111788,7 @@ var ts; case 78 /* CaseKeyword */: return ts.getSwitchedType(ts.cast(parent, ts.isCaseClause), checker); case 18 /* OpenBraceToken */: - return ts.isJsxExpression(parent) && parent.parent.kind !== 266 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; + return ts.isJsxExpression(parent) && parent.parent.kind !== 267 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; default: var argInfo = ts.SignatureHelp.getArgumentInfoForCompletions(previousToken, position, sourceFile); return argInfo ? @@ -111221,7 +111807,7 @@ var ts; return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker)); } function isModuleSymbol(symbol) { - return symbol.declarations.some(function (d) { return d.kind === 290 /* SourceFile */; }); + return symbol.declarations.some(function (d) { return d.kind === 291 /* SourceFile */; }); } function getCompletionData(program, log, sourceFile, isUncheckedFile, position, preferences, detailsEntryId, host) { var typeChecker = program.getTypeChecker(); @@ -111272,11 +111858,11 @@ var ts; if (tag.tagName.pos <= position && position <= tag.tagName.end) { return { kind: 1 /* JsDocTagName */ }; } - if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 294 /* JSDocTypeExpression */) { + if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 295 /* JSDocTypeExpression */) { currentToken = ts.getTokenAtPosition(sourceFile, position); if (!currentToken || (!ts.isDeclarationName(currentToken) && - (currentToken.parent.kind !== 323 /* JSDocPropertyTag */ || + (currentToken.parent.kind !== 324 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken))) { // Use as type location if inside tag's type expression insideJsDocTagTypeExpression = isCurrentlyEditingNode(tag.typeExpression); @@ -111328,7 +111914,7 @@ var ts; isRightOfDot = contextToken.kind === 24 /* DotToken */; isRightOfQuestionDot = contextToken.kind === 28 /* QuestionDotToken */; switch (parent.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: propertyAccessToConvert = parent; node = propertyAccessToConvert.expression; if (node.end === contextToken.pos && @@ -111340,14 +111926,14 @@ var ts; return undefined; } break; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: node = parent.left; break; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: node = parent.name; break; - case 188 /* ImportType */: - case 219 /* MetaProperty */: + case 189 /* ImportType */: + case 220 /* MetaProperty */: node = parent; break; default: @@ -111360,7 +111946,7 @@ var ts; // // If the tagname is a property access expression, we will then walk up to the top most of property access expression. // Then, try to get a JSX container and its associated attributes type. - if (parent && parent.kind === 194 /* PropertyAccessExpression */) { + if (parent && parent.kind === 195 /* PropertyAccessExpression */) { contextToken = parent; parent = parent.parent; } @@ -111368,38 +111954,38 @@ var ts; if (currentToken.parent === location) { switch (currentToken.kind) { case 31 /* GreaterThanToken */: - if (currentToken.parent.kind === 266 /* JsxElement */ || currentToken.parent.kind === 268 /* JsxOpeningElement */) { + if (currentToken.parent.kind === 267 /* JsxElement */ || currentToken.parent.kind === 269 /* JsxOpeningElement */) { location = currentToken; } break; case 43 /* SlashToken */: - if (currentToken.parent.kind === 267 /* JsxSelfClosingElement */) { + if (currentToken.parent.kind === 268 /* JsxSelfClosingElement */) { location = currentToken; } break; } } switch (parent.kind) { - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: if (contextToken.kind === 43 /* SlashToken */) { isStartingCloseTag = true; location = contextToken; } break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (!binaryExpressionMayBeOpenTag(parent)) { break; } // falls through - case 267 /* JsxSelfClosingElement */: - case 266 /* JsxElement */: - case 268 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 267 /* JsxElement */: + case 269 /* JsxOpeningElement */: if (contextToken.kind === 29 /* LessThanToken */) { isRightOfOpenTag = true; location = contextToken; } break; - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: switch (previousToken.kind) { case 62 /* EqualsToken */: isJsxInitializer = true; @@ -111479,11 +112065,11 @@ var ts; }; function isTagWithTypeExpression(tag) { switch (tag.kind) { - case 317 /* JSDocParameterTag */: - case 323 /* JSDocPropertyTag */: - case 318 /* JSDocReturnTag */: - case 320 /* JSDocTypeTag */: - case 322 /* JSDocTypedefTag */: + case 318 /* JSDocParameterTag */: + case 324 /* JSDocPropertyTag */: + case 319 /* JSDocReturnTag */: + case 321 /* JSDocTypeTag */: + case 323 /* JSDocTypedefTag */: return true; default: return false; @@ -111528,7 +112114,7 @@ var ts; // If the module is merged with a value, we must get the type of the class and add its propertes (for inherited static methods). if (!isTypeLocation && symbol.declarations && - symbol.declarations.some(function (d) { return d.kind !== 290 /* SourceFile */ && d.kind !== 249 /* ModuleDeclaration */ && d.kind !== 248 /* EnumDeclaration */; })) { + symbol.declarations.some(function (d) { return d.kind !== 291 /* SourceFile */ && d.kind !== 250 /* ModuleDeclaration */ && d.kind !== 249 /* EnumDeclaration */; })) { var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType(); var insertQuestionDot = false; if (type.isNullableType()) { @@ -111575,7 +112161,7 @@ var ts; if (isRightOfQuestionDot && ts.some(type.getCallSignatures())) { isNewIdentifierLocation = true; } - var propertyAccess = node.kind === 188 /* ImportType */ ? node : node.parent; + var propertyAccess = node.kind === 189 /* ImportType */ ? node : node.parent; if (isUncheckedFile) { // In javascript files, for union types, we don't just get the members that // the individual types have in common, we also include all the members that @@ -111731,7 +112317,7 @@ var ts; } } // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` - if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 290 /* SourceFile */) { + if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 291 /* SourceFile */) { var thisType = typeChecker.tryGetThisTypeAt(scopeNode, /*includeGlobalThis*/ false); if (thisType) { for (var _a = 0, _b = getPropertiesForCompletion(thisType, typeChecker); _a < _b.length; _a++) { @@ -111781,10 +112367,10 @@ var ts; } function isSnippetScope(scopeNode) { switch (scopeNode.kind) { - case 290 /* SourceFile */: - case 211 /* TemplateExpression */: - case 276 /* JsxExpression */: - case 223 /* Block */: + case 291 /* SourceFile */: + case 212 /* TemplateExpression */: + case 277 /* JsxExpression */: + case 224 /* Block */: return true; default: return ts.isStatement(scopeNode); @@ -111830,27 +112416,27 @@ var ts; function isContextTokenValueLocation(contextToken) { return contextToken && contextToken.kind === 108 /* TypeOfKeyword */ && - (contextToken.parent.kind === 172 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); + (contextToken.parent.kind === 173 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); } function isContextTokenTypeLocation(contextToken) { if (contextToken) { var parentKind = contextToken.parent.kind; switch (contextToken.kind) { case 58 /* ColonToken */: - return parentKind === 159 /* PropertyDeclaration */ || - parentKind === 158 /* PropertySignature */ || - parentKind === 156 /* Parameter */ || - parentKind === 242 /* VariableDeclaration */ || + return parentKind === 160 /* PropertyDeclaration */ || + parentKind === 159 /* PropertySignature */ || + parentKind === 157 /* Parameter */ || + parentKind === 243 /* VariableDeclaration */ || ts.isFunctionLikeKind(parentKind); case 62 /* EqualsToken */: - return parentKind === 247 /* TypeAliasDeclaration */; + return parentKind === 248 /* TypeAliasDeclaration */; case 123 /* AsKeyword */: - return parentKind === 217 /* AsExpression */; + return parentKind === 218 /* AsExpression */; case 29 /* LessThanToken */: - return parentKind === 169 /* TypeReference */ || - parentKind === 199 /* TypeAssertionExpression */; + return parentKind === 170 /* TypeReference */ || + parentKind === 200 /* TypeAssertionExpression */; case 90 /* ExtendsKeyword */: - return parentKind === 155 /* TypeParameter */; + return parentKind === 156 /* TypeParameter */; } } return false; @@ -112061,7 +112647,7 @@ var ts; return true; } if (contextToken.kind === 31 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 268 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 269 /* JsxOpeningElement */) { // Two possibilities: // 1.
/**/ // - contextToken: GreaterThanToken (before cursor) @@ -112071,10 +112657,10 @@ var ts; // - contextToken: GreaterThanToken (before cursor) // - location: GreaterThanToken (after cursor) // - same parent (JSXOpeningElement) - return location.parent.kind !== 268 /* JsxOpeningElement */; + return location.parent.kind !== 269 /* JsxOpeningElement */; } - if (contextToken.parent.kind === 269 /* JsxClosingElement */ || contextToken.parent.kind === 267 /* JsxSelfClosingElement */) { - return !!contextToken.parent.parent && contextToken.parent.parent.kind === 266 /* JsxElement */; + if (contextToken.parent.kind === 270 /* JsxClosingElement */ || contextToken.parent.kind === 268 /* JsxSelfClosingElement */) { + return !!contextToken.parent.parent && contextToken.parent.parent.kind === 267 /* JsxElement */; } } return false; @@ -112085,40 +112671,40 @@ var ts; // Previous token may have been a keyword that was converted to an identifier. switch (keywordForNode(previousToken)) { case 27 /* CommaToken */: - return containingNodeKind === 196 /* CallExpression */ // func( a, | - || containingNodeKind === 162 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 197 /* NewExpression */ // new C(a, | - || containingNodeKind === 192 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 209 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 170 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 197 /* CallExpression */ // func( a, | + || containingNodeKind === 163 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 198 /* NewExpression */ // new C(a, | + || containingNodeKind === 193 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 210 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 171 /* FunctionType */; // var x: (s: string, list| case 20 /* OpenParenToken */: - return containingNodeKind === 196 /* CallExpression */ // func( | - || containingNodeKind === 162 /* Constructor */ // constructor( | - || containingNodeKind === 197 /* NewExpression */ // new C(a| - || containingNodeKind === 200 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 182 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 197 /* CallExpression */ // func( | + || containingNodeKind === 163 /* Constructor */ // constructor( | + || containingNodeKind === 198 /* NewExpression */ // new C(a| + || containingNodeKind === 201 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 183 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 22 /* OpenBracketToken */: - return containingNodeKind === 192 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 167 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 154 /* ComputedPropertyName */; // [ | /* this can become an index signature */ - case 135 /* ModuleKeyword */: // module | - case 136 /* NamespaceKeyword */: // namespace | + return containingNodeKind === 193 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 168 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 155 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + case 136 /* ModuleKeyword */: // module | + case 137 /* NamespaceKeyword */: // namespace | return true; case 24 /* DotToken */: - return containingNodeKind === 249 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 250 /* ModuleDeclaration */; // module A.| case 18 /* OpenBraceToken */: - return containingNodeKind === 245 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 246 /* ClassDeclaration */; // class A{ | case 62 /* EqualsToken */: - return containingNodeKind === 242 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 209 /* BinaryExpression */; // x = a| + return containingNodeKind === 243 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 210 /* BinaryExpression */; // x = a| case 15 /* TemplateHead */: - return containingNodeKind === 211 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 212 /* TemplateExpression */; // `aa ${| case 16 /* TemplateMiddle */: - return containingNodeKind === 221 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 222 /* TemplateSpan */; // `aa ${10} dd ${| case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - return containingNodeKind === 159 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 160 /* PropertyDeclaration */; // class A{ public | } } return false; @@ -112145,7 +112731,7 @@ var ts; completionKind = 0 /* ObjectPropertyDeclaration */; var typeMembers; var existingMembers; - if (objectLikeContainer.kind === 193 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 194 /* ObjectLiteralExpression */) { var instantiatedType = typeChecker.getContextualType(objectLikeContainer); var completionsType = instantiatedType && typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */); if (!instantiatedType || !completionsType) @@ -112155,7 +112741,7 @@ var ts; existingMembers = objectLikeContainer.properties; } else { - ts.Debug.assert(objectLikeContainer.kind === 189 /* ObjectBindingPattern */); + ts.Debug.assert(objectLikeContainer.kind === 190 /* ObjectBindingPattern */); // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -112166,12 +112752,12 @@ var ts; // through type declaration or inference. // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - // type of parameter will flow in from the contextual type of the function - var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 232 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 156 /* Parameter */) { + var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 233 /* ForOfStatement */; + if (!canGetType && rootDeclaration.kind === 157 /* Parameter */) { if (ts.isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); } - else if (rootDeclaration.parent.kind === 161 /* MethodDeclaration */ || rootDeclaration.parent.kind === 164 /* SetAccessor */) { + else if (rootDeclaration.parent.kind === 162 /* MethodDeclaration */ || rootDeclaration.parent.kind === 165 /* SetAccessor */) { canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -112221,7 +112807,7 @@ var ts; return 0 /* Continue */; // cursor is in an import clause // try to show exported member for imported module - var moduleSpecifier = (namedImportsOrExports.kind === 257 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; + var moduleSpecifier = (namedImportsOrExports.kind === 258 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); // TODO: GH#18217 if (!moduleSpecifierSymbol) return 2 /* Fail */; @@ -112343,11 +112929,11 @@ var ts; case 30 /* LessThanSlashToken */: case 43 /* SlashToken */: case 75 /* Identifier */: - case 194 /* PropertyAccessExpression */: - case 274 /* JsxAttributes */: - case 273 /* JsxAttribute */: - case 275 /* JsxSpreadAttribute */: - if (parent && (parent.kind === 267 /* JsxSelfClosingElement */ || parent.kind === 268 /* JsxOpeningElement */)) { + case 195 /* PropertyAccessExpression */: + case 275 /* JsxAttributes */: + case 274 /* JsxAttribute */: + case 276 /* JsxSpreadAttribute */: + if (parent && (parent.kind === 268 /* JsxSelfClosingElement */ || parent.kind === 269 /* JsxOpeningElement */)) { if (contextToken.kind === 31 /* GreaterThanToken */) { var precedingToken = ts.findPrecedingToken(contextToken.pos, sourceFile, /*startNode*/ undefined); if (!parent.typeArguments || (precedingToken && precedingToken.kind === 43 /* SlashToken */)) @@ -112355,7 +112941,7 @@ var ts; } return parent; } - else if (parent.kind === 273 /* JsxAttribute */) { + else if (parent.kind === 274 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -112367,7 +112953,7 @@ var ts; // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 10 /* StringLiteral */: - if (parent && ((parent.kind === 273 /* JsxAttribute */) || (parent.kind === 275 /* JsxSpreadAttribute */))) { + if (parent && ((parent.kind === 274 /* JsxAttribute */) || (parent.kind === 276 /* JsxSpreadAttribute */))) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -112377,8 +112963,8 @@ var ts; break; case 19 /* CloseBraceToken */: if (parent && - parent.kind === 276 /* JsxExpression */ && - parent.parent && parent.parent.kind === 273 /* JsxAttribute */) { + parent.kind === 277 /* JsxExpression */ && + parent.parent && parent.parent.kind === 274 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -112386,7 +112972,7 @@ var ts; // each JsxAttribute can have initializer as JsxExpression return parent.parent.parent.parent; } - if (parent && parent.kind === 275 /* JsxSpreadAttribute */) { + if (parent && parent.kind === 276 /* JsxSpreadAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -112406,51 +112992,51 @@ var ts; var containingNodeKind = parent.kind; switch (contextToken.kind) { case 27 /* CommaToken */: - return containingNodeKind === 242 /* VariableDeclaration */ || + return containingNodeKind === 243 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken) || - containingNodeKind === 225 /* VariableStatement */ || - containingNodeKind === 248 /* EnumDeclaration */ || // enum a { foo, | + containingNodeKind === 226 /* VariableStatement */ || + containingNodeKind === 249 /* EnumDeclaration */ || // enum a { foo, | isFunctionLikeButNotConstructor(containingNodeKind) || - containingNodeKind === 246 /* InterfaceDeclaration */ || // interface A= contextToken.pos); case 24 /* DotToken */: - return containingNodeKind === 190 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 191 /* ArrayBindingPattern */; // var [.| case 58 /* ColonToken */: - return containingNodeKind === 191 /* BindingElement */; // var {x :html| + return containingNodeKind === 192 /* BindingElement */; // var {x :html| case 22 /* OpenBracketToken */: - return containingNodeKind === 190 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 191 /* ArrayBindingPattern */; // var [x| case 20 /* OpenParenToken */: - return containingNodeKind === 280 /* CatchClause */ || + return containingNodeKind === 281 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); case 18 /* OpenBraceToken */: - return containingNodeKind === 248 /* EnumDeclaration */; // enum a { | + return containingNodeKind === 249 /* EnumDeclaration */; // enum a { | case 29 /* LessThanToken */: - return containingNodeKind === 245 /* ClassDeclaration */ || // class A< | - containingNodeKind === 214 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 246 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 247 /* TypeAliasDeclaration */ || // type List< | + return containingNodeKind === 246 /* ClassDeclaration */ || // class A< | + containingNodeKind === 215 /* ClassExpression */ || // var C = class D< | + containingNodeKind === 247 /* InterfaceDeclaration */ || // interface A< | + containingNodeKind === 248 /* TypeAliasDeclaration */ || // type List< | ts.isFunctionLikeKind(containingNodeKind); case 120 /* StaticKeyword */: - return containingNodeKind === 159 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); + return containingNodeKind === 160 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); case 25 /* DotDotDotToken */: - return containingNodeKind === 156 /* Parameter */ || - (!!parent.parent && parent.parent.kind === 190 /* ArrayBindingPattern */); // var [...z| + return containingNodeKind === 157 /* Parameter */ || + (!!parent.parent && parent.parent.kind === 191 /* ArrayBindingPattern */); // var [...z| case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - return containingNodeKind === 156 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); + return containingNodeKind === 157 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); case 123 /* AsKeyword */: - return containingNodeKind === 258 /* ImportSpecifier */ || - containingNodeKind === 263 /* ExportSpecifier */ || - containingNodeKind === 256 /* NamespaceImport */; - case 131 /* GetKeyword */: - case 142 /* SetKeyword */: + return containingNodeKind === 259 /* ImportSpecifier */ || + containingNodeKind === 264 /* ExportSpecifier */ || + containingNodeKind === 257 /* NamespaceImport */; + case 132 /* GetKeyword */: + case 143 /* SetKeyword */: return !isFromObjectTypeDeclaration(contextToken); case 80 /* ClassKeyword */: case 88 /* EnumKeyword */: @@ -112461,7 +113047,7 @@ var ts; case 115 /* LetKeyword */: case 81 /* ConstKeyword */: case 121 /* YieldKeyword */: - case 145 /* TypeKeyword */: // type htm| + case 146 /* TypeKeyword */: // type htm| return true; case 41 /* AsteriskToken */: return ts.isFunctionLike(contextToken.parent) && !ts.isMethodDeclaration(contextToken.parent); @@ -112487,7 +113073,7 @@ var ts; case 122 /* AbstractKeyword */: case 80 /* ClassKeyword */: case 81 /* ConstKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 88 /* EnumKeyword */: case 94 /* FunctionKeyword */: case 114 /* InterfaceKeyword */: @@ -112509,7 +113095,7 @@ var ts; && !(ts.isClassLike(contextToken.parent) && (contextToken !== previousToken || position > previousToken.end)); } function isFunctionLikeButNotConstructor(kind) { - return ts.isFunctionLikeKind(kind) && kind !== 162 /* Constructor */; + return ts.isFunctionLikeKind(kind) && kind !== 163 /* Constructor */; } function isDotOfNumericLiteral(contextToken) { if (contextToken.kind === 8 /* NumericLiteral */) { @@ -112519,7 +113105,7 @@ var ts; return false; } function isVariableDeclarationListButNotTypeArgument(node) { - return node.parent.kind === 243 /* VariableDeclarationList */ + return node.parent.kind === 244 /* VariableDeclarationList */ && !ts.isPossiblyTypeArgumentPosition(node, sourceFile, typeChecker); } /** @@ -112537,13 +113123,13 @@ var ts; for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 281 /* PropertyAssignment */ && - m.kind !== 282 /* ShorthandPropertyAssignment */ && - m.kind !== 191 /* BindingElement */ && - m.kind !== 161 /* MethodDeclaration */ && - m.kind !== 163 /* GetAccessor */ && - m.kind !== 164 /* SetAccessor */ && - m.kind !== 283 /* SpreadAssignment */) { + if (m.kind !== 282 /* PropertyAssignment */ && + m.kind !== 283 /* ShorthandPropertyAssignment */ && + m.kind !== 192 /* BindingElement */ && + m.kind !== 162 /* MethodDeclaration */ && + m.kind !== 164 /* GetAccessor */ && + m.kind !== 165 /* SetAccessor */ && + m.kind !== 284 /* SpreadAssignment */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -112614,10 +113200,10 @@ var ts; for (var _i = 0, existingMembers_2 = existingMembers; _i < existingMembers_2.length; _i++) { var m = existingMembers_2[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 159 /* PropertyDeclaration */ && - m.kind !== 161 /* MethodDeclaration */ && - m.kind !== 163 /* GetAccessor */ && - m.kind !== 164 /* SetAccessor */) { + if (m.kind !== 160 /* PropertyDeclaration */ && + m.kind !== 162 /* MethodDeclaration */ && + m.kind !== 164 /* GetAccessor */ && + m.kind !== 165 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -112658,7 +113244,7 @@ var ts; if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 273 /* JsxAttribute */) { + if (attr.kind === 274 /* JsxAttribute */) { seenNames.set(attr.name.escapedText, true); } else if (ts.isJsxSpreadAttribute(attr)) { @@ -112708,7 +113294,7 @@ var ts; var _keywordCompletions = []; var allKeywordsCompletions = ts.memoize(function () { var res = []; - for (var i = 77 /* FirstKeyword */; i <= 152 /* LastKeyword */; i++) { + for (var i = 77 /* FirstKeyword */; i <= 153 /* LastKeyword */; i++) { res.push({ name: ts.tokenToString(i), kind: "keyword" /* keyword */, @@ -112734,12 +113320,12 @@ var ts; return false; case 1 /* All */: return isFunctionLikeBodyKeyword(kind) - || kind === 130 /* DeclareKeyword */ - || kind === 135 /* ModuleKeyword */ - || kind === 145 /* TypeKeyword */ - || kind === 136 /* NamespaceKeyword */ + || kind === 131 /* DeclareKeyword */ + || kind === 136 /* ModuleKeyword */ + || kind === 146 /* TypeKeyword */ + || kind === 137 /* NamespaceKeyword */ || kind === 123 /* AsKeyword */ - || ts.isTypeKeyword(kind) && kind !== 146 /* UndefinedKeyword */; + || ts.isTypeKeyword(kind) && kind !== 147 /* UndefinedKeyword */; case 5 /* FunctionLikeBodyKeywords */: return isFunctionLikeBodyKeyword(kind); case 2 /* ClassElementKeywords */: @@ -112761,46 +113347,46 @@ var ts; switch (kind) { case 122 /* AbstractKeyword */: case 125 /* AnyKeyword */: - case 151 /* BigIntKeyword */: - case 128 /* BooleanKeyword */: - case 130 /* DeclareKeyword */: + case 152 /* BigIntKeyword */: + case 129 /* BooleanKeyword */: + case 131 /* DeclareKeyword */: case 88 /* EnumKeyword */: - case 150 /* GlobalKeyword */: + case 151 /* GlobalKeyword */: case 113 /* ImplementsKeyword */: - case 132 /* InferKeyword */: + case 133 /* InferKeyword */: case 114 /* InterfaceKeyword */: - case 133 /* IsKeyword */: - case 134 /* KeyOfKeyword */: - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: - case 137 /* NeverKeyword */: - case 140 /* NumberKeyword */: - case 141 /* ObjectKeyword */: + case 134 /* IsKeyword */: + case 135 /* KeyOfKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: + case 138 /* NeverKeyword */: + case 141 /* NumberKeyword */: + case 142 /* ObjectKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 119 /* PublicKeyword */: - case 138 /* ReadonlyKeyword */: - case 143 /* StringKeyword */: - case 144 /* SymbolKeyword */: - case 145 /* TypeKeyword */: - case 147 /* UniqueKeyword */: - case 148 /* UnknownKeyword */: + case 139 /* ReadonlyKeyword */: + case 144 /* StringKeyword */: + case 145 /* SymbolKeyword */: + case 146 /* TypeKeyword */: + case 148 /* UniqueKeyword */: + case 149 /* UnknownKeyword */: return true; default: return false; } } function isInterfaceOrTypeLiteralCompletionKeyword(kind) { - return kind === 138 /* ReadonlyKeyword */; + return kind === 139 /* ReadonlyKeyword */; } function isClassMemberCompletionKeyword(kind) { switch (kind) { case 122 /* AbstractKeyword */: - case 129 /* ConstructorKeyword */: - case 131 /* GetKeyword */: - case 142 /* SetKeyword */: + case 130 /* ConstructorKeyword */: + case 132 /* GetKeyword */: + case 143 /* SetKeyword */: case 126 /* AsyncKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: return true; default: return ts.isClassMemberModifier(kind); @@ -112859,7 +113445,7 @@ var ts; function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) { // class c { method() { } | method2() { } } switch (location.kind) { - case 324 /* SyntaxList */: + case 325 /* SyntaxList */: return ts.tryCast(location.parent, ts.isObjectTypeDeclaration); case 1 /* EndOfFileToken */: var cls = ts.tryCast(ts.lastOrUndefined(ts.cast(location.parent, ts.isSourceFile).statements), ts.isObjectTypeDeclaration); @@ -113027,11 +113613,11 @@ var ts; case 111 /* WhileKeyword */: case 86 /* DoKeyword */: return useParent(node.parent, function (n) { return ts.isIterationStatement(n, /*lookInLabeledStatements*/ true); }, getLoopBreakContinueOccurrences); - case 129 /* ConstructorKeyword */: - return getFromAllDeclarations(ts.isConstructorDeclaration, [129 /* ConstructorKeyword */]); - case 131 /* GetKeyword */: - case 142 /* SetKeyword */: - return getFromAllDeclarations(ts.isAccessor, [131 /* GetKeyword */, 142 /* SetKeyword */]); + case 130 /* ConstructorKeyword */: + return getFromAllDeclarations(ts.isConstructorDeclaration, [130 /* ConstructorKeyword */]); + case 132 /* GetKeyword */: + case 143 /* SetKeyword */: + return getFromAllDeclarations(ts.isAccessor, [132 /* GetKeyword */, 143 /* SetKeyword */]); case 127 /* AwaitKeyword */: return useParent(node.parent, ts.isAwaitExpression, getAsyncAndAwaitOccurrences); case 126 /* AsyncKeyword */: @@ -113079,7 +113665,7 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 290 /* SourceFile */) { + if (ts.isFunctionBlock(parent) || parent.kind === 291 /* SourceFile */) { return parent; } // A throw-statement is only owned by a try-statement if the try-statement has @@ -113111,16 +113697,16 @@ var ts; function getBreakOrContinueOwner(statement) { return ts.findAncestor(statement, function (node) { switch (node.kind) { - case 237 /* SwitchStatement */: - if (statement.kind === 233 /* ContinueStatement */) { + case 238 /* SwitchStatement */: + if (statement.kind === 234 /* ContinueStatement */) { return false; } // falls through - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 229 /* WhileStatement */: - case 228 /* DoStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 230 /* WhileStatement */: + case 229 /* DoStatement */: return !statement.label || isLabeledBy(node, statement.label.escapedText); default: // Don't cross function boundaries. @@ -113136,11 +113722,11 @@ var ts; // Types of node whose children might have modifiers. var container = declaration.parent; switch (container.kind) { - case 250 /* ModuleBlock */: - case 290 /* SourceFile */: - case 223 /* Block */: - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 251 /* ModuleBlock */: + case 291 /* SourceFile */: + case 224 /* Block */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: // Container is either a class declaration or the declaration is a classDeclaration if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) { return __spreadArrays(declaration.members, [declaration]); @@ -113148,14 +113734,14 @@ var ts; else { return container.statements; } - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 244 /* FunctionDeclaration */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: return __spreadArrays(container.parameters, (ts.isClassLike(container.parent) ? container.parent.members : [])); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 173 /* TypeLiteral */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 174 /* TypeLiteral */: var nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. @@ -113188,7 +113774,7 @@ var ts; var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 93 /* ForKeyword */, 111 /* WhileKeyword */, 86 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 228 /* DoStatement */) { + if (loopNode.kind === 229 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 111 /* WhileKeyword */)) { @@ -113208,13 +113794,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -113581,10 +114167,10 @@ var ts; if (cancellationToken) cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (!isAvailableThroughGlobal) { var parent = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent.kind === 242 /* VariableDeclaration */) { + if (exportKind === 2 /* ExportEquals */ && parent.kind === 243 /* VariableDeclaration */) { var name = parent.name; if (name.kind === 75 /* Identifier */) { directImports.push(name); @@ -113597,20 +114183,20 @@ var ts; break; case 75 /* Identifier */: // for 'const x = require("y"); break; // TODO: GH#23879 - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: handleNamespaceImport(direct, direct.name, ts.hasModifier(direct, 1 /* Export */), /*alreadyAddedDirect*/ false); break; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: directImports.push(direct); var namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 256 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 257 /* NamespaceImport */) { handleNamespaceImport(direct, namedBindings.name, /*isReExport*/ false, /*alreadyAddedDirect*/ true); } else if (!isAvailableThroughGlobal && ts.isDefaultImport(direct)) { addIndirectUser(getSourceFileLikeForImportDeclaration(direct)); // Add a check for indirect uses to handle synthetic default imports } break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: if (!direct.exportClause) { // This is `export * from "foo"`, so imports of this module may import the export too. handleDirectImports(getContainingModuleSymbol(direct, checker)); @@ -113620,7 +114206,7 @@ var ts; directImports.push(direct); } break; - case 188 /* ImportType */: + case 189 /* ImportType */: directImports.push(direct); break; default: @@ -113637,7 +114223,7 @@ var ts; } else if (!isAvailableThroughGlobal) { var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - ts.Debug.assert(sourceFileLike.kind === 290 /* SourceFile */ || sourceFileLike.kind === 249 /* ModuleDeclaration */); + ts.Debug.assert(sourceFileLike.kind === 291 /* SourceFile */ || sourceFileLike.kind === 250 /* ModuleDeclaration */); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUsers(sourceFileLike); } @@ -113694,7 +114280,7 @@ var ts; } return { importSearches: importSearches, singleReferences: singleReferences }; function handleImport(decl) { - if (decl.kind === 253 /* ImportEqualsDeclaration */) { + if (decl.kind === 254 /* ImportEqualsDeclaration */) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } @@ -113704,7 +114290,7 @@ var ts; handleNamespaceImportLike(decl); return; } - if (decl.kind === 188 /* ImportType */) { + if (decl.kind === 189 /* ImportType */) { if (decl.qualifier) { var firstIdentifier = ts.getFirstIdentifier(decl.qualifier); if (firstIdentifier.escapedText === ts.symbolName(exportSymbol)) { @@ -113720,7 +114306,7 @@ var ts; if (decl.moduleSpecifier.kind !== 10 /* StringLiteral */) { return; } - if (decl.kind === 260 /* ExportDeclaration */) { + if (decl.kind === 261 /* ExportDeclaration */) { if (decl.exportClause && ts.isNamedExports(decl.exportClause)) { searchForNamedImport(decl.exportClause); } @@ -113729,10 +114315,10 @@ var ts; var _a = decl.importClause || { name: undefined, namedBindings: undefined }, name = _a.name, namedBindings = _a.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: handleNamespaceImportLike(namedBindings.name); break; - case 257 /* NamedImports */: + case 258 /* NamedImports */: // 'default' might be accessed as a named import `{ default as foo }`. if (exportKind === 0 /* Named */ || exportKind === 1 /* Default */) { searchForNamedImport(namedBindings); @@ -113782,7 +114368,7 @@ var ts; } } else { - var localSymbol = element.kind === 263 /* ExportSpecifier */ && element.propertyName + var localSymbol = element.kind === 264 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol. : checker.getSymbolAtLocation(name); addSearch(name, localSymbol); @@ -113811,7 +114397,7 @@ var ts; for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { var referencingFile = sourceFiles_1[_i]; var searchSourceFile = searchModuleSymbol.valueDeclaration; - if (searchSourceFile.kind === 290 /* SourceFile */) { + if (searchSourceFile.kind === 291 /* SourceFile */) { for (var _a = 0, _b = referencingFile.referencedFiles; _a < _b.length; _a++) { var ref = _b[_a]; if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { @@ -113859,7 +114445,7 @@ var ts; } /** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */ function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return ts.forEach(sourceFileLike.kind === 290 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return ts.forEach(sourceFileLike.kind === 291 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); }); } @@ -113874,15 +114460,15 @@ var ts; else { forEachPossibleImportOrExportStatement(sourceFile, function (statement) { switch (statement.kind) { - case 260 /* ExportDeclaration */: - case 254 /* ImportDeclaration */: { + case 261 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: { var decl = statement; if (decl.moduleSpecifier && ts.isStringLiteral(decl.moduleSpecifier)) { action(decl, decl.moduleSpecifier); } break; } - case 253 /* ImportEqualsDeclaration */: { + case 254 /* ImportEqualsDeclaration */: { var decl = statement; if (isExternalModuleImportEquals(decl)) { action(decl, decl.moduleReference.expression); @@ -113906,7 +114492,7 @@ var ts; var parent = node.parent; var grandParent = parent.parent; if (symbol.exportSymbol) { - if (parent.kind === 194 /* PropertyAccessExpression */) { + if (parent.kind === 195 /* PropertyAccessExpression */) { // When accessing an export of a JS module, there's no alias. The symbol will still be flagged as an export even though we're at the use. // So check that we are at the declaration. return symbol.declarations.some(function (d) { return d === parent; }) && ts.isBinaryExpression(grandParent) @@ -114036,13 +114622,13 @@ var ts; function isNodeImport(node) { var parent = node.parent; switch (parent.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return parent.name === node && isExternalModuleImportEquals(parent); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. return !parent.propertyName; - case 255 /* ImportClause */: - case 256 /* NamespaceImport */: + case 256 /* ImportClause */: + case 257 /* NamespaceImport */: ts.Debug.assert(parent.name === node); return true; default: @@ -114075,21 +114661,21 @@ var ts; return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 196 /* CallExpression */) { + if (node.kind === 197 /* CallExpression */) { return node.getSourceFile(); } var parent = node.parent; - if (parent.kind === 290 /* SourceFile */) { + if (parent.kind === 291 /* SourceFile */) { return parent; } - ts.Debug.assert(parent.kind === 250 /* ModuleBlock */); + ts.Debug.assert(parent.kind === 251 /* ModuleBlock */); return ts.cast(parent.parent, isAmbientModuleDeclaration); } function isAmbientModuleDeclaration(node) { - return node.kind === 249 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; + return node.kind === 250 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; } function isExternalModuleImportEquals(eq) { - return eq.moduleReference.kind === 265 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; + return eq.moduleReference.kind === 266 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; } })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); @@ -114191,7 +114777,7 @@ var ts; if (!node) return undefined; switch (node.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return !ts.isVariableDeclarationList(node.parent) || node.parent.declarations.length !== 1 ? node : ts.isVariableStatement(node.parent.parent) ? @@ -114199,27 +114785,27 @@ var ts; ts.isForInOrOfStatement(node.parent.parent) ? getContextNode(node.parent.parent) : node.parent; - case 191 /* BindingElement */: + case 192 /* BindingElement */: return getContextNode(node.parent.parent); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return node.parent.parent.parent; - case 263 /* ExportSpecifier */: - case 256 /* NamespaceImport */: + case 264 /* ExportSpecifier */: + case 257 /* NamespaceImport */: return node.parent.parent; - case 255 /* ImportClause */: + case 256 /* ImportClause */: return node.parent; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return ts.isExpressionStatement(node.parent) ? node.parent : node; - case 232 /* ForOfStatement */: - case 231 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 232 /* ForInStatement */: return { start: node.initializer, end: node.expression }; - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(ts.findAncestor(node.parent, function (node) { return ts.isBinaryExpression(node) || ts.isForInOrOfStatement(node); @@ -114280,13 +114866,13 @@ var ts; } FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { return undefined; } var checker = program.getTypeChecker(); // If invoked directly on a shorthand property assignment, then return // the declaration of the symbol being assigned (not the symbol being assigned to). - if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { var result_1 = []; Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_1.push(nodeEntry(node)); }); return result_1; @@ -114436,13 +115022,13 @@ var ts; if (symbol) { return getDefinitionKindAndDisplayParts(symbol, checker, node); } - else if (node.kind === 193 /* ObjectLiteralExpression */) { + else if (node.kind === 194 /* ObjectLiteralExpression */) { return { kind: "interface" /* interfaceElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("object literal"), ts.punctuationPart(21 /* CloseParenToken */)] }; } - else if (node.kind === 214 /* ClassExpression */) { + else if (node.kind === 215 /* ClassExpression */) { return { kind: "local class" /* localClassElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("anonymous local class"), ts.punctuationPart(21 /* CloseParenToken */)] @@ -114492,7 +115078,7 @@ var ts; return node.kind === 84 /* DefaultKeyword */ || !!ts.getDeclarationFromName(node) || ts.isLiteralComputedPropertyDeclarationName(node) - || (node.kind === 129 /* ConstructorKeyword */ && ts.isConstructorDeclaration(node.parent)); + || (node.kind === 130 /* ConstructorKeyword */ && ts.isConstructorDeclaration(node.parent)); } /** * True if 'decl' provides a value, as in `function f() {}`; @@ -114503,47 +115089,47 @@ var ts; if (!!(decl.flags & 8388608 /* Ambient */)) return true; switch (decl.kind) { - case 209 /* BinaryExpression */: - case 191 /* BindingElement */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 210 /* BinaryExpression */: + case 192 /* BindingElement */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: case 84 /* DefaultKeyword */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 263 /* ExportSpecifier */: - case 255 /* ImportClause */: // default import - case 253 /* ImportEqualsDeclaration */: - case 258 /* ImportSpecifier */: - case 246 /* InterfaceDeclaration */: - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: - case 273 /* JsxAttribute */: - case 249 /* ModuleDeclaration */: - case 252 /* NamespaceExportDeclaration */: - case 256 /* NamespaceImport */: - case 262 /* NamespaceExport */: - case 156 /* Parameter */: - case 282 /* ShorthandPropertyAssignment */: - case 247 /* TypeAliasDeclaration */: - case 155 /* TypeParameter */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 264 /* ExportSpecifier */: + case 256 /* ImportClause */: // default import + case 254 /* ImportEqualsDeclaration */: + case 259 /* ImportSpecifier */: + case 247 /* InterfaceDeclaration */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: + case 274 /* JsxAttribute */: + case 250 /* ModuleDeclaration */: + case 253 /* NamespaceExportDeclaration */: + case 257 /* NamespaceImport */: + case 263 /* NamespaceExport */: + case 157 /* Parameter */: + case 283 /* ShorthandPropertyAssignment */: + case 248 /* TypeAliasDeclaration */: + case 156 /* TypeParameter */: return true; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // In `({ x: y } = 0);`, `x` is not a write access. (Won't call this function for `y`.) return !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent); - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return !!decl.body; - case 242 /* VariableDeclaration */: - case 159 /* PropertyDeclaration */: + case 243 /* VariableDeclaration */: + case 160 /* PropertyDeclaration */: return !!decl.initializer || ts.isCatchClause(decl.parent); - case 160 /* MethodSignature */: - case 158 /* PropertySignature */: - case 323 /* JSDocPropertyTag */: - case 317 /* JSDocParameterTag */: + case 161 /* MethodSignature */: + case 159 /* PropertySignature */: + case 324 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: return false; default: return ts.Debug.failBadSyntaxKind(decl); @@ -114704,10 +115290,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; switch (decl.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: // Don't include the source file itself. (This may not be ideal behavior, but awkward to include an entire file as a reference.) break; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: if (sourceFilesSet.has(decl.getSourceFile().fileName)) { references.push(nodeEntry(decl.name)); } @@ -114736,9 +115322,9 @@ var ts; } /** As in a `readonly prop: any` or `constructor(readonly prop: any)`, not a `readonly any[]`. */ function isReadonlyTypeOperator(node) { - return node.kind === 138 /* ReadonlyKeyword */ + return node.kind === 139 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(node.parent) - && node.parent.operator === 138 /* ReadonlyKeyword */; + && node.parent.operator === 139 /* ReadonlyKeyword */; } /** getReferencedSymbols for special node kinds. */ function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { @@ -114749,12 +115335,12 @@ var ts; } // A modifier readonly (like on a property declaration) is not special; // a readonly type keyword (like `readonly string[]`) is. - if (node.kind === 138 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { + if (node.kind === 139 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { return undefined; } // Likewise, when we *are* looking for a special keyword, make sure we // *don’t* include readonly member modifiers. - return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 138 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); + return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 139 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); } // Labels if (ts.isJumpStatementTarget(node)) { @@ -114815,7 +115401,7 @@ var ts; } function getSpecialSearchKind(node) { switch (node.kind) { - case 129 /* ConstructorKeyword */: + case 130 /* ConstructorKeyword */: return 1 /* Constructor */; case 75 /* Identifier */: if (ts.isClassLike(node.parent)) { @@ -115055,7 +115641,7 @@ var ts; // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 201 /* FunctionExpression */ || valueDeclaration.kind === 214 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 202 /* FunctionExpression */ || valueDeclaration.kind === 215 /* ClassExpression */)) { return valueDeclaration; } if (!declarations) { @@ -115065,7 +115651,7 @@ var ts; if (flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.find(declarations, function (d) { return ts.hasModifier(d, 8 /* Private */) || ts.isPrivateIdentifierPropertyDeclaration(d); }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 245 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 246 /* ClassDeclaration */); } // Else this is a public property and could be accessed from anywhere. return undefined; @@ -115094,7 +115680,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (!container || container.kind === 290 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 291 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { // This is a global variable and not an external module, any declaration defined // within this scope is visible outside the file return undefined; @@ -115463,15 +116049,15 @@ var ts; if (constructorSymbol && constructorSymbol.declarations) { for (var _i = 0, _a = constructorSymbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - var ctrKeyword = ts.findChildOfKind(decl, 129 /* ConstructorKeyword */, sourceFile); - ts.Debug.assert(decl.kind === 162 /* Constructor */ && !!ctrKeyword); + var ctrKeyword = ts.findChildOfKind(decl, 130 /* ConstructorKeyword */, sourceFile); + ts.Debug.assert(decl.kind === 163 /* Constructor */ && !!ctrKeyword); addNode(ctrKeyword); } } if (classSymbol.exports) { classSymbol.exports.forEach(function (member) { var decl = member.valueDeclaration; - if (decl && decl.kind === 161 /* MethodDeclaration */) { + if (decl && decl.kind === 162 /* MethodDeclaration */) { var body = decl.body; if (body) { forEachDescendantOfKind(body, 104 /* ThisKeyword */, function (thisKeyword) { @@ -115495,7 +116081,7 @@ var ts; } for (var _i = 0, _a = constructor.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - ts.Debug.assert(decl.kind === 162 /* Constructor */); + ts.Debug.assert(decl.kind === 163 /* Constructor */); var body = decl.body; if (body) { forEachDescendantOfKind(body, 102 /* SuperKeyword */, function (node) { @@ -115525,7 +116111,7 @@ var ts; if (refNode.kind !== 75 /* Identifier */) { return; } - if (refNode.parent.kind === 282 /* ShorthandPropertyAssignment */) { + if (refNode.parent.kind === 283 /* ShorthandPropertyAssignment */) { // Go ahead and dereference the shorthand assignment by going to its definition getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); } @@ -115545,7 +116131,7 @@ var ts; } else if (ts.isFunctionLike(typeHavingNode) && typeHavingNode.body) { var body = typeHavingNode.body; - if (body.kind === 223 /* Block */) { + if (body.kind === 224 /* Block */) { ts.forEachReturnStatement(body, function (returnStatement) { if (returnStatement.expression) addIfImplementation(returnStatement.expression); @@ -115573,13 +116159,13 @@ var ts; */ function isImplementationExpression(node) { switch (node.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isImplementationExpression(node.expression); - case 202 /* ArrowFunction */: - case 201 /* FunctionExpression */: - case 193 /* ObjectLiteralExpression */: - case 214 /* ClassExpression */: - case 192 /* ArrayLiteralExpression */: + case 203 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 194 /* ObjectLiteralExpression */: + case 215 /* ClassExpression */: + case 193 /* ArrayLiteralExpression */: return true; default: return false; @@ -115632,13 +116218,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -115659,41 +116245,41 @@ var ts; return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references: references }]; } function isParameterName(node) { - return node.kind === 75 /* Identifier */ && node.parent.kind === 156 /* Parameter */ && node.parent.name === node; + return node.kind === 75 /* Identifier */ && node.parent.kind === 157 /* Parameter */ && node.parent.name === node; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); // Whether 'this' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // falls through - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { return undefined; } // falls through - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. default: return undefined; } - var references = ts.flatMap(searchSpaceNode.kind === 290 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { + var references = ts.flatMap(searchSpaceNode.kind === 291 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { cancellationToken.throwIfCancellationRequested(); return getPossibleSymbolReferenceNodes(sourceFile, "this", ts.isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter(function (node) { if (!ts.isThis(node)) { @@ -115701,19 +116287,19 @@ var ts; } var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); switch (searchSpaceNode.kind) { - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: return searchSpaceNode.symbol === container.symbol; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: return ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol; - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: // Make sure the container belongs to the same class // and has the appropriate static modifier from the original container. return container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag; - case 290 /* SourceFile */: - return container.kind === 290 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); + case 291 /* SourceFile */: + return container.kind === 291 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); } }); }).map(function (n) { return nodeEntry(n); }); @@ -115796,7 +116382,7 @@ var ts; ts.Debug.assert(paramProps.length === 2 && !!(paramProps[0].flags & 1 /* FunctionScopedVariable */) && !!(paramProps[1].flags & 4 /* Property */)); // is [parameter, property] return fromRoot(symbol.flags & 1 /* FunctionScopedVariable */ ? paramProps[1] : paramProps[0]); } - var exportSpecifier = ts.getDeclarationOfKind(symbol, 263 /* ExportSpecifier */); + var exportSpecifier = ts.getDeclarationOfKind(symbol, 264 /* ExportSpecifier */); if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) { var localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); if (localSymbol) { @@ -115841,7 +116427,7 @@ var ts; }); } function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { - var bindingElement = ts.getDeclarationOfKind(symbol, 191 /* BindingElement */); + var bindingElement = ts.getDeclarationOfKind(symbol, 192 /* BindingElement */); if (bindingElement && ts.isObjectBindingElementWithoutPropertyName(bindingElement)) { return ts.getPropertySymbolFromBindingElement(checker, bindingElement); } @@ -116237,55 +116823,55 @@ var ts; } switch (node.kind) { case 75 /* Identifier */: - case 253 /* ImportEqualsDeclaration */: - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: // do not descend into nodes that cannot contain callable nodes return; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: // do not descend into the type side of an assertion collect(node.expression); return; - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: // do not descend into the type of a variable or parameter declaration collect(node.name); collect(node.initializer); return; - case 196 /* CallExpression */: + case 197 /* CallExpression */: // do not descend into the type arguments of a call expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 197 /* NewExpression */: + case 198 /* NewExpression */: // do not descend into the type arguments of a new expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: // do not descend into the type arguments of a tagged template expression recordCallSite(node); collect(node.tag); collect(node.template); return; - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: // do not descend into the type arguments of a JsxOpeningLikeElement recordCallSite(node); collect(node.tagName); collect(node.attributes); return; - case 157 /* Decorator */: + case 158 /* Decorator */: recordCallSite(node); collect(node.expression); return; - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: recordCallSite(node); ts.forEachChild(node, collect); break; @@ -116335,22 +116921,22 @@ var ts; var callSites = []; var collect = createCallSiteCollector(program, callSites); switch (node.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: collectCallSitesOfSourceFile(node, collect); break; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: collectCallSitesOfModuleDeclaration(node, collect); break; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect); break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: collectCallSitesOfClassLikeDeclaration(node, collect); break; default: @@ -116647,7 +117233,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { var shorthandSymbol_1 = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); return shorthandSymbol_1 ? shorthandSymbol_1.declarations.map(function (decl) { return createDefinitionInfo(decl, typeChecker, shorthandSymbol_1, node); }) : []; } @@ -116816,11 +117402,11 @@ var ts; return true; } switch (declaration.kind) { - case 255 /* ImportClause */: - case 253 /* ImportEqualsDeclaration */: + case 256 /* ImportClause */: + case 254 /* ImportEqualsDeclaration */: return true; - case 258 /* ImportSpecifier */: - return declaration.parent.kind === 257 /* NamedImports */; + case 259 /* ImportSpecifier */: + return declaration.parent.kind === 258 /* NamedImports */; default: return false; } @@ -116834,7 +117420,7 @@ var ts; function getConstructSignatureDefinition() { // Applicable only if we are in a new expression, or we are on a constructor declaration // and in either case the symbol has a construct signature definition, i.e. class - if (symbol.flags & 32 /* Class */ && !(symbol.flags & 16 /* Function */) && (ts.isNewExpressionTarget(node) || node.kind === 129 /* ConstructorKeyword */)) { + if (symbol.flags & 32 /* Class */ && !(symbol.flags & 16 /* Function */) && (ts.isNewExpressionTarget(node) || node.kind === 130 /* ConstructorKeyword */)) { var cls = ts.find(filteredDeclarations, ts.isClassLike) || ts.Debug.fail("Expected declaration to have at least one class-like declaration"); return getSignatureDefinition(cls.members, /*selectConstructors*/ true); } @@ -116907,9 +117493,9 @@ var ts; } function isConstructorLike(node) { switch (node.kind) { - case 162 /* Constructor */: - case 171 /* ConstructorType */: - case 166 /* ConstructSignature */: + case 163 /* Constructor */: + case 172 /* ConstructorType */: + case 167 /* ConstructSignature */: return true; default: return false; @@ -117027,11 +117613,11 @@ var ts; JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; function getCommentHavingNodes(declaration) { switch (declaration.kind) { - case 317 /* JSDocParameterTag */: - case 323 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: + case 324 /* JSDocPropertyTag */: return [declaration]; - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: return [declaration, declaration.parent]; default: return ts.getJSDocCommentsAndTags(declaration); @@ -117052,18 +117638,18 @@ var ts; function getCommentText(tag) { var comment = tag.comment; switch (tag.kind) { - case 308 /* JSDocImplementsTag */: + case 309 /* JSDocImplementsTag */: return withNode(tag.class); - case 307 /* JSDocAugmentsTag */: + case 308 /* JSDocAugmentsTag */: return withNode(tag.class); - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return withList(tag.typeParameters); - case 320 /* JSDocTypeTag */: + case 321 /* JSDocTypeTag */: return withNode(tag.typeExpression); - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 323 /* JSDocPropertyTag */: - case 317 /* JSDocParameterTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 324 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: var name = tag.name; return name ? withNode(name) : comment; default: @@ -117232,23 +117818,23 @@ var ts; } function getCommentOwnerInfoWorker(commentOwner) { switch (commentOwner.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 160 /* MethodSignature */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 161 /* MethodSignature */: var parameters = commentOwner.parameters; return { commentOwner: commentOwner, parameters: parameters }; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return getCommentOwnerInfoWorker(commentOwner.initializer); - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 158 /* PropertySignature */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 247 /* TypeAliasDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 159 /* PropertySignature */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 248 /* TypeAliasDeclaration */: return { commentOwner: commentOwner }; - case 225 /* VariableStatement */: { + case 226 /* VariableStatement */: { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; var parameters_1 = varDeclarations.length === 1 && varDeclarations[0].initializer @@ -117256,14 +117842,14 @@ var ts; : undefined; return { commentOwner: commentOwner, parameters: parameters_1 }; } - case 290 /* SourceFile */: + case 291 /* SourceFile */: return "quit"; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: // If in walking up the tree, we hit a a nested namespace declaration, // then we must be somewhere within a dotted namespace name; however we don't // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. - return commentOwner.parent.kind === 249 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; - case 209 /* BinaryExpression */: { + return commentOwner.parent.kind === 250 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; + case 210 /* BinaryExpression */: { var be = commentOwner; if (ts.getAssignmentDeclarationKind(be) === 0 /* None */) { return "quit"; @@ -117271,7 +117857,7 @@ var ts; var parameters_2 = ts.isFunctionLike(be.right) ? be.right.parameters : ts.emptyArray; return { commentOwner: commentOwner, parameters: parameters_2 }; } - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: var init = commentOwner.initializer; if (init && (ts.isFunctionExpression(init) || ts.isArrowFunction(init))) { return { commentOwner: commentOwner, parameters: init.parameters }; @@ -117287,14 +117873,14 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 200 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 201 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return rightHandSide.parameters; - case 214 /* ClassExpression */: { + case 215 /* ClassExpression */: { var ctr = ts.find(rightHandSide.members, ts.isConstructorDeclaration); return ctr ? ctr.parameters : ts.emptyArray; } @@ -117356,9 +117942,9 @@ var ts; } function shouldKeepItem(declaration, checker) { switch (declaration.kind) { - case 255 /* ImportClause */: - case 258 /* ImportSpecifier */: - case 253 /* ImportEqualsDeclaration */: + case 256 /* ImportClause */: + case 259 /* ImportSpecifier */: + case 254 /* ImportEqualsDeclaration */: var importer = checker.getSymbolAtLocation(declaration.name); // TODO: GH#18217 var imported = checker.getAliasedSymbol(importer); return importer.escapedName !== imported.escapedName; @@ -117368,7 +117954,7 @@ var ts; } function tryAddSingleDeclarationName(declaration, containers) { var name = ts.getNameOfDeclaration(declaration); - return !!name && (pushLiteral(name, containers) || name.kind === 154 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); + return !!name && (pushLiteral(name, containers) || name.kind === 155 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); } // Only added the names of computed properties if they're simple dotted expressions, like: // @@ -117385,7 +117971,7 @@ var ts; // First, if we started with a computed property name, then add all but the last // portion into the container array. var name = ts.getNameOfDeclaration(declaration); - if (name && name.kind === 154 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { + if (name && name.kind === 155 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { return ts.emptyArray; } // Don't include the last portion. @@ -117592,7 +118178,7 @@ var ts; return; } switch (node.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it. var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); @@ -117604,21 +118190,21 @@ var ts; } } break; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 161 /* MethodSignature */: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 255 /* ImportClause */: + case 256 /* ImportClause */: var importClause = node; // Handle default import case e.g.: // import d from "mod"; @@ -117630,7 +118216,7 @@ var ts; // import {a, b as B} from "mod"; var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 256 /* NamespaceImport */) { + if (namedBindings.kind === 257 /* NamespaceImport */) { addLeafNode(namedBindings); } else { @@ -117641,17 +118227,17 @@ var ts; } } break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: addNodeWithRecursiveChild(node, node.name); break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: var expression = node.expression; // Use the expression as the name of the SpreadAssignment, otherwise show as . ts.isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node); break; - case 191 /* BindingElement */: - case 281 /* PropertyAssignment */: - case 242 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 282 /* PropertyAssignment */: + case 243 /* VariableDeclaration */: var _e = node, name = _e.name, initializer = _e.initializer; if (ts.isBindingPattern(name)) { addChildrenRecursively(name); @@ -117666,7 +118252,7 @@ var ts; addNodeWithRecursiveChild(node, initializer); } break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: var nameNode = node.name; // If we see a function declaration track as a possible ES5 class if (nameNode && ts.isIdentifier(nameNode)) { @@ -117674,11 +118260,11 @@ var ts; } addNodeWithRecursiveChild(node, node.body); break; - case 202 /* ArrowFunction */: - case 201 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 202 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: startNode(node); for (var _f = 0, _g = node.members; _f < _g.length; _f++) { var member = _g[_f]; @@ -117688,9 +118274,9 @@ var ts; } endNode(); break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: startNode(node); for (var _h = 0, _j = node.members; _h < _j.length; _h++) { var member = _j[_h]; @@ -117698,20 +118284,20 @@ var ts; } endNode(); break; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 259 /* ExportAssignment */: - case 263 /* ExportSpecifier */: - case 253 /* ImportEqualsDeclaration */: - case 167 /* IndexSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 247 /* TypeAliasDeclaration */: + case 260 /* ExportAssignment */: + case 264 /* ExportSpecifier */: + case 254 /* ImportEqualsDeclaration */: + case 168 /* IndexSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 248 /* TypeAliasDeclaration */: addLeafNode(node); break; - case 196 /* CallExpression */: - case 209 /* BinaryExpression */: { + case 197 /* CallExpression */: + case 210 /* BinaryExpression */: { var special = ts.getAssignmentDeclarationKind(node); switch (special) { case 1 /* ExportsProperty */: @@ -117953,12 +118539,12 @@ var ts; return false; } switch (a.kind) { - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return ts.hasModifier(a, 32 /* Static */) === ts.hasModifier(b, 32 /* Static */); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return areSameModule(a, b); default: return true; @@ -117974,7 +118560,7 @@ var ts; // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'! function areSameModule(a, b) { // TODO: GH#18217 - return a.body.kind === b.body.kind && (a.body.kind !== 249 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 250 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); } /** Merge source into target. Source should be thrown away after this is called. */ function merge(target, source) { @@ -118004,7 +118590,7 @@ var ts; * So `new()` can still come before an `aardvark` method. */ function tryGetName(node) { - if (node.kind === 249 /* ModuleDeclaration */) { + if (node.kind === 250 /* ModuleDeclaration */) { return getModuleName(node); } var declName = ts.getNameOfDeclaration(node); @@ -118013,16 +118599,16 @@ var ts; return propertyName && ts.unescapeLeadingUnderscores(propertyName); } switch (node.kind) { - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 214 /* ClassExpression */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 215 /* ClassExpression */: return getFunctionOrClassName(node); default: return undefined; } } function getItemName(node, name) { - if (node.kind === 249 /* ModuleDeclaration */) { + if (node.kind === 250 /* ModuleDeclaration */) { return cleanText(getModuleName(node)); } if (name) { @@ -118034,18 +118620,18 @@ var ts; } } switch (node.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return ts.isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; - case 202 /* ArrowFunction */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 203 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: if (ts.getModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -118053,13 +118639,13 @@ var ts; // (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the // navigation bar. return getFunctionOrClassName(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return "constructor"; - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: return "new()"; - case 165 /* CallSignature */: + case 166 /* CallSignature */: return "()"; - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: return "[]"; default: return ""; @@ -118092,19 +118678,19 @@ var ts; } // Some nodes are otherwise important enough to always include in the primary navigation menu. switch (navigationBarNodeKind(item)) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 248 /* EnumDeclaration */: - case 246 /* InterfaceDeclaration */: - case 249 /* ModuleDeclaration */: - case 290 /* SourceFile */: - case 247 /* TypeAliasDeclaration */: - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 249 /* EnumDeclaration */: + case 247 /* InterfaceDeclaration */: + case 250 /* ModuleDeclaration */: + case 291 /* SourceFile */: + case 248 /* TypeAliasDeclaration */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: return true; - case 202 /* ArrowFunction */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -118114,10 +118700,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 250 /* ModuleBlock */: - case 290 /* SourceFile */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: + case 251 /* ModuleBlock */: + case 291 /* SourceFile */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: return true; default: return false; @@ -118177,7 +118763,7 @@ var ts; // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 249 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 250 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } @@ -118191,13 +118777,13 @@ var ts; return decl.body && ts.isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 154 /* ComputedPropertyName */; + return !member.name || member.name.kind === 155 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 290 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); + return node.kind === 291 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); } function getModifiers(node) { - if (node.parent && node.parent.kind === 242 /* VariableDeclaration */) { + if (node.parent && node.parent.kind === 243 /* VariableDeclaration */) { node = node.parent; } return ts.getNodeModifiers(node); @@ -118255,9 +118841,9 @@ var ts; } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 202 /* ArrowFunction */: - case 201 /* FunctionExpression */: - case 214 /* ClassExpression */: + case 203 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 215 /* ClassExpression */: return true; default: return false; @@ -118765,7 +119351,7 @@ var ts; } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 223 /* Block */: + case 224 /* Block */: if (ts.isFunctionLike(n.parent)) { return functionSpan(n.parent, n, sourceFile); } @@ -118773,16 +119359,16 @@ var ts; // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. switch (n.parent.kind) { - case 228 /* DoStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 230 /* ForStatement */: - case 227 /* IfStatement */: - case 229 /* WhileStatement */: - case 236 /* WithStatement */: - case 280 /* CatchClause */: + case 229 /* DoStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 231 /* ForStatement */: + case 228 /* IfStatement */: + case 230 /* WhileStatement */: + case 237 /* WithStatement */: + case 281 /* CatchClause */: return spanForNode(n.parent); - case 240 /* TryStatement */: + case 241 /* TryStatement */: // Could be the try-block, or the finally-block. var tryStatement = n.parent; if (tryStatement.tryBlock === n) { @@ -118799,26 +119385,29 @@ var ts; // the span of the block, independent of any parent span. return createOutliningSpan(ts.createTextSpanFromNode(n, sourceFile), "code" /* Code */); } - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return spanForNode(n.parent); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 251 /* CaseBlock */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 252 /* CaseBlock */: return spanForNode(n); - case 193 /* ObjectLiteralExpression */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: + return spanForNodeArray(n.statements); + case 194 /* ObjectLiteralExpression */: return spanForObjectOrArrayLiteral(n); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return spanForObjectOrArrayLiteral(n, 22 /* OpenBracketToken */); - case 266 /* JsxElement */: + case 267 /* JsxElement */: return spanForJSXElement(n); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return spanForJSXFragment(n); - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: return spanForJSXAttributes(n.attributes); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: return spanForTemplateLiteral(n); } @@ -118861,13 +119450,16 @@ var ts; var closeToken = ts.findChildOfKind(n, close, sourceFile); return openToken && closeToken && spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart); } + function spanForNodeArray(nodeArray) { + return nodeArray.length ? createOutliningSpan(ts.createTextSpanFromRange(nodeArray), "code" /* Code */) : undefined; + } } function functionSpan(node, body, sourceFile) { var openToken = ts.isNodeArrayMultiLine(node.parameters, sourceFile) ? ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile) : ts.findChildOfKind(body, 18 /* OpenBraceToken */, sourceFile); var closeToken = ts.findChildOfKind(body, 19 /* CloseBraceToken */, sourceFile); - return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 202 /* ArrowFunction */); + return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 203 /* ArrowFunction */); } function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart) { if (autoCollapse === void 0) { autoCollapse = false; } @@ -119402,10 +119994,10 @@ var ts; */ function tryConsumeDeclare() { var token = ts.scanner.getToken(); - if (token === 130 /* DeclareKeyword */) { + if (token === 131 /* DeclareKeyword */) { // declare module "mod" token = nextToken(); - if (token === 135 /* ModuleKeyword */) { + if (token === 136 /* ModuleKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { recordAmbientExternalModule(); @@ -119427,7 +120019,7 @@ var ts; token = nextToken(); if (token === 20 /* OpenParenToken */) { token = nextToken(); - if (token === 10 /* StringLiteral */) { + if (token === 10 /* StringLiteral */ || token === 14 /* NoSubstitutionTemplateLiteral */) { // import("mod"); recordModuleName(); return true; @@ -119441,7 +120033,7 @@ var ts; else { if (token === 75 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 149 /* FromKeyword */) { + if (token === 150 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import d from "mod"; @@ -119472,7 +120064,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 149 /* FromKeyword */) { + if (token === 150 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import {a as A} from "mod"; @@ -119488,7 +120080,7 @@ var ts; token = nextToken(); if (token === 75 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 149 /* FromKeyword */) { + if (token === 150 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import * as NS from "mod" @@ -119518,7 +120110,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 149 /* FromKeyword */) { + if (token === 150 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export {a as A} from "mod"; @@ -119530,7 +120122,7 @@ var ts; } else if (token === 41 /* AsteriskToken */) { token = nextToken(); - if (token === 149 /* FromKeyword */) { + if (token === 150 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export * from "mod" @@ -119553,13 +120145,15 @@ var ts; } return false; } - function tryConsumeRequireCall(skipCurrentToken) { + function tryConsumeRequireCall(skipCurrentToken, allowTemplateLiterals) { + if (allowTemplateLiterals === void 0) { allowTemplateLiterals = false; } var token = skipCurrentToken ? nextToken() : ts.scanner.getToken(); - if (token === 139 /* RequireKeyword */) { + if (token === 140 /* RequireKeyword */) { token = nextToken(); if (token === 20 /* OpenParenToken */) { token = nextToken(); - if (token === 10 /* StringLiteral */) { + if (token === 10 /* StringLiteral */ || + allowTemplateLiterals && token === 14 /* NoSubstitutionTemplateLiteral */) { // require("mod"); recordModuleName(); } @@ -119576,7 +120170,7 @@ var ts; return true; } token = nextToken(); - if (token === 10 /* StringLiteral */) { + if (token === 10 /* StringLiteral */ || token === 14 /* NoSubstitutionTemplateLiteral */) { // looks like define ("modname", ... - skip string literal and comma token = nextToken(); if (token === 27 /* CommaToken */) { @@ -119596,7 +120190,7 @@ var ts; // scan until ']' or EOF while (token !== 23 /* CloseBracketToken */ && token !== 1 /* EndOfFileToken */) { // record string literals as module names - if (token === 10 /* StringLiteral */) { + if (token === 10 /* StringLiteral */ || token === 14 /* NoSubstitutionTemplateLiteral */) { recordModuleName(); } token = nextToken(); @@ -119631,7 +120225,8 @@ var ts; if (tryConsumeDeclare() || tryConsumeImport() || tryConsumeExport() || - (detectJavaScriptImports && (tryConsumeRequireCall(/*skipCurrentToken*/ false) || tryConsumeDefine()))) { + (detectJavaScriptImports && (tryConsumeRequireCall(/*skipCurrentToken*/ false, /*allowTemplateLiterals*/ true) || + tryConsumeDefine()))) { continue; } else { @@ -119707,14 +120302,14 @@ var ts; return getRenameInfoError(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); } // Cannot rename `default` as in `import { default as foo } from "./someModule"; - if (ts.isIdentifier(node) && node.originalKeywordKind === 84 /* DefaultKeyword */ && symbol.parent.flags & 1536 /* Module */) { + if (ts.isIdentifier(node) && node.originalKeywordKind === 84 /* DefaultKeyword */ && symbol.parent && symbol.parent.flags & 1536 /* Module */) { return undefined; } if (ts.isStringLiteralLike(node) && ts.tryGetImportFromModuleSpecifier(node)) { return options && options.allowRenameOfImportPath ? getRenameInfoForModule(node, sourceFile, symbol) : undefined; } var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 154 /* ComputedPropertyName */) + var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 155 /* ComputedPropertyName */) ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node)) : undefined; var displayName = specifierName || typeChecker.symbolToString(symbol); @@ -119926,14 +120521,14 @@ var ts; ts.Debug.assertEqual(closeBraceToken.kind, 19 /* CloseBraceToken */); // Group `-/+readonly` and `-/+?` var groupedWithPlusMinusTokens = groupChildren(children, function (child) { - return child === node.readonlyToken || child.kind === 138 /* ReadonlyKeyword */ || + return child === node.readonlyToken || child.kind === 139 /* ReadonlyKeyword */ || child === node.questionToken || child.kind === 57 /* QuestionToken */; }); // Group type parameter with surrounding brackets var groupedWithBrackets = groupChildren(groupedWithPlusMinusTokens, function (_a) { var kind = _a.kind; return kind === 22 /* OpenBracketToken */ || - kind === 155 /* TypeParameter */ || + kind === 156 /* TypeParameter */ || kind === 23 /* CloseBracketToken */; }); return [ @@ -120040,7 +120635,7 @@ var ts; } function createSyntaxList(children) { ts.Debug.assertGreaterThanOrEqual(children.length, 1); - var syntaxList = ts.createNode(324 /* SyntaxList */, children[0].pos, ts.last(children).end); + var syntaxList = ts.createNode(325 /* SyntaxList */, children[0].pos, ts.last(children).end); syntaxList._children = children; return syntaxList; } @@ -120049,14 +120644,14 @@ var ts; return kind === 18 /* OpenBraceToken */ || kind === 22 /* OpenBracketToken */ || kind === 20 /* OpenParenToken */ - || kind === 268 /* JsxOpeningElement */; + || kind === 269 /* JsxOpeningElement */; } function isListCloser(token) { var kind = token && token.kind; return kind === 19 /* CloseBraceToken */ || kind === 23 /* CloseBracketToken */ || kind === 21 /* CloseParenToken */ - || kind === 269 /* JsxClosingElement */; + || kind === 270 /* JsxClosingElement */; } })(SmartSelectionRange = ts.SmartSelectionRange || (ts.SmartSelectionRange = {})); })(ts || (ts = {})); @@ -120261,10 +120856,10 @@ var ts; } return undefined; } - else if (ts.isTemplateHead(node) && parent.parent.kind === 198 /* TaggedTemplateExpression */) { + else if (ts.isTemplateHead(node) && parent.parent.kind === 199 /* TaggedTemplateExpression */) { var templateExpression = parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 211 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 212 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } @@ -120331,17 +120926,17 @@ var ts; return undefined; var parent = startingToken.parent; switch (parent.kind) { - case 200 /* ParenthesizedExpression */: - case 161 /* MethodDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 201 /* ParenthesizedExpression */: + case 162 /* MethodDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: var info = getArgumentOrParameterListInfo(startingToken, sourceFile); if (!info) return undefined; var argumentIndex = info.argumentIndex, argumentCount = info.argumentCount, argumentsSpan = info.argumentsSpan; var contextualType = ts.isMethodDeclaration(parent) ? checker.getContextualTypeForObjectLiteralElement(parent) : checker.getContextualType(parent); return contextualType && { contextualType: contextualType, argumentIndex: argumentIndex, argumentCount: argumentCount, argumentsSpan: argumentsSpan }; - case 209 /* BinaryExpression */: { + case 210 /* BinaryExpression */: { var highestBinary = getHighestBinary(parent); var contextualType_1 = checker.getContextualType(highestBinary); var argumentIndex_1 = startingToken.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent) - 1; @@ -120465,7 +121060,7 @@ var ts; // | | // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 211 /* TemplateExpression */) { + if (template.kind === 212 /* TemplateExpression */) { var lastSpan = ts.last(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -120812,11 +121407,11 @@ var ts; function containsTopLevelCommonjs(sourceFile) { return sourceFile.statements.some(function (statement) { switch (statement.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return statement.declarationList.declarations.some(function (decl) { return !!decl.initializer && ts.isRequireCall(propertyAccessLeftHandSide(decl.initializer), /*checkArgumentIsStringLiteralLike*/ true); }); - case 226 /* ExpressionStatement */: { + case 227 /* ExpressionStatement */: { var expression = statement.expression; if (!ts.isBinaryExpression(expression)) return ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true); @@ -120833,12 +121428,12 @@ var ts; } function importNameForConvertToDefaultImport(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: var importClause = node.importClause, moduleSpecifier = node.moduleSpecifier; - return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 256 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) + return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 257 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : undefined; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return node.name; default: return undefined; @@ -120896,9 +121491,9 @@ var ts; // should be kept up to date with getTransformationBody in convertToAsyncFunction.ts function isFixablePromiseArgument(arg) { switch (arg.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); // falls through case 100 /* NullKeyword */: @@ -120913,7 +121508,7 @@ var ts; } function canBeConvertedToClass(node) { var _a, _b, _c, _d; - if (node.kind === 201 /* FunctionExpression */) { + if (node.kind === 202 /* FunctionExpression */) { if (ts.isVariableDeclaration(node.parent) && ((_a = node.symbol.members) === null || _a === void 0 ? void 0 : _a.size)) { return true; } @@ -120921,7 +121516,7 @@ var ts; var symbol = decl === null || decl === void 0 ? void 0 : decl.symbol; return !!(symbol && (((_b = symbol.exports) === null || _b === void 0 ? void 0 : _b.size) || ((_c = symbol.members) === null || _c === void 0 ? void 0 : _c.size))); } - if (node.kind === 244 /* FunctionDeclaration */) { + if (node.kind === 245 /* FunctionDeclaration */) { return !!((_d = node.symbol.members) === null || _d === void 0 ? void 0 : _d.size); } return false; @@ -120940,7 +121535,7 @@ var ts; } var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32 /* Class */) { - return ts.getDeclarationOfKind(symbol, 214 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 215 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; } if (flags & 384 /* Enum */) @@ -121026,11 +121621,11 @@ var ts; // If we requested completions after `x.` at the top-level, we may be at a source file location. switch (location.parent && location.parent.kind) { // If we've typed a character of the attribute name, will be 'JsxAttribute', else will be 'JsxOpeningElement'. - case 268 /* JsxOpeningElement */: - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: return location.kind === 75 /* Identifier */ ? "property" /* memberVariableElement */ : "JSX attribute" /* jsxAttribute */; - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return "JSX attribute" /* jsxAttribute */; default: return "property" /* memberVariableElement */; @@ -121074,7 +121669,7 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (location.parent && location.parent.kind === 194 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 195 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -121094,7 +121689,7 @@ var ts; } if (callExpressionLike) { signature = typeChecker.getResolvedSignature(callExpressionLike); // TODO: GH#18217 - var useConstructSignatures = callExpressionLike.kind === 197 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 102 /* SuperKeyword */); + var useConstructSignatures = callExpressionLike.kind === 198 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 102 /* SuperKeyword */); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -121150,29 +121745,29 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || // name of function declaration - (location.kind === 129 /* ConstructorKeyword */ && location.parent.kind === 162 /* Constructor */)) { // At constructor keyword of constructor declaration + (location.kind === 130 /* ConstructorKeyword */ && location.parent.kind === 163 /* Constructor */)) { // At constructor keyword of constructor declaration // get the signature from the declaration and write it var functionDeclaration_1 = location.parent; // Use function declaration to write the signatures only if the symbol corresponding to this declaration var locationIsSymbolDeclaration = symbol.declarations && ts.find(symbol.declarations, function (declaration) { - return declaration === (location.kind === 129 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); + return declaration === (location.kind === 130 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); }); if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 162 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration_1.kind === 163 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); // TODO: GH#18217 } else { signature = allSignatures[0]; } - if (functionDeclaration_1.kind === 162 /* Constructor */) { + if (functionDeclaration_1.kind === 163 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = "constructor" /* constructorImplementationElement */; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 165 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 166 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -121183,7 +121778,7 @@ var ts; } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { addAliasPrefixIfNecessary(); - if (ts.getDeclarationOfKind(symbol, 214 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 215 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -121206,7 +121801,7 @@ var ts; } if ((symbolFlags & 524288 /* TypeAlias */) && (semanticMeaning & 2 /* Type */)) { prefixNextMeaning(); - displayParts.push(ts.keywordPart(145 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(146 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); @@ -121227,9 +121822,9 @@ var ts; } if (symbolFlags & 1536 /* Module */ && !isThisExpression) { prefixNextMeaning(); - var declaration = ts.getDeclarationOfKind(symbol, 249 /* ModuleDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 250 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 75 /* Identifier */; - displayParts.push(ts.keywordPart(isNamespace ? 136 /* NamespaceKeyword */ : 135 /* ModuleKeyword */)); + displayParts.push(ts.keywordPart(isNamespace ? 137 /* NamespaceKeyword */ : 136 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -121248,7 +121843,7 @@ var ts; } else { // Method/function type parameter - var decl = ts.getDeclarationOfKind(symbol, 155 /* TypeParameter */); + var decl = ts.getDeclarationOfKind(symbol, 156 /* TypeParameter */); if (decl === undefined) return ts.Debug.fail(); var declaration = decl.parent; @@ -121256,21 +121851,21 @@ var ts; if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); // TODO: GH#18217 - if (declaration.kind === 166 /* ConstructSignature */) { + if (declaration.kind === 167 /* ConstructSignature */) { displayParts.push(ts.keywordPart(99 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 165 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 166 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } - else if (declaration.kind === 247 /* TypeAliasDeclaration */) { + else if (declaration.kind === 248 /* TypeAliasDeclaration */) { // Type alias type parameter // For example // type list = T[]; // Both T will go through same code path addInPrefix(); - displayParts.push(ts.keywordPart(145 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(146 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -121282,7 +121877,7 @@ var ts; symbolKind = "enum member" /* enumMemberElement */; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 284 /* EnumMember */) { + if (declaration.kind === 285 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -121312,17 +121907,17 @@ var ts; } } switch (symbol.declarations[0].kind) { - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(136 /* NamespaceKeyword */)); + displayParts.push(ts.keywordPart(137 /* NamespaceKeyword */)); break; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 62 /* EqualsToken */ : 84 /* DefaultKeyword */)); break; - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); break; default: @@ -121331,13 +121926,13 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 253 /* ImportEqualsDeclaration */) { + if (declaration.kind === 254 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(62 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(139 /* RequireKeyword */)); + displayParts.push(ts.keywordPart(140 /* RequireKeyword */)); displayParts.push(ts.punctuationPart(20 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(21 /* CloseParenToken */)); @@ -121410,10 +122005,10 @@ var ts; // For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo` // there documentation comments might be attached to the right hand side symbol of their declarations. // The pattern of such special property access is that the parent symbol is the symbol of the file. - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 290 /* SourceFile */; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 291 /* SourceFile */; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 209 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 210 /* BinaryExpression */) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -121531,16 +122126,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 201 /* FunctionExpression */) { + if (declaration.kind === 202 /* FunctionExpression */) { return true; } - if (declaration.kind !== 242 /* VariableDeclaration */ && declaration.kind !== 244 /* FunctionDeclaration */) { + if (declaration.kind !== 243 /* VariableDeclaration */ && declaration.kind !== 245 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { // Reached source file or module block - if (parent.kind === 290 /* SourceFile */ || parent.kind === 250 /* ModuleBlock */) { + if (parent.kind === 291 /* SourceFile */ || parent.kind === 251 /* ModuleBlock */) { return false; } } @@ -121840,10 +122435,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 273 /* JsxAttribute */: - case 268 /* JsxOpeningElement */: - case 269 /* JsxClosingElement */: - case 267 /* JsxSelfClosingElement */: + case 274 /* JsxAttribute */: + case 269 /* JsxOpeningElement */: + case 270 /* JsxClosingElement */: + case 268 /* JsxSelfClosingElement */: // May parse an identifier like `module-layout`; that will be scanned as a keyword at first, but we should parse the whole thing to get an identifier. return ts.isKeyword(node.kind) || node.kind === 75 /* Identifier */; } @@ -122035,7 +122630,7 @@ var ts; (function (formatting) { function getAllRules() { var allTokens = []; - for (var token = 0 /* FirstToken */; token <= 152 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 153 /* LastToken */; token++) { if (token !== 1 /* EndOfFileToken */) { allTokens.push(token); } @@ -122050,9 +122645,9 @@ var ts; var anyToken = { tokens: allTokens, isSpecific: false }; var anyTokenIncludingMultilineComments = tokenRangeFrom(__spreadArrays(allTokens, [3 /* MultiLineCommentTrivia */])); var anyTokenIncludingEOF = tokenRangeFrom(__spreadArrays(allTokens, [1 /* EndOfFileToken */])); - var keywords = tokenRangeFromRange(77 /* FirstKeyword */, 152 /* LastKeyword */); + var keywords = tokenRangeFromRange(77 /* FirstKeyword */, 153 /* LastKeyword */); var binaryOperators = tokenRangeFromRange(29 /* FirstBinaryOperator */, 74 /* LastBinaryOperator */); - var binaryKeywordOperators = [97 /* InKeyword */, 98 /* InstanceOfKeyword */, 152 /* OfKeyword */, 123 /* AsKeyword */, 133 /* IsKeyword */]; + var binaryKeywordOperators = [97 /* InKeyword */, 98 /* InstanceOfKeyword */, 153 /* OfKeyword */, 123 /* AsKeyword */, 134 /* IsKeyword */]; var unaryPrefixOperators = [45 /* PlusPlusToken */, 46 /* MinusMinusToken */, 54 /* TildeToken */, 53 /* ExclamationToken */]; var unaryPrefixExpressions = [ 8 /* NumericLiteral */, 9 /* BigIntLiteral */, 75 /* Identifier */, 20 /* OpenParenToken */, @@ -122126,7 +122721,7 @@ var ts; // Though, we do extra check on the context to make sure we are dealing with get/set node. Example: // get x() {} // set x(val) {} - rule("SpaceAfterGetSetInMember", [131 /* GetKeyword */, 142 /* SetKeyword */], 75 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), + rule("SpaceAfterGetSetInMember", [132 /* GetKeyword */, 143 /* SetKeyword */], 75 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), rule("NoSpaceBetweenYieldKeywordAndStar", 121 /* YieldKeyword */, 41 /* AsteriskToken */, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 16 /* DeleteSpace */), rule("SpaceBetweenYieldOrYieldStarAndOperand", [121 /* YieldKeyword */, 41 /* AsteriskToken */], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 4 /* InsertSpace */), rule("NoSpaceBetweenReturnAndSemicolon", 101 /* ReturnKeyword */, 26 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), @@ -122150,34 +122745,34 @@ var ts; rule("NoSpaceAfterEqualInJsxAttribute", 62 /* EqualsToken */, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // TypeScript-specific rules // Use of module as a function call. e.g.: import m2 = module("m2"); - rule("NoSpaceAfterModuleImport", [135 /* ModuleKeyword */, 139 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("NoSpaceAfterModuleImport", [136 /* ModuleKeyword */, 140 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // Add a space around certain TypeScript keywords rule("SpaceAfterCertainTypeScriptKeywords", [ 122 /* AbstractKeyword */, 80 /* ClassKeyword */, - 130 /* DeclareKeyword */, + 131 /* DeclareKeyword */, 84 /* DefaultKeyword */, 88 /* EnumKeyword */, 89 /* ExportKeyword */, 90 /* ExtendsKeyword */, - 131 /* GetKeyword */, + 132 /* GetKeyword */, 113 /* ImplementsKeyword */, 96 /* ImportKeyword */, 114 /* InterfaceKeyword */, - 135 /* ModuleKeyword */, - 136 /* NamespaceKeyword */, + 136 /* ModuleKeyword */, + 137 /* NamespaceKeyword */, 117 /* PrivateKeyword */, 119 /* PublicKeyword */, 118 /* ProtectedKeyword */, - 138 /* ReadonlyKeyword */, - 142 /* SetKeyword */, + 139 /* ReadonlyKeyword */, + 143 /* SetKeyword */, 120 /* StaticKeyword */, - 145 /* TypeKeyword */, - 149 /* FromKeyword */, - 134 /* KeyOfKeyword */, - 132 /* InferKeyword */, + 146 /* TypeKeyword */, + 150 /* FromKeyword */, + 135 /* KeyOfKeyword */, + 133 /* InferKeyword */, ], anyToken, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [90 /* ExtendsKeyword */, 113 /* ImplementsKeyword */, 149 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), + rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [90 /* ExtendsKeyword */, 113 /* ImplementsKeyword */, 150 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { rule("SpaceAfterModuleName", 10 /* StringLiteral */, 18 /* OpenBraceToken */, [isModuleDeclContext], 4 /* InsertSpace */), // Lambda expressions @@ -122208,8 +122803,8 @@ var ts; 119 /* PublicKeyword */, 117 /* PrivateKeyword */, 118 /* ProtectedKeyword */, - 131 /* GetKeyword */, - 142 /* SetKeyword */, + 132 /* GetKeyword */, + 143 /* SetKeyword */, 22 /* OpenBracketToken */, 41 /* AsteriskToken */, ], [isEndOfDecoratorContextOnSameLine], 4 /* InsertSpace */), @@ -122220,8 +122815,8 @@ var ts; // These rules are applied after high priority var userConfigurableRules = [ // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses - rule("SpaceAfterConstructor", 129 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("NoSpaceAfterConstructor", 129 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("SpaceAfterConstructor", 130 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), + rule("NoSpaceAfterConstructor", 130 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), rule("SpaceAfterComma", 27 /* CommaToken */, anyToken, [isOptionEnabled("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNextTokenNotCloseBracket, isNextTokenNotCloseParen], 4 /* InsertSpace */), rule("NoSpaceAfterComma", 27 /* CommaToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext], 16 /* DeleteSpace */), // Insert space after function keyword for anonymous functions @@ -122249,6 +122844,9 @@ var ts; rule("NoSpaceBetweenEmptyBraceBrackets", 18 /* OpenBraceToken */, 19 /* CloseBraceToken */, [isNonJsxSameLineTokenContext, isObjectContext], 16 /* DeleteSpace */), rule("NoSpaceAfterOpenBrace", 18 /* OpenBraceToken */, anyToken, [isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), rule("NoSpaceBeforeCloseBrace", anyToken, 19 /* CloseBraceToken */, [isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + // Insert a space after opening and before closing empty brace brackets + rule("SpaceBetweenEmptyBraceBrackets", 18 /* OpenBraceToken */, 19 /* CloseBraceToken */, [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces")], 4 /* InsertSpace */), + rule("NoSpaceBetweenEmptyBraceBrackets", 18 /* OpenBraceToken */, 19 /* CloseBraceToken */, [isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // Insert space after opening and before closing template string braces rule("SpaceAfterTemplateHeadAndMiddle", [15 /* TemplateHead */, 16 /* TemplateMiddle */], anyToken, [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), rule("SpaceBeforeTemplateMiddleAndTail", anyToken, [16 /* TemplateMiddle */, 17 /* TemplateTail */], [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), @@ -122360,51 +122958,51 @@ var ts; return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; }; } function isForContext(context) { - return context.contextNode.kind === 230 /* ForStatement */; + return context.contextNode.kind === 231 /* ForStatement */; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return context.contextNode.operatorToken.kind !== 27 /* CommaToken */; - case 210 /* ConditionalExpression */: - case 180 /* ConditionalType */: - case 217 /* AsExpression */: - case 263 /* ExportSpecifier */: - case 258 /* ImportSpecifier */: - case 168 /* TypePredicate */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: + case 211 /* ConditionalExpression */: + case 181 /* ConditionalType */: + case 218 /* AsExpression */: + case 264 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 169 /* TypePredicate */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 191 /* BindingElement */: + case 192 /* BindingElement */: // equals in type X = ... // falls through - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: // equal in import a = module('a'); // falls through - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // equal in let a = 0 // falls through - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: // equal in p = 0 // falls through - case 156 /* Parameter */: - case 284 /* EnumMember */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 157 /* Parameter */: + case 285 /* EnumMember */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: // "in" keyword in [P in keyof T]: T[P] // falls through - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return context.currentTokenSpan.kind === 97 /* InKeyword */ || context.nextTokenSpan.kind === 97 /* InKeyword */ || context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 232 /* ForOfStatement */: - return context.currentTokenSpan.kind === 152 /* OfKeyword */ || context.nextTokenSpan.kind === 152 /* OfKeyword */; + case 233 /* ForOfStatement */: + return context.currentTokenSpan.kind === 153 /* OfKeyword */ || context.nextTokenSpan.kind === 153 /* OfKeyword */; } return false; } @@ -122416,22 +123014,22 @@ var ts; } function isTypeAnnotationContext(context) { var contextKind = context.contextNode.kind; - return contextKind === 159 /* PropertyDeclaration */ || - contextKind === 158 /* PropertySignature */ || - contextKind === 156 /* Parameter */ || - contextKind === 242 /* VariableDeclaration */ || + return contextKind === 160 /* PropertyDeclaration */ || + contextKind === 159 /* PropertySignature */ || + contextKind === 157 /* Parameter */ || + contextKind === 243 /* VariableDeclaration */ || ts.isFunctionLikeKind(contextKind); } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 210 /* ConditionalExpression */ || - context.contextNode.kind === 180 /* ConditionalType */; + return context.contextNode.kind === 211 /* ConditionalExpression */ || + context.contextNode.kind === 181 /* ConditionalType */; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 189 /* ObjectBindingPattern */ || - context.contextNode.kind === 186 /* MappedType */ || + return context.contextNode.kind === 190 /* ObjectBindingPattern */ || + context.contextNode.kind === 187 /* MappedType */ || isSingleLineBlockContext(context); } // This check is done before an open brace in a control construct, a function, or a typescript block declaration @@ -122457,34 +123055,34 @@ var ts; return true; } switch (node.kind) { - case 223 /* Block */: - case 251 /* CaseBlock */: - case 193 /* ObjectLiteralExpression */: - case 250 /* ModuleBlock */: + case 224 /* Block */: + case 252 /* CaseBlock */: + case 194 /* ObjectLiteralExpression */: + case 251 /* ModuleBlock */: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: // falls through - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // case SyntaxKind.MethodSignature: // falls through - case 165 /* CallSignature */: - case 201 /* FunctionExpression */: - case 162 /* Constructor */: - case 202 /* ArrowFunction */: + case 166 /* CallSignature */: + case 202 /* FunctionExpression */: + case 163 /* Constructor */: + case 203 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: // falls through - case 246 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one + case 247 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one return true; } return false; @@ -122493,40 +123091,40 @@ var ts; return !isFunctionDeclContext(context); } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 244 /* FunctionDeclaration */ || context.contextNode.kind === 201 /* FunctionExpression */; + return context.contextNode.kind === 245 /* FunctionDeclaration */ || context.contextNode.kind === 202 /* FunctionExpression */; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 173 /* TypeLiteral */: - case 249 /* ModuleDeclaration */: - case 260 /* ExportDeclaration */: - case 261 /* NamedExports */: - case 254 /* ImportDeclaration */: - case 257 /* NamedImports */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 174 /* TypeLiteral */: + case 250 /* ModuleDeclaration */: + case 261 /* ExportDeclaration */: + case 262 /* NamedExports */: + case 255 /* ImportDeclaration */: + case 258 /* NamedImports */: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 245 /* ClassDeclaration */: - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: - case 280 /* CatchClause */: - case 250 /* ModuleBlock */: - case 237 /* SwitchStatement */: + case 246 /* ClassDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 281 /* CatchClause */: + case 251 /* ModuleBlock */: + case 238 /* SwitchStatement */: return true; - case 223 /* Block */: { + case 224 /* Block */: { var blockParent = context.currentTokenParent.parent; // In a codefix scenario, we can't rely on parents being set. So just always return true. - if (!blockParent || blockParent.kind !== 202 /* ArrowFunction */ && blockParent.kind !== 201 /* FunctionExpression */) { + if (!blockParent || blockParent.kind !== 203 /* ArrowFunction */ && blockParent.kind !== 202 /* FunctionExpression */) { return true; } } @@ -122535,32 +123133,32 @@ var ts; } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 227 /* IfStatement */: - case 237 /* SwitchStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 229 /* WhileStatement */: - case 240 /* TryStatement */: - case 228 /* DoStatement */: - case 236 /* WithStatement */: + case 228 /* IfStatement */: + case 238 /* SwitchStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 230 /* WhileStatement */: + case 241 /* TryStatement */: + case 229 /* DoStatement */: + case 237 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: // falls through - case 280 /* CatchClause */: + case 281 /* CatchClause */: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 193 /* ObjectLiteralExpression */; + return context.contextNode.kind === 194 /* ObjectLiteralExpression */; } function isFunctionCallContext(context) { - return context.contextNode.kind === 196 /* CallExpression */; + return context.contextNode.kind === 197 /* CallExpression */; } function isNewContext(context) { - return context.contextNode.kind === 197 /* NewExpression */; + return context.contextNode.kind === 198 /* NewExpression */; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -122575,28 +123173,28 @@ var ts; return context.nextTokenSpan.kind !== 21 /* CloseParenToken */; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 202 /* ArrowFunction */; + return context.contextNode.kind === 203 /* ArrowFunction */; } function isImportTypeContext(context) { - return context.contextNode.kind === 188 /* ImportType */; + return context.contextNode.kind === 189 /* ImportType */; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 11 /* JsxText */; } function isNonJsxElementOrFragmentContext(context) { - return context.contextNode.kind !== 266 /* JsxElement */ && context.contextNode.kind !== 270 /* JsxFragment */; + return context.contextNode.kind !== 267 /* JsxElement */ && context.contextNode.kind !== 271 /* JsxFragment */; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 276 /* JsxExpression */ || context.contextNode.kind === 275 /* JsxSpreadAttribute */; + return context.contextNode.kind === 277 /* JsxExpression */ || context.contextNode.kind === 276 /* JsxSpreadAttribute */; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 273 /* JsxAttribute */; + return context.nextTokenParent.kind === 274 /* JsxAttribute */; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 273 /* JsxAttribute */; + return context.contextNode.kind === 274 /* JsxAttribute */; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 267 /* JsxSelfClosingElement */; + return context.contextNode.kind === 268 /* JsxSelfClosingElement */; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -122611,45 +123209,45 @@ var ts; while (ts.isExpressionNode(node)) { node = node.parent; } - return node.kind === 157 /* Decorator */; + return node.kind === 158 /* Decorator */; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 243 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 244 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; } function isModuleDeclContext(context) { - return context.contextNode.kind === 249 /* ModuleDeclaration */; + return context.contextNode.kind === 250 /* ModuleDeclaration */; } function isObjectTypeContext(context) { - return context.contextNode.kind === 173 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 174 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 166 /* ConstructSignature */; + return context.contextNode.kind === 167 /* ConstructSignature */; } function isTypeArgumentOrParameterOrAssertion(token, parent) { if (token.kind !== 29 /* LessThanToken */ && token.kind !== 31 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 169 /* TypeReference */: - case 199 /* TypeAssertionExpression */: - case 247 /* TypeAliasDeclaration */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 216 /* ExpressionWithTypeArguments */: + case 170 /* TypeReference */: + case 200 /* TypeAssertionExpression */: + case 248 /* TypeAliasDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 217 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -122660,28 +123258,28 @@ var ts; isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 199 /* TypeAssertionExpression */; + return context.contextNode.kind === 200 /* TypeAssertionExpression */; } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 110 /* VoidKeyword */ && context.currentTokenParent.kind === 205 /* VoidExpression */; + return context.currentTokenSpan.kind === 110 /* VoidKeyword */ && context.currentTokenParent.kind === 206 /* VoidExpression */; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 212 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 213 /* YieldExpression */ && context.contextNode.expression !== undefined; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 218 /* NonNullExpression */; + return context.contextNode.kind === 219 /* NonNullExpression */; } function isNotStatementConditionContext(context) { return !isStatementConditionContext(context); } function isStatementConditionContext(context) { switch (context.contextNode.kind) { - case 227 /* IfStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 228 /* IfStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return true; default: return false; @@ -122706,12 +123304,12 @@ var ts; return nextTokenKind === 19 /* CloseBraceToken */ || nextTokenKind === 1 /* EndOfFileToken */; } - if (nextTokenKind === 222 /* SemicolonClassElement */ || + if (nextTokenKind === 223 /* SemicolonClassElement */ || nextTokenKind === 26 /* SemicolonToken */) { return false; } - if (context.contextNode.kind === 246 /* InterfaceDeclaration */ || - context.contextNode.kind === 247 /* TypeAliasDeclaration */) { + if (context.contextNode.kind === 247 /* InterfaceDeclaration */ || + context.contextNode.kind === 248 /* TypeAliasDeclaration */) { // Can’t remove semicolon after `foo`; it would parse as a method declaration: // // interface I { @@ -122725,9 +123323,9 @@ var ts; if (ts.isPropertyDeclaration(context.currentTokenParent)) { return !context.currentTokenParent.initializer; } - return context.currentTokenParent.kind !== 230 /* ForStatement */ - && context.currentTokenParent.kind !== 224 /* EmptyStatement */ - && context.currentTokenParent.kind !== 222 /* SemicolonClassElement */ + return context.currentTokenParent.kind !== 231 /* ForStatement */ + && context.currentTokenParent.kind !== 225 /* EmptyStatement */ + && context.currentTokenParent.kind !== 223 /* SemicolonClassElement */ && nextTokenKind !== 22 /* OpenBracketToken */ && nextTokenKind !== 20 /* OpenParenToken */ && nextTokenKind !== 39 /* PlusToken */ @@ -122735,7 +123333,7 @@ var ts; && nextTokenKind !== 43 /* SlashToken */ && nextTokenKind !== 13 /* RegularExpressionLiteral */ && nextTokenKind !== 27 /* CommaToken */ - && nextTokenKind !== 211 /* TemplateExpression */ + && nextTokenKind !== 212 /* TemplateExpression */ && nextTokenKind !== 15 /* TemplateHead */ && nextTokenKind !== 14 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 24 /* DotToken */; @@ -122826,12 +123424,12 @@ var ts; return map; } function getRuleBucketIndex(row, column) { - ts.Debug.assert(row <= 152 /* LastKeyword */ && column <= 152 /* LastKeyword */, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 153 /* LastKeyword */ && column <= 153 /* LastKeyword */, "Must compute formatting context from tokens"); return (row * mapRowLength) + column; } var maskBitSize = 5; var mask = 31; // MaskBitSize bits - var mapRowLength = 152 /* LastToken */ + 1; + var mapRowLength = 153 /* LastToken */ + 1; var RulesPosition; (function (RulesPosition) { RulesPosition[RulesPosition["StopRulesSpecific"] = 0] = "StopRulesSpecific"; @@ -123019,17 +123617,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: var body = parent.body; - return !!body && body.kind === 250 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); - case 290 /* SourceFile */: - case 223 /* Block */: - case 250 /* ModuleBlock */: + return !!body && body.kind === 251 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); + case 291 /* SourceFile */: + case 224 /* Block */: + case 251 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -123186,7 +123784,9 @@ var ts; var leadingTrivia = formattingScanner.getCurrentLeadingTrivia(); if (leadingTrivia) { indentTriviaItems(leadingTrivia, initialIndentation, /*indentNextTokenOrTrivia*/ false, function (item) { return processRange(item, sourceFile.getLineAndCharacterOfPosition(item.pos), enclosingNode, enclosingNode, /*dynamicIndentation*/ undefined); }); - trimTrailingWhitespacesForRemainingRange(); + if (options.trimTrailingWhitespace !== false) { + trimTrailingWhitespacesForRemainingRange(); + } } } return edits; @@ -123254,19 +123854,19 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 245 /* ClassDeclaration */: return 80 /* ClassKeyword */; - case 246 /* InterfaceDeclaration */: return 114 /* InterfaceKeyword */; - case 244 /* FunctionDeclaration */: return 94 /* FunctionKeyword */; - case 248 /* EnumDeclaration */: return 248 /* EnumDeclaration */; - case 163 /* GetAccessor */: return 131 /* GetKeyword */; - case 164 /* SetAccessor */: return 142 /* SetKeyword */; - case 161 /* MethodDeclaration */: + case 246 /* ClassDeclaration */: return 80 /* ClassKeyword */; + case 247 /* InterfaceDeclaration */: return 114 /* InterfaceKeyword */; + case 245 /* FunctionDeclaration */: return 94 /* FunctionKeyword */; + case 249 /* EnumDeclaration */: return 249 /* EnumDeclaration */; + case 164 /* GetAccessor */: return 132 /* GetKeyword */; + case 165 /* SetAccessor */: return 143 /* SetKeyword */; + case 162 /* MethodDeclaration */: if (node.asteriskToken) { return 41 /* AsteriskToken */; } // falls through - case 159 /* PropertyDeclaration */: - case 156 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 157 /* Parameter */: var name = ts.getNameOfDeclaration(node); if (name) { return name.kind; @@ -123323,15 +123923,15 @@ var ts; case 43 /* SlashToken */: case 31 /* GreaterThanToken */: switch (container.kind) { - case 268 /* JsxOpeningElement */: - case 269 /* JsxClosingElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 270 /* JsxClosingElement */: + case 268 /* JsxSelfClosingElement */: return false; } break; case 22 /* OpenBracketToken */: case 23 /* CloseBracketToken */: - if (container.kind !== 186 /* MappedType */) { + if (container.kind !== 187 /* MappedType */) { return false; } break; @@ -123434,7 +124034,7 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 157 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 158 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); if (child.kind === 11 /* JsxText */) { @@ -123454,7 +124054,7 @@ var ts; } } childContextNode = node; - if (isFirstListItem && parent.kind === 192 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent.kind === 193 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -123626,7 +124226,7 @@ var ts; function processPair(currentItem, currentStartLine, currentParent, previousItem, previousStartLine, previousParent, contextNode, dynamicIndentation) { formattingContext.updateContext(previousItem, previousParent, currentItem, currentParent, contextNode); var rules = getRules(formattingContext); - var trimTrailingWhitespaces = false; + var trimTrailingWhitespaces = formattingContext.options.trimTrailingWhitespace !== false; var lineAction = 0 /* None */; if (rules) { // Apply rules in reverse order so that higher priority rules (which are first in the array) @@ -123653,11 +124253,11 @@ var ts; ts.Debug.assert(lineAction === 0 /* None */); } // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line - trimTrailingWhitespaces = !(rule.action & 16 /* DeleteSpace */) && rule.flags !== 1 /* CanDeleteNewLines */; + trimTrailingWhitespaces = trimTrailingWhitespaces && !(rule.action & 16 /* DeleteSpace */) && rule.flags !== 1 /* CanDeleteNewLines */; }); } else { - trimTrailingWhitespaces = currentItem.kind !== 1 /* EndOfFileToken */; + trimTrailingWhitespaces = trimTrailingWhitespaces && currentItem.kind !== 1 /* EndOfFileToken */; } if (currentStartLine !== previousStartLine && trimTrailingWhitespaces) { // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line @@ -123897,12 +124497,12 @@ var ts; formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { - case 162 /* Constructor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 202 /* ArrowFunction */: + case 163 /* Constructor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 203 /* ArrowFunction */: if (node.typeParameters === list) { return 29 /* LessThanToken */; } @@ -123910,8 +124510,8 @@ var ts; return 20 /* OpenParenToken */; } break; - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } @@ -123919,12 +124519,12 @@ var ts; return 20 /* OpenParenToken */; } break; - case 169 /* TypeReference */: + case 170 /* TypeReference */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } break; - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return 18 /* OpenBraceToken */; } return 0 /* Unknown */; @@ -124042,7 +124642,7 @@ var ts; if (options.indentStyle === ts.IndentStyle.Block) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 209 /* BinaryExpression */) { + if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 210 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -124196,7 +124796,7 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 290 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 291 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -124244,7 +124844,7 @@ var ts; } SmartIndenter.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 227 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 228 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 87 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -124282,40 +124882,40 @@ var ts; } function getListByRange(start, end, node, sourceFile) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return getList(node.typeArguments); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return getList(node.properties); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return getList(node.elements); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return getList(node.members); - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 162 /* Constructor */: - case 171 /* ConstructorType */: - case 166 /* ConstructSignature */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 163 /* Constructor */: + case 172 /* ConstructorType */: + case 167 /* ConstructSignature */: return getList(node.typeParameters) || getList(node.parameters); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 321 /* JSDocTemplateTag */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 322 /* JSDocTemplateTag */: return getList(node.typeParameters); - case 197 /* NewExpression */: - case 196 /* CallExpression */: + case 198 /* NewExpression */: + case 197 /* CallExpression */: return getList(node.typeArguments) || getList(node.arguments); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return getList(node.declarations); - case 257 /* NamedImports */: - case 261 /* NamedExports */: + case 258 /* NamedImports */: + case 262 /* NamedExports */: return getList(node.elements); - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: return getList(node.elements); } function getList(list) { @@ -124338,7 +124938,7 @@ var ts; return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options); } function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) { - if (node.parent && node.parent.kind === 243 /* VariableDeclarationList */) { + if (node.parent && node.parent.kind === 244 /* VariableDeclarationList */) { // VariableDeclarationList has no wrapping tokens return -1 /* Unknown */; } @@ -124411,87 +125011,87 @@ var ts; function nodeWillIndentChild(settings, parent, child, sourceFile, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 226 /* ExpressionStatement */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 192 /* ArrayLiteralExpression */: - case 223 /* Block */: - case 250 /* ModuleBlock */: - case 193 /* ObjectLiteralExpression */: - case 173 /* TypeLiteral */: - case 186 /* MappedType */: - case 175 /* TupleType */: - case 251 /* CaseBlock */: - case 278 /* DefaultClause */: - case 277 /* CaseClause */: - case 200 /* ParenthesizedExpression */: - case 194 /* PropertyAccessExpression */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 225 /* VariableStatement */: - case 259 /* ExportAssignment */: - case 235 /* ReturnStatement */: - case 210 /* ConditionalExpression */: - case 190 /* ArrayBindingPattern */: - case 189 /* ObjectBindingPattern */: - case 268 /* JsxOpeningElement */: - case 271 /* JsxOpeningFragment */: - case 267 /* JsxSelfClosingElement */: - case 276 /* JsxExpression */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 156 /* Parameter */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 182 /* ParenthesizedType */: - case 198 /* TaggedTemplateExpression */: - case 206 /* AwaitExpression */: - case 261 /* NamedExports */: - case 257 /* NamedImports */: - case 263 /* ExportSpecifier */: - case 258 /* ImportSpecifier */: - case 159 /* PropertyDeclaration */: + case 227 /* ExpressionStatement */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 193 /* ArrayLiteralExpression */: + case 224 /* Block */: + case 251 /* ModuleBlock */: + case 194 /* ObjectLiteralExpression */: + case 174 /* TypeLiteral */: + case 187 /* MappedType */: + case 176 /* TupleType */: + case 252 /* CaseBlock */: + case 279 /* DefaultClause */: + case 278 /* CaseClause */: + case 201 /* ParenthesizedExpression */: + case 195 /* PropertyAccessExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 226 /* VariableStatement */: + case 260 /* ExportAssignment */: + case 236 /* ReturnStatement */: + case 211 /* ConditionalExpression */: + case 191 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 269 /* JsxOpeningElement */: + case 272 /* JsxOpeningFragment */: + case 268 /* JsxSelfClosingElement */: + case 277 /* JsxExpression */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 157 /* Parameter */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 183 /* ParenthesizedType */: + case 199 /* TaggedTemplateExpression */: + case 207 /* AwaitExpression */: + case 262 /* NamedExports */: + case 258 /* NamedImports */: + case 264 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 160 /* PropertyDeclaration */: return true; - case 242 /* VariableDeclaration */: - case 281 /* PropertyAssignment */: - case 209 /* BinaryExpression */: - if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 193 /* ObjectLiteralExpression */) { // TODO: GH#18217 + case 243 /* VariableDeclaration */: + case 282 /* PropertyAssignment */: + case 210 /* BinaryExpression */: + if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 194 /* ObjectLiteralExpression */) { // TODO: GH#18217 return rangeIsOnOneLine(sourceFile, child); } - if (parent.kind !== 209 /* BinaryExpression */) { + if (parent.kind !== 210 /* BinaryExpression */) { return true; } break; - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 230 /* ForStatement */: - case 227 /* IfStatement */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 202 /* ArrowFunction */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - return childKind !== 223 /* Block */; - case 260 /* ExportDeclaration */: - return childKind !== 261 /* NamedExports */; - case 254 /* ImportDeclaration */: - return childKind !== 255 /* ImportClause */ || - (!!child.namedBindings && child.namedBindings.kind !== 257 /* NamedImports */); - case 266 /* JsxElement */: - return childKind !== 269 /* JsxClosingElement */; - case 270 /* JsxFragment */: - return childKind !== 272 /* JsxClosingFragment */; - case 179 /* IntersectionType */: - case 178 /* UnionType */: - if (childKind === 173 /* TypeLiteral */) { + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 231 /* ForStatement */: + case 228 /* IfStatement */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 203 /* ArrowFunction */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + return childKind !== 224 /* Block */; + case 261 /* ExportDeclaration */: + return childKind !== 262 /* NamedExports */; + case 255 /* ImportDeclaration */: + return childKind !== 256 /* ImportClause */ || + (!!child.namedBindings && child.namedBindings.kind !== 258 /* NamedImports */); + case 267 /* JsxElement */: + return childKind !== 270 /* JsxClosingElement */; + case 271 /* JsxFragment */: + return childKind !== 273 /* JsxClosingFragment */; + case 180 /* IntersectionType */: + case 179 /* UnionType */: + if (childKind === 174 /* TypeLiteral */) { return false; } // falls through @@ -124502,11 +125102,11 @@ var ts; SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent) { switch (kind) { - case 235 /* ReturnStatement */: - case 239 /* ThrowStatement */: - case 233 /* ContinueStatement */: - case 234 /* BreakStatement */: - return parent.kind !== 223 /* Block */; + case 236 /* ReturnStatement */: + case 240 /* ThrowStatement */: + case 234 /* ContinueStatement */: + case 235 /* BreakStatement */: + return parent.kind !== 224 /* Block */; default: return false; } @@ -124648,7 +125248,7 @@ var ts; * Checks if 'candidate' argument is a legal separator in the list that contains 'node' as an element */ function isSeparator(node, candidate) { - return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 193 /* ObjectLiteralExpression */)); + return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 194 /* ObjectLiteralExpression */)); } function spaces(count) { var s = ""; @@ -124825,7 +125425,7 @@ var ts; } } else { - endNode = node.kind !== 242 /* VariableDeclaration */ && node.questionToken ? node.questionToken : node.name; + endNode = node.kind !== 243 /* VariableDeclaration */ && node.questionToken ? node.questionToken : node.name; } this.insertNodeAt(sourceFile, endNode.end, type, { prefix: ": " }); return true; @@ -124979,18 +125579,18 @@ var ts; }; ChangeTracker.prototype.getInsertNodeAfterOptionsWorker = function (node) { switch (node.kind) { - case 245 /* ClassDeclaration */: - case 249 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 250 /* ModuleDeclaration */: return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: case 10 /* StringLiteral */: case 75 /* Identifier */: return { prefix: ", " }; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return { suffix: "," + this.newLineCharacter }; case 89 /* ExportKeyword */: return { prefix: " " }; - case 156 /* Parameter */: + case 157 /* Parameter */: return {}; default: ts.Debug.assert(ts.isStatement(node) || ts.isClassOrTypeElement(node)); // Else we haven't handled this kind of node yet -- add it @@ -124999,7 +125599,7 @@ var ts; }; ChangeTracker.prototype.insertName = function (sourceFile, node, name) { ts.Debug.assert(!node.name); - if (node.kind === 202 /* ArrowFunction */) { + if (node.kind === 203 /* ArrowFunction */) { var arrow = ts.findChildOfKind(node, 38 /* EqualsGreaterThanToken */, sourceFile); var lparen = ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile); if (lparen) { @@ -125013,14 +125613,14 @@ var ts; // Replacing full range of arrow to get rid of the leading space -- replace ` =>` with `)` this.replaceRange(sourceFile, arrow, ts.createToken(21 /* CloseParenToken */)); } - if (node.body.kind !== 223 /* Block */) { + if (node.body.kind !== 224 /* Block */) { // `() => 0` => `function f() { return 0; }` this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [ts.createToken(18 /* OpenBraceToken */), ts.createToken(101 /* ReturnKeyword */)], { joiner: " ", suffix: " " }); this.insertNodesAt(sourceFile, node.body.end, [ts.createToken(26 /* SemicolonToken */), ts.createToken(19 /* CloseBraceToken */)], { joiner: " " }); } } else { - var pos = ts.findChildOfKind(node, node.kind === 201 /* FunctionExpression */ ? 94 /* FunctionKeyword */ : 80 /* ClassKeyword */, sourceFile).end; + var pos = ts.findChildOfKind(node, node.kind === 202 /* FunctionExpression */ ? 94 /* FunctionKeyword */ : 80 /* ClassKeyword */, sourceFile).end; this.insertNodeAt(sourceFile, pos, ts.createIdentifier(name), { prefix: " " }); } }; @@ -125278,7 +125878,9 @@ var ts; : format(change.node); // strip initial indentation (spaces or tabs) if text will be inserted in the middle of the line var noIndent = (options.preserveLeadingWhitespace || options.indentation !== undefined || ts.getLineStartPositionForPosition(pos, sourceFile) === pos) ? text : text.replace(/^\s+/, ""); - return (options.prefix || "") + noIndent + (options.suffix || ""); + return (options.prefix || "") + noIndent + + ((!options.suffix || ts.endsWith(noIndent, options.suffix)) + ? "" : options.suffix); } function getFormatCodeSettingsForWriting(_a, sourceFile) { var options = _a.options; @@ -125583,14 +126185,14 @@ var ts; } textChanges_3.isValidLocationToAddComment = isValidLocationToAddComment; function needSemicolonBetween(a, b) { - return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 154 /* ComputedPropertyName */ + return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 155 /* ComputedPropertyName */ || ts.isStatementButNotDeclaration(a) && ts.isStatementButNotDeclaration(b); // TODO: only if b would start with a `(` or `[` } var deleteDeclaration; (function (deleteDeclaration_1) { function deleteDeclaration(changes, deletedNodesInLists, sourceFile, node) { switch (node.kind) { - case 156 /* Parameter */: { + case 157 /* Parameter */: { var oldFunction = node.parent; if (ts.isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && @@ -125605,15 +126207,15 @@ var ts; } break; } - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: var isFirstImport = sourceFile.imports.length && node === ts.first(sourceFile.imports).parent || node === ts.find(sourceFile.statements, ts.isImportDeclaration); deleteNode(changes, sourceFile, node, // For first import, leave header comment in place isFirstImport ? { leadingTriviaOption: LeadingTriviaOption.Exclude } : undefined); break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: var pattern = node.parent; - var preserveComma = pattern.kind === 190 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); + var preserveComma = pattern.kind === 191 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); if (preserveComma) { deleteNode(changes, sourceFile, node); } @@ -125621,13 +126223,13 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node); break; - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); break; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: var namedImports = node.parent; if (namedImports.elements.length === 1) { deleteImportBinding(changes, sourceFile, namedImports); @@ -125636,7 +126238,7 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: deleteImportBinding(changes, sourceFile, node); break; default: @@ -125683,13 +126285,13 @@ var ts; // Delete the entire import declaration // |import * as ns from './file'| // |import { a } from './file'| - var importDecl = ts.getAncestor(node, 254 /* ImportDeclaration */); + var importDecl = ts.getAncestor(node, 255 /* ImportDeclaration */); deleteNode(changes, sourceFile, importDecl); } } function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) { var parent = node.parent; - if (parent.kind === 280 /* CatchClause */) { + if (parent.kind === 281 /* CatchClause */) { // TODO: There's currently no unused diagnostic for this, could be a suggestion changes.deleteNodeRange(sourceFile, ts.findChildOfKind(parent, 20 /* OpenParenToken */, sourceFile), ts.findChildOfKind(parent, 21 /* CloseParenToken */, sourceFile)); return; @@ -125700,14 +126302,14 @@ var ts; } var gp = parent.parent; switch (gp.kind) { - case 232 /* ForOfStatement */: - case 231 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 232 /* ForInStatement */: changes.replaceNode(sourceFile, node, ts.createObjectLiteral()); break; - case 230 /* ForStatement */: + case 231 /* ForStatement */: deleteNode(changes, sourceFile, parent); break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: deleteNode(changes, sourceFile, gp); break; default: @@ -125886,8 +126488,8 @@ var ts; var token = ts.getTokenAtPosition(sourceFile, pos); var assertion = ts.Debug.checkDefined(ts.findAncestor(token, function (n) { return ts.isAsExpression(n) || ts.isTypeAssertion(n); }), "Expected to find an assertion expression"); var replacement = ts.isAsExpression(assertion) - ? ts.createAsExpression(assertion.expression, ts.createKeywordTypeNode(148 /* UnknownKeyword */)) - : ts.createTypeAssertion(ts.createKeywordTypeNode(148 /* UnknownKeyword */), assertion.expression); + ? ts.createAsExpression(assertion.expression, ts.createKeywordTypeNode(149 /* UnknownKeyword */)) + : ts.createTypeAssertion(ts.createKeywordTypeNode(149 /* UnknownKeyword */), assertion.expression); changeTracker.replaceNode(sourceFile, assertion.expression, replacement); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -126118,7 +126720,7 @@ var ts; } var declaration = ts.tryCast(symbol.valueDeclaration, ts.isVariableDeclaration); var variableName = declaration && ts.tryCast(declaration.name, ts.isIdentifier); - var variableStatement = ts.getAncestor(declaration, 225 /* VariableStatement */); + var variableStatement = ts.getAncestor(declaration, 226 /* VariableStatement */); if (!declaration || !variableStatement || declaration.type || !declaration.initializer || @@ -126196,10 +126798,10 @@ var ts; function isInsideAwaitableBody(node) { return node.kind & 32768 /* AwaitContext */ || !!ts.findAncestor(node, function (ancestor) { return ancestor.parent && ts.isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || - ts.isBlock(ancestor) && (ancestor.parent.kind === 244 /* FunctionDeclaration */ || - ancestor.parent.kind === 201 /* FunctionExpression */ || - ancestor.parent.kind === 202 /* ArrowFunction */ || - ancestor.parent.kind === 161 /* MethodDeclaration */); + ts.isBlock(ancestor) && (ancestor.parent.kind === 245 /* FunctionDeclaration */ || + ancestor.parent.kind === 202 /* FunctionExpression */ || + ancestor.parent.kind === 203 /* ArrowFunction */ || + ancestor.parent.kind === 162 /* MethodDeclaration */); }); } function makeChange(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) { @@ -126318,10 +126920,10 @@ var ts; function isPossiblyPartOfDestructuring(node) { switch (node.kind) { case 75 /* Identifier */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return true; default: return false; @@ -126336,7 +126938,7 @@ var ts; function isPossiblyPartOfCommaSeperatedInitializer(node) { switch (node.kind) { case 75 /* Identifier */: - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: case 27 /* CommaToken */: return true; default: @@ -126385,9 +126987,9 @@ var ts; return; } var declaration = token.parent; - if (declaration.kind === 159 /* PropertyDeclaration */ && + if (declaration.kind === 160 /* PropertyDeclaration */ && (!fixedNodes || fixedNodes.tryAdd(declaration))) { - changeTracker.insertModifierBefore(sourceFile, 130 /* DeclareKeyword */, declaration); + changeTracker.insertModifierBefore(sourceFile, 131 /* DeclareKeyword */, declaration); } } })(codefix = ts.codefix || (ts.codefix = {})); @@ -126522,26 +127124,26 @@ var ts; } function isDeclarationWithType(node) { return ts.isFunctionLikeDeclaration(node) || - node.kind === 242 /* VariableDeclaration */ || - node.kind === 158 /* PropertySignature */ || - node.kind === 159 /* PropertyDeclaration */; + node.kind === 243 /* VariableDeclaration */ || + node.kind === 159 /* PropertySignature */ || + node.kind === 160 /* PropertyDeclaration */; } function transformJSDocType(node) { switch (node.kind) { - case 295 /* JSDocAllType */: - case 296 /* JSDocUnknownType */: + case 296 /* JSDocAllType */: + case 297 /* JSDocUnknownType */: return ts.createTypeReferenceNode("any", ts.emptyArray); - case 299 /* JSDocOptionalType */: + case 300 /* JSDocOptionalType */: return transformJSDocOptionalType(node); - case 298 /* JSDocNonNullableType */: + case 299 /* JSDocNonNullableType */: return transformJSDocType(node.type); - case 297 /* JSDocNullableType */: + case 298 /* JSDocNullableType */: return transformJSDocNullableType(node); - case 301 /* JSDocVariadicType */: + case 302 /* JSDocVariadicType */: return transformJSDocVariadicType(node); - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: return transformJSDocFunctionType(node); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return transformJSDocTypeReference(node); default: var visited = ts.visitEachChild(node, transformJSDocType, /*context*/ undefined); // TODO: GH#18217 @@ -126563,7 +127165,7 @@ var ts; } function transformJSDocParameter(node) { var index = node.parent.parameters.indexOf(node); - var isRest = node.type.kind === 301 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 + var isRest = node.type.kind === 302 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 var name = node.name || (isRest ? "rest" : "arg" + index); var dotdotdot = isRest ? ts.createToken(25 /* DotDotDotToken */) : node.dotDotDotToken; return ts.createParameter(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer); @@ -126603,8 +127205,8 @@ var ts; var index = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, - /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 140 /* NumberKeyword */ ? "n" : "s", - /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 140 /* NumberKeyword */ ? "number" : "string", []), + /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 141 /* NumberKeyword */ ? "n" : "s", + /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 141 /* NumberKeyword */ ? "number" : "string", []), /*initializer*/ undefined); var indexSignature = ts.createTypeLiteralNode([ts.createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]); ts.setEmitFlags(indexSignature, 1 /* SingleLine */); @@ -126862,7 +127464,7 @@ var ts; function annotate(changes, importAdder, sourceFile, declaration, type, program, host) { var typeNode = ts.getTypeNodeIfAccessible(type, declaration, program, host); if (typeNode) { - if (ts.isInJSFile(sourceFile) && declaration.kind !== 158 /* PropertySignature */) { + if (ts.isInJSFile(sourceFile) && declaration.kind !== 159 /* PropertySignature */) { var parent = ts.isVariableDeclaration(declaration) ? ts.tryCast(declaration.parent.parent, ts.isVariableStatement) : declaration; if (!parent) { return; @@ -126911,13 +127513,13 @@ var ts; return !!merged; }); }); var tag = ts.createJSDocComment(comments.join("\n"), ts.createNodeArray(__spreadArrays((oldTags || ts.emptyArray), unmergedNewTags))); - var jsDocNode = parent.kind === 202 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; + var jsDocNode = parent.kind === 203 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; jsDocNode.jsDoc = parent.jsDoc; jsDocNode.jsDocCache = parent.jsDocCache; changes.insertJsdocCommentBefore(sourceFile, jsDocNode, tag); } function getJsDocNodeForArrowFunction(signature) { - if (signature.parent.kind === 159 /* PropertyDeclaration */) { + if (signature.parent.kind === 160 /* PropertyDeclaration */) { return signature.parent; } return signature.parent.parent; @@ -126927,14 +127529,14 @@ var ts; return undefined; } switch (oldTag.kind) { - case 317 /* JSDocParameterTag */: { + case 318 /* JSDocParameterTag */: { var oldParam = oldTag; var newParam = newTag; return ts.isIdentifier(oldParam.name) && ts.isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? ts.createJSDocParamTag(newParam.name, newParam.isBracketed, newParam.typeExpression, oldParam.comment) : undefined; } - case 318 /* JSDocReturnTag */: + case 319 /* JSDocReturnTag */: return ts.createJSDocReturnTag(newTag.typeExpression, oldTag.comment); } } @@ -126959,18 +127561,18 @@ var ts; function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) { var searchToken; switch (containingFunction.kind) { - case 162 /* Constructor */: - searchToken = ts.findChildOfKind(containingFunction, 129 /* ConstructorKeyword */, sourceFile); + case 163 /* Constructor */: + searchToken = ts.findChildOfKind(containingFunction, 130 /* ConstructorKeyword */, sourceFile); break; - case 202 /* ArrowFunction */: - case 201 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 202 /* FunctionExpression */: var parent = containingFunction.parent; searchToken = ts.isVariableDeclaration(parent) && ts.isIdentifier(parent.name) ? parent.name : containingFunction.name; break; - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: searchToken = containingFunction.name; break; } @@ -127112,24 +127714,24 @@ var ts; node = node.parent; } switch (node.parent.kind) { - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: addCandidateType(usage, checker.getVoidType()); break; - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: usage.isNumber = true; break; - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: inferTypeFromPrefixUnaryExpression(node.parent, usage); break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: inferTypeFromBinaryExpression(node, node.parent, usage); break; - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: inferTypeFromSwitchStatementLabel(node.parent, usage); break; - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: if (node.parent.expression === node) { inferTypeFromCallExpression(node.parent, usage); } @@ -127137,20 +127739,20 @@ var ts; inferTypeFromContextualType(node, usage); } break; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: inferTypeFromPropertyAccessExpression(node.parent, usage); break; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: inferTypeFromPropertyElementExpression(node.parent, node, usage); break; - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: inferTypeFromPropertyAssignment(node.parent, usage); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: inferTypeFromPropertyDeclaration(node.parent, usage); break; - case 242 /* VariableDeclaration */: { + case 243 /* VariableDeclaration */: { var _a = node.parent, name = _a.name, initializer = _a.initializer; if (node === name) { if (initializer) { // This can happen for `let x = null;` which still has an implicit-any error. @@ -127269,7 +127871,7 @@ var ts; case 56 /* BarBarToken */: case 60 /* QuestionQuestionToken */: if (node === parent.left && - (node.parent.parent.kind === 242 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { + (node.parent.parent.kind === 243 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { // var x = x || {}; // TODO: use getFalsyflagsOfType addCandidateType(usage, checker.getTypeAtLocation(parent.right)); @@ -127297,7 +127899,7 @@ var ts; } } calculateUsageOfNode(parent, call.return_); - if (parent.kind === 196 /* CallExpression */) { + if (parent.kind === 197 /* CallExpression */) { (usage.calls || (usage.calls = [])).push(call); } else { @@ -127513,6 +128115,9 @@ var ts; else if (genericType.flags & 3145728 /* UnionOrIntersection */) { return ts.flatMap(genericType.types, function (t) { return inferTypeParameters(t, usageType, typeParameter); }); } + else if (genericType.flags & 134217728 /* Awaited */) { + return inferTypeParameters(genericType.awaitedType, usageType, typeParameter); + } else if (ts.getObjectFlags(genericType) & 4 /* Reference */ && ts.getObjectFlags(usageType) & 4 /* Reference */) { // this is wrong because we need a reference to the targetType to, so we can check that it's also a reference var genericArgs = checker.getTypeArguments(genericType); @@ -127616,12 +128221,12 @@ var ts; var precedingNode; var newClassDeclaration; switch (ctorDeclaration.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: precedingNode = ctorDeclaration; changes.delete(sourceFile, ctorDeclaration); newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: precedingNode = ctorDeclaration.parent.parent; newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration); if (ctorDeclaration.parent.declarations.length === 1) { @@ -127676,7 +128281,7 @@ var ts; return; } // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 226 /* ExpressionStatement */ + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 227 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; changes.delete(sourceFile, nodeToDelete); if (!assignmentBinaryExpression.right) { @@ -127684,7 +128289,7 @@ var ts; /*type*/ undefined, /*initializer*/ undefined); } switch (assignmentBinaryExpression.right.kind) { - case 201 /* FunctionExpression */: { + case 202 /* FunctionExpression */: { var functionExpression = assignmentBinaryExpression.right; var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(functionExpression, 126 /* AsyncKeyword */)); var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, @@ -127692,12 +128297,12 @@ var ts; ts.copyLeadingComments(assignmentBinaryExpression, method, sourceFile); return method; } - case 202 /* ArrowFunction */: { + case 203 /* ArrowFunction */: { var arrowFunction = assignmentBinaryExpression.right; var arrowFunctionBody = arrowFunction.body; var bodyBlock = void 0; // case 1: () => { return [1,2,3] } - if (arrowFunctionBody.kind === 223 /* Block */) { + if (arrowFunctionBody.kind === 224 /* Block */) { bodyBlock = arrowFunctionBody; } // case 2: () => [1,2,3] @@ -127725,7 +128330,7 @@ var ts; } function createClassFromVariableDeclaration(node) { var initializer = node.initializer; - if (!initializer || initializer.kind !== 201 /* FunctionExpression */) { + if (!initializer || initializer.kind !== 202 /* FunctionExpression */) { return undefined; } if (node.name.kind !== 75 /* Identifier */) { @@ -127797,27 +128402,21 @@ var ts; return; } var synthNamesMap = ts.createMap(); - var originalTypeMap = ts.createMap(); - var allVarNames = []; var isInJavascript = ts.isInJSFile(functionToConvert); var setOfExpressionsToReturn = getAllPromiseExpressionsToReturn(functionToConvert, checker); - var functionToConvertRenamed = renameCollidingVarNames(functionToConvert, checker, synthNamesMap, context, setOfExpressionsToReturn, originalTypeMap, allVarNames); - var constIdentifiers = getConstIdentifiers(synthNamesMap); + var functionToConvertRenamed = renameCollidingVarNames(functionToConvert, checker, synthNamesMap, context.sourceFile); var returnStatements = functionToConvertRenamed.body && ts.isBlock(functionToConvertRenamed.body) ? getReturnStatementsWithPromiseHandlers(functionToConvertRenamed.body) : ts.emptyArray; - var transformer = { checker: checker, synthNamesMap: synthNamesMap, allVarNames: allVarNames, setOfExpressionsToReturn: setOfExpressionsToReturn, constIdentifiers: constIdentifiers, originalTypeMap: originalTypeMap, isInJSFile: isInJavascript }; + var transformer = { checker: checker, synthNamesMap: synthNamesMap, setOfExpressionsToReturn: setOfExpressionsToReturn, isInJSFile: isInJavascript }; if (!returnStatements.length) { return; } // add the async keyword changes.insertLastModifierBefore(sourceFile, 126 /* AsyncKeyword */, functionToConvert); - function startTransformation(node, nodeToReplace) { - var newNodes = transformExpression(node, transformer, node); - changes.replaceNodeWithNodes(sourceFile, nodeToReplace, newNodes); - } - var _loop_13 = function (statement) { - ts.forEachChild(statement, function visit(node) { + var _loop_13 = function (returnStatement) { + ts.forEachChild(returnStatement, function visit(node) { if (ts.isCallExpression(node)) { - startTransformation(node, statement); + var newNodes = transformExpression(node, transformer); + changes.replaceNodeWithNodes(sourceFile, returnStatement, newNodes); } else if (!ts.isFunctionLike(node)) { ts.forEachChild(node, visit); @@ -127825,8 +128424,8 @@ var ts; }); }; for (var _i = 0, returnStatements_1 = returnStatements; _i < returnStatements_1.length; _i++) { - var statement = returnStatements_1[_i]; - _loop_13(statement); + var returnStatement = returnStatements_1[_i]; + _loop_13(returnStatement); } } function getReturnStatementsWithPromiseHandlers(body) { @@ -127837,16 +128436,6 @@ var ts; }); return res; } - // Returns the identifiers that are never reassigned in the refactor - function getConstIdentifiers(synthNamesMap) { - var constIdentifiers = []; - synthNamesMap.forEach(function (val) { - if (val.numberOfAssignmentsOriginal === 0) { - constIdentifiers.push(val.identifier); - } - }); - return constIdentifiers; - } /* Finds all of the expressions of promise type that should not be saved in a variable during the refactor */ @@ -127856,16 +128445,16 @@ var ts; } var setOfExpressionsToReturn = ts.createMap(); ts.forEachChild(func.body, function visit(node) { - if (isPromiseReturningExpression(node, checker, "then")) { + if (isPromiseReturningCallExpression(node, checker, "then")) { setOfExpressionsToReturn.set(ts.getNodeId(node).toString(), true); ts.forEach(node.arguments, visit); } - else if (isPromiseReturningExpression(node, checker, "catch")) { + else if (isPromiseReturningCallExpression(node, checker, "catch")) { setOfExpressionsToReturn.set(ts.getNodeId(node).toString(), true); // if .catch() is the last call in the chain, move leftward in the chain until we hit something else that should be returned ts.forEachChild(node, visit); } - else if (isPromiseReturningExpression(node, checker)) { + else if (isPromiseTypedExpression(node, checker)) { setOfExpressionsToReturn.set(ts.getNodeId(node).toString(), true); // don't recurse here, since we won't refactor any children or arguments of the expression } @@ -127875,16 +128464,22 @@ var ts; }); return setOfExpressionsToReturn; } - /* - Returns true if node is a promise returning expression - If name is not undefined, node is a promise returning call of name - */ - function isPromiseReturningExpression(node, checker, name) { - var isNodeExpression = name ? ts.isCallExpression(node) : ts.isExpression(node); - var isExpressionOfName = isNodeExpression && (!name || ts.hasPropertyAccessExpressionWithName(node, name)); + function isPromiseReturningCallExpression(node, checker, name) { + if (!ts.isCallExpression(node)) + return false; + var isExpressionOfName = ts.hasPropertyAccessExpressionWithName(node, name); var nodeType = isExpressionOfName && checker.getTypeAtLocation(node); return !!(nodeType && checker.getPromisedTypeOfPromise(nodeType)); } + function isParameterOfPromiseCallback(node, checker) { + return ts.isParameter(node) && (isPromiseReturningCallExpression(node.parent.parent, checker, "then") || + isPromiseReturningCallExpression(node.parent.parent, checker, "catch")); + } + function isPromiseTypedExpression(node, checker) { + if (!ts.isExpression(node)) + return false; + return !!checker.getPromisedTypeOfPromise(checker.getTypeAtLocation(node)); + } function declaredInFile(symbol, sourceFile) { return symbol.valueDeclaration && symbol.valueDeclaration.getSourceFile() === sourceFile; } @@ -127893,31 +128488,36 @@ var ts; This function collects all existing identifier names and names of identifiers that will be created in the refactor. It then checks for any collisions and renames them through getSynthesizedDeepClone */ - function renameCollidingVarNames(nodeToRename, checker, synthNamesMap, context, setOfAllExpressionsToReturn, originalType, allVarNames) { + function renameCollidingVarNames(nodeToRename, checker, synthNamesMap, sourceFile) { + var variableNames = []; var identsToRenameMap = ts.createMap(); // key is the symbol id - var collidingSymbolMap = ts.createMap(); + var collidingSymbolMap = ts.createMultiMap(); ts.forEachChild(nodeToRename, function visit(node) { if (!ts.isIdentifier(node)) { ts.forEachChild(node, visit); return; } var symbol = checker.getSymbolAtLocation(node); - var isDefinedInFile = symbol && declaredInFile(symbol, context.sourceFile); + var isDefinedInFile = symbol && declaredInFile(symbol, sourceFile); if (symbol && isDefinedInFile) { var type = checker.getTypeAtLocation(node); + // Note - the choice of the last call signature is arbitrary var lastCallSignature = getLastCallSignature(type, checker); var symbolIdString = ts.getSymbolId(symbol).toString(); - // if the identifier refers to a function we want to add the new synthesized variable for the declaration (ex. blob in let blob = res(arg)) - // Note - the choice of the last call signature is arbitrary + // If the identifier refers to a function, we want to add the new synthesized variable for the declaration. Example: + // fetch('...').then(response => { ... }) + // will eventually become + // const response = await fetch('...') + // so we push an entry for 'response'. if (lastCallSignature && !ts.isFunctionLikeDeclaration(node.parent) && !synthNamesMap.has(symbolIdString)) { var firstParameter = ts.firstOrUndefined(lastCallSignature.parameters); var ident = firstParameter && ts.isParameter(firstParameter.valueDeclaration) && ts.tryCast(firstParameter.valueDeclaration.name, ts.isIdentifier) || ts.createOptimisticUniqueName("result"); var synthName = getNewNameIfConflict(ident, collidingSymbolMap); synthNamesMap.set(symbolIdString, synthName); - allVarNames.push({ identifier: synthName.identifier, symbol: symbol }); - addNameToFrequencyMap(collidingSymbolMap, ident.text, symbol); + variableNames.push({ identifier: synthName.identifier, symbol: symbol }); + collidingSymbolMap.add(ident.text, symbol); } - // we only care about identifiers that are parameters, declarations, or binding elements (don't care about other uses) + // We only care about identifiers that are parameters, variable declarations, or binding elements else if (node.parent && (ts.isParameter(node.parent) || ts.isVariableDeclaration(node.parent) || ts.isBindingElement(node.parent))) { var originalName = node.text; var collidingSymbols = collidingSymbolMap.get(originalName); @@ -127926,96 +128526,65 @@ var ts; var newName = getNewNameIfConflict(node, collidingSymbolMap); identsToRenameMap.set(symbolIdString, newName.identifier); synthNamesMap.set(symbolIdString, newName); - allVarNames.push({ identifier: newName.identifier, symbol: symbol }); - addNameToFrequencyMap(collidingSymbolMap, originalName, symbol); + variableNames.push({ identifier: newName.identifier, symbol: symbol }); + collidingSymbolMap.add(originalName, symbol); } else { var identifier = ts.getSynthesizedDeepClone(node); identsToRenameMap.set(symbolIdString, identifier); - synthNamesMap.set(symbolIdString, createSynthIdentifier(identifier, [], allVarNames.filter(function (elem) { return elem.identifier.text === node.text; }).length /*, numberOfAssignmentsSynthesized: 0*/)); - if ((ts.isParameter(node.parent) && isExpressionOrCallOnTypePromise(node.parent.parent)) || ts.isVariableDeclaration(node.parent)) { - allVarNames.push({ identifier: identifier, symbol: symbol }); - addNameToFrequencyMap(collidingSymbolMap, originalName, symbol); + synthNamesMap.set(symbolIdString, createSynthIdentifier(identifier)); + if (isParameterOfPromiseCallback(node.parent, checker) || ts.isVariableDeclaration(node.parent)) { + variableNames.push({ identifier: identifier, symbol: symbol }); + collidingSymbolMap.add(originalName, symbol); } } } } }); - return ts.getSynthesizedDeepCloneWithRenames(nodeToRename, /*includeTrivia*/ true, identsToRenameMap, checker, deepCloneCallback); - function isExpressionOrCallOnTypePromise(child) { - var node = child.parent; - if (ts.isCallExpression(node) || ts.isIdentifier(node) && !setOfAllExpressionsToReturn.get(ts.getNodeId(node).toString())) { - var nodeType = checker.getTypeAtLocation(node); - var isPromise = nodeType && checker.getPromisedTypeOfPromise(nodeType); - return !!isPromise; - } - return false; - } - function deepCloneCallback(node, clone) { - if (ts.isIdentifier(node)) { - var symbol = checker.getSymbolAtLocation(node); - var symboldIdString = symbol && ts.getSymbolId(symbol).toString(); - var renameInfo = symbol && synthNamesMap.get(symboldIdString); - if (renameInfo) { - var type = checker.getTypeAtLocation(node); - originalType.set(ts.getNodeId(clone).toString(), type); - } - } - var val = setOfAllExpressionsToReturn.get(ts.getNodeId(node).toString()); - if (val !== undefined) { - setOfAllExpressionsToReturn.delete(ts.getNodeId(node).toString()); - setOfAllExpressionsToReturn.set(ts.getNodeId(clone).toString(), val); - } - } - } - function addNameToFrequencyMap(renamedVarNameFrequencyMap, originalName, symbol) { - if (renamedVarNameFrequencyMap.has(originalName)) { - renamedVarNameFrequencyMap.get(originalName).push(symbol); - } - else { - renamedVarNameFrequencyMap.set(originalName, [symbol]); - } + return ts.getSynthesizedDeepCloneWithRenames(nodeToRename, /*includeTrivia*/ true, identsToRenameMap, checker); } function getNewNameIfConflict(name, originalNames) { var numVarsSameName = (originalNames.get(name.text) || ts.emptyArray).length; - var numberOfAssignmentsOriginal = 0; var identifier = numVarsSameName === 0 ? name : ts.createIdentifier(name.text + "_" + numVarsSameName); - return createSynthIdentifier(identifier, [], numberOfAssignmentsOriginal); + return createSynthIdentifier(identifier); + } + function silentFail() { + codeActionSucceeded = false; + return ts.emptyArray; } // dispatch function to recursively build the refactoring // should be kept up to date with isFixablePromiseHandler in suggestionDiagnostics.ts - function transformExpression(node, transformer, outermostParent, prevArgName) { - if (!node) { - return ts.emptyArray; - } - var originalType = ts.isIdentifier(node) && transformer.originalTypeMap.get(ts.getNodeId(node).toString()); - var nodeType = originalType || transformer.checker.getTypeAtLocation(node); - if (ts.isCallExpression(node) && ts.hasPropertyAccessExpressionWithName(node, "then") && nodeType && !!transformer.checker.getPromisedTypeOfPromise(nodeType)) { - return transformThen(node, transformer, outermostParent, prevArgName); - } - else if (ts.isCallExpression(node) && ts.hasPropertyAccessExpressionWithName(node, "catch") && nodeType && !!transformer.checker.getPromisedTypeOfPromise(nodeType)) { + function transformExpression(node, transformer, prevArgName) { + if (isPromiseReturningCallExpression(node, transformer.checker, "then")) { + if (node.arguments.length === 0) + return silentFail(); + return transformThen(node, transformer, prevArgName); + } + if (isPromiseReturningCallExpression(node, transformer.checker, "catch")) { + if (node.arguments.length === 0) + return silentFail(); return transformCatch(node, transformer, prevArgName); } - else if (ts.isPropertyAccessExpression(node)) { - return transformExpression(node.expression, transformer, outermostParent, prevArgName); + if (ts.isPropertyAccessExpression(node)) { + return transformExpression(node.expression, transformer, prevArgName); } - else if (nodeType && transformer.checker.getPromisedTypeOfPromise(nodeType)) { - return transformPromiseCall(node, transformer, prevArgName); + var nodeType = transformer.checker.getTypeAtLocation(node); + if (nodeType && transformer.checker.getPromisedTypeOfPromise(nodeType)) { + ts.Debug.assertNode(node.original.parent, ts.isPropertyAccessExpression); + return transformPromiseExpressionOfPropertyAccess(node, transformer, prevArgName); } - codeActionSucceeded = false; - return ts.emptyArray; + return silentFail(); } function transformCatch(node, transformer, prevArgName) { var func = node.arguments[0]; var argName = getArgBindingName(func, transformer); - var shouldReturn = transformer.setOfExpressionsToReturn.get(ts.getNodeId(node).toString()); var possibleNameForVarDecl; /* If there is another call in the chain after the .catch() we are transforming, we will need to save the result of both paths (try block and catch block) To do this, we will need to synthesize a variable that we were not aware of while we were adding identifiers to the synthNamesMap We will use the prevArgName and then update the synthNamesMap with a new variable name for the next transformation step */ - if (prevArgName && !shouldReturn) { + if (prevArgName && !shouldReturn(node, transformer)) { if (isSynthIdentifier(prevArgName)) { possibleNameForVarDecl = prevArgName; transformer.synthNamesMap.forEach(function (val, key) { @@ -128028,13 +128597,12 @@ var ts; else { possibleNameForVarDecl = createSynthIdentifier(ts.createOptimisticUniqueName("result"), prevArgName.types); } - possibleNameForVarDecl.numberOfAssignmentsOriginal = 2; // Try block and catch block - // update the constIdentifiers list - if (transformer.constIdentifiers.some(function (elem) { return elem.text === possibleNameForVarDecl.identifier.text; })) { - transformer.constIdentifiers.push(createUniqueSynthName(possibleNameForVarDecl).identifier); - } + // We are about to write a 'let' variable declaration, but `transformExpression` for both + // the try block and catch block will assign to this name. Setting this flag indicates + // that future assignments should be written as `name = value` instead of `const name = value`. + possibleNameForVarDecl.hasBeenDeclared = true; } - var tryBlock = ts.createBlock(transformExpression(node.expression, transformer, node, possibleNameForVarDecl)); + var tryBlock = ts.createBlock(transformExpression(node.expression, transformer, possibleNameForVarDecl)); var transformationBody = getTransformationBody(func, possibleNameForVarDecl, argName, node, transformer); var catchArg = argName ? isSynthIdentifier(argName) ? argName.identifier.text : argName.bindingPattern : "e"; var catchVariableDeclaration = ts.createVariableDeclaration(catchArg); @@ -128044,7 +128612,7 @@ var ts; */ var varDeclList; var varDeclIdentifier; - if (possibleNameForVarDecl && !shouldReturn) { + if (possibleNameForVarDecl && !shouldReturn(node, transformer)) { varDeclIdentifier = ts.getSynthesizedDeepClone(possibleNameForVarDecl.identifier); var typeArray = possibleNameForVarDecl.types; var unionType = transformer.checker.getUnionType(typeArray, 2 /* Subtype */); @@ -128057,68 +128625,53 @@ var ts; && ts.createVariableStatement(/* modifiers */ undefined, ts.createVariableDeclarationList([ts.createVariableDeclaration(ts.getSynthesizedDeepCloneWithRenames(prevArgName.bindingPattern), /* type */ undefined, varDeclIdentifier)], 2 /* Const */)); return ts.compact([varDeclList, tryStatement, destructuredResult]); } - function getIdentifierTextsFromBindingName(bindingName) { - if (ts.isIdentifier(bindingName)) - return [bindingName.text]; - return ts.flatMap(bindingName.elements, function (element) { - if (ts.isOmittedExpression(element)) - return []; - return getIdentifierTextsFromBindingName(element.name); - }); - } function createUniqueSynthName(prevArgName) { var renamedPrevArg = ts.createOptimisticUniqueName(prevArgName.identifier.text); return createSynthIdentifier(renamedPrevArg); } - function transformThen(node, transformer, outermostParent, prevArgName) { - var _a = node.arguments, res = _a[0], rej = _a[1]; - if (!res) { - return transformExpression(node.expression, transformer, outermostParent); - } - var argNameRes = getArgBindingName(res, transformer); - var transformationBody = getTransformationBody(res, prevArgName, argNameRes, node, transformer); - if (rej) { - var argNameRej = getArgBindingName(rej, transformer); - var tryBlock = ts.createBlock(transformExpression(node.expression, transformer, node, argNameRes).concat(transformationBody)); - var transformationBody2 = getTransformationBody(rej, prevArgName, argNameRej, node, transformer); - var catchArg = argNameRej ? isSynthIdentifier(argNameRej) ? argNameRej.identifier.text : argNameRej.bindingPattern : "e"; + function transformThen(node, transformer, prevArgName) { + var _a = node.arguments, onFulfilled = _a[0], onRejected = _a[1]; + var onFulfilledArgumentName = getArgBindingName(onFulfilled, transformer); + var transformationBody = getTransformationBody(onFulfilled, prevArgName, onFulfilledArgumentName, node, transformer); + if (onRejected) { + var onRejectedArgumentName = getArgBindingName(onRejected, transformer); + var tryBlock = ts.createBlock(transformExpression(node.expression, transformer, onFulfilledArgumentName).concat(transformationBody)); + var transformationBody2 = getTransformationBody(onRejected, prevArgName, onRejectedArgumentName, node, transformer); + var catchArg = onRejectedArgumentName ? isSynthIdentifier(onRejectedArgumentName) ? onRejectedArgumentName.identifier.text : onRejectedArgumentName.bindingPattern : "e"; var catchVariableDeclaration = ts.createVariableDeclaration(catchArg); var catchClause = ts.createCatchClause(catchVariableDeclaration, ts.createBlock(transformationBody2)); return [ts.createTry(tryBlock, catchClause, /* finallyBlock */ undefined)]; } - return transformExpression(node.expression, transformer, node, argNameRes).concat(transformationBody); + return transformExpression(node.expression, transformer, onFulfilledArgumentName).concat(transformationBody); } - function getFlagOfBindingName(bindingName, constIdentifiers) { - var identifiers = getIdentifierTextsFromBindingName(getNode(bindingName)); - var inArr = constIdentifiers.some(function (elem) { return ts.contains(identifiers, elem.text); }); - return inArr ? 2 /* Const */ : 1 /* Let */; - } - function transformPromiseCall(node, transformer, prevArgName) { - var shouldReturn = transformer.setOfExpressionsToReturn.get(ts.getNodeId(node).toString()); - // the identifier is empty when the handler (.then()) ignores the argument - In this situation we do not need to save the result of the promise returning call - var originalNodeParent = node.original ? node.original.parent : node.parent; - if (prevArgName && !shouldReturn && (!originalNodeParent || ts.isPropertyAccessExpression(originalNodeParent))) { - return createTransformedStatement(prevArgName, ts.createAwait(node), transformer); - } - else if (!prevArgName && !shouldReturn && (!originalNodeParent || ts.isPropertyAccessExpression(originalNodeParent))) { - return [ts.createStatement(ts.createAwait(node))]; + /** + * Transforms the 'x' part of `x.then(...)`, or the 'y()' part of `y.catch(...)`, where 'x' and 'y()' are Promises. + */ + function transformPromiseExpressionOfPropertyAccess(node, transformer, prevArgName) { + if (shouldReturn(node, transformer)) { + return [ts.createReturn(ts.getSynthesizedDeepClone(node))]; } - return [ts.createReturn(ts.getSynthesizedDeepClone(node))]; + return createVariableOrAssignmentOrExpressionStatement(prevArgName, ts.createAwait(node)); } - function createTransformedStatement(prevArgName, rightHandSide, transformer) { - if (!prevArgName || isEmpty(prevArgName)) { + function createVariableOrAssignmentOrExpressionStatement(variableName, rightHandSide) { + if (!variableName || isEmptyBindingName(variableName)) { // if there's no argName to assign to, there still might be side effects - return [ts.createStatement(rightHandSide)]; + return [ts.createExpressionStatement(rightHandSide)]; } - if (isSynthIdentifier(prevArgName) && prevArgName.types.length < prevArgName.numberOfAssignmentsOriginal) { + if (isSynthIdentifier(variableName) && variableName.hasBeenDeclared) { // if the variable has already been declared, we don't need "let" or "const" - return [ts.createStatement(ts.createAssignment(ts.getSynthesizedDeepClone(prevArgName.identifier), rightHandSide))]; + return [ts.createExpressionStatement(ts.createAssignment(ts.getSynthesizedDeepClone(variableName.identifier), rightHandSide))]; } - return [ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(ts.getSynthesizedDeepClone(getNode(prevArgName)), /*type*/ undefined, rightHandSide)], getFlagOfBindingName(prevArgName, transformer.constIdentifiers))))]; + return [ + ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration(ts.getSynthesizedDeepClone(getNode(variableName)), + /*type*/ undefined, rightHandSide) + ], 2 /* Const */)) + ]; } // should be kept up to date with isFixablePromiseArgument in suggestionDiagnostics.ts function getTransformationBody(func, prevArgName, argName, parent, transformer) { - var shouldReturn = transformer.setOfExpressionsToReturn.get(ts.getNodeId(parent).toString()); switch (func.kind) { case 100 /* NullKeyword */: // do not produce a transformed statement for a null argument @@ -128129,24 +128682,23 @@ var ts; break; } var synthCall = ts.createCall(ts.getSynthesizedDeepClone(func), /*typeArguments*/ undefined, isSynthIdentifier(argName) ? [argName.identifier] : []); - if (shouldReturn) { + if (shouldReturn(parent, transformer)) { return [ts.createReturn(synthCall)]; } - var type = transformer.originalTypeMap.get(ts.getNodeId(func).toString()) || transformer.checker.getTypeAtLocation(func); + var type = transformer.checker.getTypeAtLocation(func); var callSignatures = transformer.checker.getSignaturesOfType(type, 0 /* Call */); if (!callSignatures.length) { // if identifier in handler has no call signatures, it's invalid - codeActionSucceeded = false; - break; + return silentFail(); } var returnType = callSignatures[0].getReturnType(); - var varDeclOrAssignment = createTransformedStatement(prevArgName, ts.createAwait(synthCall), transformer); + var varDeclOrAssignment = createVariableOrAssignmentOrExpressionStatement(prevArgName, ts.createAwait(synthCall)); if (prevArgName) { prevArgName.types.push(returnType); } return varDeclOrAssignment; - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: { + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: { var funcBody = func.body; // Arrow functions with block bodies { } will enter this control flow if (ts.isBlock(funcBody)) { @@ -128164,8 +128716,9 @@ var ts; refactoredStmts.push(statement); } } - return shouldReturn ? refactoredStmts.map(function (s) { return ts.getSynthesizedDeepClone(s); }) : - removeReturns(refactoredStmts, prevArgName, transformer, seenReturnStatement); + return shouldReturn(parent, transformer) + ? refactoredStmts.map(function (s) { return ts.getSynthesizedDeepClone(s); }) + : removeReturns(refactoredStmts, prevArgName, transformer, seenReturnStatement); } else { var innerRetStmts = ts.isFixablePromiseHandler(funcBody) ? [ts.createReturn(funcBody)] : ts.emptyArray; @@ -128177,8 +128730,8 @@ var ts; var returnType_1 = getLastCallSignature(type_1, transformer.checker).getReturnType(); var rightHandSide = ts.getSynthesizedDeepClone(funcBody); var possiblyAwaitedRightHandSide = !!transformer.checker.getPromisedTypeOfPromise(returnType_1) ? ts.createAwait(rightHandSide) : rightHandSide; - if (!shouldReturn) { - var transformedStatement = createTransformedStatement(prevArgName, possiblyAwaitedRightHandSide, transformer); + if (!shouldReturn(parent, transformer)) { + var transformedStatement = createVariableOrAssignmentOrExpressionStatement(prevArgName, possiblyAwaitedRightHandSide); if (prevArgName) { prevArgName.types.push(returnType_1); } @@ -128191,8 +128744,7 @@ var ts; } default: // If no cases apply, we've found a transformation body we don't know how to handle, so the refactoring should no-op to avoid deleting code. - codeActionSucceeded = false; - break; + return silentFail(); } return ts.emptyArray; } @@ -128206,12 +128758,12 @@ var ts; var stmt = stmts_1[_i]; if (ts.isReturnStatement(stmt)) { if (stmt.expression) { - var possiblyAwaitedExpression = isPromiseReturningExpression(stmt.expression, transformer.checker) ? ts.createAwait(stmt.expression) : stmt.expression; + var possiblyAwaitedExpression = isPromiseTypedExpression(stmt.expression, transformer.checker) ? ts.createAwait(stmt.expression) : stmt.expression; if (prevArgName === undefined) { ret.push(ts.createExpressionStatement(possiblyAwaitedExpression)); } else { - ret.push(ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(getNode(prevArgName), /*type*/ undefined, possiblyAwaitedExpression)], getFlagOfBindingName(prevArgName, transformer.constIdentifiers))))); + ret.push(ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(getNode(prevArgName), /*type*/ undefined, possiblyAwaitedExpression)], 2 /* Const */)))); } } } @@ -128221,7 +128773,7 @@ var ts; } // if block has no return statement, need to define prevArgName as undefined to prevent undeclared variables if (!seenReturnStatement && prevArgName !== undefined) { - ret.push(ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(getNode(prevArgName), /*type*/ undefined, ts.createIdentifier("undefined"))], getFlagOfBindingName(prevArgName, transformer.constIdentifiers))))); + ret.push(ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(getNode(prevArgName), /*type*/ undefined, ts.createIdentifier("undefined"))], 2 /* Const */)))); } return ret; } @@ -128231,7 +128783,7 @@ var ts; var stmt = innerRetStmts_1[_i]; ts.forEachChild(stmt, function visit(node) { if (ts.isCallExpression(node)) { - var temp = transformExpression(node, transformer, node, prevArgName); + var temp = transformExpression(node, transformer, prevArgName); innerCbBody = innerCbBody.concat(temp); if (innerCbBody.length > 0) { return; @@ -128245,7 +128797,6 @@ var ts; return innerCbBody; } function getArgBindingName(funcNode, transformer) { - var numberOfAssignmentsOriginal = 0; var types = []; var name; if (ts.isFunctionLikeDeclaration(funcNode)) { @@ -128277,10 +128828,10 @@ var ts; var originalNode = getOriginalNode(identifier); var symbol = getSymbol(originalNode); if (!symbol) { - return createSynthIdentifier(identifier, types, numberOfAssignmentsOriginal); + return createSynthIdentifier(identifier, types); } var mapEntry = transformer.synthNamesMap.get(ts.getSymbolId(symbol).toString()); - return mapEntry || createSynthIdentifier(identifier, types, numberOfAssignmentsOriginal); + return mapEntry || createSynthIdentifier(identifier, types); } function getSymbol(node) { return node.symbol ? node.symbol : transformer.checker.getSymbolAtLocation(node); @@ -128289,22 +128840,21 @@ var ts; return node.original ? node.original : node; } } - function isEmpty(bindingName) { + function isEmptyBindingName(bindingName) { if (!bindingName) { return true; } if (isSynthIdentifier(bindingName)) { return !bindingName.identifier.text; } - return ts.every(bindingName.elements, isEmpty); + return ts.every(bindingName.elements, isEmptyBindingName); } function getNode(bindingName) { return isSynthIdentifier(bindingName) ? bindingName.identifier : bindingName.bindingPattern; } - function createSynthIdentifier(identifier, types, numberOfAssignmentsOriginal) { + function createSynthIdentifier(identifier, types) { if (types === void 0) { types = []; } - if (numberOfAssignmentsOriginal === void 0) { numberOfAssignmentsOriginal = 0; } - return { kind: 0 /* Identifier */, identifier: identifier, types: types, numberOfAssignmentsOriginal: numberOfAssignmentsOriginal }; + return { kind: 0 /* Identifier */, identifier: identifier, types: types, hasBeenDeclared: false }; } function createSynthBindingPattern(bindingPattern, elements, types) { if (elements === void 0) { elements = ts.emptyArray; } @@ -128317,6 +128867,9 @@ var ts; function isSynthBindingPattern(bindingName) { return bindingName.kind === 1 /* BindingPattern */; } + function shouldReturn(expression, transformer) { + return !!expression.original && transformer.setOfExpressionsToReturn.has(ts.getNodeId(expression.original).toString()); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -128350,10 +128903,10 @@ var ts; } var importNode = ts.importFromModuleSpecifier(moduleSpecifier); switch (importNode.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: changes.replaceNode(importingFile, importNode, ts.makeImport(importNode.name, /*namedImports*/ undefined, moduleSpecifier, quotePreference)); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (ts.isRequireCall(importNode, /*checkArgumentIsStringLiteralLike*/ false)) { changes.replaceNode(importingFile, importNode, ts.createPropertyAccess(ts.getSynthesizedDeepClone(importNode), "default")); } @@ -128406,20 +128959,20 @@ var ts; } function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, quotePreference) { switch (statement.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); return false; - case 226 /* ExpressionStatement */: { + case 227 /* ExpressionStatement */: { var expression = statement.expression; switch (expression.kind) { - case 196 /* CallExpression */: { + case 197 /* CallExpression */: { if (ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true)) { // For side-effecting require() call, just make a side-effecting import. changes.replaceNode(sourceFile, statement, ts.makeImport(/*name*/ undefined, /*namedImports*/ undefined, expression.arguments[0], quotePreference)); } return false; } - case 209 /* BinaryExpression */: { + case 210 /* BinaryExpression */: { var operatorToken = expression.operatorToken; return operatorToken.kind === 62 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports); } @@ -128461,8 +129014,8 @@ var ts; /** Converts `const name = require("moduleSpecifier").propertyName` */ function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, quotePreference) { switch (name.kind) { - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: { + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: { // `const [a, b] = require("c").d` --> `import { d } from "c"; const [a, b] = d;` var tmp = makeUniqueName(propertyName, identifiers); return [ @@ -128513,16 +129066,16 @@ var ts; function tryChangeModuleExportsObject(object) { var statements = ts.mapAllOrFail(object.properties, function (prop) { switch (prop.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. // falls through - case 282 /* ShorthandPropertyAssignment */: - case 283 /* SpreadAssignment */: + case 283 /* ShorthandPropertyAssignment */: + case 284 /* SpreadAssignment */: return undefined; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.createToken(89 /* ExportKeyword */)], prop); default: ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind " + prop.kind); @@ -128586,7 +129139,7 @@ var ts; function convertExportsDotXEquals_replaceNode(name, exported) { var modifiers = [ts.createToken(89 /* ExportKeyword */)]; switch (exported.kind) { - case 201 /* FunctionExpression */: { + case 202 /* FunctionExpression */: { var expressionName = exported.name; if (expressionName && expressionName.text !== name) { // `exports.f = function g() {}` -> `export const f = function g() {}` @@ -128594,10 +129147,10 @@ var ts; } } // falls through - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: // `exports.f = function() {}` --> `export function f() {}` return functionExpressionToDeclaration(name, modifiers, exported); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: // `exports.C = class {}` --> `export class C {}` return classExpressionToDeclaration(name, modifiers, exported); default: @@ -128615,7 +129168,7 @@ var ts; */ function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target, quotePreference) { switch (name.kind) { - case 189 /* ObjectBindingPattern */: { + case 190 /* ObjectBindingPattern */: { var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) { return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name) ? undefined @@ -128628,7 +129181,7 @@ var ts; } } // falls through -- object destructuring has an interesting pattern and must be a variable declaration - case 190 /* ArrayBindingPattern */: { + case 191 /* ArrayBindingPattern */: { /* import x from "x"; const [a, b, c] = x; @@ -128711,11 +129264,11 @@ var ts; function isFreeIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return parent.name !== node; - case 191 /* BindingElement */: + case 192 /* BindingElement */: return parent.propertyName !== node; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return parent.propertyName !== node; default: return true; @@ -129173,11 +129726,11 @@ var ts; function getTargetModuleFromNamespaceLikeImport(declaration, checker) { var _a; switch (declaration.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return checker.resolveExternalModuleName(declaration.initializer.arguments[0]); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return checker.getAliasedSymbol(declaration.symbol); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: var namespaceImport = ts.tryCast((_a = declaration.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings, ts.isNamespaceImport); return namespaceImport && checker.getAliasedSymbol(namespaceImport.symbol); default: @@ -129187,11 +129740,11 @@ var ts; function getNamespaceLikeImportText(declaration) { var _a, _b, _c; switch (declaration.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return (_a = ts.tryCast(declaration.name, ts.isIdentifier)) === null || _a === void 0 ? void 0 : _a.text; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return declaration.name.text; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return (_c = ts.tryCast((_b = declaration.importClause) === null || _b === void 0 ? void 0 : _b.namedBindings, ts.isNamespaceImport)) === null || _c === void 0 ? void 0 : _c.name.text; default: return ts.Debug.assertNever(declaration); @@ -129200,10 +129753,10 @@ var ts; function tryAddToExistingImport(existingImports, canUseTypeOnlyImport) { return ts.firstDefined(existingImports, function (_a) { var declaration = _a.declaration, importKind = _a.importKind; - if (declaration.kind === 253 /* ImportEqualsDeclaration */) + if (declaration.kind === 254 /* ImportEqualsDeclaration */) return undefined; - if (declaration.kind === 242 /* VariableDeclaration */) { - return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 189 /* ObjectBindingPattern */ + if (declaration.kind === 243 /* VariableDeclaration */) { + return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 190 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind: importKind, moduleSpecifier: declaration.initializer.arguments[0].text, canUseTypeOnlyImport: false } : undefined; } @@ -129211,7 +129764,7 @@ var ts; if (!importClause) return undefined; var name = importClause.name, namedBindings = importClause.namedBindings; - return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 257 /* NamedImports */) + return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 258 /* NamedImports */) ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: importClause, importKind: importKind, moduleSpecifier: declaration.moduleSpecifier.getText(), canUseTypeOnlyImport: canUseTypeOnlyImport } : undefined; }); @@ -129224,7 +129777,7 @@ var ts; if (ts.isRequireVariableDeclaration(i.parent, /*requireStringLiteralLikeArgument*/ true)) { return checker.resolveExternalModuleName(moduleSpecifier) === moduleSymbol ? { declaration: i.parent, importKind: importKind } : undefined; } - if (i.kind === 254 /* ImportDeclaration */ || i.kind === 253 /* ImportEqualsDeclaration */) { + if (i.kind === 255 /* ImportDeclaration */ || i.kind === 254 /* ImportEqualsDeclaration */) { return checker.getSymbolAtLocation(moduleSpecifier) === moduleSymbol ? { declaration: i, importKind: importKind } : undefined; } }); @@ -129267,9 +129820,9 @@ var ts; } function newImportInfoFromExistingSpecifier(_a, preferTypeOnlyImport, useRequire) { var declaration = _a.declaration, importKind = _a.importKind; - var moduleSpecifier = declaration.kind === 254 /* ImportDeclaration */ ? declaration.moduleSpecifier : - declaration.kind === 242 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : - declaration.moduleReference.kind === 265 /* ExternalModuleReference */ ? declaration.moduleReference.expression : + var moduleSpecifier = declaration.kind === 255 /* ImportDeclaration */ ? declaration.moduleSpecifier : + declaration.kind === 243 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : + declaration.moduleReference.kind === 266 /* ExternalModuleReference */ ? declaration.moduleReference.expression : undefined; return moduleSpecifier && ts.isStringLiteral(moduleSpecifier) ? { kind: 3 /* AddNew */, moduleSpecifier: moduleSpecifier.text, importKind: importKind, typeOnly: preferTypeOnlyImport, useRequire: useRequire } @@ -129480,7 +130033,7 @@ var ts; } } function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, canUseTypeOnlyImport) { - if (clause.kind === 189 /* ObjectBindingPattern */) { + if (clause.kind === 190 /* ObjectBindingPattern */) { if (defaultImport) { addElementToBindingPattern(clause, defaultImport, "default"); } @@ -129590,9 +130143,9 @@ var ts; } function forEachExternalModuleToImportFrom(program, host, from, filterByPackageJson, cb) { var filteredCount = 0; - var packageJson = filterByPackageJson && createAutoImportFilter(from, program, host); + var moduleSpecifierResolutionHost = createModuleSpecifierResolutionHost(program, host); + var packageJson = filterByPackageJson && createAutoImportFilter(from, program, host, moduleSpecifierResolutionHost); var allSourceFiles = program.getSourceFiles(); - var globalTypingsCache = host.getGlobalTypingsCacheLocation && host.getGlobalTypingsCacheLocation(); forEachExternalModule(program.getTypeChecker(), allSourceFiles, function (module, sourceFile) { if (sourceFile === undefined) { if (!packageJson || packageJson.allowsImportingAmbientModule(module, allSourceFiles)) { @@ -129604,7 +130157,7 @@ var ts; } else if (sourceFile && sourceFile !== from && - isImportablePath(from.fileName, sourceFile.fileName, ts.hostGetCanonicalFileName(host), globalTypingsCache)) { + isImportableFile(program, from, sourceFile, moduleSpecifierResolutionHost)) { if (!packageJson || packageJson.allowsImportingSourceFile(sourceFile, allSourceFiles)) { cb(module); } @@ -129630,6 +130183,19 @@ var ts; } } } + function isImportableFile(program, from, to, moduleSpecifierResolutionHost) { + var _a; + var getCanonicalFileName = ts.hostGetCanonicalFileName(moduleSpecifierResolutionHost); + var globalTypingsCache = (_a = moduleSpecifierResolutionHost.getGlobalTypingsCacheLocation) === null || _a === void 0 ? void 0 : _a.call(moduleSpecifierResolutionHost); + return !!ts.moduleSpecifiers.forEachFileNameOfModule(program.getSourceFiles(), from.fileName, to.fileName, ts.hostGetCanonicalFileName(moduleSpecifierResolutionHost), moduleSpecifierResolutionHost, program.redirectTargetsMap, + /*preferSymlinks*/ false, function (toPath) { + var toFile = program.getSourceFile(toPath); + // Determine to import using toPath only if toPath is what we were looking at + // or there doesnt exist the file in the program by the symlink + return (toFile === to || !toFile) && + isImportablePath(from.fileName, toPath, getCanonicalFileName, globalTypingsCache); + }); + } /** * Don't include something from a `node_modules` that isn't actually reachable by a global import. * A relative import to node_modules is usually a bad idea. @@ -129673,12 +130239,10 @@ var ts; return !ts.isStringANonContextualKeyword(res) ? res || "_" : "_" + res; } codefix.moduleSpecifierToValidIdentifier = moduleSpecifierToValidIdentifier; - function createAutoImportFilter(fromFile, program, host) { - var packageJsons = host.getPackageJsonsVisibleToFile && host.getPackageJsonsVisibleToFile(fromFile.fileName) || ts.getPackageJsonsVisibleToFile(fromFile.fileName, host); - var dependencyGroups = 1 /* Dependencies */ | 2 /* DevDependencies */ | 8 /* OptionalDependencies */; + function createModuleSpecifierResolutionHost(program, host) { // Mix in `getProbablySymlinks` from Program when host doesn't have it // in order for non-Project hosts to have a symlinks cache. - var moduleSpecifierResolutionHost = { + return { directoryExists: ts.maybeBind(host, host.directoryExists), fileExists: ts.maybeBind(host, host.fileExists), getCurrentDirectory: ts.maybeBind(host, host.getCurrentDirectory), @@ -129687,8 +130251,13 @@ var ts; getProbableSymlinks: ts.maybeBind(host, host.getProbableSymlinks) || program.getProbableSymlinks, getGlobalTypingsCacheLocation: ts.maybeBind(host, host.getGlobalTypingsCacheLocation), }; + } + function createAutoImportFilter(fromFile, program, host, moduleSpecifierResolutionHost) { + if (moduleSpecifierResolutionHost === void 0) { moduleSpecifierResolutionHost = createModuleSpecifierResolutionHost(program, host); } + var packageJsons = host.getPackageJsonsVisibleToFile && host.getPackageJsonsVisibleToFile(fromFile.fileName) || ts.getPackageJsonsVisibleToFile(fromFile.fileName, host); + var dependencyGroups = 1 /* Dependencies */ | 2 /* DevDependencies */ | 8 /* OptionalDependencies */; var usesNodeCoreModules; - return { allowsImportingAmbientModule: allowsImportingAmbientModule, allowsImportingSourceFile: allowsImportingSourceFile, allowsImportingSpecifier: allowsImportingSpecifier }; + return { allowsImportingAmbientModule: allowsImportingAmbientModule, allowsImportingSourceFile: allowsImportingSourceFile, allowsImportingSpecifier: allowsImportingSpecifier, moduleSpecifierResolutionHost: moduleSpecifierResolutionHost }; function moduleSpecifierIsCoveredByPackageJson(specifier) { var packageName = getNodeModuleRootSpecifier(specifier); for (var _i = 0, packageJsons_1 = packageJsons; _i < packageJsons_1.length; _i++) { @@ -129960,7 +130529,7 @@ var ts; } else { var typeNode = getTypeNode(program.getTypeChecker(), parentDeclaration, token); - addPropertyDeclaration(changes, declSourceFile, parentDeclaration, token.text, typeNode, makeStatic); + addPropertyDeclaration(changes, declSourceFile, parentDeclaration, token.text, typeNode, makeStatic ? 32 /* Static */ : 0); } } }; @@ -130040,7 +130609,7 @@ var ts; function addMissingMemberInJs(changeTracker, declSourceFile, classDeclaration, token, makeStatic) { var tokenName = token.text; if (makeStatic) { - if (classDeclaration.kind === 214 /* ClassExpression */) { + if (classDeclaration.kind === 215 /* ClassExpression */) { return; } var className = classDeclaration.name.getText(); @@ -130076,12 +130645,19 @@ var ts; } function getActionsForAddMissingMemberInTypeScriptFile(context, declSourceFile, classDeclaration, token, makeStatic) { var typeNode = getTypeNode(context.program.getTypeChecker(), classDeclaration, token); - var addProp = createAddPropertyDeclarationAction(context, declSourceFile, classDeclaration, makeStatic, token.text, typeNode); - return makeStatic || ts.isPrivateIdentifier(token) ? [addProp] : [addProp, createAddIndexSignatureAction(context, declSourceFile, classDeclaration, token.text, typeNode)]; + var actions = [createAddPropertyDeclarationAction(context, declSourceFile, classDeclaration, token.text, typeNode, makeStatic ? 32 /* Static */ : 0)]; + if (makeStatic || ts.isPrivateIdentifier(token)) { + return actions; + } + if (ts.startsWithUnderscore(token.text)) { + actions.unshift(createAddPropertyDeclarationAction(context, declSourceFile, classDeclaration, token.text, typeNode, 8 /* Private */)); + } + actions.push(createAddIndexSignatureAction(context, declSourceFile, classDeclaration, token.text, typeNode)); + return actions; } function getTypeNode(checker, classDeclaration, token) { var typeNode; - if (token.parent.parent.kind === 209 /* BinaryExpression */) { + if (token.parent.parent.kind === 210 /* BinaryExpression */) { var binaryExpression = token.parent.parent; var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); @@ -130093,14 +130669,17 @@ var ts; } return typeNode || ts.createKeywordTypeNode(125 /* AnyKeyword */); } - function createAddPropertyDeclarationAction(context, declSourceFile, classDeclaration, makeStatic, tokenName, typeNode) { - var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addPropertyDeclaration(t, declSourceFile, classDeclaration, tokenName, typeNode, makeStatic); }); - return codefix.createCodeFixAction(fixName, changes, [makeStatic ? ts.Diagnostics.Declare_static_property_0 : ts.Diagnostics.Declare_property_0, tokenName], fixId, ts.Diagnostics.Add_all_missing_members); + function createAddPropertyDeclarationAction(context, declSourceFile, classDeclaration, tokenName, typeNode, modifierFlags) { + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addPropertyDeclaration(t, declSourceFile, classDeclaration, tokenName, typeNode, modifierFlags); }); + if (modifierFlags & 8 /* Private */) { + return codefix.createCodeFixActionWithoutFixAll(fixName, changes, [ts.Diagnostics.Declare_private_property_0, tokenName]); + } + return codefix.createCodeFixAction(fixName, changes, [modifierFlags & 32 /* Static */ ? ts.Diagnostics.Declare_static_property_0 : ts.Diagnostics.Declare_property_0, tokenName], fixId, ts.Diagnostics.Add_all_missing_members); } - function addPropertyDeclaration(changeTracker, declSourceFile, classDeclaration, tokenName, typeNode, makeStatic) { + function addPropertyDeclaration(changeTracker, declSourceFile, classDeclaration, tokenName, typeNode, modifierFlags) { var property = ts.createProperty( /*decorators*/ undefined, - /*modifiers*/ makeStatic ? [ts.createToken(120 /* StaticKeyword */)] : undefined, tokenName, + /*modifiers*/ modifierFlags ? ts.createNodeArray(ts.createModifiersFromModifierFlags(modifierFlags)) : undefined, tokenName, /*questionToken*/ undefined, typeNode, /*initializer*/ undefined); var lastProp = getNodeToInsertPropertyAfter(classDeclaration); @@ -130124,7 +130703,7 @@ var ts; } function createAddIndexSignatureAction(context, declSourceFile, classDeclaration, tokenName, typeNode) { // Index signatures cannot have the static modifier. - var stringTypeNode = ts.createKeywordTypeNode(143 /* StringKeyword */); + var stringTypeNode = ts.createKeywordTypeNode(144 /* StringKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -130148,7 +130727,7 @@ var ts; } function addMethodDeclaration(context, changeTracker, declSourceFile, typeDecl, token, callExpression, makeStatic, inJs, preferences) { var methodDeclaration = codefix.createMethodFromCallExpression(context, callExpression, token.text, inJs, makeStatic, preferences, typeDecl); - var containingMethodDeclaration = ts.getAncestor(callExpression, 161 /* MethodDeclaration */); + var containingMethodDeclaration = ts.getAncestor(callExpression, 162 /* MethodDeclaration */); if (containingMethodDeclaration && containingMethodDeclaration.parent === typeDecl) { changeTracker.insertNodeAfter(declSourceFile, containingMethodDeclaration, methodDeclaration); } @@ -130167,7 +130746,10 @@ var ts; return !!(type && type.flags & 132 /* StringLike */); }); var enumMember = ts.createEnumMember(token, hasStringInitializer ? ts.createStringLiteral(token.text) : undefined); - changes.replaceNode(enumDeclaration.getSourceFile(), enumDeclaration, ts.updateEnumDeclaration(enumDeclaration, enumDeclaration.decorators, enumDeclaration.modifiers, enumDeclaration.name, ts.concatenate(enumDeclaration.members, ts.singleElementArray(enumMember)))); + changes.replaceNode(enumDeclaration.getSourceFile(), enumDeclaration, ts.updateEnumDeclaration(enumDeclaration, enumDeclaration.decorators, enumDeclaration.modifiers, enumDeclaration.name, ts.concatenate(enumDeclaration.members, ts.singleElementArray(enumMember))), { + leadingTriviaOption: ts.textChanges.LeadingTriviaOption.IncludeAll, + trailingTriviaOption: ts.textChanges.TrailingTriviaOption.Exclude + }); } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); @@ -130212,7 +130794,7 @@ var ts; (function (codefix) { var fixName = "fixCannotFindModule"; var fixIdInstallTypesPackage = "installTypesPackage"; - var errorCodeCannotFindModule = ts.Diagnostics.Cannot_find_module_0.code; + var errorCodeCannotFindModule = ts.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations.code; var errorCodes = [ errorCodeCannotFindModule, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code, @@ -130704,7 +131286,7 @@ var ts; return [createDeleteFix(delVar, ts.Diagnostics.Remove_variable_statement)]; } var result = []; - if (token.kind === 132 /* InferKeyword */) { + if (token.kind === 133 /* InferKeyword */) { var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return changeInferToUnknown(t, sourceFile, token); }); var name = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name.text; result.push(codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Replace_infer_0_with_unknown, name], fixIdInfer, ts.Diagnostics.Replace_all_unused_infer_with_unknown)); @@ -130736,7 +131318,7 @@ var ts; tryPrefixDeclaration(changes, diag.code, sourceFile, token); break; case fixIdDelete: { - if (token.kind === 132 /* InferKeyword */) + if (token.kind === 133 /* InferKeyword */) break; // Can't delete var importDecl = tryGetFullImport(token); if (importDecl) { @@ -130755,7 +131337,7 @@ var ts; break; } case fixIdInfer: - if (token.kind === 132 /* InferKeyword */) { + if (token.kind === 133 /* InferKeyword */) { changeInferToUnknown(changes, sourceFile, token); } break; @@ -130766,7 +131348,7 @@ var ts; }, }); function changeInferToUnknown(changes, sourceFile, token) { - changes.replaceNode(sourceFile, token.parent, ts.createKeywordTypeNode(148 /* UnknownKeyword */)); + changes.replaceNode(sourceFile, token.parent, ts.createKeywordTypeNode(149 /* UnknownKeyword */)); } function createDeleteFix(changes, diag) { return codefix.createCodeFixAction(fixName, changes, diag, fixIdDelete, ts.Diagnostics.Delete_all_unused_declarations); @@ -130782,7 +131364,7 @@ var ts; if (token.kind !== 18 /* OpenBraceToken */ || !ts.isObjectBindingPattern(token.parent)) return false; var decl = token.parent.parent; - if (decl.kind === 156 /* Parameter */) { + if (decl.kind === 157 /* Parameter */) { tryDeleteParameter(changes, sourceFile, decl, checker, sourceFiles, isFixAll); } else { @@ -130793,7 +131375,7 @@ var ts; function tryDeleteFullVariableStatement(sourceFile, token, changes) { var declarationList = ts.tryCast(token.parent, ts.isVariableDeclarationList); if (declarationList && declarationList.getChildren(sourceFile)[0] === token) { - changes.delete(sourceFile, declarationList.parent.kind === 225 /* VariableStatement */ ? declarationList.parent : declarationList); + changes.delete(sourceFile, declarationList.parent.kind === 226 /* VariableStatement */ ? declarationList.parent : declarationList); return true; } return false; @@ -130802,7 +131384,7 @@ var ts; // Don't offer to prefix a property. if (errorCode === ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code) return; - if (token.kind === 132 /* InferKeyword */) { + if (token.kind === 133 /* InferKeyword */) { token = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name; } if (ts.isIdentifier(token) && canPrefix(token)) { @@ -130811,14 +131393,14 @@ var ts; } function canPrefix(token) { switch (token.parent.kind) { - case 156 /* Parameter */: - case 155 /* TypeParameter */: + case 157 /* Parameter */: + case 156 /* TypeParameter */: return true; - case 242 /* VariableDeclaration */: { + case 243 /* VariableDeclaration */: { var varDecl = token.parent; switch (varDecl.parent.parent.kind) { - case 232 /* ForOfStatement */: - case 231 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 232 /* ForInStatement */: return true; } } @@ -130865,17 +131447,17 @@ var ts; function mayDeleteParameter(p, checker, isFixAll) { var parent = p.parent; switch (parent.kind) { - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: // Don't remove a parameter if this overrides something. var symbol = checker.getSymbolAtLocation(parent.name); if (ts.isMemberSymbolInBaseType(symbol, checker)) return false; // falls through - case 162 /* Constructor */: - case 244 /* FunctionDeclaration */: + case 163 /* Constructor */: + case 245 /* FunctionDeclaration */: return true; - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: { + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: { // Can't remove a non-last parameter in a callback. Can remove a parameter in code-fix-all if future parameters are also unused. var parameters = parent.parameters; var index = parameters.indexOf(p); @@ -130884,7 +131466,7 @@ var ts; ? parameters.slice(index + 1).every(function (p) { return p.name.kind === 75 /* Identifier */ && !p.symbol.isReferenced; }) : index === parameters.length - 1; } - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: // Setter must have a parameter return false; default: @@ -130933,7 +131515,7 @@ var ts; var container = (ts.isBlock(statement.parent) ? statement.parent : statement).parent; if (!ts.isBlock(statement.parent) || statement === ts.first(statement.parent.statements)) { switch (container.kind) { - case 227 /* IfStatement */: + case 228 /* IfStatement */: if (container.elseStatement) { if (ts.isBlock(statement.parent)) { break; @@ -130944,8 +131526,8 @@ var ts; return; } // falls through - case 229 /* WhileStatement */: - case 230 /* ForStatement */: + case 230 /* WhileStatement */: + case 231 /* ForStatement */: changes.delete(sourceFile, container); return; } @@ -131018,7 +131600,7 @@ var ts; var typeNode = info.typeNode, type = info.type; var original = typeNode.getText(sourceFile); var actions = [fix(type, fixIdPlain, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)]; - if (typeNode.kind === 297 /* JSDocNullableType */) { + if (typeNode.kind === 298 /* JSDocNullableType */) { // for nullable types, suggest the flow-compatible `T | null | undefined` // in addition to the jsdoc/closure-compatible `T | null` actions.push(fix(checker.getNullableType(type, 32768 /* Undefined */), fixIdNullable, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)); @@ -131038,7 +131620,7 @@ var ts; if (!info) return; var typeNode = info.typeNode, type = info.type; - var fixedType = typeNode.kind === 297 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; + var fixedType = typeNode.kind === 298 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; doChange(changes, sourceFile, typeNode, fixedType, checker); }); } @@ -131055,22 +131637,22 @@ var ts; // NOTE: Some locations are not handled yet: // MappedTypeNode.typeParameters and SignatureDeclaration.typeParameters, as well as CallExpression.typeArguments switch (node.kind) { - case 217 /* AsExpression */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 244 /* FunctionDeclaration */: - case 163 /* GetAccessor */: - case 167 /* IndexSignature */: - case 186 /* MappedType */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 156 /* Parameter */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 164 /* SetAccessor */: - case 247 /* TypeAliasDeclaration */: - case 199 /* TypeAssertionExpression */: - case 242 /* VariableDeclaration */: + case 218 /* AsExpression */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 245 /* FunctionDeclaration */: + case 164 /* GetAccessor */: + case 168 /* IndexSignature */: + case 187 /* MappedType */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 157 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 165 /* SetAccessor */: + case 248 /* TypeAliasDeclaration */: + case 200 /* TypeAssertionExpression */: + case 243 /* VariableDeclaration */: return true; default: return false; @@ -131080,6 +131662,51 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "fixMissingCallParentheses"; + var errorCodes = [ + ts.Diagnostics.This_condition_will_always_return_true_since_the_function_is_always_defined_Did_you_mean_to_call_it_instead.code, + ]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + fixIds: [fixId], + getCodeActions: function (context) { + var sourceFile = context.sourceFile, span = context.span; + var callName = getCallName(sourceFile, span.start); + if (!callName) + return; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, callName); }); + return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_missing_call_parentheses, fixId, ts.Diagnostics.Add_all_missing_call_parentheses)]; + }, + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var callName = getCallName(diag.file, diag.start); + if (callName) + doChange(changes, diag.file, callName); + }); } + }); + function doChange(changes, sourceFile, name) { + changes.replaceNodeWithText(sourceFile, name, name.text + "()"); + } + function getCallName(sourceFile, start) { + var token = ts.getTokenAtPosition(sourceFile, start); + if (ts.isPropertyAccessExpression(token.parent)) { + var current = token.parent; + while (ts.isPropertyAccessExpression(current.parent)) { + current = current.parent; + } + return current.name; + } + if (ts.isIdentifier(token)) { + return token; + } + return undefined; + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var codefix; (function (codefix) { @@ -131127,14 +131754,14 @@ var ts; } var insertBefore; switch (containingFunction.kind) { - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: insertBefore = containingFunction.name; break; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: insertBefore = ts.findChildOfKind(containingFunction, 94 /* FunctionKeyword */, sourceFile); break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: insertBefore = ts.findChildOfKind(containingFunction, 20 /* OpenParenToken */, sourceFile) || ts.first(containingFunction.parameters); break; default: @@ -131265,8 +131892,8 @@ var ts; var optional = !!(symbol.flags & 16777216 /* Optional */); var ambient = !!(enclosingDeclaration.flags & 8388608 /* Ambient */); switch (declaration.kind) { - case 158 /* PropertySignature */: - case 159 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 160 /* PropertyDeclaration */: var flags = preferences.quotePreference === "single" ? 268435456 /* UseSingleQuotesForStringLiteralType */ : undefined; var typeNode = checker.typeToTypeNode(type, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context)); if (importAdder) { @@ -131280,8 +131907,8 @@ var ts; /*decorators*/ undefined, modifiers, name, optional ? ts.createToken(57 /* QuestionToken */) : undefined, typeNode, /*initializer*/ undefined)); break; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: { + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: { var typeNode_1 = checker.typeToTypeNode(type, enclosingDeclaration, /*flags*/ undefined, getNoopSymbolTrackerWithResolver(context)); var allAccessors = ts.getAllAccessorDeclarations(declarations, declaration); var orderedAccessors = allAccessors.secondAccessor @@ -131310,8 +131937,8 @@ var ts; } break; } - case 160 /* MethodSignature */: - case 161 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 162 /* MethodDeclaration */: // The signature for the implementation appears as an entry in `signatures` iff // there is only one signature. // If there are overloads and an implementation signature, it appears as an @@ -131356,7 +131983,7 @@ var ts; var program = context.program; var checker = program.getTypeChecker(); var scriptTarget = ts.getEmitScriptTarget(program.getCompilerOptions()); - var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 161 /* MethodDeclaration */, enclosingDeclaration, 1 /* NoTruncation */ | 256 /* SuppressAnyReturnType */, getNoopSymbolTrackerWithResolver(context)); + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 162 /* MethodDeclaration */, enclosingDeclaration, 1 /* NoTruncation */ | 256 /* SuppressAnyReturnType */, getNoopSymbolTrackerWithResolver(context)); if (!signatureDeclaration) { return undefined; } @@ -131618,7 +132245,7 @@ var ts; }); function getActionsForUsageOfInvalidImport(context) { var sourceFile = context.sourceFile; - var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 196 /* CallExpression */ : 197 /* NewExpression */; + var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 197 /* CallExpression */ : 198 /* NewExpression */; var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start), function (a) { return a.kind === targetKind; }); if (!node) { return []; @@ -131737,7 +132364,7 @@ var ts; return codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Add_undefined_type_to_property_0, propertyDeclaration.name.getText()], fixIdAddUndefinedType, ts.Diagnostics.Add_undefined_type_to_all_uninitialized_properties); } function addUndefinedType(changeTracker, propertyDeclarationSourceFile, propertyDeclaration) { - var undefinedTypeNode = ts.createKeywordTypeNode(146 /* UndefinedKeyword */); + var undefinedTypeNode = ts.createKeywordTypeNode(147 /* UndefinedKeyword */); var type = propertyDeclaration.type; // TODO: GH#18217 var types = ts.isUnionTypeNode(type) ? type.types.concat(undefinedTypeNode) : [type, undefinedTypeNode]; changeTracker.replaceNode(propertyDeclarationSourceFile, type, ts.createUnionTypeNode(types)); @@ -131913,7 +132540,7 @@ var ts; function getImportTypeNode(sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos); ts.Debug.assert(token.kind === 96 /* ImportKeyword */, "This token should be an ImportKeyword"); - ts.Debug.assert(token.parent.kind === 188 /* ImportType */, "Token parent should be an ImportType"); + ts.Debug.assert(token.parent.kind === 189 /* ImportType */, "Token parent should be an ImportType"); return token.parent; } function doChange(changes, sourceFile, importType) { @@ -131965,7 +132592,7 @@ var ts; var otherMembers = members.filter(function (member) { return !ts.isIndexSignatureDeclaration(member); }); var parameter = ts.first(indexSignature.parameters); var mappedTypeParameter = ts.createTypeParameterDeclaration(ts.cast(parameter.name, ts.isIdentifier), parameter.type); - var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(138 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); + var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(139 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); var intersectionType = ts.createIntersectionTypeNode(__spreadArrays(ts.getAllSuperTypeNodes(container), [ mappedIntersectionType ], (otherMembers.length ? [ts.createTypeLiteralNode(otherMembers)] : ts.emptyArray))); @@ -132089,6 +132716,46 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "fixExpectedComma"; + var expectedErrorCode = ts.Diagnostics._0_expected.code; + var errorCodes = [expectedErrorCode]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var info = getInfo(sourceFile, context.span.start, context.errorCode); + if (!info) { + return undefined; + } + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, info); }); + return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Change_0_to_1, ";", ","], fixId, [ts.Diagnostics.Change_0_to_1, ";", ","])]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var info = getInfo(diag.file, diag.start, diag.code); + if (info) + doChange(changes, context.sourceFile, info); + }); }, + }); + function getInfo(sourceFile, pos, _) { + var node = ts.getTokenAtPosition(sourceFile, pos); + return (node.kind === 26 /* SemicolonToken */ && + node.parent && + (ts.isObjectLiteralExpression(node.parent) || + ts.isArrayLiteralExpression(node.parent))) ? { node: node } : undefined; + } + function doChange(changes, sourceFile, _a) { + var node = _a.node; + var newNode = ts.createNode(27 /* CommaToken */); + changes.replaceNode(sourceFile, node, newNode); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var refactor; (function (refactor) { @@ -132126,16 +132793,16 @@ var ts; return undefined; } switch (exportNode.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 249 /* ModuleDeclaration */: { + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 250 /* ModuleDeclaration */: { var node = exportNode; return node.name && ts.isIdentifier(node.name) ? { exportNode: node, exportName: node.name, wasDefault: wasDefault, exportingModuleSymbol: exportingModuleSymbol } : undefined; } - case 225 /* VariableStatement */: { + case 226 /* VariableStatement */: { var vs = exportNode; // Must be `export const x = something;`. if (!(vs.declarationList.flags & 2 /* Const */) || vs.declarationList.declarations.length !== 1) { @@ -132163,12 +132830,12 @@ var ts; else { var exportKeyword = ts.Debug.checkDefined(ts.findModifier(exportNode, 89 /* ExportKeyword */), "Should find an export keyword in modifier list"); switch (exportNode.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: changes.insertNodeAfter(exportingSourceFile, exportKeyword, ts.createToken(84 /* DefaultKeyword */)); break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // If 'x' isn't used in this file, `export const x = 0;` --> `export default 0;` if (!ts.FindAllReferences.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile)) { // We checked in `getInfo` that an initializer exists. @@ -132176,9 +132843,9 @@ var ts; break; } // falls through - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 249 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 250 /* ModuleDeclaration */: // `export type T = number;` -> `type T = number; export default T;` changes.deleteModifier(exportingSourceFile, exportKeyword); changes.insertNodeAfter(exportingSourceFile, exportNode, ts.createExportDefault(ts.createIdentifier(exportName.text))); @@ -132205,18 +132872,18 @@ var ts; function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) { var parent = ref.parent; switch (parent.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: // `a.default` --> `a.foo` changes.replaceNode(importingSourceFile, ref, ts.createIdentifier(exportName)); break; - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: { + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: { var spec = parent; // `default as foo` --> `foo`, `default as bar` --> `foo as bar` changes.replaceNode(importingSourceFile, spec, makeImportSpecifier(exportName, spec.name.text)); break; } - case 255 /* ImportClause */: { + case 256 /* ImportClause */: { var clause = parent; ts.Debug.assert(clause.name === ref, "Import clause name should match provided ref"); var spec = makeImportSpecifier(exportName, ref.text); @@ -132225,7 +132892,7 @@ var ts; // `import foo from "./a";` --> `import { foo } from "./a";` changes.replaceNode(importingSourceFile, ref, ts.createNamedImports([spec])); } - else if (namedBindings.kind === 256 /* NamespaceImport */) { + else if (namedBindings.kind === 257 /* NamespaceImport */) { // `import foo, * as a from "./a";` --> `import * as a from ".a/"; import { foo } from "./a";` changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) }); var quotePreference = ts.isStringLiteral(clause.parent.moduleSpecifier) ? ts.quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : 1 /* Double */; @@ -132246,11 +132913,11 @@ var ts; function changeNamedToDefaultImport(importingSourceFile, ref, changes) { var parent = ref.parent; switch (parent.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: // `a.foo` --> `a.default` changes.replaceNode(importingSourceFile, ref, ts.createIdentifier("default")); break; - case 258 /* ImportSpecifier */: { + case 259 /* ImportSpecifier */: { // `import { foo } from "./a";` --> `import foo from "./a";` // `import { foo as bar } from "./a";` --> `import bar from "./a";` var defaultImport = ts.createIdentifier(parent.name.text); @@ -132263,7 +132930,7 @@ var ts; } break; } - case 263 /* ExportSpecifier */: { + case 264 /* ExportSpecifier */: { // `export { foo } from "./a";` --> `export { default as foo } from "./a";` // `export { foo as bar } from "./a";` --> `export { default as bar } from "./a";` // `export { foo as default } from "./a";` --> `export { default } from "./a";` @@ -132296,8 +132963,8 @@ var ts; var i = getImportToConvert(context); if (!i) return ts.emptyArray; - var description = i.kind === 256 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; - var actionName = i.kind === 256 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; + var description = i.kind === 257 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; + var actionName = i.kind === 257 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; return [{ name: refactorName, description: description, actions: [{ name: actionName, description: description }] }]; }, getEditsForAction: function (context, actionName) { @@ -132319,7 +132986,7 @@ var ts; } function doChange(sourceFile, program, changes, toConvert) { var checker = program.getTypeChecker(); - if (toConvert.kind === 256 /* NamespaceImport */) { + if (toConvert.kind === 257 /* NamespaceImport */) { doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())); } else { @@ -132666,20 +133333,20 @@ var ts; function checkForStaticContext(nodeToCheck, containingClass) { var current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 159 /* PropertyDeclaration */) { + if (current.kind === 160 /* PropertyDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 156 /* Parameter */) { + else if (current.kind === 157 /* Parameter */) { var ctorOrMethod = ts.getContainingFunction(current); - if (ctorOrMethod.kind === 162 /* Constructor */) { + if (ctorOrMethod.kind === 163 /* Constructor */) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 161 /* MethodDeclaration */) { + else if (current.kind === 162 /* MethodDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } @@ -132722,7 +133389,7 @@ var ts; return true; } if (ts.isDeclaration(node)) { - var declaringNode = (node.kind === 242 /* VariableDeclaration */) ? node.parent.parent : node; + var declaringNode = (node.kind === 243 /* VariableDeclaration */) ? node.parent.parent : node; if (ts.hasModifier(declaringNode, 1 /* Export */)) { // TODO: GH#18217 Silly to use `errors ||` since it's definitely not defined (see top of `visit`) // Also, if we're only pushing one error, just use `let error: Diagnostic | undefined`! @@ -132734,13 +133401,13 @@ var ts; } // Some things can't be extracted in certain situations switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractImport)); return true; case 102 /* SuperKeyword */: // For a super *constructor call*, we have to be extracting the entire class, // but a super *method call* simply implies a 'this' reference - if (node.parent.kind === 196 /* CallExpression */) { + if (node.parent.kind === 197 /* CallExpression */) { // Super constructor call var containingClass_1 = ts.getContainingClass(node); // TODO:GH#18217 if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { @@ -132755,8 +133422,8 @@ var ts; } if (ts.isFunctionLikeDeclaration(node) || ts.isClassLike(node)) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: if (ts.isSourceFile(node.parent) && node.parent.externalModuleIndicator === undefined) { // You cannot extract global declarations (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); @@ -132768,21 +133435,21 @@ var ts; } var savedPermittedJumps = permittedJumps; switch (node.kind) { - case 227 /* IfStatement */: + case 228 /* IfStatement */: permittedJumps = 0 /* None */; break; - case 240 /* TryStatement */: + case 241 /* TryStatement */: // forbid all jumps inside try blocks permittedJumps = 0 /* None */; break; - case 223 /* Block */: - if (node.parent && node.parent.kind === 240 /* TryStatement */ && node.parent.finallyBlock === node) { + case 224 /* Block */: + if (node.parent && node.parent.kind === 241 /* TryStatement */ && node.parent.finallyBlock === node) { // allow unconditional returns from finally blocks permittedJumps = 4 /* Return */; } break; - case 278 /* DefaultClause */: - case 277 /* CaseClause */: + case 279 /* DefaultClause */: + case 278 /* CaseClause */: // allow unlabeled break inside case clauses permittedJumps |= 1 /* Break */; break; @@ -132794,19 +133461,19 @@ var ts; break; } switch (node.kind) { - case 183 /* ThisType */: + case 184 /* ThisType */: case 104 /* ThisKeyword */: rangeFacts |= RangeFacts.UsesThis; break; - case 238 /* LabeledStatement */: { + case 239 /* LabeledStatement */: { var label = node.label; (seenLabels || (seenLabels = [])).push(label.escapedText); ts.forEachChild(node, visit); seenLabels.pop(); break; } - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: { + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: { var label = node.label; if (label) { if (!ts.contains(seenLabels, label.escapedText)) { @@ -132815,20 +133482,20 @@ var ts; } } else { - if (!(permittedJumps & (node.kind === 234 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + if (!(permittedJumps & (node.kind === 235 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { // attempt to break or continue in a forbidden context (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: rangeFacts |= RangeFacts.IsAsyncFunction; break; - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: rangeFacts |= RangeFacts.IsGenerator; break; - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: if (permittedJumps & 4 /* Return */) { rangeFacts |= RangeFacts.HasReturn; } @@ -132882,7 +133549,7 @@ var ts; while (true) { current = current.parent; // A function parameter's initializer is actually in the outer scope, not the function declaration - if (current.kind === 156 /* Parameter */) { + if (current.kind === 157 /* Parameter */) { // Skip all the way to the outer scope of the function that declared this parameter current = ts.findAncestor(current, function (parent) { return ts.isFunctionLikeDeclaration(parent); }).parent; } @@ -132893,7 +133560,7 @@ var ts; // * Module/namespace or source file if (isScope(current)) { scopes.push(current); - if (current.kind === 290 /* SourceFile */) { + if (current.kind === 291 /* SourceFile */) { return scopes; } } @@ -132983,32 +133650,32 @@ var ts; } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: return "constructor"; - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: return scope.name ? "function '" + scope.name.text + "'" : "anonymous function"; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return "arrow function"; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return "method '" + scope.name.getText() + "'"; - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: return "'get " + scope.name.getText() + "'"; - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: return "'set " + scope.name.getText() + "'"; default: throw ts.Debug.assertNever(scope, "Unexpected scope kind " + scope.kind); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 245 /* ClassDeclaration */ + return scope.kind === 246 /* ClassDeclaration */ ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration" : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 250 /* ModuleBlock */ + return scope.kind === 251 /* ModuleBlock */ ? "namespace '" + scope.parent.name.getText() + "'" : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } @@ -133228,9 +133895,9 @@ var ts; while (ts.isParenthesizedTypeNode(withoutParens)) { withoutParens = withoutParens.type; } - return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 146 /* UndefinedKeyword */; }) + return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 147 /* UndefinedKeyword */; }) ? clone - : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(146 /* UndefinedKeyword */)]); + : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(147 /* UndefinedKeyword */)]); } } /** @@ -133259,7 +133926,7 @@ var ts; if (rangeFacts & RangeFacts.InStaticRegion) { modifiers.push(ts.createToken(120 /* StaticKeyword */)); } - modifiers.push(ts.createToken(138 /* ReadonlyKeyword */)); + modifiers.push(ts.createToken(139 /* ReadonlyKeyword */)); var newVariable = ts.createProperty( /*decorators*/ undefined, modifiers, localNameText, /*questionToken*/ undefined, variableType, initializer); @@ -133288,7 +133955,7 @@ var ts; var localReference = ts.createIdentifier(localNameText); changeTracker.replaceNode(context.file, node, localReference); } - else if (node.parent.kind === 226 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { + else if (node.parent.kind === 227 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { // If the parent is an expression statement and the target scope is the immediately enclosing one, // replace the statement with the declaration. var newVariableStatement = ts.createVariableStatement( @@ -133307,7 +133974,7 @@ var ts; changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false); } // Consume - if (node.parent.kind === 226 /* ExpressionStatement */) { + if (node.parent.kind === 227 /* ExpressionStatement */) { // If the parent is an expression statement, delete it. changeTracker.delete(context.file, node.parent); } @@ -133451,7 +134118,7 @@ var ts; return { body: ts.createBlock(statements, /*multiLine*/ true), returnValueProperty: undefined }; } function visitor(node) { - if (!ignoreReturns && node.kind === 235 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { + if (!ignoreReturns && node.kind === 236 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { var assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); if (node.expression) { if (!returnValueProperty) { @@ -133629,7 +134296,7 @@ var ts; var scope = scopes_1[_i]; usagesPerScope.push({ usages: ts.createMap(), typeParameterUsages: ts.createMap(), substitutions: ts.createMap() }); substitutionsPerScope.push(ts.createMap()); - functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 244 /* FunctionDeclaration */ + functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 245 /* FunctionDeclaration */ ? [ts.createDiagnosticForNode(scope, Messages.cannotExtractToOtherFunctionLike)] : []); var constantErrors = []; @@ -133945,30 +134612,30 @@ var ts; function isExtractableExpression(node) { var parent = node.parent; switch (parent.kind) { - case 284 /* EnumMember */: + case 285 /* EnumMember */: return false; } switch (node.kind) { case 10 /* StringLiteral */: - return parent.kind !== 254 /* ImportDeclaration */ && - parent.kind !== 258 /* ImportSpecifier */; - case 213 /* SpreadElement */: - case 189 /* ObjectBindingPattern */: - case 191 /* BindingElement */: + return parent.kind !== 255 /* ImportDeclaration */ && + parent.kind !== 259 /* ImportSpecifier */; + case 214 /* SpreadElement */: + case 190 /* ObjectBindingPattern */: + case 192 /* BindingElement */: return false; case 75 /* Identifier */: - return parent.kind !== 191 /* BindingElement */ && - parent.kind !== 258 /* ImportSpecifier */ && - parent.kind !== 263 /* ExportSpecifier */; + return parent.kind !== 192 /* BindingElement */ && + parent.kind !== 259 /* ImportSpecifier */ && + parent.kind !== 264 /* ExportSpecifier */; } return true; } function isBlockLike(node) { switch (node.kind) { - case 223 /* Block */: - case 290 /* SourceFile */: - case 250 /* ModuleBlock */: - case 277 /* CaseClause */: + case 224 /* Block */: + case 291 /* SourceFile */: + case 251 /* ModuleBlock */: + case 278 /* CaseClause */: return true; default: return false; @@ -134132,7 +134799,7 @@ var ts; } function doTypedefChange(changes, file, name, info) { var firstStatement = info.firstStatement, selection = info.selection, typeParameters = info.typeParameters; - var node = ts.createNode(322 /* JSDocTypedefTag */); + var node = ts.createNode(323 /* JSDocTypedefTag */); node.tagName = ts.createIdentifier("typedef"); // TODO: jsdoc factory https://github.com/Microsoft/TypeScript/pull/29539 node.fullName = ts.createIdentifier(name); node.name = node.fullName; @@ -134140,10 +134807,10 @@ var ts; var templates = []; ts.forEach(typeParameters, function (typeParameter) { var constraint = ts.getEffectiveConstraintOfTypeParameter(typeParameter); - var template = ts.createNode(321 /* JSDocTemplateTag */); + var template = ts.createNode(322 /* JSDocTemplateTag */); template.tagName = ts.createIdentifier("template"); template.constraint = constraint && ts.cast(constraint, ts.isJSDocTypeExpression); - var parameter = ts.createNode(155 /* TypeParameter */); + var parameter = ts.createNode(156 /* TypeParameter */); parameter.name = typeParameter.name; template.typeParameters = ts.createNodeArray([parameter]); templates.push(template); @@ -134237,9 +134904,6 @@ var ts; var modifiers = ts.append(!isJS ? [ts.createToken(accessModifier)] : undefined, isStatic ? ts.createToken(120 /* StaticKeyword */) : undefined); return modifiers && ts.createNodeArray(modifiers); } - function startsWithUnderscore(name) { - return name.charCodeAt(0) === 95 /* _ */; - } function getConvertibleFieldAtPosition(context) { var file = context.file, startPosition = context.startPosition, endPosition = context.endPosition; var node = ts.getTokenAtPosition(file, startPosition); @@ -134250,14 +134914,14 @@ var ts; || !isConvertibleName(declaration.name) || (ts.getModifierFlags(declaration) | meaning) !== meaning) return undefined; var name = declaration.name.text; - var startWithUnderscore = startsWithUnderscore(name); + var startWithUnderscore = ts.startsWithUnderscore(name); var fieldName = createPropertyName(startWithUnderscore ? name : ts.getUniqueName("_" + name, file), declaration.name); var accessorName = createPropertyName(startWithUnderscore ? ts.getUniqueName(name.substring(1), file) : name, declaration.name); return { isStatic: ts.hasStaticModifier(declaration), isReadonly: ts.hasReadonlyModifier(declaration), type: ts.getTypeAnnotationNode(declaration), - container: declaration.kind === 156 /* Parameter */ ? declaration.parent.parent : declaration.parent, + container: declaration.kind === 157 /* Parameter */ ? declaration.parent.parent : declaration.parent, originalName: declaration.name.text, declaration: declaration, fieldName: fieldName, @@ -134400,11 +135064,11 @@ var ts; } function isPureImport(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return true; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return !ts.hasModifier(node, 1 /* Export */); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return node.declarationList.declarations.every(function (d) { return !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ true); }); default: return false; @@ -134492,12 +135156,12 @@ var ts; } function getNamespaceLikeImport(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 256 /* NamespaceImport */ ? + case 255 /* ImportDeclaration */: + return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 257 /* NamespaceImport */ ? node.importClause.namedBindings.name : undefined; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return node.name; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ts.tryCast(node.name, ts.isIdentifier); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); @@ -134528,20 +135192,20 @@ var ts; var newNamespaceId = ts.createIdentifier(newNamespaceName); var newModuleString = ts.createLiteral(newModuleSpecifier); switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(newNamespaceId)), newModuleString); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return ts.createImportEqualsDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, newNamespaceId, ts.createExternalModuleReference(newModuleString)); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ts.createVariableDeclaration(newNamespaceId, /*type*/ undefined, createRequireCall(newModuleString)); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); } } function moduleSpecifierFromImport(i) { - return (i.kind === 254 /* ImportDeclaration */ ? i.moduleSpecifier - : i.kind === 253 /* ImportEqualsDeclaration */ ? i.moduleReference.expression + return (i.kind === 255 /* ImportDeclaration */ ? i.moduleSpecifier + : i.kind === 254 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0]); } function forEachImportInStatement(statement, cb) { @@ -134611,15 +135275,15 @@ var ts; } function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) { switch (importDecl.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused); break; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: if (isUnused(importDecl.name)) { changes.delete(sourceFile, importDecl); } break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused); break; default: @@ -134632,7 +135296,7 @@ var ts; var _a = importDecl.importClause, name = _a.name, namedBindings = _a.namedBindings; var defaultUnused = !name || isUnused(name); var namedBindingsUnused = !namedBindings || - (namedBindings.kind === 256 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); + (namedBindings.kind === 257 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); if (defaultUnused && namedBindingsUnused) { changes.delete(sourceFile, importDecl); } @@ -134644,7 +135308,7 @@ var ts; if (namedBindingsUnused) { changes.replaceNode(sourceFile, importDecl.importClause, ts.updateImportClause(importDecl.importClause, name, /*namedBindings*/ undefined, importDecl.importClause.isTypeOnly)); } - else if (namedBindings.kind === 257 /* NamedImports */) { + else if (namedBindings.kind === 258 /* NamedImports */) { for (var _i = 0, _b = namedBindings.elements; _i < _b.length; _i++) { var element = _b[_i]; if (isUnused(element.name)) @@ -134662,9 +135326,9 @@ var ts; changes.delete(sourceFile, name); } break; - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: break; - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: if (name.elements.every(function (e) { return ts.isIdentifier(e.name) && isUnused(e.name); })) { changes.delete(sourceFile, ts.isVariableDeclarationList(varDecl.parent) && varDecl.parent.declarations.length === 1 ? varDecl.parent.parent : varDecl); } @@ -134791,13 +135455,13 @@ var ts; // Below should all be utilities function isInImport(decl) { switch (decl.kind) { - case 253 /* ImportEqualsDeclaration */: - case 258 /* ImportSpecifier */: - case 255 /* ImportClause */: + case 254 /* ImportEqualsDeclaration */: + case 259 /* ImportSpecifier */: + case 256 /* ImportClause */: return true; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return isVariableDeclarationInImport(decl); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return ts.isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent); default: return false; @@ -134809,7 +135473,7 @@ var ts; } function filterImport(i, moduleSpecifier, keep) { switch (i.kind) { - case 254 /* ImportDeclaration */: { + case 255 /* ImportDeclaration */: { var clause = i.importClause; if (!clause) return undefined; @@ -134819,9 +135483,9 @@ var ts; ? ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(defaultImport, namedBindings), moduleSpecifier) : undefined; } - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return keep(i.name) ? i : undefined; - case 242 /* VariableDeclaration */: { + case 243 /* VariableDeclaration */: { var name = filterBindingName(i.name, keep); return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : undefined; } @@ -134830,7 +135494,7 @@ var ts; } } function filterNamedBindings(namedBindings, keep) { - if (namedBindings.kind === 256 /* NamespaceImport */) { + if (namedBindings.kind === 257 /* NamespaceImport */) { return keep(namedBindings.name) ? namedBindings : undefined; } else { @@ -134842,9 +135506,9 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return keep(name) ? name : undefined; - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: return name; - case 189 /* ObjectBindingPattern */: { + case 190 /* ObjectBindingPattern */: { // We can't handle nested destructurings or property names well here, so just copy them all. var newElements = name.elements.filter(function (prop) { return prop.propertyName || !ts.isIdentifier(prop.name) || keep(prop.name); }); return newElements.length ? ts.createObjectBindingPattern(newElements) : undefined; @@ -134901,13 +135565,13 @@ var ts; } function isNonVariableTopLevelDeclaration(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 254 /* ImportEqualsDeclaration */: return true; default: return false; @@ -134915,17 +135579,17 @@ var ts; } function forEachTopLevelDeclaration(statement, cb) { switch (statement.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 254 /* ImportEqualsDeclaration */: return cb(statement); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return ts.firstDefined(statement.declarationList.declarations, function (decl) { return forEachTopLevelDeclarationInBindingName(decl.name, cb); }); - case 226 /* ExpressionStatement */: { + case 227 /* ExpressionStatement */: { var expression = statement.expression; return ts.isBinaryExpression(expression) && ts.getAssignmentDeclarationKind(expression) === 1 /* ExportsProperty */ ? cb(statement) @@ -134937,8 +135601,8 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return cb(ts.cast(name.parent, function (x) { return ts.isVariableDeclaration(x) || ts.isBindingElement(x); })); - case 190 /* ArrayBindingPattern */: - case 189 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: return ts.firstDefined(name.elements, function (em) { return ts.isOmittedExpression(em) ? undefined : forEachTopLevelDeclarationInBindingName(em.name, cb); }); default: return ts.Debug.assertNever(name, "Unexpected name kind " + name.kind); @@ -134949,9 +135613,9 @@ var ts; } function getTopLevelDeclarationStatement(d) { switch (d.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return d.parent.parent; - case 191 /* BindingElement */: + case 192 /* BindingElement */: return getTopLevelDeclarationStatement(ts.cast(d.parent.parent, function (p) { return ts.isVariableDeclaration(p) || ts.isBindingElement(p); })); default: return d; @@ -134984,23 +135648,23 @@ var ts; function addEs6Export(d) { var modifiers = ts.concatenate([ts.createModifier(89 /* ExportKeyword */)], d.modifiers); switch (d.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(d, d.decorators, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return ts.updateClassDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return ts.updateVariableStatement(d, modifiers, d.declarationList); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return ts.updateModuleDeclaration(d, d.decorators, modifiers, d.name, d.body); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return ts.updateEnumDeclaration(d, d.decorators, modifiers, d.name, d.members); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.type); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(d, d.decorators, modifiers, d.name, d.moduleReference); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return ts.Debug.fail(); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(d, "Unexpected declaration kind " + d.kind); @@ -135011,18 +135675,18 @@ var ts; } function getNamesToExportInCommonJS(decl) { switch (decl.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: return [decl.name.text]; // TODO: GH#18217 - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return ts.mapDefined(decl.declarationList.declarations, function (d) { return ts.isIdentifier(d.name) ? d.name.text : undefined; }); - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 254 /* ImportEqualsDeclaration */: return ts.emptyArray; - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return ts.Debug.fail("Can't export an ExpressionStatement"); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(decl, "Unexpected decl kind " + decl.kind); @@ -135292,15 +135956,15 @@ var ts; var parent = functionReference.parent; switch (parent.kind) { // foo(...) or super(...) or new Foo(...) - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: var callOrNewExpression = ts.tryCast(parent, ts.isCallOrNewExpression); if (callOrNewExpression && callOrNewExpression.expression === functionReference) { return callOrNewExpression; } break; // x.foo(...) - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) { var callOrNewExpression_1 = ts.tryCast(propertyAccessExpression.parent, ts.isCallOrNewExpression); @@ -135310,7 +135974,7 @@ var ts; } break; // x["foo"](...) - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) { var callOrNewExpression_2 = ts.tryCast(elementAccessExpression.parent, ts.isCallOrNewExpression); @@ -135329,14 +135993,14 @@ var ts; var parent = reference.parent; switch (parent.kind) { // `C.foo` - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.expression === reference) { return propertyAccessExpression; } break; // `C["foo"]` - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.expression === reference) { return elementAccessExpression; @@ -135378,11 +136042,11 @@ var ts; if (!isValidParameterNodeArray(functionDeclaration.parameters, checker)) return false; switch (functionDeclaration.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return isSingleImplementation(functionDeclaration, checker); - case 162 /* Constructor */: + case 163 /* Constructor */: if (ts.isClassDeclaration(functionDeclaration.parent)) { return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker); } @@ -135390,8 +136054,8 @@ var ts; return isValidVariableDeclaration(functionDeclaration.parent.parent) && isSingleImplementation(functionDeclaration, checker); } - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return isValidVariableDeclaration(functionDeclaration.parent); } return false; @@ -135562,7 +136226,7 @@ var ts; } function getClassNames(constructorDeclaration) { switch (constructorDeclaration.parent.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: var classDeclaration = constructorDeclaration.parent; if (classDeclaration.name) return [classDeclaration.name]; @@ -135570,7 +136234,7 @@ var ts; // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(classDeclaration, 84 /* DefaultKeyword */), "Nameless class declaration should be a default export"); return [defaultModifier]; - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: var classExpression = constructorDeclaration.parent; var variableDeclaration = constructorDeclaration.parent.parent; var className = classExpression.name; @@ -135581,25 +136245,25 @@ var ts; } function getFunctionNames(functionDeclaration) { switch (functionDeclaration.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: if (functionDeclaration.name) return [functionDeclaration.name]; // If the function declaration doesn't have a name, it should have a default modifier. // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(functionDeclaration, 84 /* DefaultKeyword */), "Nameless function declaration should be a default export"); return [defaultModifier]; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return [functionDeclaration.name]; - case 162 /* Constructor */: - var ctrKeyword = ts.Debug.checkDefined(ts.findChildOfKind(functionDeclaration, 129 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); - if (functionDeclaration.parent.kind === 214 /* ClassExpression */) { + case 163 /* Constructor */: + var ctrKeyword = ts.Debug.checkDefined(ts.findChildOfKind(functionDeclaration, 130 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); + if (functionDeclaration.parent.kind === 215 /* ClassExpression */) { var variableDeclaration = functionDeclaration.parent.parent; return [variableDeclaration.name, ctrKeyword]; } return [ctrKeyword]; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return [functionDeclaration.parent.name]; - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: if (functionDeclaration.name) return [functionDeclaration.name, functionDeclaration.parent.name]; return [functionDeclaration.parent.name]; @@ -135850,8 +136514,8 @@ var ts; if (!children.length) { return undefined; } - var child = ts.find(children, function (kid) { return kid.kind < 294 /* FirstJSDocNode */ || kid.kind > 323 /* LastJSDocNode */; }); - return child.kind < 153 /* FirstNode */ ? + var child = ts.find(children, function (kid) { return kid.kind < 295 /* FirstJSDocNode */ || kid.kind > 324 /* LastJSDocNode */; }); + return child.kind < 154 /* FirstNode */ ? child : child.getFirstToken(sourceFile); }; @@ -135862,7 +136526,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 153 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 154 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { return ts.forEachChild(this, cbNode, cbNodeArray); @@ -135920,7 +136584,7 @@ var ts; } } function createSyntaxList(nodes, parent) { - var list = createNode(324 /* SyntaxList */, nodes.pos, nodes.end, parent); + var list = createNode(325 /* SyntaxList */, nodes.pos, nodes.end, parent); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { @@ -136234,7 +136898,7 @@ var ts; __extends(SourceFileObject, _super); function SourceFileObject(kind, pos, end) { var _this = _super.call(this, kind, pos, end) || this; - _this.kind = 290 /* SourceFile */; + _this.kind = 291 /* SourceFile */; return _this; } SourceFileObject.prototype.update = function (newText, textChangeRange) { @@ -136293,10 +136957,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -136316,31 +136980,31 @@ var ts; } ts.forEachChild(node, visit); break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 248 /* EnumDeclaration */: - case 249 /* ModuleDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 263 /* ExportSpecifier */: - case 258 /* ImportSpecifier */: - case 255 /* ImportClause */: - case 256 /* NamespaceImport */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 173 /* TypeLiteral */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: + case 250 /* ModuleDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 264 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 256 /* ImportClause */: + case 257 /* NamespaceImport */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 174 /* TypeLiteral */: addDeclaration(node); ts.forEachChild(node, visit); break; - case 156 /* Parameter */: + case 157 /* Parameter */: // Only consider parameter properties if (!ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { break; } // falls through - case 242 /* VariableDeclaration */: - case 191 /* BindingElement */: { + case 243 /* VariableDeclaration */: + case 192 /* BindingElement */: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -136351,12 +137015,12 @@ var ts; } } // falls through - case 284 /* EnumMember */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 285 /* EnumMember */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: addDeclaration(node); break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; var exportDeclaration = node; @@ -136369,7 +137033,7 @@ var ts; } } break; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -136381,7 +137045,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 256 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 257 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -136390,7 +137054,7 @@ var ts; } } break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) !== 0 /* None */) { addDeclaration(node); } @@ -136716,6 +137380,7 @@ var ts; return sourceFile; } function synchronizeHostData() { + var _a; ts.Debug.assert(!syntaxOnly); // perform fast check if host supports it if (host.getProjectVersion) { @@ -136797,12 +137462,10 @@ var ts; return host.resolveTypeReferenceDirectives.apply(host, args); }; } - if (host.setResolvedProjectReferenceCallbacks) { - compilerHost.setResolvedProjectReferenceCallbacks = function (callbacks) { return host.setResolvedProjectReferenceCallbacks(callbacks); }; - } if (host.useSourceOfProjectReferenceRedirect) { compilerHost.useSourceOfProjectReferenceRedirect = function () { return host.useSourceOfProjectReferenceRedirect(); }; } + (_a = host.setCompilerHost) === null || _a === void 0 ? void 0 : _a.call(host, compilerHost); var documentRegistryBucketKey = documentRegistry.getKeyForCompilationSettings(newSettings); var options = { rootNames: rootFileNames, @@ -136888,7 +137551,7 @@ var ts; // We do not support the scenario where a host can modify a registered // file's script kind, i.e. in one project some file is treated as ".ts" // and in another as ".js" - ts.Debug.assertEqual(hostFileInformation.scriptKind, oldSourceFile.scriptKind, "Registered script kind should match new script kind.", path); + ts.Debug.assertEqual(hostFileInformation.scriptKind, oldSourceFile.scriptKind, "Registered script kind should match new script kind."); return documentRegistry.updateDocumentWithKey(fileName, path, newSettings, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind); } // We didn't already have the file. Fall through and acquire it from the registry. @@ -137010,12 +137673,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return !ts.isLabelName(node) && !ts.isTagName(node); - case 194 /* PropertyAccessExpression */: - case 153 /* QualifiedName */: + case 195 /* PropertyAccessExpression */: + case 154 /* QualifiedName */: // Don't return quickInfo if inside the comment in `a/**/.b` return !ts.isInComment(sourceFile, position); case 104 /* ThisKeyword */: - case 183 /* ThisType */: + case 184 /* ThisType */: case 102 /* SuperKeyword */: return true; default: @@ -137117,15 +137780,15 @@ var ts; return undefined; } switch (node.kind) { - case 194 /* PropertyAccessExpression */: - case 153 /* QualifiedName */: + case 195 /* PropertyAccessExpression */: + case 154 /* QualifiedName */: case 10 /* StringLiteral */: case 91 /* FalseKeyword */: case 106 /* TrueKeyword */: case 100 /* NullKeyword */: case 102 /* SuperKeyword */: case 104 /* ThisKeyword */: - case 183 /* ThisType */: + case 184 /* ThisType */: case 75 /* Identifier */: break; // Cant create the text span @@ -137142,7 +137805,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 249 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 250 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -137619,7 +138282,7 @@ var ts; */ function literalIsName(node) { return ts.isDeclarationName(node) || - node.parent.kind === 265 /* ExternalModuleReference */ || + node.parent.kind === 266 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node); } @@ -137637,13 +138300,13 @@ var ts; case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: - if (node.parent.kind === 154 /* ComputedPropertyName */) { + if (node.parent.kind === 155 /* ComputedPropertyName */) { return ts.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; } // falls through case 75 /* Identifier */: return ts.isObjectLiteralElement(node.parent) && - (node.parent.parent.kind === 193 /* ObjectLiteralExpression */ || node.parent.parent.kind === 274 /* JsxAttributes */) && + (node.parent.parent.kind === 194 /* ObjectLiteralExpression */ || node.parent.parent.kind === 275 /* JsxAttributes */) && node.parent.name === node ? node.parent : undefined; } return undefined; @@ -137685,7 +138348,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 195 /* ElementAccessExpression */ && + node.parent.kind === 196 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /** @@ -137765,114 +138428,114 @@ var ts; if (node) { var parent = node.parent; switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 242 /* VariableDeclaration */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 243 /* VariableDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return spanInVariableDeclaration(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return spanInParameterDeclaration(node); - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 162 /* Constructor */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 163 /* Constructor */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 223 /* Block */: + case 224 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // falls through - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return spanInBlock(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return spanInBlock(node.block); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: // Span on while(...) return textSpanEndingAtNextToken(node, node.expression); - case 228 /* DoStatement */: + case 229 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 241 /* DebuggerStatement */: + case 242 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 227 /* IfStatement */: + case 228 /* IfStatement */: // set on if(..) span return textSpanEndingAtNextToken(node, node.expression); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return spanInForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: // span of for (a in ...) return textSpanEndingAtNextToken(node, node.expression); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: // span in initializer return spanInInitializerOfForLike(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: // span on switch(...) return textSpanEndingAtNextToken(node, node.expression); - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 240 /* TryStatement */: + case 241 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } // falls through - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 191 /* BindingElement */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 192 /* BindingElement */: // span on complete node return textSpan(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 157 /* Decorator */: + case 158 /* Decorator */: return spanInNodeArray(parent.decorators); - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: return undefined; // Tokens: case 26 /* SemicolonToken */: @@ -137902,7 +138565,7 @@ var ts; case 79 /* CatchKeyword */: case 92 /* FinallyKeyword */: return spanInNextNode(node); - case 152 /* OfKeyword */: + case 153 /* OfKeyword */: return spanInOfKeyword(node); default: // Destructuring pattern in destructuring assignment @@ -137915,13 +138578,13 @@ var ts; // `a` or `...c` or `d: x` from // `[a, b, ...c]` or `{ a, b }` or `{ d: x }` from destructuring pattern if ((node.kind === 75 /* Identifier */ || - node.kind === 213 /* SpreadElement */ || - node.kind === 281 /* PropertyAssignment */ || - node.kind === 282 /* ShorthandPropertyAssignment */) && + node.kind === 214 /* SpreadElement */ || + node.kind === 282 /* PropertyAssignment */ || + node.kind === 283 /* ShorthandPropertyAssignment */) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(parent)) { return textSpan(node); } - if (node.kind === 209 /* BinaryExpression */) { + if (node.kind === 210 /* BinaryExpression */) { var _a = node, left = _a.left, operatorToken = _a.operatorToken; // Set breakpoint in destructuring pattern if its destructuring assignment // [a, b, c] or {a, b, c} of @@ -137943,22 +138606,22 @@ var ts; } if (ts.isExpressionNode(node)) { switch (parent.kind) { - case 228 /* DoStatement */: + case 229 /* DoStatement */: // Set span as if on while keyword return spanInPreviousNode(node); - case 157 /* Decorator */: + case 158 /* Decorator */: // Set breakpoint on the decorator emit return spanInNode(node.parent); - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: return textSpan(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (node.parent.operatorToken.kind === 27 /* CommaToken */) { // If this is a comma expression, the breakpoint is possible in this expression return textSpan(node); } break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: if (node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); @@ -137967,21 +138630,21 @@ var ts; } } switch (node.parent.kind) { - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // If this is name of property assignment, set breakpoint in the initializer if (node.parent.name === node && !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } break; - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: // Breakpoint in type assertion goes to its operand if (node.parent.type === node) { return spanInNextNode(node.parent.type); } break; - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: { + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: { // initializer of variable/parameter declaration go to previous node var _b = node.parent, initializer = _b.initializer, type = _b.type; if (initializer === node || type === node || ts.isAssignmentOperator(node.kind)) { @@ -137989,7 +138652,7 @@ var ts; } break; } - case 209 /* BinaryExpression */: { + case 210 /* BinaryExpression */: { var left = node.parent.left; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { // If initializer of destructuring assignment move to previous token @@ -138019,7 +138682,7 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 231 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 232 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } var parent = variableDeclaration.parent; @@ -138031,7 +138694,7 @@ var ts; // or its declaration from 'for of' if (variableDeclaration.initializer || ts.hasModifier(variableDeclaration, 1 /* Export */) || - parent.parent.kind === 232 /* ForOfStatement */) { + parent.parent.kind === 233 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } if (ts.isVariableDeclarationList(variableDeclaration.parent) && @@ -138072,7 +138735,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasModifier(functionDeclaration, 1 /* Export */) || - (functionDeclaration.parent.kind === 245 /* ClassDeclaration */ && functionDeclaration.kind !== 162 /* Constructor */); + (functionDeclaration.parent.kind === 246 /* ClassDeclaration */ && functionDeclaration.kind !== 163 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -138095,26 +138758,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // Set on parent if on same line otherwise on first statement // falls through - case 229 /* WhileStatement */: - case 227 /* IfStatement */: - case 231 /* ForInStatement */: + case 230 /* WhileStatement */: + case 228 /* IfStatement */: + case 232 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 243 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 244 /* VariableDeclarationList */) { // Declaration list - set breakpoint in first declaration var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -138139,21 +138802,21 @@ var ts; } function spanInBindingPattern(bindingPattern) { // Set breakpoint in first binding element - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 215 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 216 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } // Empty binding pattern of binding element, set breakpoint on binding element - if (bindingPattern.parent.kind === 191 /* BindingElement */) { + if (bindingPattern.parent.kind === 192 /* BindingElement */) { return textSpan(bindingPattern.parent); } // Variable declaration is used as the span return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 190 /* ArrayBindingPattern */ && node.kind !== 189 /* ObjectBindingPattern */); - var elements = node.kind === 192 /* ArrayLiteralExpression */ ? node.elements : node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 215 /* OmittedExpression */ ? element : undefined; }); + ts.Debug.assert(node.kind !== 191 /* ArrayBindingPattern */ && node.kind !== 190 /* ObjectBindingPattern */); + var elements = node.kind === 193 /* ArrayLiteralExpression */ ? node.elements : node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 216 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } @@ -138161,18 +138824,18 @@ var ts; // just nested element in another destructuring assignment // set breakpoint on assignment when parent is destructuring assignment // Otherwise set breakpoint for this element - return textSpan(node.parent.kind === 209 /* BinaryExpression */ ? node.parent : node); + return textSpan(node.parent.kind === 210 /* BinaryExpression */ ? node.parent : node); } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -138180,25 +138843,25 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: // If this is not an instantiated module block, no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } // falls through - case 248 /* EnumDeclaration */: - case 245 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 246 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 223 /* Block */: + case 224 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // falls through - case 280 /* CatchClause */: + case 281 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -138206,7 +138869,7 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -138222,7 +138885,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -138237,12 +138900,12 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 228 /* DoStatement */ || // Go to while keyword and do action instead - node.parent.kind === 196 /* CallExpression */ || - node.parent.kind === 197 /* NewExpression */) { + if (node.parent.kind === 229 /* DoStatement */ || // Go to while keyword and do action instead + node.parent.kind === 197 /* CallExpression */ || + node.parent.kind === 198 /* NewExpression */) { return spanInPreviousNode(node); } - if (node.parent.kind === 200 /* ParenthesizedExpression */) { + if (node.parent.kind === 201 /* ParenthesizedExpression */) { return spanInNextNode(node); } // Default to parent node @@ -138251,21 +138914,21 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 162 /* Constructor */: - case 229 /* WhileStatement */: - case 228 /* DoStatement */: - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 200 /* ParenthesizedExpression */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 163 /* Constructor */: + case 230 /* WhileStatement */: + case 229 /* DoStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 201 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -138275,20 +138938,20 @@ var ts; function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration if (ts.isFunctionLike(node.parent) || - node.parent.kind === 281 /* PropertyAssignment */ || - node.parent.kind === 156 /* Parameter */) { + node.parent.kind === 282 /* PropertyAssignment */ || + node.parent.kind === 157 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 199 /* TypeAssertionExpression */) { + if (node.parent.kind === 200 /* TypeAssertionExpression */) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 228 /* DoStatement */) { + if (node.parent.kind === 229 /* DoStatement */) { // Set span on while expression return textSpanEndingAtNextToken(node, node.parent.expression); } @@ -138296,7 +138959,7 @@ var ts; return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 232 /* ForOfStatement */) { + if (node.parent.kind === 233 /* ForOfStatement */) { // Set using next token return spanInNextNode(node); } diff --git a/lib/typescriptServices.d.ts b/lib/typescriptServices.d.ts index fe7223478461f..17fdc780f9d13 100644 --- a/lib/typescriptServices.d.ts +++ b/lib/typescriptServices.d.ts @@ -71,7 +71,7 @@ declare namespace ts { end: number; } export type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind; - export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.OfKeyword; + export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.AwaitedKeyword | SyntaxKind.OfKeyword; export type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; export enum SyntaxKind { Unknown = 0, @@ -203,210 +203,211 @@ declare namespace ts { AnyKeyword = 125, AsyncKeyword = 126, AwaitKeyword = 127, - BooleanKeyword = 128, - ConstructorKeyword = 129, - DeclareKeyword = 130, - GetKeyword = 131, - InferKeyword = 132, - IsKeyword = 133, - KeyOfKeyword = 134, - ModuleKeyword = 135, - NamespaceKeyword = 136, - NeverKeyword = 137, - ReadonlyKeyword = 138, - RequireKeyword = 139, - NumberKeyword = 140, - ObjectKeyword = 141, - SetKeyword = 142, - StringKeyword = 143, - SymbolKeyword = 144, - TypeKeyword = 145, - UndefinedKeyword = 146, - UniqueKeyword = 147, - UnknownKeyword = 148, - FromKeyword = 149, - GlobalKeyword = 150, - BigIntKeyword = 151, - OfKeyword = 152, - QualifiedName = 153, - ComputedPropertyName = 154, - TypeParameter = 155, - Parameter = 156, - Decorator = 157, - PropertySignature = 158, - PropertyDeclaration = 159, - MethodSignature = 160, - MethodDeclaration = 161, - Constructor = 162, - GetAccessor = 163, - SetAccessor = 164, - CallSignature = 165, - ConstructSignature = 166, - IndexSignature = 167, - TypePredicate = 168, - TypeReference = 169, - FunctionType = 170, - ConstructorType = 171, - TypeQuery = 172, - TypeLiteral = 173, - ArrayType = 174, - TupleType = 175, - OptionalType = 176, - RestType = 177, - UnionType = 178, - IntersectionType = 179, - ConditionalType = 180, - InferType = 181, - ParenthesizedType = 182, - ThisType = 183, - TypeOperator = 184, - IndexedAccessType = 185, - MappedType = 186, - LiteralType = 187, - ImportType = 188, - ObjectBindingPattern = 189, - ArrayBindingPattern = 190, - BindingElement = 191, - ArrayLiteralExpression = 192, - ObjectLiteralExpression = 193, - PropertyAccessExpression = 194, - ElementAccessExpression = 195, - CallExpression = 196, - NewExpression = 197, - TaggedTemplateExpression = 198, - TypeAssertionExpression = 199, - ParenthesizedExpression = 200, - FunctionExpression = 201, - ArrowFunction = 202, - DeleteExpression = 203, - TypeOfExpression = 204, - VoidExpression = 205, - AwaitExpression = 206, - PrefixUnaryExpression = 207, - PostfixUnaryExpression = 208, - BinaryExpression = 209, - ConditionalExpression = 210, - TemplateExpression = 211, - YieldExpression = 212, - SpreadElement = 213, - ClassExpression = 214, - OmittedExpression = 215, - ExpressionWithTypeArguments = 216, - AsExpression = 217, - NonNullExpression = 218, - MetaProperty = 219, - SyntheticExpression = 220, - TemplateSpan = 221, - SemicolonClassElement = 222, - Block = 223, - EmptyStatement = 224, - VariableStatement = 225, - ExpressionStatement = 226, - IfStatement = 227, - DoStatement = 228, - WhileStatement = 229, - ForStatement = 230, - ForInStatement = 231, - ForOfStatement = 232, - ContinueStatement = 233, - BreakStatement = 234, - ReturnStatement = 235, - WithStatement = 236, - SwitchStatement = 237, - LabeledStatement = 238, - ThrowStatement = 239, - TryStatement = 240, - DebuggerStatement = 241, - VariableDeclaration = 242, - VariableDeclarationList = 243, - FunctionDeclaration = 244, - ClassDeclaration = 245, - InterfaceDeclaration = 246, - TypeAliasDeclaration = 247, - EnumDeclaration = 248, - ModuleDeclaration = 249, - ModuleBlock = 250, - CaseBlock = 251, - NamespaceExportDeclaration = 252, - ImportEqualsDeclaration = 253, - ImportDeclaration = 254, - ImportClause = 255, - NamespaceImport = 256, - NamedImports = 257, - ImportSpecifier = 258, - ExportAssignment = 259, - ExportDeclaration = 260, - NamedExports = 261, - NamespaceExport = 262, - ExportSpecifier = 263, - MissingDeclaration = 264, - ExternalModuleReference = 265, - JsxElement = 266, - JsxSelfClosingElement = 267, - JsxOpeningElement = 268, - JsxClosingElement = 269, - JsxFragment = 270, - JsxOpeningFragment = 271, - JsxClosingFragment = 272, - JsxAttribute = 273, - JsxAttributes = 274, - JsxSpreadAttribute = 275, - JsxExpression = 276, - CaseClause = 277, - DefaultClause = 278, - HeritageClause = 279, - CatchClause = 280, - PropertyAssignment = 281, - ShorthandPropertyAssignment = 282, - SpreadAssignment = 283, - EnumMember = 284, - UnparsedPrologue = 285, - UnparsedPrepend = 286, - UnparsedText = 287, - UnparsedInternalText = 288, - UnparsedSyntheticReference = 289, - SourceFile = 290, - Bundle = 291, - UnparsedSource = 292, - InputFiles = 293, - JSDocTypeExpression = 294, - JSDocAllType = 295, - JSDocUnknownType = 296, - JSDocNullableType = 297, - JSDocNonNullableType = 298, - JSDocOptionalType = 299, - JSDocFunctionType = 300, - JSDocVariadicType = 301, - JSDocNamepathType = 302, - JSDocComment = 303, - JSDocTypeLiteral = 304, - JSDocSignature = 305, - JSDocTag = 306, - JSDocAugmentsTag = 307, - JSDocImplementsTag = 308, - JSDocAuthorTag = 309, - JSDocClassTag = 310, - JSDocPublicTag = 311, - JSDocPrivateTag = 312, - JSDocProtectedTag = 313, - JSDocReadonlyTag = 314, - JSDocCallbackTag = 315, - JSDocEnumTag = 316, - JSDocParameterTag = 317, - JSDocReturnTag = 318, - JSDocThisTag = 319, - JSDocTypeTag = 320, - JSDocTemplateTag = 321, - JSDocTypedefTag = 322, - JSDocPropertyTag = 323, - SyntaxList = 324, - NotEmittedStatement = 325, - PartiallyEmittedExpression = 326, - CommaListExpression = 327, - MergeDeclarationMarker = 328, - EndOfDeclarationMarker = 329, - SyntheticReferenceExpression = 330, - Count = 331, + AwaitedKeyword = 128, + BooleanKeyword = 129, + ConstructorKeyword = 130, + DeclareKeyword = 131, + GetKeyword = 132, + InferKeyword = 133, + IsKeyword = 134, + KeyOfKeyword = 135, + ModuleKeyword = 136, + NamespaceKeyword = 137, + NeverKeyword = 138, + ReadonlyKeyword = 139, + RequireKeyword = 140, + NumberKeyword = 141, + ObjectKeyword = 142, + SetKeyword = 143, + StringKeyword = 144, + SymbolKeyword = 145, + TypeKeyword = 146, + UndefinedKeyword = 147, + UniqueKeyword = 148, + UnknownKeyword = 149, + FromKeyword = 150, + GlobalKeyword = 151, + BigIntKeyword = 152, + OfKeyword = 153, + QualifiedName = 154, + ComputedPropertyName = 155, + TypeParameter = 156, + Parameter = 157, + Decorator = 158, + PropertySignature = 159, + PropertyDeclaration = 160, + MethodSignature = 161, + MethodDeclaration = 162, + Constructor = 163, + GetAccessor = 164, + SetAccessor = 165, + CallSignature = 166, + ConstructSignature = 167, + IndexSignature = 168, + TypePredicate = 169, + TypeReference = 170, + FunctionType = 171, + ConstructorType = 172, + TypeQuery = 173, + TypeLiteral = 174, + ArrayType = 175, + TupleType = 176, + OptionalType = 177, + RestType = 178, + UnionType = 179, + IntersectionType = 180, + ConditionalType = 181, + InferType = 182, + ParenthesizedType = 183, + ThisType = 184, + TypeOperator = 185, + IndexedAccessType = 186, + MappedType = 187, + LiteralType = 188, + ImportType = 189, + ObjectBindingPattern = 190, + ArrayBindingPattern = 191, + BindingElement = 192, + ArrayLiteralExpression = 193, + ObjectLiteralExpression = 194, + PropertyAccessExpression = 195, + ElementAccessExpression = 196, + CallExpression = 197, + NewExpression = 198, + TaggedTemplateExpression = 199, + TypeAssertionExpression = 200, + ParenthesizedExpression = 201, + FunctionExpression = 202, + ArrowFunction = 203, + DeleteExpression = 204, + TypeOfExpression = 205, + VoidExpression = 206, + AwaitExpression = 207, + PrefixUnaryExpression = 208, + PostfixUnaryExpression = 209, + BinaryExpression = 210, + ConditionalExpression = 211, + TemplateExpression = 212, + YieldExpression = 213, + SpreadElement = 214, + ClassExpression = 215, + OmittedExpression = 216, + ExpressionWithTypeArguments = 217, + AsExpression = 218, + NonNullExpression = 219, + MetaProperty = 220, + SyntheticExpression = 221, + TemplateSpan = 222, + SemicolonClassElement = 223, + Block = 224, + EmptyStatement = 225, + VariableStatement = 226, + ExpressionStatement = 227, + IfStatement = 228, + DoStatement = 229, + WhileStatement = 230, + ForStatement = 231, + ForInStatement = 232, + ForOfStatement = 233, + ContinueStatement = 234, + BreakStatement = 235, + ReturnStatement = 236, + WithStatement = 237, + SwitchStatement = 238, + LabeledStatement = 239, + ThrowStatement = 240, + TryStatement = 241, + DebuggerStatement = 242, + VariableDeclaration = 243, + VariableDeclarationList = 244, + FunctionDeclaration = 245, + ClassDeclaration = 246, + InterfaceDeclaration = 247, + TypeAliasDeclaration = 248, + EnumDeclaration = 249, + ModuleDeclaration = 250, + ModuleBlock = 251, + CaseBlock = 252, + NamespaceExportDeclaration = 253, + ImportEqualsDeclaration = 254, + ImportDeclaration = 255, + ImportClause = 256, + NamespaceImport = 257, + NamedImports = 258, + ImportSpecifier = 259, + ExportAssignment = 260, + ExportDeclaration = 261, + NamedExports = 262, + NamespaceExport = 263, + ExportSpecifier = 264, + MissingDeclaration = 265, + ExternalModuleReference = 266, + JsxElement = 267, + JsxSelfClosingElement = 268, + JsxOpeningElement = 269, + JsxClosingElement = 270, + JsxFragment = 271, + JsxOpeningFragment = 272, + JsxClosingFragment = 273, + JsxAttribute = 274, + JsxAttributes = 275, + JsxSpreadAttribute = 276, + JsxExpression = 277, + CaseClause = 278, + DefaultClause = 279, + HeritageClause = 280, + CatchClause = 281, + PropertyAssignment = 282, + ShorthandPropertyAssignment = 283, + SpreadAssignment = 284, + EnumMember = 285, + UnparsedPrologue = 286, + UnparsedPrepend = 287, + UnparsedText = 288, + UnparsedInternalText = 289, + UnparsedSyntheticReference = 290, + SourceFile = 291, + Bundle = 292, + UnparsedSource = 293, + InputFiles = 294, + JSDocTypeExpression = 295, + JSDocAllType = 296, + JSDocUnknownType = 297, + JSDocNullableType = 298, + JSDocNonNullableType = 299, + JSDocOptionalType = 300, + JSDocFunctionType = 301, + JSDocVariadicType = 302, + JSDocNamepathType = 303, + JSDocComment = 304, + JSDocTypeLiteral = 305, + JSDocSignature = 306, + JSDocTag = 307, + JSDocAugmentsTag = 308, + JSDocImplementsTag = 309, + JSDocAuthorTag = 310, + JSDocClassTag = 311, + JSDocPublicTag = 312, + JSDocPrivateTag = 313, + JSDocProtectedTag = 314, + JSDocReadonlyTag = 315, + JSDocCallbackTag = 316, + JSDocEnumTag = 317, + JSDocParameterTag = 318, + JSDocReturnTag = 319, + JSDocThisTag = 320, + JSDocTypeTag = 321, + JSDocTemplateTag = 322, + JSDocTypedefTag = 323, + JSDocPropertyTag = 324, + SyntaxList = 325, + NotEmittedStatement = 326, + PartiallyEmittedExpression = 327, + CommaListExpression = 328, + MergeDeclarationMarker = 329, + EndOfDeclarationMarker = 330, + SyntheticReferenceExpression = 331, + Count = 332, FirstAssignment = 62, LastAssignment = 74, FirstCompoundAssignment = 63, @@ -414,15 +415,15 @@ declare namespace ts { FirstReservedWord = 77, LastReservedWord = 112, FirstKeyword = 77, - LastKeyword = 152, + LastKeyword = 153, FirstFutureReservedWord = 113, LastFutureReservedWord = 121, - FirstTypeNode = 168, - LastTypeNode = 188, + FirstTypeNode = 169, + LastTypeNode = 189, FirstPunctuation = 18, LastPunctuation = 74, FirstToken = 0, - LastToken = 152, + LastToken = 153, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -431,13 +432,13 @@ declare namespace ts { LastTemplateToken = 17, FirstBinaryOperator = 29, LastBinaryOperator = 74, - FirstStatement = 225, - LastStatement = 241, - FirstNode = 153, - FirstJSDocNode = 294, - LastJSDocNode = 323, - FirstJSDocTagNode = 306, - LastJSDocTagNode = 323, + FirstStatement = 226, + LastStatement = 242, + FirstNode = 154, + FirstJSDocNode = 295, + LastJSDocNode = 324, + FirstJSDocTagNode = 307, + LastJSDocTagNode = 324, } export enum NodeFlags { None = 0, @@ -844,7 +845,7 @@ declare namespace ts { } export interface TypeOperatorNode extends TypeNode { kind: SyntaxKind.TypeOperator; - operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword; + operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.AwaitedKeyword; type: TypeNode; } export interface IndexedAccessTypeNode extends TypeNode { @@ -1924,7 +1925,8 @@ declare namespace ts { /** @throws OperationCanceledException if isCancellationRequested is true */ throwIfCancellationRequested(): void; } - export interface Program extends ScriptReferenceHost { + export interface Program extends ScriptReferenceHost, ModuleSpecifierResolutionHost { + getCurrentDirectory(): string; /** * Get a list of root file names that were passed to a 'createProgram' */ @@ -2359,6 +2361,7 @@ declare namespace ts { Conditional = 16777216, Substitution = 33554432, NonPrimitive = 67108864, + Awaited = 134217728, Literal = 2944, Unit = 109440, StringOrNumberLiteral = 384, @@ -2373,11 +2376,11 @@ declare namespace ts { UnionOrIntersection = 3145728, StructuredType = 3670016, TypeVariable = 8650752, - InstantiableNonPrimitive = 58982400, + InstantiableNonPrimitive = 193200128, InstantiablePrimitive = 4194304, - Instantiable = 63176704, - StructuredOrInstantiable = 66846720, - Narrowable = 133970943, + Instantiable = 197394432, + StructuredOrInstantiable = 201064448, + Narrowable = 268188671, NotUnionOrUnit = 67637251, } export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; @@ -2522,9 +2525,12 @@ declare namespace ts { resolvedFalseType: Type; } export interface SubstitutionType extends InstantiableType { - typeVariable: TypeVariable; + baseType: Type; substitute: Type; } + export interface AwaitedType extends InstantiableType { + awaitedType: Type; + } export enum SignatureKind { Call = 0, Construct = 1 @@ -2917,7 +2923,7 @@ declare namespace ts { } export interface ResolvedTypeReferenceDirectiveWithFailedLookupLocations { readonly resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective | undefined; - readonly failedLookupLocations: readonly string[]; + readonly failedLookupLocations: string[]; } export interface CompilerHost extends ModuleResolutionHost { getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean): SourceFile | undefined; @@ -4070,7 +4076,7 @@ declare namespace ts { function updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode; function createThisTypeNode(): ThisTypeNode; function createTypeOperatorNode(type: TypeNode): TypeOperatorNode; - function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode; + function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.AwaitedKeyword, type: TypeNode): TypeOperatorNode; function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; function updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; @@ -4757,6 +4763,8 @@ declare namespace ts { resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[]; } interface WatchCompilerHost extends ProgramHost, WatchHost { + /** Instead of using output d.ts file from project reference, use its source file */ + useSourceOfProjectReferenceRedirect?(): boolean; /** If provided, callback to invoke after every new program creation */ afterProgramCreate?(program: T): void; } @@ -5136,25 +5144,88 @@ declare namespace ts { metadata?: unknown; }; interface LanguageService { + /** This is used as a part of restarting the language service. */ cleanupSemanticCache(): void; + /** + * Gets errors indicating invalid syntax in a file. + * + * In English, "this cdeo have, erorrs" is syntactically invalid because it has typos, + * grammatical errors, and misplaced punctuation. Likewise, examples of syntax + * errors in TypeScript are missing parentheses in an `if` statement, mismatched + * curly braces, and using a reserved keyword as a variable name. + * + * These diagnostics are inexpensive to compute and don't require knowledge of + * other files. Note that a non-empty result increases the likelihood of false positives + * from `getSemanticDiagnostics`. + * + * While these represent the majority of syntax-related diagnostics, there are some + * that require the type system, which will be present in `getSemanticDiagnostics`. + * + * @param fileName A path to the file you want syntactic diagnostics for + */ getSyntacticDiagnostics(fileName: string): DiagnosticWithLocation[]; - /** The first time this is called, it will return global diagnostics (no location). */ + /** + * Gets warnings or errors indicating type system issues in a given file. + * Requesting semantic diagnostics may start up the type system and + * run deferred work, so the first call may take longer than subsequent calls. + * + * Unlike the other get*Diagnostics functions, these diagnostics can potentially not + * include a reference to a source file. Specifically, the first time this is called, + * it will return global diagnostics with no associated location. + * + * To contrast the differences between semantic and syntactic diagnostics, consider the + * sentence: "The sun is green." is syntactically correct; those are real English words with + * correct sentence structure. However, it is semantically invalid, because it is not true. + * + * @param fileName A path to the file you want semantic diagnostics for + */ getSemanticDiagnostics(fileName: string): Diagnostic[]; - getSuggestionDiagnostics(fileName: string): DiagnosticWithLocation[]; - getCompilerOptionsDiagnostics(): Diagnostic[]; /** - * @deprecated Use getEncodedSyntacticClassifications instead. + * Gets suggestion diagnostics for a specific file. These diagnostics tend to + * proactively suggest refactors, as opposed to diagnostics that indicate + * potentially incorrect runtime behavior. + * + * @param fileName A path to the file you want semantic diagnostics for */ - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; + getSuggestionDiagnostics(fileName: string): DiagnosticWithLocation[]; /** - * @deprecated Use getEncodedSemanticClassifications instead. + * Gets global diagnostics related to the program configuration and compiler options. */ + getCompilerOptionsDiagnostics(): Diagnostic[]; + /** @deprecated Use getEncodedSyntacticClassifications instead. */ + getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; + /** @deprecated Use getEncodedSemanticClassifications instead. */ getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications; getEncodedSemanticClassifications(fileName: string, span: TextSpan): Classifications; + /** + * Gets completion entries at a particular position in a file. + * + * @param fileName The path to the file + * @param position A zero-based index of the character where you want the entries + * @param options An object describing how the request was triggered and what kinds + * of code actions can be returned with the completions. + */ getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined): WithMetadata | undefined; - getCompletionEntryDetails(fileName: string, position: number, name: string, formatOptions: FormatCodeOptions | FormatCodeSettings | undefined, source: string | undefined, preferences: UserPreferences | undefined): CompletionEntryDetails | undefined; + /** + * Gets the extended details for a completion entry retrieved from `getCompletionsAtPosition`. + * + * @param fileName The path to the file + * @param position A zero based index of the character where you want the entries + * @param entryName The name from an existing completion which came from `getCompletionsAtPosition` + * @param formatOptions How should code samples in the completions be formatted, can be undefined for backwards compatibility + * @param source Source code for the current file, can be undefined for backwards compatibility + * @param preferences User settings, can be undefined for backwards compatibility + */ + getCompletionEntryDetails(fileName: string, position: number, entryName: string, formatOptions: FormatCodeOptions | FormatCodeSettings | undefined, source: string | undefined, preferences: UserPreferences | undefined): CompletionEntryDetails | undefined; getCompletionEntrySymbol(fileName: string, position: number, name: string, source: string | undefined): Symbol | undefined; + /** + * Gets semantic information about the identifier at a particular position in a + * file. Quick info is what you typically see when you hover in an editor. + * + * @param fileName The path to the file + * @param position A zero-based index of the character where you want the quick info + */ getQuickInfoAtPosition(fileName: string, position: number): QuickInfo | undefined; getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan | undefined; getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan | undefined; @@ -5509,6 +5580,7 @@ declare namespace ts { newLineCharacter?: string; convertTabsToSpaces?: boolean; indentStyle?: IndentStyle; + trimTrailingWhitespace?: boolean; } interface FormatCodeOptions extends EditorOptions { InsertSpaceAfterCommaDelimiter: boolean; @@ -5538,6 +5610,7 @@ declare namespace ts { readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean; readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean; readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean; + readonly insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean; readonly insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean; readonly insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean; readonly insertSpaceAfterTypeAssertion?: boolean; diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index ea532d504ce3f..0a4971a67668a 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -3203,233 +3203,234 @@ var ts; SyntaxKind[SyntaxKind["AnyKeyword"] = 125] = "AnyKeyword"; SyntaxKind[SyntaxKind["AsyncKeyword"] = 126] = "AsyncKeyword"; SyntaxKind[SyntaxKind["AwaitKeyword"] = 127] = "AwaitKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 128] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 129] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 130] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 131] = "GetKeyword"; - SyntaxKind[SyntaxKind["InferKeyword"] = 132] = "InferKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 133] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 134] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 135] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 136] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 137] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 138] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 139] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 140] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 141] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 142] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 143] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 144] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 145] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 146] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 147] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["UnknownKeyword"] = 148] = "UnknownKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 149] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 150] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["BigIntKeyword"] = 151] = "BigIntKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 152] = "OfKeyword"; + SyntaxKind[SyntaxKind["AwaitedKeyword"] = 128] = "AwaitedKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 129] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 130] = "ConstructorKeyword"; + SyntaxKind[SyntaxKind["DeclareKeyword"] = 131] = "DeclareKeyword"; + SyntaxKind[SyntaxKind["GetKeyword"] = 132] = "GetKeyword"; + SyntaxKind[SyntaxKind["InferKeyword"] = 133] = "InferKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 134] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 135] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 136] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 137] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 138] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 139] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 140] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 141] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 142] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 143] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 144] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 145] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 146] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 147] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 148] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["UnknownKeyword"] = 149] = "UnknownKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 150] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 151] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["BigIntKeyword"] = 152] = "BigIntKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 153] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 153] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 154] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 154] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 155] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 155] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 156] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 157] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 156] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 157] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 158] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 158] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 159] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 160] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 161] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 162] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 163] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 164] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 165] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 166] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 167] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 159] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 160] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 161] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 162] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 163] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 164] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 165] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 166] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 167] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 168] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 168] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 169] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 170] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 171] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 172] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 173] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 174] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 175] = "TupleType"; - SyntaxKind[SyntaxKind["OptionalType"] = 176] = "OptionalType"; - SyntaxKind[SyntaxKind["RestType"] = 177] = "RestType"; - SyntaxKind[SyntaxKind["UnionType"] = 178] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 179] = "IntersectionType"; - SyntaxKind[SyntaxKind["ConditionalType"] = 180] = "ConditionalType"; - SyntaxKind[SyntaxKind["InferType"] = 181] = "InferType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 182] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 183] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 184] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 185] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 186] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 187] = "LiteralType"; - SyntaxKind[SyntaxKind["ImportType"] = 188] = "ImportType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 169] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 170] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 171] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 172] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 173] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 174] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 175] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 176] = "TupleType"; + SyntaxKind[SyntaxKind["OptionalType"] = 177] = "OptionalType"; + SyntaxKind[SyntaxKind["RestType"] = 178] = "RestType"; + SyntaxKind[SyntaxKind["UnionType"] = 179] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 180] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 181] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 182] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 183] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 184] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 185] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 186] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 187] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 188] = "LiteralType"; + SyntaxKind[SyntaxKind["ImportType"] = 189] = "ImportType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 189] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 190] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 191] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 190] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 191] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 192] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 192] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 193] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 194] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 195] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 196] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 197] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 198] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 199] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 200] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 201] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 202] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 203] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 204] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 205] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 206] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 207] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 208] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 209] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 210] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 211] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 212] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 213] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 214] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 215] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 216] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 217] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 218] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 219] = "MetaProperty"; - SyntaxKind[SyntaxKind["SyntheticExpression"] = 220] = "SyntheticExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 193] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 194] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 195] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 196] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 197] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 198] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 199] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 200] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 201] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 202] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 203] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 204] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 205] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 206] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 207] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 208] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 209] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 210] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 211] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 212] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 213] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 214] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 215] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 216] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 217] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 218] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 219] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 220] = "MetaProperty"; + SyntaxKind[SyntaxKind["SyntheticExpression"] = 221] = "SyntheticExpression"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 221] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 222] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 222] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 223] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 223] = "Block"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 224] = "EmptyStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 225] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 226] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 227] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 228] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 229] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 230] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 231] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 232] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 233] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 234] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 235] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 236] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 237] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 238] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 239] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 240] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 241] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 242] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 243] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 244] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 245] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 246] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 247] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 248] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 249] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 250] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 251] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 252] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 253] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 254] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 255] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 256] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 257] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 258] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 259] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 260] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 261] = "NamedExports"; - SyntaxKind[SyntaxKind["NamespaceExport"] = 262] = "NamespaceExport"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 263] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 264] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 224] = "Block"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 225] = "EmptyStatement"; + SyntaxKind[SyntaxKind["VariableStatement"] = 226] = "VariableStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 227] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 228] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 229] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 230] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 231] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 232] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 233] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 234] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 235] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 236] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 237] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 238] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 239] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 240] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 241] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 242] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 243] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 244] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 245] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 246] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 247] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 248] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 249] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 250] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 251] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 252] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 253] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 254] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 255] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 256] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 257] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 258] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 259] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 260] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 261] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 262] = "NamedExports"; + SyntaxKind[SyntaxKind["NamespaceExport"] = 263] = "NamespaceExport"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 264] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 265] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 265] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 266] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 266] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 267] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 268] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 269] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 270] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 271] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 272] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 273] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 274] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 275] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 276] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 267] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 268] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 269] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 270] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 271] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 272] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 273] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 274] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 275] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 276] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 277] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 277] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 278] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 279] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 280] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 278] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 279] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 280] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 281] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 281] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 282] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 283] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 282] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 283] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 284] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 284] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 285] = "EnumMember"; // Unparsed - SyntaxKind[SyntaxKind["UnparsedPrologue"] = 285] = "UnparsedPrologue"; - SyntaxKind[SyntaxKind["UnparsedPrepend"] = 286] = "UnparsedPrepend"; - SyntaxKind[SyntaxKind["UnparsedText"] = 287] = "UnparsedText"; - SyntaxKind[SyntaxKind["UnparsedInternalText"] = 288] = "UnparsedInternalText"; - SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 289] = "UnparsedSyntheticReference"; + SyntaxKind[SyntaxKind["UnparsedPrologue"] = 286] = "UnparsedPrologue"; + SyntaxKind[SyntaxKind["UnparsedPrepend"] = 287] = "UnparsedPrepend"; + SyntaxKind[SyntaxKind["UnparsedText"] = 288] = "UnparsedText"; + SyntaxKind[SyntaxKind["UnparsedInternalText"] = 289] = "UnparsedInternalText"; + SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 290] = "UnparsedSyntheticReference"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 290] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 291] = "Bundle"; - SyntaxKind[SyntaxKind["UnparsedSource"] = 292] = "UnparsedSource"; - SyntaxKind[SyntaxKind["InputFiles"] = 293] = "InputFiles"; + SyntaxKind[SyntaxKind["SourceFile"] = 291] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 292] = "Bundle"; + SyntaxKind[SyntaxKind["UnparsedSource"] = 293] = "UnparsedSource"; + SyntaxKind[SyntaxKind["InputFiles"] = 294] = "InputFiles"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 294] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 295] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 295] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 296] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 296] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 297] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 298] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 299] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 300] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 301] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 297] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 298] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 299] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 300] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 301] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 302] = "JSDocVariadicType"; // https://jsdoc.app/about-namepaths.html - SyntaxKind[SyntaxKind["JSDocNamepathType"] = 302] = "JSDocNamepathType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 303] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 304] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocSignature"] = 305] = "JSDocSignature"; - SyntaxKind[SyntaxKind["JSDocTag"] = 306] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 307] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 308] = "JSDocImplementsTag"; - SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 309] = "JSDocAuthorTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 310] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocPublicTag"] = 311] = "JSDocPublicTag"; - SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 312] = "JSDocPrivateTag"; - SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 313] = "JSDocProtectedTag"; - SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 314] = "JSDocReadonlyTag"; - SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 315] = "JSDocCallbackTag"; - SyntaxKind[SyntaxKind["JSDocEnumTag"] = 316] = "JSDocEnumTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 317] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 318] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocThisTag"] = 319] = "JSDocThisTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 320] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 321] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 322] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 323] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocNamepathType"] = 303] = "JSDocNamepathType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 304] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 305] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocSignature"] = 306] = "JSDocSignature"; + SyntaxKind[SyntaxKind["JSDocTag"] = 307] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 308] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 309] = "JSDocImplementsTag"; + SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 310] = "JSDocAuthorTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 311] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocPublicTag"] = 312] = "JSDocPublicTag"; + SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 313] = "JSDocPrivateTag"; + SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 314] = "JSDocProtectedTag"; + SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 315] = "JSDocReadonlyTag"; + SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 316] = "JSDocCallbackTag"; + SyntaxKind[SyntaxKind["JSDocEnumTag"] = 317] = "JSDocEnumTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 318] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 319] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocThisTag"] = 320] = "JSDocThisTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 321] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 322] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 323] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 324] = "JSDocPropertyTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 324] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 325] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 325] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 326] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 327] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 328] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 329] = "EndOfDeclarationMarker"; - SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 330] = "SyntheticReferenceExpression"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 326] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 327] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 328] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 329] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 330] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 331] = "SyntheticReferenceExpression"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 331] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 332] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 62] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 74] = "LastAssignment"; @@ -3438,15 +3439,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 77] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 112] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 77] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 152] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 153] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 113] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 121] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 168] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 188] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 169] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 189] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 18] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 74] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 152] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 153] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -3455,15 +3456,15 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 17] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 29] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 74] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstStatement"] = 225] = "FirstStatement"; - SyntaxKind[SyntaxKind["LastStatement"] = 241] = "LastStatement"; - SyntaxKind[SyntaxKind["FirstNode"] = 153] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 294] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 323] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 306] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 323] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstStatement"] = 226] = "FirstStatement"; + SyntaxKind[SyntaxKind["LastStatement"] = 242] = "LastStatement"; + SyntaxKind[SyntaxKind["FirstNode"] = 154] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 295] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 324] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 307] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 324] = "LastJSDocTagNode"; /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 122] = "FirstContextualKeyword"; - /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 152] = "LastContextualKeyword"; + /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 153] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -3619,6 +3620,12 @@ var ts; FlowFlags[FlowFlags["Label"] = 12] = "Label"; FlowFlags[FlowFlags["Condition"] = 96] = "Condition"; })(FlowFlags = ts.FlowFlags || (ts.FlowFlags = {})); + /* @internal */ + var CommentDirectiveType; + (function (CommentDirectiveType) { + CommentDirectiveType[CommentDirectiveType["ExpectError"] = 0] = "ExpectError"; + CommentDirectiveType[CommentDirectiveType["Ignore"] = 1] = "Ignore"; + })(CommentDirectiveType = ts.CommentDirectiveType || (ts.CommentDirectiveType = {})); var OperationCanceledException = /** @class */ (function () { function OperationCanceledException() { } @@ -4003,6 +4010,7 @@ var ts; TypeFlags[TypeFlags["Conditional"] = 16777216] = "Conditional"; TypeFlags[TypeFlags["Substitution"] = 33554432] = "Substitution"; TypeFlags[TypeFlags["NonPrimitive"] = 67108864] = "NonPrimitive"; + TypeFlags[TypeFlags["Awaited"] = 134217728] = "Awaited"; /* @internal */ TypeFlags[TypeFlags["AnyOrUnknown"] = 3] = "AnyOrUnknown"; /* @internal */ @@ -4031,10 +4039,10 @@ var ts; TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType"; TypeFlags[TypeFlags["TypeVariable"] = 8650752] = "TypeVariable"; - TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 58982400] = "InstantiableNonPrimitive"; + TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 193200128] = "InstantiableNonPrimitive"; TypeFlags[TypeFlags["InstantiablePrimitive"] = 4194304] = "InstantiablePrimitive"; - TypeFlags[TypeFlags["Instantiable"] = 63176704] = "Instantiable"; - TypeFlags[TypeFlags["StructuredOrInstantiable"] = 66846720] = "StructuredOrInstantiable"; + TypeFlags[TypeFlags["Instantiable"] = 197394432] = "Instantiable"; + TypeFlags[TypeFlags["StructuredOrInstantiable"] = 201064448] = "StructuredOrInstantiable"; /* @internal */ TypeFlags[TypeFlags["ObjectFlagsType"] = 3899393] = "ObjectFlagsType"; /* @internal */ @@ -4043,10 +4051,10 @@ var ts; TypeFlags[TypeFlags["Substructure"] = 66584576] = "Substructure"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 133970943] = "Narrowable"; + TypeFlags[TypeFlags["Narrowable"] = 268188671] = "Narrowable"; TypeFlags[TypeFlags["NotUnionOrUnit"] = 67637251] = "NotUnionOrUnit"; /* @internal */ - TypeFlags[TypeFlags["NotPrimitiveUnion"] = 66994211] = "NotPrimitiveUnion"; + TypeFlags[TypeFlags["NotPrimitiveUnion"] = 201211939] = "NotPrimitiveUnion"; // The following flags are aggregated during union and intersection type construction /* @internal */ TypeFlags[TypeFlags["IncludesMask"] = 71041023] = "IncludesMask"; @@ -4145,6 +4153,7 @@ var ts; SignatureFlags[SignatureFlags["HasLiteralTypes"] = 2] = "HasLiteralTypes"; SignatureFlags[SignatureFlags["IsInnerCallChain"] = 4] = "IsInnerCallChain"; SignatureFlags[SignatureFlags["IsOuterCallChain"] = 8] = "IsOuterCallChain"; + SignatureFlags[SignatureFlags["IsUntypedSignatureInJSFile"] = 16] = "IsUntypedSignatureInJSFile"; // We do not propagate `IsInnerCallChain` to instantiated signatures, as that would result in us // attempting to add `| undefined` on each recursive call to `getReturnTypeOfSignature` when // instantiating the return type. @@ -4156,6 +4165,15 @@ var ts; IndexKind[IndexKind["String"] = 0] = "String"; IndexKind[IndexKind["Number"] = 1] = "Number"; })(IndexKind = ts.IndexKind || (ts.IndexKind = {})); + /* @internal */ + var TypeMapKind; + (function (TypeMapKind) { + TypeMapKind[TypeMapKind["Simple"] = 0] = "Simple"; + TypeMapKind[TypeMapKind["Array"] = 1] = "Array"; + TypeMapKind[TypeMapKind["Function"] = 2] = "Function"; + TypeMapKind[TypeMapKind["Composite"] = 3] = "Composite"; + TypeMapKind[TypeMapKind["Merged"] = 4] = "Merged"; + })(TypeMapKind = ts.TypeMapKind || (ts.TypeMapKind = {})); var InferencePriority; (function (InferencePriority) { InferencePriority[InferencePriority["NakedTypeVariable"] = 1] = "NakedTypeVariable"; @@ -6749,6 +6767,10 @@ var ts; } } ts.forEachAncestorDirectory = forEachAncestorDirectory; + function isNodeModulesDirectory(dirPath) { + return ts.endsWith(dirPath, "/node_modules"); + } + ts.isNodeModulesDirectory = isNodeModulesDirectory; })(ts || (ts = {})); // // generated from './diagnosticInformationMap.generated.ts' by 'src/compiler' @@ -7059,7 +7081,7 @@ var ts; Cannot_find_name_0: diag(2304, ts.DiagnosticCategory.Error, "Cannot_find_name_0_2304", "Cannot find name '{0}'."), Module_0_has_no_exported_member_1: diag(2305, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_2305", "Module '{0}' has no exported member '{1}'."), File_0_is_not_a_module: diag(2306, ts.DiagnosticCategory.Error, "File_0_is_not_a_module_2306", "File '{0}' is not a module."), - Cannot_find_module_0: diag(2307, ts.DiagnosticCategory.Error, "Cannot_find_module_0_2307", "Cannot find module '{0}'."), + Cannot_find_module_0_or_its_corresponding_type_declarations: diag(2307, ts.DiagnosticCategory.Error, "Cannot_find_module_0_or_its_corresponding_type_declarations_2307", "Cannot find module '{0}' or its corresponding type declarations."), Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: diag(2308, ts.DiagnosticCategory.Error, "Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308", "Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."), An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: diag(2309, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", "An export assignment cannot be used in a module with other exported elements."), Type_0_recursively_references_itself_as_a_base_type: diag(2310, ts.DiagnosticCategory.Error, "Type_0_recursively_references_itself_as_a_base_type_2310", "Type '{0}' recursively references itself as a base type."), @@ -7319,6 +7341,7 @@ var ts; No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments: diag(2575, ts.DiagnosticCategory.Error, "No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575", "No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."), Property_0_is_a_static_member_of_type_1: diag(2576, ts.DiagnosticCategory.Error, "Property_0_is_a_static_member_of_type_1_2576", "Property '{0}' is a static member of type '{1}'"), Return_type_annotation_circularly_references_itself: diag(2577, ts.DiagnosticCategory.Error, "Return_type_annotation_circularly_references_itself_2577", "Return type annotation circularly references itself."), + Unused_ts_expect_error_directive: diag(2578, ts.DiagnosticCategory.Error, "Unused_ts_expect_error_directive_2578", "Unused '@ts-expect-error' directive."), Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`."), Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`."), Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`."), @@ -7447,7 +7470,7 @@ var ts; This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided: diag(2746, ts.DiagnosticCategory.Error, "This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746", "This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."), _0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2: diag(2747, ts.DiagnosticCategory.Error, "_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747", "'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."), Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided: diag(2748, ts.DiagnosticCategory.Error, "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748", "Cannot access ambient const enums when the '--isolatedModules' flag is provided."), - _0_refers_to_a_value_but_is_being_used_as_a_type_here: diag(2749, ts.DiagnosticCategory.Error, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_2749", "'{0}' refers to a value, but is being used as a type here."), + _0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0: diag(2749, ts.DiagnosticCategory.Error, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749", "'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"), The_implementation_signature_is_declared_here: diag(2750, ts.DiagnosticCategory.Error, "The_implementation_signature_is_declared_here_2750", "The implementation signature is declared here."), Circularity_originates_in_type_at_this_location: diag(2751, ts.DiagnosticCategory.Error, "Circularity_originates_in_type_at_this_location_2751", "Circularity originates in type at this location."), The_first_export_default_is_here: diag(2752, ts.DiagnosticCategory.Error, "The_first_export_default_is_here_2752", "The first export default is here."), @@ -7482,6 +7505,7 @@ var ts; The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access: diag(2781, ts.DiagnosticCategory.Error, "The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781", "The left-hand side of a 'for...of' statement may not be an optional property access."), _0_needs_an_explicit_type_annotation: diag(2782, ts.DiagnosticCategory.Message, "_0_needs_an_explicit_type_annotation_2782", "'{0}' needs an explicit type annotation."), _0_is_specified_more_than_once_so_this_usage_will_be_overwritten: diag(2783, ts.DiagnosticCategory.Error, "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783", "'{0}' is specified more than once, so this usage will be overwritten."), + get_and_set_accessors_cannot_declare_this_parameters: diag(2784, ts.DiagnosticCategory.Error, "get_and_set_accessors_cannot_declare_this_parameters_2784", "'get' and 'set' accessors cannot declare 'this' parameters."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -7616,6 +7640,7 @@ var ts; Unknown_watch_option_0_Did_you_mean_1: diag(5079, ts.DiagnosticCategory.Error, "Unknown_watch_option_0_Did_you_mean_1_5079", "Unknown watch option '{0}'. Did you mean '{1}'?"), Watch_option_0_requires_a_value_of_type_1: diag(5080, ts.DiagnosticCategory.Error, "Watch_option_0_requires_a_value_of_type_1_5080", "Watch option '{0}' requires a value of type {1}."), Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0: diag(5081, ts.DiagnosticCategory.Error, "Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081", "Cannot find a tsconfig.json file at the current directory: {0}."), + _0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1: diag(5082, ts.DiagnosticCategory.Error, "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082", "'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6000, ts.DiagnosticCategory.Message, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, ts.DiagnosticCategory.Message, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, ts.DiagnosticCategory.Message, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -8028,6 +8053,7 @@ var ts; Import_default_0_from_module_1: diag(90032, ts.DiagnosticCategory.Message, "Import_default_0_from_module_1_90032", "Import default '{0}' from module \"{1}\""), Add_default_import_0_to_existing_import_declaration_from_1: diag(90033, ts.DiagnosticCategory.Message, "Add_default_import_0_to_existing_import_declaration_from_1_90033", "Add default import '{0}' to existing import declaration from \"{1}\""), Add_parameter_name: diag(90034, ts.DiagnosticCategory.Message, "Add_parameter_name_90034", "Add parameter name"), + Declare_private_property_0: diag(90035, ts.DiagnosticCategory.Message, "Declare_private_property_0_90035", "Declare private property '{0}'"), Declare_a_private_field_named_0: diag(90053, ts.DiagnosticCategory.Message, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), @@ -8093,6 +8119,8 @@ var ts; Add_all_missing_imports: diag(95064, ts.DiagnosticCategory.Message, "Add_all_missing_imports_95064", "Add all missing imports"), Convert_to_async_function: diag(95065, ts.DiagnosticCategory.Message, "Convert_to_async_function_95065", "Convert to async function"), Convert_all_to_async_functions: diag(95066, ts.DiagnosticCategory.Message, "Convert_all_to_async_functions_95066", "Convert all to async functions"), + Add_missing_call_parentheses: diag(95067, ts.DiagnosticCategory.Message, "Add_missing_call_parentheses_95067", "Add missing call parentheses"), + Add_all_missing_call_parentheses: diag(95068, ts.DiagnosticCategory.Message, "Add_all_missing_call_parentheses_95068", "Add all missing call parentheses"), Add_unknown_conversion_for_non_overlapping_types: diag(95069, ts.DiagnosticCategory.Message, "Add_unknown_conversion_for_non_overlapping_types_95069", "Add 'unknown' conversion for non-overlapping types"), Add_unknown_to_all_conversions_of_non_overlapping_types: diag(95070, ts.DiagnosticCategory.Message, "Add_unknown_to_all_conversions_of_non_overlapping_types_95070", "Add 'unknown' to all conversions of non-overlapping types"), Add_missing_new_operator_to_call: diag(95071, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_call_95071", "Add missing 'new' operator to call"), @@ -8168,8 +8196,8 @@ var ts; any: 125 /* AnyKeyword */, as: 123 /* AsKeyword */, asserts: 124 /* AssertsKeyword */, - bigint: 151 /* BigIntKeyword */, - boolean: 128 /* BooleanKeyword */, + bigint: 152 /* BigIntKeyword */, + boolean: 129 /* BooleanKeyword */, break: 77 /* BreakKeyword */, case: 78 /* CaseKeyword */, catch: 79 /* CatchKeyword */, @@ -8177,9 +8205,9 @@ var ts; continue: 82 /* ContinueKeyword */, const: 81 /* ConstKeyword */ }, - _a["" + "constructor"] = 129 /* ConstructorKeyword */, + _a["" + "constructor"] = 130 /* ConstructorKeyword */, _a.debugger = 83 /* DebuggerKeyword */, - _a.declare = 130 /* DeclareKeyword */, + _a.declare = 131 /* DeclareKeyword */, _a.default = 84 /* DefaultKeyword */, _a.delete = 85 /* DeleteKeyword */, _a.do = 86 /* DoKeyword */, @@ -8190,49 +8218,49 @@ var ts; _a.false = 91 /* FalseKeyword */, _a.finally = 92 /* FinallyKeyword */, _a.for = 93 /* ForKeyword */, - _a.from = 149 /* FromKeyword */, + _a.from = 150 /* FromKeyword */, _a.function = 94 /* FunctionKeyword */, - _a.get = 131 /* GetKeyword */, + _a.get = 132 /* GetKeyword */, _a.if = 95 /* IfKeyword */, _a.implements = 113 /* ImplementsKeyword */, _a.import = 96 /* ImportKeyword */, _a.in = 97 /* InKeyword */, - _a.infer = 132 /* InferKeyword */, + _a.infer = 133 /* InferKeyword */, _a.instanceof = 98 /* InstanceOfKeyword */, _a.interface = 114 /* InterfaceKeyword */, - _a.is = 133 /* IsKeyword */, - _a.keyof = 134 /* KeyOfKeyword */, + _a.is = 134 /* IsKeyword */, + _a.keyof = 135 /* KeyOfKeyword */, _a.let = 115 /* LetKeyword */, - _a.module = 135 /* ModuleKeyword */, - _a.namespace = 136 /* NamespaceKeyword */, - _a.never = 137 /* NeverKeyword */, + _a.module = 136 /* ModuleKeyword */, + _a.namespace = 137 /* NamespaceKeyword */, + _a.never = 138 /* NeverKeyword */, _a.new = 99 /* NewKeyword */, _a.null = 100 /* NullKeyword */, - _a.number = 140 /* NumberKeyword */, - _a.object = 141 /* ObjectKeyword */, + _a.number = 141 /* NumberKeyword */, + _a.object = 142 /* ObjectKeyword */, _a.package = 116 /* PackageKeyword */, _a.private = 117 /* PrivateKeyword */, _a.protected = 118 /* ProtectedKeyword */, _a.public = 119 /* PublicKeyword */, - _a.readonly = 138 /* ReadonlyKeyword */, - _a.require = 139 /* RequireKeyword */, - _a.global = 150 /* GlobalKeyword */, + _a.readonly = 139 /* ReadonlyKeyword */, + _a.require = 140 /* RequireKeyword */, + _a.global = 151 /* GlobalKeyword */, _a.return = 101 /* ReturnKeyword */, - _a.set = 142 /* SetKeyword */, + _a.set = 143 /* SetKeyword */, _a.static = 120 /* StaticKeyword */, - _a.string = 143 /* StringKeyword */, + _a.string = 144 /* StringKeyword */, _a.super = 102 /* SuperKeyword */, _a.switch = 103 /* SwitchKeyword */, - _a.symbol = 144 /* SymbolKeyword */, + _a.symbol = 145 /* SymbolKeyword */, _a.this = 104 /* ThisKeyword */, _a.throw = 105 /* ThrowKeyword */, _a.true = 106 /* TrueKeyword */, _a.try = 107 /* TryKeyword */, - _a.type = 145 /* TypeKeyword */, + _a.type = 146 /* TypeKeyword */, _a.typeof = 108 /* TypeOfKeyword */, - _a.undefined = 146 /* UndefinedKeyword */, - _a.unique = 147 /* UniqueKeyword */, - _a.unknown = 148 /* UnknownKeyword */, + _a.undefined = 147 /* UndefinedKeyword */, + _a.unique = 148 /* UniqueKeyword */, + _a.unknown = 149 /* UnknownKeyword */, _a.var = 109 /* VarKeyword */, _a.void = 110 /* VoidKeyword */, _a.while = 111 /* WhileKeyword */, @@ -8240,7 +8268,8 @@ var ts; _a.yield = 121 /* YieldKeyword */, _a.async = 126 /* AsyncKeyword */, _a.await = 127 /* AwaitKeyword */, - _a.of = 152 /* OfKeyword */, + _a.awaited = 128 /* AwaitedKeyword */, + _a.of = 153 /* OfKeyword */, _a); var textToKeyword = ts.createMapFromTemplate(textToKeywordObj); var textToToken = ts.createMapFromTemplate(__assign(__assign({}, textToKeywordObj), { "{": 18 /* OpenBraceToken */, "}": 19 /* CloseBraceToken */, "(": 20 /* OpenParenToken */, ")": 21 /* CloseParenToken */, "[": 22 /* OpenBracketToken */, "]": 23 /* CloseBracketToken */, ".": 24 /* DotToken */, "...": 25 /* DotDotDotToken */, ";": 26 /* SemicolonToken */, ",": 27 /* CommaToken */, "<": 29 /* LessThanToken */, ">": 31 /* GreaterThanToken */, "<=": 32 /* LessThanEqualsToken */, ">=": 33 /* GreaterThanEqualsToken */, "==": 34 /* EqualsEqualsToken */, "!=": 35 /* ExclamationEqualsToken */, "===": 36 /* EqualsEqualsEqualsToken */, "!==": 37 /* ExclamationEqualsEqualsToken */, "=>": 38 /* EqualsGreaterThanToken */, "+": 39 /* PlusToken */, "-": 40 /* MinusToken */, "**": 42 /* AsteriskAsteriskToken */, "*": 41 /* AsteriskToken */, "/": 43 /* SlashToken */, "%": 44 /* PercentToken */, "++": 45 /* PlusPlusToken */, "--": 46 /* MinusMinusToken */, "<<": 47 /* LessThanLessThanToken */, ">": 48 /* GreaterThanGreaterThanToken */, ">>>": 49 /* GreaterThanGreaterThanGreaterThanToken */, "&": 50 /* AmpersandToken */, "|": 51 /* BarToken */, "^": 52 /* CaretToken */, "!": 53 /* ExclamationToken */, "~": 54 /* TildeToken */, "&&": 55 /* AmpersandAmpersandToken */, "||": 56 /* BarBarToken */, "?": 57 /* QuestionToken */, "??": 60 /* QuestionQuestionToken */, "?.": 28 /* QuestionDotToken */, ":": 58 /* ColonToken */, "=": 62 /* EqualsToken */, "+=": 63 /* PlusEqualsToken */, "-=": 64 /* MinusEqualsToken */, "*=": 65 /* AsteriskEqualsToken */, "**=": 66 /* AsteriskAsteriskEqualsToken */, "/=": 67 /* SlashEqualsToken */, "%=": 68 /* PercentEqualsToken */, "<<=": 69 /* LessThanLessThanEqualsToken */, ">>=": 70 /* GreaterThanGreaterThanEqualsToken */, ">>>=": 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */, "&=": 72 /* AmpersandEqualsToken */, "|=": 73 /* BarEqualsToken */, "^=": 74 /* CaretEqualsToken */, "@": 59 /* AtToken */, "`": 61 /* BacktickToken */ })); @@ -8298,6 +8327,10 @@ var ts; */ var unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 895, 895, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1488, 1514, 1519, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2144, 2154, 2208, 2228, 2230, 2237, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2432, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2556, 2556, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2809, 2809, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3133, 3160, 3162, 3168, 3169, 3200, 3200, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3412, 3414, 3423, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6264, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6430, 6480, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7401, 7404, 7406, 7411, 7413, 7414, 7418, 7418, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12443, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42653, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43261, 43262, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43488, 43492, 43494, 43503, 43514, 43518, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43646, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66335, 66349, 66378, 66384, 66421, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68096, 68112, 68115, 68117, 68119, 68121, 68149, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68324, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68899, 69376, 69404, 69415, 69415, 69424, 69445, 69600, 69622, 69635, 69687, 69763, 69807, 69840, 69864, 69891, 69926, 69956, 69956, 69968, 70002, 70006, 70006, 70019, 70066, 70081, 70084, 70106, 70106, 70108, 70108, 70144, 70161, 70163, 70187, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70366, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70461, 70461, 70480, 70480, 70493, 70497, 70656, 70708, 70727, 70730, 70751, 70751, 70784, 70831, 70852, 70853, 70855, 70855, 71040, 71086, 71128, 71131, 71168, 71215, 71236, 71236, 71296, 71338, 71352, 71352, 71424, 71450, 71680, 71723, 71840, 71903, 71935, 71935, 72096, 72103, 72106, 72144, 72161, 72161, 72163, 72163, 72192, 72192, 72203, 72242, 72250, 72250, 72272, 72272, 72284, 72329, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72750, 72768, 72768, 72818, 72847, 72960, 72966, 72968, 72969, 72971, 73008, 73030, 73030, 73056, 73061, 73063, 73064, 73066, 73097, 73112, 73112, 73440, 73458, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92880, 92909, 92928, 92975, 92992, 92995, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94032, 94032, 94099, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 123136, 123180, 123191, 123197, 123214, 123214, 123584, 123627, 124928, 125124, 125184, 125251, 125259, 125259, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101]; var unicodeESNextIdentifierPart = [48, 57, 65, 90, 95, 95, 97, 122, 170, 170, 181, 181, 183, 183, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 895, 895, 902, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1519, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2045, 2045, 2048, 2093, 2112, 2139, 2144, 2154, 2208, 2228, 2230, 2237, 2259, 2273, 2275, 2403, 2406, 2415, 2417, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2556, 2556, 2558, 2558, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2809, 2815, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3072, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3168, 3171, 3174, 3183, 3200, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3328, 3331, 3333, 3340, 3342, 3344, 3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3558, 3567, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4969, 4977, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6264, 6272, 6314, 6320, 6389, 6400, 6430, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6832, 6845, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418, 7424, 7673, 7675, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42737, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43047, 43072, 43123, 43136, 43205, 43216, 43225, 43232, 43255, 43259, 43259, 43261, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43488, 43518, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65071, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66045, 66045, 66176, 66204, 66208, 66256, 66272, 66272, 66304, 66335, 66349, 66378, 66384, 66426, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68099, 68101, 68102, 68108, 68115, 68117, 68119, 68121, 68149, 68152, 68154, 68159, 68159, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68326, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68903, 68912, 68921, 69376, 69404, 69415, 69415, 69424, 69456, 69600, 69622, 69632, 69702, 69734, 69743, 69759, 69818, 69840, 69864, 69872, 69881, 69888, 69940, 69942, 69951, 69956, 69958, 69968, 70003, 70006, 70006, 70016, 70084, 70089, 70092, 70096, 70106, 70108, 70108, 70144, 70161, 70163, 70199, 70206, 70206, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70378, 70384, 70393, 70400, 70403, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70459, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70730, 70736, 70745, 70750, 70751, 70784, 70853, 70855, 70855, 70864, 70873, 71040, 71093, 71096, 71104, 71128, 71133, 71168, 71232, 71236, 71236, 71248, 71257, 71296, 71352, 71360, 71369, 71424, 71450, 71453, 71467, 71472, 71481, 71680, 71738, 71840, 71913, 71935, 71935, 72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263, 72263, 72272, 72345, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72758, 72760, 72768, 72784, 72793, 72818, 72847, 72850, 72871, 72873, 72886, 72960, 72966, 72968, 72969, 72971, 73014, 73018, 73018, 73020, 73021, 73023, 73031, 73040, 73049, 73056, 73061, 73063, 73064, 73066, 73102, 73104, 73105, 73107, 73112, 73120, 73129, 73440, 73462, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 92880, 92909, 92912, 92916, 92928, 92982, 92992, 92995, 93008, 93017, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94031, 94087, 94095, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113821, 113822, 119141, 119145, 119149, 119154, 119163, 119170, 119173, 119179, 119210, 119213, 119362, 119364, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 120782, 120831, 121344, 121398, 121403, 121452, 121461, 121461, 121476, 121476, 121499, 121503, 121505, 121519, 122880, 122886, 122888, 122904, 122907, 122913, 122915, 122916, 122918, 122922, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123214, 123584, 123641, 124928, 125124, 125136, 125142, 125184, 125259, 125264, 125273, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 917760, 917999]; + /** + * Test for whether a comment's text contains a `@ts-expect-error` or `@ts-ignore` directive. + */ + var commentDirectiveRegEx = /^\s*\/\/\/?\s*@(ts-expect-error|ts-ignore)/; function lookupInUnicodeMap(code, map) { // Bail out quickly if it couldn't possibly be in the map. if (code < map[0]) { @@ -8864,6 +8897,7 @@ var ts; var token; var tokenValue; var tokenFlags; + var commentDirectives; var inJSDocType = 0; setText(text, start, length); var scanner = { @@ -8879,6 +8913,7 @@ var ts; isIdentifier: function () { return token === 75 /* Identifier */ || token > 112 /* LastReservedWord */; }, isReservedWord: function () { return token >= 77 /* FirstReservedWord */ && token <= 112 /* LastReservedWord */; }, isUnterminated: function () { return (tokenFlags & 4 /* Unterminated */) !== 0; }, + getCommentDirectives: function () { return commentDirectives; }, getTokenFlags: function () { return tokenFlags; }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, @@ -8894,6 +8929,7 @@ var ts; scanJsDocToken: scanJsDocToken, scan: scan, getText: getText, + clearCommentDirectives: clearCommentDirectives, setText: setText, setScriptTarget: setScriptTarget, setLanguageVariant: setLanguageVariant, @@ -9623,6 +9659,13 @@ var ts; } pos++; } + var type = getDirectiveFromComment(text.slice(tokenPos, pos)); + if (type !== undefined) { + commentDirectives = ts.append(commentDirectives, { + range: { pos: tokenPos, end: pos }, + type: type, + }); + } if (skipTrivia) { continue; } @@ -9977,6 +10020,19 @@ var ts; } return token; } + function getDirectiveFromComment(text) { + var match = commentDirectiveRegEx.exec(text); + if (!match) { + return undefined; + } + switch (match[1]) { + case "ts-expect-error": + return 0 /* ExpectError */; + case "ts-ignore": + return 1 /* Ignore */; + } + return undefined; + } /** * Unconditionally back up and scan a template expression portion. */ @@ -10216,6 +10272,7 @@ var ts; var saveToken = token; var saveTokenValue = tokenValue; var saveTokenFlags = tokenFlags; + var saveErrorExpectations = commentDirectives; setText(text, start, length); var result = callback(); end = saveEnd; @@ -10225,6 +10282,7 @@ var ts; token = saveToken; tokenValue = saveTokenValue; tokenFlags = saveTokenFlags; + commentDirectives = saveErrorExpectations; return result; } function lookAhead(callback) { @@ -10236,6 +10294,9 @@ var ts; function getText() { return text; } + function clearCommentDirectives() { + commentDirectives = undefined; + } function setText(newText, start, length) { text = newText || ""; end = length === undefined ? text.length : start + length; @@ -10543,9 +10604,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 155 /* TypeParameter */) { + if (d && d.kind === 156 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 246 /* InterfaceDeclaration */) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 247 /* InterfaceDeclaration */) { return current; } } @@ -10553,7 +10614,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node, parent) { - return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 162 /* Constructor */; + return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 163 /* Constructor */; } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -10583,14 +10644,14 @@ var ts; node = walkUpBindingElementsAndPatterns(node); } var flags = getFlags(node); - if (node.kind === 242 /* VariableDeclaration */) { + if (node.kind === 243 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 243 /* VariableDeclarationList */) { + if (node && node.kind === 244 /* VariableDeclarationList */) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 225 /* VariableStatement */) { + if (node && node.kind === 226 /* VariableStatement */) { flags |= getFlags(node); } return flags; @@ -10739,30 +10800,30 @@ var ts; } // Covers remaining cases (returning undefined if none match). switch (hostNode.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: var expr = hostNode.expression; - if (expr.kind === 209 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { + if (expr.kind === 210 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { expr = expr.left; } switch (expr.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return expr.name; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: var arg = expr.argumentExpression; if (isIdentifier(arg)) { return arg; } } break; - case 200 /* ParenthesizedExpression */: { + case 201 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 238 /* LabeledStatement */: { + case 239 /* LabeledStatement */: { if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -10799,16 +10860,16 @@ var ts; switch (declaration.kind) { case 75 /* Identifier */: return declaration; - case 323 /* JSDocPropertyTag */: - case 317 /* JSDocParameterTag */: { + case 324 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: { var name = declaration.name; - if (name.kind === 153 /* QualifiedName */) { + if (name.kind === 154 /* QualifiedName */) { return name.right; } break; } - case 196 /* CallExpression */: - case 209 /* BinaryExpression */: { + case 197 /* CallExpression */: + case 210 /* BinaryExpression */: { var expr_1 = declaration; switch (ts.getAssignmentDeclarationKind(expr_1)) { case 1 /* ExportsProperty */: @@ -10824,15 +10885,15 @@ var ts; return undefined; } } - case 322 /* JSDocTypedefTag */: + case 323 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 316 /* JSDocEnumTag */: + case 317 /* JSDocEnumTag */: return nameForNamelessJSDocTypedef(declaration); - case 259 /* ExportAssignment */: { + case 260 /* ExportAssignment */: { var expression = declaration.expression; return isIdentifier(expression) ? expression : undefined; } - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: var expr = declaration; if (ts.isBindableStaticElementAccessExpression(expr)) { return expr.argumentExpression; @@ -11068,7 +11129,7 @@ var ts; return ts.emptyArray; } if (ts.isJSDocTypeAlias(node)) { - ts.Debug.assert(node.parent.kind === 303 /* JSDocComment */); + ts.Debug.assert(node.parent.kind === 304 /* JSDocComment */); return ts.flatMap(node.parent.tags, function (tag) { return isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; }); } if (node.typeParameters) { @@ -11139,11 +11200,11 @@ var ts; ts.isIdentifier = isIdentifier; // Names function isQualifiedName(node) { - return node.kind === 153 /* QualifiedName */; + return node.kind === 154 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 154 /* ComputedPropertyName */; + return node.kind === 155 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; function isPrivateIdentifier(node) { @@ -11156,164 +11217,164 @@ var ts; ts.isIdentifierOrPrivateIdentifier = isIdentifierOrPrivateIdentifier; // Signature elements function isTypeParameterDeclaration(node) { - return node.kind === 155 /* TypeParameter */; + return node.kind === 156 /* TypeParameter */; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 156 /* Parameter */; + return node.kind === 157 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 157 /* Decorator */; + return node.kind === 158 /* Decorator */; } ts.isDecorator = isDecorator; // TypeMember function isPropertySignature(node) { - return node.kind === 158 /* PropertySignature */; + return node.kind === 159 /* PropertySignature */; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 159 /* PropertyDeclaration */; + return node.kind === 160 /* PropertyDeclaration */; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 160 /* MethodSignature */; + return node.kind === 161 /* MethodSignature */; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 161 /* MethodDeclaration */; + return node.kind === 162 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 162 /* Constructor */; + return node.kind === 163 /* Constructor */; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 163 /* GetAccessor */; + return node.kind === 164 /* GetAccessor */; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 164 /* SetAccessor */; + return node.kind === 165 /* SetAccessor */; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 165 /* CallSignature */; + return node.kind === 166 /* CallSignature */; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 166 /* ConstructSignature */; + return node.kind === 167 /* ConstructSignature */; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 167 /* IndexSignature */; + return node.kind === 168 /* IndexSignature */; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; /* @internal */ function isGetOrSetAccessorDeclaration(node) { - return node.kind === 164 /* SetAccessor */ || node.kind === 163 /* GetAccessor */; + return node.kind === 165 /* SetAccessor */ || node.kind === 164 /* GetAccessor */; } ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration; // Type function isTypePredicateNode(node) { - return node.kind === 168 /* TypePredicate */; + return node.kind === 169 /* TypePredicate */; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 169 /* TypeReference */; + return node.kind === 170 /* TypeReference */; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 170 /* FunctionType */; + return node.kind === 171 /* FunctionType */; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 171 /* ConstructorType */; + return node.kind === 172 /* ConstructorType */; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 172 /* TypeQuery */; + return node.kind === 173 /* TypeQuery */; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 173 /* TypeLiteral */; + return node.kind === 174 /* TypeLiteral */; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 174 /* ArrayType */; + return node.kind === 175 /* ArrayType */; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 175 /* TupleType */; + return node.kind === 176 /* TupleType */; } ts.isTupleTypeNode = isTupleTypeNode; function isUnionTypeNode(node) { - return node.kind === 178 /* UnionType */; + return node.kind === 179 /* UnionType */; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 179 /* IntersectionType */; + return node.kind === 180 /* IntersectionType */; } ts.isIntersectionTypeNode = isIntersectionTypeNode; function isConditionalTypeNode(node) { - return node.kind === 180 /* ConditionalType */; + return node.kind === 181 /* ConditionalType */; } ts.isConditionalTypeNode = isConditionalTypeNode; function isInferTypeNode(node) { - return node.kind === 181 /* InferType */; + return node.kind === 182 /* InferType */; } ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 182 /* ParenthesizedType */; + return node.kind === 183 /* ParenthesizedType */; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 183 /* ThisType */; + return node.kind === 184 /* ThisType */; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 184 /* TypeOperator */; + return node.kind === 185 /* TypeOperator */; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 185 /* IndexedAccessType */; + return node.kind === 186 /* IndexedAccessType */; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 186 /* MappedType */; + return node.kind === 187 /* MappedType */; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 187 /* LiteralType */; + return node.kind === 188 /* LiteralType */; } ts.isLiteralTypeNode = isLiteralTypeNode; function isImportTypeNode(node) { - return node.kind === 188 /* ImportType */; + return node.kind === 189 /* ImportType */; } ts.isImportTypeNode = isImportTypeNode; // Binding patterns function isObjectBindingPattern(node) { - return node.kind === 189 /* ObjectBindingPattern */; + return node.kind === 190 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 190 /* ArrayBindingPattern */; + return node.kind === 191 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 191 /* BindingElement */; + return node.kind === 192 /* BindingElement */; } ts.isBindingElement = isBindingElement; // Expression function isArrayLiteralExpression(node) { - return node.kind === 192 /* ArrayLiteralExpression */; + return node.kind === 193 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 193 /* ObjectLiteralExpression */; + return node.kind === 194 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 194 /* PropertyAccessExpression */; + return node.kind === 195 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isPropertyAccessChain(node) { @@ -11321,7 +11382,7 @@ var ts; } ts.isPropertyAccessChain = isPropertyAccessChain; function isElementAccessExpression(node) { - return node.kind === 195 /* ElementAccessExpression */; + return node.kind === 196 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isElementAccessChain(node) { @@ -11329,7 +11390,7 @@ var ts; } ts.isElementAccessChain = isElementAccessChain; function isCallExpression(node) { - return node.kind === 196 /* CallExpression */; + return node.kind === 197 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isCallChain(node) { @@ -11339,9 +11400,9 @@ var ts; function isOptionalChain(node) { var kind = node.kind; return !!(node.flags & 32 /* OptionalChain */) && - (kind === 194 /* PropertyAccessExpression */ - || kind === 195 /* ElementAccessExpression */ - || kind === 196 /* CallExpression */); + (kind === 195 /* PropertyAccessExpression */ + || kind === 196 /* ElementAccessExpression */ + || kind === 197 /* CallExpression */); } ts.isOptionalChain = isOptionalChain; /* @internal */ @@ -11375,19 +11436,19 @@ var ts; } ts.isOutermostOptionalChain = isOutermostOptionalChain; function isNullishCoalesce(node) { - return node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; + return node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; } ts.isNullishCoalesce = isNullishCoalesce; function isNewExpression(node) { - return node.kind === 197 /* NewExpression */; + return node.kind === 198 /* NewExpression */; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 198 /* TaggedTemplateExpression */; + return node.kind === 199 /* TaggedTemplateExpression */; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertion(node) { - return node.kind === 199 /* TypeAssertionExpression */; + return node.kind === 200 /* TypeAssertionExpression */; } ts.isTypeAssertion = isTypeAssertion; function isConstTypeReference(node) { @@ -11396,384 +11457,384 @@ var ts; } ts.isConstTypeReference = isConstTypeReference; function isParenthesizedExpression(node) { - return node.kind === 200 /* ParenthesizedExpression */; + return node.kind === 201 /* ParenthesizedExpression */; } ts.isParenthesizedExpression = isParenthesizedExpression; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 326 /* PartiallyEmittedExpression */) { + while (node.kind === 327 /* PartiallyEmittedExpression */) { node = node.expression; } return node; } ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; function isFunctionExpression(node) { - return node.kind === 201 /* FunctionExpression */; + return node.kind === 202 /* FunctionExpression */; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 202 /* ArrowFunction */; + return node.kind === 203 /* ArrowFunction */; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 203 /* DeleteExpression */; + return node.kind === 204 /* DeleteExpression */; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 204 /* TypeOfExpression */; + return node.kind === 205 /* TypeOfExpression */; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 205 /* VoidExpression */; + return node.kind === 206 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 206 /* AwaitExpression */; + return node.kind === 207 /* AwaitExpression */; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 207 /* PrefixUnaryExpression */; + return node.kind === 208 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 208 /* PostfixUnaryExpression */; + return node.kind === 209 /* PostfixUnaryExpression */; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 209 /* BinaryExpression */; + return node.kind === 210 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 210 /* ConditionalExpression */; + return node.kind === 211 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 211 /* TemplateExpression */; + return node.kind === 212 /* TemplateExpression */; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 212 /* YieldExpression */; + return node.kind === 213 /* YieldExpression */; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 213 /* SpreadElement */; + return node.kind === 214 /* SpreadElement */; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 214 /* ClassExpression */; + return node.kind === 215 /* ClassExpression */; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 215 /* OmittedExpression */; + return node.kind === 216 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 216 /* ExpressionWithTypeArguments */; + return node.kind === 217 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 217 /* AsExpression */; + return node.kind === 218 /* AsExpression */; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 218 /* NonNullExpression */; + return node.kind === 219 /* NonNullExpression */; } ts.isNonNullExpression = isNonNullExpression; function isMetaProperty(node) { - return node.kind === 219 /* MetaProperty */; + return node.kind === 220 /* MetaProperty */; } ts.isMetaProperty = isMetaProperty; // Misc function isTemplateSpan(node) { - return node.kind === 221 /* TemplateSpan */; + return node.kind === 222 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 222 /* SemicolonClassElement */; + return node.kind === 223 /* SemicolonClassElement */; } ts.isSemicolonClassElement = isSemicolonClassElement; // Block function isBlock(node) { - return node.kind === 223 /* Block */; + return node.kind === 224 /* Block */; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 225 /* VariableStatement */; + return node.kind === 226 /* VariableStatement */; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 224 /* EmptyStatement */; + return node.kind === 225 /* EmptyStatement */; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 226 /* ExpressionStatement */; + return node.kind === 227 /* ExpressionStatement */; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 227 /* IfStatement */; + return node.kind === 228 /* IfStatement */; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 228 /* DoStatement */; + return node.kind === 229 /* DoStatement */; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 229 /* WhileStatement */; + return node.kind === 230 /* WhileStatement */; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 230 /* ForStatement */; + return node.kind === 231 /* ForStatement */; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 231 /* ForInStatement */; + return node.kind === 232 /* ForInStatement */; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 232 /* ForOfStatement */; + return node.kind === 233 /* ForOfStatement */; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 233 /* ContinueStatement */; + return node.kind === 234 /* ContinueStatement */; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 234 /* BreakStatement */; + return node.kind === 235 /* BreakStatement */; } ts.isBreakStatement = isBreakStatement; function isBreakOrContinueStatement(node) { - return node.kind === 234 /* BreakStatement */ || node.kind === 233 /* ContinueStatement */; + return node.kind === 235 /* BreakStatement */ || node.kind === 234 /* ContinueStatement */; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isReturnStatement(node) { - return node.kind === 235 /* ReturnStatement */; + return node.kind === 236 /* ReturnStatement */; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 236 /* WithStatement */; + return node.kind === 237 /* WithStatement */; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 237 /* SwitchStatement */; + return node.kind === 238 /* SwitchStatement */; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 238 /* LabeledStatement */; + return node.kind === 239 /* LabeledStatement */; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 239 /* ThrowStatement */; + return node.kind === 240 /* ThrowStatement */; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 240 /* TryStatement */; + return node.kind === 241 /* TryStatement */; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 241 /* DebuggerStatement */; + return node.kind === 242 /* DebuggerStatement */; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 242 /* VariableDeclaration */; + return node.kind === 243 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 243 /* VariableDeclarationList */; + return node.kind === 244 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 244 /* FunctionDeclaration */; + return node.kind === 245 /* FunctionDeclaration */; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 245 /* ClassDeclaration */; + return node.kind === 246 /* ClassDeclaration */; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 246 /* InterfaceDeclaration */; + return node.kind === 247 /* InterfaceDeclaration */; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 247 /* TypeAliasDeclaration */; + return node.kind === 248 /* TypeAliasDeclaration */; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 248 /* EnumDeclaration */; + return node.kind === 249 /* EnumDeclaration */; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 249 /* ModuleDeclaration */; + return node.kind === 250 /* ModuleDeclaration */; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 250 /* ModuleBlock */; + return node.kind === 251 /* ModuleBlock */; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 251 /* CaseBlock */; + return node.kind === 252 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 252 /* NamespaceExportDeclaration */; + return node.kind === 253 /* NamespaceExportDeclaration */; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */; + return node.kind === 254 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 254 /* ImportDeclaration */; + return node.kind === 255 /* ImportDeclaration */; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 255 /* ImportClause */; + return node.kind === 256 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 256 /* NamespaceImport */; + return node.kind === 257 /* NamespaceImport */; } ts.isNamespaceImport = isNamespaceImport; function isNamespaceExport(node) { - return node.kind === 262 /* NamespaceExport */; + return node.kind === 263 /* NamespaceExport */; } ts.isNamespaceExport = isNamespaceExport; function isNamedExportBindings(node) { - return node.kind === 262 /* NamespaceExport */ || node.kind === 261 /* NamedExports */; + return node.kind === 263 /* NamespaceExport */ || node.kind === 262 /* NamedExports */; } ts.isNamedExportBindings = isNamedExportBindings; function isNamedImports(node) { - return node.kind === 257 /* NamedImports */; + return node.kind === 258 /* NamedImports */; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 258 /* ImportSpecifier */; + return node.kind === 259 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 259 /* ExportAssignment */; + return node.kind === 260 /* ExportAssignment */; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 260 /* ExportDeclaration */; + return node.kind === 261 /* ExportDeclaration */; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 261 /* NamedExports */; + return node.kind === 262 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 263 /* ExportSpecifier */; + return node.kind === 264 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 264 /* MissingDeclaration */; + return node.kind === 265 /* MissingDeclaration */; } ts.isMissingDeclaration = isMissingDeclaration; // Module References function isExternalModuleReference(node) { - return node.kind === 265 /* ExternalModuleReference */; + return node.kind === 266 /* ExternalModuleReference */; } ts.isExternalModuleReference = isExternalModuleReference; // JSX function isJsxElement(node) { - return node.kind === 266 /* JsxElement */; + return node.kind === 267 /* JsxElement */; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 267 /* JsxSelfClosingElement */; + return node.kind === 268 /* JsxSelfClosingElement */; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 268 /* JsxOpeningElement */; + return node.kind === 269 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 269 /* JsxClosingElement */; + return node.kind === 270 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 270 /* JsxFragment */; + return node.kind === 271 /* JsxFragment */; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 271 /* JsxOpeningFragment */; + return node.kind === 272 /* JsxOpeningFragment */; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 272 /* JsxClosingFragment */; + return node.kind === 273 /* JsxClosingFragment */; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 273 /* JsxAttribute */; + return node.kind === 274 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 274 /* JsxAttributes */; + return node.kind === 275 /* JsxAttributes */; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 275 /* JsxSpreadAttribute */; + return node.kind === 276 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 276 /* JsxExpression */; + return node.kind === 277 /* JsxExpression */; } ts.isJsxExpression = isJsxExpression; // Clauses function isCaseClause(node) { - return node.kind === 277 /* CaseClause */; + return node.kind === 278 /* CaseClause */; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 278 /* DefaultClause */; + return node.kind === 279 /* DefaultClause */; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 279 /* HeritageClause */; + return node.kind === 280 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 280 /* CatchClause */; + return node.kind === 281 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 281 /* PropertyAssignment */; + return node.kind === 282 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 282 /* ShorthandPropertyAssignment */; + return node.kind === 283 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 283 /* SpreadAssignment */; + return node.kind === 284 /* SpreadAssignment */; } ts.isSpreadAssignment = isSpreadAssignment; // Enum function isEnumMember(node) { - return node.kind === 284 /* EnumMember */; + return node.kind === 285 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Top-level nodes function isSourceFile(node) { - return node.kind === 290 /* SourceFile */; + return node.kind === 291 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 291 /* Bundle */; + return node.kind === 292 /* Bundle */; } ts.isBundle = isBundle; function isUnparsedSource(node) { - return node.kind === 292 /* UnparsedSource */; + return node.kind === 293 /* UnparsedSource */; } ts.isUnparsedSource = isUnparsedSource; function isUnparsedPrepend(node) { - return node.kind === 286 /* UnparsedPrepend */; + return node.kind === 287 /* UnparsedPrepend */; } ts.isUnparsedPrepend = isUnparsedPrepend; function isUnparsedTextLike(node) { switch (node.kind) { - case 287 /* UnparsedText */: - case 288 /* UnparsedInternalText */: + case 288 /* UnparsedText */: + case 289 /* UnparsedInternalText */: return true; default: return false; @@ -11782,125 +11843,125 @@ var ts; ts.isUnparsedTextLike = isUnparsedTextLike; function isUnparsedNode(node) { return isUnparsedTextLike(node) || - node.kind === 285 /* UnparsedPrologue */ || - node.kind === 289 /* UnparsedSyntheticReference */; + node.kind === 286 /* UnparsedPrologue */ || + node.kind === 290 /* UnparsedSyntheticReference */; } ts.isUnparsedNode = isUnparsedNode; // JSDoc function isJSDocTypeExpression(node) { - return node.kind === 294 /* JSDocTypeExpression */; + return node.kind === 295 /* JSDocTypeExpression */; } ts.isJSDocTypeExpression = isJSDocTypeExpression; function isJSDocAllType(node) { - return node.kind === 295 /* JSDocAllType */; + return node.kind === 296 /* JSDocAllType */; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 296 /* JSDocUnknownType */; + return node.kind === 297 /* JSDocUnknownType */; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 297 /* JSDocNullableType */; + return node.kind === 298 /* JSDocNullableType */; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 298 /* JSDocNonNullableType */; + return node.kind === 299 /* JSDocNonNullableType */; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 299 /* JSDocOptionalType */; + return node.kind === 300 /* JSDocOptionalType */; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 300 /* JSDocFunctionType */; + return node.kind === 301 /* JSDocFunctionType */; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 301 /* JSDocVariadicType */; + return node.kind === 302 /* JSDocVariadicType */; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDoc(node) { - return node.kind === 303 /* JSDocComment */; + return node.kind === 304 /* JSDocComment */; } ts.isJSDoc = isJSDoc; function isJSDocAuthorTag(node) { - return node.kind === 309 /* JSDocAuthorTag */; + return node.kind === 310 /* JSDocAuthorTag */; } ts.isJSDocAuthorTag = isJSDocAuthorTag; function isJSDocAugmentsTag(node) { - return node.kind === 307 /* JSDocAugmentsTag */; + return node.kind === 308 /* JSDocAugmentsTag */; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocImplementsTag(node) { - return node.kind === 308 /* JSDocImplementsTag */; + return node.kind === 309 /* JSDocImplementsTag */; } ts.isJSDocImplementsTag = isJSDocImplementsTag; function isJSDocClassTag(node) { - return node.kind === 310 /* JSDocClassTag */; + return node.kind === 311 /* JSDocClassTag */; } ts.isJSDocClassTag = isJSDocClassTag; function isJSDocPublicTag(node) { - return node.kind === 311 /* JSDocPublicTag */; + return node.kind === 312 /* JSDocPublicTag */; } ts.isJSDocPublicTag = isJSDocPublicTag; function isJSDocPrivateTag(node) { - return node.kind === 312 /* JSDocPrivateTag */; + return node.kind === 313 /* JSDocPrivateTag */; } ts.isJSDocPrivateTag = isJSDocPrivateTag; function isJSDocProtectedTag(node) { - return node.kind === 313 /* JSDocProtectedTag */; + return node.kind === 314 /* JSDocProtectedTag */; } ts.isJSDocProtectedTag = isJSDocProtectedTag; function isJSDocReadonlyTag(node) { - return node.kind === 314 /* JSDocReadonlyTag */; + return node.kind === 315 /* JSDocReadonlyTag */; } ts.isJSDocReadonlyTag = isJSDocReadonlyTag; function isJSDocEnumTag(node) { - return node.kind === 316 /* JSDocEnumTag */; + return node.kind === 317 /* JSDocEnumTag */; } ts.isJSDocEnumTag = isJSDocEnumTag; function isJSDocThisTag(node) { - return node.kind === 319 /* JSDocThisTag */; + return node.kind === 320 /* JSDocThisTag */; } ts.isJSDocThisTag = isJSDocThisTag; function isJSDocParameterTag(node) { - return node.kind === 317 /* JSDocParameterTag */; + return node.kind === 318 /* JSDocParameterTag */; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 318 /* JSDocReturnTag */; + return node.kind === 319 /* JSDocReturnTag */; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocTypeTag(node) { - return node.kind === 320 /* JSDocTypeTag */; + return node.kind === 321 /* JSDocTypeTag */; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 321 /* JSDocTemplateTag */; + return node.kind === 322 /* JSDocTemplateTag */; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 322 /* JSDocTypedefTag */; + return node.kind === 323 /* JSDocTypedefTag */; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocPropertyTag(node) { - return node.kind === 323 /* JSDocPropertyTag */; + return node.kind === 324 /* JSDocPropertyTag */; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocPropertyLikeTag(node) { - return node.kind === 323 /* JSDocPropertyTag */ || node.kind === 317 /* JSDocParameterTag */; + return node.kind === 324 /* JSDocPropertyTag */ || node.kind === 318 /* JSDocParameterTag */; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isJSDocTypeLiteral(node) { - return node.kind === 304 /* JSDocTypeLiteral */; + return node.kind === 305 /* JSDocTypeLiteral */; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; function isJSDocCallbackTag(node) { - return node.kind === 315 /* JSDocCallbackTag */; + return node.kind === 316 /* JSDocCallbackTag */; } ts.isJSDocCallbackTag = isJSDocCallbackTag; function isJSDocSignature(node) { - return node.kind === 305 /* JSDocSignature */; + return node.kind === 306 /* JSDocSignature */; } ts.isJSDocSignature = isJSDocSignature; // #endregion @@ -11911,7 +11972,7 @@ var ts; // they may be used with transformations. /* @internal */ function isSyntaxList(n) { - return n.kind === 324 /* SyntaxList */; + return n.kind === 325 /* SyntaxList */; } ts.isSyntaxList = isSyntaxList; /* @internal */ @@ -11921,7 +11982,7 @@ var ts; ts.isNode = isNode; /* @internal */ function isNodeKind(kind) { - return kind >= 153 /* FirstNode */; + return kind >= 154 /* FirstNode */; } ts.isNodeKind = isNodeKind; /** @@ -11930,7 +11991,7 @@ var ts; * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 152 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 153 /* LastToken */; } ts.isToken = isToken; // Node Arrays @@ -11971,12 +12032,12 @@ var ts; ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isTypeOnlyImportOrExportDeclaration(node) { switch (node.kind) { - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return node.parent.isTypeOnly; - case 255 /* ImportClause */: + case 256 /* ImportClause */: return node.isTypeOnly; default: return false; @@ -12011,13 +12072,13 @@ var ts; case 122 /* AbstractKeyword */: case 126 /* AsyncKeyword */: case 81 /* ConstKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 84 /* DefaultKeyword */: case 89 /* ExportKeyword */: case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: case 120 /* StaticKeyword */: return true; } @@ -12040,23 +12101,24 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 153 /* QualifiedName */ + return kind === 154 /* QualifiedName */ || kind === 75 /* Identifier */; } ts.isEntityName = isEntityName; function isPropertyName(node) { var kind = node.kind; return kind === 75 /* Identifier */ + || kind === 76 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 154 /* ComputedPropertyName */; + || kind === 155 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 75 /* Identifier */ - || kind === 189 /* ObjectBindingPattern */ - || kind === 190 /* ArrayBindingPattern */; + || kind === 190 /* ObjectBindingPattern */ + || kind === 191 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Functions @@ -12071,13 +12133,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return true; default: return false; @@ -12086,14 +12148,14 @@ var ts; /* @internal */ function isFunctionLikeKind(kind) { switch (kind) { - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 305 /* JSDocSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 170 /* FunctionType */: - case 300 /* JSDocFunctionType */: - case 171 /* ConstructorType */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 306 /* JSDocSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 171 /* FunctionType */: + case 301 /* JSDocFunctionType */: + case 172 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -12108,29 +12170,29 @@ var ts; // Classes function isClassElement(node) { var kind = node.kind; - return kind === 162 /* Constructor */ - || kind === 159 /* PropertyDeclaration */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */ - || kind === 167 /* IndexSignature */ - || kind === 222 /* SemicolonClassElement */; + return kind === 163 /* Constructor */ + || kind === 160 /* PropertyDeclaration */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */ + || kind === 168 /* IndexSignature */ + || kind === 223 /* SemicolonClassElement */; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */); + return node && (node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 163 /* GetAccessor */ || node.kind === 164 /* SetAccessor */); + return node && (node.kind === 164 /* GetAccessor */ || node.kind === 165 /* SetAccessor */); } ts.isAccessor = isAccessor; /* @internal */ function isMethodOrAccessor(node) { switch (node.kind) { - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return true; default: return false; @@ -12140,11 +12202,11 @@ var ts; // Type members function isTypeElement(node) { var kind = node.kind; - return kind === 166 /* ConstructSignature */ - || kind === 165 /* CallSignature */ - || kind === 158 /* PropertySignature */ - || kind === 160 /* MethodSignature */ - || kind === 167 /* IndexSignature */; + return kind === 167 /* ConstructSignature */ + || kind === 166 /* CallSignature */ + || kind === 159 /* PropertySignature */ + || kind === 161 /* MethodSignature */ + || kind === 168 /* IndexSignature */; } ts.isTypeElement = isTypeElement; function isClassOrTypeElement(node) { @@ -12153,12 +12215,12 @@ var ts; ts.isClassOrTypeElement = isClassOrTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 281 /* PropertyAssignment */ - || kind === 282 /* ShorthandPropertyAssignment */ - || kind === 283 /* SpreadAssignment */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */; + return kind === 282 /* PropertyAssignment */ + || kind === 283 /* ShorthandPropertyAssignment */ + || kind === 284 /* SpreadAssignment */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type @@ -12173,8 +12235,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 170 /* FunctionType */: - case 171 /* ConstructorType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: return true; } return false; @@ -12185,8 +12247,8 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 190 /* ArrayBindingPattern */ - || kind === 189 /* ObjectBindingPattern */; + return kind === 191 /* ArrayBindingPattern */ + || kind === 190 /* ObjectBindingPattern */; } return false; } @@ -12194,15 +12256,15 @@ var ts; /* @internal */ function isAssignmentPattern(node) { var kind = node.kind; - return kind === 192 /* ArrayLiteralExpression */ - || kind === 193 /* ObjectLiteralExpression */; + return kind === 193 /* ArrayLiteralExpression */ + || kind === 194 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; /* @internal */ function isArrayBindingElement(node) { var kind = node.kind; - return kind === 191 /* BindingElement */ - || kind === 215 /* OmittedExpression */; + return kind === 192 /* BindingElement */ + || kind === 216 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -12211,9 +12273,9 @@ var ts; /* @internal */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 191 /* BindingElement */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 192 /* BindingElement */: return true; } return false; @@ -12234,8 +12296,8 @@ var ts; /* @internal */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 189 /* ObjectBindingPattern */: - case 193 /* ObjectLiteralExpression */: + case 190 /* ObjectBindingPattern */: + case 194 /* ObjectLiteralExpression */: return true; } return false; @@ -12247,8 +12309,8 @@ var ts; /* @internal */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 190 /* ArrayBindingPattern */: - case 192 /* ArrayLiteralExpression */: + case 191 /* ArrayBindingPattern */: + case 193 /* ArrayLiteralExpression */: return true; } return false; @@ -12257,26 +12319,26 @@ var ts; /* @internal */ function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { var kind = node.kind; - return kind === 194 /* PropertyAccessExpression */ - || kind === 153 /* QualifiedName */ - || kind === 188 /* ImportType */; + return kind === 195 /* PropertyAccessExpression */ + || kind === 154 /* QualifiedName */ + || kind === 189 /* ImportType */; } ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode; // Expression function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 194 /* PropertyAccessExpression */ - || kind === 153 /* QualifiedName */; + return kind === 195 /* PropertyAccessExpression */ + || kind === 154 /* QualifiedName */; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 198 /* TaggedTemplateExpression */: - case 157 /* Decorator */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 199 /* TaggedTemplateExpression */: + case 158 /* Decorator */: return true; default: return false; @@ -12284,12 +12346,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 196 /* CallExpression */ || node.kind === 197 /* NewExpression */; + return node.kind === 197 /* CallExpression */ || node.kind === 198 /* NewExpression */; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 211 /* TemplateExpression */ + return kind === 212 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; @@ -12300,33 +12362,33 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: - case 197 /* NewExpression */: - case 196 /* CallExpression */: - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 270 /* JsxFragment */: - case 198 /* TaggedTemplateExpression */: - case 192 /* ArrayLiteralExpression */: - case 200 /* ParenthesizedExpression */: - case 193 /* ObjectLiteralExpression */: - case 214 /* ClassExpression */: - case 201 /* FunctionExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: + case 198 /* NewExpression */: + case 197 /* CallExpression */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 271 /* JsxFragment */: + case 199 /* TaggedTemplateExpression */: + case 193 /* ArrayLiteralExpression */: + case 201 /* ParenthesizedExpression */: + case 194 /* ObjectLiteralExpression */: + case 215 /* ClassExpression */: + case 202 /* FunctionExpression */: case 75 /* Identifier */: case 13 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: case 91 /* FalseKeyword */: case 100 /* NullKeyword */: case 104 /* ThisKeyword */: case 106 /* TrueKeyword */: case 102 /* SuperKeyword */: - case 218 /* NonNullExpression */: - case 219 /* MetaProperty */: + case 219 /* NonNullExpression */: + case 220 /* MetaProperty */: case 96 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression return true; default: @@ -12340,13 +12402,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: - case 203 /* DeleteExpression */: - case 204 /* TypeOfExpression */: - case 205 /* VoidExpression */: - case 206 /* AwaitExpression */: - case 199 /* TypeAssertionExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: + case 204 /* DeleteExpression */: + case 205 /* TypeOfExpression */: + case 206 /* VoidExpression */: + case 207 /* AwaitExpression */: + case 200 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -12355,9 +12417,9 @@ var ts; /* @internal */ function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return true; - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; default: @@ -12376,15 +12438,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 210 /* ConditionalExpression */: - case 212 /* YieldExpression */: - case 202 /* ArrowFunction */: - case 209 /* BinaryExpression */: - case 213 /* SpreadElement */: - case 217 /* AsExpression */: - case 215 /* OmittedExpression */: - case 327 /* CommaListExpression */: - case 326 /* PartiallyEmittedExpression */: + case 211 /* ConditionalExpression */: + case 213 /* YieldExpression */: + case 203 /* ArrowFunction */: + case 210 /* BinaryExpression */: + case 214 /* SpreadElement */: + case 218 /* AsExpression */: + case 216 /* OmittedExpression */: + case 328 /* CommaListExpression */: + case 327 /* PartiallyEmittedExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -12392,23 +12454,23 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 199 /* TypeAssertionExpression */ - || kind === 217 /* AsExpression */; + return kind === 200 /* TypeAssertionExpression */ + || kind === 218 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; /* @internal */ function isPartiallyEmittedExpression(node) { - return node.kind === 326 /* PartiallyEmittedExpression */; + return node.kind === 327 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; /* @internal */ function isNotEmittedStatement(node) { - return node.kind === 325 /* NotEmittedStatement */; + return node.kind === 326 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; /* @internal */ function isSyntheticReference(node) { - return node.kind === 330 /* SyntheticReferenceExpression */; + return node.kind === 331 /* SyntheticReferenceExpression */; } ts.isSyntheticReference = isSyntheticReference; /* @internal */ @@ -12419,13 +12481,13 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return true; - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -12454,7 +12516,7 @@ var ts; ts.isExternalModuleIndicator = isExternalModuleIndicator; /* @internal */ function isForInOrOfStatement(node) { - return node.kind === 231 /* ForInStatement */ || node.kind === 232 /* ForOfStatement */; + return node.kind === 232 /* ForInStatement */ || node.kind === 233 /* ForOfStatement */; } ts.isForInOrOfStatement = isForInOrOfStatement; // Element @@ -12478,114 +12540,114 @@ var ts; /* @internal */ function isModuleBody(node) { var kind = node.kind; - return kind === 250 /* ModuleBlock */ - || kind === 249 /* ModuleDeclaration */ + return kind === 251 /* ModuleBlock */ + || kind === 250 /* ModuleDeclaration */ || kind === 75 /* Identifier */; } ts.isModuleBody = isModuleBody; /* @internal */ function isNamespaceBody(node) { var kind = node.kind; - return kind === 250 /* ModuleBlock */ - || kind === 249 /* ModuleDeclaration */; + return kind === 251 /* ModuleBlock */ + || kind === 250 /* ModuleDeclaration */; } ts.isNamespaceBody = isNamespaceBody; /* @internal */ function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 75 /* Identifier */ - || kind === 249 /* ModuleDeclaration */; + || kind === 250 /* ModuleDeclaration */; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; /* @internal */ function isNamedImportBindings(node) { var kind = node.kind; - return kind === 257 /* NamedImports */ - || kind === 256 /* NamespaceImport */; + return kind === 258 /* NamedImports */ + || kind === 257 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; /* @internal */ function isModuleOrEnumDeclaration(node) { - return node.kind === 249 /* ModuleDeclaration */ || node.kind === 248 /* EnumDeclaration */; + return node.kind === 250 /* ModuleDeclaration */ || node.kind === 249 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 202 /* ArrowFunction */ - || kind === 191 /* BindingElement */ - || kind === 245 /* ClassDeclaration */ - || kind === 214 /* ClassExpression */ - || kind === 162 /* Constructor */ - || kind === 248 /* EnumDeclaration */ - || kind === 284 /* EnumMember */ - || kind === 263 /* ExportSpecifier */ - || kind === 244 /* FunctionDeclaration */ - || kind === 201 /* FunctionExpression */ - || kind === 163 /* GetAccessor */ - || kind === 255 /* ImportClause */ - || kind === 253 /* ImportEqualsDeclaration */ - || kind === 258 /* ImportSpecifier */ - || kind === 246 /* InterfaceDeclaration */ - || kind === 273 /* JsxAttribute */ - || kind === 161 /* MethodDeclaration */ - || kind === 160 /* MethodSignature */ - || kind === 249 /* ModuleDeclaration */ - || kind === 252 /* NamespaceExportDeclaration */ - || kind === 256 /* NamespaceImport */ - || kind === 262 /* NamespaceExport */ - || kind === 156 /* Parameter */ - || kind === 281 /* PropertyAssignment */ - || kind === 159 /* PropertyDeclaration */ - || kind === 158 /* PropertySignature */ - || kind === 164 /* SetAccessor */ - || kind === 282 /* ShorthandPropertyAssignment */ - || kind === 247 /* TypeAliasDeclaration */ - || kind === 155 /* TypeParameter */ - || kind === 242 /* VariableDeclaration */ - || kind === 322 /* JSDocTypedefTag */ - || kind === 315 /* JSDocCallbackTag */ - || kind === 323 /* JSDocPropertyTag */; + return kind === 203 /* ArrowFunction */ + || kind === 192 /* BindingElement */ + || kind === 246 /* ClassDeclaration */ + || kind === 215 /* ClassExpression */ + || kind === 163 /* Constructor */ + || kind === 249 /* EnumDeclaration */ + || kind === 285 /* EnumMember */ + || kind === 264 /* ExportSpecifier */ + || kind === 245 /* FunctionDeclaration */ + || kind === 202 /* FunctionExpression */ + || kind === 164 /* GetAccessor */ + || kind === 256 /* ImportClause */ + || kind === 254 /* ImportEqualsDeclaration */ + || kind === 259 /* ImportSpecifier */ + || kind === 247 /* InterfaceDeclaration */ + || kind === 274 /* JsxAttribute */ + || kind === 162 /* MethodDeclaration */ + || kind === 161 /* MethodSignature */ + || kind === 250 /* ModuleDeclaration */ + || kind === 253 /* NamespaceExportDeclaration */ + || kind === 257 /* NamespaceImport */ + || kind === 263 /* NamespaceExport */ + || kind === 157 /* Parameter */ + || kind === 282 /* PropertyAssignment */ + || kind === 160 /* PropertyDeclaration */ + || kind === 159 /* PropertySignature */ + || kind === 165 /* SetAccessor */ + || kind === 283 /* ShorthandPropertyAssignment */ + || kind === 248 /* TypeAliasDeclaration */ + || kind === 156 /* TypeParameter */ + || kind === 243 /* VariableDeclaration */ + || kind === 323 /* JSDocTypedefTag */ + || kind === 316 /* JSDocCallbackTag */ + || kind === 324 /* JSDocPropertyTag */; } function isDeclarationStatementKind(kind) { - return kind === 244 /* FunctionDeclaration */ - || kind === 264 /* MissingDeclaration */ - || kind === 245 /* ClassDeclaration */ - || kind === 246 /* InterfaceDeclaration */ - || kind === 247 /* TypeAliasDeclaration */ - || kind === 248 /* EnumDeclaration */ - || kind === 249 /* ModuleDeclaration */ - || kind === 254 /* ImportDeclaration */ - || kind === 253 /* ImportEqualsDeclaration */ - || kind === 260 /* ExportDeclaration */ - || kind === 259 /* ExportAssignment */ - || kind === 252 /* NamespaceExportDeclaration */; + return kind === 245 /* FunctionDeclaration */ + || kind === 265 /* MissingDeclaration */ + || kind === 246 /* ClassDeclaration */ + || kind === 247 /* InterfaceDeclaration */ + || kind === 248 /* TypeAliasDeclaration */ + || kind === 249 /* EnumDeclaration */ + || kind === 250 /* ModuleDeclaration */ + || kind === 255 /* ImportDeclaration */ + || kind === 254 /* ImportEqualsDeclaration */ + || kind === 261 /* ExportDeclaration */ + || kind === 260 /* ExportAssignment */ + || kind === 253 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 234 /* BreakStatement */ - || kind === 233 /* ContinueStatement */ - || kind === 241 /* DebuggerStatement */ - || kind === 228 /* DoStatement */ - || kind === 226 /* ExpressionStatement */ - || kind === 224 /* EmptyStatement */ - || kind === 231 /* ForInStatement */ - || kind === 232 /* ForOfStatement */ - || kind === 230 /* ForStatement */ - || kind === 227 /* IfStatement */ - || kind === 238 /* LabeledStatement */ - || kind === 235 /* ReturnStatement */ - || kind === 237 /* SwitchStatement */ - || kind === 239 /* ThrowStatement */ - || kind === 240 /* TryStatement */ - || kind === 225 /* VariableStatement */ - || kind === 229 /* WhileStatement */ - || kind === 236 /* WithStatement */ - || kind === 325 /* NotEmittedStatement */ - || kind === 329 /* EndOfDeclarationMarker */ - || kind === 328 /* MergeDeclarationMarker */; + return kind === 235 /* BreakStatement */ + || kind === 234 /* ContinueStatement */ + || kind === 242 /* DebuggerStatement */ + || kind === 229 /* DoStatement */ + || kind === 227 /* ExpressionStatement */ + || kind === 225 /* EmptyStatement */ + || kind === 232 /* ForInStatement */ + || kind === 233 /* ForOfStatement */ + || kind === 231 /* ForStatement */ + || kind === 228 /* IfStatement */ + || kind === 239 /* LabeledStatement */ + || kind === 236 /* ReturnStatement */ + || kind === 238 /* SwitchStatement */ + || kind === 240 /* ThrowStatement */ + || kind === 241 /* TryStatement */ + || kind === 226 /* VariableStatement */ + || kind === 230 /* WhileStatement */ + || kind === 237 /* WithStatement */ + || kind === 326 /* NotEmittedStatement */ + || kind === 330 /* EndOfDeclarationMarker */ + || kind === 329 /* MergeDeclarationMarker */; } /* @internal */ function isDeclaration(node) { - if (node.kind === 155 /* TypeParameter */) { - return (node.parent && node.parent.kind !== 321 /* JSDocTemplateTag */) || ts.isInJSFile(node); + if (node.kind === 156 /* TypeParameter */) { + return (node.parent && node.parent.kind !== 322 /* JSDocTemplateTag */) || ts.isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -12612,10 +12674,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 223 /* Block */) + if (node.kind !== 224 /* Block */) return false; if (node.parent !== undefined) { - if (node.parent.kind === 240 /* TryStatement */ || node.parent.kind === 280 /* CatchClause */) { + if (node.parent.kind === 241 /* TryStatement */ || node.parent.kind === 281 /* CatchClause */) { return false; } } @@ -12625,8 +12687,8 @@ var ts; /* @internal */ function isModuleReference(node) { var kind = node.kind; - return kind === 265 /* ExternalModuleReference */ - || kind === 153 /* QualifiedName */ + return kind === 266 /* ExternalModuleReference */ + || kind === 154 /* QualifiedName */ || kind === 75 /* Identifier */; } ts.isModuleReference = isModuleReference; @@ -12636,70 +12698,70 @@ var ts; var kind = node.kind; return kind === 104 /* ThisKeyword */ || kind === 75 /* Identifier */ - || kind === 194 /* PropertyAccessExpression */; + || kind === 195 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; /* @internal */ function isJsxChild(node) { var kind = node.kind; - return kind === 266 /* JsxElement */ - || kind === 276 /* JsxExpression */ - || kind === 267 /* JsxSelfClosingElement */ + return kind === 267 /* JsxElement */ + || kind === 277 /* JsxExpression */ + || kind === 268 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ - || kind === 270 /* JsxFragment */; + || kind === 271 /* JsxFragment */; } ts.isJsxChild = isJsxChild; /* @internal */ function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 273 /* JsxAttribute */ - || kind === 275 /* JsxSpreadAttribute */; + return kind === 274 /* JsxAttribute */ + || kind === 276 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; /* @internal */ function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 10 /* StringLiteral */ - || kind === 276 /* JsxExpression */; + || kind === 277 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 268 /* JsxOpeningElement */ - || kind === 267 /* JsxSelfClosingElement */; + return kind === 269 /* JsxOpeningElement */ + || kind === 268 /* JsxSelfClosingElement */; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 277 /* CaseClause */ - || kind === 278 /* DefaultClause */; + return kind === 278 /* CaseClause */ + || kind === 279 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; // JSDoc /** True if node is of some JSDoc syntax kind. */ /* @internal */ function isJSDocNode(node) { - return node.kind >= 294 /* FirstJSDocNode */ && node.kind <= 323 /* LastJSDocNode */; + return node.kind >= 295 /* FirstJSDocNode */ && node.kind <= 324 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node) { - return node.kind === 303 /* JSDocComment */ || node.kind === 302 /* JSDocNamepathType */ || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); + return node.kind === 304 /* JSDocComment */ || node.kind === 303 /* JSDocNamepathType */ || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; // TODO: determine what this does before making it public. /* @internal */ function isJSDocTag(node) { - return node.kind >= 306 /* FirstJSDocTagNode */ && node.kind <= 323 /* LastJSDocTagNode */; + return node.kind >= 307 /* FirstJSDocTagNode */ && node.kind <= 324 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 164 /* SetAccessor */; + return node.kind === 165 /* SetAccessor */; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 163 /* GetAccessor */; + return node.kind === 164 /* GetAccessor */; } ts.isGetAccessor = isGetAccessor; /** True if has jsdoc nodes attached to it. */ @@ -12725,13 +12787,13 @@ var ts; /** True if has initializer node attached to it. */ function hasOnlyExpressionInitializer(node) { switch (node.kind) { - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 191 /* BindingElement */: - case 158 /* PropertySignature */: - case 159 /* PropertyDeclaration */: - case 281 /* PropertyAssignment */: - case 284 /* EnumMember */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 192 /* BindingElement */: + case 159 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 282 /* PropertyAssignment */: + case 285 /* EnumMember */: return true; default: return false; @@ -12739,12 +12801,12 @@ var ts; } ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; function isObjectLiteralElement(node) { - return node.kind === 273 /* JsxAttribute */ || node.kind === 275 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); + return node.kind === 274 /* JsxAttribute */ || node.kind === 276 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); } ts.isObjectLiteralElement = isObjectLiteralElement; /* @internal */ function isTypeReferenceType(node) { - return node.kind === 169 /* TypeReference */ || node.kind === 216 /* ExpressionWithTypeArguments */; + return node.kind === 170 /* TypeReference */ || node.kind === 217 /* ExpressionWithTypeArguments */; } ts.isTypeReferenceType = isTypeReferenceType; var MAX_SMI_X86 = 1073741823; @@ -13038,7 +13100,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 290 /* SourceFile */) { + while (node && node.kind !== 291 /* SourceFile */) { node = node.parent; } return node; @@ -13046,11 +13108,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 223 /* Block */: - case 251 /* CaseBlock */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 224 /* Block */: + case 252 /* CaseBlock */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: return true; } return false; @@ -13202,6 +13264,33 @@ var ts; text.charCodeAt(start + 2) === 33 /* exclamation */; } ts.isPinnedComment = isPinnedComment; + function createCommentDirectivesMap(sourceFile, commentDirectives) { + var directivesByLine = ts.createMapFromEntries(commentDirectives.map(function (commentDirective) { return ([ + "" + ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.pos).line, + commentDirective, + ]); })); + var usedLines = ts.createMap(); + return { getUnusedExpectations: getUnusedExpectations, markUsed: markUsed }; + function getUnusedExpectations() { + return ts.arrayFrom(directivesByLine.entries()) + .filter(function (_a) { + var line = _a[0], directive = _a[1]; + return directive.type === 0 /* ExpectError */ && !usedLines.get(line); + }) + .map(function (_a) { + var _ = _a[0], directive = _a[1]; + return directive; + }); + } + function markUsed(line) { + if (!directivesByLine.has("" + line)) { + return false; + } + usedLines.set("" + line, true); + return true; + } + } + ts.createCommentDirectivesMap = createCommentDirectivesMap; function getTokenPosOfNode(node, sourceFile, includeJsDoc) { // With nodes that have no width (i.e. 'Missing' nodes), we actually *don't* // want to skip trivia because this will launch us forward to the next token. @@ -13218,7 +13307,7 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 324 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 325 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -13343,7 +13432,7 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 242 /* VariableDeclaration */ && node.parent.kind === 280 /* CatchClause */; + return node.kind === 243 /* VariableDeclaration */ && node.parent.kind === 281 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { @@ -13375,11 +13464,11 @@ var ts; ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { // The only kind of module that can be missing a body is a shorthand ambient module. - return node && node.kind === 249 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 250 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 290 /* SourceFile */ || - node.kind === 249 /* ModuleDeclaration */ || + return node.kind === 291 /* SourceFile */ || + node.kind === 250 /* ModuleDeclaration */ || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -13396,9 +13485,9 @@ var ts; // - defined in the top level scope and source file is an external module // - defined inside ambient module declaration located in the top level scope and source file not an external module switch (node.parent.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: return ts.isExternalModule(node.parent); - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -13451,22 +13540,22 @@ var ts; ts.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile; function isBlockScope(node, parentNode) { switch (node.kind) { - case 290 /* SourceFile */: - case 251 /* CaseBlock */: - case 280 /* CatchClause */: - case 249 /* ModuleDeclaration */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 291 /* SourceFile */: + case 252 /* CaseBlock */: + case 281 /* CatchClause */: + case 250 /* ModuleDeclaration */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return true; - case 223 /* Block */: + case 224 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return !ts.isFunctionLike(parentNode); @@ -13476,9 +13565,9 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: - case 305 /* JSDocSignature */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: + case 306 /* JSDocSignature */: return true; default: ts.assertType(node); @@ -13488,25 +13577,25 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isDeclarationWithTypeParameterChildren(node) { switch (node.kind) { - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 160 /* MethodSignature */: - case 167 /* IndexSignature */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 300 /* JSDocFunctionType */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 321 /* JSDocTemplateTag */: - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 161 /* MethodSignature */: + case 168 /* IndexSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 301 /* JSDocFunctionType */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 322 /* JSDocTemplateTag */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return true; default: ts.assertType(node); @@ -13516,8 +13605,8 @@ var ts; ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren; function isAnyImportSyntax(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: return true; default: return false; @@ -13526,15 +13615,15 @@ var ts; ts.isAnyImportSyntax = isAnyImportSyntax; function isLateVisibilityPaintedStatement(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 225 /* VariableStatement */: - case 245 /* ClassDeclaration */: - case 244 /* FunctionDeclaration */: - case 249 /* ModuleDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 226 /* VariableStatement */: + case 246 /* ClassDeclaration */: + case 245 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: return true; default: return false; @@ -13571,7 +13660,7 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: if (isStringOrNumericLiteralLike(name.expression)) return ts.escapeLeadingUnderscores(name.expression.text); return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames"); @@ -13587,9 +13676,9 @@ var ts; case 76 /* PrivateIdentifier */: case 75 /* Identifier */: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: if (ts.isIdentifier(name.name) || ts.isPrivateIdentifier(name.name)) { return entityNameToString(name.expression) + "." + entityNameToString(name.name); } @@ -13630,6 +13719,17 @@ var ts; }; } ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; + function createDiagnosticForRange(sourceFile, range, message) { + return { + file: sourceFile, + start: range.pos, + length: range.end - range.pos, + code: message.code, + category: message.category, + messageText: message.message, + }; + } + ts.createDiagnosticForRange = createDiagnosticForRange; function getSpanOfTokenAtPosition(sourceFile, pos) { var scanner = ts.createScanner(sourceFile.languageVersion, /*skipTrivia*/ true, sourceFile.languageVariant, sourceFile.text, /*onError:*/ undefined, pos); scanner.scan(); @@ -13639,7 +13739,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 223 /* Block */) { + if (node.body && node.body.kind === 224 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -13653,7 +13753,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -13662,28 +13762,28 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 242 /* VariableDeclaration */: - case 191 /* BindingElement */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 247 /* TypeAliasDeclaration */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 243 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 248 /* TypeAliasDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: errorNode = node.name; break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: var start = ts.skipTrivia(sourceFile.text, node.pos); var end = node.statements.length > 0 ? node.statements[0].pos : node.end; return ts.createTextSpanFromBounds(start, end); @@ -13735,11 +13835,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 196 /* CallExpression */ && n.expression.kind === 102 /* SuperKeyword */; + return n.kind === 197 /* CallExpression */ && n.expression.kind === 102 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 196 /* CallExpression */ && n.expression.kind === 96 /* ImportKeyword */; + return n.kind === 197 /* CallExpression */ && n.expression.kind === 96 /* ImportKeyword */; } ts.isImportCall = isImportCall; function isImportMeta(n) { @@ -13753,7 +13853,7 @@ var ts; } ts.isLiteralImportTypeNode = isLiteralImportTypeNode; function isPrologueDirective(node) { - return node.kind === 226 /* ExpressionStatement */ + return node.kind === 227 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -13762,11 +13862,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 156 /* Parameter */ || - node.kind === 155 /* TypeParameter */ || - node.kind === 201 /* FunctionExpression */ || - node.kind === 202 /* ArrowFunction */ || - node.kind === 200 /* ParenthesizedExpression */) ? + var commentRanges = (node.kind === 157 /* Parameter */ || + node.kind === 156 /* TypeParameter */ || + node.kind === 202 /* FunctionExpression */ || + node.kind === 203 /* ArrowFunction */ || + node.kind === 201 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' @@ -13782,48 +13882,48 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (168 /* FirstTypeNode */ <= node.kind && node.kind <= 188 /* LastTypeNode */) { + if (169 /* FirstTypeNode */ <= node.kind && node.kind <= 189 /* LastTypeNode */) { return true; } switch (node.kind) { case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 143 /* StringKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: - case 141 /* ObjectKeyword */: - case 146 /* UndefinedKeyword */: - case 137 /* NeverKeyword */: + case 149 /* UnknownKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 144 /* StringKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: + case 142 /* ObjectKeyword */: + case 147 /* UndefinedKeyword */: + case 138 /* NeverKeyword */: return true; case 110 /* VoidKeyword */: - return node.parent.kind !== 205 /* VoidExpression */; - case 216 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 206 /* VoidExpression */; + case 217 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); - case 155 /* TypeParameter */: - return node.parent.kind === 186 /* MappedType */ || node.parent.kind === 181 /* InferType */; + case 156 /* TypeParameter */: + return node.parent.kind === 187 /* MappedType */ || node.parent.kind === 182 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 75 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 153 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 154 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 75 /* Identifier */ || node.kind === 153 /* QualifiedName */ || node.kind === 194 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + ts.Debug.assert(node.kind === 75 /* Identifier */ || node.kind === 154 /* QualifiedName */ || node.kind === 195 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 153 /* QualifiedName */: - case 194 /* PropertyAccessExpression */: + case 154 /* QualifiedName */: + case 195 /* PropertyAccessExpression */: case 104 /* ThisKeyword */: { var parent = node.parent; - if (parent.kind === 172 /* TypeQuery */) { + if (parent.kind === 173 /* TypeQuery */) { return false; } - if (parent.kind === 188 /* ImportType */) { + if (parent.kind === 189 /* ImportType */) { return !parent.isTypeOf; } // Do not recursively call isPartOfTypeNode on the parent. In the example: @@ -13832,40 +13932,40 @@ var ts; // // Calling isPartOfTypeNode would consider the qualified name A.B a type node. // Only C and A.B.C are type nodes. - if (168 /* FirstTypeNode */ <= parent.kind && parent.kind <= 188 /* LastTypeNode */) { + if (169 /* FirstTypeNode */ <= parent.kind && parent.kind <= 189 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return node === parent.constraint; - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return node === parent.constraint; - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 156 /* Parameter */: - case 242 /* VariableDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 157 /* Parameter */: + case 243 /* VariableDeclaration */: return node === parent.type; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return node === parent.type; - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: return node === parent.type; - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: return node === parent.type; - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: return ts.contains(parent.typeArguments, node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -13890,23 +13990,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitor(node); - case 251 /* CaseBlock */: - case 223 /* Block */: - case 227 /* IfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 236 /* WithStatement */: - case 237 /* SwitchStatement */: - case 277 /* CaseClause */: - case 278 /* DefaultClause */: - case 238 /* LabeledStatement */: - case 240 /* TryStatement */: - case 280 /* CatchClause */: + case 252 /* CaseBlock */: + case 224 /* Block */: + case 228 /* IfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 237 /* WithStatement */: + case 238 /* SwitchStatement */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: + case 239 /* LabeledStatement */: + case 241 /* TryStatement */: + case 281 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -13916,23 +14016,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 248 /* EnumDeclaration */: - case 246 /* InterfaceDeclaration */: - case 249 /* ModuleDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: + case 247 /* InterfaceDeclaration */: + case 250 /* ModuleDeclaration */: + case 248 /* TypeAliasDeclaration */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, skip them to avoid the work. return; default: if (ts.isFunctionLike(node)) { - if (node.name && node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 155 /* ComputedPropertyName */) { // Note that we will not include methods/accessors of a class because they would require // first descending into the class. This is by design. traverse(node.name.expression); @@ -13955,10 +14055,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 174 /* ArrayType */) { + if (node && node.kind === 175 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 169 /* TypeReference */) { + else if (node && node.kind === 170 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -13968,12 +14068,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 246 /* InterfaceDeclaration */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 173 /* TypeLiteral */: + case 247 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 174 /* TypeLiteral */: return node.members; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return node.properties; } } @@ -13981,14 +14081,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 191 /* BindingElement */: - case 284 /* EnumMember */: - case 156 /* Parameter */: - case 281 /* PropertyAssignment */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 282 /* ShorthandPropertyAssignment */: - case 242 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 285 /* EnumMember */: + case 157 /* Parameter */: + case 282 /* PropertyAssignment */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 283 /* ShorthandPropertyAssignment */: + case 243 /* VariableDeclaration */: return true; } } @@ -14000,8 +14100,8 @@ var ts; } ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 243 /* VariableDeclarationList */ - && node.parent.parent.kind === 225 /* VariableStatement */; + return node.parent.kind === 244 /* VariableDeclarationList */ + && node.parent.parent.kind === 226 /* VariableStatement */; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -14012,13 +14112,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return true; } return false; @@ -14029,7 +14129,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 238 /* LabeledStatement */) { + if (node.statement.kind !== 239 /* LabeledStatement */) { return node.statement; } node = node.statement; @@ -14037,17 +14137,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 223 /* Block */ && ts.isFunctionLike(node.parent); + return node && node.kind === 224 /* Block */ && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 161 /* MethodDeclaration */ && node.parent.kind === 193 /* ObjectLiteralExpression */; + return node && node.kind === 162 /* MethodDeclaration */ && node.parent.kind === 194 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 161 /* MethodDeclaration */ && - (node.parent.kind === 193 /* ObjectLiteralExpression */ || - node.parent.kind === 214 /* ClassExpression */); + return node.kind === 162 /* MethodDeclaration */ && + (node.parent.kind === 194 /* ObjectLiteralExpression */ || + node.parent.kind === 215 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -14060,7 +14160,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return objectLiteral.properties.filter(function (property) { - if (property.kind === 281 /* PropertyAssignment */) { + if (property.kind === 282 /* PropertyAssignment */) { var propName = getTextOfPropertyName(property.name); return key === propName || (!!key2 && key2 === propName); } @@ -14101,14 +14201,14 @@ var ts; } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { - ts.Debug.assert(node.kind !== 290 /* SourceFile */); + ts.Debug.assert(node.kind !== 291 /* SourceFile */); while (true) { node = node.parent; if (!node) { return ts.Debug.fail(); // If we never pass in a SourceFile, this should be unreachable, since we'll stop when we reach that. } switch (node.kind) { - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: // If the grandparent node is an object literal (as opposed to a class), // then the computed property is not a 'this' container. // A computed property name in a class needs to be a this container @@ -14123,9 +14223,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 157 /* Decorator */: + case 158 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 156 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 157 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -14136,26 +14236,26 @@ var ts; node = node.parent; } break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 249 /* ModuleDeclaration */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 248 /* EnumDeclaration */: - case 290 /* SourceFile */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 250 /* ModuleDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 249 /* EnumDeclaration */: + case 291 /* SourceFile */: return node; } } @@ -14165,9 +14265,9 @@ var ts; var container = getThisContainer(node, /*includeArrowFunctions*/ false); if (container) { switch (container.kind) { - case 162 /* Constructor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 163 /* Constructor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return container; } } @@ -14189,27 +14289,27 @@ var ts; return node; } switch (node.kind) { - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: node = node.parent; break; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return node; - case 157 /* Decorator */: + case 158 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 156 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 157 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -14225,14 +14325,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 201 /* FunctionExpression */ || func.kind === 202 /* ArrowFunction */) { + if (func.kind === 202 /* FunctionExpression */ || func.kind === 203 /* ArrowFunction */) { var prev = func; var parent = func.parent; - while (parent.kind === 200 /* ParenthesizedExpression */) { + while (parent.kind === 201 /* ParenthesizedExpression */) { prev = parent; parent = parent.parent; } - if (parent.kind === 196 /* CallExpression */ && parent.expression === prev) { + if (parent.kind === 197 /* CallExpression */ && parent.expression === prev) { return parent; } } @@ -14248,7 +14348,7 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 194 /* PropertyAccessExpression */ || kind === 195 /* ElementAccessExpression */) + return (kind === 195 /* PropertyAccessExpression */ || kind === 196 /* ElementAccessExpression */) && node.expression.kind === 102 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; @@ -14257,20 +14357,20 @@ var ts; */ function isThisProperty(node) { var kind = node.kind; - return (kind === 194 /* PropertyAccessExpression */ || kind === 195 /* ElementAccessExpression */) + return (kind === 195 /* PropertyAccessExpression */ || kind === 196 /* ElementAccessExpression */) && node.expression.kind === 104 /* ThisKeyword */; } ts.isThisProperty = isThisProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return node.typeName; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 75 /* Identifier */: - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return node; } return undefined; @@ -14278,10 +14378,10 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { switch (node.kind) { - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return node.tag; - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: return node.tagName; default: return node.expression; @@ -14294,25 +14394,25 @@ var ts; return false; } switch (node.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: // classes are valid targets return true; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return parent.kind === 245 /* ClassDeclaration */; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 161 /* MethodDeclaration */: + return parent.kind === 246 /* ClassDeclaration */; + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 162 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && parent.kind === 245 /* ClassDeclaration */; - case 156 /* Parameter */: + && parent.kind === 246 /* ClassDeclaration */; + case 157 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return parent.body !== undefined - && (parent.kind === 162 /* Constructor */ - || parent.kind === 161 /* MethodDeclaration */ - || parent.kind === 164 /* SetAccessor */) - && grandparent.kind === 245 /* ClassDeclaration */; + && (parent.kind === 163 /* Constructor */ + || parent.kind === 162 /* MethodDeclaration */ + || parent.kind === 165 /* SetAccessor */) + && grandparent.kind === 246 /* ClassDeclaration */; } return false; } @@ -14328,10 +14428,10 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); // TODO: GH#18217 - case 161 /* MethodDeclaration */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 165 /* SetAccessor */: return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); // TODO: GH#18217 default: return false; @@ -14340,9 +14440,9 @@ var ts; ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 268 /* JsxOpeningElement */ || - parent.kind === 267 /* JsxSelfClosingElement */ || - parent.kind === 269 /* JsxClosingElement */) { + if (parent.kind === 269 /* JsxOpeningElement */ || + parent.kind === 268 /* JsxSelfClosingElement */ || + parent.kind === 270 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -14355,44 +14455,44 @@ var ts; case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: case 13 /* RegularExpressionLiteral */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 198 /* TaggedTemplateExpression */: - case 217 /* AsExpression */: - case 199 /* TypeAssertionExpression */: - case 218 /* NonNullExpression */: - case 200 /* ParenthesizedExpression */: - case 201 /* FunctionExpression */: - case 214 /* ClassExpression */: - case 202 /* ArrowFunction */: - case 205 /* VoidExpression */: - case 203 /* DeleteExpression */: - case 204 /* TypeOfExpression */: - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: - case 209 /* BinaryExpression */: - case 210 /* ConditionalExpression */: - case 213 /* SpreadElement */: - case 211 /* TemplateExpression */: - case 215 /* OmittedExpression */: - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 270 /* JsxFragment */: - case 212 /* YieldExpression */: - case 206 /* AwaitExpression */: - case 219 /* MetaProperty */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 199 /* TaggedTemplateExpression */: + case 218 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 219 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: + case 202 /* FunctionExpression */: + case 215 /* ClassExpression */: + case 203 /* ArrowFunction */: + case 206 /* VoidExpression */: + case 204 /* DeleteExpression */: + case 205 /* TypeOfExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: + case 210 /* BinaryExpression */: + case 211 /* ConditionalExpression */: + case 214 /* SpreadElement */: + case 212 /* TemplateExpression */: + case 216 /* OmittedExpression */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 271 /* JsxFragment */: + case 213 /* YieldExpression */: + case 207 /* AwaitExpression */: + case 220 /* MetaProperty */: return true; - case 153 /* QualifiedName */: - while (node.parent.kind === 153 /* QualifiedName */) { + case 154 /* QualifiedName */: + while (node.parent.kind === 154 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 172 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 173 /* TypeQuery */ || isJSXTagName(node); case 75 /* Identifier */: - if (node.parent.kind === 172 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 173 /* TypeQuery */ || isJSXTagName(node)) { return true; } // falls through @@ -14410,49 +14510,49 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 284 /* EnumMember */: - case 281 /* PropertyAssignment */: - case 191 /* BindingElement */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 285 /* EnumMember */: + case 282 /* PropertyAssignment */: + case 192 /* BindingElement */: return parent.initializer === node; - case 226 /* ExpressionStatement */: - case 227 /* IfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 235 /* ReturnStatement */: - case 236 /* WithStatement */: - case 237 /* SwitchStatement */: - case 277 /* CaseClause */: - case 239 /* ThrowStatement */: + case 227 /* ExpressionStatement */: + case 228 /* IfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 236 /* ReturnStatement */: + case 237 /* WithStatement */: + case 238 /* SwitchStatement */: + case 278 /* CaseClause */: + case 240 /* ThrowStatement */: return parent.expression === node; - case 230 /* ForStatement */: + case 231 /* ForStatement */: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 243 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 244 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 243 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 244 /* VariableDeclarationList */) || forInStatement.expression === node; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: return node === parent.expression; - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return node === parent.expression; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return node === parent.expression; - case 157 /* Decorator */: - case 276 /* JsxExpression */: - case 275 /* JsxSpreadAttribute */: - case 283 /* SpreadAssignment */: + case 158 /* Decorator */: + case 277 /* JsxExpression */: + case 276 /* JsxSpreadAttribute */: + case 284 /* SpreadAssignment */: return true; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return parent.objectAssignmentInitializer === node; default: return isExpressionNode(parent); @@ -14460,14 +14560,14 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isPartOfTypeQuery(node) { - while (node.kind === 153 /* QualifiedName */ || node.kind === 75 /* Identifier */) { + while (node.kind === 154 /* QualifiedName */ || node.kind === 75 /* Identifier */) { node = node.parent; } - return node.kind === 172 /* TypeQuery */; + return node.kind === 173 /* TypeQuery */; } ts.isPartOfTypeQuery = isPartOfTypeQuery; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 265 /* ExternalModuleReference */; + return node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 266 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -14476,7 +14576,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 265 /* ExternalModuleReference */; + return node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 266 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJS(file) { @@ -14508,11 +14608,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 143 /* StringKeyword */ || node.typeArguments[0].kind === 140 /* NumberKeyword */); + (node.typeArguments[0].kind === 144 /* StringKeyword */ || node.typeArguments[0].kind === 141 /* NumberKeyword */); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, requireStringLiteralLikeArgument) { - if (callExpression.kind !== 196 /* CallExpression */) { + if (callExpression.kind !== 197 /* CallExpression */) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -14644,11 +14744,11 @@ var ts; function getExpandoInitializer(initializer, isPrototypeAssignment) { if (ts.isCallExpression(initializer)) { var e = skipParentheses(initializer.expression); - return e.kind === 201 /* FunctionExpression */ || e.kind === 202 /* ArrowFunction */ ? initializer : undefined; + return e.kind === 202 /* FunctionExpression */ || e.kind === 203 /* ArrowFunction */ ? initializer : undefined; } - if (initializer.kind === 201 /* FunctionExpression */ || - initializer.kind === 214 /* ClassExpression */ || - initializer.kind === 202 /* ArrowFunction */) { + if (initializer.kind === 202 /* FunctionExpression */ || + initializer.kind === 215 /* ClassExpression */ || + initializer.kind === 203 /* ArrowFunction */) { return initializer; } if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -14874,7 +14974,7 @@ var ts; // exports.name = expr OR module.exports.name = expr OR exports["name"] = expr ... return 1 /* ExportsProperty */; } - if (isBindableStaticNameExpression(lhs, /*excludeThisKeyword*/ true) || (ts.isElementAccessExpression(lhs) && isDynamicName(lhs) && lhs.expression.kind !== 104 /* ThisKeyword */)) { + if (isBindableStaticNameExpression(lhs, /*excludeThisKeyword*/ true) || (ts.isElementAccessExpression(lhs) && isDynamicName(lhs))) { // F.G...x = expr return 5 /* Property */; } @@ -14895,7 +14995,7 @@ var ts; ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment; function isSpecialPropertyDeclaration(expr) { return isInJSFile(expr) && - expr.parent && expr.parent.kind === 226 /* ExpressionStatement */ && + expr.parent && expr.parent.kind === 227 /* ExpressionStatement */ && (!ts.isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!ts.getJSDocTypeTag(expr.parent); } @@ -14905,7 +15005,7 @@ var ts; return false; } var decl = symbol.valueDeclaration; - return decl.kind === 244 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); + return decl.kind === 245 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); } ts.isFunctionSymbol = isFunctionSymbol; function importFromModuleSpecifier(node) { @@ -14914,14 +15014,14 @@ var ts; ts.importFromModuleSpecifier = importFromModuleSpecifier; function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: return node.parent; - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: return node.parent.parent; - case 196 /* CallExpression */: + case 197 /* CallExpression */: return isImportCall(node.parent) || isRequireCall(node.parent, /*checkArg*/ false) ? node.parent : undefined; - case 187 /* LiteralType */: + case 188 /* LiteralType */: ts.Debug.assert(ts.isStringLiteral(node)); return ts.tryCast(node.parent.parent, ts.isImportTypeNode); default: @@ -14931,12 +15031,12 @@ var ts; ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier; function getExternalModuleName(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: return node.moduleSpecifier; - case 253 /* ImportEqualsDeclaration */: - return node.moduleReference.kind === 265 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; - case 188 /* ImportType */: + case 254 /* ImportEqualsDeclaration */: + return node.moduleReference.kind === 266 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; + case 189 /* ImportType */: return isLiteralImportTypeNode(node) ? node.argument.literal : undefined; default: return ts.Debug.assertNever(node); @@ -14945,11 +15045,11 @@ var ts; ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return node; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return node.exportClause && ts.tryCast(node.exportClause, ts.isNamespaceExport); default: return ts.Debug.assertNever(node); @@ -14957,7 +15057,7 @@ var ts; } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 254 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; + return node.kind === 255 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function forEachImportClauseDeclaration(node, action) { @@ -14978,13 +15078,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 156 /* Parameter */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 282 /* ShorthandPropertyAssignment */: - case 281 /* PropertyAssignment */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 157 /* Parameter */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 283 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -14998,7 +15098,7 @@ var ts; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function isJSDocTypeAlias(node) { - return node.kind === 322 /* JSDocTypedefTag */ || node.kind === 315 /* JSDocCallbackTag */ || node.kind === 316 /* JSDocEnumTag */; + return node.kind === 323 /* JSDocTypedefTag */ || node.kind === 316 /* JSDocCallbackTag */ || node.kind === 317 /* JSDocEnumTag */; } ts.isJSDocTypeAlias = isJSDocTypeAlias; function isTypeAlias(node) { @@ -15023,12 +15123,12 @@ var ts; } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: var v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return node.initializer; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return node.initializer; } } @@ -15039,7 +15139,7 @@ var ts; function getNestedModuleDeclaration(node) { return ts.isModuleDeclaration(node) && node.body && - node.body.kind === 249 /* ModuleDeclaration */ + node.body.kind === 250 /* ModuleDeclaration */ ? node.body : undefined; } @@ -15054,11 +15154,11 @@ var ts; if (ts.hasJSDocNodes(node)) { result = ts.append(result, ts.last(node.jsDoc)); } - if (node.kind === 156 /* Parameter */) { + if (node.kind === 157 /* Parameter */) { result = ts.addRange(result, ts.getJSDocParameterTags(node)); break; } - if (node.kind === 155 /* TypeParameter */) { + if (node.kind === 156 /* TypeParameter */) { result = ts.addRange(result, ts.getJSDocTypeParameterTags(node)); break; } @@ -15069,10 +15169,10 @@ var ts; ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags; function getNextJSDocCommentLocation(node) { var parent = node.parent; - if (parent.kind === 281 /* PropertyAssignment */ || - parent.kind === 259 /* ExportAssignment */ || - parent.kind === 159 /* PropertyDeclaration */ || - parent.kind === 226 /* ExpressionStatement */ && node.kind === 194 /* PropertyAccessExpression */ || + if (parent.kind === 282 /* PropertyAssignment */ || + parent.kind === 260 /* ExportAssignment */ || + parent.kind === 160 /* PropertyDeclaration */ || + parent.kind === 227 /* ExpressionStatement */ && node.kind === 195 /* PropertyAccessExpression */ || getNestedModuleDeclaration(parent) || ts.isBinaryExpression(node) && node.operatorToken.kind === 62 /* EqualsToken */) { return parent; @@ -15146,7 +15246,7 @@ var ts; ts.hasRestParameter = hasRestParameter; function isRestParameter(node) { var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type; - return node.dotDotDotToken !== undefined || !!type && type.kind === 301 /* JSDocVariadicType */; + return node.dotDotDotToken !== undefined || !!type && type.kind === 302 /* JSDocVariadicType */; } ts.isRestParameter = isRestParameter; function hasTypeArguments(node) { @@ -15163,31 +15263,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 62 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 200 /* ParenthesizedExpression */: - case 192 /* ArrayLiteralExpression */: - case 213 /* SpreadElement */: - case 218 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: + case 193 /* ArrayLiteralExpression */: + case 214 /* SpreadElement */: + case 219 /* NonNullExpression */: node = parent; break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } node = parent.parent; break; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: if (parent.name === node) { return 0 /* None */; } @@ -15214,22 +15314,22 @@ var ts; */ function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 223 /* Block */: - case 225 /* VariableStatement */: - case 236 /* WithStatement */: - case 227 /* IfStatement */: - case 237 /* SwitchStatement */: - case 251 /* CaseBlock */: - case 277 /* CaseClause */: - case 278 /* DefaultClause */: - case 238 /* LabeledStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 240 /* TryStatement */: - case 280 /* CatchClause */: + case 224 /* Block */: + case 226 /* VariableStatement */: + case 237 /* WithStatement */: + case 228 /* IfStatement */: + case 238 /* SwitchStatement */: + case 252 /* CaseBlock */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: + case 239 /* LabeledStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 241 /* TryStatement */: + case 281 /* CatchClause */: return true; } return false; @@ -15246,33 +15346,33 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 182 /* ParenthesizedType */); + return walkUp(node, 183 /* ParenthesizedType */); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 200 /* ParenthesizedExpression */); + return walkUp(node, 201 /* ParenthesizedExpression */); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; function skipParentheses(node) { - while (node.kind === 200 /* ParenthesizedExpression */) { + while (node.kind === 201 /* ParenthesizedExpression */) { node = node.expression; } return node; } ts.skipParentheses = skipParentheses; function skipParenthesesUp(node) { - while (node.kind === 200 /* ParenthesizedExpression */) { + while (node.kind === 201 /* ParenthesizedExpression */) { node = node.parent; } return node; } // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped function isDeleteTarget(node) { - if (node.kind !== 194 /* PropertyAccessExpression */ && node.kind !== 195 /* ElementAccessExpression */) { + if (node.kind !== 195 /* PropertyAccessExpression */ && node.kind !== 196 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 203 /* DeleteExpression */; + return node && node.kind === 204 /* DeleteExpression */; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -15325,7 +15425,7 @@ var ts; ts.getDeclarationFromName = getDeclarationFromName; function isLiteralComputedPropertyDeclarationName(node) { return isStringOrNumericLiteralLike(node) && - node.parent.kind === 154 /* ComputedPropertyName */ && + node.parent.kind === 155 /* ComputedPropertyName */ && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -15333,32 +15433,32 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 284 /* EnumMember */: - case 281 /* PropertyAssignment */: - case 194 /* PropertyAccessExpression */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 285 /* EnumMember */: + case 282 /* PropertyAssignment */: + case 195 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: // Name on right hand side of dot in a type query or type reference if (parent.right === node) { - while (parent.kind === 153 /* QualifiedName */) { + while (parent.kind === 154 /* QualifiedName */) { parent = parent.parent; } - return parent.kind === 172 /* TypeQuery */ || parent.kind === 169 /* TypeReference */; + return parent.kind === 173 /* TypeQuery */ || parent.kind === 170 /* TypeReference */; } return false; - case 191 /* BindingElement */: - case 258 /* ImportSpecifier */: + case 192 /* BindingElement */: + case 259 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 263 /* ExportSpecifier */: - case 273 /* JsxAttribute */: + case 264 /* ExportSpecifier */: + case 274 /* JsxAttribute */: // Any name in an export specifier or JSX Attribute return true; } @@ -15378,33 +15478,33 @@ var ts; // {} // {name: } function isAliasSymbolDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */ || - node.kind === 252 /* NamespaceExportDeclaration */ || - node.kind === 255 /* ImportClause */ && !!node.name || - node.kind === 256 /* NamespaceImport */ || - node.kind === 262 /* NamespaceExport */ || - node.kind === 258 /* ImportSpecifier */ || - node.kind === 263 /* ExportSpecifier */ || - node.kind === 259 /* ExportAssignment */ && exportAssignmentIsAlias(node) || + return node.kind === 254 /* ImportEqualsDeclaration */ || + node.kind === 253 /* NamespaceExportDeclaration */ || + node.kind === 256 /* ImportClause */ && !!node.name || + node.kind === 257 /* NamespaceImport */ || + node.kind === 263 /* NamespaceExport */ || + node.kind === 259 /* ImportSpecifier */ || + node.kind === 264 /* ExportSpecifier */ || + node.kind === 260 /* ExportAssignment */ && exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableExpression(node.parent.right) || - node.kind === 282 /* ShorthandPropertyAssignment */ || - node.kind === 281 /* PropertyAssignment */ && isAliasableExpression(node.initializer); + node.kind === 283 /* ShorthandPropertyAssignment */ || + node.kind === 282 /* PropertyAssignment */ && isAliasableExpression(node.initializer); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getAliasDeclarationFromName(node) { switch (node.parent.kind) { - case 255 /* ImportClause */: - case 258 /* ImportSpecifier */: - case 256 /* NamespaceImport */: - case 263 /* ExportSpecifier */: - case 259 /* ExportAssignment */: - case 253 /* ImportEqualsDeclaration */: + case 256 /* ImportClause */: + case 259 /* ImportSpecifier */: + case 257 /* NamespaceImport */: + case 264 /* ExportSpecifier */: + case 260 /* ExportAssignment */: + case 254 /* ImportEqualsDeclaration */: return node.parent; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: do { node = node.parent; - } while (node.parent.kind === 153 /* QualifiedName */); + } while (node.parent.kind === 154 /* QualifiedName */); return getAliasDeclarationFromName(node); } } @@ -15423,7 +15523,7 @@ var ts; } ts.getExportAssignmentExpression = getExportAssignmentExpression; function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 282 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 281 /* PropertyAssignment */ ? node.initializer : + return node.kind === 283 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 282 /* PropertyAssignment */ ? node.initializer : node.parent.right; } ts.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression; @@ -15489,11 +15589,11 @@ var ts; } ts.getAncestor = getAncestor; function isKeyword(token) { - return 77 /* FirstKeyword */ <= token && token <= 152 /* LastKeyword */; + return 77 /* FirstKeyword */ <= token && token <= 153 /* LastKeyword */; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 122 /* FirstContextualKeyword */ <= token && token <= 152 /* LastContextualKeyword */; + return 122 /* FirstContextualKeyword */ <= token && token <= 153 /* LastContextualKeyword */; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -15537,14 +15637,14 @@ var ts; } var flags = 0 /* Normal */; switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } // falls through - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: if (hasModifier(node, 256 /* Async */)) { flags |= 2 /* Async */; } @@ -15558,10 +15658,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: return node.body !== undefined && node.asteriskToken === undefined && hasModifier(node, 256 /* Async */); @@ -15594,7 +15694,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - if (!(name.kind === 154 /* ComputedPropertyName */ || name.kind === 195 /* ElementAccessExpression */)) { + if (!(name.kind === 155 /* ComputedPropertyName */ || name.kind === 196 /* ElementAccessExpression */)) { return false; } var expr = ts.isElementAccessExpression(name) ? name.argumentExpression : name.expression; @@ -15620,7 +15720,7 @@ var ts; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -15683,11 +15783,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 156 /* Parameter */; + return root.kind === 157 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 191 /* BindingElement */) { + while (node.kind === 192 /* BindingElement */) { node = node.parent.parent; } return node; @@ -15695,15 +15795,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 162 /* Constructor */ - || kind === 201 /* FunctionExpression */ - || kind === 244 /* FunctionDeclaration */ - || kind === 202 /* ArrowFunction */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */ - || kind === 249 /* ModuleDeclaration */ - || kind === 290 /* SourceFile */; + return kind === 163 /* Constructor */ + || kind === 202 /* FunctionExpression */ + || kind === 245 /* FunctionDeclaration */ + || kind === 203 /* ArrowFunction */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */ + || kind === 250 /* ModuleDeclaration */ + || kind === 291 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -15722,23 +15822,23 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 197 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 198 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 197 /* NewExpression */: + case 198 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 207 /* PrefixUnaryExpression */: - case 204 /* TypeOfExpression */: - case 205 /* VoidExpression */: - case 203 /* DeleteExpression */: - case 206 /* AwaitExpression */: - case 210 /* ConditionalExpression */: - case 212 /* YieldExpression */: + case 208 /* PrefixUnaryExpression */: + case 205 /* TypeOfExpression */: + case 206 /* VoidExpression */: + case 204 /* DeleteExpression */: + case 207 /* AwaitExpression */: + case 211 /* ConditionalExpression */: + case 213 /* YieldExpression */: return 1 /* Right */; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (operator) { case 42 /* AsteriskAsteriskToken */: case 62 /* EqualsToken */: @@ -15762,15 +15862,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 197 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 198 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 209 /* BinaryExpression */) { + if (expression.kind === 210 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 207 /* PrefixUnaryExpression */ || expression.kind === 208 /* PostfixUnaryExpression */) { + else if (expression.kind === 208 /* PrefixUnaryExpression */ || expression.kind === 209 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -15780,15 +15880,15 @@ var ts; ts.getOperator = getOperator; function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: return 0; - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return 1; - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return 2; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return 4; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (operatorKind) { case 27 /* CommaToken */: return 0; @@ -15809,21 +15909,21 @@ var ts; default: return getBinaryOperatorPrecedence(operatorKind); } - case 207 /* PrefixUnaryExpression */: - case 204 /* TypeOfExpression */: - case 205 /* VoidExpression */: - case 203 /* DeleteExpression */: - case 206 /* AwaitExpression */: + case 208 /* PrefixUnaryExpression */: + case 205 /* TypeOfExpression */: + case 206 /* VoidExpression */: + case 204 /* DeleteExpression */: + case 207 /* AwaitExpression */: return 16; - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return 17; - case 196 /* CallExpression */: + case 197 /* CallExpression */: return 18; - case 197 /* NewExpression */: + case 198 /* NewExpression */: return hasArguments ? 19 : 18; - case 198 /* TaggedTemplateExpression */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 199 /* TaggedTemplateExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return 19; case 104 /* ThisKeyword */: case 102 /* SuperKeyword */: @@ -15834,19 +15934,19 @@ var ts; case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 214 /* ClassExpression */: - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 270 /* JsxFragment */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 215 /* ClassExpression */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 271 /* JsxFragment */: case 13 /* RegularExpressionLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 211 /* TemplateExpression */: - case 200 /* ParenthesizedExpression */: - case 215 /* OmittedExpression */: + case 212 /* TemplateExpression */: + case 201 /* ParenthesizedExpression */: + case 216 /* OmittedExpression */: return 20; default: return -1; @@ -16448,10 +16548,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 163 /* GetAccessor */) { + if (accessor.kind === 164 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 164 /* SetAccessor */) { + else if (accessor.kind === 165 /* SetAccessor */) { setAccessor = accessor; } else { @@ -16471,10 +16571,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 163 /* GetAccessor */ && !getAccessor) { + if (member.kind === 164 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 164 /* SetAccessor */ && !setAccessor) { + if (member.kind === 165 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -16523,7 +16623,7 @@ var ts; ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations; /** template tags are only available when a typedef isn't already using them */ function isNonTypeAliasTemplate(tag) { - return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 303 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); + return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 304 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); } /** * Gets the effective type annotation of the value parameter of a set accessor. If the node @@ -16747,7 +16847,7 @@ var ts; } ts.getSelectedModifierFlags = getSelectedModifierFlags; function getModifierFlags(node) { - if (node.kind >= 0 /* FirstToken */ && node.kind <= 152 /* LastToken */) { + if (node.kind >= 0 /* FirstToken */ && node.kind <= 153 /* LastToken */) { return 0 /* None */; } if (node.modifierFlagsCache & 536870912 /* HasComputedFlags */) { @@ -16789,11 +16889,11 @@ var ts; case 117 /* PrivateKeyword */: return 8 /* Private */; case 122 /* AbstractKeyword */: return 128 /* Abstract */; case 89 /* ExportKeyword */: return 1 /* Export */; - case 130 /* DeclareKeyword */: return 2 /* Ambient */; + case 131 /* DeclareKeyword */: return 2 /* Ambient */; case 81 /* ConstKeyword */: return 2048 /* Const */; case 84 /* DefaultKeyword */: return 512 /* Default */; case 126 /* AsyncKeyword */: return 256 /* Async */; - case 138 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 139 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } @@ -16833,8 +16933,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 193 /* ObjectLiteralExpression */ - || kind === 192 /* ArrayLiteralExpression */; + return kind === 194 /* ObjectLiteralExpression */ + || kind === 193 /* ArrayLiteralExpression */; } return false; } @@ -16851,12 +16951,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: do { node = node.left; } while (node.kind !== 75 /* Identifier */); return node; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 75 /* Identifier */); @@ -16866,14 +16966,19 @@ var ts; ts.getFirstIdentifier = getFirstIdentifier; function isDottedName(node) { return node.kind === 75 /* Identifier */ || node.kind === 104 /* ThisKeyword */ || node.kind === 102 /* SuperKeyword */ || - node.kind === 194 /* PropertyAccessExpression */ && isDottedName(node.expression) || - node.kind === 200 /* ParenthesizedExpression */ && isDottedName(node.expression); + node.kind === 195 /* PropertyAccessExpression */ && isDottedName(node.expression) || + node.kind === 201 /* ParenthesizedExpression */ && isDottedName(node.expression); } ts.isDottedName = isDottedName; function isPropertyAccessEntityNameExpression(node) { return ts.isPropertyAccessExpression(node) && isEntityNameExpression(node.expression); } ts.isPropertyAccessEntityNameExpression = isPropertyAccessEntityNameExpression; + function isConstructorAccessExpression(expr) { + return (ts.isPropertyAccessExpression(expr) && ts.idText(expr.name) === "constructor" || + ts.isElementAccessExpression(expr) && ts.isStringLiteralLike(expr.argumentExpression) && expr.argumentExpression.text === "constructor"); + } + ts.isConstructorAccessExpression = isConstructorAccessExpression; function tryGetPropertyAccessOrIdentifierToString(expr) { if (ts.isPropertyAccessExpression(expr)) { var baseStr = tryGetPropertyAccessOrIdentifierToString(expr.expression); @@ -16892,17 +16997,17 @@ var ts; } ts.isPrototypeAccess = isPrototypeAccess; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 153 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 154 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 193 /* ObjectLiteralExpression */ && + return expression.kind === 194 /* ObjectLiteralExpression */ && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 192 /* ArrayLiteralExpression */ && + return expression.kind === 193 /* ArrayLiteralExpression */ && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -17200,8 +17305,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 248 /* EnumDeclaration */: - case 249 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 250 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -17278,35 +17383,35 @@ var ts; if (!parent) return 0 /* Read */; switch (parent.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return accessKind(parent); - case 208 /* PostfixUnaryExpression */: - case 207 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: var operator = parent.operator; return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 62 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return parent.name !== node ? 0 /* Read */ : accessKind(parent); - case 281 /* PropertyAssignment */: { + case 282 /* PropertyAssignment */: { var parentAccess = accessKind(parent.parent); // In `({ x: varname }) = { x: 1 }`, the left `x` is a read, the right `x` is a write. return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess; } - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: // Assume it's the local variable being accessed, since we don't check public properties for --noUnusedLocals. return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return accessKind(parent); default: return 0 /* Read */; } function writeOrReadWrite() { // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect. - return parent.parent && skipParenthesesUp(parent.parent).kind === 226 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; + return parent.parent && skipParenthesesUp(parent.parent).kind === 227 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; } } function reverseAccessKind(a) { @@ -17455,39 +17560,39 @@ var ts; } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; function isTypeNodeKind(kind) { - return (kind >= 168 /* FirstTypeNode */ && kind <= 188 /* LastTypeNode */) + return (kind >= 169 /* FirstTypeNode */ && kind <= 189 /* LastTypeNode */) || kind === 125 /* AnyKeyword */ - || kind === 148 /* UnknownKeyword */ - || kind === 140 /* NumberKeyword */ - || kind === 151 /* BigIntKeyword */ - || kind === 141 /* ObjectKeyword */ - || kind === 128 /* BooleanKeyword */ - || kind === 143 /* StringKeyword */ - || kind === 144 /* SymbolKeyword */ + || kind === 149 /* UnknownKeyword */ + || kind === 141 /* NumberKeyword */ + || kind === 152 /* BigIntKeyword */ + || kind === 142 /* ObjectKeyword */ + || kind === 129 /* BooleanKeyword */ + || kind === 144 /* StringKeyword */ + || kind === 145 /* SymbolKeyword */ || kind === 104 /* ThisKeyword */ || kind === 110 /* VoidKeyword */ - || kind === 146 /* UndefinedKeyword */ + || kind === 147 /* UndefinedKeyword */ || kind === 100 /* NullKeyword */ - || kind === 137 /* NeverKeyword */ - || kind === 216 /* ExpressionWithTypeArguments */ - || kind === 295 /* JSDocAllType */ - || kind === 296 /* JSDocUnknownType */ - || kind === 297 /* JSDocNullableType */ - || kind === 298 /* JSDocNonNullableType */ - || kind === 299 /* JSDocOptionalType */ - || kind === 300 /* JSDocFunctionType */ - || kind === 301 /* JSDocVariadicType */; + || kind === 138 /* NeverKeyword */ + || kind === 217 /* ExpressionWithTypeArguments */ + || kind === 296 /* JSDocAllType */ + || kind === 297 /* JSDocUnknownType */ + || kind === 298 /* JSDocNullableType */ + || kind === 299 /* JSDocNonNullableType */ + || kind === 300 /* JSDocOptionalType */ + || kind === 301 /* JSDocFunctionType */ + || kind === 302 /* JSDocVariadicType */; } ts.isTypeNodeKind = isTypeNodeKind; function isAccessExpression(node) { - return node.kind === 194 /* PropertyAccessExpression */ || node.kind === 195 /* ElementAccessExpression */; + return node.kind === 195 /* PropertyAccessExpression */ || node.kind === 196 /* ElementAccessExpression */; } ts.isAccessExpression = isAccessExpression; function getNameOfAccessExpression(node) { - if (node.kind === 194 /* PropertyAccessExpression */) { + if (node.kind === 195 /* PropertyAccessExpression */) { return node.name; } - ts.Debug.assert(node.kind === 195 /* ElementAccessExpression */); + ts.Debug.assert(node.kind === 196 /* ElementAccessExpression */); return node.argumentExpression; } ts.getNameOfAccessExpression = getNameOfAccessExpression; @@ -17501,12 +17606,8 @@ var ts; } } ts.isBundleFileTextLike = isBundleFileTextLike; - function getDotOrQuestionDotToken(node) { - return node.questionDotToken || ts.createNode(24 /* DotToken */, node.expression.end, node.name.pos); - } - ts.getDotOrQuestionDotToken = getDotOrQuestionDotToken; function isNamedImportsOrExports(node) { - return node.kind === 257 /* NamedImports */ || node.kind === 261 /* NamedExports */; + return node.kind === 258 /* NamedImports */ || node.kind === 262 /* NamedExports */; } ts.isNamedImportsOrExports = isNamedImportsOrExports; function Symbol(flags, name) { @@ -18584,34 +18685,44 @@ var ts; function isValidTypeOnlyAliasUseSite(useSite) { return !!(useSite.flags & 8388608 /* Ambient */) || isPartOfTypeQuery(useSite) - || isFirstIdentifierOfNonEmittingHeritageClause(useSite) + || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !isExpressionNode(useSite); } ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite; function typeOnlyDeclarationIsExport(typeOnlyDeclaration) { - return typeOnlyDeclaration.kind === 263 /* ExportSpecifier */; + return typeOnlyDeclaration.kind === 264 /* ExportSpecifier */; } ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport; function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { - while (node.kind === 75 /* Identifier */ || node.kind === 194 /* PropertyAccessExpression */) { + while (node.kind === 75 /* Identifier */ || node.kind === 195 /* PropertyAccessExpression */) { node = node.parent; } - if (node.kind !== 154 /* ComputedPropertyName */) { + if (node.kind !== 155 /* ComputedPropertyName */) { return false; } if (hasModifier(node.parent, 128 /* Abstract */)) { return true; } var containerKind = node.parent.parent.kind; - return containerKind === 246 /* InterfaceDeclaration */ || containerKind === 173 /* TypeLiteral */; + return containerKind === 247 /* InterfaceDeclaration */ || containerKind === 174 /* TypeLiteral */; } - /** Returns true for the first identifier of 1) an `implements` clause, and 2) an `extends` clause of an interface. */ - function isFirstIdentifierOfNonEmittingHeritageClause(node) { - var _a, _b; - // Number of parents to climb from identifier is 2 for `implements I`, 3 for `implements x.I` - var heritageClause = (_a = ts.tryCast(node.parent.parent, ts.isHeritageClause)) !== null && _a !== void 0 ? _a : ts.tryCast((_b = node.parent.parent) === null || _b === void 0 ? void 0 : _b.parent, ts.isHeritageClause); - return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 246 /* InterfaceDeclaration */; + /** Returns true for an identifier in 1) an `implements` clause, and 2) an `extends` clause of an interface. */ + function isIdentifierInNonEmittingHeritageClause(node) { + if (node.kind !== 75 /* Identifier */) + return false; + var heritageClause = findAncestor(node.parent, function (parent) { + switch (parent.kind) { + case 280 /* HeritageClause */: + return true; + case 195 /* PropertyAccessExpression */: + case 217 /* ExpressionWithTypeArguments */: + return false; + default: + return "quit"; + } + }); + return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 247 /* InterfaceDeclaration */; } })(ts || (ts = {})); var ts; @@ -18631,7 +18742,7 @@ var ts; var PrivateIdentifierConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 290 /* SourceFile */) { + if (kind === 291 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 75 /* Identifier */) { @@ -18686,19 +18797,19 @@ var ts; * that they appear in the source code. The language service depends on this property to locate nodes by position. */ function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 152 /* LastToken */) { + if (!node || node.kind <= 153 /* LastToken */) { return; } switch (node.kind) { - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -18706,9 +18817,9 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 156 /* Parameter */: + case 157 /* Parameter */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || @@ -18716,7 +18827,7 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -18724,51 +18835,51 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.initializer); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -18780,359 +18891,359 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return visitNode(cbNode, node.assertsModifier) || visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return visitNodes(cbNode, cbNodes, node.members); - case 174 /* ArrayType */: + case 175 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 175 /* TupleType */: + case 176 /* TupleType */: return visitNodes(cbNode, cbNodes, node.elementTypes); - case 178 /* UnionType */: - case 179 /* IntersectionType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: return visitNodes(cbNode, cbNodes, node.types); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return visitNode(cbNode, node.checkType) || visitNode(cbNode, node.extendsType) || visitNode(cbNode, node.trueType) || visitNode(cbNode, node.falseType); - case 181 /* InferType */: + case 182 /* InferType */: return visitNode(cbNode, node.typeParameter); - case 188 /* ImportType */: + case 189 /* ImportType */: return visitNode(cbNode, node.argument) || visitNode(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 182 /* ParenthesizedType */: - case 184 /* TypeOperator */: + case 183 /* ParenthesizedType */: + case 185 /* TypeOperator */: return visitNode(cbNode, node.type); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 186 /* MappedType */: + case 187 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 187 /* LiteralType */: + case 188 /* LiteralType */: return visitNode(cbNode, node.literal); - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: return visitNodes(cbNode, cbNodes, node.elements); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return visitNodes(cbNode, cbNodes, node.properties); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.name); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.argumentExpression); - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.template); - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 217 /* AsExpression */: + case 218 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return visitNode(cbNode, node.name); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 223 /* Block */: - case 250 /* ModuleBlock */: + case 224 /* Block */: + case 251 /* ModuleBlock */: return visitNodes(cbNode, cbNodes, node.statements); - case 290 /* SourceFile */: + case 291 /* SourceFile */: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return visitNodes(cbNode, cbNodes, node.declarations); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 233 /* ContinueStatement */: - case 234 /* BreakStatement */: + case 234 /* ContinueStatement */: + case 235 /* BreakStatement */: return visitNode(cbNode, node.label); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return visitNodes(cbNode, cbNodes, node.clauses); - case 277 /* CaseClause */: + case 278 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: return visitNodes(cbNode, cbNodes, node.statements); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 157 /* Decorator */: + case 158 /* Decorator */: return visitNode(cbNode, node.expression); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 284 /* EnumMember */: + case 285 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: return visitNode(cbNode, node.name); - case 257 /* NamedImports */: - case 261 /* NamedExports */: + case 258 /* NamedImports */: + case 262 /* NamedExports */: return visitNodes(cbNode, cbNodes, node.elements); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: return visitNodes(cbNode, cbNodes, node.types); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 264 /* MissingDeclaration */: + case 265 /* MissingDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators); - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 266 /* JsxElement */: + case 267 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.attributes); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return visitNodes(cbNode, cbNodes, node.properties); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 275 /* JsxSpreadAttribute */: + case 276 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 176 /* OptionalType */: - case 177 /* RestType */: - case 294 /* JSDocTypeExpression */: - case 298 /* JSDocNonNullableType */: - case 297 /* JSDocNullableType */: - case 299 /* JSDocOptionalType */: - case 301 /* JSDocVariadicType */: + case 177 /* OptionalType */: + case 178 /* RestType */: + case 295 /* JSDocTypeExpression */: + case 299 /* JSDocNonNullableType */: + case 298 /* JSDocNullableType */: + case 300 /* JSDocOptionalType */: + case 302 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 303 /* JSDocComment */: + case 304 /* JSDocComment */: return visitNodes(cbNode, cbNodes, node.tags); - case 317 /* JSDocParameterTag */: - case 323 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: + case 324 /* JSDocPropertyTag */: return visitNode(cbNode, node.tagName) || (node.isNameFirst ? visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression) : visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name)); - case 309 /* JSDocAuthorTag */: + case 310 /* JSDocAuthorTag */: return visitNode(cbNode, node.tagName); - case 308 /* JSDocImplementsTag */: + case 309 /* JSDocImplementsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 307 /* JSDocAugmentsTag */: + case 308 /* JSDocAugmentsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); - case 322 /* JSDocTypedefTag */: + case 323 /* JSDocTypedefTag */: return visitNode(cbNode, node.tagName) || (node.typeExpression && - node.typeExpression.kind === 294 /* JSDocTypeExpression */ + node.typeExpression.kind === 295 /* JSDocTypeExpression */ ? visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) : visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression)); - case 315 /* JSDocCallbackTag */: + case 316 /* JSDocCallbackTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); - case 318 /* JSDocReturnTag */: - case 320 /* JSDocTypeTag */: - case 319 /* JSDocThisTag */: - case 316 /* JSDocEnumTag */: + case 319 /* JSDocReturnTag */: + case 321 /* JSDocTypeTag */: + case 320 /* JSDocThisTag */: + case 317 /* JSDocEnumTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.typeExpression); - case 305 /* JSDocSignature */: + case 306 /* JSDocSignature */: return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); - case 304 /* JSDocTypeLiteral */: + case 305 /* JSDocTypeLiteral */: return ts.forEach(node.jsDocPropertyTags, cbNode); - case 306 /* JSDocTag */: - case 310 /* JSDocClassTag */: - case 311 /* JSDocPublicTag */: - case 312 /* JSDocPrivateTag */: - case 313 /* JSDocProtectedTag */: - case 314 /* JSDocReadonlyTag */: + case 307 /* JSDocTag */: + case 311 /* JSDocClassTag */: + case 312 /* JSDocPublicTag */: + case 313 /* JSDocPrivateTag */: + case 314 /* JSDocProtectedTag */: + case 315 /* JSDocReadonlyTag */: return visitNode(cbNode, node.tagName); - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } } @@ -19421,7 +19532,7 @@ var ts; sourceFile.endOfFileToken = parseTokenNode(); } else { - var statement = createNode(226 /* ExpressionStatement */); + var statement = createNode(227 /* ExpressionStatement */); switch (token()) { case 22 /* OpenBracketToken */: statement.expression = parseArrayLiteralExpression(); @@ -19505,6 +19616,7 @@ var ts; } function clearState() { // Clear out the text the scanner is pointing at, so it doesn't keep anything alive unnecessarily. + scanner.clearCommentDirectives(); scanner.setText(""); scanner.setOnError(undefined); // Clear any data. We don't want to accidentally hold onto it for too long. @@ -19531,6 +19643,7 @@ var ts; ts.Debug.assert(token() === 1 /* EndOfFileToken */); sourceFile.endOfFileToken = addJSDocComment(parseTokenNode()); setExternalModuleIndicator(sourceFile); + sourceFile.commentDirectives = scanner.getCommentDirectives(); sourceFile.nodeCount = nodeCount; sourceFile.identifierCount = identifierCount; sourceFile.identifiers = identifiers; @@ -19571,7 +19684,7 @@ var ts; function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(290 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(291 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -19903,7 +20016,7 @@ var ts; } function createNodeWithJSDoc(kind, pos) { var node = createNode(kind, pos); - if (scanner.getTokenFlags() & 2 /* PrecedingJSDocComment */) { + if (scanner.getTokenFlags() & 2 /* PrecedingJSDocComment */ && (kind !== 227 /* ExpressionStatement */ || token() !== 20 /* OpenParenToken */)) { addJSDocComment(node); } return node; @@ -20015,7 +20128,7 @@ var ts; // PropertyName [Yield]: // LiteralPropertyName // ComputedPropertyName[?Yield] - var node = createNode(154 /* ComputedPropertyName */); + var node = createNode(155 /* ComputedPropertyName */); parseExpected(22 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -20057,15 +20170,15 @@ var ts; if (token() === 84 /* DefaultKeyword */) { return lookAhead(nextTokenCanFollowDefaultKeyword); } - if (token() === 145 /* TypeKeyword */) { + if (token() === 146 /* TypeKeyword */) { return lookAhead(nextTokenCanFollowExportModifier); } return canFollowExportModifier(); case 84 /* DefaultKeyword */: return nextTokenCanFollowDefaultKeyword(); case 120 /* StaticKeyword */: - case 131 /* GetKeyword */: - case 142 /* SetKeyword */: + case 132 /* GetKeyword */: + case 143 /* SetKeyword */: nextToken(); return canFollowModifier(); default: @@ -20475,20 +20588,20 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 162 /* Constructor */: - case 167 /* IndexSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 159 /* PropertyDeclaration */: - case 222 /* SemicolonClassElement */: + case 163 /* Constructor */: + case 168 /* IndexSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 223 /* SemicolonClassElement */: return true; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: // Method declarations are not necessarily reusable. An object-literal // may have a method calls "constructor(...)" and we must reparse that // into an actual .ConstructorDeclaration. var methodDeclaration = node; var nameIsConstructor = methodDeclaration.name.kind === 75 /* Identifier */ && - methodDeclaration.name.originalKeywordKind === 129 /* ConstructorKeyword */; + methodDeclaration.name.originalKeywordKind === 130 /* ConstructorKeyword */; return !nameIsConstructor; } } @@ -20497,8 +20610,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: return true; } } @@ -20507,58 +20620,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 225 /* VariableStatement */: - case 223 /* Block */: - case 227 /* IfStatement */: - case 226 /* ExpressionStatement */: - case 239 /* ThrowStatement */: - case 235 /* ReturnStatement */: - case 237 /* SwitchStatement */: - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 230 /* ForStatement */: - case 229 /* WhileStatement */: - case 236 /* WithStatement */: - case 224 /* EmptyStatement */: - case 240 /* TryStatement */: - case 238 /* LabeledStatement */: - case 228 /* DoStatement */: - case 241 /* DebuggerStatement */: - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 260 /* ExportDeclaration */: - case 259 /* ExportAssignment */: - case 249 /* ModuleDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 245 /* FunctionDeclaration */: + case 226 /* VariableStatement */: + case 224 /* Block */: + case 228 /* IfStatement */: + case 227 /* ExpressionStatement */: + case 240 /* ThrowStatement */: + case 236 /* ReturnStatement */: + case 238 /* SwitchStatement */: + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 231 /* ForStatement */: + case 230 /* WhileStatement */: + case 237 /* WithStatement */: + case 225 /* EmptyStatement */: + case 241 /* TryStatement */: + case 239 /* LabeledStatement */: + case 229 /* DoStatement */: + case 242 /* DebuggerStatement */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 261 /* ExportDeclaration */: + case 260 /* ExportAssignment */: + case 250 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 284 /* EnumMember */; + return node.kind === 285 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 166 /* ConstructSignature */: - case 160 /* MethodSignature */: - case 167 /* IndexSignature */: - case 158 /* PropertySignature */: - case 165 /* CallSignature */: + case 167 /* ConstructSignature */: + case 161 /* MethodSignature */: + case 168 /* IndexSignature */: + case 159 /* PropertySignature */: + case 166 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 242 /* VariableDeclaration */) { + if (node.kind !== 243 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -20579,7 +20692,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 156 /* Parameter */) { + if (node.kind !== 157 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -20718,7 +20831,7 @@ var ts; return entity; } function createQualifiedName(entity, name) { - var node = createNode(153 /* QualifiedName */, entity.pos); + var node = createNode(154 /* QualifiedName */, entity.pos); node.left = entity; node.right = name; return finishNode(node); @@ -20759,7 +20872,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression(isTaggedTemplate) { - var template = createNode(211 /* TemplateExpression */); + var template = createNode(212 /* TemplateExpression */); template.head = parseTemplateHead(isTaggedTemplate); ts.Debug.assert(template.head.kind === 15 /* TemplateHead */, "Template head has wrong token kind"); var list = []; @@ -20771,7 +20884,7 @@ var ts; return finishNode(template); } function parseTemplateSpan(isTaggedTemplate) { - var span = createNode(221 /* TemplateSpan */); + var span = createNode(222 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token() === 19 /* CloseBraceToken */) { @@ -20837,7 +20950,7 @@ var ts; } // TYPES function parseTypeReference() { - var node = createNode(169 /* TypeReference */); + var node = createNode(170 /* TypeReference */); node.typeName = parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29 /* LessThanToken */) { node.typeArguments = parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */); @@ -20847,14 +20960,14 @@ var ts; // If true, we should abort parsing an error function. function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return ts.nodeIsMissing(node.typeName); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: { + case 171 /* FunctionType */: + case 172 /* ConstructorType */: { var _a = node, parameters = _a.parameters, type = _a.type; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -20862,20 +20975,20 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(168 /* TypePredicate */, lhs.pos); + var node = createNode(169 /* TypePredicate */, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(183 /* ThisType */); + var node = createNode(184 /* ThisType */); nextToken(); return finishNode(node); } function parseJSDocAllType(postFixEquals) { - var result = createNode(295 /* JSDocAllType */); + var result = createNode(296 /* JSDocAllType */); if (postFixEquals) { - return createPostfixType(299 /* JSDocOptionalType */, result); + return createPostfixType(300 /* JSDocOptionalType */, result); } else { nextToken(); @@ -20883,7 +20996,7 @@ var ts; return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(298 /* JSDocNonNullableType */); + var result = createNode(299 /* JSDocNonNullableType */); nextToken(); result.type = parseNonArrayType(); return finishNode(result); @@ -20907,28 +21020,28 @@ var ts; token() === 31 /* GreaterThanToken */ || token() === 62 /* EqualsToken */ || token() === 51 /* BarToken */) { - var result = createNode(296 /* JSDocUnknownType */, pos); + var result = createNode(297 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(297 /* JSDocNullableType */, pos); + var result = createNode(298 /* JSDocNullableType */, pos); result.type = parseType(); return finishNode(result); } } function parseJSDocFunctionType() { if (lookAhead(nextTokenIsOpenParen)) { - var result = createNodeWithJSDoc(300 /* JSDocFunctionType */); + var result = createNodeWithJSDoc(301 /* JSDocFunctionType */); nextToken(); fillSignature(58 /* ColonToken */, 4 /* Type */ | 32 /* JSDoc */, result); return finishNode(result); } - var node = createNode(169 /* TypeReference */); + var node = createNode(170 /* TypeReference */); node.typeName = parseIdentifierName(); return finishNode(node); } function parseJSDocParameter() { - var parameter = createNode(156 /* Parameter */); + var parameter = createNode(157 /* Parameter */); if (token() === 104 /* ThisKeyword */ || token() === 99 /* NewKeyword */) { parameter.name = parseIdentifierName(); parseExpected(58 /* ColonToken */); @@ -20938,9 +21051,9 @@ var ts; } function parseJSDocType() { scanner.setInJSDocType(true); - var moduleSpecifier = parseOptionalToken(135 /* ModuleKeyword */); + var moduleSpecifier = parseOptionalToken(136 /* ModuleKeyword */); if (moduleSpecifier) { - var moduleTag = createNode(302 /* JSDocNamepathType */, moduleSpecifier.pos); + var moduleTag = createNode(303 /* JSDocNamepathType */, moduleSpecifier.pos); terminate: while (true) { switch (token()) { case 19 /* CloseBraceToken */: @@ -20959,23 +21072,23 @@ var ts; var type = parseTypeOrTypePredicate(); scanner.setInJSDocType(false); if (dotdotdot) { - var variadic = createNode(301 /* JSDocVariadicType */, dotdotdot.pos); + var variadic = createNode(302 /* JSDocVariadicType */, dotdotdot.pos); variadic.type = type; type = finishNode(variadic); } if (token() === 62 /* EqualsToken */) { - return createPostfixType(299 /* JSDocOptionalType */, type); + return createPostfixType(300 /* JSDocOptionalType */, type); } return type; } function parseTypeQuery() { - var node = createNode(172 /* TypeQuery */); + var node = createNode(173 /* TypeQuery */); parseExpected(108 /* TypeOfKeyword */); node.exprName = parseEntityName(/*allowReservedWords*/ true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(155 /* TypeParameter */); + var node = createNode(156 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(90 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the @@ -21020,7 +21133,7 @@ var ts; isStartOfType(/*inStartOfParameter*/ !isJSDocParameter); } function parseParameter() { - var node = createNodeWithJSDoc(156 /* Parameter */); + var node = createNodeWithJSDoc(157 /* Parameter */); if (token() === 104 /* ThisKeyword */) { node.name = createIdentifier(/*isIdentifier*/ true); node.type = parseParameterType(); @@ -21121,7 +21234,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 166 /* ConstructSignature */) { + if (kind === 167 /* ConstructSignature */) { parseExpected(99 /* NewKeyword */); } fillSignature(58 /* ColonToken */, 4 /* Type */, node); @@ -21182,7 +21295,7 @@ var ts; return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(node) { - node.kind = 167 /* IndexSignature */; + node.kind = 168 /* IndexSignature */; node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -21192,13 +21305,13 @@ var ts; node.name = parsePropertyName(); node.questionToken = parseOptionalToken(57 /* QuestionToken */); if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - node.kind = 160 /* MethodSignature */; + node.kind = 161 /* MethodSignature */; // Method signatures don't exist in expression contexts. So they have neither // [Yield] nor [Await] fillSignature(58 /* ColonToken */, 4 /* Type */, node); } else { - node.kind = 158 /* PropertySignature */; + node.kind = 159 /* PropertySignature */; node.type = parseTypeAnnotation(); if (token() === 62 /* EqualsToken */) { // Although type literal properties cannot not have initializers, we attempt @@ -21244,10 +21357,10 @@ var ts; } function parseTypeMember() { if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - return parseSignatureMember(165 /* CallSignature */); + return parseSignatureMember(166 /* CallSignature */); } if (token() === 99 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(166 /* ConstructSignature */); + return parseSignatureMember(167 /* ConstructSignature */); } var node = createNodeWithJSDoc(0 /* Unknown */); node.modifiers = parseModifiers(); @@ -21273,7 +21386,7 @@ var ts; return false; } function parseTypeLiteral() { - var node = createNode(173 /* TypeLiteral */); + var node = createNode(174 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -21291,27 +21404,27 @@ var ts; function isStartOfMappedType() { nextToken(); if (token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { - return nextToken() === 138 /* ReadonlyKeyword */; + return nextToken() === 139 /* ReadonlyKeyword */; } - if (token() === 138 /* ReadonlyKeyword */) { + if (token() === 139 /* ReadonlyKeyword */) { nextToken(); } return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 97 /* InKeyword */; } function parseMappedTypeParameter() { - var node = createNode(155 /* TypeParameter */); + var node = createNode(156 /* TypeParameter */); node.name = parseIdentifier(); parseExpected(97 /* InKeyword */); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(186 /* MappedType */); + var node = createNode(187 /* MappedType */); parseExpected(18 /* OpenBraceToken */); - if (token() === 138 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { + if (token() === 139 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { node.readonlyToken = parseTokenNode(); - if (node.readonlyToken.kind !== 138 /* ReadonlyKeyword */) { - parseExpectedToken(138 /* ReadonlyKeyword */); + if (node.readonlyToken.kind !== 139 /* ReadonlyKeyword */) { + parseExpectedToken(139 /* ReadonlyKeyword */); } } parseExpected(22 /* OpenBracketToken */); @@ -21331,23 +21444,23 @@ var ts; function parseTupleElementType() { var pos = getNodePos(); if (parseOptional(25 /* DotDotDotToken */)) { - var node = createNode(177 /* RestType */, pos); + var node = createNode(178 /* RestType */, pos); node.type = parseType(); return finishNode(node); } var type = parseType(); - if (!(contextFlags & 4194304 /* JSDoc */) && type.kind === 297 /* JSDocNullableType */ && type.pos === type.type.pos) { - type.kind = 176 /* OptionalType */; + if (!(contextFlags & 4194304 /* JSDoc */) && type.kind === 298 /* JSDocNullableType */ && type.pos === type.type.pos) { + type.kind = 177 /* OptionalType */; } return type; } function parseTupleType() { - var node = createNode(175 /* TupleType */); + var node = createNode(176 /* TupleType */); node.elementTypes = parseBracketedList(21 /* TupleElementTypes */, parseTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(182 /* ParenthesizedType */); + var node = createNode(183 /* ParenthesizedType */); parseExpected(20 /* OpenParenToken */); node.type = parseType(); parseExpected(21 /* CloseParenToken */); @@ -21355,7 +21468,7 @@ var ts; } function parseFunctionOrConstructorType() { var pos = getNodePos(); - var kind = parseOptional(99 /* NewKeyword */) ? 171 /* ConstructorType */ : 170 /* FunctionType */; + var kind = parseOptional(99 /* NewKeyword */) ? 172 /* ConstructorType */ : 171 /* FunctionType */; var node = createNodeWithJSDoc(kind, pos); fillSignature(38 /* EqualsGreaterThanToken */, 4 /* Type */, node); return finishNode(node); @@ -21365,10 +21478,10 @@ var ts; return token() === 24 /* DotToken */ ? undefined : node; } function parseLiteralTypeNode(negative) { - var node = createNode(187 /* LiteralType */); + var node = createNode(188 /* LiteralType */); var unaryMinusExpression; if (negative) { - unaryMinusExpression = createNode(207 /* PrefixUnaryExpression */); + unaryMinusExpression = createNode(208 /* PrefixUnaryExpression */); unaryMinusExpression.operator = 40 /* MinusToken */; nextToken(); } @@ -21389,7 +21502,7 @@ var ts; } function parseImportType() { sourceFile.flags |= 1048576 /* PossiblyContainsDynamicImport */; - var node = createNode(188 /* ImportType */); + var node = createNode(189 /* ImportType */); if (parseOptional(108 /* TypeOfKeyword */)) { node.isTypeOf = true; } @@ -21412,15 +21525,15 @@ var ts; function parseNonArrayType() { switch (token()) { case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 144 /* SymbolKeyword */: - case 128 /* BooleanKeyword */: - case 146 /* UndefinedKeyword */: - case 137 /* NeverKeyword */: - case 141 /* ObjectKeyword */: + case 149 /* UnknownKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 145 /* SymbolKeyword */: + case 129 /* BooleanKeyword */: + case 147 /* UndefinedKeyword */: + case 138 /* NeverKeyword */: + case 142 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 41 /* AsteriskToken */: @@ -21451,7 +21564,7 @@ var ts; return parseTokenNode(); case 104 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 133 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 134 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -21477,20 +21590,20 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 128 /* BooleanKeyword */: - case 138 /* ReadonlyKeyword */: - case 144 /* SymbolKeyword */: - case 147 /* UniqueKeyword */: + case 149 /* UnknownKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 129 /* BooleanKeyword */: + case 139 /* ReadonlyKeyword */: + case 145 /* SymbolKeyword */: + case 148 /* UniqueKeyword */: case 110 /* VoidKeyword */: - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: case 100 /* NullKeyword */: case 104 /* ThisKeyword */: case 108 /* TypeOfKeyword */: - case 137 /* NeverKeyword */: + case 138 /* NeverKeyword */: case 18 /* OpenBraceToken */: case 22 /* OpenBracketToken */: case 29 /* LessThanToken */: @@ -21502,12 +21615,12 @@ var ts; case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: - case 141 /* ObjectKeyword */: + case 142 /* ObjectKeyword */: case 41 /* AsteriskToken */: case 57 /* QuestionToken */: case 53 /* ExclamationToken */: case 25 /* DotDotDotToken */: - case 132 /* InferKeyword */: + case 133 /* InferKeyword */: case 96 /* ImportKeyword */: case 124 /* AssertsKeyword */: return true; @@ -21532,26 +21645,26 @@ var ts; while (!scanner.hasPrecedingLineBreak()) { switch (token()) { case 53 /* ExclamationToken */: - type = createPostfixType(298 /* JSDocNonNullableType */, type); + type = createPostfixType(299 /* JSDocNonNullableType */, type); break; case 57 /* QuestionToken */: // If not in JSDoc and next token is start of a type we have a conditional type if (!(contextFlags & 4194304 /* JSDoc */) && lookAhead(nextTokenIsStartOfType)) { return type; } - type = createPostfixType(297 /* JSDocNullableType */, type); + type = createPostfixType(298 /* JSDocNullableType */, type); break; case 22 /* OpenBracketToken */: parseExpected(22 /* OpenBracketToken */); if (isStartOfType()) { - var node = createNode(185 /* IndexedAccessType */, type.pos); + var node = createNode(186 /* IndexedAccessType */, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(23 /* CloseBracketToken */); type = finishNode(node); } else { - var node = createNode(174 /* ArrayType */, type.pos); + var node = createNode(175 /* ArrayType */, type.pos); node.elementType = type; parseExpected(23 /* CloseBracketToken */); type = finishNode(node); @@ -21570,16 +21683,16 @@ var ts; return finishNode(postfix); } function parseTypeOperator(operator) { - var node = createNode(184 /* TypeOperator */); + var node = createNode(185 /* TypeOperator */); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); return finishNode(node); } function parseInferType() { - var node = createNode(181 /* InferType */); - parseExpected(132 /* InferKeyword */); - var typeParameter = createNode(155 /* TypeParameter */); + var node = createNode(182 /* InferType */); + parseExpected(133 /* InferKeyword */); + var typeParameter = createNode(156 /* TypeParameter */); typeParameter.name = parseIdentifier(); node.typeParameter = finishNode(typeParameter); return finishNode(node); @@ -21587,11 +21700,12 @@ var ts; function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 134 /* KeyOfKeyword */: - case 147 /* UniqueKeyword */: - case 138 /* ReadonlyKeyword */: + case 135 /* KeyOfKeyword */: + case 148 /* UniqueKeyword */: + case 139 /* ReadonlyKeyword */: + case 128 /* AwaitedKeyword */: return parseTypeOperator(operator); - case 132 /* InferKeyword */: + case 133 /* InferKeyword */: return parseInferType(); } return parsePostfixTypeOrHigher(); @@ -21612,10 +21726,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(179 /* IntersectionType */, parseTypeOperatorOrHigher, 50 /* AmpersandToken */); + return parseUnionOrIntersectionType(180 /* IntersectionType */, parseTypeOperatorOrHigher, 50 /* AmpersandToken */); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(178 /* UnionType */, parseIntersectionTypeOrHigher, 51 /* BarToken */); + return parseUnionOrIntersectionType(179 /* UnionType */, parseIntersectionTypeOrHigher, 51 /* BarToken */); } function isStartOfFunctionType() { if (token() === 29 /* LessThanToken */) { @@ -21672,7 +21786,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(168 /* TypePredicate */, typePredicateVariable.pos); + var node = createNode(169 /* TypePredicate */, typePredicateVariable.pos); node.assertsModifier = undefined; node.parameterName = typePredicateVariable; node.type = type; @@ -21684,16 +21798,16 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 133 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 134 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } } function parseAssertsTypePredicate() { - var node = createNode(168 /* TypePredicate */); + var node = createNode(169 /* TypePredicate */); node.assertsModifier = parseExpectedToken(124 /* AssertsKeyword */); node.parameterName = token() === 104 /* ThisKeyword */ ? parseThisTypeNode() : parseIdentifier(); - node.type = parseOptional(133 /* IsKeyword */) ? parseType() : undefined; + node.type = parseOptional(134 /* IsKeyword */) ? parseType() : undefined; return finishNode(node); } function parseType() { @@ -21707,7 +21821,7 @@ var ts; } var type = parseUnionTypeOrHigher(); if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(90 /* ExtendsKeyword */)) { - var node = createNode(180 /* ConditionalType */, type.pos); + var node = createNode(181 /* ConditionalType */, type.pos); node.checkType = type; // The type following 'extends' is not permitted to be another conditional type node.extendsType = parseTypeWorker(/*noConditionalTypes*/ true); @@ -21902,7 +22016,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(212 /* YieldExpression */); + var node = createNode(213 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -21924,13 +22038,13 @@ var ts; ts.Debug.assert(token() === 38 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(202 /* ArrowFunction */, asyncModifier.pos); + node = createNode(203 /* ArrowFunction */, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(202 /* ArrowFunction */, identifier.pos); + node = createNode(203 /* ArrowFunction */, identifier.pos); } - var parameter = createNode(156 /* Parameter */, identifier.pos); + var parameter = createNode(157 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); @@ -22135,7 +22249,7 @@ var ts; return 0 /* False */; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNodeWithJSDoc(202 /* ArrowFunction */); + var node = createNodeWithJSDoc(203 /* ArrowFunction */); node.modifiers = parseModifiersForArrowFunction(); var isAsync = hasModifierOfKind(node, 126 /* AsyncKeyword */) ? 2 /* Await */ : 0 /* None */; // Arrow functions are never generators. @@ -22201,7 +22315,7 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(210 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(211 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -22216,7 +22330,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 97 /* InKeyword */ || t === 152 /* OfKeyword */; + return t === 97 /* InKeyword */ || t === 153 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -22281,39 +22395,39 @@ var ts; return ts.getBinaryOperatorPrecedence(token()) > 0; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(209 /* BinaryExpression */, left.pos); + var node = createNode(210 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(217 /* AsExpression */, left.pos); + var node = createNode(218 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(207 /* PrefixUnaryExpression */); + var node = createNode(208 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(203 /* DeleteExpression */); + var node = createNode(204 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(204 /* TypeOfExpression */); + var node = createNode(205 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(205 /* VoidExpression */); + var node = createNode(206 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -22329,7 +22443,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(206 /* AwaitExpression */); + var node = createNode(207 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -22373,7 +22487,7 @@ var ts; if (token() === 42 /* AsteriskAsteriskToken */) { var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); var end = simpleUnaryExpression.end; - if (simpleUnaryExpression.kind === 199 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 200 /* TypeAssertionExpression */) { parseErrorAt(pos, end, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -22470,7 +22584,7 @@ var ts; */ function parseUpdateExpression() { if (token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) { - var node = createNode(207 /* PrefixUnaryExpression */); + var node = createNode(208 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -22483,7 +22597,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(208 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(209 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -22539,7 +22653,7 @@ var ts; var fullStart = scanner.getStartPos(); nextToken(); // advance past the 'import' nextToken(); // advance past the dot - var node = createNode(219 /* MetaProperty */, fullStart); + var node = createNode(220 /* MetaProperty */, fullStart); node.keywordToken = 96 /* ImportKeyword */; node.name = parseIdentifierName(); expression = finishNode(node); @@ -22622,7 +22736,7 @@ var ts; } // If we have seen "super" it must be followed by '(' or '.'. // If it wasn't then just try to parse out a '.' and report an error. - var node = createNode(194 /* PropertyAccessExpression */, expression.pos); + var node = createNode(195 /* PropertyAccessExpression */, expression.pos); node.expression = expression; parseExpectedToken(24 /* DotToken */, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); // private names will never work with `super` (`super.#foo`), but that's a semantic error, not syntactic @@ -22632,8 +22746,8 @@ var ts; function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 268 /* JsxOpeningElement */) { - var node = createNode(266 /* JsxElement */, opening.pos); + if (opening.kind === 269 /* JsxOpeningElement */) { + var node = createNode(267 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -22642,15 +22756,15 @@ var ts; } result = finishNode(node); } - else if (opening.kind === 271 /* JsxOpeningFragment */) { - var node = createNode(270 /* JsxFragment */, opening.pos); + else if (opening.kind === 272 /* JsxOpeningFragment */) { + var node = createNode(271 /* JsxFragment */, opening.pos); node.openingFragment = opening; node.children = parseJsxChildren(node.openingFragment); node.closingFragment = parseJsxClosingFragment(inExpressionContext); result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 267 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 268 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -22665,7 +22779,7 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(209 /* BinaryExpression */, result.pos); + var badNode = createNode(210 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -22724,7 +22838,7 @@ var ts; return createNodeArray(list, listPos); } function parseJsxAttributes() { - var jsxAttributes = createNode(274 /* JsxAttributes */); + var jsxAttributes = createNode(275 /* JsxAttributes */); jsxAttributes.properties = parseList(13 /* JsxAttributes */, parseJsxAttribute); return finishNode(jsxAttributes); } @@ -22733,7 +22847,7 @@ var ts; parseExpected(29 /* LessThanToken */); if (token() === 31 /* GreaterThanToken */) { // See below for explanation of scanJsxText - var node_1 = createNode(271 /* JsxOpeningFragment */, fullStart); + var node_1 = createNode(272 /* JsxOpeningFragment */, fullStart); scanJsxText(); return finishNode(node_1); } @@ -22745,7 +22859,7 @@ var ts; // Closing tag, so scan the immediately-following text with the JSX scanning instead // of regular scanning to avoid treating illegal characters (e.g. '#') as immediate // scanning errors - node = createNode(268 /* JsxOpeningElement */, fullStart); + node = createNode(269 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -22757,7 +22871,7 @@ var ts; parseExpected(31 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(267 /* JsxSelfClosingElement */, fullStart); + node = createNode(268 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.typeArguments = typeArguments; @@ -22774,7 +22888,7 @@ var ts; var expression = token() === 104 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ false); expression = finishNode(propertyAccess); @@ -22782,7 +22896,7 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(276 /* JsxExpression */); + var node = createNode(277 /* JsxExpression */); if (!parseExpected(18 /* OpenBraceToken */)) { return undefined; } @@ -22808,7 +22922,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(273 /* JsxAttribute */); + var node = createNode(274 /* JsxAttribute */); node.name = parseIdentifierName(); if (token() === 62 /* EqualsToken */) { switch (scanJsxAttributeValue()) { @@ -22823,7 +22937,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(275 /* JsxSpreadAttribute */); + var node = createNode(276 /* JsxSpreadAttribute */); parseExpected(18 /* OpenBraceToken */); parseExpected(25 /* DotDotDotToken */); node.expression = parseExpression(); @@ -22831,7 +22945,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(269 /* JsxClosingElement */); + var node = createNode(270 /* JsxClosingElement */); parseExpected(30 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -22844,7 +22958,7 @@ var ts; return finishNode(node); } function parseJsxClosingFragment(inExpressionContext) { - var node = createNode(272 /* JsxClosingFragment */); + var node = createNode(273 /* JsxClosingFragment */); parseExpected(30 /* LessThanSlashToken */); if (ts.tokenIsIdentifierOrKeyword(token())) { parseErrorAtRange(parseJsxElementName(), ts.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment); @@ -22859,7 +22973,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(199 /* TypeAssertionExpression */); + var node = createNode(200 /* TypeAssertionExpression */); parseExpected(29 /* LessThanToken */); node.type = parseType(); parseExpected(31 /* GreaterThanToken */); @@ -22877,7 +22991,7 @@ var ts; && lookAhead(nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate); } function parsePropertyAccessExpressionRest(expression, questionDotToken) { - var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ true); @@ -22890,7 +23004,7 @@ var ts; return finishNode(propertyAccess); } function parseElementAccessExpressionRest(expression, questionDotToken) { - var indexedAccess = createNode(195 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(196 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; indexedAccess.questionDotToken = questionDotToken; if (token() === 23 /* CloseBracketToken */) { @@ -22926,7 +23040,7 @@ var ts; } if (!questionDotToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(218 /* NonNullExpression */, expression.pos); + var nonNullExpression = createNode(219 /* NonNullExpression */, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; @@ -22947,7 +23061,7 @@ var ts; return token() === 14 /* NoSubstitutionTemplateLiteral */ || token() === 15 /* TemplateHead */; } function parseTaggedTemplateRest(tag, questionDotToken, typeArguments) { - var tagExpression = createNode(198 /* TaggedTemplateExpression */, tag.pos); + var tagExpression = createNode(199 /* TaggedTemplateExpression */, tag.pos); tagExpression.tag = tag; tagExpression.questionDotToken = questionDotToken; tagExpression.typeArguments = typeArguments; @@ -22975,7 +23089,7 @@ var ts; expression = parseTaggedTemplateRest(expression, questionDotToken, typeArguments); continue; } - var callExpr = createNode(196 /* CallExpression */, expression.pos); + var callExpr = createNode(197 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.typeArguments = typeArguments; @@ -22988,7 +23102,7 @@ var ts; } } else if (token() === 20 /* OpenParenToken */) { - var callExpr = createNode(196 /* CallExpression */, expression.pos); + var callExpr = createNode(197 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.arguments = parseArgumentList(); @@ -23000,7 +23114,7 @@ var ts; } if (questionDotToken) { // We failed to parse anything, so report a missing identifier here. - var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = createMissingNode(75 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.Identifier_expected); @@ -23119,28 +23233,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNodeWithJSDoc(200 /* ParenthesizedExpression */); + var node = createNodeWithJSDoc(201 /* ParenthesizedExpression */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(213 /* SpreadElement */); + var node = createNode(214 /* SpreadElement */); parseExpected(25 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 25 /* DotDotDotToken */ ? parseSpreadElement() : - token() === 27 /* CommaToken */ ? createNode(215 /* OmittedExpression */) : + token() === 27 /* CommaToken */ ? createNode(216 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(192 /* ArrayLiteralExpression */); + var node = createNode(193 /* ArrayLiteralExpression */); parseExpected(22 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -23152,17 +23266,17 @@ var ts; function parseObjectLiteralElement() { var node = createNodeWithJSDoc(0 /* Unknown */); if (parseOptionalToken(25 /* DotDotDotToken */)) { - node.kind = 283 /* SpreadAssignment */; + node.kind = 284 /* SpreadAssignment */; node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); - if (parseContextualModifier(131 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 163 /* GetAccessor */); + if (parseContextualModifier(132 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 164 /* GetAccessor */); } - if (parseContextualModifier(142 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 164 /* SetAccessor */); + if (parseContextualModifier(143 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 165 /* SetAccessor */); } var asteriskToken = parseOptionalToken(41 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); @@ -23180,7 +23294,7 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 58 /* ColonToken */); if (isShorthandPropertyAssignment) { - node.kind = 282 /* ShorthandPropertyAssignment */; + node.kind = 283 /* ShorthandPropertyAssignment */; var equalsToken = parseOptionalToken(62 /* EqualsToken */); if (equalsToken) { node.equalsToken = equalsToken; @@ -23188,20 +23302,26 @@ var ts; } } else { - node.kind = 281 /* PropertyAssignment */; + node.kind = 282 /* PropertyAssignment */; parseExpected(58 /* ColonToken */); node.initializer = allowInAnd(parseAssignmentExpressionOrHigher); } return finishNode(node); } function parseObjectLiteralExpression() { - var node = createNode(193 /* ObjectLiteralExpression */); + var node = createNode(194 /* ObjectLiteralExpression */); + var openBracePosition = scanner.getTokenPos(); parseExpected(18 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; } node.properties = parseDelimitedList(12 /* ObjectLiteralMembers */, parseObjectLiteralElement, /*considerSemicolonAsDelimiter*/ true); - parseExpected(19 /* CloseBraceToken */); + if (!parseExpected(19 /* CloseBraceToken */)) { + var lastError = ts.lastOrUndefined(parseDiagnostics); + if (lastError && lastError.code === ts.Diagnostics._0_expected.code) { + ts.addRelatedInfo(lastError, ts.createFileDiagnostic(sourceFile, openBracePosition, 1, ts.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here)); + } + } return finishNode(node); } function parseFunctionExpression() { @@ -23214,7 +23334,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(/*val*/ false); } - var node = createNodeWithJSDoc(201 /* FunctionExpression */); + var node = createNodeWithJSDoc(202 /* FunctionExpression */); node.modifiers = parseModifiers(); parseExpected(94 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(41 /* AsteriskToken */); @@ -23239,7 +23359,7 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(99 /* NewKeyword */); if (parseOptional(24 /* DotToken */)) { - var node_2 = createNode(219 /* MetaProperty */, fullStart); + var node_2 = createNode(220 /* MetaProperty */, fullStart); node_2.keywordToken = 99 /* NewKeyword */; node_2.name = parseIdentifierName(); return finishNode(node_2); @@ -23256,7 +23376,7 @@ var ts; } break; } - var node = createNode(197 /* NewExpression */, fullStart); + var node = createNode(198 /* NewExpression */, fullStart); node.expression = expression; node.typeArguments = typeArguments; if (node.typeArguments || token() === 20 /* OpenParenToken */) { @@ -23266,7 +23386,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(223 /* Block */); + var node = createNode(224 /* Block */); var openBracePosition = scanner.getTokenPos(); if (parseExpected(18 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { @@ -23305,12 +23425,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(224 /* EmptyStatement */); + var node = createNode(225 /* EmptyStatement */); parseExpected(26 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(227 /* IfStatement */); + var node = createNode(228 /* IfStatement */); parseExpected(95 /* IfKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23320,7 +23440,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(228 /* DoStatement */); + var node = createNode(229 /* DoStatement */); parseExpected(86 /* DoKeyword */); node.statement = parseStatement(); parseExpected(111 /* WhileKeyword */); @@ -23335,7 +23455,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(229 /* WhileStatement */); + var node = createNode(230 /* WhileStatement */); parseExpected(111 /* WhileKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23358,8 +23478,8 @@ var ts; } } var forOrForInOrForOfStatement; - if (awaitToken ? parseExpected(152 /* OfKeyword */) : parseOptional(152 /* OfKeyword */)) { - var forOfStatement = createNode(232 /* ForOfStatement */, pos); + if (awaitToken ? parseExpected(153 /* OfKeyword */) : parseOptional(153 /* OfKeyword */)) { + var forOfStatement = createNode(233 /* ForOfStatement */, pos); forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); @@ -23367,14 +23487,14 @@ var ts; forOrForInOrForOfStatement = forOfStatement; } else if (parseOptional(97 /* InKeyword */)) { - var forInStatement = createNode(231 /* ForInStatement */, pos); + var forInStatement = createNode(232 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } else { - var forStatement = createNode(230 /* ForStatement */, pos); + var forStatement = createNode(231 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(26 /* SemicolonToken */); if (token() !== 26 /* SemicolonToken */ && token() !== 21 /* CloseParenToken */) { @@ -23392,7 +23512,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 234 /* BreakStatement */ ? 77 /* BreakKeyword */ : 82 /* ContinueKeyword */); + parseExpected(kind === 235 /* BreakStatement */ ? 77 /* BreakKeyword */ : 82 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -23400,7 +23520,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(235 /* ReturnStatement */); + var node = createNode(236 /* ReturnStatement */); parseExpected(101 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -23409,7 +23529,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(236 /* WithStatement */); + var node = createNode(237 /* WithStatement */); parseExpected(112 /* WithKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23418,7 +23538,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(277 /* CaseClause */); + var node = createNode(278 /* CaseClause */); parseExpected(78 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(58 /* ColonToken */); @@ -23426,7 +23546,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(278 /* DefaultClause */); + var node = createNode(279 /* DefaultClause */); parseExpected(84 /* DefaultKeyword */); parseExpected(58 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); @@ -23436,12 +23556,12 @@ var ts; return token() === 78 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(237 /* SwitchStatement */); + var node = createNode(238 /* SwitchStatement */); parseExpected(103 /* SwitchKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); - var caseBlock = createNode(251 /* CaseBlock */); + var caseBlock = createNode(252 /* CaseBlock */); parseExpected(18 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(19 /* CloseBraceToken */); @@ -23456,7 +23576,7 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(239 /* ThrowStatement */); + var node = createNode(240 /* ThrowStatement */); parseExpected(105 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -23464,7 +23584,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(240 /* TryStatement */); + var node = createNode(241 /* TryStatement */); parseExpected(107 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); node.catchClause = token() === 79 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -23477,7 +23597,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(280 /* CatchClause */); + var result = createNode(281 /* CatchClause */); parseExpected(79 /* CatchKeyword */); if (parseOptional(20 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -23491,7 +23611,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(241 /* DebuggerStatement */); + var node = createNode(242 /* DebuggerStatement */); parseExpected(83 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -23500,15 +23620,15 @@ var ts; // Avoiding having to do the lookahead for a labeled statement by just trying to parse // out an expression, seeing if it is identifier and then seeing if it is followed by // a colon. - var node = createNodeWithJSDoc(0 /* Unknown */); + var node = createNodeWithJSDoc(token() === 75 /* Identifier */ ? 0 /* Unknown */ : 227 /* ExpressionStatement */); var expression = allowInAnd(parseExpression); if (expression.kind === 75 /* Identifier */ && parseOptional(58 /* ColonToken */)) { - node.kind = 238 /* LabeledStatement */; + node.kind = 239 /* LabeledStatement */; node.label = expression; node.statement = parseStatement(); } else { - node.kind = 226 /* ExpressionStatement */; + node.kind = 227 /* ExpressionStatement */; node.expression = expression; parseSemicolon(); } @@ -23562,25 +23682,25 @@ var ts; // // could be legal, it would add complexity for very little gain. case 114 /* InterfaceKeyword */: - case 145 /* TypeKeyword */: + case 146 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 122 /* AbstractKeyword */: case 126 /* AsyncKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 119 /* PublicKeyword */: - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 150 /* GlobalKeyword */: + case 151 /* GlobalKeyword */: nextToken(); return token() === 18 /* OpenBraceToken */ || token() === 75 /* Identifier */ || token() === 89 /* ExportKeyword */; case 96 /* ImportKeyword */: @@ -23589,7 +23709,7 @@ var ts; token() === 18 /* OpenBraceToken */ || ts.tokenIsIdentifierOrKeyword(token()); case 89 /* ExportKeyword */: var currentToken_1 = nextToken(); - if (currentToken_1 === 145 /* TypeKeyword */) { + if (currentToken_1 === 146 /* TypeKeyword */) { currentToken_1 = lookAhead(nextToken); } if (currentToken_1 === 62 /* EqualsToken */ || currentToken_1 === 41 /* AsteriskToken */ || @@ -23643,19 +23763,19 @@ var ts; case 89 /* ExportKeyword */: return isStartOfDeclaration(); case 126 /* AsyncKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 114 /* InterfaceKeyword */: - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: - case 145 /* TypeKeyword */: - case 150 /* GlobalKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: + case 146 /* TypeKeyword */: + case 151 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 120 /* StaticKeyword */: - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: // When these don't start a declaration, they may be the start of a class member if an identifier // immediately follows. Otherwise they're an identifier in an expression statement. return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); @@ -23679,16 +23799,16 @@ var ts; case 18 /* OpenBraceToken */: return parseBlock(/*ignoreMissingOpenBrace*/ false); case 109 /* VarKeyword */: - return parseVariableStatement(createNodeWithJSDoc(242 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(243 /* VariableDeclaration */)); case 115 /* LetKeyword */: if (isLetDeclaration()) { - return parseVariableStatement(createNodeWithJSDoc(242 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(243 /* VariableDeclaration */)); } break; case 94 /* FunctionKeyword */: - return parseFunctionDeclaration(createNodeWithJSDoc(244 /* FunctionDeclaration */)); + return parseFunctionDeclaration(createNodeWithJSDoc(245 /* FunctionDeclaration */)); case 80 /* ClassKeyword */: - return parseClassDeclaration(createNodeWithJSDoc(245 /* ClassDeclaration */)); + return parseClassDeclaration(createNodeWithJSDoc(246 /* ClassDeclaration */)); case 95 /* IfKeyword */: return parseIfStatement(); case 86 /* DoKeyword */: @@ -23698,9 +23818,9 @@ var ts; case 93 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 82 /* ContinueKeyword */: - return parseBreakOrContinueStatement(233 /* ContinueStatement */); + return parseBreakOrContinueStatement(234 /* ContinueStatement */); case 77 /* BreakKeyword */: - return parseBreakOrContinueStatement(234 /* BreakStatement */); + return parseBreakOrContinueStatement(235 /* BreakStatement */); case 101 /* ReturnKeyword */: return parseReturnStatement(); case 112 /* WithKeyword */: @@ -23721,10 +23841,10 @@ var ts; return parseDeclaration(); case 126 /* AsyncKeyword */: case 114 /* InterfaceKeyword */: - case 145 /* TypeKeyword */: - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: - case 130 /* DeclareKeyword */: + case 146 /* TypeKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: + case 131 /* DeclareKeyword */: case 81 /* ConstKeyword */: case 88 /* EnumKeyword */: case 89 /* ExportKeyword */: @@ -23734,8 +23854,8 @@ var ts; case 119 /* PublicKeyword */: case 122 /* AbstractKeyword */: case 120 /* StaticKeyword */: - case 138 /* ReadonlyKeyword */: - case 150 /* GlobalKeyword */: + case 139 /* ReadonlyKeyword */: + case 151 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -23744,7 +23864,7 @@ var ts; return parseExpressionOrLabeledStatement(); } function isDeclareModifier(modifier) { - return modifier.kind === 130 /* DeclareKeyword */; + return modifier.kind === 131 /* DeclareKeyword */; } function parseDeclaration() { var modifiers = lookAhead(function () { return (parseDecorators(), parseModifiers()); }); @@ -23792,13 +23912,13 @@ var ts; return parseClassDeclaration(node); case 114 /* InterfaceKeyword */: return parseInterfaceDeclaration(node); - case 145 /* TypeKeyword */: + case 146 /* TypeKeyword */: return parseTypeAliasDeclaration(node); case 88 /* EnumKeyword */: return parseEnumDeclaration(node); - case 150 /* GlobalKeyword */: - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: + case 151 /* GlobalKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: return parseModuleDeclaration(node); case 96 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(node); @@ -23817,7 +23937,7 @@ var ts; if (node.decorators || node.modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var missing = createMissingNode(264 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(265 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; @@ -23840,16 +23960,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token() === 27 /* CommaToken */) { - return createNode(215 /* OmittedExpression */); + return createNode(216 /* OmittedExpression */); } - var node = createNode(191 /* BindingElement */); + var node = createNode(192 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(191 /* BindingElement */); + var node = createNode(192 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -23865,14 +23985,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(189 /* ObjectBindingPattern */); + var node = createNode(190 /* ObjectBindingPattern */); parseExpected(18 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(19 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(190 /* ArrayBindingPattern */); + var node = createNode(191 /* ArrayBindingPattern */); parseExpected(22 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(23 /* CloseBracketToken */); @@ -23897,7 +24017,7 @@ var ts; return parseVariableDeclaration(/*allowExclamation*/ true); } function parseVariableDeclaration(allowExclamation) { - var node = createNode(242 /* VariableDeclaration */); + var node = createNode(243 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(ts.Diagnostics.Private_identifiers_are_not_allowed_in_variable_declarations); if (allowExclamation && node.name.kind === 75 /* Identifier */ && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { @@ -23910,7 +24030,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(243 /* VariableDeclarationList */); + var node = createNode(244 /* VariableDeclarationList */); switch (token()) { case 109 /* VarKeyword */: break; @@ -23933,7 +24053,7 @@ var ts; // So we need to look ahead to determine if 'of' should be treated as a keyword in // this context. // The checker will then give an error that there is an empty declaration list. - if (token() === 152 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 153 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -23948,13 +24068,13 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; } function parseVariableStatement(node) { - node.kind = 225 /* VariableStatement */; + node.kind = 226 /* VariableStatement */; node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(node) { - node.kind = 244 /* FunctionDeclaration */; + node.kind = 245 /* FunctionDeclaration */; parseExpected(94 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(41 /* AsteriskToken */); node.name = hasModifierOfKind(node, 84 /* DefaultKeyword */) ? parseOptionalIdentifier() : parseIdentifier(); @@ -23965,8 +24085,8 @@ var ts; return finishNode(node); } function parseConstructorName() { - if (token() === 129 /* ConstructorKeyword */) { - return parseExpected(129 /* ConstructorKeyword */); + if (token() === 130 /* ConstructorKeyword */) { + return parseExpected(130 /* ConstructorKeyword */); } if (token() === 10 /* StringLiteral */ && lookAhead(nextToken) === 20 /* OpenParenToken */) { return tryParse(function () { @@ -23978,7 +24098,7 @@ var ts; function tryParseConstructorDeclaration(node) { return tryParse(function () { if (parseConstructorName()) { - node.kind = 162 /* Constructor */; + node.kind = 163 /* Constructor */; fillSignature(58 /* ColonToken */, 0 /* None */, node); node.body = parseFunctionBlockOrSemicolon(0 /* None */, ts.Diagnostics.or_expected); return finishNode(node); @@ -23986,7 +24106,7 @@ var ts; }); } function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) { - node.kind = 161 /* MethodDeclaration */; + node.kind = 162 /* MethodDeclaration */; node.asteriskToken = asteriskToken; var isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; var isAsync = hasModifierOfKind(node, 126 /* AsyncKeyword */) ? 2 /* Await */ : 0 /* None */; @@ -23995,7 +24115,7 @@ var ts; return finishNode(node); } function parsePropertyDeclaration(node) { - node.kind = 159 /* PropertyDeclaration */; + node.kind = 160 /* PropertyDeclaration */; if (!node.questionToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -24057,7 +24177,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 142 /* SetKeyword */ || idToken === 131 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 143 /* SetKeyword */ || idToken === 132 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -24089,7 +24209,7 @@ var ts; if (!parseOptional(59 /* AtToken */)) { break; } - var decorator = createNode(157 /* Decorator */, decoratorStart); + var decorator = createNode(158 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); (list || (list = [])).push(decorator); @@ -24139,20 +24259,20 @@ var ts; } function parseClassElement() { if (token() === 26 /* SemicolonToken */) { - var result = createNode(222 /* SemicolonClassElement */); + var result = createNode(223 /* SemicolonClassElement */); nextToken(); return finishNode(result); } var node = createNodeWithJSDoc(0 /* Unknown */); node.decorators = parseDecorators(); node.modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); - if (parseContextualModifier(131 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 163 /* GetAccessor */); + if (parseContextualModifier(132 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 164 /* GetAccessor */); } - if (parseContextualModifier(142 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 164 /* SetAccessor */); + if (parseContextualModifier(143 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 165 /* SetAccessor */); } - if (token() === 129 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { + if (token() === 130 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { var constructorDeclaration = tryParseConstructorDeclaration(node); if (constructorDeclaration) { return constructorDeclaration; @@ -24189,10 +24309,10 @@ var ts; return ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 214 /* ClassExpression */); + return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 215 /* ClassExpression */); } function parseClassDeclaration(node) { - return parseClassDeclarationOrExpression(node, 245 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(node, 246 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(node, kind) { node.kind = kind; @@ -24235,14 +24355,14 @@ var ts; function parseHeritageClause() { var tok = token(); ts.Debug.assert(tok === 90 /* ExtendsKeyword */ || tok === 113 /* ImplementsKeyword */); // isListElement() should ensure this. - var node = createNode(279 /* HeritageClause */); + var node = createNode(280 /* HeritageClause */); node.token = tok; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); return finishNode(node); } function parseExpressionWithTypeArguments() { - var node = createNode(216 /* ExpressionWithTypeArguments */); + var node = createNode(217 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); node.typeArguments = tryParseTypeArguments(); return finishNode(node); @@ -24258,7 +24378,7 @@ var ts; return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(node) { - node.kind = 246 /* InterfaceDeclaration */; + node.kind = 247 /* InterfaceDeclaration */; parseExpected(114 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); @@ -24267,8 +24387,8 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(node) { - node.kind = 247 /* TypeAliasDeclaration */; - parseExpected(145 /* TypeKeyword */); + node.kind = 248 /* TypeAliasDeclaration */; + parseExpected(146 /* TypeKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(62 /* EqualsToken */); @@ -24281,13 +24401,13 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNodeWithJSDoc(284 /* EnumMember */); + var node = createNodeWithJSDoc(285 /* EnumMember */); node.name = parsePropertyName(); node.initializer = allowInAnd(parseInitializer); return finishNode(node); } function parseEnumDeclaration(node) { - node.kind = 248 /* EnumDeclaration */; + node.kind = 249 /* EnumDeclaration */; parseExpected(88 /* EnumKeyword */); node.name = parseIdentifier(); if (parseExpected(18 /* OpenBraceToken */)) { @@ -24300,7 +24420,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(250 /* ModuleBlock */); + var node = createNode(251 /* ModuleBlock */); if (parseExpected(18 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(19 /* CloseBraceToken */); @@ -24311,7 +24431,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(node, flags) { - node.kind = 249 /* ModuleDeclaration */; + node.kind = 250 /* ModuleDeclaration */; // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 16 /* Namespace */; @@ -24323,8 +24443,8 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(node) { - node.kind = 249 /* ModuleDeclaration */; - if (token() === 150 /* GlobalKeyword */) { + node.kind = 250 /* ModuleDeclaration */; + if (token() === 151 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation node.name = parseIdentifier(); node.flags |= 1024 /* GlobalAugmentation */; @@ -24343,15 +24463,15 @@ var ts; } function parseModuleDeclaration(node) { var flags = 0; - if (token() === 150 /* GlobalKeyword */) { + if (token() === 151 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(node); } - else if (parseOptional(136 /* NamespaceKeyword */)) { + else if (parseOptional(137 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(135 /* ModuleKeyword */); + parseExpected(136 /* ModuleKeyword */); if (token() === 10 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(node); } @@ -24359,7 +24479,7 @@ var ts; return parseModuleOrNamespaceDeclaration(node, flags); } function isExternalModuleReference() { - return token() === 139 /* RequireKeyword */ && + return token() === 140 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -24369,9 +24489,9 @@ var ts; return nextToken() === 43 /* SlashToken */; } function parseNamespaceExportDeclaration(node) { - node.kind = 252 /* NamespaceExportDeclaration */; + node.kind = 253 /* NamespaceExportDeclaration */; parseExpected(123 /* AsKeyword */); - parseExpected(136 /* NamespaceKeyword */); + parseExpected(137 /* NamespaceKeyword */); node.name = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -24384,7 +24504,7 @@ var ts; identifier = parseIdentifier(); } var isTypeOnly = false; - if (token() !== 149 /* FromKeyword */ && + if (token() !== 150 /* FromKeyword */ && (identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) === "type" && (isIdentifier() || tokenAfterImportDefinitelyProducesImportDeclaration())) { isTypeOnly = true; @@ -24394,7 +24514,7 @@ var ts; return parseImportEqualsDeclaration(node, identifier, isTypeOnly); } // Import statement - node.kind = 254 /* ImportDeclaration */; + node.kind = 255 /* ImportDeclaration */; // ImportDeclaration: // import ImportClause from ModuleSpecifier ; // import ModuleSpecifier; @@ -24403,7 +24523,7 @@ var ts; token() === 18 /* OpenBraceToken */ // import { ) { node.importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); - parseExpected(149 /* FromKeyword */); + parseExpected(150 /* FromKeyword */); } node.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -24415,10 +24535,10 @@ var ts; function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { // In `import id ___`, the current token decides whether to produce // an ImportDeclaration or ImportEqualsDeclaration. - return token() === 27 /* CommaToken */ || token() === 149 /* FromKeyword */; + return token() === 27 /* CommaToken */ || token() === 150 /* FromKeyword */; } function parseImportEqualsDeclaration(node, identifier, isTypeOnly) { - node.kind = 253 /* ImportEqualsDeclaration */; + node.kind = 254 /* ImportEqualsDeclaration */; node.name = identifier; parseExpected(62 /* EqualsToken */); node.moduleReference = parseModuleReference(); @@ -24436,7 +24556,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(255 /* ImportClause */, fullStart); + var importClause = createNode(256 /* ImportClause */, fullStart); importClause.isTypeOnly = isTypeOnly; if (identifier) { // ImportedDefaultBinding: @@ -24447,7 +24567,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(27 /* CommaToken */)) { - importClause.namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(257 /* NamedImports */); + importClause.namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(258 /* NamedImports */); } return finishNode(importClause); } @@ -24457,8 +24577,8 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(265 /* ExternalModuleReference */); - parseExpected(139 /* RequireKeyword */); + var node = createNode(266 /* ExternalModuleReference */); + parseExpected(140 /* RequireKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = parseModuleSpecifier(); parseExpected(21 /* CloseParenToken */); @@ -24480,7 +24600,7 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(256 /* NamespaceImport */); + var namespaceImport = createNode(257 /* NamespaceImport */); parseExpected(41 /* AsteriskToken */); parseExpected(123 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -24495,14 +24615,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 257 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); + node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 258 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(263 /* ExportSpecifier */); + return parseImportOrExportSpecifier(264 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(258 /* ImportSpecifier */); + return parseImportOrExportSpecifier(259 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -24527,34 +24647,34 @@ var ts; else { node.name = identifierName; } - if (kind === 258 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 259 /* ImportSpecifier */ && checkIdentifierIsKeyword) { parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseNamespaceExport(pos) { - var node = createNode(262 /* NamespaceExport */, pos); + var node = createNode(263 /* NamespaceExport */, pos); node.name = parseIdentifier(); return finishNode(node); } function parseExportDeclaration(node) { - node.kind = 260 /* ExportDeclaration */; - node.isTypeOnly = parseOptional(145 /* TypeKeyword */); + node.kind = 261 /* ExportDeclaration */; + node.isTypeOnly = parseOptional(146 /* TypeKeyword */); var namespaceExportPos = scanner.getStartPos(); if (parseOptional(41 /* AsteriskToken */)) { if (parseOptional(123 /* AsKeyword */)) { node.exportClause = parseNamespaceExport(namespaceExportPos); } - parseExpected(149 /* FromKeyword */); + parseExpected(150 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(261 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(262 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 149 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(149 /* FromKeyword */); + if (token() === 150 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(150 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -24562,7 +24682,7 @@ var ts; return finishNode(node); } function parseExportAssignment(node) { - node.kind = 259 /* ExportAssignment */; + node.kind = 260 /* ExportAssignment */; if (parseOptional(62 /* EqualsToken */)) { node.isExportEquals = true; } @@ -24582,10 +24702,10 @@ var ts; } function isAnExternalModuleIndicatorNode(node) { return hasModifierOfKind(node, 89 /* ExportKeyword */) - || node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 265 /* ExternalModuleReference */ - || node.kind === 254 /* ImportDeclaration */ - || node.kind === 259 /* ExportAssignment */ - || node.kind === 260 /* ExportDeclaration */ ? node : undefined; + || node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 266 /* ExternalModuleReference */ + || node.kind === 255 /* ImportDeclaration */ + || node.kind === 260 /* ExportAssignment */ + || node.kind === 261 /* ExportDeclaration */ ? node : undefined; } function getImportMetaIfNecessary(sourceFile) { return sourceFile.flags & 2097152 /* PossiblyContainsImportMeta */ ? @@ -24651,7 +24771,7 @@ var ts; JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; // Parses out a JSDoc type expression. function parseJSDocTypeExpression(mayOmitBraces) { - var result = createNode(294 /* JSDocTypeExpression */); + var result = createNode(295 /* JSDocTypeExpression */); var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(18 /* OpenBraceToken */); result.type = doInsideOfContext(4194304 /* JSDoc */, parseJSDocType); if (!mayOmitBraces || hasBrace) { @@ -24814,7 +24934,7 @@ var ts; } } function createJSDocComment() { - var result = createNode(303 /* JSDocComment */, start); + var result = createNode(304 /* JSDocComment */, start); result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd); result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -24884,19 +25004,19 @@ var ts; break; case "class": case "constructor": - tag = parseSimpleTag(start, 310 /* JSDocClassTag */, tagName); + tag = parseSimpleTag(start, 311 /* JSDocClassTag */, tagName); break; case "public": - tag = parseSimpleTag(start, 311 /* JSDocPublicTag */, tagName); + tag = parseSimpleTag(start, 312 /* JSDocPublicTag */, tagName); break; case "private": - tag = parseSimpleTag(start, 312 /* JSDocPrivateTag */, tagName); + tag = parseSimpleTag(start, 313 /* JSDocPrivateTag */, tagName); break; case "protected": - tag = parseSimpleTag(start, 313 /* JSDocProtectedTag */, tagName); + tag = parseSimpleTag(start, 314 /* JSDocProtectedTag */, tagName); break; case "readonly": - tag = parseSimpleTag(start, 314 /* JSDocReadonlyTag */, tagName); + tag = parseSimpleTag(start, 315 /* JSDocReadonlyTag */, tagName); break; case "this": tag = parseThisTag(start, tagName); @@ -25031,7 +25151,7 @@ var ts; return comments.length === 0 ? undefined : comments.join(""); } function parseUnknownTag(start, tagName) { - var result = createNode(306 /* JSDocTag */, start); + var result = createNode(307 /* JSDocTag */, start); result.tagName = tagName; return finishNode(result); } @@ -25076,9 +25196,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 141 /* ObjectKeyword */: + case 142 /* ObjectKeyword */: return true; - case 174 /* ArrayType */: + case 175 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; @@ -25094,8 +25214,8 @@ var ts; typeExpression = tryParseTypeExpression(); } var result = target === 1 /* Property */ ? - createNode(323 /* JSDocPropertyTag */, start) : - createNode(317 /* JSDocParameterTag */, start); + createNode(324 /* JSDocPropertyTag */, start) : + createNode(318 /* JSDocParameterTag */, start); var comment = parseTagComments(indent + scanner.getStartPos() - start); var nestedTypeLiteral = target !== 4 /* CallbackParameter */ && parseNestedTypeLiteral(typeExpression, name, target, indent); if (nestedTypeLiteral) { @@ -25112,20 +25232,20 @@ var ts; } function parseNestedTypeLiteral(typeExpression, name, target, indent) { if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { - var typeLiteralExpression = createNode(294 /* JSDocTypeExpression */, scanner.getTokenPos()); + var typeLiteralExpression = createNode(295 /* JSDocTypeExpression */, scanner.getTokenPos()); var child = void 0; var jsdocTypeLiteral = void 0; var start_3 = scanner.getStartPos(); var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) { - if (child.kind === 317 /* JSDocParameterTag */ || child.kind === 323 /* JSDocPropertyTag */) { + if (child.kind === 318 /* JSDocParameterTag */ || child.kind === 324 /* JSDocPropertyTag */) { children = ts.append(children, child); } } if (children) { - jsdocTypeLiteral = createNode(304 /* JSDocTypeLiteral */, start_3); + jsdocTypeLiteral = createNode(305 /* JSDocTypeLiteral */, start_3); jsdocTypeLiteral.jsDocPropertyTags = children; - if (typeExpression.type.kind === 174 /* ArrayType */) { + if (typeExpression.type.kind === 175 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typeLiteralExpression.type = finishNode(jsdocTypeLiteral); @@ -25137,7 +25257,7 @@ var ts; if (ts.some(tags, ts.isJSDocReturnTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(318 /* JSDocReturnTag */, start); + var result = createNode(319 /* JSDocReturnTag */, start); result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); @@ -25146,13 +25266,13 @@ var ts; if (ts.some(tags, ts.isJSDocTypeTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(320 /* JSDocTypeTag */, start); + var result = createNode(321 /* JSDocTypeTag */, start); result.tagName = tagName; result.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); return finishNode(result); } function parseAuthorTag(start, tagName, indent) { - var result = createNode(309 /* JSDocAuthorTag */, start); + var result = createNode(310 /* JSDocAuthorTag */, start); result.tagName = tagName; var authorInfoWithEmail = tryParse(function () { return tryParseAuthorNameAndEmail(); }); if (!authorInfoWithEmail) { @@ -25206,20 +25326,20 @@ var ts; } } function parseImplementsTag(start, tagName) { - var result = createNode(308 /* JSDocImplementsTag */, start); + var result = createNode(309 /* JSDocImplementsTag */, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseAugmentsTag(start, tagName) { - var result = createNode(307 /* JSDocAugmentsTag */, start); + var result = createNode(308 /* JSDocAugmentsTag */, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseExpressionWithTypeArgumentsForAugments() { var usedBrace = parseOptional(18 /* OpenBraceToken */); - var node = createNode(216 /* ExpressionWithTypeArguments */); + var node = createNode(217 /* ExpressionWithTypeArguments */); node.expression = parsePropertyAccessEntityNameExpression(); node.typeArguments = tryParseTypeArguments(); var res = finishNode(node); @@ -25231,7 +25351,7 @@ var ts; function parsePropertyAccessEntityNameExpression() { var node = parseJSDocIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var prop = createNode(194 /* PropertyAccessExpression */, node.pos); + var prop = createNode(195 /* PropertyAccessExpression */, node.pos); prop.expression = node; prop.name = parseJSDocIdentifierName(); node = finishNode(prop); @@ -25244,14 +25364,14 @@ var ts; return finishNode(tag); } function parseThisTag(start, tagName) { - var tag = createNode(319 /* JSDocThisTag */, start); + var tag = createNode(320 /* JSDocThisTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); return finishNode(tag); } function parseEnumTag(start, tagName) { - var tag = createNode(316 /* JSDocEnumTag */, start); + var tag = createNode(317 /* JSDocEnumTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); @@ -25260,7 +25380,7 @@ var ts; function parseTypedefTag(start, tagName, indent) { var typeExpression = tryParseTypeExpression(); skipWhitespaceOrAsterisk(); - var typedefTag = createNode(322 /* JSDocTypedefTag */, start); + var typedefTag = createNode(323 /* JSDocTypedefTag */, start); typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(); typedefTag.name = getJSDocTypeAliasName(typedefTag.fullName); @@ -25274,9 +25394,9 @@ var ts; var childTypeTag = void 0; while (child = tryParse(function () { return parseChildPropertyTag(indent); })) { if (!jsdocTypeLiteral) { - jsdocTypeLiteral = createNode(304 /* JSDocTypeLiteral */, start); + jsdocTypeLiteral = createNode(305 /* JSDocTypeLiteral */, start); } - if (child.kind === 320 /* JSDocTypeTag */) { + if (child.kind === 321 /* JSDocTypeTag */) { if (childTypeTag) { break; } @@ -25289,7 +25409,7 @@ var ts; } } if (jsdocTypeLiteral) { - if (typeExpression && typeExpression.type.kind === 174 /* ArrayType */) { + if (typeExpression && typeExpression.type.kind === 175 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? @@ -25308,7 +25428,7 @@ var ts; } var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (parseOptional(24 /* DotToken */)) { - var jsDocNamespaceNode = createNode(249 /* ModuleDeclaration */, pos); + var jsDocNamespaceNode = createNode(250 /* ModuleDeclaration */, pos); if (nested) { jsDocNamespaceNode.flags |= 4 /* NestedNamespace */; } @@ -25322,14 +25442,14 @@ var ts; return typeNameOrNamespaceName; } function parseCallbackTag(start, tagName, indent) { - var callbackTag = createNode(315 /* JSDocCallbackTag */, start); + var callbackTag = createNode(316 /* JSDocCallbackTag */, start); callbackTag.tagName = tagName; callbackTag.fullName = parseJSDocTypeNameWithNamespace(); callbackTag.name = getJSDocTypeAliasName(callbackTag.fullName); skipWhitespace(); callbackTag.comment = parseTagComments(indent); var child; - var jsdocSignature = createNode(305 /* JSDocSignature */, start); + var jsdocSignature = createNode(306 /* JSDocSignature */, start); jsdocSignature.parameters = []; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent); })) { jsdocSignature.parameters = ts.append(jsdocSignature.parameters, child); @@ -25337,7 +25457,7 @@ var ts; var returnTag = tryParse(function () { if (parseOptionalJsdoc(59 /* AtToken */)) { var tag = parseTag(indent); - if (tag && tag.kind === 318 /* JSDocReturnTag */) { + if (tag && tag.kind === 319 /* JSDocReturnTag */) { return tag; } } @@ -25382,7 +25502,7 @@ var ts; case 59 /* AtToken */: if (canParseTag) { var child = tryParseChildTag(target, indent); - if (child && (child.kind === 317 /* JSDocParameterTag */ || child.kind === 323 /* JSDocPropertyTag */) && + if (child && (child.kind === 318 /* JSDocParameterTag */ || child.kind === 324 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; @@ -25446,13 +25566,13 @@ var ts; var typeParametersPos = getNodePos(); do { skipWhitespace(); - var typeParameter = createNode(155 /* TypeParameter */); + var typeParameter = createNode(156 /* TypeParameter */); typeParameter.name = parseJSDocIdentifierName(ts.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces); finishNode(typeParameter); skipWhitespaceOrAsterisk(); typeParameters.push(typeParameter); } while (parseOptionalJsdoc(27 /* CommaToken */)); - var result = createNode(321 /* JSDocTemplateTag */, start); + var result = createNode(322 /* JSDocTemplateTag */, start); result.tagName = tagName; result.constraint = constraint; result.typeParameters = createNodeArray(typeParameters, typeParametersPos); @@ -26259,7 +26379,9 @@ var ts; ["esnext.symbol", "lib.es2019.symbol.d.ts"], ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"], ["esnext.intl", "lib.esnext.intl.d.ts"], - ["esnext.bigint", "lib.es2020.bigint.d.ts"] + ["esnext.bigint", "lib.es2020.bigint.d.ts"], + ["esnext.string", "lib.esnext.string.d.ts"], + ["esnext.promise", "lib.esnext.promise.d.ts"] ]; /** * An array of supported "lib" reference file names used to determine the order for inclusion @@ -27759,7 +27881,7 @@ var ts; function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) { var result = returnValue ? {} : undefined; var _loop_3 = function (element) { - if (element.kind !== 281 /* PropertyAssignment */) { + if (element.kind !== 282 /* PropertyAssignment */) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); return "continue"; } @@ -27850,13 +27972,13 @@ var ts; case 8 /* NumericLiteral */: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { break; // not valid JSON syntax } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; // Currently having element option declaration in the tsconfig with type "object" @@ -27873,7 +27995,7 @@ var ts; return convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined); } - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -29058,7 +29180,12 @@ var ts; ts.Debug.assert(ts.extensionIsTS(resolved.extension)); return { fileName: resolved.path, packageId: resolved.packageId }; } - function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations) { + function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, resultFromCache) { + var _a; + if (resultFromCache) { + (_a = resultFromCache.failedLookupLocations).push.apply(_a, failedLookupLocations); + return resultFromCache; + } return { resolvedModule: resolved && { resolvedFileName: resolved.path, originalPath: resolved.originalPath === true ? undefined : resolved.originalPath, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, failedLookupLocations: failedLookupLocations @@ -29750,15 +29877,12 @@ var ts; } ts.nodeModuleNameResolver = nodeModuleNameResolver; function nodeModuleNameResolverWorker(moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference) { + var _a, _b; var traceEnabled = isTraceEnabled(compilerOptions, host); var failedLookupLocations = []; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations }; var result = ts.forEach(extensions, function (ext) { return tryResolve(ext); }); - if (result && result.value) { - var _a = result.value, resolved = _a.resolved, isExternalLibraryImport = _a.isExternalLibraryImport; - return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations); - } - return { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; + return createResolvedModuleWithFailedLookupLocations((_a = result === null || result === void 0 ? void 0 : result.value) === null || _a === void 0 ? void 0 : _a.resolved, (_b = result === null || result === void 0 ? void 0 : result.value) === null || _b === void 0 ? void 0 : _b.isExternalLibraryImport, failedLookupLocations, state.resultFromCache); function tryResolve(extensions) { var loader = function (extensions, candidate, onlyRecordFailures, state) { return nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, /*considerPackageJson*/ true); }; var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, state); @@ -30195,13 +30319,12 @@ var ts; } ts.unmangleScopedPackageName = unmangleScopedPackageName; function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, state) { - var _a; var result = cache && cache.get(containingDirectory); if (result) { if (state.traceEnabled) { trace(state.host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory); } - (_a = state.failedLookupLocations).push.apply(_a, result.failedLookupLocations); + state.resultFromCache = result; return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, originalPath: result.resolvedModule.originalPath || true, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId } }; } } @@ -30212,7 +30335,7 @@ var ts; var containingDirectory = ts.getDirectoryPath(containingFile); var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); // No originalPath because classic resolution doesn't resolve realPath - return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations); + return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations, state.resultFromCache); function tryResolve(extensions) { var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state); if (resolvedUsingSettings) { @@ -30257,7 +30380,7 @@ var ts; var failedLookupLocations = []; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations }; var resolved = loadModuleFromImmediateNodeModulesDirectory(Extensions.DtsOnly, moduleName, globalCache, state, /*typesScopeOnly*/ false); - return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations); + return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations, state.resultFromCache); } ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache; /** @@ -30300,26 +30423,26 @@ var ts; // A module is uninstantiated if it contains only switch (node.kind) { // 1. interface declarations, type alias declarations - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: if (ts.isEnumConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: if (!(ts.hasModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } break; // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: var exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 261 /* NamedExports */) { + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 262 /* NamedExports */) { var state = 0 /* NonInstantiated */; for (var _i = 0, _a = exportDeclaration.exportClause.elements; _i < _a.length; _i++) { var specifier = _a[_i]; @@ -30335,7 +30458,7 @@ var ts; } break; // 5. other uninstantiated module declarations. - case 250 /* ModuleBlock */: { + case 251 /* ModuleBlock */: { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateCached(n, visited); @@ -30357,7 +30480,7 @@ var ts; }); return state_1; } - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 75 /* Identifier */: // Only jsdoc typedef definition can exist in jsdoc namespace, and it should @@ -30565,7 +30688,7 @@ var ts; // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { - if (node.kind === 259 /* ExportAssignment */) { + if (node.kind === 260 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } var name = ts.getNameOfDeclaration(node); @@ -30574,7 +30697,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 154 /* ComputedPropertyName */) { + if (name.kind === 155 /* ComputedPropertyName */) { var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteralLike(nameExpression)) { @@ -30602,36 +30725,36 @@ var ts; return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: return "__constructor" /* Constructor */; - case 170 /* FunctionType */: - case 165 /* CallSignature */: - case 305 /* JSDocSignature */: + case 171 /* FunctionType */: + case 166 /* CallSignature */: + case 306 /* JSDocSignature */: return "__call" /* Call */; - case 171 /* ConstructorType */: - case 166 /* ConstructSignature */: + case 172 /* ConstructorType */: + case 167 /* ConstructSignature */: return "__new" /* New */; - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: return "__index" /* Index */; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 290 /* SourceFile */: + case 291 /* SourceFile */: // json file should behave as // module.exports = ... return "export=" /* ExportEquals */; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) { // module.exports = ... return "export=" /* ExportEquals */; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */); - case 156 /* Parameter */: + case 157 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 300 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); + ts.Debug.assert(node.parent.kind === 301 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); var functionType = node.parent; var index = functionType.parameters.indexOf(node); return "arg" + index; @@ -30731,7 +30854,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (node.kind === 259 /* ExportAssignment */ && !node.isExportEquals)) { + (node.kind === 260 /* ExportAssignment */ && !node.isExportEquals)) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName_1 = false; multipleDefaultExports_1 = true; @@ -30770,7 +30893,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 263 /* ExportSpecifier */ || (node.kind === 253 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 264 /* ExportSpecifier */ || (node.kind === 254 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -30837,7 +30960,7 @@ var ts; // for it. We must clear this so we don't accidentally move any stale data forward from // a previous compilation. if (containerFlags & 1 /* IsContainer */) { - if (node.kind !== 202 /* ArrowFunction */) { + if (node.kind !== 203 /* ArrowFunction */) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -30870,7 +30993,7 @@ var ts; } // We create a return control flow graph for IIFEs and constructors. For constructors // we use the return control flow graph in strict property initialization checks. - currentReturnTarget = isIIFE || node.kind === 162 /* Constructor */ ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 163 /* Constructor */ ? createBranchLabel() : undefined; currentExceptionTarget = undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; @@ -30885,13 +31008,13 @@ var ts; node.flags |= 512 /* HasExplicitReturn */; node.endFlowNode = currentFlow; } - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 162 /* Constructor */) { + if (node.kind === 163 /* Constructor */) { node.returnFlowNode = currentFlow; } } @@ -30935,8 +31058,8 @@ var ts; } } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, function (n) { return n.kind === 244 /* FunctionDeclaration */ ? bind(n) : undefined; }); - bindEach(nodes, function (n) { return n.kind !== 244 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind === 245 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind !== 245 /* FunctionDeclaration */ ? bind(n) : undefined; }); } function bindEach(nodes, bindFunction) { if (bindFunction === void 0) { bindFunction = bind; } @@ -30968,90 +31091,90 @@ var ts; bindJSDoc(node); return; } - if (node.kind >= 225 /* FirstStatement */ && node.kind <= 241 /* LastStatement */ && !options.allowUnreachableCode) { + if (node.kind >= 226 /* FirstStatement */ && node.kind <= 242 /* LastStatement */ && !options.allowUnreachableCode) { node.flowNode = currentFlow; } switch (node.kind) { - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: bindWhileStatement(node); break; - case 228 /* DoStatement */: + case 229 /* DoStatement */: bindDoStatement(node); break; - case 230 /* ForStatement */: + case 231 /* ForStatement */: bindForStatement(node); break; - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 227 /* IfStatement */: + case 228 /* IfStatement */: bindIfStatement(node); break; - case 235 /* ReturnStatement */: - case 239 /* ThrowStatement */: + case 236 /* ReturnStatement */: + case 240 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 240 /* TryStatement */: + case 241 /* TryStatement */: bindTryStatement(node); break; - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: bindSwitchStatement(node); break; - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: bindCaseBlock(node); break; - case 277 /* CaseClause */: + case 278 /* CaseClause */: bindCaseClause(node); break; - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: bindExpressionStatement(node); break; - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: bindLabeledStatement(node); break; - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: bindAccessExpressionFlow(node); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: bindCallExpressionFlow(node); break; - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: bindJSDocTypeAlias(node); break; // In source files and blocks, bind functions first to match hoisting that occurs at runtime - case 290 /* SourceFile */: { + case 291 /* SourceFile */: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 223 /* Block */: - case 250 /* ModuleBlock */: + case 224 /* Block */: + case 251 /* ModuleBlock */: bindEachFunctionsFirst(node.statements); break; default: @@ -31064,18 +31187,18 @@ var ts; switch (expr.kind) { case 75 /* Identifier */: case 104 /* ThisKeyword */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return containsNarrowableReference(expr); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return hasNarrowableArgument(expr); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return isNarrowingExpression(expr.expression); } return false; @@ -31097,7 +31220,7 @@ var ts; } } } - if (expr.expression.kind === 194 /* PropertyAccessExpression */ && + if (expr.expression.kind === 195 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { return true; } @@ -31130,9 +31253,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 62 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -31208,26 +31331,26 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 227 /* IfStatement */: - case 229 /* WhileStatement */: - case 228 /* DoStatement */: + case 228 /* IfStatement */: + case 230 /* WhileStatement */: + case 229 /* DoStatement */: return parent.expression === node; - case 230 /* ForStatement */: - case 210 /* ConditionalExpression */: + case 231 /* ForStatement */: + case 211 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 200 /* ParenthesizedExpression */) { + if (node.kind === 201 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 207 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { + else if (node.kind === 208 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 209 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || + return node.kind === 210 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */); } @@ -31269,7 +31392,7 @@ var ts; } function setContinueTarget(node, target) { var label = activeLabelList; - while (label && node.parent.kind === 238 /* LabeledStatement */) { + while (label && node.parent.kind === 239 /* LabeledStatement */) { label.continueTarget = target; label = label.next; node = node.parent; @@ -31320,12 +31443,12 @@ var ts; bind(node.expression); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 232 /* ForOfStatement */) { + if (node.kind === 233 /* ForOfStatement */) { bind(node.awaitModifier); } addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 243 /* VariableDeclarationList */) { + if (node.initializer.kind !== 244 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -31347,7 +31470,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 235 /* ReturnStatement */) { + if (node.kind === 236 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -31364,7 +31487,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 234 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 235 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -31464,7 +31587,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 278 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 279 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). Note, we no longer need // this property in control flow analysis, it's there only for backwards compatibility. @@ -31513,7 +31636,7 @@ var ts; bind(node.expression); // A top level call expression with a dotted function name and at least one argument // is potentially an assertion and is therefore included in the control flow. - if (node.expression.kind === 196 /* CallExpression */) { + if (node.expression.kind === 197 /* CallExpression */) { var call = node.expression; if (ts.isDottedName(call.expression)) { currentFlow = createFlowCall(currentFlow, call); @@ -31539,7 +31662,7 @@ var ts; currentFlow = finishFlowLabel(postStatementLabel); } function bindDestructuringTargetFlow(node) { - if (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { + if (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -31550,10 +31673,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); } - else if (node.kind === 192 /* ArrayLiteralExpression */) { + else if (node.kind === 193 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 213 /* SpreadElement */) { + if (e.kind === 214 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -31561,16 +31684,16 @@ var ts; } } } - else if (node.kind === 193 /* ObjectLiteralExpression */) { + else if (node.kind === 194 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 281 /* PropertyAssignment */) { + if (p.kind === 282 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 282 /* ShorthandPropertyAssignment */) { + else if (p.kind === 283 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 283 /* SpreadAssignment */) { + else if (p.kind === 284 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -31692,7 +31815,7 @@ var ts; var operator = node.operatorToken.kind; if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 62 /* EqualsToken */ && node.left.kind === 195 /* ElementAccessExpression */) { + if (operator === 62 /* EqualsToken */ && node.left.kind === 196 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -31754,7 +31877,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 194 /* PropertyAccessExpression */) { + if (node.expression.kind === 195 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -31793,14 +31916,14 @@ var ts; } function bindJSDocTypeAlias(node) { node.tagName.parent = node; - if (node.kind !== 316 /* JSDocEnumTag */ && node.fullName) { + if (node.kind !== 317 /* JSDocEnumTag */ && node.fullName) { setParentPointers(node, node.fullName); } } function bindJSDocClassTag(node) { bindEachChild(node); var host = ts.getHostSignatureFromJSDoc(node); - if (host && host.kind !== 161 /* MethodDeclaration */) { + if (host && host.kind !== 162 /* MethodDeclaration */) { addDeclarationToSymbol(host.symbol, host, 32 /* Class */); } } @@ -31814,13 +31937,13 @@ var ts; function bindOptionalChainRest(node) { bind(node.questionDotToken); switch (node.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: bind(node.name); break; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: bind(node.argumentExpression); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: bindEach(node.typeArguments); bindEach(node.arguments); break; @@ -31876,7 +31999,7 @@ var ts; // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = ts.skipParentheses(node.expression); - if (expr.kind === 201 /* FunctionExpression */ || expr.kind === 202 /* ArrowFunction */) { + if (expr.kind === 202 /* FunctionExpression */ || expr.kind === 203 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -31885,7 +32008,7 @@ var ts; bindEachChild(node); } } - if (node.expression.kind === 194 /* PropertyAccessExpression */) { + if (node.expression.kind === 195 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (ts.isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -31894,54 +32017,54 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 193 /* ObjectLiteralExpression */: - case 173 /* TypeLiteral */: - case 304 /* JSDocTypeLiteral */: - case 274 /* JsxAttributes */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 194 /* ObjectLiteralExpression */: + case 174 /* TypeLiteral */: + case 305 /* JSDocTypeLiteral */: + case 275 /* JsxAttributes */: return 1 /* IsContainer */; - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 249 /* ModuleDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 186 /* MappedType */: + case 250 /* ModuleDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 187 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 290 /* SourceFile */: + case 291 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } // falls through - case 162 /* Constructor */: - case 244 /* FunctionDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 165 /* CallSignature */: - case 305 /* JSDocSignature */: - case 300 /* JSDocFunctionType */: - case 170 /* FunctionType */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 171 /* ConstructorType */: + case 163 /* Constructor */: + case 245 /* FunctionDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 166 /* CallSignature */: + case 306 /* JSDocSignature */: + case 301 /* JSDocFunctionType */: + case 171 /* FunctionType */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 172 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 280 /* CatchClause */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 251 /* CaseBlock */: + case 281 /* CatchClause */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 252 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 223 /* Block */: + case 224 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -31974,45 +32097,45 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 290 /* SourceFile */: + case 291 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 173 /* TypeLiteral */: - case 304 /* JSDocTypeLiteral */: - case 193 /* ObjectLiteralExpression */: - case 246 /* InterfaceDeclaration */: - case 274 /* JsxAttributes */: + case 174 /* TypeLiteral */: + case 305 /* JSDocTypeLiteral */: + case 194 /* ObjectLiteralExpression */: + case 247 /* InterfaceDeclaration */: + case 275 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 305 /* JSDocSignature */: - case 167 /* IndexSignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 300 /* JSDocFunctionType */: - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 247 /* TypeAliasDeclaration */: - case 186 /* MappedType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 306 /* JSDocSignature */: + case 168 /* IndexSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 301 /* JSDocFunctionType */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 248 /* TypeAliasDeclaration */: + case 187 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -32113,7 +32236,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 283 /* SpreadAssignment */ || prop.name.kind !== 75 /* Identifier */) { + if (prop.kind === 284 /* SpreadAssignment */ || prop.name.kind !== 75 /* Identifier */) { continue; } var identifier = prop.name; @@ -32125,7 +32248,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 281 /* PropertyAssignment */ || prop.kind === 282 /* ShorthandPropertyAssignment */ || prop.kind === 161 /* MethodDeclaration */ + var currentKind = prop.kind === 282 /* PropertyAssignment */ || prop.kind === 283 /* ShorthandPropertyAssignment */ || prop.kind === 162 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen.get(identifier.escapedText); @@ -32157,10 +32280,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (ts.isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -32346,8 +32469,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 290 /* SourceFile */ && - blockScopeContainer.kind !== 249 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 291 /* SourceFile */ && + blockScopeContainer.kind !== 250 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -32442,7 +32565,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 152 /* LastToken */) { + if (node.kind > 153 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -32518,14 +32641,14 @@ var ts; } // falls through case 104 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 282 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 283 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); case 76 /* PrivateIdentifier */: return checkPrivateIdentifier(node); - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: var expr = node; if (currentFlow && isNarrowableReference(expr)) { expr.flowNode = currentFlow; @@ -32540,7 +32663,7 @@ var ts; declareSymbol(file.locals, /*parent*/ undefined, expr.expression, 1 /* FunctionScopedVariable */ | 134217728 /* ModuleExports */, 111550 /* FunctionScopedVariableExcludes */); } break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var specialKind = ts.getAssignmentDeclarationKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -32568,78 +32691,78 @@ var ts; ts.Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return checkStrictModeCatchClause(node); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return checkStrictModeWithStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return checkStrictModeLabeledStatement(node); - case 183 /* ThisType */: + case 184 /* ThisType */: seenThisKeyword = true; return; - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: break; // Binding the children will handle everything - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return bindTypeParameter(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return bindParameter(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 191 /* BindingElement */: + case 192 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return bindPropertyWorker(node); - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 284 /* EnumMember */: + case 285 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */); - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */); - case 170 /* FunctionType */: - case 300 /* JSDocFunctionType */: - case 305 /* JSDocSignature */: - case 171 /* ConstructorType */: + case 171 /* FunctionType */: + case 301 /* JSDocFunctionType */: + case 306 /* JSDocSignature */: + case 172 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 173 /* TypeLiteral */: - case 304 /* JSDocTypeLiteral */: - case 186 /* MappedType */: + case 174 /* TypeLiteral */: + case 305 /* JSDocTypeLiteral */: + case 187 /* MappedType */: return bindAnonymousTypeWorker(node); - case 310 /* JSDocClassTag */: + case 311 /* JSDocClassTag */: return bindJSDocClassTag(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return bindFunctionExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: var assignmentKind = ts.getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7 /* ObjectDefinePropertyValue */: @@ -32658,65 +32781,65 @@ var ts; } break; // Members of classes, interfaces, and modules - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return bindJsxAttributes(node); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 253 /* ImportEqualsDeclaration */: - case 256 /* NamespaceImport */: - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 254 /* ImportEqualsDeclaration */: + case 257 /* NamespaceImport */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return bindImportClause(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return bindExportDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return bindExportAssignment(node); - case 290 /* SourceFile */: + case 291 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 223 /* Block */: + case 224 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } // falls through - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 317 /* JSDocParameterTag */: - if (node.parent.kind === 305 /* JSDocSignature */) { + case 318 /* JSDocParameterTag */: + if (node.parent.kind === 306 /* JSDocSignature */) { return bindParameter(node); } - if (node.parent.kind !== 304 /* JSDocTypeLiteral */) { + if (node.parent.kind !== 305 /* JSDocTypeLiteral */) { break; } // falls through - case 323 /* JSDocPropertyTag */: + case 324 /* JSDocPropertyTag */: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 299 /* JSDocOptionalType */ ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 300 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); } } @@ -32872,8 +32995,8 @@ var ts; } var thisContainer = ts.getThisContainer(node, /*includeArrowFunctions*/ false); switch (thisContainer.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: var constructorSymbol = thisContainer.symbol; // For `f.prototype.m = function() { this.x = 0; }`, `this.x = 0` should modify `f`'s members, not the function expression. if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -32895,11 +33018,11 @@ var ts; addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */); } break; - case 162 /* Constructor */: - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 163 /* Constructor */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // this.foo assignment in a JavaScript class // Bind this property to the containing class var containingClass = thisContainer.parent; @@ -32911,7 +33034,7 @@ var ts; declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, /*isReplaceableByMethod*/ true); } break; - case 290 /* SourceFile */: + case 291 /* SourceFile */: // this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script if (ts.hasDynamicName(node)) { break; @@ -32941,7 +33064,7 @@ var ts; if (node.expression.kind === 104 /* ThisKeyword */) { bindThisPropertyAssignment(node); } - else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 290 /* SourceFile */) { + else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 291 /* SourceFile */) { if (ts.isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } @@ -32981,7 +33104,7 @@ var ts; } function bindObjectDefinePropertyAssignment(node) { var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - var isToplevel = node.parent.parent.kind === 290 /* SourceFile */; + var isToplevel = node.parent.parent.kind === 291 /* SourceFile */; namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, /*isPrototypeProperty*/ false, /*containerIsClass*/ false); bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, /*isPrototypeProperty*/ false); } @@ -33083,8 +33206,8 @@ var ts; } function isTopLevelNamespaceAssignment(propertyAccess) { return ts.isBinaryExpression(propertyAccess.parent) - ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 290 /* SourceFile */ - : propertyAccess.parent.parent.kind === 290 /* SourceFile */; + ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 291 /* SourceFile */ + : propertyAccess.parent.parent.kind === 291 /* SourceFile */; } function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { var namespaceSymbol = lookupSymbolForPropertyAccess(name); @@ -33163,7 +33286,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 245 /* ClassDeclaration */) { + if (node.kind === 246 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */); } else { @@ -33226,7 +33349,7 @@ var ts; } } function bindParameter(node) { - if (node.kind === 317 /* JSDocParameterTag */ && container.kind !== 305 /* JSDocSignature */) { + if (node.kind === 318 /* JSDocParameterTag */ && container.kind !== 306 /* JSDocSignature */) { return; } if (inStrictMode && !(node.flags & 8388608 /* Ambient */)) { @@ -33303,7 +33426,7 @@ var ts; declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); } } - else if (node.parent.kind === 181 /* InferType */) { + else if (node.parent.kind === 182 /* InferType */) { var container_2 = getInferTypeContainer(node.parent); if (container_2) { if (!container_2.locals) { @@ -33331,11 +33454,11 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 224 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 225 /* EmptyStatement */) || // report error on class declarations - node.kind === 245 /* ClassDeclaration */ || + node.kind === 246 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 249 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); + (node.kind === 250 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); if (reportError) { currentFlow = reportedUnreachableFlow; if (!options.allowUnreachableCode) { @@ -33379,12 +33502,12 @@ var ts; } function isPurelyTypeDeclaration(s) { switch (s.kind) { - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: return true; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return getModuleInstanceState(s) !== 1 /* Instantiated */; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return ts.hasModifier(s, 2048 /* Const */); default: return false; @@ -33433,58 +33556,58 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 196 /* CallExpression */: + case 197 /* CallExpression */: return computeCallExpression(node, subtreeFlags); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return computeNewExpression(node, subtreeFlags); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return computeModuleDeclaration(node, subtreeFlags); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return computeParenthesizedExpression(node, subtreeFlags); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return computeBinaryExpression(node, subtreeFlags); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return computeExpressionStatement(node, subtreeFlags); - case 156 /* Parameter */: + case 157 /* Parameter */: return computeParameter(node, subtreeFlags); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return computeArrowFunction(node, subtreeFlags); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return computeFunctionExpression(node, subtreeFlags); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return computeFunctionDeclaration(node, subtreeFlags); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return computeVariableDeclaration(node, subtreeFlags); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return computeVariableDeclarationList(node, subtreeFlags); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return computeVariableStatement(node, subtreeFlags); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return computeLabeledStatement(node, subtreeFlags); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return computeClassDeclaration(node, subtreeFlags); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return computeClassExpression(node, subtreeFlags); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: return computeHeritageClause(node, subtreeFlags); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return computeCatchClause(node, subtreeFlags); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 162 /* Constructor */: + case 163 /* Constructor */: return computeConstructor(node, subtreeFlags); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return computePropertyDeclaration(node, subtreeFlags); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return computeMethod(node, subtreeFlags); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return computeAccessor(node, subtreeFlags); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return computeImportEquals(node, subtreeFlags); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return computePropertyAccess(node, subtreeFlags); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return computeElementAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); @@ -33535,12 +33658,12 @@ var ts; if (operatorTokenKind === 60 /* QuestionQuestionToken */) { transformFlags |= 8 /* AssertES2020 */; } - else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 193 /* ObjectLiteralExpression */) { + else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 194 /* ObjectLiteralExpression */) { // Destructuring object assignments with are ES2015 syntax // and possibly ES2018 if they contain rest transformFlags |= 32 /* AssertES2018 */ | 256 /* AssertES2015 */ | 1024 /* AssertDestructuringAssignment */; } - else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 192 /* ArrayLiteralExpression */) { + else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 193 /* ArrayLiteralExpression */) { // Destructuring assignments are ES2015 syntax. transformFlags |= 256 /* AssertES2015 */ | 1024 /* AssertDestructuringAssignment */; } @@ -33588,8 +33711,8 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (expressionKind === 217 /* AsExpression */ - || expressionKind === 199 /* TypeAssertionExpression */) { + if (expressionKind === 218 /* AsExpression */ + || expressionKind === 200 /* TypeAssertionExpression */) { transformFlags |= 1 /* AssertTypeScript */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; @@ -33937,13 +34060,13 @@ var ts; // async is ES2017 syntax, but may be ES2018 syntax (for async generators) transformFlags |= 32 /* AssertES2018 */ | 64 /* AssertES2017 */; break; - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: // await is ES2017 syntax, but may be ES2018 syntax (for async generators) transformFlags |= 32 /* AssertES2018 */ | 64 /* AssertES2017 */ | 524288 /* ContainsAwait */; break; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: - case 326 /* PartiallyEmittedExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: + case 327 /* PartiallyEmittedExpression */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; excludeFlags = 536870912 /* OuterExpressionExcludes */; @@ -33952,27 +34075,27 @@ var ts; case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 122 /* AbstractKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 81 /* ConstKeyword */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 218 /* NonNullExpression */: - case 138 /* ReadonlyKeyword */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 219 /* NonNullExpression */: + case 139 /* ReadonlyKeyword */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; break; - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: case 11 /* JsxText */: - case 269 /* JsxClosingElement */: - case 270 /* JsxFragment */: - case 271 /* JsxOpeningFragment */: - case 272 /* JsxClosingFragment */: - case 273 /* JsxAttribute */: - case 274 /* JsxAttributes */: - case 275 /* JsxSpreadAttribute */: - case 276 /* JsxExpression */: + case 270 /* JsxClosingElement */: + case 271 /* JsxFragment */: + case 272 /* JsxOpeningFragment */: + case 273 /* JsxClosingFragment */: + case 274 /* JsxAttribute */: + case 275 /* JsxAttributes */: + case 276 /* JsxSpreadAttribute */: + case 277 /* JsxExpression */: // These nodes are Jsx syntax. transformFlags |= 2 /* AssertJsx */; break; @@ -33985,16 +34108,16 @@ var ts; break; } // falls through - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: if (ts.hasInvalidEscape(node.template)) { transformFlags |= 32 /* AssertES2018 */; break; } // falls through - case 211 /* TemplateExpression */: - case 282 /* ShorthandPropertyAssignment */: + case 212 /* TemplateExpression */: + case 283 /* ShorthandPropertyAssignment */: case 120 /* StaticKeyword */: - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: // These nodes are ES6 syntax. transformFlags |= 256 /* AssertES2015 */; break; @@ -34011,70 +34134,70 @@ var ts; case 9 /* BigIntLiteral */: transformFlags |= 4 /* AssertESNext */; break; - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: // This node is either ES2015 syntax or ES2017 syntax (if it is a for-await-of). if (node.awaitModifier) { transformFlags |= 32 /* AssertES2018 */; } transformFlags |= 256 /* AssertES2015 */; break; - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: // This node is either ES2015 syntax (in a generator) or ES2017 syntax (in an async // generator). transformFlags |= 32 /* AssertES2018 */ | 256 /* AssertES2015 */ | 262144 /* ContainsYield */; break; case 125 /* AnyKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 137 /* NeverKeyword */: - case 141 /* ObjectKeyword */: - case 143 /* StringKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 138 /* NeverKeyword */: + case 142 /* ObjectKeyword */: + case 144 /* StringKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: case 110 /* VoidKeyword */: - case 155 /* TypeParameter */: - case 158 /* PropertySignature */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 168 /* TypePredicate */: - case 169 /* TypeReference */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 172 /* TypeQuery */: - case 173 /* TypeLiteral */: - case 174 /* ArrayType */: - case 175 /* TupleType */: - case 176 /* OptionalType */: - case 177 /* RestType */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 180 /* ConditionalType */: - case 181 /* InferType */: - case 182 /* ParenthesizedType */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 183 /* ThisType */: - case 184 /* TypeOperator */: - case 185 /* IndexedAccessType */: - case 186 /* MappedType */: - case 187 /* LiteralType */: - case 252 /* NamespaceExportDeclaration */: + case 156 /* TypeParameter */: + case 159 /* PropertySignature */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 169 /* TypePredicate */: + case 170 /* TypeReference */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 173 /* TypeQuery */: + case 174 /* TypeLiteral */: + case 175 /* ArrayType */: + case 176 /* TupleType */: + case 177 /* OptionalType */: + case 178 /* RestType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 181 /* ConditionalType */: + case 182 /* InferType */: + case 183 /* ParenthesizedType */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 184 /* ThisType */: + case 185 /* TypeOperator */: + case 186 /* IndexedAccessType */: + case 187 /* MappedType */: + case 188 /* LiteralType */: + case 253 /* NamespaceExportDeclaration */: // Types and signatures are TypeScript syntax, and exclude all other facts. transformFlags = 1 /* AssertTypeScript */; excludeFlags = -2 /* TypeExcludes */; break; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: // Even though computed property names are ES6, we don't treat them as such. // This is so that they can flow through PropertyName transforms unaffected. // Instead, we mark the container as ES6, so that it can properly handle the transform. transformFlags |= 32768 /* ContainsComputedPropertyName */; break; - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: transformFlags |= 256 /* AssertES2015 */ | 8192 /* ContainsRestOrSpread */; break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: transformFlags |= 32 /* AssertES2018 */ | 16384 /* ContainsObjectRestOrSpread */; break; case 102 /* SuperKeyword */: @@ -34086,28 +34209,28 @@ var ts; // Mark this node and its ancestors as containing a lexical `this` keyword. transformFlags |= 4096 /* ContainsLexicalThis */; break; - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: transformFlags |= 256 /* AssertES2015 */ | 131072 /* ContainsBindingPattern */; if (subtreeFlags & 8192 /* ContainsRestOrSpread */) { transformFlags |= 32 /* AssertES2018 */ | 16384 /* ContainsObjectRestOrSpread */; } excludeFlags = 536879104 /* BindingPatternExcludes */; break; - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: transformFlags |= 256 /* AssertES2015 */ | 131072 /* ContainsBindingPattern */; excludeFlags = 536879104 /* BindingPatternExcludes */; break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: transformFlags |= 256 /* AssertES2015 */; if (node.dotDotDotToken) { transformFlags |= 8192 /* ContainsRestOrSpread */; } break; - case 157 /* Decorator */: + case 158 /* Decorator */: // This node is TypeScript syntax, and marks its container as also being TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */ | 2048 /* ContainsTypeScriptClassSyntax */; break; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: excludeFlags = 536922112 /* ObjectLiteralExcludes */; if (subtreeFlags & 32768 /* ContainsComputedPropertyName */) { // If an ObjectLiteralExpression contains a ComputedPropertyName, then it @@ -34120,29 +34243,29 @@ var ts; transformFlags |= 32 /* AssertES2018 */; } break; - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: excludeFlags = 536879104 /* ArrayLiteralOrCallOrNewExcludes */; break; - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: // A loop containing a block scoped binding *may* need to be transformed from ES6. if (subtreeFlags & 65536 /* ContainsBlockScopedBinding */) { transformFlags |= 256 /* AssertES2015 */; } break; - case 290 /* SourceFile */: + case 291 /* SourceFile */: break; - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: transformFlags |= 4 /* AssertESNext */; break; - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: // Return statements may require an `await` in ES2018. transformFlags |= 1048576 /* ContainsHoistedDeclarationOrCompletion */ | 32 /* AssertES2018 */; break; - case 233 /* ContinueStatement */: - case 234 /* BreakStatement */: + case 234 /* ContinueStatement */: + case 235 /* BreakStatement */: transformFlags |= 1048576 /* ContainsHoistedDeclarationOrCompletion */; break; case 76 /* PrivateIdentifier */: @@ -34163,67 +34286,67 @@ var ts; * than calling this function. */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 168 /* FirstTypeNode */ && kind <= 188 /* LastTypeNode */) { + if (kind >= 169 /* FirstTypeNode */ && kind <= 189 /* LastTypeNode */) { return -2 /* TypeExcludes */; } switch (kind) { - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 192 /* ArrayLiteralExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 193 /* ArrayLiteralExpression */: return 536879104 /* ArrayLiteralOrCallOrNewExcludes */; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return 537991168 /* ModuleExcludes */; - case 156 /* Parameter */: + case 157 /* Parameter */: return 536870912 /* ParameterExcludes */; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return 538920960 /* ArrowFunctionExcludes */; - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: return 538925056 /* FunctionExcludes */; - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return 537018368 /* VariableDeclarationListExcludes */; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return 536905728 /* ClassExcludes */; - case 162 /* Constructor */: + case 163 /* Constructor */: return 538923008 /* ConstructorExcludes */; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return 538923008 /* MethodOrAccessorExcludes */; case 125 /* AnyKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 137 /* NeverKeyword */: - case 143 /* StringKeyword */: - case 141 /* ObjectKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 138 /* NeverKeyword */: + case 144 /* StringKeyword */: + case 142 /* ObjectKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: case 110 /* VoidKeyword */: - case 155 /* TypeParameter */: - case 158 /* PropertySignature */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 156 /* TypeParameter */: + case 159 /* PropertySignature */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: return -2 /* TypeExcludes */; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return 536922112 /* ObjectLiteralExcludes */; - case 280 /* CatchClause */: + case 281 /* CatchClause */: return 536887296 /* CatchClauseExcludes */; - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: return 536879104 /* BindingPatternExcludes */; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: - case 326 /* PartiallyEmittedExpression */: - case 200 /* ParenthesizedExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: + case 327 /* PartiallyEmittedExpression */: + case 201 /* ParenthesizedExpression */: case 102 /* SuperKeyword */: return 536870912 /* OuterExpressionExcludes */; - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return 536870912 /* PropertyAccessExcludes */; default: return 536870912 /* NodeExcludes */; @@ -34398,7 +34521,7 @@ var ts; // (their type resolved directly to the member deeply referenced) // So to get the intervening symbols, we need to check if there's a type // query node on any of the symbol's declarations and get symbols there - if (d.type && d.type.kind === 172 /* TypeQuery */) { + if (d.type && d.type.kind === 173 /* TypeQuery */) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -34584,6 +34707,7 @@ var ts; IntersectionState[IntersectionState["None"] = 0] = "None"; IntersectionState[IntersectionState["Source"] = 1] = "Source"; IntersectionState[IntersectionState["Target"] = 2] = "Target"; + IntersectionState[IntersectionState["ExcessCheck"] = 4] = "ExcessCheck"; })(IntersectionState || (IntersectionState = {})); var MappedTypeModifiers; (function (MappedTypeModifiers) { @@ -34626,6 +34750,11 @@ var ts; DeclarationSpaces[DeclarationSpaces["ExportType"] = 2] = "ExportType"; DeclarationSpaces[DeclarationSpaces["ExportNamespace"] = 4] = "ExportNamespace"; })(DeclarationSpaces || (DeclarationSpaces = {})); + function SymbolLinks() { + } + function NodeLinks() { + this.flags = 0; + } function getNodeId(node) { if (!node.id) { node.id = nextNodeId; @@ -34685,7 +34814,6 @@ var ts; var constraintDepth = 0; var currentNode; var emptySymbols = ts.createSymbolTable(); - var identityMapper = ts.identity; var arrayVariances = [1 /* Covariant */]; var compilerOptions = host.getCompilerOptions(); var languageVersion = ts.getEmitScriptTarget(compilerOptions); @@ -35035,6 +35163,7 @@ var ts; var literalTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); var substitutionTypes = ts.createMap(); + var awaitedTypes = ts.createMap(); var evolvingArrayTypes = []; var undefinedProperties = ts.createMap(); var unknownSymbol = createSymbol(4 /* Property */, "unknown"); @@ -35082,6 +35211,8 @@ var ts; var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); var keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; var numberOrBigIntType = getUnionType([numberType, bigintType]); + var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t; }); + var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? wildcardType : t; }); var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var emptyJsxObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); emptyJsxObjectType.objectFlags |= 4096 /* JsxAttributes */; @@ -35591,14 +35722,14 @@ var ts; if (symbol.flags & 33554432 /* Transient */) return symbol; var id = getSymbolId(symbol); - return symbolLinks[id] || (symbolLinks[id] = {}); + return symbolLinks[id] || (symbolLinks[id] = new SymbolLinks()); } function getNodeLinks(node) { var nodeId = getNodeId(node); - return nodeLinks[nodeId] || (nodeLinks[nodeId] = { flags: 0 }); + return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); } function isGlobalSourceFile(node) { - return node.kind === 290 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 291 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -35656,17 +35787,17 @@ var ts; } if (declaration.pos <= usage.pos) { // declaration is before usage - if (declaration.kind === 191 /* BindingElement */) { + if (declaration.kind === 192 /* BindingElement */) { // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) - var errorBindingElement = ts.getAncestor(usage, 191 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 192 /* BindingElement */); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 242 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 243 /* VariableDeclaration */), usage); } - else if (declaration.kind === 242 /* VariableDeclaration */) { + else if (declaration.kind === 243 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } @@ -35697,12 +35828,12 @@ var ts; // or if usage is in a type context: // 1. inside a type query (typeof in type position) // 2. inside a jsdoc comment - if (usage.parent.kind === 263 /* ExportSpecifier */ || (usage.parent.kind === 259 /* ExportAssignment */ && usage.parent.isExportEquals)) { + if (usage.parent.kind === 264 /* ExportSpecifier */ || (usage.parent.kind === 260 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } // When resolving symbols for exports, the `usage` location passed in can be the export site directly - if (usage.kind === 259 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 260 /* ExportAssignment */ && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -35722,9 +35853,9 @@ var ts; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 225 /* VariableStatement */: - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: + case 226 /* VariableStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, container)) { @@ -35745,16 +35876,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 159 /* PropertyDeclaration */ && + current.parent.kind === 160 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasModifier(current.parent, 32 /* Static */)) { - if (declaration.kind === 161 /* MethodDeclaration */) { + if (declaration.kind === 162 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -35776,19 +35907,19 @@ var ts; return "quit"; } switch (node.kind) { - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return true; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // even when stopping at any property declaration, they need to come from the same class return stopAtAnyPropertyDeclaration && (ts.isPropertyDeclaration(declaration) && node.parent === declaration.parent || ts.isParameterPropertyDeclaration(declaration, declaration.parent) && node.parent === declaration.parent.parent) ? "quit" : true; - case 223 /* Block */: + case 224 /* Block */: switch (node.parent.kind) { - case 163 /* GetAccessor */: - case 161 /* MethodDeclaration */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 162 /* MethodDeclaration */: + case 165 /* SetAccessor */: return true; default: return false; @@ -35834,12 +35965,12 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 303 /* JSDocComment */) { + if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 304 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === location.type || - lastLocation.kind === 156 /* Parameter */ || - lastLocation.kind === 155 /* TypeParameter */ + lastLocation.kind === 157 /* Parameter */ || + lastLocation.kind === 156 /* TypeParameter */ // local types not visible outside the function body : false; } @@ -35856,13 +35987,13 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 156 /* Parameter */ || + lastLocation.kind === 157 /* Parameter */ || (lastLocation === location.type && !!ts.findAncestor(result.valueDeclaration, ts.isParameter)); } } } - else if (location.kind === 180 /* ConditionalType */) { + else if (location.kind === 181 /* ConditionalType */) { // A type parameter declared using 'infer T' in a conditional type is visible only in // the true branch of the conditional type. useResult = lastLocation === location.trueType; @@ -35877,14 +36008,14 @@ var ts; } withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; // falls through - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports || emptySymbols; - if (location.kind === 290 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { + if (location.kind === 291 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. if (result = moduleExports.get("default" /* Default */)) { @@ -35908,7 +36039,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && - (ts.getDeclarationOfKind(moduleExport, 263 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 262 /* NamespaceExport */))) { + (ts.getDeclarationOfKind(moduleExport, 264 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 263 /* NamespaceExport */))) { break; } } @@ -35922,12 +36053,12 @@ var ts; } } break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -35944,9 +36075,9 @@ var ts; } } break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: // The below is used to lookup type parameters within a class or interface, as they are added to the class/interface locals // These can never be latebound, so the symbol's raw members are sufficient. `getMembersOfNode` cannot be used, as it would // trigger resolving late-bound names, which we may already be in the process of doing while we're here! @@ -35965,7 +36096,7 @@ var ts; } break loop; } - if (location.kind === 214 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 215 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -35973,7 +36104,7 @@ var ts; } } break; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: // The type parameters of a class are not in scope in the base class expression. if (lastLocation === location.expression && location.parent.token === 90 /* ExtendsKeyword */) { var container = location.parent.parent; @@ -35993,9 +36124,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 246 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 247 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -36003,24 +36134,24 @@ var ts; } } break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: // when targeting ES6 or higher there is no 'arguments' in an arrow function // for lower compile targets the resolved symbol is used to emit an error if (compilerOptions.target >= 2 /* ES2015 */) { break; } // falls through - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -36033,7 +36164,7 @@ var ts; } } break; - case 157 /* Decorator */: + case 158 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -36042,7 +36173,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 156 /* Parameter */) { + if (location.parent && location.parent.kind === 157 /* Parameter */) { location = location.parent; } // @@ -36057,25 +36188,25 @@ var ts; // declare function y(x: T): any; // @param(1 as T) // <-- T should resolve to the type alias outside of class C // class C {} - if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 245 /* ClassDeclaration */)) { + if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 246 /* ClassDeclaration */)) { location = location.parent; } break; - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: // js type aliases do not resolve names from their host, so skip past it location = ts.getJSDocHost(location); break; - case 156 /* Parameter */: + case 157 /* Parameter */: if (lastLocation && lastLocation === location.initializer) { associatedDeclarationForContainingInitializer = location; } break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: if (lastLocation && lastLocation === location.initializer) { var root = ts.getRootDeclaration(location); - if (root.kind === 156 /* Parameter */) { + if (root.kind === 157 /* Parameter */) { associatedDeclarationForContainingInitializer = location; } } @@ -36095,7 +36226,7 @@ var ts; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 290 /* SourceFile */); + ts.Debug.assert(lastLocation.kind === 291 /* SourceFile */); if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) { return lastLocation.symbol; } @@ -36212,10 +36343,10 @@ var ts; } } function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 202 /* ArrowFunction */ && location.kind !== 201 /* FunctionExpression */) { + if (location.kind !== 203 /* ArrowFunction */ && location.kind !== 202 /* FunctionExpression */) { // initializers in instance property declaration of class like entities are executed in constructor and thus deferred return ts.isTypeQueryNode(location) || ((ts.isFunctionLikeDeclaration(location) || - (location.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred + (location.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred } if (lastLocation && lastLocation === location.name) { return false; @@ -36228,12 +36359,12 @@ var ts; } function isSelfReferenceLocation(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 249 /* ModuleDeclaration */: // For `namespace N { N; }` + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 250 /* ModuleDeclaration */: // For `namespace N { N; }` return true; default: return false; @@ -36245,7 +36376,7 @@ var ts; function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 155 /* TypeParameter */) { + if (decl.kind === 156 /* TypeParameter */) { var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent; if (parent === container) { return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias)); // TODO: GH#18217 @@ -36301,9 +36432,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 75 /* Identifier */: - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -36337,7 +36468,7 @@ var ts; if (meaning & (788968 /* Type */ & ~1920 /* Namespace */)) { var symbol = resolveSymbol(resolveName(errorLocation, name, ~788968 /* Type */ & 111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); if (symbol && !(symbol.flags & 1920 /* Namespace */)) { - error(errorLocation, ts.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here, ts.unescapeLeadingUnderscores(name)); + error(errorLocation, ts.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0, ts.unescapeLeadingUnderscores(name)); return true; } } @@ -36347,7 +36478,7 @@ var ts; return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; } function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 263 /* ExportSpecifier */) { + if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 264 /* ExportSpecifier */) { error(errorLocation, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); return true; } @@ -36406,7 +36537,7 @@ var ts; return; } // Block-scoped variables cannot be used before their definition - var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 248 /* EnumDeclaration */); }); + var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 249 /* EnumDeclaration */); }); if (declaration === undefined) return ts.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); if (!(declaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { @@ -36441,13 +36572,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return node; - case 255 /* ImportClause */: + case 256 /* ImportClause */: return node.parent; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return node.parent.parent; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return node.parent.parent.parent; default: return undefined; @@ -36471,28 +36602,28 @@ var ts; * {name: } */ function isAliasSymbolDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */ || - node.kind === 252 /* NamespaceExportDeclaration */ || - node.kind === 255 /* ImportClause */ && !!node.name || - node.kind === 256 /* NamespaceImport */ || - node.kind === 262 /* NamespaceExport */ || - node.kind === 258 /* ImportSpecifier */ || - node.kind === 263 /* ExportSpecifier */ || - node.kind === 259 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || + return node.kind === 254 /* ImportEqualsDeclaration */ || + node.kind === 253 /* NamespaceExportDeclaration */ || + node.kind === 256 /* ImportClause */ && !!node.name || + node.kind === 257 /* NamespaceImport */ || + node.kind === 263 /* NamespaceExport */ || + node.kind === 259 /* ImportSpecifier */ || + node.kind === 264 /* ExportSpecifier */ || + node.kind === 260 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || - node.kind === 282 /* ShorthandPropertyAssignment */ || - node.kind === 281 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); + node.kind === 283 /* ShorthandPropertyAssignment */ || + node.kind === 282 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); } function isAliasableOrJsExpression(e) { return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - if (node.moduleReference.kind === 265 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 266 /* ExternalModuleReference */) { var immediate = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var resolved_4 = resolveExternalModuleSymbol(immediate); markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved_4, /*overwriteEmpty*/ false); @@ -36793,28 +36924,28 @@ var ts; function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; } switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 259 /* ExportAssignment */: - case 209 /* BinaryExpression */: + case 260 /* ExportAssignment */: + case 210 /* BinaryExpression */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ true, dontRecursivelyResolve); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return getTargetOfPropertyAssignment(node, dontRecursivelyResolve); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve); default: return ts.Debug.fail(); @@ -36854,6 +36985,13 @@ var ts; } return links.target; } + function tryResolveAlias(symbol) { + var links = getSymbolLinks(symbol); + if (links.target !== resolvingSymbol) { + return resolveAlias(symbol); + } + return undefined; + } /** * Marks a symbol as type-only if its declaration is syntactically type-only. * If it is not itself marked type-only, but resolves to a type-only alias @@ -36959,13 +37097,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 75 /* Identifier */ || entityName.parent.kind === 153 /* QualifiedName */) { + if (entityName.kind === 75 /* Identifier */ || entityName.parent.kind === 154 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 253 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 254 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } @@ -36989,9 +37127,9 @@ var ts; return symbolFromJSPrototype; } } - else if (name.kind === 153 /* QualifiedName */ || name.kind === 194 /* PropertyAccessExpression */) { - var left = name.kind === 153 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 153 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 154 /* QualifiedName */ || name.kind === 195 /* PropertyAccessExpression */) { + var left = name.kind === 154 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 154 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -37026,7 +37164,7 @@ var ts; throw ts.Debug.assertNever(name, "Unknown entity name kind."); } ts.Debug.assert((ts.getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 259 /* ExportAssignment */)) { + if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 260 /* ExportAssignment */)) { markSymbolOfAliasDeclarationIfTypeOnly(ts.getAliasDeclarationFromName(name), symbol, /*finalTarget*/ undefined, /*overwriteEmpty*/ true); } return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); @@ -37105,7 +37243,7 @@ var ts; } } function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) { - return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : ts.Diagnostics.Cannot_find_module_0); + return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : ts.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations); } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } @@ -37248,7 +37386,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 290 /* SourceFile */)) { + if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 291 /* SourceFile */)) { var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; @@ -37535,7 +37673,7 @@ var ts; var members = node.members; for (var _i = 0, members_3 = members; _i < members_3.length; _i++) { var member = members_3[_i]; - if (member.kind === 162 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 163 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -37622,12 +37760,12 @@ var ts; } } switch (location.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } // falls through - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: var sym = getSymbolOfNode(location); // `sym` may not have exports if this module declaration is backed by the symbol for a `const` that's being rewritten // into a namespace - in such cases, it's best to just let the namespace appear empty (the const members couldn't have referred @@ -37636,9 +37774,9 @@ var ts; return { value: result }; } break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: // Type parameters are bound into `members` lists so they can merge across declarations // This is troublesome, since in all other respects, they behave like locals :cries: // TODO: the below is shared with similar code in `resolveName` - in fact, rephrasing all this symbol @@ -37721,7 +37859,7 @@ var ts; && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) // While exports are generally considered to be in scope, export-specifier declared symbols are _not_ // See similar comment in `resolveName` for details - && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 263 /* ExportSpecifier */))) { + && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 264 /* ExportSpecifier */))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); var candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); if (candidate) { @@ -37765,7 +37903,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 263 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 264 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -37780,10 +37918,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: continue; default: return false; @@ -37914,10 +38052,10 @@ var ts; return node && getSymbolOfNode(node); } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -37964,14 +38102,14 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 172 /* TypeQuery */ || + if (entityName.parent.kind === 173 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 154 /* ComputedPropertyName */) { + entityName.parent.kind === 155 /* ComputedPropertyName */) { // Typeof value meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 153 /* QualifiedName */ || entityName.kind === 194 /* PropertyAccessExpression */ || - entityName.parent.kind === 253 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 154 /* QualifiedName */ || entityName.kind === 195 /* PropertyAccessExpression */ || + entityName.parent.kind === 254 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -38020,10 +38158,10 @@ var ts; function signatureToStringWorker(writer) { var sigOutput; if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 171 /* ConstructorType */ : 170 /* FunctionType */; + sigOutput = kind === 1 /* Construct */ ? 172 /* ConstructorType */ : 171 /* FunctionType */; } else { - sigOutput = kind === 1 /* Construct */ ? 166 /* ConstructSignature */ : 165 /* CallSignature */; + sigOutput = kind === 1 /* Construct */ ? 167 /* ConstructSignature */ : 166 /* CallSignature */; } var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); @@ -38107,6 +38245,7 @@ var ts; getSourceFiles: function () { return host.getSourceFiles(); }, getCurrentDirectory: ts.maybeBind(host, host.getCurrentDirectory), getProbableSymlinks: ts.maybeBind(host, host.getProbableSymlinks), + useCaseSensitiveFileNames: ts.maybeBind(host, host.useCaseSensitiveFileNames) } : undefined }, encounteredError: false, visitedTypes: undefined, @@ -38138,23 +38277,23 @@ var ts; return ts.createKeywordTypeNode(125 /* AnyKeyword */); } if (type.flags & 2 /* Unknown */) { - return ts.createKeywordTypeNode(148 /* UnknownKeyword */); + return ts.createKeywordTypeNode(149 /* UnknownKeyword */); } if (type.flags & 4 /* String */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(143 /* StringKeyword */); + return ts.createKeywordTypeNode(144 /* StringKeyword */); } if (type.flags & 8 /* Number */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(140 /* NumberKeyword */); + return ts.createKeywordTypeNode(141 /* NumberKeyword */); } if (type.flags & 64 /* BigInt */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(151 /* BigIntKeyword */); + return ts.createKeywordTypeNode(152 /* BigIntKeyword */); } if (type.flags & 16 /* Boolean */) { context.approximateLength += 7; - return ts.createKeywordTypeNode(128 /* BooleanKeyword */); + return ts.createKeywordTypeNode(129 /* BooleanKeyword */); } if (type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */)) { var parentSymbol = getParentOfSymbol(type.symbol); @@ -38195,7 +38334,7 @@ var ts; } } context.approximateLength += 13; - return ts.createTypeOperatorNode(147 /* UniqueKeyword */, ts.createKeywordTypeNode(144 /* SymbolKeyword */)); + return ts.createTypeOperatorNode(148 /* UniqueKeyword */, ts.createKeywordTypeNode(145 /* SymbolKeyword */)); } if (type.flags & 16384 /* Void */) { context.approximateLength += 4; @@ -38203,7 +38342,7 @@ var ts; } if (type.flags & 32768 /* Undefined */) { context.approximateLength += 9; - return ts.createKeywordTypeNode(146 /* UndefinedKeyword */); + return ts.createKeywordTypeNode(147 /* UndefinedKeyword */); } if (type.flags & 65536 /* Null */) { context.approximateLength += 4; @@ -38211,15 +38350,15 @@ var ts; } if (type.flags & 131072 /* Never */) { context.approximateLength += 5; - return ts.createKeywordTypeNode(137 /* NeverKeyword */); + return ts.createKeywordTypeNode(138 /* NeverKeyword */); } if (type.flags & 4096 /* ESSymbol */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(144 /* SymbolKeyword */); + return ts.createKeywordTypeNode(145 /* SymbolKeyword */); } if (type.flags & 67108864 /* NonPrimitive */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(141 /* ObjectKeyword */); + return ts.createKeywordTypeNode(142 /* ObjectKeyword */); } if (isThisTypeParameter(type)) { if (context.flags & 4194304 /* InObjectTypeLiteral */) { @@ -38268,7 +38407,7 @@ var ts; } var typeNodes = mapToTypeNodes(types, context, /*isBareList*/ true); if (typeNodes && typeNodes.length > 0) { - var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 178 /* UnionType */ : 179 /* IntersectionType */, typeNodes); + var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 179 /* UnionType */ : 180 /* IntersectionType */, typeNodes); return unionOrIntersectionTypeNode; } else { @@ -38295,6 +38434,11 @@ var ts; context.approximateLength += 2; return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); } + if (type.flags & 134217728 /* Awaited */) { + var awaitedTypeNode = typeToTypeNodeHelper(type.awaitedType, context); + context.approximateLength += 9; + return ts.createTypeOperatorNode(128 /* AwaitedKeyword */, awaitedTypeNode); + } if (type.flags & 16777216 /* Conditional */) { var checkTypeNode = typeToTypeNodeHelper(type.checkType, context); var saveInferTypeParameters = context.inferTypeParameters; @@ -38307,7 +38451,7 @@ var ts; return ts.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode); } if (type.flags & 33554432 /* Substitution */) { - return typeToTypeNodeHelper(type.typeVariable, context); + return typeToTypeNodeHelper(type.baseType, context); } return ts.Debug.fail("Should be unreachable."); function createMappedTypeNodeFromType(type) { @@ -38339,7 +38483,7 @@ var ts; return symbolToTypeNode(symbol, context, isInstanceType); } // Always use 'typeof T' for type of class, enum, and module objects - else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 214 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || + else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 215 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { return symbolToTypeNode(symbol, context, 111551 /* Value */); @@ -38369,7 +38513,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 290 /* SourceFile */ || declaration.parent.kind === 250 /* ModuleBlock */; + return declaration.parent.kind === 291 /* SourceFile */ || declaration.parent.kind === 251 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -38420,12 +38564,12 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 170 /* FunctionType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 171 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 171 /* ConstructorType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 172 /* ConstructorType */, context); return signatureNode; } } @@ -38446,7 +38590,7 @@ var ts; } var elementType = typeToTypeNodeHelper(typeArguments[0], context); var arrayType = ts.createArrayTypeNode(elementType); - return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, arrayType); + return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, arrayType); } else if (type.target.objectFlags & 8 /* Tuple */) { if (typeArguments.length > 0) { @@ -38460,12 +38604,12 @@ var ts; ts.createOptionalTypeNode(tupleConstituentNodes[i]); } var tupleTypeNode = ts.createTupleTypeNode(tupleConstituentNodes); - return type.target.readonly ? ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } } if (context.encounteredError || (context.flags & 524288 /* AllowEmptyTuple */)) { var tupleTypeNode = ts.createTupleTypeNode([]); - return type.target.readonly ? ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } context.encounteredError = true; return undefined; // TODO: GH#18217 @@ -38560,11 +38704,11 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 165 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 166 /* CallSignature */, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 166 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 167 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { var indexSignature = void 0; @@ -38641,7 +38785,7 @@ var ts; var signatures = getSignaturesOfType(filterType(propertyType, function (t) { return !(t.flags & 32768 /* Undefined */); }), 0 /* Call */); for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) { var signature = signatures_1[_i]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 160 /* MethodSignature */, context); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 161 /* MethodSignature */, context); methodDeclaration.name = propertyName; methodDeclaration.questionToken = optionalToken; typeElements.push(preserveCommentsOn(methodDeclaration)); @@ -38658,7 +38802,7 @@ var ts; propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(125 /* AnyKeyword */); } context.flags = savedFlags; - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(138 /* ReadonlyKeyword */)] : undefined; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(139 /* ReadonlyKeyword */)] : undefined; if (modifiers) { context.approximateLength += 9; } @@ -38667,8 +38811,8 @@ var ts; typeElements.push(preserveCommentsOn(propertySignature)); } function preserveCommentsOn(node) { - if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 323 /* JSDocPropertyTag */; })) { - var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 323 /* JSDocPropertyTag */; }); + if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 324 /* JSDocPropertyTag */; })) { + var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 324 /* JSDocPropertyTag */; }); var commentText = d.comment; if (commentText) { ts.setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); @@ -38719,7 +38863,7 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 143 /* StringKeyword */ : 140 /* NumberKeyword */); + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 144 /* StringKeyword */ : 141 /* NumberKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -38732,7 +38876,7 @@ var ts; } context.approximateLength += (name.length + 4); return ts.createIndexSignature( - /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(138 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(139 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context) { var suppressAny = context.flags & 256 /* SuppressAnyReturnType */; @@ -38746,7 +38890,7 @@ var ts; else { typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); } - var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 162 /* Constructor */); }); + var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 163 /* Constructor */); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); @@ -38790,9 +38934,9 @@ var ts; return typeParameterToDeclarationWithConstraint(type, context, constraintNode); } function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 156 /* Parameter */); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 157 /* Parameter */); if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) { - parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 317 /* JSDocParameterTag */); + parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 318 /* JSDocParameterTag */); } var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { @@ -38804,7 +38948,7 @@ var ts; var dotDotDotToken = isRest ? ts.createToken(25 /* DotDotDotToken */) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 75 /* Identifier */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : - parameterDeclaration.name.kind === 153 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : + parameterDeclaration.name.kind === 154 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : ts.symbolName(parameterSymbol) : ts.symbolName(parameterSymbol); @@ -38823,7 +38967,7 @@ var ts; } var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags); var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited); - if (clone.kind === 191 /* BindingElement */) { + if (clone.kind === 192 /* BindingElement */) { clone.initializer = undefined; } return ts.setEmitFlags(clone, 1 /* SingleLine */ | 16777216 /* NoAsciiEscaping */); @@ -38943,10 +39087,10 @@ var ts; var typeParameterNodes; if (context.flags & 512 /* WriteTypeParametersInQualifiedName */ && index < (chain.length - 1)) { var parentSymbol = symbol; - var nextSymbol = chain[index + 1]; - if (ts.getCheckFlags(nextSymbol) & 1 /* Instantiated */) { + var nextSymbol_1 = chain[index + 1]; + if (ts.getCheckFlags(nextSymbol_1) & 1 /* Instantiated */) { var params = getTypeParametersOfClassOrInterface(parentSymbol.flags & 2097152 /* Alias */ ? resolveAlias(parentSymbol) : parentSymbol); - typeParameterNodes = mapToTypeNodes(ts.map(params, nextSymbol.mapper), context); + typeParameterNodes = mapToTypeNodes(ts.map(params, function (t) { return getMappedType(t, nextSymbol_1.mapper); }), context); } else { typeParameterNodes = typeParametersToTypeParameterDeclarations(symbol, context); @@ -38964,7 +39108,7 @@ var ts; return top; } function getSpecifierForModuleSymbol(symbol, context) { - var file = ts.getDeclarationOfKind(symbol, 290 /* SourceFile */); + var file = ts.getDeclarationOfKind(symbol, 291 /* SourceFile */); if (file && file.moduleName !== undefined) { // Use the amd name if it is available return file.moduleName; @@ -39270,8 +39414,8 @@ var ts; return initial; } function symbolTableToDeclarationStatements(symbolTable, context, bundled) { - var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 161 /* MethodDeclaration */, /*useAcessors*/ true); - var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 160 /* MethodSignature */, /*useAcessors*/ false); + var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 162 /* MethodDeclaration */, /*useAcessors*/ true); + var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 161 /* MethodSignature */, /*useAcessors*/ false); // TODO: Use `setOriginalNode` on original declaration names where possible so these declarations see some kind of // declaration mapping // We save the enclosing declaration off here so it's not adjusted by well-meaning declaration @@ -39610,8 +39754,8 @@ var ts; var baseTypes = getBaseTypes(interfaceType); var baseType = ts.length(baseTypes) ? getIntersectionType(baseTypes) : undefined; var members = ts.flatMap(getPropertiesOfType(interfaceType), function (p) { return serializePropertySymbolForInterface(p, baseType); }); - var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 165 /* CallSignature */); - var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 166 /* ConstructSignature */); + var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 166 /* CallSignature */); + var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 167 /* ConstructSignature */); var indexSignatures = serializeIndexSignatures(interfaceType, baseType); var heritageClauses = !ts.length(baseTypes) ? undefined : [ts.createHeritageClause(90 /* ExtendsKeyword */, ts.mapDefined(baseTypes, function (b) { return trySerializeAsTypeReference(b); }))]; addResult(ts.createInterfaceDeclaration( @@ -39726,7 +39870,7 @@ var ts; for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { var sig = signatures_2[_i]; // Each overload becomes a separate function declaration, in order - var decl = signatureToSignatureDeclarationHelper(sig, 244 /* FunctionDeclaration */, context); + var decl = signatureToSignatureDeclarationHelper(sig, 245 /* FunctionDeclaration */, context); decl.name = ts.createIdentifier(localName); addResult(ts.setTextRange(decl, sig.declaration), modifierFlags); } @@ -39819,7 +39963,7 @@ var ts; var staticMembers = symbol.flags & (16 /* Function */ | 512 /* ValueModule */) ? [] : ts.flatMap(ts.filter(getPropertiesOfType(staticType), function (p) { return !(p.flags & 4194304 /* Prototype */) && p.escapedName !== "prototype"; }), function (p) { return serializePropertySymbolForClass(p, /*isStatic*/ true, staticBaseType); }); - var constructors = serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 162 /* Constructor */); + var constructors = serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 163 /* Constructor */); for (var _i = 0, constructors_1 = constructors; _i < constructors_1.length; _i++) { var c = constructors_1[_i]; // A constructor's return type and type parameters are supposed to be controlled by the enclosing class declaration @@ -39851,7 +39995,7 @@ var ts; var targetName = getInternalSymbolName(target, verbatimTargetName); includePrivateSymbol(target); // the target may be within the same scope - attempt to serialize it first switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // Could be a local `import localName = ns.member` or // an external `import localName = require("whatever")` var isLocalImport = !(target.flags & 512 /* ValueModule */); @@ -39861,13 +40005,13 @@ var ts; ? symbolToName(target, context, 67108863 /* All */, /*expectsIdentifier*/ false) : ts.createExternalModuleReference(ts.createLiteral(getSpecifierForModuleSymbol(symbol, context)))), isLocalImport ? modifierFlags : 0 /* None */); break; - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: // export as namespace foo // TODO: Not part of a file's local or export symbol tables // Is bound into file.symbol.globalExports instead, which we don't currently traverse addResult(ts.createNamespaceExportDeclaration(ts.idText(node.name)), 0 /* None */); break; - case 255 /* ImportClause */: + case 256 /* ImportClause */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(ts.createIdentifier(localName), /*namedBindings*/ undefined), @@ -39876,24 +40020,24 @@ var ts; // In such cases, the `target` refers to the module itself already ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*importClause*/ undefined, ts.createNamespaceImport(ts.createIdentifier(localName))), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: addResult(ts.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createNamespaceExport(ts.createIdentifier(localName)), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*importClause*/ undefined, ts.createNamedImports([ ts.createImportSpecifier(localName !== verbatimTargetName ? ts.createIdentifier(verbatimTargetName) : undefined, ts.createIdentifier(localName)) ])), ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: // does not use localName because the symbol name in this case refers to the name in the exports table, // which we must exactly preserve var specifier = node.parent.parent.moduleSpecifier; @@ -39901,11 +40045,11 @@ var ts; // another file serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), specifier ? verbatimTargetName : targetName, specifier && ts.isStringLiteralLike(specifier) ? ts.createLiteral(specifier.text) : undefined); break; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: serializeMaybeAliasAssignment(symbol); break; - case 209 /* BinaryExpression */: - case 194 /* PropertyAccessExpression */: + case 210 /* BinaryExpression */: + case 195 /* PropertyAccessExpression */: // Could be best encoded as though an export specifier or as though an export assignment // If name is default or export=, do an export assignment // Otherwise do an export specifier @@ -40125,17 +40269,18 @@ var ts; context.flags = oldFlags; return result; function visitExistingNodeTreeSymbols(node) { - if (ts.isJSDocAllType(node)) { + // We don't _actually_ support jsdoc namepath types, emit `any` instead + if (ts.isJSDocAllType(node) || node.kind === 303 /* JSDocNamepathType */) { return ts.createKeywordTypeNode(125 /* AnyKeyword */); } if (ts.isJSDocUnknownType(node)) { - return ts.createKeywordTypeNode(148 /* UnknownKeyword */); + return ts.createKeywordTypeNode(149 /* UnknownKeyword */); } if (ts.isJSDocNullableType(node)) { return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(100 /* NullKeyword */)]); } if (ts.isJSDocOptionalType(node)) { - return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(146 /* UndefinedKeyword */)]); + return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(147 /* UndefinedKeyword */)]); } if (ts.isJSDocNonNullableType(node)) { return ts.visitNode(node.type, visitExistingNodeTreeSymbols); @@ -40404,8 +40549,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { - var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 182 /* ParenthesizedType */; }); - if (node.kind === 247 /* TypeAliasDeclaration */) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 183 /* ParenthesizedType */; }); + if (node.kind === 248 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -40413,11 +40558,11 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 250 /* ModuleBlock */ && + node.parent.kind === 251 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 290 /* SourceFile */ || ts.isAmbientModule(location); + return location.kind === 291 /* SourceFile */ || ts.isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { var nameType = getSymbolLinks(symbol).nameType; @@ -40476,17 +40621,17 @@ var ts; if (!declaration) { declaration = symbol.declarations[0]; // Declaration may be nameless, but we'll try anyway } - if (declaration.parent && declaration.parent.kind === 242 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 243 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 214 /* ClassExpression */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 215 /* ClassExpression */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } - return declaration.kind === 214 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 215 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; } } var name = getNameOfSymbolFromNameType(symbol, context); @@ -40503,28 +40648,28 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: - case 316 /* JSDocEnumTag */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: + case 317 /* JSDocEnumTag */: // Top-level jsdoc type aliases are considered exported // First parent is comment node, second is hosting declaration or token; we only care about those tokens or declarations whose parent is a source file return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent)); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // falls through - case 249 /* ModuleDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 244 /* FunctionDeclaration */: - case 248 /* EnumDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 250 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 245 /* FunctionDeclaration */: + case 249 /* EnumDeclaration */: + case 254 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; @@ -40532,54 +40677,54 @@ var ts; var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 253 /* ImportEqualsDeclaration */ && parent.kind !== 290 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { + !(node.kind !== 254 /* ImportEqualsDeclaration */ && parent.kind !== 291 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent); - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.hasModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 162 /* Constructor */: - case 166 /* ConstructSignature */: - case 165 /* CallSignature */: - case 167 /* IndexSignature */: - case 156 /* Parameter */: - case 250 /* ModuleBlock */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 173 /* TypeLiteral */: - case 169 /* TypeReference */: - case 174 /* ArrayType */: - case 175 /* TupleType */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 182 /* ParenthesizedType */: + case 163 /* Constructor */: + case 167 /* ConstructSignature */: + case 166 /* CallSignature */: + case 168 /* IndexSignature */: + case 157 /* Parameter */: + case 251 /* ModuleBlock */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 174 /* TypeLiteral */: + case 170 /* TypeReference */: + case 175 /* ArrayType */: + case 176 /* TupleType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 183 /* ParenthesizedType */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 255 /* ImportClause */: - case 256 /* NamespaceImport */: - case 258 /* ImportSpecifier */: + case 256 /* ImportClause */: + case 257 /* NamespaceImport */: + case 259 /* ImportSpecifier */: return false; // Type parameters are always visible - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: // Source file and namespace export are always visible // falls through - case 290 /* SourceFile */: - case 252 /* NamespaceExportDeclaration */: + case 291 /* SourceFile */: + case 253 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return false; default: return false; @@ -40588,10 +40733,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 259 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 260 /* ExportAssignment */) { exportSymbol = resolveName(node, node.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); } - else if (node.parent.kind === 263 /* ExportSpecifier */) { + else if (node.parent.kind === 264 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } var result; @@ -40694,12 +40839,12 @@ var ts; function getDeclarationContainer(node) { return ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 242 /* VariableDeclaration */: - case 243 /* VariableDeclarationList */: - case 258 /* ImportSpecifier */: - case 257 /* NamedImports */: - case 256 /* NamespaceImport */: - case 255 /* ImportClause */: + case 243 /* VariableDeclaration */: + case 244 /* VariableDeclarationList */: + case 259 /* ImportSpecifier */: + case 258 /* NamedImports */: + case 257 /* NamespaceImport */: + case 256 /* ImportClause */: return false; default: return true; @@ -40732,7 +40877,7 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false); } function isComputedNonLiteralName(name) { - return name.kind === 154 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); + return name.kind === 155 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); } function getRestType(source, properties, symbol) { source = filterType(source, function (t) { return !(t.flags & 98304 /* Nullable */); }); @@ -40786,7 +40931,7 @@ var ts; if (parentAccess && parentAccess.flowNode) { var propName = getDestructuringPropertyName(node); if (propName) { - var result = ts.createNode(195 /* ElementAccessExpression */, node.pos, node.end); + var result = ts.createNode(196 /* ElementAccessExpression */, node.pos, node.end); result.parent = node; result.expression = parentAccess; var literal = ts.createNode(10 /* StringLiteral */, node.pos, node.end); @@ -40801,23 +40946,23 @@ var ts; function getParentElementAccess(node) { var ancestor = node.parent.parent; switch (ancestor.kind) { - case 191 /* BindingElement */: - case 281 /* PropertyAssignment */: + case 192 /* BindingElement */: + case 282 /* PropertyAssignment */: return getSyntheticElementAccess(ancestor); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return getSyntheticElementAccess(node.parent); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ancestor.initializer; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return ancestor.right; } } function getDestructuringPropertyName(node) { var parent = node.parent; - if (node.kind === 191 /* BindingElement */ && parent.kind === 189 /* ObjectBindingPattern */) { + if (node.kind === 192 /* BindingElement */ && parent.kind === 190 /* ObjectBindingPattern */) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 281 /* PropertyAssignment */ || node.kind === 282 /* ShorthandPropertyAssignment */) { + if (node.kind === 282 /* PropertyAssignment */ || node.kind === 283 /* ShorthandPropertyAssignment */) { return getLiteralPropertyNameText(node.name); } return "" + parent.elements.indexOf(node); @@ -40838,8 +40983,12 @@ var ts; if (strictNullChecks && declaration.flags & 8388608 /* Ambient */ && ts.isParameterDeclaration(declaration)) { parentType = getNonNullableType(parentType); } + // Filter `undefined` from the type we check against if the parent has an initializer (which handles the `undefined` case implicitly) + else if (strictNullChecks && pattern.parent.initializer) { + parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */); + } var type; - if (pattern.kind === 189 /* ObjectBindingPattern */) { + if (pattern.kind === 190 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { parentType = getReducedType(parentType); if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) { @@ -40912,7 +41061,7 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 192 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 193 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } @@ -40922,11 +41071,11 @@ var ts; function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 231 /* ForInStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForInStatement */) { var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression))); return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType; } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 233 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -40945,7 +41094,7 @@ var ts; return addOptionality(declaredType, isOptional); } if ((noImplicitAny || ts.isInJSFile(declaration)) && - declaration.kind === 242 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && + declaration.kind === 243 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1 /* Export */) && !(declaration.flags & 8388608 /* Ambient */)) { // If --noImplicitAny is on or the declaration is in a Javascript file, // use control flow tracked 'any' type for non-ambient, non-exported var or let variables with no @@ -40959,11 +41108,11 @@ var ts; return autoArrayType; } } - if (declaration.kind === 156 /* Parameter */) { + if (declaration.kind === 157 /* Parameter */) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 164 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 163 /* GetAccessor */); + if (func.kind === 165 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 164 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -41178,9 +41327,9 @@ var ts; var thisContainer = ts.getThisContainer(expression, /*includeArrowFunctions*/ false); // Properties defined in a constructor (or base constructor, or javascript constructor function) don't get undefined added. // Function expressions that are assigned to the prototype count as methods. - return thisContainer.kind === 162 /* Constructor */ || - thisContainer.kind === 244 /* FunctionDeclaration */ || - (thisContainer.kind === 201 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); + return thisContainer.kind === 163 /* Constructor */ || + thisContainer.kind === 245 /* FunctionDeclaration */ || + (thisContainer.kind === 202 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { ts.Debug.assert(types.length === declarations.length); @@ -41264,7 +41413,7 @@ var ts; function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) { var elements = pattern.elements; var lastElement = ts.lastOrUndefined(elements); - var hasRestElement = !!(lastElement && lastElement.kind === 191 /* BindingElement */ && lastElement.dotDotDotToken); + var hasRestElement = !!(lastElement && lastElement.kind === 192 /* BindingElement */ && lastElement.dotDotDotToken); if (elements.length === 0 || elements.length === 1 && hasRestElement) { return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType; } @@ -41288,7 +41437,7 @@ var ts; function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { if (includePatternInType === void 0) { includePatternInType = false; } if (reportErrors === void 0) { reportErrors = false; } - return pattern.kind === 189 /* ObjectBindingPattern */ + return pattern.kind === 190 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -41327,7 +41476,7 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 156 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 157 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(declaration) { @@ -41385,7 +41534,7 @@ var ts; return reportCircularityError(symbol); } var type; - if (declaration.kind === 259 /* ExportAssignment */) { + if (declaration.kind === 260 /* ExportAssignment */) { type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration); } else if (ts.isBinaryExpression(declaration) || @@ -41456,7 +41605,7 @@ var ts; } function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { - if (accessor.kind === 163 /* GetAccessor */) { + if (accessor.kind === 164 /* GetAccessor */) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; } @@ -41490,15 +41639,15 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 163 /* GetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 164 /* GetAccessor */); error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } return type; } function resolveTypeOfAccessors(symbol) { - var getter = ts.getDeclarationOfKind(symbol, 163 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 164 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 164 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 165 /* SetAccessor */); if (getter && ts.isInJSFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -41566,9 +41715,9 @@ var ts; if (symbol.flags & 1536 /* Module */ && ts.isShorthandAmbientModuleSymbol(symbol)) { return anyType; } - else if (declaration.kind === 209 /* BinaryExpression */ || + else if (declaration.kind === 210 /* BinaryExpression */ || ts.isAccessExpression(declaration) && - declaration.parent.kind === 209 /* BinaryExpression */) { + declaration.parent.kind === 210 /* BinaryExpression */) { return getWidenedTypeForAssignmentDeclaration(symbol); } else if (symbol.flags & 512 /* ValueModule */ && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) { @@ -41635,7 +41784,7 @@ var ts; return errorType; } // Check if variable has initializer that circularly references the variable itself - if (noImplicitAny && (declaration.kind !== 156 /* Parameter */ || declaration.initializer)) { + if (noImplicitAny && (declaration.kind !== 157 /* Parameter */ || declaration.initializer)) { error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); } // Circularities could also result from parameters in function expressions that end up @@ -41734,36 +41883,36 @@ var ts; return undefined; } switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 160 /* MethodSignature */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 300 /* JSDocFunctionType */: - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 247 /* TypeAliasDeclaration */: - case 321 /* JSDocTemplateTag */: - case 322 /* JSDocTypedefTag */: - case 316 /* JSDocEnumTag */: - case 315 /* JSDocCallbackTag */: - case 186 /* MappedType */: - case 180 /* ConditionalType */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 161 /* MethodSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 301 /* JSDocFunctionType */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 248 /* TypeAliasDeclaration */: + case 322 /* JSDocTemplateTag */: + case 323 /* JSDocTypedefTag */: + case 317 /* JSDocEnumTag */: + case 316 /* JSDocCallbackTag */: + case 187 /* MappedType */: + case 181 /* ConditionalType */: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 186 /* MappedType */) { + if (node.kind === 187 /* MappedType */) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } - else if (node.kind === 180 /* ConditionalType */) { + else if (node.kind === 181 /* ConditionalType */) { return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node)); var thisType = includeThisTypes && - (node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */ || node.kind === 246 /* InterfaceDeclaration */ || isJSConstructor(node)) && + (node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */ || node.kind === 247 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } @@ -41771,7 +41920,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 246 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 247 /* InterfaceDeclaration */); ts.Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); } @@ -41781,9 +41930,9 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 246 /* InterfaceDeclaration */ || - node.kind === 245 /* ClassDeclaration */ || - node.kind === 214 /* ClassExpression */ || + if (node.kind === 247 /* InterfaceDeclaration */ || + node.kind === 246 /* ClassDeclaration */ || + node.kind === 215 /* ClassExpression */ || isJSConstructor(node) || ts.isTypeAlias(node)) { var declaration = node; @@ -42001,7 +42150,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 246 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 247 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getReducedType(getTypeFromTypeNode(node)); @@ -42037,7 +42186,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 246 /* InterfaceDeclaration */) { + if (declaration.kind === 247 /* InterfaceDeclaration */) { if (declaration.flags & 128 /* ContainsThis */) { return false; } @@ -42125,7 +42274,7 @@ var ts; if (ts.isStringLiteralLike(expr)) { return true; } - else if (expr.kind === 209 /* BinaryExpression */) { + else if (expr.kind === 210 /* BinaryExpression */) { return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right); } return false; @@ -42140,12 +42289,12 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return true; - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; case 75 /* Identifier */: return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return isStringConcatExpression(expr); default: return false; @@ -42159,7 +42308,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 248 /* EnumDeclaration */) { + if (declaration.kind === 249 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && ts.isStringLiteralLike(member.initializer)) { @@ -42186,7 +42335,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 248 /* EnumDeclaration */) { + if (declaration.kind === 249 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var value = getEnumMemberValue(member); @@ -42259,22 +42408,22 @@ var ts; function isThislessType(node) { switch (node.kind) { case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: - case 141 /* ObjectKeyword */: + case 149 /* UnknownKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: + case 142 /* ObjectKeyword */: case 110 /* VoidKeyword */: - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: case 100 /* NullKeyword */: - case 137 /* NeverKeyword */: - case 187 /* LiteralType */: + case 138 /* NeverKeyword */: + case 188 /* LiteralType */: return true; - case 174 /* ArrayType */: + case 175 /* ArrayType */: return isThislessType(node.elementType); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -42300,7 +42449,7 @@ var ts; function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - return (node.kind === 162 /* Constructor */ || (!!returnType && isThislessType(returnType))) && + return (node.kind === 163 /* Constructor */ || (!!returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } @@ -42316,14 +42465,14 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -42614,7 +42763,6 @@ var ts; var stringIndexInfo; var numberIndexInfo; if (ts.rangeEquals(typeParameters, typeArguments, 0, typeParameters.length)) { - mapper = identityMapper; members = source.symbol ? getMembersOfSymbol(source.symbol) : ts.createSymbolTable(source.declaredProperties); callSignatures = source.declaredCallSignatures; constructSignatures = source.declaredConstructSignatures; @@ -43118,8 +43266,7 @@ var ts; var checkType = type.checkType; var constraint = getLowerBoundOfKeyType(checkType); if (constraint !== checkType) { - var mapper = makeUnaryTypeMapper(type.root.checkType, constraint); - return getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); + return getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper)); } } return type; @@ -43168,7 +43315,7 @@ var ts; // Create a mapper from T to the current iteration type constituent. Then, if the // mapped type is itself an instantiated type, combine the iteration mapper with the // instantiation mapper. - var templateMapper = combineTypeMappers(type.mapper, createTypeMapper([typeParameter], [t])); + var templateMapper = appendTypeMapping(type.mapper, typeParameter, t); // If the current iteration type constituent is a string literal type, create a property. // Otherwise, for type string create a string index signature. if (isTypeUsableAsPropertyName(t)) { @@ -43218,6 +43365,7 @@ var ts; type = errorType; } symbol.type = type; + symbol.mapper = undefined; } return symbol.type; } @@ -43232,7 +43380,7 @@ var ts; function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? - instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), type.mapper || identityMapper) : + instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), type.mapper) : errorType); } function getConstraintDeclarationForMappedType(type) { @@ -43240,8 +43388,8 @@ var ts; } function isMappedTypeWithKeyofConstraintDeclaration(type) { var constraintDeclaration = getConstraintDeclarationForMappedType(type); // TODO: GH#18217 - return constraintDeclaration.kind === 184 /* TypeOperator */ && - constraintDeclaration.operator === 134 /* KeyOfKeyword */; + return constraintDeclaration.kind === 185 /* TypeOperator */ && + constraintDeclaration.operator === 135 /* KeyOfKeyword */; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { @@ -43249,7 +43397,7 @@ var ts; // If the constraint declaration is a 'keyof T' node, the modifiers type is T. We check // AST nodes here because, when T is a non-generic type, the logic below eagerly resolves // 'keyof T' to a literal union type and we can't recover T from that type. - type.modifiersType = instantiateType(getTypeFromTypeNode(getConstraintDeclarationForMappedType(type).type), type.mapper || identityMapper); + type.modifiersType = instantiateType(getTypeFromTypeNode(getConstraintDeclarationForMappedType(type).type), type.mapper); } else { // Otherwise, get the declared constraint type, and if the constraint type is a type parameter, @@ -43258,7 +43406,7 @@ var ts; var declaredType = getTypeFromMappedTypeNode(type.declaration); var constraint = getConstraintTypeFromMappedType(declaredType); var extendedConstraint = constraint && constraint.flags & 262144 /* TypeParameter */ ? getConstraintOfTypeParameter(constraint) : constraint; - type.modifiersType = extendedConstraint && extendedConstraint.flags & 4194304 /* Index */ ? instantiateType(extendedConstraint.type, type.mapper || identityMapper) : unknownType; + type.modifiersType = extendedConstraint && extendedConstraint.flags & 4194304 /* Index */ ? instantiateType(extendedConstraint.type, type.mapper) : unknownType; } } return type.modifiersType; @@ -43345,8 +43493,8 @@ var ts; } } // The properties of a union type are those that are present in all constituent types, so - // we only need to check the properties of the first type - if (type.flags & 1048576 /* Union */) { + // we only need to check the properties of the first type without index signature + if (type.flags & 1048576 /* Union */ && !getIndexInfoOfType(current, 0 /* String */) && !getIndexInfoOfType(current, 1 /* Number */)) { break; } } @@ -43447,8 +43595,7 @@ var ts; var simplified = getSimplifiedType(type.checkType, /*writing*/ false); var constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified; if (constraint && constraint !== type.checkType) { - var mapper = makeUnaryTypeMapper(type.root.checkType, constraint); - var instantiated = getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); + var instantiated = getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper)); if (!(instantiated.flags & 131072 /* Never */)) { return instantiated; } @@ -43467,7 +43614,7 @@ var ts; var hasDisjointDomainType = false; for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { var t = types_4[_i]; - if (t.flags & 63176704 /* Instantiable */) { + if (t.flags & 197394432 /* Instantiable */) { // We keep following constraints as long as we have an instantiable type that is known // not to be circular or infinite (hence we stop on index access types). var constraint = getConstraintOfType(t); @@ -43503,7 +43650,7 @@ var ts; return undefined; } function getBaseConstraintOfType(type) { - if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { + if (type.flags & (193200128 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { var constraint = getResolvedBaseConstraint(type); return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined; } @@ -43605,6 +43752,10 @@ var ts; constraintDepth--; return result; } + if (t.flags & 134217728 /* Awaited */) { + var basePromiseType = getBaseConstraint(t.awaitedType); + return basePromiseType ? getAwaitedType(basePromiseType) : undefined; + } if (t.flags & 33554432 /* Substitution */) { return getBaseConstraint(t.substitute); } @@ -43665,8 +43816,7 @@ var ts; if (typeVariable) { var constraint = getConstraintOfTypeParameter(typeVariable); if (constraint && (isArrayType(constraint) || isTupleType(constraint))) { - var mapper = makeUnaryTypeMapper(typeVariable, constraint); - return instantiateType(type, combineTypeMappers(mapper, type.mapper)); + return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper)); } } return type; @@ -43677,7 +43827,7 @@ var ts; * type itself. */ function getApparentType(type) { - var t = type.flags & 63176704 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; + var t = type.flags & 197394432 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; return ts.getObjectFlags(t) & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) : t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : t.flags & 132 /* StringLike */ ? globalStringType : @@ -43938,7 +44088,7 @@ var ts; ts.append(propTypes, getIndexTypeOfType(type, 1 /* Number */)); } if (propTypes.length) { - return getUnionType(propTypes, 2 /* Subtype */); + return getUnionType(propTypes); } } return undefined; @@ -43965,10 +44115,10 @@ var ts; function isJSDocOptionalParameter(node) { return ts.isInJSFile(node) && ( // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType - node.type && node.type.kind === 299 /* JSDocOptionalType */ + node.type && node.type.kind === 300 /* JSDocOptionalType */ || ts.getJSDocParameterTags(node).some(function (_a) { var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 299 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 300 /* JSDocOptionalType */; })); } function tryFindAmbientModule(moduleName, withAugmentations) { @@ -43987,7 +44137,7 @@ var ts; var signature = getSignatureFromDeclaration(node.parent); var parameterIndex = node.parent.parameters.indexOf(node); ts.Debug.assert(parameterIndex >= 0); - return parameterIndex >= getMinArgumentCount(signature); + return parameterIndex >= getMinArgumentCount(signature, /*strongArityForUntypedJS*/ true); } var iife = ts.getImmediatelyInvokedFunctionExpression(node.parent); if (iife) { @@ -44002,7 +44152,7 @@ var ts; return false; } var isBracketed = node.isBracketed, typeExpression = node.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 299 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 300 /* JSDocOptionalType */; } function createTypePredicate(kind, parameterName, parameterIndex, type) { return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; @@ -44062,6 +44212,9 @@ var ts; ts.isValueSignatureDeclaration(declaration) && !ts.hasJSDocParameterTags(declaration) && !ts.getJSDocType(declaration); + if (isUntypedSignatureInJSFile) { + flags |= 16 /* IsUntypedSignatureInJSFile */; + } // If this is a JSDoc construct signature, then skip the first parameter in the // parameter list. The first parameter represents the return type of the construct // signature. @@ -44081,30 +44234,29 @@ var ts; else { parameters.push(paramSymbol); } - if (type && type.kind === 187 /* LiteralType */) { + if (type && type.kind === 188 /* LiteralType */) { flags |= 2 /* HasLiteralTypes */; } // Record a new minimum argument count if this is not an optional parameter var isOptionalParameter_1 = isOptionalJSDocParameterTag(param) || param.initializer || param.questionToken || param.dotDotDotToken || iife && parameters.length > iife.arguments.length && !type || - isUntypedSignatureInJSFile || isJSDocOptionalParameter(param); if (!isOptionalParameter_1) { minArgumentCount = parameters.length; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 163 /* GetAccessor */ || declaration.kind === 164 /* SetAccessor */) && + if ((declaration.kind === 164 /* GetAccessor */ || declaration.kind === 165 /* SetAccessor */) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; + var otherKind = declaration.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 162 /* Constructor */ ? + var classType = declaration.kind === 163 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); @@ -44166,11 +44318,11 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - return node.name.kind === 154 /* ComputedPropertyName */ + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + return node.name.kind === 155 /* ComputedPropertyName */ && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse); @@ -44242,7 +44394,7 @@ var ts; function createTypePredicateFromTypePredicateNode(node, signature) { var parameterName = node.parameterName; var type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 183 /* ThisType */ ? + return parameterName.kind === 184 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, /*parameterName*/ undefined, /*parameterIndex*/ undefined, type) : createTypePredicate(node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */, parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type); } @@ -44285,7 +44437,7 @@ var ts; return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 162 /* Constructor */) { + if (declaration.kind === 163 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } if (ts.isJSDocConstructSignature(declaration)) { @@ -44295,12 +44447,12 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 163 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { + if (declaration.kind === 164 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 164 /* SetAccessor */); + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 165 /* SetAccessor */); var setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -44390,7 +44542,7 @@ var ts; // will result in a different declaration kind. if (!signature.isolatedSignatureType) { var kind = signature.declaration ? signature.declaration.kind : 0 /* Unknown */; - var isConstructor = kind === 162 /* Constructor */ || kind === 166 /* ConstructSignature */ || kind === 171 /* ConstructorType */; + var isConstructor = kind === 163 /* Constructor */ || kind === 167 /* ConstructSignature */ || kind === 172 /* ConstructorType */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -44404,7 +44556,7 @@ var ts; return symbol.members.get("__index" /* Index */); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 140 /* NumberKeyword */ : 143 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 141 /* NumberKeyword */ : 144 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -44438,13 +44590,13 @@ var ts; if (typeParameter.symbol) { for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.parent.kind === 181 /* InferType */) { + if (declaration.parent.kind === 182 /* InferType */) { // When an 'infer T' declaration is immediately contained in a type reference node // (such as 'Foo'), T's constraint is inferred from the constraint of the // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are // present, we form an intersection of the inferred constraint types. var grandParent = declaration.parent.parent; - if (grandParent.kind === 169 /* TypeReference */) { + if (grandParent.kind === 170 /* TypeReference */) { var typeReference = grandParent; var typeParameters = getTypeParametersForTypeReference(typeReference); if (typeParameters) { @@ -44469,7 +44621,7 @@ var ts; } // When an 'infer T' declaration is immediately contained in a rest parameter // declaration, we infer an 'unknown[]' constraint. - else if (grandParent.kind === 156 /* Parameter */ && grandParent.dotDotDotToken) { + else if (grandParent.kind === 157 /* Parameter */ && grandParent.dotDotDotToken) { inferences = ts.append(inferences, createArrayType(unknownType)); } } @@ -44486,14 +44638,24 @@ var ts; } else { var constraintDeclaration = getConstraintDeclaration(typeParameter); - typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : - getInferredTypeParameterConstraint(typeParameter) || noConstraintType; + if (!constraintDeclaration) { + typeParameter.constraint = getInferredTypeParameterConstraint(typeParameter) || noConstraintType; + } + else { + var type = getTypeFromTypeNode(constraintDeclaration); + if (type.flags & 1 /* Any */ && type !== errorType) { // Allow errorType to propegate to keep downstream errors suppressed + // use keyofConstraintType as the base constraint for mapped type key constraints (unknown isn;t assignable to that, but `any` was), + // use unknown otherwise + type = constraintDeclaration.parent.parent.kind === 187 /* MappedType */ ? keyofConstraintType : unknownType; + } + typeParameter.constraint = type; + } } } return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - var tp = ts.getDeclarationOfKind(typeParameter.symbol, 155 /* TypeParameter */); + var tp = ts.getDeclarationOfKind(typeParameter.symbol, 156 /* TypeParameter */); var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent; return host && getSymbolOfNode(host); } @@ -44573,8 +44735,8 @@ var ts; } var node = type.node; var typeArguments = !node ? ts.emptyArray : - node.kind === 169 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : - node.kind === 174 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : + node.kind === 170 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : + node.kind === 175 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments; @@ -44618,7 +44780,7 @@ var ts; return errorType; } } - if (node.kind === 169 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { + if (node.kind === 170 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { return createDeferredTypeReference(type, node, /*mapper*/ undefined); } // In a type reference, the outer type parameters of the referenced class or interface are automatically @@ -44663,9 +44825,9 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return node.typeName; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -44696,9 +44858,7 @@ var ts; // Get type from reference to named type that cannot be generic (enum or type parameter) var res = tryGetDeclaredTypeOfSymbol(symbol); if (res) { - return checkNoTypeArguments(node, symbol) ? - res.flags & 262144 /* TypeParameter */ ? getConstrainedTypeVariable(res, node) : getRegularTypeOfLiteralType(res) : - errorType; + return checkNoTypeArguments(node, symbol) ? getRegularTypeOfLiteralType(res) : errorType; } if (symbol.flags & 111551 /* Value */ && isJSDocTypeReference(node)) { var jsdocType = getTypeFromJSDocValueReference(node, symbol); @@ -44734,7 +44894,7 @@ var ts; } isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, /*requireStringLiteralLikeArgument*/ true) && !!valueType.symbol; } - var isImportTypeWithQualifier = node.kind === 188 /* ImportType */ && node.qualifier; + var isImportTypeWithQualifier = node.kind === 189 /* ImportType */ && node.qualifier; // valueType might not have a symbol, eg, {import('./b').STRING_LITERAL} if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier)) { typeType = getTypeReferenceType(node, valueType.symbol); @@ -44744,45 +44904,45 @@ var ts; } return links.resolvedJSDocType; } - function getSubstitutionType(typeVariable, substitute) { - if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === typeVariable) { - return typeVariable; + function getSubstitutionType(baseType, substitute) { + if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === baseType) { + return baseType; } - var id = getTypeId(typeVariable) + ">" + getTypeId(substitute); + var id = getTypeId(baseType) + ">" + getTypeId(substitute); var cached = substitutionTypes.get(id); if (cached) { return cached; } var result = createType(33554432 /* Substitution */); - result.typeVariable = typeVariable; + result.baseType = baseType; result.substitute = substitute; substitutionTypes.set(id, result); return result; } function isUnaryTupleTypeNode(node) { - return node.kind === 175 /* TupleType */ && node.elementTypes.length === 1; + return node.kind === 176 /* TupleType */ && node.elementTypes.length === 1; } - function getImpliedConstraint(typeVariable, checkNode, extendsNode) { - return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(typeVariable, checkNode.elementTypes[0], extendsNode.elementTypes[0]) : - getActualTypeVariable(getTypeFromTypeNode(checkNode)) === typeVariable ? getTypeFromTypeNode(extendsNode) : + function getImpliedConstraint(type, checkNode, extendsNode) { + return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elementTypes[0], extendsNode.elementTypes[0]) : + getActualTypeVariable(getTypeFromTypeNode(checkNode)) === type ? getTypeFromTypeNode(extendsNode) : undefined; } - function getConstrainedTypeVariable(typeVariable, node) { + function getConditionalFlowTypeOfType(type, node) { var constraints; - while (node && !ts.isStatement(node) && node.kind !== 303 /* JSDocComment */) { + while (node && !ts.isStatement(node) && node.kind !== 304 /* JSDocComment */) { var parent = node.parent; - if (parent.kind === 180 /* ConditionalType */ && node === parent.trueType) { - var constraint = getImpliedConstraint(typeVariable, parent.checkType, parent.extendsType); + if (parent.kind === 181 /* ConditionalType */ && node === parent.trueType) { + var constraint = getImpliedConstraint(type, parent.checkType, parent.extendsType); if (constraint) { constraints = ts.append(constraints, constraint); } } node = parent; } - return constraints ? getSubstitutionType(typeVariable, getIntersectionType(ts.append(constraints, typeVariable))) : typeVariable; + return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type; } function isJSDocTypeReference(node) { - return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 169 /* TypeReference */ || node.kind === 188 /* ImportType */); + return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 170 /* TypeReference */ || node.kind === 189 /* ImportType */); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { @@ -44895,9 +45055,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: return declaration; } } @@ -45018,19 +45178,19 @@ var ts; } function getArrayOrTupleTargetType(node) { var readonly = isReadonlyTypeOperator(node.parent); - if (node.kind === 174 /* ArrayType */ || node.elementTypes.length === 1 && node.elementTypes[0].kind === 177 /* RestType */) { + if (node.kind === 175 /* ArrayType */ || node.elementTypes.length === 1 && node.elementTypes[0].kind === 178 /* RestType */) { return readonly ? globalReadonlyArrayType : globalArrayType; } var lastElement = ts.lastOrUndefined(node.elementTypes); - var restElement = lastElement && lastElement.kind === 177 /* RestType */ ? lastElement : undefined; - var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 176 /* OptionalType */ && n !== restElement; }) + 1; + var restElement = lastElement && lastElement.kind === 178 /* RestType */ ? lastElement : undefined; + var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 177 /* OptionalType */ && n !== restElement; }) + 1; return getTupleTypeOfArity(node.elementTypes.length, minLength, !!restElement, readonly, /*associatedNames*/ undefined); } // Return true if the given type reference node is directly aliased or if it needs to be deferred // because it is possibly contained in a circular chain of eagerly resolved types. function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { - return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 174 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : - node.kind === 175 /* TupleType */ ? ts.some(node.elementTypes, mayResolveTypeAlias) : + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 175 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : + node.kind === 176 /* TupleType */ ? ts.some(node.elementTypes, mayResolveTypeAlias) : hasDefaultTypeArguments || ts.some(node.typeArguments, mayResolveTypeAlias)); } // Return true when the given node is transitively contained in type constructs that eagerly @@ -45039,15 +45199,15 @@ var ts; function isResolvedByTypeAlias(node) { var parent = node.parent; switch (parent.kind) { - case 182 /* ParenthesizedType */: - case 169 /* TypeReference */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 185 /* IndexedAccessType */: - case 180 /* ConditionalType */: - case 184 /* TypeOperator */: + case 183 /* ParenthesizedType */: + case 170 /* TypeReference */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 186 /* IndexedAccessType */: + case 181 /* ConditionalType */: + case 185 /* TypeOperator */: return isResolvedByTypeAlias(parent); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return true; } return false; @@ -45056,27 +45216,27 @@ var ts; // of a type alias. function mayResolveTypeAlias(node) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node.typeName, 788968 /* Type */).flags & 524288 /* TypeAlias */); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return true; - case 184 /* TypeOperator */: - return node.operator !== 147 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); - case 182 /* ParenthesizedType */: - case 176 /* OptionalType */: - case 299 /* JSDocOptionalType */: - case 297 /* JSDocNullableType */: - case 298 /* JSDocNonNullableType */: - case 294 /* JSDocTypeExpression */: + case 185 /* TypeOperator */: + return node.operator !== 148 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); + case 183 /* ParenthesizedType */: + case 177 /* OptionalType */: + case 300 /* JSDocOptionalType */: + case 298 /* JSDocNullableType */: + case 299 /* JSDocNonNullableType */: + case 295 /* JSDocTypeExpression */: return mayResolveTypeAlias(node.type); - case 177 /* RestType */: - return node.type.kind !== 174 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); - case 178 /* UnionType */: - case 179 /* IntersectionType */: + case 178 /* RestType */: + return node.type.kind !== 175 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); + case 179 /* UnionType */: + case 180 /* IntersectionType */: return ts.some(node.types, mayResolveTypeAlias); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); } @@ -45090,18 +45250,18 @@ var ts; links.resolvedType = emptyObjectType; } else if (isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 175 /* TupleType */ && node.elementTypes.length === 0 ? target : + links.resolvedType = node.kind === 176 /* TupleType */ && node.elementTypes.length === 0 ? target : createDeferredTypeReference(target, node, /*mapper*/ undefined); } else { - var elementTypes = node.kind === 174 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); + var elementTypes = node.kind === 175 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); links.resolvedType = createTypeReference(target, elementTypes); } } return links.resolvedType; } function isReadonlyTypeOperator(node) { - return ts.isTypeOperatorNode(node) && node.operator === 138 /* ReadonlyKeyword */; + return ts.isTypeOperatorNode(node) && node.operator === 139 /* ReadonlyKeyword */; } // We represent tuple types as type references to synthesized generic interface types created by // this function. The types are of the form: @@ -45206,7 +45366,7 @@ var ts; // We ignore 'never' types in unions if (!(flags & 131072 /* Never */)) { includes |= flags & 71041023 /* IncludesMask */; - if (flags & 66846720 /* StructuredOrInstantiable */) + if (flags & 201064448 /* StructuredOrInstantiable */) includes |= 262144 /* IncludesStructuredOrInstantiable */; if (type === wildcardType) includes |= 8388608 /* IncludesWildcard */; @@ -45338,7 +45498,7 @@ var ts; neverType; } } - var objectFlags = (includes & 66994211 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | + var objectFlags = (includes & 201211939 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 268435456 /* ContainsIntersections */ : 0); return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments); } @@ -45692,7 +45852,7 @@ var ts; type = getReducedType(type); return type.flags & 1048576 /* Union */ ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : - maybeTypeOfKind(type, 58982400 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) : + maybeTypeOfKind(type, 193200128 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) : ts.getObjectFlags(type) & 32 /* Mapped */ ? filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); }) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : @@ -45714,20 +45874,24 @@ var ts; return indexType.flags & 131072 /* Never */ ? stringType : indexType; } function getTypeFromTypeOperatorNode(node) { + var _a; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 134 /* KeyOfKeyword */: + case 135 /* KeyOfKeyword */: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 147 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 144 /* SymbolKeyword */ + case 148 /* UniqueKeyword */: + links.resolvedType = node.type.kind === 145 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : errorType; break; - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: links.resolvedType = getTypeFromTypeNode(node.type); break; + case 128 /* AwaitedKeyword */: + links.resolvedType = (_a = getAwaitedType(getTypeFromTypeNode(node.type))) !== null && _a !== void 0 ? _a : unknownType; + break; default: throw ts.Debug.assertNever(node.operator); } @@ -45762,13 +45926,13 @@ var ts; if (type.flags & 2097152 /* Intersection */) { return ts.some(type.types, isJSLiteralType); } - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { return isJSLiteralType(getResolvedBaseConstraint(type)); } return false; } function getPropertyNameFromIndex(indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode : undefined; return isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? @@ -45779,7 +45943,7 @@ var ts; undefined; } function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags) { - var accessExpression = accessNode && accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode : undefined; var propName = accessNode && ts.isPrivateIdentifier(accessNode) ? undefined : getPropertyNameFromIndex(indexType, accessNode); if (propName !== undefined) { var prop = getPropertyOfType(objectType, propName); @@ -45916,9 +46080,9 @@ var ts; } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode.argumentExpression : - accessNode.kind === 185 /* IndexedAccessType */ ? accessNode.indexType : - accessNode.kind === 154 /* ComputedPropertyName */ ? accessNode.expression : + return accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode.argumentExpression : + accessNode.kind === 186 /* IndexedAccessType */ ? accessNode.indexType : + accessNode.kind === 155 /* ComputedPropertyName */ ? accessNode.expression : accessNode; } function isGenericObjectType(type) { @@ -45929,7 +46093,7 @@ var ts; } return !!(type.objectFlags & 8388608 /* IsGenericObjectType */); } - return !!(type.flags & 58982400 /* InstantiableNonPrimitive */) || isGenericMappedType(type); + return !!(type.flags & 193200128 /* InstantiableNonPrimitive */) || isGenericMappedType(type); } function isGenericIndexType(type) { if (type.flags & 3145728 /* UnionOrIntersection */) { @@ -45939,7 +46103,7 @@ var ts; } return !!(type.objectFlags & 33554432 /* IsGenericIndexType */); } - return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); + return !!(type.flags & (193200128 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); } function isThisTypeParameter(type) { return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType); @@ -45992,7 +46156,7 @@ var ts; return type[cache] = distributedOverIndex; } // Only do the inner distributions if the index can no longer be instantiated to cause index distribution again - if (!(indexType.flags & 63176704 /* Instantiable */)) { + if (!(indexType.flags & 197394432 /* Instantiable */)) { // (T | U)[K] -> T[K] | U[K] (reading) // (T | U)[K] -> T[K] & U[K] (writing) // (T & U)[K] -> T[K] & U[K] @@ -46064,7 +46228,7 @@ var ts; // object type. Note that for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in // an expression. This is to preserve backwards compatibility. For example, an element access 'this["foo"]' // has always been resolved eagerly using the constraint type of 'this' at the given location. - if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 185 /* IndexedAccessType */) && isGenericObjectType(objectType)) { + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 186 /* IndexedAccessType */) && isGenericObjectType(objectType)) { if (objectType.flags & 3 /* AnyOrUnknown */) { return objectType; } @@ -46114,7 +46278,7 @@ var ts; links.resolvedType = resolved.flags & 8388608 /* IndexedAccess */ && resolved.objectType === objectType && resolved.indexType === indexType ? - getConstrainedTypeVariable(resolved, node) : resolved; + getConditionalFlowTypeOfType(resolved, node) : resolved; } return links.resolvedType; } @@ -46134,7 +46298,7 @@ var ts; } function getActualTypeVariable(type) { if (type.flags & 33554432 /* Substitution */) { - return type.typeVariable; + return type.baseType; } if (type.flags & 8388608 /* IndexedAccess */ && (type.objectType.flags & 33554432 /* Substitution */ || type.indexType.flags & 33554432 /* Substitution */)) { @@ -46162,7 +46326,7 @@ var ts; // types rules (i.e. proper contravariance) for inferences. inferTypes(context.inferences, checkType, extendsType, 128 /* NoConstraints */ | 256 /* AlwaysStrict */); } - combinedMapper = combineTypeMappers(mapper, context.mapper); + combinedMapper = mergeTypeMappers(mapper, context.mapper); } // Instantiate the extends type including inferences for 'infer T' type parameters var inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType; @@ -46353,7 +46517,7 @@ var ts; } function getAliasSymbolForTypeNode(node) { var host = node.parent; - while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 138 /* ReadonlyKeyword */) { + while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 139 /* ReadonlyKeyword */) { host = host.parent; } return ts.isTypeAlias(host) ? getSymbolOfNode(host) : undefined; @@ -46415,7 +46579,7 @@ var ts; * this function should be called in a left folding style, with left = previous result of getSpreadType * and right = the new element to be spread. */ - function getSpreadType(left, right, symbol, objectFlags, readonly, isParentTypeNullable) { + function getSpreadType(left, right, symbol, objectFlags, readonly) { if (left.flags & 1 /* Any */ || right.flags & 1 /* Any */) { return anyType; } @@ -46431,16 +46595,16 @@ var ts; if (left.flags & 1048576 /* Union */) { var merged = tryMergeUnionOfObjectTypeAndEmptyObject(left, readonly); if (merged) { - return getSpreadType(merged, right, symbol, objectFlags, readonly, isParentTypeNullable); + return getSpreadType(merged, right, symbol, objectFlags, readonly); } - return mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly, isParentTypeNullable); }); + return mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly); }); } if (right.flags & 1048576 /* Union */) { var merged = tryMergeUnionOfObjectTypeAndEmptyObject(right, readonly); if (merged) { - return getSpreadType(left, merged, symbol, objectFlags, readonly, maybeTypeOfKind(right, 98304 /* Nullable */)); + return getSpreadType(left, merged, symbol, objectFlags, readonly); } - return mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly, maybeTypeOfKind(right, 98304 /* Nullable */)); }); + return mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly); }); } if (right.flags & (528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 132 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)) { return left; @@ -46502,14 +46666,6 @@ var ts; result.nameType = getSymbolLinks(leftProp).nameType; members.set(leftProp.escapedName, result); } - else if (strictNullChecks && - !isParentTypeNullable && - symbol && - !isFromSpreadAssignment(leftProp, symbol) && - isFromSpreadAssignment(rightProp, symbol) && - !maybeTypeOfKind(rightType, 98304 /* Nullable */)) { - error(leftProp.valueDeclaration, ts.Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, ts.unescapeLeadingUnderscores(leftProp.escapedName)); - } } else { members.set(leftProp.escapedName, getSpreadSymbol(leftProp, readonly)); @@ -46608,7 +46764,7 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 246 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 247 /* InterfaceDeclaration */)) { if (!ts.hasModifier(container, 32 /* Static */) && (!ts.isConstructorDeclaration(container) || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -46639,90 +46795,93 @@ var ts; return links.resolvedType; } function getTypeFromTypeNode(node) { + return getConditionalFlowTypeOfType(getTypeFromTypeNodeWorker(node), node); + } + function getTypeFromTypeNodeWorker(node) { switch (node.kind) { case 125 /* AnyKeyword */: - case 295 /* JSDocAllType */: - case 296 /* JSDocUnknownType */: + case 296 /* JSDocAllType */: + case 297 /* JSDocUnknownType */: return anyType; - case 148 /* UnknownKeyword */: + case 149 /* UnknownKeyword */: return unknownType; - case 143 /* StringKeyword */: + case 144 /* StringKeyword */: return stringType; - case 140 /* NumberKeyword */: + case 141 /* NumberKeyword */: return numberType; - case 151 /* BigIntKeyword */: + case 152 /* BigIntKeyword */: return bigintType; - case 128 /* BooleanKeyword */: + case 129 /* BooleanKeyword */: return booleanType; - case 144 /* SymbolKeyword */: + case 145 /* SymbolKeyword */: return esSymbolType; case 110 /* VoidKeyword */: return voidType; - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: return undefinedType; case 100 /* NullKeyword */: return nullType; - case 137 /* NeverKeyword */: + case 138 /* NeverKeyword */: return neverType; - case 141 /* ObjectKeyword */: + case 142 /* ObjectKeyword */: return node.flags & 131072 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType; - case 183 /* ThisType */: + case 184 /* ThisType */: case 104 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 187 /* LiteralType */: + case 188 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return getTypeFromTypeReference(node); - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return node.assertsModifier ? voidType : booleanType; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 174 /* ArrayType */: - case 175 /* TupleType */: + case 175 /* ArrayType */: + case 176 /* TupleType */: return getTypeFromArrayOrTupleTypeNode(node); - case 176 /* OptionalType */: + case 177 /* OptionalType */: return getTypeFromOptionalTypeNode(node); - case 178 /* UnionType */: + case 179 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 179 /* IntersectionType */: + case 180 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 297 /* JSDocNullableType */: + case 298 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 299 /* JSDocOptionalType */: + case 300 /* JSDocOptionalType */: return addOptionality(getTypeFromTypeNode(node.type)); - case 182 /* ParenthesizedType */: - case 298 /* JSDocNonNullableType */: - case 294 /* JSDocTypeExpression */: + case 183 /* ParenthesizedType */: + case 299 /* JSDocNonNullableType */: + case 295 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 177 /* RestType */: + case 178 /* RestType */: return getElementTypeOfArrayType(getTypeFromTypeNode(node.type)) || errorType; - case 301 /* JSDocVariadicType */: + case 302 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 173 /* TypeLiteral */: - case 304 /* JSDocTypeLiteral */: - case 300 /* JSDocFunctionType */: - case 305 /* JSDocSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 174 /* TypeLiteral */: + case 305 /* JSDocTypeLiteral */: + case 301 /* JSDocFunctionType */: + case 306 /* JSDocSignature */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 184 /* TypeOperator */: + case 185 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 186 /* MappedType */: + case 187 /* MappedType */: return getTypeFromMappedTypeNode(node); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return getTypeFromConditionalTypeNode(node); - case 181 /* InferType */: + case 182 /* InferType */: return getTypeFromInferTypeNode(node); - case 188 /* ImportType */: + case 189 /* ImportType */: return getTypeFromImportTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode case 75 /* Identifier */: - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: var symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -46752,27 +46911,41 @@ var ts; function instantiateSignatures(signatures, mapper) { return instantiateList(signatures, mapper, instantiateSignature); } - function makeUnaryTypeMapper(source, target) { - return function (t) { return t === source ? target : t; }; + function createTypeMapper(sources, targets) { + return sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : makeArrayTypeMapper(sources, targets); + } + function getMappedType(type, mapper) { + switch (mapper.kind) { + case 0 /* Simple */: + return type === mapper.source ? mapper.target : type; + case 1 /* Array */: + var sources = mapper.sources; + var targets = mapper.targets; + for (var i = 0; i < sources.length; i++) { + if (type === sources[i]) { + return targets ? targets[i] : anyType; + } + } + return type; + case 2 /* Function */: + return mapper.func(type); + case 3 /* Composite */: + case 4 /* Merged */: + var t1 = getMappedType(type, mapper.mapper1); + return t1 !== type && mapper.kind === 3 /* Composite */ ? instantiateType(t1, mapper.mapper2) : getMappedType(t1, mapper.mapper2); + } } - function makeBinaryTypeMapper(source1, target1, source2, target2) { - return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; }; + function makeUnaryTypeMapper(source, target) { + return { kind: 0 /* Simple */, source: source, target: target }; } function makeArrayTypeMapper(sources, targets) { - return function (t) { - for (var i = 0; i < sources.length; i++) { - if (t === sources[i]) { - return targets ? targets[i] : anyType; - } - } - return t; - }; + return { kind: 1 /* Array */, sources: sources, targets: targets }; } - function createTypeMapper(sources, targets) { - ts.Debug.assert(targets === undefined || sources.length === targets.length); - return sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : - sources.length === 2 ? makeBinaryTypeMapper(sources[0], targets ? targets[0] : anyType, sources[1], targets ? targets[1] : anyType) : - makeArrayTypeMapper(sources, targets); + function makeFunctionTypeMapper(func) { + return { kind: 2 /* Function */, func: func }; + } + function makeCompositeTypeMapper(kind, mapper1, mapper2) { + return { kind: kind, mapper1: mapper1, mapper2: mapper2 }; } function createTypeEraser(sources) { return createTypeMapper(sources, /*targets*/ undefined); @@ -46782,29 +46955,25 @@ var ts; * This is used during inference when instantiating type parameter defaults. */ function createBackreferenceMapper(context, index) { - return function (t) { return ts.findIndex(context.inferences, function (info) { return info.typeParameter === t; }) >= index ? unknownType : t; }; + return makeFunctionTypeMapper(function (t) { return ts.findIndex(context.inferences, function (info) { return info.typeParameter === t; }) >= index ? unknownType : t; }); } function combineTypeMappers(mapper1, mapper2) { - if (!mapper1) - return mapper2; - if (!mapper2) - return mapper1; - return function (t) { return instantiateType(mapper1(t), mapper2); }; + return mapper1 ? makeCompositeTypeMapper(3 /* Composite */, mapper1, mapper2) : mapper2; + } + function mergeTypeMappers(mapper1, mapper2) { + return mapper1 ? makeCompositeTypeMapper(4 /* Merged */, mapper1, mapper2) : mapper2; } - function createReplacementMapper(source, target, baseMapper) { - return function (t) { return t === source ? target : baseMapper(t); }; + function prependTypeMapping(source, target, mapper) { + return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(4 /* Merged */, makeUnaryTypeMapper(source, target), mapper); } - function permissiveMapper(type) { - return type.flags & 262144 /* TypeParameter */ ? wildcardType : type; + function appendTypeMapping(mapper, source, target) { + return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(4 /* Merged */, mapper, makeUnaryTypeMapper(source, target)); } function getRestrictiveTypeParameter(tp) { return tp.constraint === unknownType ? tp : tp.restrictiveInstantiation || (tp.restrictiveInstantiation = createTypeParameter(tp.symbol), tp.restrictiveInstantiation.constraint = unknownType, tp.restrictiveInstantiation); } - function restrictiveMapper(type) { - return type.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(type) : type; - } function cloneTypeParameter(typeParameter) { var result = createTypeParameter(typeParameter.symbol); result.target = typeParameter; @@ -46838,7 +47007,7 @@ var ts; } function instantiateSymbol(symbol, mapper) { var links = getSymbolLinks(symbol); - if (links.type && !maybeTypeOfKind(links.type, 524288 /* Object */ | 63176704 /* Instantiable */)) { + if (links.type && !couldContainTypeVariables(links.type)) { // If the type of the symbol is already resolved, and if that type could not possibly // be affected by instantiation, simply return the symbol itself. return symbol; @@ -46904,7 +47073,8 @@ var ts; // We are instantiating an anonymous type that has one or more type parameters in scope. Apply the // mapper to the type parameters to produce the effective list of type arguments, and compute the // instantiation cache key from the type IDs of the type arguments. - var typeArguments = ts.map(typeParameters, combineTypeMappers(type.mapper, mapper)); + var combinedMapper_1 = combineTypeMappers(type.mapper, mapper); + var typeArguments = ts.map(typeParameters, function (t) { return getMappedType(t, combinedMapper_1); }); var id = getTypeListId(typeArguments); var result = links.instantiations.get(id); if (!result) { @@ -46919,9 +47089,9 @@ var ts; return type; } function maybeTypeParameterReference(node) { - return !(node.kind === 153 /* QualifiedName */ || - node.parent.kind === 169 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || - node.parent.kind === 188 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); + return !(node.kind === 154 /* QualifiedName */ || + node.parent.kind === 170 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || + node.parent.kind === 189 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); } function isTypeParameterPossiblyReferenced(tp, node) { // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks @@ -46930,7 +47100,7 @@ var ts; if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container = tp.symbol.declarations[0].parent; for (var n = node; n !== container; n = n.parent) { - if (!n || n.kind === 223 /* Block */ || n.kind === 180 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { + if (!n || n.kind === 224 /* Block */ || n.kind === 181 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { return true; } } @@ -46939,12 +47109,12 @@ var ts; return true; function containsReference(node) { switch (node.kind) { - case 183 /* ThisType */: + case 184 /* ThisType */: return !!tp.isThisType; case 75 /* Identifier */: return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) && - getTypeFromTypeNode(node) === tp; - case 172 /* TypeQuery */: + getTypeFromTypeNodeWorker(node) === tp; // use worker because we're looking for === equality + case 173 /* TypeQuery */: return true; } return !!ts.forEachChild(node, containsReference); @@ -46976,8 +47146,8 @@ var ts; var mappedTypeVariable = instantiateType(typeVariable, mapper); if (typeVariable !== mappedTypeVariable) { return mapType(getReducedType(mappedTypeVariable), function (t) { - if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { - var replacementMapper = createReplacementMapper(typeVariable, t, mapper); + if (t.flags & (3 /* AnyOrUnknown */ | 193200128 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { + var replacementMapper = prependTypeMapping(typeVariable, t, mapper); return isArrayType(t) ? instantiateMappedArrayType(t, type, replacementMapper) : isTupleType(t) ? instantiateMappedTupleType(t, type, replacementMapper) : instantiateAnonymousType(type, replacementMapper); @@ -47010,7 +47180,7 @@ var ts; createTupleType(elementTypes, newMinLength, tupleType.target.hasRestElement, newReadonly, tupleType.target.associatedNames); } function instantiateMappedTypeTemplate(type, key, isOptional, mapper) { - var templateMapper = combineTypeMappers(mapper, createTypeMapper([getTypeParameterFromMappedType(type)], [key])); + var templateMapper = appendTypeMapping(mapper, getTypeParameterFromMappedType(type), key); var propType = instantiateType(getTemplateTypeFromMappedType(type.target || type), templateMapper); var modifiers = getMappedTypeModifiers(type); return strictNullChecks && modifiers & 4 /* IncludeOptional */ && !maybeTypeOfKind(propType, 32768 /* Undefined */ | 16384 /* Void */) ? getOptionalType(propType) : @@ -47040,7 +47210,7 @@ var ts; // We are instantiating a conditional type that has one or more type parameters in scope. Apply the // mapper to the type parameters to produce the effective list of type arguments, and compute the // instantiation cache key from the type IDs of the type arguments. - var typeArguments = ts.map(root.outerTypeParameters, mapper); + var typeArguments = ts.map(root.outerTypeParameters, function (t) { return getMappedType(t, mapper); }); var id = getTypeListId(typeArguments); var result = root.instantiations.get(id); if (!result) { @@ -47058,15 +47228,15 @@ var ts; // type A | B, we produce (A extends U ? X : Y) | (B extends U ? X : Y). if (root.isDistributive) { var checkType_1 = root.checkType; - var instantiatedType = mapper(checkType_1); + var instantiatedType = getMappedType(checkType_1, mapper); if (checkType_1 !== instantiatedType && instantiatedType.flags & (1048576 /* Union */ | 131072 /* Never */)) { - return mapType(instantiatedType, function (t) { return getConditionalType(root, createReplacementMapper(checkType_1, t, mapper)); }); + return mapType(instantiatedType, function (t) { return getConditionalType(root, prependTypeMapping(checkType_1, t, mapper)); }); } } return getConditionalType(root, mapper); } function instantiateType(type, mapper) { - if (!type || !mapper || mapper === identityMapper) { + if (!type || !mapper) { return type; } if (instantiationDepth === 50 || instantiationCount >= 5000000) { @@ -47084,9 +47254,10 @@ var ts; return result; } function instantiateTypeWorker(type, mapper) { + var _a; var flags = type.flags; if (flags & 262144 /* TypeParameter */) { - return mapper(type); + return getMappedType(type, mapper); } if (flags & 524288 /* Object */) { var objectFlags = type.objectFlags; @@ -47131,8 +47302,11 @@ var ts; if (flags & 16777216 /* Conditional */) { return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper)); } + if (flags & 134217728 /* Awaited */) { + return (_a = getAwaitedType(instantiateType(type.awaitedType, mapper))) !== null && _a !== void 0 ? _a : unknownType; + } if (flags & 33554432 /* Substitution */) { - var maybeVariable = instantiateType(type.typeVariable, mapper); + var maybeVariable = instantiateType(type.baseType, mapper); if (maybeVariable.flags & 8650752 /* TypeVariable */) { return getSubstitutionType(maybeVariable, instantiateType(type.substitute, mapper)); } @@ -47172,35 +47346,35 @@ var ts; // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 244 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type return isContextSensitiveFunctionLikeDeclaration(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return ts.some(node.properties, isContextSensitive); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return ts.some(node.elements, isContextSensitive); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive); - case 273 /* JsxAttribute */: { + case 274 /* JsxAttribute */: { // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. var initializer = node.initializer; return !!initializer && isContextSensitive(initializer); } - case 276 /* JsxExpression */: { + case 277 /* JsxExpression */: { // It is possible to that node.expression is undefined (e.g
) var expression = node.expression; return !!expression && isContextSensitive(expression); @@ -47219,7 +47393,7 @@ var ts; if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 202 /* ArrowFunction */) { + if (node.kind !== 203 /* ArrowFunction */) { // If the first parameter is not an explicit 'this' parameter, then the function has // an implicit 'this' parameter which is subject to contextual typing. var parameter = ts.firstOrUndefined(node.parameters); @@ -47232,7 +47406,7 @@ var ts; } function hasContextSensitiveReturnExpression(node) { // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 223 /* Block */ && isContextSensitive(node.body); + return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 224 /* Block */ && isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && @@ -47285,7 +47459,7 @@ var ts; function isTypeDerivedFrom(source, target) { return source.flags & 1048576 /* Union */ ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) : target.flags & 1048576 /* Union */ ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) : - source.flags & 58982400 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : + source.flags & 193200128 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : target === globalObjectType ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) : target === globalFunctionType ? !!(source.flags & 524288 /* Object */) && isFunctionObjectType(source) : hasBaseType(source, getTargetType(target)); @@ -47335,23 +47509,23 @@ var ts; return true; } switch (node.kind) { - case 276 /* JsxExpression */: - case 200 /* ParenthesizedExpression */: + case 277 /* JsxExpression */: + case 201 /* ParenthesizedExpression */: return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: case 27 /* CommaToken */: return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); } return false; @@ -47542,7 +47716,7 @@ var ts; } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: // child is of the type of the expression return { errorNode: child, innerExpression: child.expression, nameType: nameType }; case 11 /* JsxText */: @@ -47551,9 +47725,9 @@ var ts; } // child is a string return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() }; - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 270 /* JsxFragment */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 271 /* JsxFragment */: // child is of type JSX.Element return { errorNode: child, innerExpression: child, nameType: nameType }; default: @@ -47704,11 +47878,11 @@ var ts; } _b = prop.kind; switch (_b) { - case 164 /* SetAccessor */: return [3 /*break*/, 2]; - case 163 /* GetAccessor */: return [3 /*break*/, 2]; - case 161 /* MethodDeclaration */: return [3 /*break*/, 2]; - case 282 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; - case 281 /* PropertyAssignment */: return [3 /*break*/, 4]; + case 165 /* SetAccessor */: return [3 /*break*/, 2]; + case 164 /* GetAccessor */: return [3 /*break*/, 2]; + case 162 /* MethodDeclaration */: return [3 /*break*/, 2]; + case 283 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; + case 282 /* PropertyAssignment */: return [3 /*break*/, 4]; } return [3 /*break*/, 6]; case 2: return [4 /*yield*/, { errorNode: prop.name, innerExpression: undefined, nameType: type }]; @@ -47785,8 +47959,8 @@ var ts; return 0 /* False */; } var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 161 /* MethodDeclaration */ && - kind !== 160 /* MethodSignature */ && kind !== 162 /* Constructor */; + var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 162 /* MethodDeclaration */ && + kind !== 161 /* MethodSignature */ && kind !== 163 /* Constructor */; var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -48047,7 +48221,7 @@ var ts; return !!(related & 1 /* Succeeded */); } } - if (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */) { + if (source.flags & 201064448 /* StructuredOrInstantiable */ || target.flags & 201064448 /* StructuredOrInstantiable */) { return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; @@ -48060,7 +48234,7 @@ var ts; var t = isFreshLiteralType(type) ? type.regularType : ts.getObjectFlags(type) & 4 /* Reference */ && type.node ? createTypeReference(type.target, getTypeArguments(type)) : type.flags & 3145728 /* UnionOrIntersection */ ? getReducedType(type) : - type.flags & 33554432 /* Substitution */ ? writing ? type.typeVariable : type.substitute : + type.flags & 33554432 /* Substitution */ ? writing ? type.baseType : type.substitute : type.flags & 25165824 /* Simplifiable */ ? getSimplifiedType(type, writing) : type; if (t === type) @@ -48280,8 +48454,15 @@ var ts; if (incompatibleStack.length) reportIncompatibleStack(); var _a = getTypeNamesForErrorDisplay(source, target), sourceType = _a[0], targetType = _a[1]; - if (target.flags & 262144 /* TypeParameter */ && target.immediateBaseConstraint !== undefined && isTypeAssignableTo(source, target.immediateBaseConstraint)) { - reportError(ts.Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2, sourceType, targetType, typeToString(target.immediateBaseConstraint)); + if (target.flags & 262144 /* TypeParameter */) { + var constraint = getBaseConstraintOfType(target); + var constraintElab = constraint && isTypeAssignableTo(source, constraint); + if (constraintElab) { + reportError(ts.Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2, sourceType, targetType, typeToString(constraint)); + } + else { + reportError(ts.Diagnostics._0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1, targetType, sourceType); + } } if (!message) { if (relation === comparableRelation) { @@ -48417,7 +48598,7 @@ var ts; if (source.flags & 1048576 /* Union */) { result = relation === comparableRelation ? someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState) : - eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */)); + eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState & 4 /* ExcessCheck */); } else { if (target.flags & 1048576 /* Union */) { @@ -48425,9 +48606,9 @@ var ts; } else if (target.flags & 2097152 /* Intersection */) { result = typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2 /* Target */); - if (result && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks)) { + if (result && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) && !(intersectionState & 4 /* ExcessCheck */)) { // Validate against excess props using the original `source` - if (!propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 0 /* None */)) { + if (!propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 4 /* ExcessCheck */)) { return 0 /* False */; } } @@ -48446,9 +48627,11 @@ var ts; // // - For a primitive type or type parameter (such as 'number = A & B') there is no point in // breaking the intersection apart. - result = someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */); + if (!isNonGenericObjectType(target) || !ts.every(source.types, function (t) { return isNonGenericObjectType(t) && !(ts.getObjectFlags(t) & 2097152 /* NonInferrableType */); })) { + result = someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */); + } } - if (!result && (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */)) { + if (!result && (source.flags & 201064448 /* StructuredOrInstantiable */ || target.flags & 201064448 /* StructuredOrInstantiable */)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) { resetErrorInfo(saveErrorInfo); } @@ -48678,12 +48861,12 @@ var ts; } return 0 /* False */; } - function eachTypeRelatedToType(source, target, reportErrors) { + function eachTypeRelatedToType(source, target, reportErrors, intersectionState) { var result = -1 /* True */; var sourceTypes = source.types; for (var _i = 0, sourceTypes_2 = sourceTypes; _i < sourceTypes_2.length; _i++) { var sourceType = sourceTypes_2[_i]; - var related = isRelatedTo(sourceType, target, reportErrors); + var related = isRelatedTo(sourceType, target, reportErrors, /*headMessage*/ undefined, intersectionState); if (!related) { return 0 /* False */; } @@ -48771,10 +48954,10 @@ var ts; // We're in the middle of variance checking - integrate any unmeasurable/unreliable flags from this cached component var saved = entry & 24 /* ReportsMask */; if (saved & 8 /* ReportsUnmeasurable */) { - instantiateType(source, reportUnmeasurableMarkers); + instantiateType(source, makeFunctionTypeMapper(reportUnmeasurableMarkers)); } if (saved & 16 /* ReportsUnreliable */) { - instantiateType(source, reportUnreliableMarkers); + instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers)); } } return entry & 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */; @@ -48813,7 +48996,8 @@ var ts; if (outofbandVarianceMarkerHandler) { originalHandler = outofbandVarianceMarkerHandler; outofbandVarianceMarkerHandler = function (onlyUnreliable) { - propagatingVarianceFlags |= onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */; + propagatingVarianceFlags |= + onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */; return originalHandler(onlyUnreliable); }; } @@ -48940,6 +49124,17 @@ var ts; } } } + else if (target.flags & 134217728 /* Awaited */ && source.flags & 134217728 /* Awaited */) { + var targetType = target.awaitedType; + var sourceType = instantiateType(source.awaitedType, makeFunctionTypeMapper(reportUnreliableMarkers)); + // An `awaited S` is related to an `awaited T` if `S` is related to `T`: + // + // S <: T ⇒ awaited S <: awaited T + // + if (result = isRelatedTo(sourceType, targetType, reportErrors)) { + return result; + } + } else if (isGenericMappedType(target)) { // A source type T is related to a target type { [P in X]: T[P] } var template = getTemplateTypeFromMappedType(target); @@ -49053,6 +49248,21 @@ var ts; } } } + else if (source.flags & 134217728 /* Awaited */) { + // An `awaited S` is related to `T` if `awaited C` is related to `T`, where `C` is the + // constraint of `S`: + // + // S <: C ^ awaited C <: T ⇒ awaited S <: T + // + // For example `awaited Promise` is assignable to `number`. + var constraint = getConstraintOfType(source.awaitedType); + var awaitedConstraint = constraint && getAwaitedType(constraint); + if (awaitedConstraint) { + if (result = isRelatedTo(awaitedConstraint, target, reportErrors)) { + return result; + } + } + } else { // An empty object type is related to any mapped type that includes a '?' modifier. if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target) && isEmptyObjectType(source)) { @@ -49212,7 +49422,7 @@ var ts; if (modifiersRelated) { var result_6; var targetConstraint = getConstraintTypeFromMappedType(target); - var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers); + var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers)); if (result_6 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) { var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); return result_6 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); @@ -49680,7 +49890,7 @@ var ts; * See signatureAssignableTo, compareSignaturesIdentical */ function signatureRelatedTo(source, target, erase, reportErrors, incompatibleReporter) { - return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0, reportErrors, reportError, incompatibleReporter, isRelatedTo, reportUnreliableMarkers); + return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0, reportErrors, reportError, incompatibleReporter, isRelatedTo, makeFunctionTypeMapper(reportUnreliableMarkers)); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -49831,10 +50041,6 @@ var ts; // make sure exactly 1 matches before returning it return match === -1 || discriminable.indexOf(/*searchElement*/ true, match + 1) !== -1 ? defaultValue : target.types[match]; } - function isFromSpreadAssignment(prop, container) { - var _a; - return ((_a = prop.valueDeclaration) === null || _a === void 0 ? void 0 : _a.parent) !== container.valueDeclaration; - } /** * A type is 'weak' if it is an object type with at least one optional property * and no required properties, call/construct signatures or index signatures @@ -49908,13 +50114,11 @@ var ts; variance = 4 /* Independent */; } outofbandVarianceMarkerHandler = oldHandler; - if (unmeasurable || unreliable) { - if (unmeasurable) { - variance |= 8 /* Unmeasurable */; - } - if (unreliable) { - variance |= 16 /* Unreliable */; - } + if (unmeasurable) { + variance |= 8 /* Unmeasurable */; + } + if (unreliable) { + variance |= 16 /* Unreliable */; } variances.push(variance); }; @@ -50687,12 +50891,12 @@ var ts; } var diagnostic; switch (declaration.kind) { - case 209 /* BinaryExpression */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 210 /* BinaryExpression */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 156 /* Parameter */: + case 157 /* Parameter */: var param = declaration; if (ts.isIdentifier(param.name) && (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && @@ -50707,23 +50911,23 @@ var ts; noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; if (!noImplicitAny) { // Don't issue a suggestion for binding elements since the codefix doesn't yet support them. return; } break; - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: if (noImplicitAny && !declaration.name) { if (wideningKind === 1 /* GeneratorYield */) { error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); @@ -50737,7 +50941,7 @@ var ts; wideningKind === 1 /* GeneratorYield */ ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 186 /* MappedType */: + case 187 /* MappedType */: if (noImplicitAny) { error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } @@ -50799,8 +51003,8 @@ var ts; signature: signature, flags: flags, compareTypes: compareTypes, - mapper: function (t) { return mapToInferredType(context, t, /*fix*/ true); }, - nonFixingMapper: function (t) { return mapToInferredType(context, t, /*fix*/ false); }, + mapper: makeFunctionTypeMapper(function (t) { return mapToInferredType(context, t, /*fix*/ true); }), + nonFixingMapper: makeFunctionTypeMapper(function (t) { return mapToInferredType(context, t, /*fix*/ false); }), }; return context; } @@ -50865,7 +51069,7 @@ var ts; if (objectFlags & 67108864 /* CouldContainTypeVariablesComputed */) { return !!(objectFlags & 134217728 /* CouldContainTypeVariables */); } - var result = !!(type.flags & 63176704 /* Instantiable */ || + var result = !!(type.flags & 197394432 /* Instantiable */ || objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 131072 /* ObjectRestType */) || @@ -51161,7 +51365,7 @@ var ts; var indexType = getSimplifiedType(target.indexType, /*writing*/ false); // Generally simplifications of instantiable indexes are avoided to keep relationship checking correct, however if our target is an access, we can consider // that key of that access to be "instantiated", since we're looking to find the infernce goal in any way we can. - if (indexType.flags & 63176704 /* Instantiable */) { + if (indexType.flags & 197394432 /* Instantiable */) { var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, /*writing*/ false), indexType, /*writing*/ false); if (simplified_1 && simplified_1 !== target) { invokeOnce(source, simplified_1, inferFromTypes); @@ -51196,6 +51400,9 @@ var ts; inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } + else if (source.flags & 134217728 /* Awaited */ && target.flags & 134217728 /* Awaited */) { + inferFromTypes(source.awaitedType, target.awaitedType); + } else if (target.flags & 16777216 /* Conditional */) { var savePriority = priority; priority |= contravariant ? 16 /* ContravariantConditional */ : 0; @@ -51203,6 +51410,10 @@ var ts; inferToMultipleTypes(source, targetTypes, target.flags); priority = savePriority; } + else if (target.flags & 134217728 /* Awaited */) { + var targetTypes = [target.awaitedType, createPromiseLikeType(target.awaitedType)]; + inferToMultipleTypes(source, targetTypes, target.flags); + } else if (target.flags & 3145728 /* UnionOrIntersection */) { inferToMultipleTypes(source, target.types, target.flags); } @@ -51216,7 +51427,7 @@ var ts; } else { source = getReducedType(source); - if (!(priority & 128 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 63176704 /* Instantiable */))) { + if (!(priority & 128 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 197394432 /* Instantiable */))) { var apparentSource = getApparentType(source); // getApparentType can return _any_ type, since an indexed access or conditional may simplify to any other type. // If that occurs and it doesn't simplify to an object or intersection, we'll need to restart `inferFromTypes` @@ -51498,6 +51709,32 @@ var ts; } // Infer from the members of source and target only if the two types are possibly related if (!typesDefinitelyUnrelated(source, target)) { + if (isArrayType(source) || isTupleType(source)) { + if (isTupleType(target)) { + var sourceLength = isTupleType(source) ? getLengthOfTupleType(source) : 0; + var targetLength = getLengthOfTupleType(target); + var sourceRestType = isTupleType(source) ? getRestTypeOfTupleType(source) : getElementTypeOfArrayType(source); + var targetRestType = getRestTypeOfTupleType(target); + var fixedLength = targetLength < sourceLength || sourceRestType ? targetLength : sourceLength; + for (var i = 0; i < fixedLength; i++) { + inferFromTypes(i < sourceLength ? getTypeArguments(source)[i] : sourceRestType, getTypeArguments(target)[i]); + } + if (targetRestType) { + var types = fixedLength < sourceLength ? getTypeArguments(source).slice(fixedLength, sourceLength) : []; + if (sourceRestType) { + types.push(sourceRestType); + } + if (types.length) { + inferFromTypes(getUnionType(types), targetRestType); + } + } + return; + } + if (isArrayType(target)) { + inferFromIndexTypes(source, target); + return; + } + } inferFromProperties(source, target); inferFromSignatures(source, target, 0 /* Call */); inferFromSignatures(source, target, 1 /* Construct */); @@ -51505,32 +51742,6 @@ var ts; } } function inferFromProperties(source, target) { - if (isArrayType(source) || isTupleType(source)) { - if (isTupleType(target)) { - var sourceLength = isTupleType(source) ? getLengthOfTupleType(source) : 0; - var targetLength = getLengthOfTupleType(target); - var sourceRestType = isTupleType(source) ? getRestTypeOfTupleType(source) : getElementTypeOfArrayType(source); - var targetRestType = getRestTypeOfTupleType(target); - var fixedLength = targetLength < sourceLength || sourceRestType ? targetLength : sourceLength; - for (var i = 0; i < fixedLength; i++) { - inferFromTypes(i < sourceLength ? getTypeArguments(source)[i] : sourceRestType, getTypeArguments(target)[i]); - } - if (targetRestType) { - var types = fixedLength < sourceLength ? getTypeArguments(source).slice(fixedLength, sourceLength) : []; - if (sourceRestType) { - types.push(sourceRestType); - } - if (types.length) { - inferFromTypes(getUnionType(types), targetRestType); - } - } - return; - } - if (isArrayType(target)) { - inferFromIndexTypes(source, target); - return; - } - } var properties = getPropertiesOfObjectType(target); for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { var targetProp = properties_3[_i]; @@ -51548,7 +51759,7 @@ var ts; var len = sourceLen < targetLen ? sourceLen : targetLen; var skipParameters = !!(ts.getObjectFlags(source) & 2097152 /* NonInferrableType */); for (var i = 0; i < len; i++) { - inferFromSignature(getBaseSignature(sourceSignatures[sourceLen - len + i]), getBaseSignature(targetSignatures[targetLen - len + i]), skipParameters); + inferFromSignature(getBaseSignature(sourceSignatures[sourceLen - len + i]), getErasedSignature(targetSignatures[targetLen - len + i]), skipParameters); } } function inferFromSignature(source, target, skipParameters) { @@ -51556,7 +51767,7 @@ var ts; var saveBivariant = bivariant; var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; // Once we descend into a bivariant signature we remain bivariant for all nested inferences - bivariant = bivariant || kind === 161 /* MethodDeclaration */ || kind === 160 /* MethodSignature */ || kind === 162 /* Constructor */; + bivariant = bivariant || kind === 162 /* MethodDeclaration */ || kind === 161 /* MethodSignature */ || kind === 163 /* Constructor */; applyToParameterTypes(source, target, inferFromContravariantTypes); bivariant = saveBivariant; } @@ -51664,7 +51875,7 @@ var ts; if (defaultType) { // Instantiate the default type. Any forward reference to a type // parameter should be instantiated to the empty object type. - inferredType = instantiateType(defaultType, combineTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper)); + inferredType = instantiateType(defaultType, mergeTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper)); } } } @@ -51726,7 +51937,7 @@ var ts; case "AsyncIterator": return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later; default: - if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; } else { @@ -51747,7 +51958,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - return !!ts.findAncestor(node, function (n) { return n.kind === 172 /* TypeQuery */ ? true : n.kind === 75 /* Identifier */ || n.kind === 153 /* QualifiedName */ ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 173 /* TypeQuery */ ? true : n.kind === 75 /* Identifier */ || n.kind === 154 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -51762,11 +51973,11 @@ var ts; return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; case 104 /* ThisKeyword */: return "0"; - case 218 /* NonNullExpression */: - case 200 /* ParenthesizedExpression */: + case 219 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: var propName = getAccessedPropertyName(node); if (propName !== undefined) { var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); @@ -51777,24 +51988,24 @@ var ts; } function isMatchingReference(source, target) { switch (target.kind) { - case 200 /* ParenthesizedExpression */: - case 218 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: + case 219 /* NonNullExpression */: return isMatchingReference(source, target.expression); } switch (source.kind) { case 75 /* Identifier */: return target.kind === 75 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 242 /* VariableDeclaration */ || target.kind === 191 /* BindingElement */) && + (target.kind === 243 /* VariableDeclaration */ || target.kind === 192 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 104 /* ThisKeyword */: return target.kind === 104 /* ThisKeyword */; case 102 /* SuperKeyword */: return target.kind === 102 /* SuperKeyword */; - case 218 /* NonNullExpression */: - case 200 /* ParenthesizedExpression */: + case 219 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: return isMatchingReference(source.expression, target); - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return ts.isAccessExpression(target) && getAccessedPropertyName(source) === getAccessedPropertyName(target) && isMatchingReference(source.expression, target.expression); @@ -51802,7 +52013,7 @@ var ts; return false; } function getAccessedPropertyName(access) { - return access.kind === 194 /* PropertyAccessExpression */ ? access.name.escapedText : + return access.kind === 195 /* PropertyAccessExpression */ ? access.name.escapedText : ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } @@ -51831,7 +52042,7 @@ var ts; if (prop.isDiscriminantProperty === undefined) { prop.isDiscriminantProperty = (prop.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && - !maybeTypeOfKind(getTypeOfSymbol(prop), 63176704 /* Instantiable */); + !maybeTypeOfKind(getTypeOfSymbol(prop), 197394432 /* Instantiable */); } return !!prop.isDiscriminantProperty; } @@ -51864,7 +52075,7 @@ var ts; } } } - if (callExpression.expression.kind === 194 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 195 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -51982,7 +52193,7 @@ var ts; if (flags & 67108864 /* NonPrimitive */) { return strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */; } - if (flags & 63176704 /* Instantiable */) { + if (flags & 197394432 /* Instantiable */) { return getTypeFacts(getBaseConstraintOfType(type) || unknownType); } if (flags & 3145728 /* UnionOrIntersection */) { @@ -52019,15 +52230,15 @@ var ts; return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 192 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 281 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 193 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 282 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 209 /* BinaryExpression */ && parent.parent.left === parent || - parent.parent.kind === 232 /* ForOfStatement */ && parent.parent.initializer === parent; + return parent.parent.kind === 210 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 233 /* ForOfStatement */ && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -52044,21 +52255,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return stringType; - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || errorType; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return undefinedType; - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return errorType; @@ -52066,7 +52277,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 189 /* ObjectBindingPattern */ ? + var type = pattern.kind === 190 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : @@ -52084,30 +52295,30 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 231 /* ForInStatement */) { + if (node.parent.parent.kind === 232 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 232 /* ForOfStatement */) { + if (node.parent.parent.kind === 233 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 242 /* VariableDeclaration */ ? + return node.kind === 243 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function isEmptyArrayAssignment(node) { - return node.kind === 242 /* VariableDeclaration */ && node.initializer && + return node.kind === 243 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 191 /* BindingElement */ && node.parent.kind === 209 /* BinaryExpression */ && + node.kind !== 192 /* BindingElement */ && node.parent.kind === 210 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: return getReferenceCandidate(node.left); @@ -52119,13 +52330,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 200 /* ParenthesizedExpression */ || - parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || - parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? + return parent.kind === 201 /* ParenthesizedExpression */ || + parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || + parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 277 /* CaseClause */) { + if (clause.kind === 278 /* CaseClause */) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -52141,20 +52352,19 @@ var ts; } return links.switchTypes; } - // Get the types from all cases in a switch on `typeof`. An - // `undefined` element denotes an explicit `default` clause. - function getSwitchClauseTypeOfWitnesses(switchStatement) { + function getSwitchClauseTypeOfWitnesses(switchStatement, retainDefault) { var witnesses = []; for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) { var clause = _a[_i]; - if (clause.kind === 277 /* CaseClause */) { + if (clause.kind === 278 /* CaseClause */) { if (ts.isStringLiteralLike(clause.expression)) { witnesses.push(clause.expression.text); continue; } return ts.emptyArray; } - witnesses.push(/*explicitDefaultStatement*/ undefined); + if (retainDefault) + witnesses.push(/*explicitDefaultStatement*/ undefined); } return witnesses; } @@ -52308,12 +52518,12 @@ var ts; var root = getReferenceRoot(node); var parent = root.parent; var isLengthPushOrUnshift = ts.isPropertyAccessExpression(parent) && (parent.name.escapedText === "length" || - parent.parent.kind === 196 /* CallExpression */ + parent.parent.kind === 197 /* CallExpression */ && ts.isIdentifier(parent.name) && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 195 /* ElementAccessExpression */ && + var isElementAssignment = parent.kind === 196 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 209 /* BinaryExpression */ && + parent.parent.kind === 210 /* BinaryExpression */ && parent.parent.operatorToken.kind === 62 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -52321,8 +52531,8 @@ var ts; return isLengthPushOrUnshift || isElementAssignment; } function isDeclarationWithExplicitTypeAnnotation(declaration) { - return !!(declaration && (declaration.kind === 242 /* VariableDeclaration */ || declaration.kind === 156 /* Parameter */ || - declaration.kind === 159 /* PropertyDeclaration */ || declaration.kind === 158 /* PropertySignature */) && + return !!(declaration && (declaration.kind === 243 /* VariableDeclaration */ || declaration.kind === 157 /* Parameter */ || + declaration.kind === 160 /* PropertyDeclaration */ || declaration.kind === 159 /* PropertySignature */) && ts.getEffectiveTypeAnnotationNode(declaration)); } function getExplicitTypeOfSymbol(symbol, diagnostic) { @@ -52352,11 +52562,11 @@ var ts; return getExplicitThisType(node); case 102 /* SuperKeyword */: return checkSuperExpression(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: var type = getTypeOfDottedName(node.expression, diagnostic); var prop = type && getPropertyOfType(type, node.name.escapedText); return prop && getExplicitTypeOfSymbol(prop, diagnostic); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return getTypeOfDottedName(node.expression, diagnostic); } } @@ -52370,7 +52580,7 @@ var ts; // circularities in control flow analysis, we use getTypeOfDottedName when resolving the call // target expression of an assertion. var funcType = void 0; - if (node.parent.kind === 226 /* ExpressionStatement */) { + if (node.parent.kind === 227 /* ExpressionStatement */) { funcType = getTypeOfDottedName(node.expression, /*diagnostic*/ undefined); } else if (node.expression.kind !== 102 /* SuperKeyword */) { @@ -52414,7 +52624,7 @@ var ts; } function isFalseExpression(expr) { var node = ts.skipParentheses(expr); - return node.kind === 91 /* FalseKeyword */ || node.kind === 209 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || + return node.kind === 91 /* FalseKeyword */ || node.kind === 210 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right)); } function isReachableFlowNodeWorker(flow, noCacheCheck) { @@ -52489,7 +52699,7 @@ var ts; if (flowAnalysisDisabled) { return errorType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 133970943 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 268188671 /* Narrowable */)) { return declaredType; } flowInvocationCount++; @@ -52501,7 +52711,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); - if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 218 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 219 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { return declaredType; } return resultType; @@ -52582,8 +52792,8 @@ var ts; // Check if we should continue with the control flow of the containing function. var container = flow.node; if (container && container !== flowContainer && - reference.kind !== 194 /* PropertyAccessExpression */ && - reference.kind !== 195 /* ElementAccessExpression */ && + reference.kind !== 195 /* PropertyAccessExpression */ && + reference.kind !== 196 /* ElementAccessExpression */ && reference.kind !== 104 /* ThisKeyword */) { flow = container.flowNode; continue; @@ -52608,7 +52818,7 @@ var ts; } function getInitialOrAssignedType(flow) { var node = flow.node; - return getConstraintForLocation(node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */ ? + return getConstraintForLocation(node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference); } @@ -52648,14 +52858,14 @@ var ts; // in which case we continue control flow analysis back to the function's declaration if (ts.isVariableDeclaration(node) && (ts.isInJSFile(node) || ts.isVarConst(node))) { var init = ts.getDeclaredExpandoInitializer(node); - if (init && (init.kind === 201 /* FunctionExpression */ || init.kind === 202 /* ArrowFunction */)) { + if (init && (init.kind === 202 /* FunctionExpression */ || init.kind === 203 /* ArrowFunction */)) { return getTypeAtFlowNode(flow.antecedent); } } return declaredType; } // for (const _ in ref) acts as a nonnull on ref - if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 231 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { + if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 232 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))); } // Assignment doesn't affect reference @@ -52666,7 +52876,7 @@ var ts; if (node.kind === 91 /* FalseKeyword */) { return unreachableNeverType; } - if (node.kind === 209 /* BinaryExpression */) { + if (node.kind === 210 /* BinaryExpression */) { if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) { return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); } @@ -52697,7 +52907,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 196 /* CallExpression */ ? + var expr = node.kind === 197 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -52705,7 +52915,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 196 /* CallExpression */) { + if (node.kind === 197 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -52755,7 +52965,7 @@ var ts; if (isMatchingReference(reference, expr)) { type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } - else if (expr.kind === 204 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { + else if (expr.kind === 205 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } else { @@ -52763,7 +52973,7 @@ var ts; if (optionalChainContainsReference(expr, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & (32768 /* Undefined */ | 131072 /* Never */)); }); } - else if (expr.kind === 204 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { + else if (expr.kind === 205 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined"); }); } } @@ -52975,12 +53185,18 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 204 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { + if (left_1.kind === 205 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 204 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { + if (right_1.kind === 205 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } + if (ts.isConstructorAccessExpression(left_1)) { + return narrowTypeByConstructor(type, left_1, operator_1, right_1, assumeTrue); + } + if (ts.isConstructorAccessExpression(right_1)) { + return narrowTypeByConstructor(type, right_1, operator_1, left_1, assumeTrue); + } if (isMatchingReference(reference, left_1)) { return narrowTypeByEquality(type, operator_1, right_1, assumeTrue); } @@ -53112,7 +53328,7 @@ var ts; if (isTypeSubtypeOf(targetType, type)) { return targetType; } - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(targetType, constraint)) { return getIntersectionType([type, targetType]); @@ -53182,7 +53398,7 @@ var ts; if (isTypeSubtypeOf(candidate, type)) { return candidate; } - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(candidate, constraint)) { return getIntersectionType([type, candidate]); @@ -53192,7 +53408,7 @@ var ts; }; } function narrowBySwitchOnTypeOf(type, switchStatement, clauseStart, clauseEnd) { - var switchWitnesses = getSwitchClauseTypeOfWitnesses(switchStatement); + var switchWitnesses = getSwitchClauseTypeOfWitnesses(switchStatement, /*retainDefault*/ true); if (!switchWitnesses.length) { return type; } @@ -53255,6 +53471,50 @@ var ts; } return getTypeWithFacts(mapType(type, narrowTypeForTypeofSwitch(impliedType)), switchFacts); } + function narrowTypeByConstructor(type, constructorAccessExpr, operator, identifier, assumeTrue) { + // Do not narrow when checking inequality. + if (assumeTrue ? (operator !== 34 /* EqualsEqualsToken */ && operator !== 36 /* EqualsEqualsEqualsToken */) : (operator !== 35 /* ExclamationEqualsToken */ && operator !== 37 /* ExclamationEqualsEqualsToken */)) { + return type; + } + // In the case of `x.y`, a `x.constructor === T` type guard resets the narrowed type of `y` to its declared type. + if (!isMatchingReference(reference, constructorAccessExpr.expression)) { + return declaredType; + } + // Get the type of the constructor identifier expression, if it is not a function then do not narrow. + var identifierType = getTypeOfExpression(identifier); + if (!isFunctionType(identifierType) && !isConstructorType(identifierType)) { + return type; + } + // Get the prototype property of the type identifier so we can find out its type. + var prototypeProperty = getPropertyOfType(identifierType, "prototype"); + if (!prototypeProperty) { + return type; + } + // Get the type of the prototype, if it is undefined, or the global `Object` or `Function` types then do not narrow. + var prototypeType = getTypeOfSymbol(prototypeProperty); + var candidate = !isTypeAny(prototypeType) ? prototypeType : undefined; + if (!candidate || candidate === globalObjectType || candidate === globalFunctionType) { + return type; + } + // If the type that is being narrowed is `any` then just return the `candidate` type since every type is a subtype of `any`. + if (isTypeAny(type)) { + return candidate; + } + // Filter out types that are not considered to be "constructed by" the `candidate` type. + return filterType(type, function (t) { return isConstructedBy(t, candidate); }); + function isConstructedBy(source, target) { + // If either the source or target type are a class type then we need to check that they are the same exact type. + // This is because you may have a class `A` that defines some set of properties, and another class `B` + // that defines the same set of properties as class `A`, in that case they are structurally the same + // type, but when you do something like `instanceOfA.constructor === B` it will return false. + if (source.flags & 524288 /* Object */ && ts.getObjectFlags(source) & 1 /* Class */ || + target.flags & 524288 /* Object */ && ts.getObjectFlags(target) & 1 /* Class */) { + return source.symbol === target.symbol; + } + // For all other types just check that the `source` type is a subtype of the `target` type. + return isTypeSubtypeOf(source, target); + } + } function narrowTypeByInstanceof(type, expr, assumeTrue) { var left = getReferenceCandidate(expr.left); if (!isMatchingReference(reference, left)) { @@ -53349,16 +53609,16 @@ var ts; case 75 /* Identifier */: case 104 /* ThisKeyword */: case 102 /* SuperKeyword */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return narrowTypeByCallExpression(type, expr, assumeTrue); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: if (expr.operator === 53 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -53403,9 +53663,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 250 /* ModuleBlock */ || - node.kind === 290 /* SourceFile */ || - node.kind === 159 /* PropertyDeclaration */; + node.kind === 251 /* ModuleBlock */ || + node.kind === 291 /* SourceFile */ || + node.kind === 160 /* PropertyDeclaration */; }); } // Check if a parameter is assigned anywhere within its declaring function. @@ -53427,7 +53687,7 @@ var ts; if (node.kind === 75 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 156 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 157 /* Parameter */) { symbol.isAssigned = true; } } @@ -53443,7 +53703,7 @@ var ts; function removeOptionalityFromDeclaredType(declaredType, declaration) { if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 156 /* Parameter */ && + declaration.kind === 157 /* Parameter */ && declaration.initializer && getFalsyFlags(declaredType) & 32768 /* Undefined */ && !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768 /* Undefined */); @@ -53457,13 +53717,13 @@ var ts; } function isConstraintPosition(node) { var parent = node.parent; - return parent.kind === 194 /* PropertyAccessExpression */ || - parent.kind === 196 /* CallExpression */ && parent.expression === node || - parent.kind === 195 /* ElementAccessExpression */ && parent.expression === node || - parent.kind === 191 /* BindingElement */ && parent.name === node && !!parent.initializer; + return parent.kind === 195 /* PropertyAccessExpression */ || + parent.kind === 197 /* CallExpression */ && parent.expression === node || + parent.kind === 196 /* ElementAccessExpression */ && parent.expression === node || + parent.kind === 192 /* BindingElement */ && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { - return type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); + return type.flags & 193200128 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); } function getConstraintForLocation(type, node) { // When a node is the left hand expression of a property access, element access, or call expression, @@ -53502,7 +53762,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 202 /* ArrowFunction */) { + if (container.kind === 203 /* ArrowFunction */) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasModifier(container, 256 /* Async */)) { @@ -53523,7 +53783,7 @@ var ts; // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration.kind === 245 /* ClassDeclaration */ + if (declaration.kind === 246 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -53535,14 +53795,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 214 /* ClassExpression */) { + else if (declaration.kind === 215 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); - while (container.kind !== 290 /* SourceFile */) { + while (container.kind !== 291 /* SourceFile */) { if (container.parent === declaration) { - if (container.kind === 159 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { + if (container.kind === 160 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 33554432 /* ConstructorReferenceInClass */; } @@ -53591,7 +53851,7 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 156 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 157 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; @@ -53600,8 +53860,8 @@ var ts; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 201 /* FunctionExpression */ || - flowContainer.kind === 202 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 202 /* FunctionExpression */ || + flowContainer.kind === 203 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } @@ -53610,9 +53870,9 @@ var ts; // declaration container are the same). var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || - isInTypeQuery(node) || node.parent.kind === 263 /* ExportSpecifier */) || - node.parent.kind === 218 /* NonNullExpression */ || - declaration.kind === 242 /* VariableDeclaration */ && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 264 /* ExportSpecifier */) || + node.parent.kind === 219 /* NonNullExpression */ || + declaration.kind === 243 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 8388608 /* Ambient */; var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : @@ -53647,7 +53907,7 @@ var ts; if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || ts.isSourceFile(symbol.valueDeclaration) || - symbol.valueDeclaration.parent.kind === 280 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 281 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -53670,7 +53930,7 @@ var ts; // mark iteration statement as containing block-scoped binding captured in some function var capturesBlockScopeBindingInLoopBody = true; if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container) { var part = getPartOfForStatementContainingNode(node.parent, container); if (part) { @@ -53691,7 +53951,7 @@ var ts; // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */; } @@ -53710,7 +53970,7 @@ var ts; function isAssignedInBodyOfForStatement(node, container) { // skip parenthesized nodes var current = node; - while (current.parent.kind === 200 /* ParenthesizedExpression */) { + while (current.parent.kind === 201 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -53718,7 +53978,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 207 /* PrefixUnaryExpression */ || current.parent.kind === 208 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 208 /* PrefixUnaryExpression */ || current.parent.kind === 209 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; } @@ -53731,7 +53991,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 159 /* PropertyDeclaration */ || container.kind === 162 /* Constructor */) { + if (container.kind === 160 /* PropertyDeclaration */ || container.kind === 163 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -53799,37 +54059,37 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var capturedByArrowFunction = false; - if (container.kind === 162 /* Constructor */) { + if (container.kind === 163 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 202 /* ArrowFunction */) { + if (container.kind === 203 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); capturedByArrowFunction = true; } switch (container.kind) { - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 162 /* Constructor */: + case 163 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: if (ts.hasModifier(container, 32 /* Static */) && !(compilerOptions.target === 99 /* ESNext */ && compilerOptions.useDefineForClassFields)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -53869,7 +54129,9 @@ var ts; var classSymbol = checkExpression(className).symbol; if (classSymbol && classSymbol.members && (classSymbol.flags & 16 /* Function */)) { var classType = getDeclaredTypeOfSymbol(classSymbol).thisType; - return getFlowTypeOfReference(node, classType); + if (classType) { + return getFlowTypeOfReference(node, classType); + } } } // Check if it's a constructor definition, can be either a variable decl or function decl @@ -53877,7 +54139,7 @@ var ts; // * /** @constructor */ function [name]() { ... } // * /** @constructor */ var x = function() { ... } else if (isInJS && - (container.kind === 201 /* FunctionExpression */ || container.kind === 244 /* FunctionDeclaration */) && + (container.kind === 202 /* FunctionExpression */ || container.kind === 245 /* FunctionDeclaration */) && ts.getJSDocClassTag(container)) { var classType = getDeclaredTypeOfSymbol(getMergedSymbol(container.symbol)).thisType; return getFlowTypeOfReference(node, classType); @@ -53924,7 +54186,7 @@ var ts; } function getClassNameFromPrototypeMethod(container) { // Check if it's the RHS of a x.prototype.y = function [name]() { .... } - if (container.kind === 201 /* FunctionExpression */ && + if (container.kind === 202 /* FunctionExpression */ && ts.isBinaryExpression(container.parent) && ts.getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = container' @@ -53934,16 +54196,16 @@ var ts; .expression; // x } // x.prototype = { method() { } } - else if (container.kind === 161 /* MethodDeclaration */ && - container.parent.kind === 193 /* ObjectLiteralExpression */ && + else if (container.kind === 162 /* MethodDeclaration */ && + container.parent.kind === 194 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { return container.parent.parent.left.expression; } // x.prototype = { method: function() { } } - else if (container.kind === 201 /* FunctionExpression */ && - container.parent.kind === 281 /* PropertyAssignment */ && - container.parent.parent.kind === 193 /* ObjectLiteralExpression */ && + else if (container.kind === 202 /* FunctionExpression */ && + container.parent.kind === 282 /* PropertyAssignment */ && + container.parent.parent.kind === 194 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { return container.parent.parent.parent.left.expression; @@ -53951,7 +54213,7 @@ var ts; // Object.defineProperty(x, "method", { value: function() { } }); // Object.defineProperty(x, "method", { set: (x: () => void) => void }); // Object.defineProperty(x, "method", { get: () => function() { }) }); - else if (container.kind === 201 /* FunctionExpression */ && + else if (container.kind === 202 /* FunctionExpression */ && ts.isPropertyAssignment(container.parent) && ts.isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && @@ -53976,7 +54238,7 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 300 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 301 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -53990,15 +54252,15 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 156 /* Parameter */ && n.parent === constructorDecl; }); + return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 157 /* Parameter */ && n.parent === constructorDecl; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 196 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 197 /* CallExpression */ && node.parent.expression === node; var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 202 /* ArrowFunction */) { + while (container && container.kind === 203 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -54011,14 +54273,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 154 /* ComputedPropertyName */; }); - if (current && current.kind === 154 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 155 /* ComputedPropertyName */; }); + if (current && current.kind === 155 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 193 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 194 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -54026,7 +54288,7 @@ var ts; } return errorType; } - if (!isCallExpression && container.kind === 162 /* Constructor */) { + if (!isCallExpression && container.kind === 163 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasModifier(container, 32 /* Static */) || isCallExpression) { @@ -54095,7 +54357,7 @@ var ts; // as a call expression cannot be used as the target of a destructuring assignment while a property access can. // // For element access expressions (`super[x]`), we emit a generic helper that forwards the element access in both situations. - if (container.kind === 161 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { + if (container.kind === 162 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -54109,7 +54371,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 193 /* ObjectLiteralExpression */) { + if (container.parent.kind === 194 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return errorType; @@ -54130,7 +54392,7 @@ var ts; if (!baseClassType) { return errorType; } - if (container.kind === 162 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 163 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return errorType; @@ -54145,7 +54407,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 162 /* Constructor */; + return container.kind === 163 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -54153,21 +54415,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 193 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 194 /* ObjectLiteralExpression */) { if (ts.hasModifier(container, 32 /* Static */)) { - return container.kind === 161 /* MethodDeclaration */ || - container.kind === 160 /* MethodSignature */ || - container.kind === 163 /* GetAccessor */ || - container.kind === 164 /* SetAccessor */; + return container.kind === 162 /* MethodDeclaration */ || + container.kind === 161 /* MethodSignature */ || + container.kind === 164 /* GetAccessor */ || + container.kind === 165 /* SetAccessor */; } else { - return container.kind === 161 /* MethodDeclaration */ || - container.kind === 160 /* MethodSignature */ || - container.kind === 163 /* GetAccessor */ || - container.kind === 164 /* SetAccessor */ || - container.kind === 159 /* PropertyDeclaration */ || - container.kind === 158 /* PropertySignature */ || - container.kind === 162 /* Constructor */; + return container.kind === 162 /* MethodDeclaration */ || + container.kind === 161 /* MethodSignature */ || + container.kind === 164 /* GetAccessor */ || + container.kind === 165 /* SetAccessor */ || + container.kind === 160 /* PropertyDeclaration */ || + container.kind === 159 /* PropertySignature */ || + container.kind === 163 /* Constructor */; } } } @@ -54175,10 +54437,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 161 /* MethodDeclaration */ || - func.kind === 163 /* GetAccessor */ || - func.kind === 164 /* SetAccessor */) && func.parent.kind === 193 /* ObjectLiteralExpression */ ? func.parent : - func.kind === 201 /* FunctionExpression */ && func.parent.kind === 281 /* PropertyAssignment */ ? func.parent.parent : + return (func.kind === 162 /* MethodDeclaration */ || + func.kind === 164 /* GetAccessor */ || + func.kind === 165 /* SetAccessor */) && func.parent.kind === 194 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 202 /* FunctionExpression */ && func.parent.kind === 282 /* PropertyAssignment */ ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -54190,7 +54452,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 202 /* ArrowFunction */) { + if (func.kind === 203 /* ArrowFunction */) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -54217,7 +54479,7 @@ var ts; if (thisType) { return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); } - if (literal.parent.kind !== 281 /* PropertyAssignment */) { + if (literal.parent.kind !== 282 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -54231,7 +54493,7 @@ var ts; // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. var parent = ts.walkUpParenthesizedExpressions(func.parent); - if (parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { + if (parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { var target = parent.left; if (ts.isAccessExpression(target)) { var expression = target.expression; @@ -54284,9 +54546,9 @@ var ts; return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 156 /* Parameter */: + case 157 /* Parameter */: return getContextuallyTypedParameterType(declaration); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return getContextualTypeForBindingElement(declaration); // By default, do nothing and return undefined - only parameters and binding elements have context implied by a parent } @@ -54295,7 +54557,7 @@ var ts; var parent = declaration.parent.parent; var name = declaration.propertyName || declaration.name; var parentType = getContextualTypeForVariableLikeDeclaration(parent) || - parent.kind !== 191 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); + parent.kind !== 192 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); if (parentType && !ts.isBindingPattern(name) && !isComputedNonLiteralName(name)) { var nameType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(nameType)) { @@ -54336,6 +54598,9 @@ var ts; if (contextualReturnType) { if (functionFlags & 2 /* Async */) { // Async function var contextualAwaitedType = getAwaitedTypeOfPromise(contextualReturnType); + if (contextualAwaitedType && contextualAwaitedType.flags & 134217728 /* Awaited */) { + contextualAwaitedType = contextualAwaitedType.awaitedType; + } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return contextualReturnType; // Regular function @@ -54347,6 +54612,9 @@ var ts; var contextualType = getContextualType(node); if (contextualType) { var contextualAwaitedType = getAwaitedType(contextualType); + if (contextualAwaitedType && contextualAwaitedType.flags & 134217728 /* Awaited */) { + contextualAwaitedType = contextualAwaitedType.awaitedType; + } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return undefined; @@ -54417,7 +54685,7 @@ var ts; return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 198 /* TaggedTemplateExpression */) { + if (template.parent.kind === 199 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -54653,21 +54921,21 @@ var ts; case 91 /* FalseKeyword */: case 100 /* NullKeyword */: case 75 /* Identifier */: - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: return true; - case 194 /* PropertyAccessExpression */: - case 200 /* ParenthesizedExpression */: + case 195 /* PropertyAccessExpression */: + case 201 /* ParenthesizedExpression */: return isPossiblyDiscriminantValue(node.expression); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return !node.expression || isPossiblyDiscriminantValue(node.expression); } return false; } function discriminateContextualTypeByObjectMembers(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 281 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 282 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } function discriminateContextualTypeByJSXAttributes(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 273 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 274 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. @@ -54692,7 +54960,7 @@ var ts; // If the given contextual type contains instantiable types and if a mapper representing // return type inferences is available, instantiate those types using that mapper. function instantiateContextualType(contextualType, node, contextFlags) { - if (contextualType && maybeTypeOfKind(contextualType, 63176704 /* Instantiable */)) { + if (contextualType && maybeTypeOfKind(contextualType, 197394432 /* Instantiable */)) { var inferenceContext = getInferenceContext(node); // If no inferences have been made, nothing is gained from instantiating as type parameters // would just be replaced with their defaults similar to the apparent type. @@ -54715,7 +54983,7 @@ var ts; // are classified as instantiable (i.e. it doesn't instantiate object types), and (b) it performs // no reductions on instantiated union types. function instantiateInstantiableTypes(type, mapper) { - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { return instantiateType(type, mapper); } if (type.flags & 1048576 /* Union */) { @@ -54753,58 +55021,58 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 191 /* BindingElement */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 192 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 202 /* ArrowFunction */: - case 235 /* ReturnStatement */: + case 203 /* ArrowFunction */: + case 236 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return getContextualTypeForAwaitOperand(parent); - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (parent.expression.kind === 96 /* ImportKeyword */) { return stringType; } /* falls through */ - case 197 /* NewExpression */: + case 198 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: return ts.isConstTypeReference(parent.type) ? undefined : getTypeFromTypeNode(parent.type); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node, contextFlags); - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent, contextFlags); - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: return getApparentTypeOfContextualType(parent.parent, contextFlags); - case 192 /* ArrayLiteralExpression */: { + case 193 /* ArrayLiteralExpression */: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); - case 221 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 211 /* TemplateExpression */); + case 222 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 212 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 200 /* ParenthesizedExpression */: { + case 201 /* ParenthesizedExpression */: { // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast. var tag = ts.isInJSFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent, contextFlags); } - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return getContextualTypeForJsxExpression(parent); - case 273 /* JsxAttribute */: - case 275 /* JsxSpreadAttribute */: + case 274 /* JsxAttribute */: + case 276 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: return getContextualJsxElementAttributesType(parent, contextFlags); } return undefined; @@ -54961,7 +55229,7 @@ var ts; return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 201 /* FunctionExpression */ || node.kind === 202 /* ArrowFunction */; + return node.kind === 202 /* FunctionExpression */ || node.kind === 203 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -54975,7 +55243,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; @@ -55020,8 +55288,8 @@ var ts; return checkIteratedTypeOrElementType(33 /* Spread */, arrayOrIterableType, undefinedType, node.expression); } function hasDefaultValue(node) { - return (node.kind === 191 /* BindingElement */ && !!node.initializer) || - (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); + return (node.kind === 192 /* BindingElement */ && !!node.initializer) || + (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); } function checkArrayLiteral(node, checkMode, forceTuple) { var elements = node.elements; @@ -55034,7 +55302,7 @@ var ts; var inConstContext = isConstContext(node); for (var i = 0; i < elementCount; i++) { var e = elements[i]; - var spread = e.kind === 213 /* SpreadElement */ && e.expression; + var spread = e.kind === 214 /* SpreadElement */ && e.expression; var spreadType = spread && checkExpression(spread, checkMode, forceTuple); if (spreadType && isTupleType(spreadType)) { elementTypes.push.apply(elementTypes, getTypeArguments(spreadType)); @@ -55120,7 +55388,7 @@ var ts; } function isNumericName(name) { switch (name.kind) { - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return isNumericComputedName(name); case 75 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -55206,11 +55474,12 @@ var ts; // Grammar checking checkGrammarObjectLiteralExpression(node, inDestructuringPattern); var propertiesTable; + var allPropertiesTable = ts.createSymbolTable(); var propertiesArray = []; var spread = emptyObjectType; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 189 /* ObjectBindingPattern */ || contextualType.pattern.kind === 193 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 190 /* ObjectBindingPattern */ || contextualType.pattern.kind === 194 /* ObjectLiteralExpression */); var inConstContext = isConstContext(node); var checkFlags = inConstContext ? 8 /* Readonly */ : 0; var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node); @@ -55225,13 +55494,13 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = getSymbolOfNode(memberDecl); - var computedNameType = memberDecl.name && memberDecl.name.kind === 154 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? + var computedNameType = memberDecl.name && memberDecl.name.kind === 155 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? checkComputedPropertyName(memberDecl.name) : undefined; - if (memberDecl.kind === 281 /* PropertyAssignment */ || - memberDecl.kind === 282 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 282 /* PropertyAssignment */ || + memberDecl.kind === 283 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { - var type = memberDecl.kind === 281 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : - memberDecl.kind === 282 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : + var type = memberDecl.kind === 282 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : + memberDecl.kind === 283 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode); if (isInJavascript) { var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -55254,8 +55523,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 281 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 282 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 282 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 283 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -55279,8 +55548,9 @@ var ts; prop.type = type; prop.target = member; member = prop; + allPropertiesTable.set(prop.escapedName, prop); } - else if (memberDecl.kind === 283 /* SpreadAssignment */) { + else if (memberDecl.kind === 284 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } @@ -55296,6 +55566,16 @@ var ts; error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); return errorType; } + for (var _i = 0, _a = getPropertiesOfType(type); _i < _a.length; _i++) { + var right = _a[_i]; + var rightType = getTypeOfSymbol(right); + var left = allPropertiesTable.get(right.escapedName); + if (strictNullChecks && + left && + !maybeTypeOfKind(rightType, 98304 /* Nullable */)) { + error(left.valueDeclaration, ts.Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, ts.unescapeLeadingUnderscores(left.escapedName)); + } + } spread = getSpreadType(spread, type, node.symbol, objectFlags, inConstContext); offset = i + 1; continue; @@ -55306,7 +55586,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 163 /* GetAccessor */ || memberDecl.kind === 164 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 164 /* GetAccessor */ || memberDecl.kind === 165 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) { @@ -55331,9 +55611,9 @@ var ts; // type with those properties for which the binding pattern specifies a default value. // If the object literal is spread into another object literal, skip this step and let the top-level object // literal handle it instead. - if (contextualTypeHasPattern && node.parent.kind !== 283 /* SpreadAssignment */) { - for (var _i = 0, _a = getPropertiesOfType(contextualType); _i < _a.length; _i++) { - var prop = _a[_i]; + if (contextualTypeHasPattern && node.parent.kind !== 284 /* SpreadAssignment */) { + for (var _b = 0, _c = getPropertiesOfType(contextualType); _b < _c.length; _b++) { + var prop = _c[_b]; if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) { if (!(prop.flags & 16777216 /* Optional */)) { error(prop.valueDeclaration || prop.bindingElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); @@ -55373,13 +55653,13 @@ var ts; } } function isValidSpreadType(type) { - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { var constraint = getBaseConstraintOfType(type); if (constraint !== undefined) { return isValidSpreadType(constraint); } } - return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */) || + return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 193200128 /* InstantiableNonPrimitive */) || getFalsyFlags(type) & 117632 /* DefinitelyFalsy */ && isValidSpreadType(removeDefinitelyFalsyTypes(type)) || type.flags & 3145728 /* UnionOrIntersection */ && ts.every(type.types, isValidSpreadType)); } @@ -55473,7 +55753,7 @@ var ts; } } else { - ts.Debug.assert(attributeDecl.kind === 275 /* JsxSpreadAttribute */); + ts.Debug.assert(attributeDecl.kind === 276 /* JsxSpreadAttribute */); if (attributesTable.size > 0) { spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, /*readonly*/ false); attributesTable = ts.createSymbolTable(); @@ -55496,7 +55776,7 @@ var ts; } } // Handle children attribute - var parent = openingLikeElement.parent.kind === 266 /* JsxElement */ ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 267 /* JsxElement */ ? openingLikeElement.parent : undefined; // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); @@ -55916,7 +56196,7 @@ var ts; */ function checkPropertyAccessibility(node, isSuper, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 153 /* QualifiedName */ ? node.right : node.kind === 188 /* ImportType */ ? node : node.name; + var errorNode = node.kind === 154 /* QualifiedName */ ? node.right : node.kind === 189 /* ImportType */ ? node : node.name; if (ts.getCheckFlags(prop) & 1024 /* ContainsPrivate */) { // Synthetic property with private constituent property error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type)); @@ -56075,7 +56355,7 @@ var ts; return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right); } function isMethodAccessForCall(node) { - while (node.parent.kind === 200 /* ParenthesizedExpression */) { + while (node.parent.kind === 201 /* ParenthesizedExpression */) { node = node.parent; } return ts.isCallOrNewExpression(node.parent) && node.parent.expression === node; @@ -56228,7 +56508,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 162 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { + if (flowContainer.kind === 163 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { assumeUninitialized = true; } } @@ -56260,8 +56540,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName); } - else if (valueDeclaration.kind === 245 /* ClassDeclaration */ && - node.parent.kind !== 169 /* TypeReference */ && + else if (valueDeclaration.kind === 246 /* ClassDeclaration */ && + node.parent.kind !== 170 /* TypeReference */ && !(valueDeclaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName); @@ -56273,22 +56553,22 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return true; - case 281 /* PropertyAssignment */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 283 /* SpreadAssignment */: - case 154 /* ComputedPropertyName */: - case 221 /* TemplateSpan */: - case 276 /* JsxExpression */: - case 273 /* JsxAttribute */: - case 274 /* JsxAttributes */: - case 275 /* JsxSpreadAttribute */: - case 268 /* JsxOpeningElement */: - case 216 /* ExpressionWithTypeArguments */: - case 279 /* HeritageClause */: + case 282 /* PropertyAssignment */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 284 /* SpreadAssignment */: + case 155 /* ComputedPropertyName */: + case 222 /* TemplateSpan */: + case 277 /* JsxExpression */: + case 274 /* JsxAttribute */: + case 275 /* JsxAttributes */: + case 276 /* JsxSpreadAttribute */: + case 269 /* JsxOpeningElement */: + case 217 /* ExpressionWithTypeArguments */: + case 280 /* HeritageClause */: return false; default: return ts.isExpressionNode(node) ? false : "quit"; @@ -56438,7 +56718,19 @@ var ts; return ts.getSpellingSuggestion(name, symbols, getCandidateName); function getCandidateName(candidate) { var candidateName = ts.symbolName(candidate); - return !ts.startsWith(candidateName, "\"") && candidate.flags & meaning ? candidateName : undefined; + if (ts.startsWith(candidateName, "\"")) { + return undefined; + } + if (candidate.flags & meaning) { + return candidateName; + } + if (candidate.flags & 2097152 /* Alias */) { + var alias = tryResolveAlias(candidate); + if (alias && alias.flags & meaning) { + return candidateName; + } + } + return undefined; } } function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isThisAccess) { @@ -56451,7 +56743,7 @@ var ts; if (!hasPrivateModifier && !hasPrivateIdentifier) { return; } - if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */))) { + if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */)) { return; } if (isThisAccess) { @@ -56465,16 +56757,16 @@ var ts; } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return isValidPropertyAccessWithType(node, node.expression.kind === 102 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression))); - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getWidenedType(checkExpression(node.left))); - case 188 /* ImportType */: + case 189 /* ImportType */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getTypeFromTypeNode(node)); } } function isValidPropertyAccessForCompletions(node, type, property) { - return isValidPropertyAccessWithType(node, node.kind === 194 /* PropertyAccessExpression */ && node.expression.kind === 102 /* SuperKeyword */, property.escapedName, type); + return isValidPropertyAccessWithType(node, node.kind === 195 /* PropertyAccessExpression */ && node.expression.kind === 102 /* SuperKeyword */, property.escapedName, type); // Previously we validated the 'this' type of methods but this adversely affected performance. See #31377 for more context. } function isValidPropertyAccessWithType(node, isSuper, propertyName, type) { @@ -56497,7 +56789,7 @@ var ts; */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 243 /* VariableDeclarationList */) { + if (initializer.kind === 244 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -56526,7 +56818,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 231 /* ForInStatement */ && + if (node.kind === 232 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -56610,13 +56902,13 @@ var ts; // This gets us diagnostics for the type arguments and marks them as referenced. ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 198 /* TaggedTemplateExpression */) { + if (node.kind === 199 /* TaggedTemplateExpression */) { checkExpression(node.template); } else if (ts.isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); } - else if (node.kind !== 157 /* Decorator */) { + else if (node.kind !== 158 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -56680,7 +56972,7 @@ var ts; } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 213 /* SpreadElement */ || arg.kind === 220 /* SyntheticExpression */ && arg.isSpread); + return !!arg && (arg.kind === 214 /* SpreadElement */ || arg.kind === 221 /* SyntheticExpression */ && arg.isSpread); } function getSpreadArgumentIndex(args) { return ts.findIndex(args, isSpreadArgument); @@ -56694,9 +56986,9 @@ var ts; var callIsIncomplete = false; // In incomplete call we want to be lenient when we have too few arguments var effectiveParameterCount = getParameterCount(signature); var effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 198 /* TaggedTemplateExpression */) { + if (node.kind === 199 /* TaggedTemplateExpression */) { argCount = args.length; - if (node.template.kind === 211 /* TemplateExpression */) { + if (node.template.kind === 212 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. var lastSpan = ts.last(node.template.templateSpans); // we should always have at least one span. @@ -56711,7 +57003,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 157 /* Decorator */) { + else if (node.kind === 158 /* Decorator */) { argCount = getDecoratorArgumentCount(node, signature); } else if (ts.isJsxOpeningLikeElement(node)) { @@ -56726,7 +57018,7 @@ var ts; else { if (!node.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(node.kind === 197 /* NewExpression */); + ts.Debug.assert(node.kind === 198 /* NewExpression */); return getMinArgumentCount(signature) === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; @@ -56819,7 +57111,7 @@ var ts; // example, given a 'function wrap(cb: (x: T) => U): (x: T) => U' and a call expression // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the // return type of 'wrap'. - if (node.kind !== 157 /* Decorator */) { + if (node.kind !== 158 /* Decorator */) { var contextualType = getContextualType(node); if (contextualType) { // We clone the inference context to avoid disturbing a resolution in progress for an @@ -56862,7 +57154,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 215 /* OmittedExpression */) { + if (arg.kind !== 216 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); inferTypes(context.inferences, argType, paramType); @@ -56876,7 +57168,7 @@ var ts; } function getArrayifiedType(type) { return type.flags & 1048576 /* Union */ ? mapType(type, getArrayifiedType) : - type.flags & (1 /* Any */ | 63176704 /* Instantiable */) || isMutableArrayOrTuple(type) ? type : + type.flags & (1 /* Any */ | 197394432 /* Instantiable */) || isMutableArrayOrTuple(type) ? type : isTupleType(type) ? createTupleType(getTypeArguments(type), type.target.minLength, type.target.hasRestElement, /*readonly*/ false, type.target.associatedNames) : createArrayType(getIndexedAccessType(type, numberType)); } @@ -56886,7 +57178,7 @@ var ts; if (isSpreadArgument(arg)) { // We are inferring from a spread expression in the last argument position, i.e. both the parameter // and the argument are ...x forms. - return arg.kind === 220 /* SyntheticExpression */ ? + return arg.kind === 221 /* SyntheticExpression */ ? createArrayType(arg.type) : getArrayifiedType(checkExpressionWithContextualType(arg.expression, restType, context, 0 /* Normal */)); } @@ -57041,7 +57333,7 @@ var ts; return undefined; } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 197 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 198 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -57071,7 +57363,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 215 /* OmittedExpression */) { + if (arg.kind !== 216 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, /*inferenceContext*/ undefined, checkMode); // If one or more arguments are still excluded (as indicated by CheckMode.SkipContextSensitive), @@ -57112,7 +57404,7 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 196 /* CallExpression */) { + if (node.kind === 197 /* CallExpression */) { var callee = ts.skipOuterExpressions(node.expression); if (ts.isAccessExpression(callee)) { return callee.expression; @@ -57120,7 +57412,7 @@ var ts; } } function createSyntheticExpression(parent, type, isSpread) { - var result = ts.createNode(220 /* SyntheticExpression */, parent.pos, parent.end); + var result = ts.createNode(221 /* SyntheticExpression */, parent.pos, parent.end); result.parent = parent; result.type = type; result.isSpread = isSpread || false; @@ -57130,17 +57422,17 @@ var ts; * Returns the effective arguments for an expression that works like a function invocation. */ function getEffectiveCallArguments(node) { - if (node.kind === 198 /* TaggedTemplateExpression */) { + if (node.kind === 199 /* TaggedTemplateExpression */) { var template = node.template; var args_3 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 211 /* TemplateExpression */) { + if (template.kind === 212 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args_3.push(span.expression); }); } return args_3; } - if (node.kind === 157 /* Decorator */) { + if (node.kind === 158 /* Decorator */) { return getEffectiveDecoratorArguments(node); } if (ts.isJsxOpeningLikeElement(node)) { @@ -57170,30 +57462,30 @@ var ts; var parent = node.parent; var expr = node.expression; switch (parent.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class). return [ createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent))) ]; - case 156 /* Parameter */: + case 157 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts). var func = parent.parent; return [ - createSyntheticExpression(expr, parent.parent.kind === 162 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), + createSyntheticExpression(expr, parent.parent.kind === 163 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), createSyntheticExpression(expr, anyType), createSyntheticExpression(expr, numberType) ]; - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts). If we are emitting decorators // for ES3, we will only pass two arguments. - var hasPropDesc = parent.kind !== 159 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; + var hasPropDesc = parent.kind !== 160 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; return [ createSyntheticExpression(expr, getParentTypeOfClassElement(parent)), createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)), @@ -57207,17 +57499,17 @@ var ts; */ function getDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return 1; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return 2; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // For ES3 or decorators with only two parameters we supply only two arguments return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3; - case 156 /* Parameter */: + case 157 /* Parameter */: return 3; default: return ts.Debug.fail(); @@ -57342,8 +57634,8 @@ var ts; return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { - var isTaggedTemplate = node.kind === 198 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 157 /* Decorator */; + var isTaggedTemplate = node.kind === 199 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 158 /* Decorator */; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var reportErrors = !candidatesOutArray; var typeArguments; @@ -57405,7 +57697,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 196 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 197 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -57921,7 +58213,7 @@ var ts; var declaration = signature.declaration; var modifiers = ts.getSelectedModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */); // (1) Public constructors and (2) constructor functions are always accessible. - if (!modifiers || declaration.kind !== 162 /* Constructor */) { + if (!modifiers || declaration.kind !== 163 /* Constructor */) { return true; } var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -58052,16 +58344,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 156 /* Parameter */: + case 157 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return ts.Debug.fail(); @@ -58152,16 +58444,16 @@ var ts; } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 196 /* CallExpression */: + case 197 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray, checkMode); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray, checkMode); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 157 /* Decorator */: + case 158 /* Decorator */: return resolveDecorator(node, candidatesOutArray, checkMode); - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); } throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -58250,7 +58542,7 @@ var ts; return false; } var parent = node.parent; - while (parent && parent.kind === 194 /* PropertyAccessExpression */) { + while (parent && parent.kind === 195 /* PropertyAccessExpression */) { parent = parent.parent; } if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -58275,12 +58567,12 @@ var ts; if (node.expression.kind === 102 /* SuperKeyword */) { return voidType; } - if (node.kind === 197 /* NewExpression */) { + if (node.kind === 198 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 162 /* Constructor */ && - declaration.kind !== 166 /* ConstructSignature */ && - declaration.kind !== 171 /* ConstructorType */ && + declaration.kind !== 163 /* Constructor */ && + declaration.kind !== 167 /* ConstructSignature */ && + declaration.kind !== 172 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any @@ -58300,7 +58592,7 @@ var ts; if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) { return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent)); } - if (node.kind === 196 /* CallExpression */ && node.parent.kind === 226 /* ExpressionStatement */ && + if (node.kind === 197 /* CallExpression */ && node.parent.kind === 227 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { if (!ts.isDottedName(node.expression)) { error(node.expression, ts.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); @@ -58407,9 +58699,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 244 /* FunctionDeclaration */ + ? 245 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 242 /* VariableDeclaration */ + ? 243 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -58437,18 +58729,18 @@ var ts; case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return true; - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isValidConstAssertionArgument(node.expression); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: var op = node.operator; var arg = node.operand; return op === 40 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) || op === 39 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */; - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: var expr = node.expression; if (ts.isIdentifier(expr)) { var symbol = getSymbolAtLocation(expr); @@ -58498,7 +58790,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return errorType; } - else if (container.kind === 162 /* Constructor */) { + else if (container.kind === 163 /* Constructor */) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -58591,7 +58883,7 @@ var ts; } return length; } - function getMinArgumentCount(signature) { + function getMinArgumentCount(signature, strongArityForUntypedJS) { if (signatureHasRestParameter(signature)) { var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); if (isTupleType(restType)) { @@ -58601,6 +58893,9 @@ var ts; } } } + if (!strongArityForUntypedJS && signature.flags & 16 /* IsUntypedSignatureInJSFile */) { + return 0; + } return signature.minArgumentCount; } function hasEffectiveRestParameter(signature) { @@ -58762,7 +59057,7 @@ var ts; var yieldType; var nextType; var fallbackReturnType = voidType; - if (func.body.kind !== 223 /* Block */) { // Async or normal arrow function + if (func.body.kind !== 224 /* Block */) { // Async or normal arrow function returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */); if (isAsync) { // From within an async function you can return either a non-promise value or a promise. Any @@ -58949,10 +59244,9 @@ var ts; return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node)); } function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 204 /* TypeOfExpression */) { + if (node.expression.kind === 205 /* TypeOfExpression */) { var operandType = getTypeOfExpression(node.expression.expression); - // This cast is safe because the switch is possibly exhaustive and does not contain a default case, so there can be no undefined. - var witnesses = getSwitchClauseTypeOfWitnesses(node); + var witnesses = getSwitchClauseTypeOfWitnesses(node, /*retainDefault*/ false); // notEqualFacts states that the type of the switched value is not equal to every type in the switch. var notEqualFacts_1 = getFactsFromTypeofSwitch(0, 0, witnesses, /*hasDefault*/ true); var type_3 = getBaseConstraintOfType(operandType) || operandType; @@ -59009,11 +59303,11 @@ var ts; } function mayReturnNever(func) { switch (func.kind) { - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return true; - case 161 /* MethodDeclaration */: - return func.parent.kind === 193 /* ObjectLiteralExpression */; + case 162 /* MethodDeclaration */: + return func.parent.kind === 194 /* ObjectLiteralExpression */; default: return false; } @@ -59039,7 +59333,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (func.kind === 160 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 223 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 161 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 224 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */; @@ -59072,7 +59366,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); checkNodeDeferred(node); // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode && checkMode & 4 /* SkipContextSensitive */ && isContextSensitive(node)) { @@ -59096,7 +59390,7 @@ var ts; } // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 201 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 202 /* FunctionExpression */) { checkGrammarForGenerator(node); } contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -59149,7 +59443,7 @@ var ts; type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnType = getReturnTypeFromAnnotation(node); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); @@ -59162,7 +59456,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 223 /* Block */) { + if (node.body.kind === 224 /* Block */) { checkSourceElement(node.body); } else { @@ -59252,7 +59546,7 @@ var ts; expr.expression.kind === 104 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var ctor = ts.getContainingFunction(expr); - if (!(ctor && ctor.kind === 162 /* Constructor */)) { + if (!(ctor && ctor.kind === 163 /* Constructor */)) { return true; } if (symbol.valueDeclaration) { @@ -59277,7 +59571,7 @@ var ts; var symbol_2 = getNodeLinks(node).resolvedSymbol; if (symbol_2.flags & 2097152 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol_2); - return !!declaration && declaration.kind === 256 /* NamespaceImport */; + return !!declaration && declaration.kind === 257 /* NamespaceImport */; } } } @@ -59303,7 +59597,7 @@ var ts; error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); return booleanType; } - if (expr.kind === 194 /* PropertyAccessExpression */ && ts.isPrivateIdentifier(expr.name)) { + if (expr.kind === 195 /* PropertyAccessExpression */ && ts.isPrivateIdentifier(expr.name)) { error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier); } var links = getNodeLinks(expr); @@ -59353,7 +59647,7 @@ var ts; var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos); var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); var func = ts.getContainingFunction(node); - if (func && func.kind !== 162 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { + if (func && func.kind !== 163 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); } @@ -59525,7 +59819,7 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 296 /* NumberLike */ | 12288 /* ESSymbolLike */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { + if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 193200128 /* InstantiableNonPrimitive */)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -59545,7 +59839,7 @@ var ts; if (rightIsThis === void 0) { rightIsThis = false; } var properties = node.properties; var property = properties[propertyIndex]; - if (property.kind === 281 /* PropertyAssignment */ || property.kind === 282 /* ShorthandPropertyAssignment */) { + if (property.kind === 282 /* PropertyAssignment */ || property.kind === 283 /* ShorthandPropertyAssignment */) { var name = property.name; var exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -59558,9 +59852,9 @@ var ts; } var elementType = getIndexedAccessType(objectLiteralType, exprType, name); var type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 282 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); + return checkDestructuringAssignment(property.kind === 283 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); } - else if (property.kind === 283 /* SpreadAssignment */) { + else if (property.kind === 284 /* SpreadAssignment */) { if (propertyIndex < properties.length - 1) { error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } @@ -59603,8 +59897,8 @@ var ts; function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 215 /* OmittedExpression */) { - if (element.kind !== 213 /* SpreadElement */) { + if (element.kind !== 216 /* OmittedExpression */) { + if (element.kind !== 214 /* SpreadElement */) { var indexType = getLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { // We create a synthetic expression so that getIndexedAccessType doesn't get confused @@ -59622,7 +59916,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 209 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { + if (restExpression.kind === 210 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -59638,7 +59932,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { var target; - if (exprOrAssignment.kind === 282 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 283 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -59654,24 +59948,24 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 209 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { + if (target.kind === 210 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 193 /* ObjectLiteralExpression */) { + if (target.kind === 194 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 192 /* ArrayLiteralExpression */) { + if (target.kind === 193 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 283 /* SpreadAssignment */ ? + var error = target.parent.kind === 284 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; - var optionalError = target.parent.kind === 283 /* SpreadAssignment */ ? + var optionalError = target.parent.kind === 284 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; if (checkReferenceExpression(target, error, optionalError)) { @@ -59696,36 +59990,36 @@ var ts; case 75 /* Identifier */: case 10 /* StringLiteral */: case 13 /* RegularExpressionLiteral */: - case 198 /* TaggedTemplateExpression */: - case 211 /* TemplateExpression */: + case 199 /* TaggedTemplateExpression */: + case 212 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: case 100 /* NullKeyword */: - case 146 /* UndefinedKeyword */: - case 201 /* FunctionExpression */: - case 214 /* ClassExpression */: - case 202 /* ArrowFunction */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: - case 204 /* TypeOfExpression */: - case 218 /* NonNullExpression */: - case 267 /* JsxSelfClosingElement */: - case 266 /* JsxElement */: + case 147 /* UndefinedKeyword */: + case 202 /* FunctionExpression */: + case 215 /* ClassExpression */: + case 203 /* ArrowFunction */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 205 /* TypeOfExpression */: + case 219 /* NonNullExpression */: + case 268 /* JsxSelfClosingElement */: + case 267 /* JsxElement */: return true; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -59737,9 +60031,9 @@ var ts; } return false; // Some forms listed here for clarity - case 205 /* VoidExpression */: // Explicit opt-out - case 199 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 217 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 206 /* VoidExpression */: // Explicit opt-out + case 200 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 218 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -59771,7 +60065,7 @@ var ts; } checkGrammarNullishCoalesceWithLogicalExpression(node); var operator = node.operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (node.left.kind === 193 /* ObjectLiteralExpression */ || node.left.kind === 192 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (node.left.kind === 194 /* ObjectLiteralExpression */ || node.left.kind === 193 /* ArrayLiteralExpression */)) { finishInvocation(checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 104 /* ThisKeyword */)); break; } @@ -59838,7 +60132,7 @@ var ts; // expression-wide checks and does not use a work stack to fold nested binary expressions into the same callstack frame function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (left.kind === 193 /* ObjectLiteralExpression */ || left.kind === 192 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (left.kind === 194 /* ObjectLiteralExpression */ || left.kind === 193 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 104 /* ThisKeyword */); } var leftType; @@ -60243,7 +60537,7 @@ var ts; return stringType; } function getContextNode(node) { - if (node.kind === 274 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { + if (node.kind === 275 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes) } return node; @@ -60292,13 +60586,13 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 199 /* TypeAssertionExpression */ || node.kind === 217 /* AsExpression */; + return node.kind === 200 /* TypeAssertionExpression */ || node.kind === 218 /* AsExpression */; } function checkDeclarationInitializer(declaration, contextualType) { var initializer = ts.getEffectiveInitializer(declaration); var type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, 0 /* Normal */) : checkExpressionCached(initializer)); - return ts.isParameter(declaration) && declaration.name.kind === 190 /* ArrayBindingPattern */ && + return ts.isParameter(declaration) && declaration.name.kind === 191 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type; } @@ -60308,7 +60602,7 @@ var ts; var elementTypes = arity ? getTypeArguments(type).slice() : []; for (var i = arity; i < patternElements.length; i++) { var e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === 191 /* BindingElement */ && e.dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === 192 /* BindingElement */ && e.dotDotDotToken)) { elementTypes.push(!ts.isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, /*includePatternInType*/ false, /*reportErrors*/ false) : anyType); if (!ts.isOmittedExpression(e) && !hasDefaultValue(e)) { reportImplicitAny(e, anyType); @@ -60337,7 +60631,7 @@ var ts; var types = contextualType.types; return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); }); } - if (contextualType.flags & 58982400 /* InstantiableNonPrimitive */) { + if (contextualType.flags & 193200128 /* InstantiableNonPrimitive */) { // If the contextual type is a type variable constrained to a primitive type, consider // this a literal context for literals of that primitive type. For example, given a // type parameter 'T extends string', infer string literal types for T. @@ -60374,7 +60668,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); @@ -60385,7 +60679,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -60619,11 +60913,11 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 195 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 75 /* Identifier */ || node.kind === 153 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || - (node.parent.kind === 172 /* TypeQuery */ && node.parent.exprName === node)) || - (node.parent.kind === 263 /* ExportSpecifier */); // We allow reexporting const enums + var ok = (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 196 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 75 /* Identifier */ || node.kind === 154 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 173 /* TypeQuery */ && node.parent.exprName === node)) || + (node.parent.kind === 264 /* ExportSpecifier */); // We allow reexporting const enums if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } @@ -60648,9 +60942,9 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 214 /* ClassExpression */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 215 /* ClassExpression */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -60676,78 +60970,78 @@ var ts; return trueType; case 91 /* FalseKeyword */: return falseType; - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: return checkTemplateExpression(node); case 13 /* RegularExpressionLiteral */: return globalRegExpType; - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode, forceTuple); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return checkQualifiedName(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (node.expression.kind === 96 /* ImportKeyword */) { return checkImportCallExpression(node); } // falls through - case 197 /* NewExpression */: + case 198 /* NewExpression */: return checkCallExpression(node, checkMode); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return checkClassExpression(node); - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: return checkAssertion(node); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: return checkNonNullAssertion(node); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return checkMetaProperty(node); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return checkDeleteExpression(node); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return checkVoidExpression(node); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return checkAwaitExpression(node); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 215 /* OmittedExpression */: + case 216 /* OmittedExpression */: return undefinedWideningType; - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return checkYieldExpression(node); - case 220 /* SyntheticExpression */: + case 221 /* SyntheticExpression */: return node.type; - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 266 /* JsxElement */: + case 267 /* JsxElement */: return checkJsxElement(node, checkMode); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node, checkMode); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return checkJsxFragment(node); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 268 /* JsxOpeningElement */: + case 269 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -60784,7 +61078,7 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { - if (!(func.kind === 162 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 163 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -60795,12 +61089,15 @@ var ts; if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 162 /* Constructor */ || func.kind === 166 /* ConstructSignature */ || func.kind === 171 /* ConstructorType */) { + if (func.kind === 163 /* Constructor */ || func.kind === 167 /* ConstructSignature */ || func.kind === 172 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 202 /* ArrowFunction */) { + if (func.kind === 203 /* ArrowFunction */) { error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } + if (func.kind === 164 /* GetAccessor */ || func.kind === 165 /* SetAccessor */) { + error(node, ts.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); + } } // Only check rest parameter type if it's not a binding pattern. Since binding patterns are // not allowed in a rest parameter, we already have an error from checkGrammarParameterList. @@ -60856,13 +61153,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 202 /* ArrowFunction */: - case 165 /* CallSignature */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 170 /* FunctionType */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 203 /* ArrowFunction */: + case 166 /* CallSignature */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 171 /* FunctionType */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: var parent = node.parent; if (node === parent.type) { return parent; @@ -60880,7 +61177,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 190 /* ArrayBindingPattern */ || name.kind === 189 /* ObjectBindingPattern */) { + else if (name.kind === 191 /* ArrayBindingPattern */ || name.kind === 190 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -60889,13 +61186,13 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 167 /* IndexSignature */) { + if (node.kind === 168 /* IndexSignature */) { checkGrammarIndexSignature(node); } // TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled - else if (node.kind === 170 /* FunctionType */ || node.kind === 244 /* FunctionDeclaration */ || node.kind === 171 /* ConstructorType */ || - node.kind === 165 /* CallSignature */ || node.kind === 162 /* Constructor */ || - node.kind === 166 /* ConstructSignature */) { + else if (node.kind === 171 /* FunctionType */ || node.kind === 245 /* FunctionDeclaration */ || node.kind === 172 /* ConstructorType */ || + node.kind === 166 /* CallSignature */ || node.kind === 163 /* Constructor */ || + node.kind === 167 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -60925,10 +61222,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 165 /* CallSignature */: + case 166 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -60958,7 +61255,7 @@ var ts; checkAsyncFunctionReturnType(node, returnTypeNode); } } - if (node.kind !== 167 /* IndexSignature */ && node.kind !== 300 /* JSDocFunctionType */) { + if (node.kind !== 168 /* IndexSignature */ && node.kind !== 301 /* JSDocFunctionType */) { registerForUnusedIdentifiersCheck(node); } } @@ -60970,7 +61267,7 @@ var ts; var privateIdentifiers = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 162 /* Constructor */) { + if (member.kind === 163 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param, member) && !ts.isBindingPattern(param.name)) { @@ -60990,16 +61287,16 @@ var ts; var memberName = name && ts.getPropertyNameForPropertyNameNode(name); if (memberName) { switch (member.kind) { - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: addName(names, name, memberName, 1 /* GetAccessor */); break; - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: addName(names, name, memberName, 2 /* SetAccessor */); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: addName(names, name, memberName, 3 /* GetOrSetAccessor */); break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: addName(names, name, memberName, 8 /* Method */); break; } @@ -61062,7 +61359,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 158 /* PropertySignature */) { + if (member.kind === 159 /* PropertySignature */) { var memberName = void 0; var name = member.name; switch (name.kind) { @@ -61087,7 +61384,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 246 /* InterfaceDeclaration */) { + if (node.kind === 247 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -61107,7 +61404,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 143 /* StringKeyword */: + case 144 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -61115,7 +61412,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 140 /* NumberKeyword */: + case 141 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -61157,7 +61454,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 161 /* MethodDeclaration */ && node.body) { + if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 162 /* MethodDeclaration */ && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -61185,7 +61482,7 @@ var ts; if (ts.isPrivateIdentifierPropertyDeclaration(n)) { return true; } - return n.kind === 159 /* PropertyDeclaration */ && + return n.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(n, 32 /* Static */) && !!n.initializer; } @@ -61215,7 +61512,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_3 = statements; _i < statements_3.length; _i++) { var statement = statements_3[_i]; - if (statement.kind === 226 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 227 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -61240,7 +61537,7 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 163 /* GetAccessor */) { + if (node.kind === 164 /* GetAccessor */) { if (!(node.flags & 8388608 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 256 /* HasImplicitReturn */)) { if (!(node.flags & 512 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -61250,7 +61547,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (ts.isPrivateIdentifier(node.name)) { @@ -61259,7 +61556,7 @@ var ts; if (!hasNonBindableDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; + var otherKind = node.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getModifierFlags(node); @@ -61277,7 +61574,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 163 /* GetAccessor */) { + if (node.kind === 164 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -61325,7 +61622,7 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 169 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 170 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } ts.forEach(node.typeArguments, checkSourceElement); @@ -61370,7 +61667,7 @@ var ts; var seenOptionalElement = false; for (var i = 0; i < elementTypes.length; i++) { var e = elementTypes[i]; - if (e.kind === 177 /* RestType */) { + if (e.kind === 178 /* RestType */) { if (i !== elementTypes.length - 1) { grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); break; @@ -61379,7 +61676,7 @@ var ts; error(e, ts.Diagnostics.A_rest_element_type_must_be_an_array_type); } } - else if (e.kind === 176 /* OptionalType */) { + else if (e.kind === 177 /* OptionalType */) { seenOptionalElement = true; } else if (seenOptionalElement) { @@ -61400,7 +61697,7 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType, /*stringsOnly*/ false))) { - if (accessNode.kind === 195 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && + if (accessNode.kind === 196 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } @@ -61451,7 +61748,7 @@ var ts; ts.forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 180 /* ConditionalType */ && n.parent.extendsType === n; })) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 181 /* ConditionalType */ && n.parent.extendsType === n; })) { grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); @@ -61468,9 +61765,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 246 /* InterfaceDeclaration */ && - n.parent.kind !== 245 /* ClassDeclaration */ && - n.parent.kind !== 214 /* ClassExpression */ && + if (n.parent.kind !== 247 /* InterfaceDeclaration */ && + n.parent.kind !== 246 /* ClassDeclaration */ && + n.parent.kind !== 215 /* ClassExpression */ && n.flags & 8388608 /* Ambient */) { if (!(flags & 2 /* Ambient */) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) { // It is nested in an ambient context, which means it is automatically exported @@ -61566,7 +61863,7 @@ var ts; // Both are literal property names that are the same. ts.isPropertyNameLiteral(node.name) && ts.isPropertyNameLiteral(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 161 /* MethodDeclaration */ || node.kind === 160 /* MethodSignature */) && + var reportError = (node.kind === 162 /* MethodDeclaration */ || node.kind === 161 /* MethodSignature */) && ts.hasModifier(node, 32 /* Static */) !== ts.hasModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -61606,7 +61903,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 8388608 /* Ambient */; - var inAmbientContextOrInterface = node.parent.kind === 246 /* InterfaceDeclaration */ || node.parent.kind === 173 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 247 /* InterfaceDeclaration */ || node.parent.kind === 174 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -61617,10 +61914,10 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if ((node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */) && !inAmbientContext) { + if ((node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */) && !inAmbientContext) { hasNonAmbientClass = true; } - if (node.kind === 244 /* FunctionDeclaration */ || node.kind === 161 /* MethodDeclaration */ || node.kind === 160 /* MethodSignature */ || node.kind === 162 /* Constructor */) { + if (node.kind === 245 /* FunctionDeclaration */ || node.kind === 162 /* MethodDeclaration */ || node.kind === 161 /* MethodSignature */ || node.kind === 163 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -61751,25 +62048,25 @@ var ts; function getDeclarationSpaces(decl) { var d = decl; switch (d.kind) { - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: // A jsdoc typedef and callback are, by definition, type aliases. // falls through - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: return 2 /* ExportType */; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: return 2 /* ExportType */ | 1 /* ExportValue */; - case 290 /* SourceFile */: + case 291 /* SourceFile */: return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: // Export assigned entity name expressions act as aliases and should fall through, otherwise they export values if (!ts.isEntityNameExpression(d.expression)) { return 1 /* ExportValue */; @@ -61777,17 +62074,17 @@ var ts; d = d.expression; // The below options all declare an Alias, which is allowed to merge with other values within the importing module. // falls through - case 253 /* ImportEqualsDeclaration */: - case 256 /* NamespaceImport */: - case 255 /* ImportClause */: + case 254 /* ImportEqualsDeclaration */: + case 257 /* NamespaceImport */: + case 256 /* ImportClause */: var result_8 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_8 |= getDeclarationSpaces(d); }); return result_8; - case 242 /* VariableDeclaration */: - case 191 /* BindingElement */: - case 244 /* FunctionDeclaration */: - case 258 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 + case 243 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 245 /* FunctionDeclaration */: + case 259 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 case 75 /* Identifier */: // https://github.com/microsoft/TypeScript/issues/36098 // Identifiers are used as declarations of assignment declarations whose parents may be // SyntaxKind.CallExpression - `Object.defineProperty(thing, "aField", {value: 42});` @@ -61810,9 +62107,9 @@ var ts; * @param type The type of the promise. * @remarks The "promised type" of a type is the type of the "value" parameter of the "onfulfilled" callback. */ - function getPromisedTypeOfPromise(promise, errorNode) { + function getPromisedTypeOfPromise(type, errorNode) { // - // { // promise + // { // type // then( // thenFunction // onfulfilled: ( // onfulfilledParameterType // value: T // valueParameterType @@ -61820,17 +62117,18 @@ var ts; // ): any; // } // - if (isTypeAny(promise)) { + if (isTypeAny(type)) { return undefined; } - var typeAsPromise = promise; + var typeAsPromise = type; if (typeAsPromise.promisedTypeOfPromise) { return typeAsPromise.promisedTypeOfPromise; } - if (isReferenceToType(promise, getGlobalPromiseType(/*reportErrors*/ false))) { - return typeAsPromise.promisedTypeOfPromise = getTypeArguments(promise)[0]; + if (isReferenceToType(type, getGlobalPromiseType(/*reportErrors*/ false)) || + isReferenceToType(type, getGlobalPromiseLikeType(/*reportErrors*/ false))) { + return typeAsPromise.promisedTypeOfPromise = getAwaitedType(getTypeArguments(type)[0], errorNode); } - var thenFunction = getTypeOfPropertyOfType(promise, "then"); // TODO: GH#18217 + var thenFunction = getTypeOfPropertyOfType(type, "then"); // TODO: GH#18217 if (isTypeAny(thenFunction)) { return undefined; } @@ -61865,28 +62163,127 @@ var ts; var awaitedType = getAwaitedType(type, errorNode, diagnosticMessage, arg0); return awaitedType || errorType; } + /** + * Gets or creates an `awaited T` type for a generic type. + * + * The "awaited type" of a generic type cannot be determined until it is instantiated. As + * a result, an `AwaitedType` for the generic type is created that can be instantiated + * or related later. + */ + function getAwaitedTypeForGenericType(type) { + var typeId = "" + type.id; + var awaitedType = awaitedTypes.get(typeId); + if (!awaitedType) { + awaitedType = createType(134217728 /* Awaited */); + awaitedType.awaitedType = type; + awaitedTypes.set(typeId, awaitedType); + } + return awaitedType; + } + function unwrapAwaitedType(type) { + return type.flags & 1048576 /* Union */ ? + mapType(type, unwrapAwaitedType) : + type.flags & 134217728 /* Awaited */ ? type.awaitedType : type; + } + /** + * Determines whether a type has a callable `then` member. + */ + function isThenableType(type) { + var thenFunction = getTypeOfPropertyOfType(type, "then"); + return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, 2097152 /* NEUndefinedOrNull */), 0 /* Call */).length > 0; + } + /** + * Determines whether a type is a generic type whose base constraint could possibly resolve to a different + * type when awaited. A type is a generic "thenable" type when all of the following conditions are met: + * - The type is a generic object type, + * - AND one of the following conditions are met + * - The type has no base constraint, + * - OR The base constraint of the type is `any`, `unknown`, `object`, or the empty object `{}`, + * - OR The base constraint has a callable `then` member. + */ + function isGenericAwaitableType(type) { + if (isGenericObjectType(type)) { + if (type.flags & 2097152 /* Intersection */) { + return ts.some(type.types, isGenericAwaitableType); + } + var baseConstraint = getBaseConstraintOfType(type); + return !baseConstraint || + !!(baseConstraint.flags & (3 /* AnyOrUnknown */ | 67108864 /* NonPrimitive */)) || + baseConstraint === emptyObjectType || + baseConstraint === emptyGenericType || + isThenableType(baseConstraint); + } + return false; + } + /** + * Gets the "awaited type" of a type. + * + * The "awaited type" of an expression is its "promised type" if the expression is a + * Promise-like type; otherwise, it is the type of the expression. If the "promised + * type" is itself a Promise-like, the "promised type" is recursively unwrapped until a + * non-promise type is found. + * + * This is used to reflect the runtime behavior of the `await` keyword and the `awaited T` + * type. + */ function getAwaitedType(type, errorNode, diagnosticMessage, arg0) { + if (isTypeAny(type)) { + return type; + } + // If the type is already an awaited type, return it. + // + // For example: + // + // awaited T -> awaited T + // + if (type.flags & 134217728 /* Awaited */) { + return type; + } var typeAsAwaitable = type; if (typeAsAwaitable.awaitedTypeOfType) { return typeAsAwaitable.awaitedTypeOfType; } - if (isTypeAny(type)) { - return typeAsAwaitable.awaitedTypeOfType = type; + // For a union, get a union of the awaited types of each constituent. + // + // For example: + // + // awaited (number | string) -> number | string + // awaited (number | Promise) -> number | string + // awaited (T | string) -> awaited T | string + // awaited (T | Promise) -> awaited T | string + // awaited (T | Promise) -> awaited T + // awaited (T | U) -> awaited T | awaited U + // + return typeAsAwaitable.awaitedTypeOfType = + mapType(type, errorNode ? function (constituentType) { return getAwaitedTypeWorker(constituentType, errorNode, diagnosticMessage, arg0); } : getAwaitedTypeWorker); + } + function getAwaitedTypeWorker(type, errorNode, diagnosticMessage, arg0) { + // If the type is already an awaited type, return it. + // + // For example: + // + // awaited T -> awaited T + // + if (type.flags & 134217728 /* Awaited */) { + return type; } - if (type.flags & 1048576 /* Union */) { - var types = void 0; - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var constituentType = _a[_i]; - types = ts.append(types, getAwaitedType(constituentType, errorNode, diagnosticMessage, arg0)); - } - if (!types) { - return undefined; - } - return typeAsAwaitable.awaitedTypeOfType = getUnionType(types); + // We cannot resolve the awaited type for a type variable until it is instantiated. As + // such, we create an `awaited T` type that can either be instantiated or related later. + // + // For example: + // + // T -> awaited T + // + if (isGenericAwaitableType(type)) { + return getAwaitedTypeForGenericType(type); + } + var typeAsAwaitable = type; + if (typeAsAwaitable.awaitedTypeOfType) { + return typeAsAwaitable.awaitedTypeOfType; } var promisedType = getPromisedTypeOfPromise(type); if (promisedType) { - if (type.id === promisedType.id || awaitedTypeStack.indexOf(promisedType.id) >= 0) { + if (type.id === promisedType.id || awaitedTypeStack.lastIndexOf(promisedType.id) >= 0) { // Verify that we don't have a bad actor in the form of a promise whose // promised type is the same as the promise type, or a mutually recursive // promise. If so, we return undefined as we cannot guess the shape. If this @@ -61900,6 +62297,7 @@ var ts; // onfulfilled: (value: BadPromise) => any, // onrejected: (error: any) => any): BadPromise; // } + // // The above interface will pass the PromiseLike check, and return a // promised type of `BadPromise`. Since this is a self reference, we // don't want to keep recursing ad infinitum. @@ -61936,8 +62334,8 @@ var ts; } // The type was not a promise, so it could not be unwrapped any further. // As long as the type does not have a callable "then" property, it is - // safe to return the type; otherwise, an error will be reported in - // the call to getNonThenableType and we will return undefined. + // safe to return the type; otherwise, an error is reported and we return + // undefined. // // An example of a non-promise "thenable" might be: // @@ -61949,8 +62347,7 @@ var ts; // of a runtime problem. If the user wants to return this value from an async // function, they would need to wrap it in some other value. If they want it to // be treated as a promise, they can cast to . - var thenFunction = getTypeOfPropertyOfType(type, "then"); - if (thenFunction && getSignaturesOfType(thenFunction, 0 /* Call */).length > 0) { + if (isThenableType(type)) { if (errorNode) { if (!diagnosticMessage) return ts.Debug.fail(); @@ -62063,24 +62460,24 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 156 /* Parameter */: + case 157 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -62127,14 +62524,14 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 179 /* IntersectionType */: - case 178 /* UnionType */: + case 180 /* IntersectionType */: + case 179 /* UnionType */: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return getEntityNameForDecoratorMetadata(node.type); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return node.typeName; } } @@ -62143,13 +62540,13 @@ var ts; var commonEntityName; for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { var typeNode = types_19[_i]; - while (typeNode.kind === 182 /* ParenthesizedType */) { + while (typeNode.kind === 183 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 137 /* NeverKeyword */) { + if (typeNode.kind === 138 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 146 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 147 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -62195,14 +62592,14 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 156 /* Parameter */) { + if (node.kind === 157 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -62211,23 +62608,23 @@ var ts; } } break; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - var otherKind = node.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + var otherKind = node.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 156 /* Parameter */: + case 157 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -62290,7 +62687,7 @@ var ts; else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && node.typeExpression && node.typeExpression.type && !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 153 /* QualifiedName */ ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 154 /* QualifiedName */ ? node.name.right : node.name)); } } } @@ -62331,7 +62728,7 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return node.name; default: return undefined; @@ -62344,7 +62741,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 155 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -62373,7 +62770,7 @@ var ts; } } } - var body = node.kind === 160 /* MethodSignature */ ? undefined : node.body; + var body = node.kind === 161 /* MethodSignature */ ? undefined : node.body; checkSourceElement(body); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); if (produceDiagnostics && !ts.getEffectiveReturnTypeNode(node)) { @@ -62415,42 +62812,42 @@ var ts; for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) { var node = potentiallyUnusedIdentifiers_1[_i]; switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 290 /* SourceFile */: - case 249 /* ModuleDeclaration */: - case 223 /* Block */: - case 251 /* CaseBlock */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 291 /* SourceFile */: + case 250 /* ModuleDeclaration */: + case 224 /* Block */: + case 252 /* CaseBlock */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 162 /* Constructor */: - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 163 /* Constructor */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; - case 181 /* InferType */: + case 182 /* InferType */: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -62470,11 +62867,11 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 161 /* MethodDeclaration */: - case 159 /* PropertyDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - if (member.kind === 164 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + case 162 /* MethodDeclaration */: + case 160 /* PropertyDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + if (member.kind === 165 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { // Already would have reported an error on the getter. break; } @@ -62485,7 +62882,7 @@ var ts; addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); } break; - case 162 /* Constructor */: + case 163 /* Constructor */: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { @@ -62493,8 +62890,8 @@ var ts; } } break; - case 167 /* IndexSignature */: - case 222 /* SemicolonClassElement */: + case 168 /* IndexSignature */: + case 223 /* SemicolonClassElement */: // Can't be private break; default: @@ -62521,7 +62918,7 @@ var ts; continue; var name = ts.idText(typeParameter.name); var parent = typeParameter.parent; - if (parent.kind !== 181 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { + if (parent.kind !== 182 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { if (seenParentsWithEveryUnused.tryAdd(parent)) { var range = ts.isJSDocTemplateTag(parent) // Whole @template tag @@ -62604,7 +63001,7 @@ var ts; var importDecl = importClause.parent; var nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? - (importClause.namedBindings.kind === 256 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) + (importClause.namedBindings.kind === 257 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) : 0); if (nDeclarations === unuseds.length) { addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 @@ -62622,7 +63019,7 @@ var ts; var bindingPattern = _a[0], bindingElements = _a[1]; var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */; if (bindingPattern.elements.length === bindingElements.length) { - if (bindingElements.length === 1 && bindingPattern.parent.kind === 242 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 243 /* VariableDeclarationList */) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 243 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 244 /* VariableDeclarationList */) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { @@ -62643,7 +63040,7 @@ var ts; if (declarationList.declarations.length === declarations.length) { addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? ts.createDiagnosticForNode(ts.first(declarations).name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(declarations).name)) - : ts.createDiagnosticForNode(declarationList.parent.kind === 225 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); + : ts.createDiagnosticForNode(declarationList.parent.kind === 226 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); } else { for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { @@ -62657,22 +63054,22 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return ts.idText(name); - case 190 /* ArrayBindingPattern */: - case 189 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name); default: return ts.Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 255 /* ImportClause */ || node.kind === 258 /* ImportSpecifier */ || node.kind === 256 /* NamespaceImport */; + return node.kind === 256 /* ImportClause */ || node.kind === 259 /* ImportSpecifier */ || node.kind === 257 /* NamespaceImport */; } function importClauseFromImported(decl) { - return decl.kind === 255 /* ImportClause */ ? decl : decl.kind === 256 /* NamespaceImport */ ? decl.parent : decl.parent.parent; + return decl.kind === 256 /* ImportClause */ ? decl : decl.kind === 257 /* NamespaceImport */ ? decl.parent : decl.parent.parent; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 223 /* Block */) { + if (node.kind === 224 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -62702,12 +63099,12 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 159 /* PropertyDeclaration */ || - node.kind === 158 /* PropertySignature */ || - node.kind === 161 /* MethodDeclaration */ || - node.kind === 160 /* MethodSignature */ || - node.kind === 163 /* GetAccessor */ || - node.kind === 164 /* SetAccessor */) { + if (node.kind === 160 /* PropertyDeclaration */ || + node.kind === 159 /* PropertySignature */ || + node.kind === 162 /* MethodDeclaration */ || + node.kind === 161 /* MethodSignature */ || + node.kind === 164 /* GetAccessor */ || + node.kind === 165 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -62716,7 +63113,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 156 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 157 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -62773,7 +63170,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -62788,7 +63185,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { + if (parent.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -62823,7 +63220,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 242 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 243 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -62835,17 +63232,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 243 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 225 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 244 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 226 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 223 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 250 /* ModuleBlock */ || - container.kind === 249 /* ModuleDeclaration */ || - container.kind === 290 /* SourceFile */); + (container.kind === 224 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 251 /* ModuleBlock */ || + container.kind === 250 /* ModuleDeclaration */ || + container.kind === 291 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -62875,18 +63272,18 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 191 /* BindingElement */) { - if (node.parent.kind === 189 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { + if (node.kind === 192 /* BindingElement */) { + if (node.parent.kind === 190 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 154 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access @@ -62907,19 +63304,19 @@ var ts; } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 190 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 191 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.getRootDeclaration(node).kind === 156 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 157 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { - var needCheckInitializer = node.initializer && node.parent.parent.kind !== 231 /* ForInStatement */; + var needCheckInitializer = node.initializer && node.parent.parent.kind !== 232 /* ForInStatement */; var needCheckWidenedType = node.name.elements.length === 0; if (needCheckInitializer || needCheckWidenedType) { // Don't validate for-in initializer as it is already an error @@ -62956,7 +63353,7 @@ var ts; ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) && ts.hasEntries(symbol.exports); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 231 /* ForInStatement */) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 232 /* ForInStatement */) { checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, /*headMessage*/ undefined); } } @@ -62982,10 +63379,10 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 159 /* PropertyDeclaration */ && node.kind !== 158 /* PropertySignature */) { + if (node.kind !== 160 /* PropertyDeclaration */ && node.kind !== 159 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { + if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -62997,7 +63394,7 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 159 /* PropertyDeclaration */ || nextDeclaration.kind === 158 /* PropertySignature */ + var message = nextDeclaration.kind === 160 /* PropertyDeclaration */ || nextDeclaration.kind === 159 /* PropertySignature */ ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; var declName = ts.declarationNameToString(nextDeclarationName); @@ -63007,8 +63404,8 @@ var ts; } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 156 /* Parameter */ && right.kind === 242 /* VariableDeclaration */) || - (left.kind === 242 /* VariableDeclaration */ && right.kind === 156 /* Parameter */)) { + if ((left.kind === 157 /* Parameter */ && right.kind === 243 /* VariableDeclaration */) || + (left.kind === 243 /* VariableDeclaration */ && right.kind === 157 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -63048,7 +63445,7 @@ var ts; var type = checkTruthinessExpression(node.expression); checkTestingKnownTruthyCallableType(node.expression, node.thenStatement, type); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 224 /* EmptyStatement */) { + if (node.thenStatement.kind === 225 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -63119,12 +63516,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 243 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 244 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 243 /* VariableDeclarationList */) { + if (node.initializer.kind === 244 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -63158,14 +63555,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 243 /* VariableDeclarationList */) { + if (node.initializer.kind === 244 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier); // There may be a destructuring assignment on the left side - if (varExpr.kind === 192 /* ArrayLiteralExpression */ || varExpr.kind === 193 /* ObjectLiteralExpression */) { + if (varExpr.kind === 193 /* ArrayLiteralExpression */ || varExpr.kind === 194 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -63197,7 +63594,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 243 /* VariableDeclarationList */) { + if (node.initializer.kind === 244 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -63211,7 +63608,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 192 /* ArrayLiteralExpression */ || varExpr.kind === 193 /* ObjectLiteralExpression */) { + if (varExpr.kind === 193 /* ArrayLiteralExpression */ || varExpr.kind === 194 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -63224,7 +63621,7 @@ var ts; } // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { + if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 193200128 /* InstantiableNonPrimitive */)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, typeToString(rightType)); } checkSourceElement(node.statement); @@ -63862,7 +64259,7 @@ var ts; var isGenerator = !!(functionFlags & 1 /* Generator */); var isAsync = !!(functionFlags & 2 /* Async */); return isGenerator ? getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, isAsync) || errorType : - isAsync ? getPromisedTypeOfPromise(returnType) || errorType : + isAsync ? unwrapAwaitedType(getAwaitedType(returnType) || errorType) : returnType; } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { @@ -63884,12 +64281,12 @@ var ts; var functionFlags = ts.getFunctionFlags(func); if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 164 /* SetAccessor */) { + if (func.kind === 165 /* SetAccessor */) { if (node.expression) { error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 162 /* Constructor */) { + else if (func.kind === 163 /* Constructor */) { if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -63897,7 +64294,7 @@ var ts; else if (getReturnTypeFromAnnotation(func)) { var unwrappedReturnType = unwrapReturnType(returnType, functionFlags); var unwrappedExprType = functionFlags & 2 /* Async */ - ? checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) + ? unwrapAwaitedType(checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)) : exprType; if (unwrappedReturnType) { // If the function has a return type, but promisedType is @@ -63907,7 +64304,7 @@ var ts; } } } - else if (func.kind !== 162 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 163 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { // The function has a return type, but the return statement doesn't have an expression. error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } @@ -63936,7 +64333,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 278 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 279 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -63945,7 +64342,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 277 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 278 /* CaseClause */) { // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable // to or from the type of the 'switch' expression. @@ -63977,7 +64374,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 238 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 239 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label)); return true; } @@ -64084,8 +64481,8 @@ var ts; // this allows us to rule out cases when both property and indexer are inherited from the base class var errorNode; if (propDeclaration && name && - (propDeclaration.kind === 209 /* BinaryExpression */ || - name.kind === 154 /* ComputedPropertyName */ || + (propDeclaration.kind === 210 /* BinaryExpression */ || + name.kind === 155 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -64162,7 +64559,7 @@ var ts; function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 169 /* TypeReference */) { + if (node.kind === 170 /* TypeReference */) { var type = getTypeFromTypeReference(node); if (type.flags & 262144 /* TypeParameter */) { for (var i = index; i < typeParameters.length; i++) { @@ -64408,7 +64805,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 245 /* ClassDeclaration */ || d.kind === 246 /* InterfaceDeclaration */; + return d.kind === 246 /* ClassDeclaration */ || d.kind === 247 /* InterfaceDeclaration */; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -64463,7 +64860,7 @@ var ts; continue basePropertyCheck; } } - if (derivedClassDecl.kind === 214 /* ClassExpression */) { + if (derivedClassDecl.kind === 215 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -64485,7 +64882,7 @@ var ts; // property/accessor is overridden with property/accessor if (!compilerOptions.useDefineForClassFields || baseDeclarationFlags & 128 /* Abstract */ && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer) - || base.valueDeclaration && base.valueDeclaration.parent.kind === 246 /* InterfaceDeclaration */ + || base.valueDeclaration && base.valueDeclaration.parent.kind === 247 /* InterfaceDeclaration */ || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) { // when the base property is abstract or from an interface, base/derived flags don't need to match // same when the derived property is from an assignment @@ -64500,7 +64897,7 @@ var ts; error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type)); } else { - var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 159 /* PropertyDeclaration */ && !d.initializer; }); + var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 160 /* PropertyDeclaration */ && !d.initializer; }); if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 128 /* Abstract */) @@ -64597,7 +64994,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 159 /* PropertyDeclaration */ && + return node.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(node, 32 /* Static */ | 128 /* Abstract */) && !node.exclamationToken && !node.initializer; @@ -64621,7 +65018,7 @@ var ts; var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 246 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 247 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -64727,7 +65124,7 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: var value_2 = evaluate(expr.operand); if (typeof value_2 === "number") { switch (expr.operator) { @@ -64737,7 +65134,7 @@ var ts; } } break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -64766,7 +65163,7 @@ var ts; case 8 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return evaluate(expr.expression); case 75 /* Identifier */: var identifier = expr; @@ -64774,14 +65171,14 @@ var ts; return +(identifier.escapedText); } return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText); - case 195 /* ElementAccessExpression */: - case 194 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384 /* Enum */) { var name = void 0; - if (ex.kind === 194 /* PropertyAccessExpression */) { + if (ex.kind === 195 /* PropertyAccessExpression */) { name = ex.name.escapedText; } else { @@ -64811,8 +65208,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 75 /* Identifier */ || - node.kind === 194 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || - node.kind === 195 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && + node.kind === 195 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || + node.kind === 196 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && ts.isStringLiteralLike(node.argumentExpression); } function checkEnumDeclaration(node) { @@ -64848,7 +65245,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 248 /* EnumDeclaration */) { + if (declaration.kind !== 249 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -64876,8 +65273,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { var declaration = declarations_8[_i]; - if ((declaration.kind === 245 /* ClassDeclaration */ || - (declaration.kind === 244 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 246 /* ClassDeclaration */ || + (declaration.kind === 245 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 8388608 /* Ambient */)) { return declaration; } @@ -64940,7 +65337,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 245 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 246 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -64990,23 +65387,23 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 259 /* ExportAssignment */: - case 260 /* ExportDeclaration */: + case 260 /* ExportAssignment */: + case 261 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 253 /* ImportEqualsDeclaration */: - case 254 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 191 /* BindingElement */: - case 242 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 243 /* VariableDeclaration */: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -65017,12 +65414,12 @@ var ts; break; } // falls through - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 244 /* FunctionDeclaration */: - case 246 /* InterfaceDeclaration */: - case 249 /* ModuleDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 245 /* FunctionDeclaration */: + case 247 /* InterfaceDeclaration */: + case 250 /* ModuleDeclaration */: + case 248 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -65045,12 +65442,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: do { node = node.left; } while (node.kind !== 75 /* Identifier */); return node; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: do { if (ts.isModuleExportsAccessExpression(node.expression) && !ts.isPrivateIdentifier(node.name)) { return node.name; @@ -65070,9 +65467,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 250 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 290 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 260 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 251 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 291 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 261 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -65107,14 +65504,14 @@ var ts; (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 263 /* ExportSpecifier */ ? + var message = node.kind === 264 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } // Don't allow to re-export something with no value side when `--isolatedModules` is set. if (compilerOptions.isolatedModules - && node.kind === 263 /* ExportSpecifier */ + && node.kind === 264 /* ExportSpecifier */ && !node.parent.parent.isTypeOnly && !(target.flags & 111551 /* Value */) && !(node.flags & 8388608 /* Ambient */)) { @@ -65142,7 +65539,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 256 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 257 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -65166,7 +65563,7 @@ var ts; if (ts.hasModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 265 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 266 /* ExternalModuleReference */) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 111551 /* Value */) { @@ -65211,10 +65608,10 @@ var ts; else if (!ts.isNamespaceExport(node.exportClause)) { checkImportBinding(node.exportClause); } - var inAmbientExternalModule = node.parent.kind === 250 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 250 /* ModuleBlock */ && + var inAmbientExternalModule = node.parent.kind === 251 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 251 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 8388608 /* Ambient */; - if (node.parent.kind !== 290 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 291 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -65232,14 +65629,14 @@ var ts; } function checkGrammarExportDeclaration(node) { var _a; - var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 261 /* NamedExports */; + var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 262 /* NamedExports */; if (isTypeOnlyExportStar) { grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type); } return !isTypeOnlyExportStar; } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 290 /* SourceFile */ || node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 249 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 291 /* SourceFile */ || node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 250 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -65295,8 +65692,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 290 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 249 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 291 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 250 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -65410,165 +65807,165 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 249 /* ModuleDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 244 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 245 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } - if (kind >= 225 /* FirstStatement */ && kind <= 241 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { + if (kind >= 226 /* FirstStatement */ && kind <= 242 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, ts.Diagnostics.Unreachable_code_detected); } switch (kind) { - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return checkTypeParameter(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return checkParameter(node); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return checkPropertyDeclaration(node); - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: return checkPropertySignature(node); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: return checkSignatureDeclaration(node); - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: return checkMethodDeclaration(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return checkConstructorDeclaration(node); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return checkAccessorDeclaration(node); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return checkTypeReferenceNode(node); - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return checkTypePredicate(node); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return checkTypeQuery(node); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return checkTypeLiteral(node); - case 174 /* ArrayType */: + case 175 /* ArrayType */: return checkArrayType(node); - case 175 /* TupleType */: + case 176 /* TupleType */: return checkTupleType(node); - case 178 /* UnionType */: - case 179 /* IntersectionType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 182 /* ParenthesizedType */: - case 176 /* OptionalType */: - case 177 /* RestType */: + case 183 /* ParenthesizedType */: + case 177 /* OptionalType */: + case 178 /* RestType */: return checkSourceElement(node.type); - case 183 /* ThisType */: + case 184 /* ThisType */: return checkThisType(node); - case 184 /* TypeOperator */: + case 185 /* TypeOperator */: return checkTypeOperator(node); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return checkConditionalType(node); - case 181 /* InferType */: + case 182 /* InferType */: return checkInferType(node); - case 188 /* ImportType */: + case 189 /* ImportType */: return checkImportType(node); - case 307 /* JSDocAugmentsTag */: + case 308 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 308 /* JSDocImplementsTag */: + case 309 /* JSDocImplementsTag */: return checkJSDocImplementsTag(node); - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: return checkJSDocTypeAliasTag(node); - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return checkJSDocTemplateTag(node); - case 320 /* JSDocTypeTag */: + case 321 /* JSDocTypeTag */: return checkJSDocTypeTag(node); - case 317 /* JSDocParameterTag */: + case 318 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: checkJSDocFunctionType(node); // falls through - case 298 /* JSDocNonNullableType */: - case 297 /* JSDocNullableType */: - case 295 /* JSDocAllType */: - case 296 /* JSDocUnknownType */: - case 304 /* JSDocTypeLiteral */: + case 299 /* JSDocNonNullableType */: + case 298 /* JSDocNullableType */: + case 296 /* JSDocAllType */: + case 297 /* JSDocUnknownType */: + case 305 /* JSDocTypeLiteral */: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 301 /* JSDocVariadicType */: + case 302 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 294 /* JSDocTypeExpression */: + case 295 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 186 /* MappedType */: + case 187 /* MappedType */: return checkMappedType(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 223 /* Block */: - case 250 /* ModuleBlock */: + case 224 /* Block */: + case 251 /* ModuleBlock */: return checkBlock(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return checkVariableStatement(node); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return checkExpressionStatement(node); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return checkIfStatement(node); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return checkDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return checkWhileStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return checkForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return checkForInStatement(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return checkForOfStatement(node); - case 233 /* ContinueStatement */: - case 234 /* BreakStatement */: + case 234 /* ContinueStatement */: + case 235 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return checkReturnStatement(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return checkWithStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return checkSwitchStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return checkLabeledStatement(node); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return checkThrowStatement(node); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return checkTryStatement(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return checkBindingElement(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return checkClassDeclaration(node); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return checkImportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return checkExportDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return checkExportAssignment(node); - case 224 /* EmptyStatement */: - case 241 /* DebuggerStatement */: + case 225 /* EmptyStatement */: + case 242 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 264 /* MissingDeclaration */: + case 265 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -65663,33 +66060,33 @@ var ts; currentNode = node; instantiationCount = 0; switch (node.kind) { - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 198 /* TaggedTemplateExpression */: - case 157 /* Decorator */: - case 268 /* JsxOpeningElement */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 199 /* TaggedTemplateExpression */: + case 158 /* Decorator */: + case 269 /* JsxOpeningElement */: // These node kinds are deferred checked when overload resolution fails // To save on work, we ensure the arguments are checked just once, in // a deferred way resolveUntypedCall(node); break; - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: checkClassExpressionDeferred(node); break; - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: checkJsxSelfClosingElementDeferred(node); break; - case 266 /* JsxElement */: + case 267 /* JsxElement */: checkJsxElementDeferred(node); break; } @@ -65832,17 +66229,17 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; // falls through - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -65850,8 +66247,8 @@ var ts; // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration. // falls through - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -65860,7 +66257,7 @@ var ts; copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968 /* Type */); } break; - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -65908,16 +66305,16 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 155 /* TypeParameter */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 248 /* EnumDeclaration */: + case 156 /* TypeParameter */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: return true; - case 255 /* ImportClause */: + case 256 /* ImportClause */: return node.isTypeOnly; - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; default: return false; @@ -65925,16 +66322,16 @@ var ts; } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 153 /* QualifiedName */) { + while (node.parent.kind === 154 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 169 /* TypeReference */; + return node.parent.kind === 170 /* TypeReference */; } function isHeritageClauseElementIdentifier(node) { - while (node.parent.kind === 194 /* PropertyAccessExpression */) { + while (node.parent.kind === 195 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent.kind === 216 /* ExpressionWithTypeArguments */; + return node.parent.kind === 217 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -65962,13 +66359,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 153 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 154 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 253 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 254 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } - if (nodeOnRightSide.parent.kind === 259 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 260 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } return undefined; @@ -65994,7 +66391,7 @@ var ts; node = parent; parent = parent.parent; } - if (parent && parent.kind === 188 /* ImportType */ && parent.qualifier === node) { + if (parent && parent.kind === 189 /* ImportType */ && parent.qualifier === node) { return parent; } return undefined; @@ -66004,7 +66401,7 @@ var ts; return getSymbolOfNode(name.parent); } if (ts.isInJSFile(name) && - name.parent.kind === 194 /* PropertyAccessExpression */ && + name.parent.kind === 195 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { // Check if this is a special property assignment if (!ts.isPrivateIdentifier(name)) { @@ -66014,7 +66411,7 @@ var ts; } } } - if (name.parent.kind === 259 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { + if (name.parent.kind === 260 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { // Even an entity name expression that doesn't resolve as an entityname may still typecheck as a property access expression var success = resolveEntityName(name, /*all meanings*/ 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*ignoreErrors*/ true); @@ -66024,7 +66421,7 @@ var ts; } else if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name) && isInRightSideOfImportOrExportAssignment(name)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(name, 253 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(name, 254 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(name, /*dontResolveAlias*/ true); } @@ -66042,7 +66439,7 @@ var ts; if (isHeritageClauseElementIdentifier(name)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (name.parent.kind === 216 /* ExpressionWithTypeArguments */) { + if (name.parent.kind === 217 /* ExpressionWithTypeArguments */) { meaning = 788968 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { @@ -66058,10 +66455,10 @@ var ts; return entityNameSymbol; } } - if (name.parent.kind === 317 /* JSDocParameterTag */) { + if (name.parent.kind === 318 /* JSDocParameterTag */) { return ts.getParameterSymbolFromJSDoc(name.parent); } - if (name.parent.kind === 155 /* TypeParameter */ && name.parent.parent.kind === 321 /* JSDocTemplateTag */) { + if (name.parent.kind === 156 /* TypeParameter */ && name.parent.parent.kind === 322 /* JSDocTemplateTag */) { ts.Debug.assert(!ts.isInJSFile(name)); // Otherwise `isDeclarationName` would have been true. var typeParameter = ts.getTypeParameterFromJsDoc(name.parent); return typeParameter && typeParameter.symbol; @@ -66078,12 +66475,12 @@ var ts; } return resolveEntityName(name, 111551 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (name.kind === 194 /* PropertyAccessExpression */ || name.kind === 153 /* QualifiedName */) { + else if (name.kind === 195 /* PropertyAccessExpression */ || name.kind === 154 /* QualifiedName */) { var links = getNodeLinks(name); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (name.kind === 194 /* PropertyAccessExpression */) { + if (name.kind === 195 /* PropertyAccessExpression */) { checkPropertyAccessExpression(name); } else { @@ -66093,17 +66490,17 @@ var ts; } } else if (isTypeReferenceIdentifier(name)) { - var meaning = name.parent.kind === 169 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; + var meaning = name.parent.kind === 170 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - if (name.parent.kind === 168 /* TypePredicate */) { + if (name.parent.kind === 169 /* TypePredicate */) { return resolveEntityName(name, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node, ignoreErrors) { - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } var parent = node.parent; @@ -66126,8 +66523,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); } - else if (parent.kind === 191 /* BindingElement */ && - grandParent.kind === 189 /* ObjectBindingPattern */ && + else if (parent.kind === 192 /* BindingElement */ && + grandParent.kind === 190 /* ObjectBindingPattern */ && node === parent.propertyName) { var typeOfPattern = getTypeOfNode(grandParent); var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); @@ -66139,8 +66536,8 @@ var ts; switch (node.kind) { case 75 /* Identifier */: case 76 /* PrivateIdentifier */: - case 194 /* PropertyAccessExpression */: - case 153 /* QualifiedName */: + case 195 /* PropertyAccessExpression */: + case 154 /* QualifiedName */: return getSymbolOfNameOrPropertyAccessExpression(node); case 104 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -66154,14 +66551,14 @@ var ts; return checkExpression(node).symbol; } // falls through - case 183 /* ThisType */: + case 184 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 102 /* SuperKeyword */: return checkExpression(node).symbol; - case 129 /* ConstructorKeyword */: + case 130 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 162 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 163 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -66172,7 +66569,7 @@ var ts; // 3). Dynamic import call or require in javascript // 4). type A = import("./f/*gotToDefinitionHere*/oo") if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 254 /* ImportDeclaration */ || node.parent.kind === 260 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 255 /* ImportDeclaration */ || node.parent.kind === 261 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || ((ts.isInJSFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteralLike*/ false)) || ts.isImportCall(node.parent)) || (ts.isLiteralTypeNode(node.parent) && ts.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent)) { return resolveExternalModuleName(node, node, ignoreErrors); @@ -66194,7 +66591,7 @@ var ts; case 38 /* EqualsGreaterThanToken */: case 80 /* ClassKeyword */: return getSymbolOfNode(node.parent); - case 188 /* ImportType */: + case 189 /* ImportType */: return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : undefined; case 89 /* ExportKeyword */: return ts.isExportAssignment(node.parent) ? ts.Debug.checkDefined(node.parent.symbol) : undefined; @@ -66203,7 +66600,7 @@ var ts; } } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 282 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 283 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */); } return undefined; @@ -66274,23 +66671,23 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfAssignmentPattern(expr) { - ts.Debug.assert(expr.kind === 193 /* ObjectLiteralExpression */ || expr.kind === 192 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 194 /* ObjectLiteralExpression */ || expr.kind === 193 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 232 /* ForOfStatement */) { + if (expr.parent.kind === 233 /* ForOfStatement */) { var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 209 /* BinaryExpression */) { + if (expr.parent.kind === 210 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 281 /* PropertyAssignment */) { + if (expr.parent.kind === 282 /* PropertyAssignment */) { var node_4 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression); var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_4) || errorType; var propertyIndex = ts.indexOfNode(node_4.properties, expr.parent); @@ -66338,7 +66735,7 @@ var ts; case 8 /* NumericLiteral */: case 10 /* StringLiteral */: return getLiteralType(name.text); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType; default: @@ -66394,7 +66791,7 @@ var ts; if (!ts.isGeneratedIdentifier(nodeIn)) { var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier); if (node) { - var isPropertyName_1 = node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node; + var isPropertyName_1 = node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node; return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } @@ -66450,7 +66847,7 @@ var ts; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 290 /* SourceFile */) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 291 /* SourceFile */) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. @@ -66478,7 +66875,7 @@ var ts; } function isSymbolOfDestructuredElementOfCatchBinding(symbol) { return ts.isBindingElement(symbol.valueDeclaration) - && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 280 /* CatchClause */; + && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 281 /* CatchClause */; } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 /* BlockScoped */ && !ts.isSourceFile(symbol.valueDeclaration)) { @@ -66509,7 +66906,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 524288 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 223 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 224 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -66550,19 +66947,19 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 255 /* ImportClause */: - case 256 /* NamespaceImport */: - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 256 /* ImportClause */: + case 257 /* NamespaceImport */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: var symbol = getSymbolOfNode(node) || unknownSymbol; return isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: var exportClause = node.exportClause; return !!exportClause && (ts.isNamespaceExport(exportClause) || ts.some(exportClause.elements, isValueAliasDeclaration)); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return node.expression && node.expression.kind === 75 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) : true; @@ -66571,7 +66968,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 290 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 291 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -66673,15 +67070,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 284 /* EnumMember */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 285 /* EnumMember */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return true; } return false; } function getConstantValue(node) { - if (node.kind === 284 /* EnumMember */) { + if (node.kind === 285 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -66860,9 +67257,11 @@ var ts; return; } var file = host.getSourceFile(resolvedDirective.resolvedFileName); - // Add the transitive closure of path references loaded by this file (as long as they are not) - // part of an existing type reference. - addReferencedFilesToTypeDirective(file, key); + if (file) { + // Add the transitive closure of path references loaded by this file (as long as they are not) + // part of an existing type reference. + addReferencedFilesToTypeDirective(file, key); + } }); } return { @@ -66920,12 +67319,12 @@ var ts; getJsxFactoryEntity: getJsxFactoryEntity, getAllAccessorDeclarations: function (accessor) { accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration); // TODO: GH#18217 - var otherKind = accessor.kind === 164 /* SetAccessor */ ? 163 /* GetAccessor */ : 164 /* SetAccessor */; + var otherKind = accessor.kind === 165 /* SetAccessor */ ? 164 /* GetAccessor */ : 165 /* SetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind); var firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor; var secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor; - var setAccessor = accessor.kind === 164 /* SetAccessor */ ? accessor : otherAccessor; - var getAccessor = accessor.kind === 163 /* GetAccessor */ ? accessor : otherAccessor; + var setAccessor = accessor.kind === 165 /* SetAccessor */ ? accessor : otherAccessor; + var getAccessor = accessor.kind === 164 /* GetAccessor */ ? accessor : otherAccessor; return { firstAccessor: firstAccessor, secondAccessor: secondAccessor, @@ -66941,7 +67340,7 @@ var ts; }, getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) { var n = ts.getParseTreeNode(node); - ts.Debug.assert(n && n.kind === 290 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + ts.Debug.assert(n && n.kind === 291 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); var sym = getSymbolOfNode(node); if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); @@ -66950,7 +67349,7 @@ var ts; } }; function isInHeritageClause(node) { - return node.parent && node.parent.kind === 216 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 279 /* HeritageClause */; + return node.parent && node.parent.kind === 217 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 280 /* HeritageClause */; } // defined here to avoid outer scope pollution function getTypeReferenceDirectivesForEntityName(node) { @@ -66962,7 +67361,7 @@ var ts; // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries var meaning = 788968 /* Type */ | 1920 /* Namespace */; - if ((node.kind === 75 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 194 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { + if ((node.kind === 75 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 195 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -67013,7 +67412,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 290 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 291 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -67041,12 +67440,12 @@ var ts; } } function getExternalModuleFileFromDeclaration(declaration) { - var specifier = declaration.kind === 249 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); + var specifier = declaration.kind === 250 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, /*moduleNotFoundError*/ undefined); // TODO: GH#18217 if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 290 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 291 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -67238,14 +67637,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 161 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 162 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 163 /* GetAccessor */ || node.kind === 164 /* SetAccessor */) { + else if (node.kind === 164 /* GetAccessor */ || node.kind === 165 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -67262,17 +67661,17 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 138 /* ReadonlyKeyword */) { - if (node.kind === 158 /* PropertySignature */ || node.kind === 160 /* MethodSignature */) { + if (modifier.kind !== 139 /* ReadonlyKeyword */) { + if (node.kind === 159 /* PropertySignature */ || node.kind === 161 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 167 /* IndexSignature */) { + if (node.kind === 168 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 81 /* ConstKeyword */: - if (node.kind !== 248 /* EnumDeclaration */) { + if (node.kind !== 249 /* EnumDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(81 /* ConstKeyword */)); } break; @@ -67292,7 +67691,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { + else if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -67318,10 +67717,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { + else if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 156 /* Parameter */) { + else if (node.kind === 157 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -67333,11 +67732,11 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 159 /* PropertyDeclaration */ && node.kind !== 158 /* PropertySignature */ && node.kind !== 167 /* IndexSignature */ && node.kind !== 156 /* Parameter */) { + else if (node.kind !== 160 /* PropertyDeclaration */ && node.kind !== 159 /* PropertySignature */ && node.kind !== 168 /* IndexSignature */ && node.kind !== 157 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -67360,19 +67759,19 @@ var ts; else if (ts.isClassLike(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 156 /* Parameter */) { + else if (node.kind === 157 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; case 84 /* DefaultKeyword */: - var container = node.parent.kind === 290 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 249 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 291 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 250 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512 /* Default */; break; - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: if (flags & 2 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } @@ -67382,10 +67781,10 @@ var ts; else if (ts.isClassLike(node.parent) && !ts.isPropertyDeclaration(node)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 156 /* Parameter */) { + else if (node.kind === 157 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 250 /* ModuleBlock */) { + else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 251 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } else if (ts.isPrivateIdentifierPropertyDeclaration(node)) { @@ -67398,14 +67797,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 245 /* ClassDeclaration */) { - if (node.kind !== 161 /* MethodDeclaration */ && - node.kind !== 159 /* PropertyDeclaration */ && - node.kind !== 163 /* GetAccessor */ && - node.kind !== 164 /* SetAccessor */) { + if (node.kind !== 246 /* ClassDeclaration */) { + if (node.kind !== 162 /* MethodDeclaration */ && + node.kind !== 160 /* PropertyDeclaration */ && + node.kind !== 164 /* GetAccessor */ && + node.kind !== 165 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 245 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { + if (!(node.parent.kind === 246 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -67427,7 +67826,7 @@ var ts; else if (flags & 2 /* Ambient */ || node.parent.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 156 /* Parameter */) { + else if (node.kind === 157 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256 /* Async */; @@ -67435,7 +67834,7 @@ var ts; break; } } - if (node.kind === 162 /* Constructor */) { + if (node.kind === 163 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -67450,13 +67849,13 @@ var ts; } return false; } - else if ((node.kind === 254 /* ImportDeclaration */ || node.kind === 253 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 255 /* ImportDeclaration */ || node.kind === 254 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 156 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 157 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 156 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 157 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -67477,37 +67876,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 162 /* Constructor */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 167 /* IndexSignature */: - case 249 /* ModuleDeclaration */: - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 260 /* ExportDeclaration */: - case 259 /* ExportAssignment */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 156 /* Parameter */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 163 /* Constructor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 168 /* IndexSignature */: + case 250 /* ModuleDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 261 /* ExportDeclaration */: + case 260 /* ExportAssignment */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 157 /* Parameter */: return false; default: - if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { + if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { return false; } switch (node.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 126 /* AsyncKeyword */); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 122 /* AbstractKeyword */); - case 246 /* InterfaceDeclaration */: - case 225 /* VariableStatement */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 226 /* VariableStatement */: + case 248 /* TypeAliasDeclaration */: return true; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 81 /* ConstKeyword */); default: ts.Debug.fail(); @@ -67520,10 +67919,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 161 /* MethodDeclaration */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -67638,7 +68037,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 143 /* StringKeyword */ && parameter.type.kind !== 140 /* NumberKeyword */) { + if (parameter.type.kind !== 144 /* StringKeyword */ && parameter.type.kind !== 141 /* NumberKeyword */) { var type = getTypeFromTypeNode(parameter.type); if (type.flags & 4 /* String */ || type.flags & 8 /* Number */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType)); @@ -67680,7 +68079,7 @@ var ts; if (args) { for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 215 /* OmittedExpression */) { + if (arg.kind === 216 /* OmittedExpression */) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -67757,20 +68156,20 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 154 /* ComputedPropertyName */) { + if (node.kind !== 155 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 209 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { + if (computedPropertyName.expression.kind === 210 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } return false; } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 244 /* FunctionDeclaration */ || - node.kind === 201 /* FunctionExpression */ || - node.kind === 161 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 245 /* FunctionDeclaration */ || + node.kind === 202 /* FunctionExpression */ || + node.kind === 162 /* MethodDeclaration */); if (node.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -67789,7 +68188,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 283 /* SpreadAssignment */) { + if (prop.kind === 284 /* SpreadAssignment */) { if (inDestructuring) { // a rest property cannot be destructured any further var expression = ts.skipParentheses(prop.expression); @@ -67800,11 +68199,11 @@ var ts; continue; } var name = prop.name; - if (name.kind === 154 /* ComputedPropertyName */) { + if (name.kind === 155 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name); } - if (prop.kind === 282 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 283 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); @@ -67817,7 +68216,7 @@ var ts; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { // TODO: GH#19955 var mod = _c[_b]; - if (mod.kind !== 126 /* AsyncKeyword */ || prop.kind !== 161 /* MethodDeclaration */) { + if (mod.kind !== 126 /* AsyncKeyword */ || prop.kind !== 162 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -67832,10 +68231,10 @@ var ts; // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; switch (prop.kind) { - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); // falls through - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8 /* NumericLiteral */) { @@ -67843,13 +68242,13 @@ var ts; } currentKind = 4 /* PropertyAssignment */; break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: currentKind = 8 /* Method */; break; - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: currentKind = 1 /* GetAccessor */; break; - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: currentKind = 2 /* SetAccessor */; break; default: @@ -67888,7 +68287,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 275 /* JsxSpreadAttribute */) { + if (attr.kind === 276 /* JsxSpreadAttribute */) { continue; } var name = attr.name, initializer = attr.initializer; @@ -67898,7 +68297,7 @@ var ts; else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 276 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 277 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -67912,14 +68311,14 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 232 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 233 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 32768 /* AwaitContext */) === 0 /* None */) { // use of 'for-await-of' in non-async function var sourceFile = ts.getSourceFileOfNode(forInOrOfStatement); if (!hasParseDiagnostics(sourceFile)) { var diagnostic = ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); var func = ts.getContainingFunction(forInOrOfStatement); - if (func && func.kind !== 162 /* Constructor */) { + if (func && func.kind !== 163 /* Constructor */) { ts.Debug.assert((ts.getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function."); var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); @@ -67930,7 +68329,7 @@ var ts; return false; } } - if (forInOrOfStatement.initializer.kind === 243 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 244 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -67945,20 +68344,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 232 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 232 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 232 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -67983,11 +68382,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, accessor.kind === 163 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, accessor.kind === 164 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - if (accessor.kind === 164 /* SetAccessor */) { + if (accessor.kind === 165 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -68009,21 +68408,21 @@ var ts; * A set accessor has one parameter or a `this` parameter and one more parameter. */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 163 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 164 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 163 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 164 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 147 /* UniqueKeyword */) { - if (node.type.kind !== 144 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(144 /* SymbolKeyword */)); + if (node.operator === 148 /* UniqueKeyword */) { + if (node.type.kind !== 145 /* SymbolKeyword */) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(145 /* SymbolKeyword */)); } var parent = ts.walkUpParenthesizedTypes(node.parent); switch (parent.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: var decl = parent; if (decl.name.kind !== 75 /* Identifier */) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -68035,13 +68434,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: if (!ts.hasModifier(parent, 32 /* Static */) || !ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: if (!ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -68050,9 +68449,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_not_allowed_here); } } - else if (node.operator === 138 /* ReadonlyKeyword */) { - if (node.type.kind !== 174 /* ArrayType */ && node.type.kind !== 175 /* TupleType */) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(144 /* SymbolKeyword */)); + else if (node.operator === 139 /* ReadonlyKeyword */) { + if (node.type.kind !== 175 /* ArrayType */ && node.type.kind !== 176 /* TupleType */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(145 /* SymbolKeyword */)); } } } @@ -68065,8 +68464,8 @@ var ts; if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 161 /* MethodDeclaration */) { - if (node.parent.kind === 193 /* ObjectLiteralExpression */) { + if (node.kind === 162 /* MethodDeclaration */) { + if (node.parent.kind === 194 /* ObjectLiteralExpression */) { // We only disallow modifier on a method declaration if it is a property of object-literal-expression if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 126 /* AsyncKeyword */)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -68094,14 +68493,14 @@ var ts; if (node.flags & 8388608 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.kind === 161 /* MethodDeclaration */ && !node.body) { + else if (node.kind === 162 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 246 /* InterfaceDeclaration */) { + else if (node.parent.kind === 247 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 173 /* TypeLiteral */) { + else if (node.parent.kind === 174 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -68112,11 +68511,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 233 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 234 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -68124,8 +68523,8 @@ var ts; return false; } break; - case 237 /* SwitchStatement */: - if (node.kind === 234 /* BreakStatement */ && !node.label) { + case 238 /* SwitchStatement */: + if (node.kind === 235 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -68140,13 +68539,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 234 /* BreakStatement */ + var message = node.kind === 235 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 234 /* BreakStatement */ + var message = node.kind === 235 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -68170,12 +68569,12 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return ts.isStringOrNumericLiteralLike(expr) || - expr.kind === 207 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 208 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function isBigIntLiteralExpression(expr) { return expr.kind === 9 /* BigIntLiteral */ || - expr.kind === 207 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 208 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */; } function isSimpleLiteralEnumReference(expr) { @@ -68206,7 +68605,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 231 /* ForInStatement */ && node.parent.parent.kind !== 232 /* ForOfStatement */) { + if (node.parent.parent.kind !== 232 /* ForInStatement */ && node.parent.parent.kind !== 233 /* ForOfStatement */) { if (node.flags & 8388608 /* Ambient */) { checkAmbientInitializer(node); } @@ -68219,7 +68618,7 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 225 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { + if (node.exclamationToken && (node.parent.parent.kind !== 226 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation); } var moduleKind = ts.getEmitModuleKind(compilerOptions); @@ -68282,15 +68681,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 227 /* IfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 236 /* WithStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 228 /* IfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 237 /* WithStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: return false; - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -68374,7 +68773,7 @@ var ts; return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } } - else if (node.parent.kind === 246 /* InterfaceDeclaration */) { + else if (node.parent.kind === 247 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -68382,7 +68781,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 173 /* TypeLiteral */) { + else if (node.parent.kind === 174 /* TypeLiteral */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -68411,13 +68810,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 246 /* InterfaceDeclaration */ || - node.kind === 247 /* TypeAliasDeclaration */ || - node.kind === 254 /* ImportDeclaration */ || - node.kind === 253 /* ImportEqualsDeclaration */ || - node.kind === 260 /* ExportDeclaration */ || - node.kind === 259 /* ExportAssignment */ || - node.kind === 252 /* NamespaceExportDeclaration */ || + if (node.kind === 247 /* InterfaceDeclaration */ || + node.kind === 248 /* TypeAliasDeclaration */ || + node.kind === 255 /* ImportDeclaration */ || + node.kind === 254 /* ImportEqualsDeclaration */ || + node.kind === 261 /* ExportDeclaration */ || + node.kind === 260 /* ExportAssignment */ || + node.kind === 253 /* NamespaceExportDeclaration */ || ts.hasModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -68426,7 +68825,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 225 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 226 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -68449,7 +68848,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 223 /* Block */ || node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { + if (node.parent.kind === 224 /* Block */ || node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { var links_2 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_2.hasReportedStatementInAmbientContext) { @@ -68471,10 +68870,10 @@ var ts; if (languageVersion >= 1 /* ES5 */) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 187 /* LiteralType */)) { + else if (ts.isChildOfNodeWithKind(node, 188 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 284 /* EnumMember */)) { + else if (ts.isChildOfNodeWithKind(node, 285 /* EnumMember */)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -68649,14 +69048,14 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 244 /* FunctionDeclaration */ && declaration.kind !== 161 /* MethodDeclaration */) || + return (declaration.kind !== 245 /* FunctionDeclaration */ && declaration.kind !== 162 /* MethodDeclaration */) || !!declaration.body; } /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */ function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return ts.isIdentifier(name); default: return ts.isDeclarationName(name); @@ -68664,14 +69063,14 @@ var ts; } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 255 /* ImportClause */: // For default import - case 253 /* ImportEqualsDeclaration */: - case 256 /* NamespaceImport */: - case 258 /* ImportSpecifier */: // For rename import `x as y` + case 256 /* ImportClause */: // For default import + case 254 /* ImportEqualsDeclaration */: + case 257 /* NamespaceImport */: + case 259 /* ImportSpecifier */: // For rename import `x as y` return true; case 75 /* Identifier */: // For regular import, `decl` is an Identifier under the ImportSpecifier. - return decl.parent.kind === 258 /* ImportSpecifier */; + return decl.parent.kind === 259 /* ImportSpecifier */; default: return false; } @@ -68934,7 +69333,7 @@ var ts; result.push(createModifier(89 /* ExportKeyword */)); } if (flags & 2 /* Ambient */) { - result.push(createModifier(130 /* DeclareKeyword */)); + result.push(createModifier(131 /* DeclareKeyword */)); } if (flags & 512 /* Default */) { result.push(createModifier(84 /* DefaultKeyword */)); @@ -68958,7 +69357,7 @@ var ts; result.push(createModifier(120 /* StaticKeyword */)); } if (flags & 64 /* Readonly */) { - result.push(createModifier(138 /* ReadonlyKeyword */)); + result.push(createModifier(139 /* ReadonlyKeyword */)); } if (flags & 256 /* Async */) { result.push(createModifier(126 /* AsyncKeyword */)); @@ -68968,7 +69367,7 @@ var ts; ts.createModifiersFromModifierFlags = createModifiersFromModifierFlags; // Names function createQualifiedName(left, right) { - var node = createSynthesizedNode(153 /* QualifiedName */); + var node = createSynthesizedNode(154 /* QualifiedName */); node.left = left; node.right = asName(right); return node; @@ -68987,7 +69386,7 @@ var ts; : expression; } function createComputedPropertyName(expression) { - var node = createSynthesizedNode(154 /* ComputedPropertyName */); + var node = createSynthesizedNode(155 /* ComputedPropertyName */); node.expression = parenthesizeForComputedName(expression); return node; } @@ -69000,7 +69399,7 @@ var ts; ts.updateComputedPropertyName = updateComputedPropertyName; // Signature elements function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createSynthesizedNode(155 /* TypeParameter */); + var node = createSynthesizedNode(156 /* TypeParameter */); node.name = asName(name); node.constraint = constraint; node.default = defaultType; @@ -69016,7 +69415,7 @@ var ts; } ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createSynthesizedNode(156 /* Parameter */); + var node = createSynthesizedNode(157 /* Parameter */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; @@ -69040,7 +69439,7 @@ var ts; } ts.updateParameter = updateParameter; function createDecorator(expression) { - var node = createSynthesizedNode(157 /* Decorator */); + var node = createSynthesizedNode(158 /* Decorator */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -69053,7 +69452,7 @@ var ts; ts.updateDecorator = updateDecorator; // Type Elements function createPropertySignature(modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(158 /* PropertySignature */); + var node = createSynthesizedNode(159 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -69073,7 +69472,7 @@ var ts; } ts.updatePropertySignature = updatePropertySignature; function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - var node = createSynthesizedNode(159 /* PropertyDeclaration */); + var node = createSynthesizedNode(160 /* PropertyDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69097,7 +69496,7 @@ var ts; } ts.updateProperty = updateProperty; function createMethodSignature(typeParameters, parameters, type, name, questionToken) { - var node = createSignatureDeclaration(160 /* MethodSignature */, typeParameters, parameters, type); + var node = createSignatureDeclaration(161 /* MethodSignature */, typeParameters, parameters, type); node.name = asName(name); node.questionToken = questionToken; return node; @@ -69114,7 +69513,7 @@ var ts; } ts.updateMethodSignature = updateMethodSignature; function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(161 /* MethodDeclaration */); + var node = createSynthesizedNode(162 /* MethodDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -69174,7 +69573,7 @@ var ts; } ts.updateMethod = updateMethod; function createConstructor(decorators, modifiers, parameters, body) { - var node = createSynthesizedNode(162 /* Constructor */); + var node = createSynthesizedNode(163 /* Constructor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; @@ -69194,7 +69593,7 @@ var ts; } ts.updateConstructor = updateConstructor; function createGetAccessor(decorators, modifiers, name, parameters, type, body) { - var node = createSynthesizedNode(163 /* GetAccessor */); + var node = createSynthesizedNode(164 /* GetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69217,7 +69616,7 @@ var ts; } ts.updateGetAccessor = updateGetAccessor; function createSetAccessor(decorators, modifiers, name, parameters, body) { - var node = createSynthesizedNode(164 /* SetAccessor */); + var node = createSynthesizedNode(165 /* SetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69238,7 +69637,7 @@ var ts; } ts.updateSetAccessor = updateSetAccessor; function createCallSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(165 /* CallSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(166 /* CallSignature */, typeParameters, parameters, type); } ts.createCallSignature = createCallSignature; function updateCallSignature(node, typeParameters, parameters, type) { @@ -69246,7 +69645,7 @@ var ts; } ts.updateCallSignature = updateCallSignature; function createConstructSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(166 /* ConstructSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(167 /* ConstructSignature */, typeParameters, parameters, type); } ts.createConstructSignature = createConstructSignature; function updateConstructSignature(node, typeParameters, parameters, type) { @@ -69254,7 +69653,7 @@ var ts; } ts.updateConstructSignature = updateConstructSignature; function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createSynthesizedNode(167 /* IndexSignature */); + var node = createSynthesizedNode(168 /* IndexSignature */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); @@ -69298,7 +69697,7 @@ var ts; } ts.createTypePredicateNode = createTypePredicateNode; function createTypePredicateNodeWithModifier(assertsModifier, parameterName, type) { - var node = createSynthesizedNode(168 /* TypePredicate */); + var node = createSynthesizedNode(169 /* TypePredicate */); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); node.type = type; @@ -69318,7 +69717,7 @@ var ts; } ts.updateTypePredicateNodeWithModifier = updateTypePredicateNodeWithModifier; function createTypeReferenceNode(typeName, typeArguments) { - var node = createSynthesizedNode(169 /* TypeReference */); + var node = createSynthesizedNode(170 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments); return node; @@ -69332,7 +69731,7 @@ var ts; } ts.updateTypeReferenceNode = updateTypeReferenceNode; function createFunctionTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(170 /* FunctionType */, typeParameters, parameters, type); + return createSignatureDeclaration(171 /* FunctionType */, typeParameters, parameters, type); } ts.createFunctionTypeNode = createFunctionTypeNode; function updateFunctionTypeNode(node, typeParameters, parameters, type) { @@ -69340,7 +69739,7 @@ var ts; } ts.updateFunctionTypeNode = updateFunctionTypeNode; function createConstructorTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(171 /* ConstructorType */, typeParameters, parameters, type); + return createSignatureDeclaration(172 /* ConstructorType */, typeParameters, parameters, type); } ts.createConstructorTypeNode = createConstructorTypeNode; function updateConstructorTypeNode(node, typeParameters, parameters, type) { @@ -69348,7 +69747,7 @@ var ts; } ts.updateConstructorTypeNode = updateConstructorTypeNode; function createTypeQueryNode(exprName) { - var node = createSynthesizedNode(172 /* TypeQuery */); + var node = createSynthesizedNode(173 /* TypeQuery */); node.exprName = exprName; return node; } @@ -69360,7 +69759,7 @@ var ts; } ts.updateTypeQueryNode = updateTypeQueryNode; function createTypeLiteralNode(members) { - var node = createSynthesizedNode(173 /* TypeLiteral */); + var node = createSynthesizedNode(174 /* TypeLiteral */); node.members = createNodeArray(members); return node; } @@ -69372,7 +69771,7 @@ var ts; } ts.updateTypeLiteralNode = updateTypeLiteralNode; function createArrayTypeNode(elementType) { - var node = createSynthesizedNode(174 /* ArrayType */); + var node = createSynthesizedNode(175 /* ArrayType */); node.elementType = ts.parenthesizeArrayTypeMember(elementType); return node; } @@ -69384,7 +69783,7 @@ var ts; } ts.updateArrayTypeNode = updateArrayTypeNode; function createTupleTypeNode(elementTypes) { - var node = createSynthesizedNode(175 /* TupleType */); + var node = createSynthesizedNode(176 /* TupleType */); node.elementTypes = createNodeArray(elementTypes); return node; } @@ -69396,7 +69795,7 @@ var ts; } ts.updateTupleTypeNode = updateTupleTypeNode; function createOptionalTypeNode(type) { - var node = createSynthesizedNode(176 /* OptionalType */); + var node = createSynthesizedNode(177 /* OptionalType */); node.type = ts.parenthesizeArrayTypeMember(type); return node; } @@ -69408,7 +69807,7 @@ var ts; } ts.updateOptionalTypeNode = updateOptionalTypeNode; function createRestTypeNode(type) { - var node = createSynthesizedNode(177 /* RestType */); + var node = createSynthesizedNode(178 /* RestType */); node.type = type; return node; } @@ -69420,7 +69819,7 @@ var ts; } ts.updateRestTypeNode = updateRestTypeNode; function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(178 /* UnionType */, types); + return createUnionOrIntersectionTypeNode(179 /* UnionType */, types); } ts.createUnionTypeNode = createUnionTypeNode; function updateUnionTypeNode(node, types) { @@ -69428,7 +69827,7 @@ var ts; } ts.updateUnionTypeNode = updateUnionTypeNode; function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(179 /* IntersectionType */, types); + return createUnionOrIntersectionTypeNode(180 /* IntersectionType */, types); } ts.createIntersectionTypeNode = createIntersectionTypeNode; function updateIntersectionTypeNode(node, types) { @@ -69447,7 +69846,7 @@ var ts; : node; } function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - var node = createSynthesizedNode(180 /* ConditionalType */); + var node = createSynthesizedNode(181 /* ConditionalType */); node.checkType = ts.parenthesizeConditionalTypeMember(checkType); node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType); node.trueType = trueType; @@ -69465,7 +69864,7 @@ var ts; } ts.updateConditionalTypeNode = updateConditionalTypeNode; function createInferTypeNode(typeParameter) { - var node = createSynthesizedNode(181 /* InferType */); + var node = createSynthesizedNode(182 /* InferType */); node.typeParameter = typeParameter; return node; } @@ -69477,7 +69876,7 @@ var ts; } ts.updateInferTypeNode = updateInferTypeNode; function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) { - var node = createSynthesizedNode(188 /* ImportType */); + var node = createSynthesizedNode(189 /* ImportType */); node.argument = argument; node.qualifier = qualifier; node.typeArguments = ts.parenthesizeTypeParameters(typeArguments); @@ -69495,7 +69894,7 @@ var ts; } ts.updateImportTypeNode = updateImportTypeNode; function createParenthesizedType(type) { - var node = createSynthesizedNode(182 /* ParenthesizedType */); + var node = createSynthesizedNode(183 /* ParenthesizedType */); node.type = type; return node; } @@ -69507,12 +69906,12 @@ var ts; } ts.updateParenthesizedType = updateParenthesizedType; function createThisTypeNode() { - return createSynthesizedNode(183 /* ThisType */); + return createSynthesizedNode(184 /* ThisType */); } ts.createThisTypeNode = createThisTypeNode; function createTypeOperatorNode(operatorOrType, type) { - var node = createSynthesizedNode(184 /* TypeOperator */); - node.operator = typeof operatorOrType === "number" ? operatorOrType : 134 /* KeyOfKeyword */; + var node = createSynthesizedNode(185 /* TypeOperator */); + node.operator = typeof operatorOrType === "number" ? operatorOrType : 135 /* KeyOfKeyword */; node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); return node; } @@ -69522,7 +69921,7 @@ var ts; } ts.updateTypeOperatorNode = updateTypeOperatorNode; function createIndexedAccessTypeNode(objectType, indexType) { - var node = createSynthesizedNode(185 /* IndexedAccessType */); + var node = createSynthesizedNode(186 /* IndexedAccessType */); node.objectType = ts.parenthesizeElementTypeMember(objectType); node.indexType = indexType; return node; @@ -69536,7 +69935,7 @@ var ts; } ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { - var node = createSynthesizedNode(186 /* MappedType */); + var node = createSynthesizedNode(187 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.questionToken = questionToken; @@ -69554,7 +69953,7 @@ var ts; } ts.updateMappedTypeNode = updateMappedTypeNode; function createLiteralTypeNode(literal) { - var node = createSynthesizedNode(187 /* LiteralType */); + var node = createSynthesizedNode(188 /* LiteralType */); node.literal = literal; return node; } @@ -69567,7 +69966,7 @@ var ts; ts.updateLiteralTypeNode = updateLiteralTypeNode; // Binding Patterns function createObjectBindingPattern(elements) { - var node = createSynthesizedNode(189 /* ObjectBindingPattern */); + var node = createSynthesizedNode(190 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -69579,7 +69978,7 @@ var ts; } ts.updateObjectBindingPattern = updateObjectBindingPattern; function createArrayBindingPattern(elements) { - var node = createSynthesizedNode(190 /* ArrayBindingPattern */); + var node = createSynthesizedNode(191 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -69591,7 +69990,7 @@ var ts; } ts.updateArrayBindingPattern = updateArrayBindingPattern; function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createSynthesizedNode(191 /* BindingElement */); + var node = createSynthesizedNode(192 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -69610,7 +70009,7 @@ var ts; ts.updateBindingElement = updateBindingElement; // Expression function createArrayLiteral(elements, multiLine) { - var node = createSynthesizedNode(192 /* ArrayLiteralExpression */); + var node = createSynthesizedNode(193 /* ArrayLiteralExpression */); node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) node.multiLine = true; @@ -69624,7 +70023,7 @@ var ts; } ts.updateArrayLiteral = updateArrayLiteral; function createObjectLiteral(properties, multiLine) { - var node = createSynthesizedNode(193 /* ObjectLiteralExpression */); + var node = createSynthesizedNode(194 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); if (multiLine) node.multiLine = true; @@ -69638,7 +70037,7 @@ var ts; } ts.updateObjectLiteral = updateObjectLiteral; function createPropertyAccess(expression, name) { - var node = createSynthesizedNode(194 /* PropertyAccessExpression */); + var node = createSynthesizedNode(195 /* PropertyAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.name = asName(name); setEmitFlags(node, 131072 /* NoIndentation */); @@ -69660,7 +70059,7 @@ var ts; } ts.updatePropertyAccess = updatePropertyAccess; function createPropertyAccessChain(expression, questionDotToken, name) { - var node = createSynthesizedNode(194 /* PropertyAccessExpression */); + var node = createSynthesizedNode(195 /* PropertyAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -69681,7 +70080,7 @@ var ts; } ts.updatePropertyAccessChain = updatePropertyAccessChain; function createElementAccess(expression, index) { - var node = createSynthesizedNode(195 /* ElementAccessExpression */); + var node = createSynthesizedNode(196 /* ElementAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.argumentExpression = asExpression(index); return node; @@ -69698,7 +70097,7 @@ var ts; } ts.updateElementAccess = updateElementAccess; function createElementAccessChain(expression, questionDotToken, index) { - var node = createSynthesizedNode(195 /* ElementAccessExpression */); + var node = createSynthesizedNode(196 /* ElementAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -69716,7 +70115,7 @@ var ts; } ts.updateElementAccessChain = updateElementAccessChain; function createCall(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(196 /* CallExpression */); + var node = createSynthesizedNode(197 /* CallExpression */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); @@ -69735,7 +70134,7 @@ var ts; } ts.updateCall = updateCall; function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { - var node = createSynthesizedNode(196 /* CallExpression */); + var node = createSynthesizedNode(197 /* CallExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -69755,7 +70154,7 @@ var ts; } ts.updateCallChain = updateCallChain; function createNew(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(197 /* NewExpression */); + var node = createSynthesizedNode(198 /* NewExpression */); node.expression = ts.parenthesizeForNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; @@ -69771,7 +70170,7 @@ var ts; } ts.updateNew = updateNew; function createTaggedTemplate(tag, typeArgumentsOrTemplate, template) { - var node = createSynthesizedNode(198 /* TaggedTemplateExpression */); + var node = createSynthesizedNode(199 /* TaggedTemplateExpression */); node.tag = ts.parenthesizeForAccess(tag); if (template) { node.typeArguments = asNodeArray(typeArgumentsOrTemplate); @@ -69794,7 +70193,7 @@ var ts; } ts.updateTaggedTemplate = updateTaggedTemplate; function createTypeAssertion(type, expression) { - var node = createSynthesizedNode(199 /* TypeAssertionExpression */); + var node = createSynthesizedNode(200 /* TypeAssertionExpression */); node.type = type; node.expression = ts.parenthesizePrefixOperand(expression); return node; @@ -69808,7 +70207,7 @@ var ts; } ts.updateTypeAssertion = updateTypeAssertion; function createParen(expression) { - var node = createSynthesizedNode(200 /* ParenthesizedExpression */); + var node = createSynthesizedNode(201 /* ParenthesizedExpression */); node.expression = expression; return node; } @@ -69820,7 +70219,7 @@ var ts; } ts.updateParen = updateParen; function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(201 /* FunctionExpression */); + var node = createSynthesizedNode(202 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -69844,7 +70243,7 @@ var ts; } ts.updateFunctionExpression = updateFunctionExpression; function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createSynthesizedNode(202 /* ArrowFunction */); + var node = createSynthesizedNode(203 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -69866,7 +70265,7 @@ var ts; } ts.updateArrowFunction = updateArrowFunction; function createDelete(expression) { - var node = createSynthesizedNode(203 /* DeleteExpression */); + var node = createSynthesizedNode(204 /* DeleteExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -69878,7 +70277,7 @@ var ts; } ts.updateDelete = updateDelete; function createTypeOf(expression) { - var node = createSynthesizedNode(204 /* TypeOfExpression */); + var node = createSynthesizedNode(205 /* TypeOfExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -69890,7 +70289,7 @@ var ts; } ts.updateTypeOf = updateTypeOf; function createVoid(expression) { - var node = createSynthesizedNode(205 /* VoidExpression */); + var node = createSynthesizedNode(206 /* VoidExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -69902,7 +70301,7 @@ var ts; } ts.updateVoid = updateVoid; function createAwait(expression) { - var node = createSynthesizedNode(206 /* AwaitExpression */); + var node = createSynthesizedNode(207 /* AwaitExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -69914,7 +70313,7 @@ var ts; } ts.updateAwait = updateAwait; function createPrefix(operator, operand) { - var node = createSynthesizedNode(207 /* PrefixUnaryExpression */); + var node = createSynthesizedNode(208 /* PrefixUnaryExpression */); node.operator = operator; node.operand = ts.parenthesizePrefixOperand(operand); return node; @@ -69927,7 +70326,7 @@ var ts; } ts.updatePrefix = updatePrefix; function createPostfix(operand, operator) { - var node = createSynthesizedNode(208 /* PostfixUnaryExpression */); + var node = createSynthesizedNode(209 /* PostfixUnaryExpression */); node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; @@ -69940,7 +70339,7 @@ var ts; } ts.updatePostfix = updatePostfix; function createBinary(left, operator, right) { - var node = createSynthesizedNode(209 /* BinaryExpression */); + var node = createSynthesizedNode(210 /* BinaryExpression */); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = ts.parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); @@ -69957,7 +70356,7 @@ var ts; } ts.updateBinary = updateBinary; function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - var node = createSynthesizedNode(210 /* ConditionalExpression */); + var node = createSynthesizedNode(211 /* ConditionalExpression */); node.condition = ts.parenthesizeForConditionalHead(condition); node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(57 /* QuestionToken */); node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); @@ -69977,7 +70376,7 @@ var ts; } ts.updateConditional = updateConditional; function createTemplateExpression(head, templateSpans) { - var node = createSynthesizedNode(211 /* TemplateExpression */); + var node = createSynthesizedNode(212 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; @@ -70074,7 +70473,7 @@ var ts; } ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral; function createYield(asteriskTokenOrExpression, expression) { - var node = createSynthesizedNode(212 /* YieldExpression */); + var node = createSynthesizedNode(213 /* YieldExpression */); node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 41 /* AsteriskToken */ ? asteriskTokenOrExpression : undefined; node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 41 /* AsteriskToken */ ? asteriskTokenOrExpression : expression; return node; @@ -70088,7 +70487,7 @@ var ts; } ts.updateYield = updateYield; function createSpread(expression) { - var node = createSynthesizedNode(213 /* SpreadElement */); + var node = createSynthesizedNode(214 /* SpreadElement */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -70100,7 +70499,7 @@ var ts; } ts.updateSpread = updateSpread; function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(214 /* ClassExpression */); + var node = createSynthesizedNode(215 /* ClassExpression */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70121,11 +70520,11 @@ var ts; } ts.updateClassExpression = updateClassExpression; function createOmittedExpression() { - return createSynthesizedNode(215 /* OmittedExpression */); + return createSynthesizedNode(216 /* OmittedExpression */); } ts.createOmittedExpression = createOmittedExpression; function createExpressionWithTypeArguments(typeArguments, expression) { - var node = createSynthesizedNode(216 /* ExpressionWithTypeArguments */); + var node = createSynthesizedNode(217 /* ExpressionWithTypeArguments */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); return node; @@ -70139,7 +70538,7 @@ var ts; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; function createAsExpression(expression, type) { - var node = createSynthesizedNode(217 /* AsExpression */); + var node = createSynthesizedNode(218 /* AsExpression */); node.expression = expression; node.type = type; return node; @@ -70153,7 +70552,7 @@ var ts; } ts.updateAsExpression = updateAsExpression; function createNonNullExpression(expression) { - var node = createSynthesizedNode(218 /* NonNullExpression */); + var node = createSynthesizedNode(219 /* NonNullExpression */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -70165,7 +70564,7 @@ var ts; } ts.updateNonNullExpression = updateNonNullExpression; function createMetaProperty(keywordToken, name) { - var node = createSynthesizedNode(219 /* MetaProperty */); + var node = createSynthesizedNode(220 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; return node; @@ -70179,7 +70578,7 @@ var ts; ts.updateMetaProperty = updateMetaProperty; // Misc function createTemplateSpan(expression, literal) { - var node = createSynthesizedNode(221 /* TemplateSpan */); + var node = createSynthesizedNode(222 /* TemplateSpan */); node.expression = expression; node.literal = literal; return node; @@ -70193,12 +70592,12 @@ var ts; } ts.updateTemplateSpan = updateTemplateSpan; function createSemicolonClassElement() { - return createSynthesizedNode(222 /* SemicolonClassElement */); + return createSynthesizedNode(223 /* SemicolonClassElement */); } ts.createSemicolonClassElement = createSemicolonClassElement; // Element function createBlock(statements, multiLine) { - var block = createSynthesizedNode(223 /* Block */); + var block = createSynthesizedNode(224 /* Block */); block.statements = createNodeArray(statements); if (multiLine) block.multiLine = multiLine; @@ -70212,7 +70611,7 @@ var ts; } ts.updateBlock = updateBlock; function createVariableStatement(modifiers, declarationList) { - var node = createSynthesizedNode(225 /* VariableStatement */); + var node = createSynthesizedNode(226 /* VariableStatement */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; @@ -70227,11 +70626,11 @@ var ts; } ts.updateVariableStatement = updateVariableStatement; function createEmptyStatement() { - return createSynthesizedNode(224 /* EmptyStatement */); + return createSynthesizedNode(225 /* EmptyStatement */); } ts.createEmptyStatement = createEmptyStatement; function createExpressionStatement(expression) { - var node = createSynthesizedNode(226 /* ExpressionStatement */); + var node = createSynthesizedNode(227 /* ExpressionStatement */); node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } @@ -70247,7 +70646,7 @@ var ts; /** @deprecated Use `updateExpressionStatement` instead. */ ts.updateStatement = updateExpressionStatement; function createIf(expression, thenStatement, elseStatement) { - var node = createSynthesizedNode(227 /* IfStatement */); + var node = createSynthesizedNode(228 /* IfStatement */); node.expression = expression; node.thenStatement = asEmbeddedStatement(thenStatement); node.elseStatement = asEmbeddedStatement(elseStatement); @@ -70263,7 +70662,7 @@ var ts; } ts.updateIf = updateIf; function createDo(statement, expression) { - var node = createSynthesizedNode(228 /* DoStatement */); + var node = createSynthesizedNode(229 /* DoStatement */); node.statement = asEmbeddedStatement(statement); node.expression = expression; return node; @@ -70277,7 +70676,7 @@ var ts; } ts.updateDo = updateDo; function createWhile(expression, statement) { - var node = createSynthesizedNode(229 /* WhileStatement */); + var node = createSynthesizedNode(230 /* WhileStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -70291,7 +70690,7 @@ var ts; } ts.updateWhile = updateWhile; function createFor(initializer, condition, incrementor, statement) { - var node = createSynthesizedNode(230 /* ForStatement */); + var node = createSynthesizedNode(231 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -70309,7 +70708,7 @@ var ts; } ts.updateFor = updateFor; function createForIn(initializer, expression, statement) { - var node = createSynthesizedNode(231 /* ForInStatement */); + var node = createSynthesizedNode(232 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = asEmbeddedStatement(statement); @@ -70325,7 +70724,7 @@ var ts; } ts.updateForIn = updateForIn; function createForOf(awaitModifier, initializer, expression, statement) { - var node = createSynthesizedNode(232 /* ForOfStatement */); + var node = createSynthesizedNode(233 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = ts.isCommaSequence(expression) ? createParen(expression) : expression; @@ -70343,7 +70742,7 @@ var ts; } ts.updateForOf = updateForOf; function createContinue(label) { - var node = createSynthesizedNode(233 /* ContinueStatement */); + var node = createSynthesizedNode(234 /* ContinueStatement */); node.label = asName(label); return node; } @@ -70355,7 +70754,7 @@ var ts; } ts.updateContinue = updateContinue; function createBreak(label) { - var node = createSynthesizedNode(234 /* BreakStatement */); + var node = createSynthesizedNode(235 /* BreakStatement */); node.label = asName(label); return node; } @@ -70367,7 +70766,7 @@ var ts; } ts.updateBreak = updateBreak; function createReturn(expression) { - var node = createSynthesizedNode(235 /* ReturnStatement */); + var node = createSynthesizedNode(236 /* ReturnStatement */); node.expression = expression; return node; } @@ -70379,7 +70778,7 @@ var ts; } ts.updateReturn = updateReturn; function createWith(expression, statement) { - var node = createSynthesizedNode(236 /* WithStatement */); + var node = createSynthesizedNode(237 /* WithStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -70393,7 +70792,7 @@ var ts; } ts.updateWith = updateWith; function createSwitch(expression, caseBlock) { - var node = createSynthesizedNode(237 /* SwitchStatement */); + var node = createSynthesizedNode(238 /* SwitchStatement */); node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; @@ -70407,7 +70806,7 @@ var ts; } ts.updateSwitch = updateSwitch; function createLabel(label, statement) { - var node = createSynthesizedNode(238 /* LabeledStatement */); + var node = createSynthesizedNode(239 /* LabeledStatement */); node.label = asName(label); node.statement = asEmbeddedStatement(statement); return node; @@ -70421,7 +70820,7 @@ var ts; } ts.updateLabel = updateLabel; function createThrow(expression) { - var node = createSynthesizedNode(239 /* ThrowStatement */); + var node = createSynthesizedNode(240 /* ThrowStatement */); node.expression = expression; return node; } @@ -70433,7 +70832,7 @@ var ts; } ts.updateThrow = updateThrow; function createTry(tryBlock, catchClause, finallyBlock) { - var node = createSynthesizedNode(240 /* TryStatement */); + var node = createSynthesizedNode(241 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -70449,12 +70848,12 @@ var ts; } ts.updateTry = updateTry; function createDebuggerStatement() { - return createSynthesizedNode(241 /* DebuggerStatement */); + return createSynthesizedNode(242 /* DebuggerStatement */); } ts.createDebuggerStatement = createDebuggerStatement; function createVariableDeclaration(name, type, initializer) { /* Internally, one should probably use createTypeScriptVariableDeclaration instead and handle definite assignment assertions */ - var node = createSynthesizedNode(242 /* VariableDeclaration */); + var node = createSynthesizedNode(243 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -70472,7 +70871,7 @@ var ts; ts.updateVariableDeclaration = updateVariableDeclaration; /* @internal */ function createTypeScriptVariableDeclaration(name, exclaimationToken, type, initializer) { - var node = createSynthesizedNode(242 /* VariableDeclaration */); + var node = createSynthesizedNode(243 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -70492,7 +70891,7 @@ var ts; ts.updateTypeScriptVariableDeclaration = updateTypeScriptVariableDeclaration; function createVariableDeclarationList(declarations, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(243 /* VariableDeclarationList */); + var node = createSynthesizedNode(244 /* VariableDeclarationList */); node.flags |= flags & 3 /* BlockScoped */; node.declarations = createNodeArray(declarations); return node; @@ -70505,7 +70904,7 @@ var ts; } ts.updateVariableDeclarationList = updateVariableDeclarationList; function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(244 /* FunctionDeclaration */); + var node = createSynthesizedNode(245 /* FunctionDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -70531,7 +70930,7 @@ var ts; } ts.updateFunctionDeclaration = updateFunctionDeclaration; function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(245 /* ClassDeclaration */); + var node = createSynthesizedNode(246 /* ClassDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70553,7 +70952,7 @@ var ts; } ts.updateClassDeclaration = updateClassDeclaration; function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(246 /* InterfaceDeclaration */); + var node = createSynthesizedNode(247 /* InterfaceDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70575,7 +70974,7 @@ var ts; } ts.updateInterfaceDeclaration = updateInterfaceDeclaration; function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createSynthesizedNode(247 /* TypeAliasDeclaration */); + var node = createSynthesizedNode(248 /* TypeAliasDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70595,7 +70994,7 @@ var ts; } ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration; function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createSynthesizedNode(248 /* EnumDeclaration */); + var node = createSynthesizedNode(249 /* EnumDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70614,7 +71013,7 @@ var ts; ts.updateEnumDeclaration = updateEnumDeclaration; function createModuleDeclaration(decorators, modifiers, name, body, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(249 /* ModuleDeclaration */); + var node = createSynthesizedNode(250 /* ModuleDeclaration */); node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); @@ -70633,7 +71032,7 @@ var ts; } ts.updateModuleDeclaration = updateModuleDeclaration; function createModuleBlock(statements) { - var node = createSynthesizedNode(250 /* ModuleBlock */); + var node = createSynthesizedNode(251 /* ModuleBlock */); node.statements = createNodeArray(statements); return node; } @@ -70645,7 +71044,7 @@ var ts; } ts.updateModuleBlock = updateModuleBlock; function createCaseBlock(clauses) { - var node = createSynthesizedNode(251 /* CaseBlock */); + var node = createSynthesizedNode(252 /* CaseBlock */); node.clauses = createNodeArray(clauses); return node; } @@ -70657,7 +71056,7 @@ var ts; } ts.updateCaseBlock = updateCaseBlock; function createNamespaceExportDeclaration(name) { - var node = createSynthesizedNode(252 /* NamespaceExportDeclaration */); + var node = createSynthesizedNode(253 /* NamespaceExportDeclaration */); node.name = asName(name); return node; } @@ -70669,7 +71068,7 @@ var ts; } ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration; function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createSynthesizedNode(253 /* ImportEqualsDeclaration */); + var node = createSynthesizedNode(254 /* ImportEqualsDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70687,7 +71086,7 @@ var ts; } ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createSynthesizedNode(254 /* ImportDeclaration */); + var node = createSynthesizedNode(255 /* ImportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -70706,7 +71105,7 @@ var ts; ts.updateImportDeclaration = updateImportDeclaration; function createImportClause(name, namedBindings, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(255 /* ImportClause */); + var node = createSynthesizedNode(256 /* ImportClause */); node.name = name; node.namedBindings = namedBindings; node.isTypeOnly = isTypeOnly; @@ -70722,13 +71121,13 @@ var ts; } ts.updateImportClause = updateImportClause; function createNamespaceImport(name) { - var node = createSynthesizedNode(256 /* NamespaceImport */); + var node = createSynthesizedNode(257 /* NamespaceImport */); node.name = name; return node; } ts.createNamespaceImport = createNamespaceImport; function createNamespaceExport(name) { - var node = createSynthesizedNode(262 /* NamespaceExport */); + var node = createSynthesizedNode(263 /* NamespaceExport */); node.name = name; return node; } @@ -70746,7 +71145,7 @@ var ts; } ts.updateNamespaceExport = updateNamespaceExport; function createNamedImports(elements) { - var node = createSynthesizedNode(257 /* NamedImports */); + var node = createSynthesizedNode(258 /* NamedImports */); node.elements = createNodeArray(elements); return node; } @@ -70758,7 +71157,7 @@ var ts; } ts.updateNamedImports = updateNamedImports; function createImportSpecifier(propertyName, name) { - var node = createSynthesizedNode(258 /* ImportSpecifier */); + var node = createSynthesizedNode(259 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; return node; @@ -70772,7 +71171,7 @@ var ts; } ts.updateImportSpecifier = updateImportSpecifier; function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createSynthesizedNode(259 /* ExportAssignment */); + var node = createSynthesizedNode(260 /* ExportAssignment */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -70790,7 +71189,7 @@ var ts; ts.updateExportAssignment = updateExportAssignment; function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(260 /* ExportDeclaration */); + var node = createSynthesizedNode(261 /* ExportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isTypeOnly = isTypeOnly; @@ -70815,7 +71214,7 @@ var ts; } ts.createEmptyExports = createEmptyExports; function createNamedExports(elements) { - var node = createSynthesizedNode(261 /* NamedExports */); + var node = createSynthesizedNode(262 /* NamedExports */); node.elements = createNodeArray(elements); return node; } @@ -70827,7 +71226,7 @@ var ts; } ts.updateNamedExports = updateNamedExports; function createExportSpecifier(propertyName, name) { - var node = createSynthesizedNode(263 /* ExportSpecifier */); + var node = createSynthesizedNode(264 /* ExportSpecifier */); node.propertyName = asName(propertyName); node.name = asName(name); return node; @@ -70842,7 +71241,7 @@ var ts; ts.updateExportSpecifier = updateExportSpecifier; // Module references function createExternalModuleReference(expression) { - var node = createSynthesizedNode(265 /* ExternalModuleReference */); + var node = createSynthesizedNode(266 /* ExternalModuleReference */); node.expression = expression; return node; } @@ -70856,14 +71255,14 @@ var ts; // JSDoc /* @internal */ function createJSDocTypeExpression(type) { - var node = createSynthesizedNode(294 /* JSDocTypeExpression */); + var node = createSynthesizedNode(295 /* JSDocTypeExpression */); node.type = type; return node; } ts.createJSDocTypeExpression = createJSDocTypeExpression; /* @internal */ function createJSDocTypeTag(typeExpression, comment) { - var tag = createJSDocTag(320 /* JSDocTypeTag */, "type"); + var tag = createJSDocTag(321 /* JSDocTypeTag */, "type"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -70871,7 +71270,7 @@ var ts; ts.createJSDocTypeTag = createJSDocTypeTag; /* @internal */ function createJSDocReturnTag(typeExpression, comment) { - var tag = createJSDocTag(318 /* JSDocReturnTag */, "returns"); + var tag = createJSDocTag(319 /* JSDocReturnTag */, "returns"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -70879,14 +71278,14 @@ var ts; ts.createJSDocReturnTag = createJSDocReturnTag; /** @internal */ function createJSDocThisTag(typeExpression) { - var tag = createJSDocTag(319 /* JSDocThisTag */, "this"); + var tag = createJSDocTag(320 /* JSDocThisTag */, "this"); tag.typeExpression = typeExpression; return tag; } ts.createJSDocThisTag = createJSDocThisTag; /* @internal */ function createJSDocParamTag(name, isBracketed, typeExpression, comment) { - var tag = createJSDocTag(317 /* JSDocParameterTag */, "param"); + var tag = createJSDocTag(318 /* JSDocParameterTag */, "param"); tag.typeExpression = typeExpression; tag.name = name; tag.isBracketed = isBracketed; @@ -70896,7 +71295,7 @@ var ts; ts.createJSDocParamTag = createJSDocParamTag; /* @internal */ function createJSDocComment(comment, tags) { - var node = createSynthesizedNode(303 /* JSDocComment */); + var node = createSynthesizedNode(304 /* JSDocComment */); node.comment = comment; node.tags = tags; return node; @@ -70910,7 +71309,7 @@ var ts; } // JSX function createJsxElement(openingElement, children, closingElement) { - var node = createSynthesizedNode(266 /* JsxElement */); + var node = createSynthesizedNode(267 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -70926,7 +71325,7 @@ var ts; } ts.updateJsxElement = updateJsxElement; function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(267 /* JsxSelfClosingElement */); + var node = createSynthesizedNode(268 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -70942,7 +71341,7 @@ var ts; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; function createJsxOpeningElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(268 /* JsxOpeningElement */); + var node = createSynthesizedNode(269 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -70958,7 +71357,7 @@ var ts; } ts.updateJsxOpeningElement = updateJsxOpeningElement; function createJsxClosingElement(tagName) { - var node = createSynthesizedNode(269 /* JsxClosingElement */); + var node = createSynthesizedNode(270 /* JsxClosingElement */); node.tagName = tagName; return node; } @@ -70970,7 +71369,7 @@ var ts; } ts.updateJsxClosingElement = updateJsxClosingElement; function createJsxFragment(openingFragment, children, closingFragment) { - var node = createSynthesizedNode(270 /* JsxFragment */); + var node = createSynthesizedNode(271 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -70992,11 +71391,11 @@ var ts; } ts.updateJsxText = updateJsxText; function createJsxOpeningFragment() { - return createSynthesizedNode(271 /* JsxOpeningFragment */); + return createSynthesizedNode(272 /* JsxOpeningFragment */); } ts.createJsxOpeningFragment = createJsxOpeningFragment; function createJsxJsxClosingFragment() { - return createSynthesizedNode(272 /* JsxClosingFragment */); + return createSynthesizedNode(273 /* JsxClosingFragment */); } ts.createJsxJsxClosingFragment = createJsxJsxClosingFragment; function updateJsxFragment(node, openingFragment, children, closingFragment) { @@ -71008,7 +71407,7 @@ var ts; } ts.updateJsxFragment = updateJsxFragment; function createJsxAttribute(name, initializer) { - var node = createSynthesizedNode(273 /* JsxAttribute */); + var node = createSynthesizedNode(274 /* JsxAttribute */); node.name = name; node.initializer = initializer; return node; @@ -71022,7 +71421,7 @@ var ts; } ts.updateJsxAttribute = updateJsxAttribute; function createJsxAttributes(properties) { - var node = createSynthesizedNode(274 /* JsxAttributes */); + var node = createSynthesizedNode(275 /* JsxAttributes */); node.properties = createNodeArray(properties); return node; } @@ -71034,7 +71433,7 @@ var ts; } ts.updateJsxAttributes = updateJsxAttributes; function createJsxSpreadAttribute(expression) { - var node = createSynthesizedNode(275 /* JsxSpreadAttribute */); + var node = createSynthesizedNode(276 /* JsxSpreadAttribute */); node.expression = expression; return node; } @@ -71046,7 +71445,7 @@ var ts; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; function createJsxExpression(dotDotDotToken, expression) { - var node = createSynthesizedNode(276 /* JsxExpression */); + var node = createSynthesizedNode(277 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; @@ -71060,7 +71459,7 @@ var ts; ts.updateJsxExpression = updateJsxExpression; // Clauses function createCaseClause(expression, statements) { - var node = createSynthesizedNode(277 /* CaseClause */); + var node = createSynthesizedNode(278 /* CaseClause */); node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; @@ -71074,7 +71473,7 @@ var ts; } ts.updateCaseClause = updateCaseClause; function createDefaultClause(statements) { - var node = createSynthesizedNode(278 /* DefaultClause */); + var node = createSynthesizedNode(279 /* DefaultClause */); node.statements = createNodeArray(statements); return node; } @@ -71086,7 +71485,7 @@ var ts; } ts.updateDefaultClause = updateDefaultClause; function createHeritageClause(token, types) { - var node = createSynthesizedNode(279 /* HeritageClause */); + var node = createSynthesizedNode(280 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); return node; @@ -71099,7 +71498,7 @@ var ts; } ts.updateHeritageClause = updateHeritageClause; function createCatchClause(variableDeclaration, block) { - var node = createSynthesizedNode(280 /* CatchClause */); + var node = createSynthesizedNode(281 /* CatchClause */); node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -71114,7 +71513,7 @@ var ts; ts.updateCatchClause = updateCatchClause; // Property assignments function createPropertyAssignment(name, initializer) { - var node = createSynthesizedNode(281 /* PropertyAssignment */); + var node = createSynthesizedNode(282 /* PropertyAssignment */); node.name = asName(name); node.questionToken = undefined; node.initializer = ts.parenthesizeExpressionForList(initializer); @@ -71129,7 +71528,7 @@ var ts; } ts.updatePropertyAssignment = updatePropertyAssignment; function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createSynthesizedNode(282 /* ShorthandPropertyAssignment */); + var node = createSynthesizedNode(283 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; @@ -71143,7 +71542,7 @@ var ts; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; function createSpreadAssignment(expression) { - var node = createSynthesizedNode(283 /* SpreadAssignment */); + var node = createSynthesizedNode(284 /* SpreadAssignment */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -71156,7 +71555,7 @@ var ts; ts.updateSpreadAssignment = updateSpreadAssignment; // Enum function createEnumMember(name, initializer) { - var node = createSynthesizedNode(284 /* EnumMember */); + var node = createSynthesizedNode(285 /* EnumMember */); node.name = asName(name); node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); return node; @@ -71177,7 +71576,7 @@ var ts; (typeReferences !== undefined && node.typeReferenceDirectives !== typeReferences) || (libReferences !== undefined && node.libReferenceDirectives !== libReferences) || (hasNoDefaultLib !== undefined && node.hasNoDefaultLib !== hasNoDefaultLib)) { - var updated = createSynthesizedNode(290 /* SourceFile */); + var updated = createSynthesizedNode(291 /* SourceFile */); updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; @@ -71261,7 +71660,7 @@ var ts; * @param original The original statement. */ function createNotEmittedStatement(original) { - var node = createSynthesizedNode(325 /* NotEmittedStatement */); + var node = createSynthesizedNode(326 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; @@ -71273,7 +71672,7 @@ var ts; */ /* @internal */ function createEndOfDeclarationMarker(original) { - var node = createSynthesizedNode(329 /* EndOfDeclarationMarker */); + var node = createSynthesizedNode(330 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -71285,7 +71684,7 @@ var ts; */ /* @internal */ function createMergeDeclarationMarker(original) { - var node = createSynthesizedNode(328 /* MergeDeclarationMarker */); + var node = createSynthesizedNode(329 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -71300,7 +71699,7 @@ var ts; * @param location The location for the expression. Defaults to the positions from "original" if provided. */ function createPartiallyEmittedExpression(expression, original) { - var node = createSynthesizedNode(326 /* PartiallyEmittedExpression */); + var node = createSynthesizedNode(327 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; setTextRange(node, original); @@ -71316,7 +71715,7 @@ var ts; ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; function flattenCommaElements(node) { if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { - if (node.kind === 327 /* CommaListExpression */) { + if (node.kind === 328 /* CommaListExpression */) { return node.elements; } if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) { @@ -71326,7 +71725,7 @@ var ts; return node; } function createCommaList(elements) { - var node = createSynthesizedNode(327 /* CommaListExpression */); + var node = createSynthesizedNode(328 /* CommaListExpression */); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); return node; } @@ -71339,7 +71738,7 @@ var ts; ts.updateCommaList = updateCommaList; /* @internal */ function createSyntheticReferenceExpression(expression, thisArg) { - var node = createSynthesizedNode(330 /* SyntheticReferenceExpression */); + var node = createSynthesizedNode(331 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; return node; @@ -71355,7 +71754,7 @@ var ts; ts.updateSyntheticReferenceExpression = updateSyntheticReferenceExpression; function createBundle(sourceFiles, prepends) { if (prepends === void 0) { prepends = ts.emptyArray; } - var node = ts.createNode(291 /* Bundle */); + var node = ts.createNode(292 /* Bundle */); node.prepends = prepends; node.sourceFiles = sourceFiles; return node; @@ -71390,7 +71789,7 @@ var ts; ], function (helper) { return helper.name; })); } function createUnparsedSource() { - var node = ts.createNode(292 /* UnparsedSource */); + var node = ts.createNode(293 /* UnparsedSource */); node.prologues = ts.emptyArray; node.referencedFiles = ts.emptyArray; node.libReferenceDirectives = ts.emptyArray; @@ -71525,10 +71924,10 @@ var ts; } function mapBundleFileSectionKindToSyntaxKind(kind) { switch (kind) { - case "prologue" /* Prologue */: return 285 /* UnparsedPrologue */; - case "prepend" /* Prepend */: return 286 /* UnparsedPrepend */; - case "internal" /* Internal */: return 288 /* UnparsedInternalText */; - case "text" /* Text */: return 287 /* UnparsedText */; + case "prologue" /* Prologue */: return 286 /* UnparsedPrologue */; + case "prepend" /* Prepend */: return 287 /* UnparsedPrepend */; + case "internal" /* Internal */: return 289 /* UnparsedInternalText */; + case "text" /* Text */: return 288 /* UnparsedText */; case "emitHelpers" /* EmitHelpers */: case "no-default-lib" /* NoDefaultLib */: case "reference" /* Reference */: @@ -71546,14 +71945,14 @@ var ts; return node; } function createUnparsedSyntheticReference(section, parent) { - var node = ts.createNode(289 /* UnparsedSyntheticReference */, section.pos, section.end); + var node = ts.createNode(290 /* UnparsedSyntheticReference */, section.pos, section.end); node.parent = parent; node.data = section.data; node.section = section; return node; } function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapTextOrBuildInfoPath, javascriptPath, declarationPath, buildInfoPath, buildInfo, oldFileOfCurrentEmit) { - var node = ts.createNode(293 /* InputFiles */); + var node = ts.createNode(294 /* InputFiles */); if (!ts.isString(javascriptTextOrReadFileText)) { var cache_1 = ts.createMap(); var textGetter_1 = function (path) { @@ -71750,7 +72149,7 @@ var ts; // To avoid holding onto transformation artifacts, we keep track of any // parse tree node we are annotating. This allows us to clean them up after // all transformations have completed. - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node))); @@ -72291,7 +72690,7 @@ var ts; if (!outermostLabeledStatement) { return node; } - var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 238 /* LabeledStatement */ + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 239 /* LabeledStatement */ ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node); if (afterRestoreLabelCallback) { @@ -72310,13 +72709,13 @@ var ts; case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: return false; - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -72343,7 +72742,7 @@ var ts; } else { switch (callee.kind) { - case 194 /* PropertyAccessExpression */: { + case 195 /* PropertyAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a.b()` target is `(_a = a).b` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -72356,7 +72755,7 @@ var ts; } break; } - case 195 /* ElementAccessExpression */: { + case 196 /* ElementAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -72416,14 +72815,14 @@ var ts; ts.Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); } switch (property.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return createExpressionForAccessorDeclaration(node.properties, property, receiver, !!node.multiLine); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return createExpressionForPropertyAssignment(property, receiver); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return createExpressionForMethodDeclaration(property, receiver); } } @@ -72749,7 +73148,7 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 200 /* ParenthesizedExpression */) { + if (skipped.kind === 201 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -72783,10 +73182,10 @@ var ts; // // If `a ** d` is on the left of operator `**`, we need to parenthesize to preserve // the intended order of operations: `(a ** b) ** c` - var binaryOperatorPrecedence = ts.getOperatorPrecedence(209 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(209 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(210 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(210 /* BinaryExpression */, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 202 /* ArrowFunction */ && binaryOperatorPrecedence > 3) { + if (!isLeftSideOfBinary && operand.kind === 203 /* ArrowFunction */ && binaryOperatorPrecedence > 3) { // We need to parenthesize arrow functions on the right side to avoid it being // parsed as parenthesized expression: `a && (() => {})` return true; @@ -72798,7 +73197,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 212 /* YieldExpression */) { + && operand.kind === 213 /* YieldExpression */) { return false; } return true; @@ -72886,7 +73285,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { + if (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -72899,7 +73298,7 @@ var ts; return 0 /* Unknown */; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(210 /* ConditionalExpression */, 57 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(211 /* ConditionalExpression */, 57 /* QuestionToken */); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) { @@ -72934,8 +73333,8 @@ var ts; var needsParens = isCommaSequence(check); if (!needsParens) { switch (getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) { - case 214 /* ClassExpression */: - case 201 /* FunctionExpression */: + case 215 /* ClassExpression */: + case 202 /* FunctionExpression */: needsParens = true; } } @@ -72951,9 +73350,9 @@ var ts; function parenthesizeForNew(expression) { var leftmostExpr = getLeftmostExpression(expression, /*stopAtCallExpressions*/ true); switch (leftmostExpr.kind) { - case 196 /* CallExpression */: + case 197 /* CallExpression */: return ts.createParen(expression); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return !leftmostExpr.arguments ? ts.createParen(expression) : expression; @@ -72976,7 +73375,7 @@ var ts; // var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 197 /* NewExpression */ || emittedExpression.arguments)) { + && (emittedExpression.kind !== 198 /* NewExpression */ || emittedExpression.arguments)) { return expression; } return ts.setTextRange(ts.createParen(expression), expression); @@ -73014,7 +73413,7 @@ var ts; function parenthesizeExpressionForList(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(209 /* BinaryExpression */, 27 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(210 /* BinaryExpression */, 27 /* CommaToken */); return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(ts.createParen(expression), expression); @@ -73025,29 +73424,29 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 201 /* FunctionExpression */ || kind === 202 /* ArrowFunction */) { + if (kind === 202 /* FunctionExpression */ || kind === 203 /* ArrowFunction */) { var mutableCall = ts.getMutableClone(emittedExpression); mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); return recreateOuterExpressions(expression, mutableCall, 4 /* PartiallyEmittedExpressions */); } } var leftmostExpressionKind = getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind; - if (leftmostExpressionKind === 193 /* ObjectLiteralExpression */ || leftmostExpressionKind === 201 /* FunctionExpression */) { + if (leftmostExpressionKind === 194 /* ObjectLiteralExpression */ || leftmostExpressionKind === 202 /* FunctionExpression */) { return ts.setTextRange(ts.createParen(expression), expression); } return expression; } ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; function parenthesizeConditionalTypeMember(member) { - return member.kind === 180 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; + return member.kind === 181 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; } ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember; function parenthesizeElementTypeMember(member) { switch (member.kind) { - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: return ts.createParenthesizedType(member); } return parenthesizeConditionalTypeMember(member); @@ -73055,9 +73454,9 @@ var ts; ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember; function parenthesizeArrayTypeMember(member) { switch (member.kind) { - case 172 /* TypeQuery */: - case 184 /* TypeOperator */: - case 181 /* InferType */: + case 173 /* TypeQuery */: + case 185 /* TypeOperator */: + case 182 /* InferType */: return ts.createParenthesizedType(member); } return parenthesizeElementTypeMember(member); @@ -73083,28 +73482,28 @@ var ts; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: node = node.operand; continue; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: node = node.left; continue; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: node = node.condition; continue; - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: node = node.tag; continue; - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 217 /* AsExpression */: - case 195 /* ElementAccessExpression */: - case 194 /* PropertyAccessExpression */: - case 218 /* NonNullExpression */: - case 326 /* PartiallyEmittedExpression */: + case 218 /* AsExpression */: + case 196 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 219 /* NonNullExpression */: + case 327 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -73113,15 +73512,15 @@ var ts; } ts.getLeftmostExpression = getLeftmostExpression; function parenthesizeConciseBody(body) { - if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 193 /* ObjectLiteralExpression */)) { + if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 194 /* ObjectLiteralExpression */)) { return ts.setTextRange(ts.createParen(body), body); } return body; } ts.parenthesizeConciseBody = parenthesizeConciseBody; function isCommaSequence(node) { - return node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || - node.kind === 327 /* CommaListExpression */; + return node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || + node.kind === 328 /* CommaListExpression */; } ts.isCommaSequence = isCommaSequence; var OuterExpressionKinds; @@ -73134,13 +73533,13 @@ var ts; function isOuterExpression(node, kinds) { if (kinds === void 0) { kinds = 7 /* All */; } switch (node.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return (kinds & 1 /* Parentheses */) !== 0; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: - case 218 /* NonNullExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: + case 219 /* NonNullExpression */: return (kinds & 2 /* Assertions */) !== 0; - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: return (kinds & 4 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -73165,7 +73564,7 @@ var ts; } ts.skipOuterExpressions = skipOuterExpressions; function skipAssertions(node) { - while (ts.isAssertionExpression(node) || node.kind === 218 /* NonNullExpression */) { + while (ts.isAssertionExpression(node) || node.kind === 219 /* NonNullExpression */) { node = node.expression; } return node; @@ -73173,11 +73572,11 @@ var ts; ts.skipAssertions = skipAssertions; function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 200 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); - case 199 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 217 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); - case 218 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); - case 326 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); + case 201 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); + case 200 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 218 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); + case 219 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); + case 327 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); } } /** @@ -73195,7 +73594,7 @@ var ts; * the containing expression is created/updated. */ function isIgnorableParen(node) { - return node.kind === 200 /* ParenthesizedExpression */ + return node.kind === 201 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node) && ts.nodeIsSynthesized(ts.getSourceMapRange(node)) && ts.nodeIsSynthesized(ts.getCommentRange(node)) @@ -73313,10 +73712,10 @@ var ts; var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 254 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 255 /* ImportDeclaration */ && node.importClause) { return ts.getGeneratedNameForNode(node); } - if (node.kind === 260 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 261 /* ExportDeclaration */ && node.moduleSpecifier) { return ts.getGeneratedNameForNode(node); } return undefined; @@ -73435,7 +73834,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -73447,11 +73846,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -73483,12 +73882,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 156 /* Parameter */: - case 191 /* BindingElement */: + case 157 /* Parameter */: + case 192 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 213 /* SpreadElement */: - case 283 /* SpreadAssignment */: + case 214 /* SpreadElement */: + case 284 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -73506,7 +73905,7 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 191 /* BindingElement */: + case 192 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -73521,7 +73920,7 @@ var ts; : propertyName; } break; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -73536,7 +73935,7 @@ var ts; : propertyName; } break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` if (bindingElement.name && ts.isPrivateIdentifier(bindingElement.name)) { return ts.Debug.failBadSyntaxKind(bindingElement.name); @@ -73559,13 +73958,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: - case 192 /* ArrayLiteralExpression */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: + case 193 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -73605,11 +74004,11 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 190 /* ArrayBindingPattern */: - case 192 /* ArrayLiteralExpression */: + case 191 /* ArrayBindingPattern */: + case 193 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 189 /* ObjectBindingPattern */: - case 193 /* ObjectLiteralExpression */: + case 190 /* ObjectBindingPattern */: + case 194 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -73768,289 +74167,289 @@ var ts; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 152 /* LastToken */) || kind === 183 /* ThisType */) { + if ((kind > 0 /* FirstToken */ && kind <= 153 /* LastToken */) || kind === 184 /* ThisType */) { return node; } switch (kind) { // Names case 75 /* Identifier */: return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); // Signature elements - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); - case 156 /* Parameter */: + case 157 /* Parameter */: return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 157 /* Decorator */: + case 158 /* Decorator */: return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); // Type elements - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), // QuestionToken and ExclamationToken is uniqued in Property Declaration and the signature of 'updateProperty' is that too visitNode(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 160 /* MethodSignature */: + case 161 /* MethodSignature */: return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 162 /* Constructor */: + case 163 /* Constructor */: return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 165 /* CallSignature */: + case 166 /* CallSignature */: return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); // Types - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return ts.updateTypePredicateNodeWithModifier(node, visitNode(node.assertsModifier, visitor), visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 170 /* FunctionType */: + case 171 /* FunctionType */: return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 171 /* ConstructorType */: + case 172 /* ConstructorType */: return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 174 /* ArrayType */: + case 175 /* ArrayType */: return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); - case 175 /* TupleType */: + case 176 /* TupleType */: return ts.updateTupleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); - case 176 /* OptionalType */: + case 177 /* OptionalType */: return ts.updateOptionalTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 177 /* RestType */: + case 178 /* RestType */: return ts.updateRestTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 178 /* UnionType */: + case 179 /* UnionType */: return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 179 /* IntersectionType */: + case 180 /* IntersectionType */: return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode)); - case 181 /* InferType */: + case 182 /* InferType */: return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); - case 188 /* ImportType */: + case 189 /* ImportType */: return ts.updateImportTypeNode(node, visitNode(node.argument, visitor, ts.isTypeNode), visitNode(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf); - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 184 /* TypeOperator */: + case 185 /* TypeOperator */: return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); - case 186 /* MappedType */: + case 187 /* MappedType */: return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 187 /* LiteralType */: + case 188 /* LiteralType */: return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); // Binding patterns - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); // Expression - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: if (node.flags & 32 /* OptionalChain */) { - return ts.updatePropertyAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, visitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier)); + return ts.updatePropertyAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier)); } return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifierOrPrivateIdentifier)); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: if (node.flags & 32 /* OptionalChain */) { - return ts.updateElementAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, visitor, ts.isToken), visitNode(node.argumentExpression, visitor, ts.isExpression)); + return ts.updateElementAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.argumentExpression, visitor, ts.isExpression)); } return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { - return ts.updateCallChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, visitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + return ts.updateCallChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); } return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 202 /* ArrowFunction */: - return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, visitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); - case 203 /* DeleteExpression */: + case 203 /* ArrowFunction */: + return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, tokenVisitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); + case 204 /* DeleteExpression */: return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 209 /* BinaryExpression */: - return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, visitor, ts.isToken)); - case 210 /* ConditionalExpression */: - return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, visitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 211 /* TemplateExpression */: + case 210 /* BinaryExpression */: + return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, tokenVisitor, ts.isToken)); + case 211 /* ConditionalExpression */: + return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, tokenVisitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); + case 212 /* TemplateExpression */: return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 217 /* AsExpression */: + case 218 /* AsExpression */: return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); // Misc - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 223 /* Block */: + case 224 /* Block */: return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return ts.updateExpressionStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 232 /* ForOfStatement */: - return ts.updateForOf(node, visitNode(node.awaitModifier, visitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 233 /* ContinueStatement */: + case 233 /* ForOfStatement */: + return ts.updateForOf(node, visitNode(node.awaitModifier, tokenVisitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 234 /* ContinueStatement */: return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 234 /* BreakStatement */: + case 235 /* BreakStatement */: return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ts.updateTypeScriptVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings), node.isTypeOnly); - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: return ts.updateNamespaceExport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 257 /* NamedImports */: + case 258 /* NamedImports */: return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExportBindings), visitNode(node.moduleSpecifier, visitor, ts.isExpression), node.isTypeOnly); - case 261 /* NamedExports */: + case 262 /* NamedExports */: return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); // Module references - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); // JSX - case 266 /* JsxElement */: + case 267 /* JsxElement */: return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 268 /* JsxOpeningElement */: + case 269 /* JsxOpeningElement */: return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 275 /* JsxSpreadAttribute */: + case 276 /* JsxSpreadAttribute */: return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Clauses - case 277 /* CaseClause */: + case 278 /* CaseClause */: return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); // Property assignments - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); // Enum - case 284 /* EnumMember */: + case 285 /* EnumMember */: return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 290 /* SourceFile */: + case 291 /* SourceFile */: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: // No need to visit nodes with no children. @@ -74093,58 +74492,58 @@ var ts; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 152 /* LastToken */)) { + if ((kind > 0 /* FirstToken */ && kind <= 153 /* LastToken */)) { return initial; } // We do not yet support types. - if ((kind >= 168 /* TypePredicate */ && kind <= 187 /* LiteralType */)) { + if ((kind >= 169 /* TypePredicate */ && kind <= 188 /* LiteralType */)) { return initial; } var result = initial; switch (node.kind) { // Leaf nodes - case 222 /* SemicolonClassElement */: - case 224 /* EmptyStatement */: - case 215 /* OmittedExpression */: - case 241 /* DebuggerStatement */: - case 325 /* NotEmittedStatement */: + case 223 /* SemicolonClassElement */: + case 225 /* EmptyStatement */: + case 216 /* OmittedExpression */: + case 242 /* DebuggerStatement */: + case 326 /* NotEmittedStatement */: // No need to visit nodes with no children. break; // Names - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: result = reduceNode(node.expression, cbNode, result); break; // Signature elements - case 156 /* Parameter */: + case 157 /* Parameter */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 157 /* Decorator */: + case 158 /* Decorator */: result = reduceNode(node.expression, cbNode, result); break; // Type member - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.questionToken, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74153,12 +74552,12 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 162 /* Constructor */: + case 163 /* Constructor */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74166,7 +74565,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74174,50 +74573,50 @@ var ts; result = reduceNode(node.body, cbNode, result); break; // Binding patterns - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: result = reduceNodes(node.elements, cbNodes, result); break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Expression - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: result = reduceNodes(node.elements, cbNodes, result); break; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: result = reduceNodes(node.properties, cbNodes, result); break; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.argumentExpression, cbNode, result); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 197 /* NewExpression */: + case 198 /* NewExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: result = reduceNode(node.tag, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNode(node.template, cbNode, result); break; - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: result = reduceNode(node.type, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -74225,123 +74624,123 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 200 /* ParenthesizedExpression */: - case 203 /* DeleteExpression */: - case 204 /* TypeOfExpression */: - case 205 /* VoidExpression */: - case 206 /* AwaitExpression */: - case 212 /* YieldExpression */: - case 213 /* SpreadElement */: - case 218 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: + case 204 /* DeleteExpression */: + case 205 /* TypeOfExpression */: + case 206 /* VoidExpression */: + case 207 /* AwaitExpression */: + case 213 /* YieldExpression */: + case 214 /* SpreadElement */: + case 219 /* NonNullExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: result = reduceNode(node.operand, cbNode, result); break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; - case 217 /* AsExpression */: + case 218 /* AsExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.type, cbNode, result); break; // Misc - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; // Element - case 223 /* Block */: + case 224 /* Block */: result = reduceNodes(node.statements, cbNodes, result); break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 227 /* IfStatement */: + case 228 /* IfStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 228 /* DoStatement */: + case 229 /* DoStatement */: result = reduceNode(node.statement, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 229 /* WhileStatement */: - case 236 /* WithStatement */: + case 230 /* WhileStatement */: + case 237 /* WithStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 230 /* ForStatement */: + case 231 /* ForStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 235 /* ReturnStatement */: - case 239 /* ThrowStatement */: + case 236 /* ReturnStatement */: + case 240 /* ThrowStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 240 /* TryStatement */: + case 241 /* TryStatement */: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: result = reduceNodes(node.declarations, cbNodes, result); break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74350,7 +74749,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74358,143 +74757,143 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.members, cbNodes, result); break; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: result = reduceNodes(node.statements, cbNodes, result); break; - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: result = reduceNodes(node.clauses, cbNodes, result); break; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.moduleReference, cbNode, result); break; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 255 /* ImportClause */: + case 256 /* ImportClause */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: result = reduceNode(node.name, cbNode, result); break; - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: result = reduceNode(node.name, cbNode, result); break; - case 257 /* NamedImports */: - case 261 /* NamedExports */: + case 258 /* NamedImports */: + case 262 /* NamedExports */: result = reduceNodes(node.elements, cbNodes, result); break; - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; // Module references - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: result = reduceNode(node.expression, cbNode, result); break; // JSX - case 266 /* JsxElement */: + case 267 /* JsxElement */: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: result = reduceNode(node.openingFragment, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingFragment, cbNode, result); break; - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: result = reduceNode(node.tagName, cbNode, result); result = reduceNodes(node.typeArguments, cbNode, result); result = reduceNode(node.attributes, cbNode, result); break; - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: result = reduceNodes(node.properties, cbNodes, result); break; - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: result = reduceNode(node.tagName, cbNode, result); break; - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 275 /* JsxSpreadAttribute */: + case 276 /* JsxSpreadAttribute */: result = reduceNode(node.expression, cbNode, result); break; - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: result = reduceNode(node.expression, cbNode, result); break; // Clauses - case 277 /* CaseClause */: + case 278 /* CaseClause */: result = reduceNode(node.expression, cbNode, result); // falls through - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: result = reduceNodes(node.statements, cbNodes, result); break; - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: result = reduceNodes(node.types, cbNodes, result); break; - case 280 /* CatchClause */: + case 281 /* CatchClause */: result = reduceNode(node.variableDeclaration, cbNode, result); result = reduceNode(node.block, cbNode, result); break; // Property assignments - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: result = reduceNode(node.expression, cbNode, result); break; // Enum - case 284 /* EnumMember */: + case 285 /* EnumMember */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Top-level nodes - case 290 /* SourceFile */: + case 291 /* SourceFile */: result = reduceNodes(node.statements, cbNodes, result); break; // Transformation nodes - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: result = reduceNodes(node.elements, cbNodes, result); break; default: @@ -74567,7 +74966,7 @@ var ts; function aggregateTransformFlagsForSubtree(node) { // We do not transform ambient declarations or types, so there is no need to // recursively aggregate transform flags. - if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 216 /* ExpressionWithTypeArguments */)) { + if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 217 /* ExpressionWithTypeArguments */)) { return 0 /* None */; } // Aggregate the transform flags of each child. @@ -75241,7 +75640,7 @@ var ts; function chainBundle(transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 290 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 291 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return ts.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends); @@ -75292,7 +75691,7 @@ var ts; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" @@ -75305,13 +75704,13 @@ var ts; hasImportDefault = true; } break; - case 253 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 265 /* ExternalModuleReference */) { + case 254 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 266 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -75342,13 +75741,13 @@ var ts; } } break; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: if (ts.hasModifier(node, 1 /* Export */)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -75356,7 +75755,7 @@ var ts; } } break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default function() { } @@ -75376,7 +75775,7 @@ var ts; } } break; - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default class { } @@ -75555,7 +75954,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member) { - return member.kind === 159 /* PropertyDeclaration */ + return member.kind === 160 /* PropertyDeclaration */ && member.initializer !== undefined; } ts.isInitializedProperty = isInitializedProperty; @@ -76184,8 +76583,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(194 /* PropertyAccessExpression */); - context.enableSubstitution(195 /* ElementAccessExpression */); + context.enableSubstitution(195 /* PropertyAccessExpression */); + context.enableSubstitution(196 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -76211,14 +76610,14 @@ var ts; var applicableSubstitutions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 291 /* Bundle */) { + if (node.kind === 292 /* Bundle */) { return transformBundle(node); } return transformSourceFile(node); } function transformBundle(node) { return ts.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 293 /* InputFiles */) { + if (prepend.kind === 294 /* InputFiles */) { return ts.createUnparsedSourceFile(prepend, "js"); } return prepend; @@ -76269,16 +76668,16 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 290 /* SourceFile */: - case 251 /* CaseBlock */: - case 250 /* ModuleBlock */: - case 223 /* Block */: + case 291 /* SourceFile */: + case 252 /* CaseBlock */: + case 251 /* ModuleBlock */: + case 224 /* Block */: currentLexicalScope = node; currentNameScope = undefined; currentScopeFirstDeclarationsOfName = undefined; break; - case 245 /* ClassDeclaration */: - case 244 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 245 /* FunctionDeclaration */: if (ts.hasModifier(node, 2 /* Ambient */)) { break; } @@ -76290,7 +76689,7 @@ var ts; // These nodes should always have names unless they are default-exports; // however, class declaration parsing allows for undefined names, so syntactically invalid // programs may also have an undefined name. - ts.Debug.assert(node.kind === 245 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); + ts.Debug.assert(node.kind === 246 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); } if (ts.isClassDeclaration(node)) { // XXX: should probably also cover interfaces and type aliases that can have type variables? @@ -76333,10 +76732,10 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 259 /* ExportAssignment */: - case 260 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 260 /* ExportAssignment */: + case 261 /* ExportDeclaration */: return visitEllidableStatement(node); default: return visitorWorker(node); @@ -76357,13 +76756,13 @@ var ts; return node; } switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return visitImportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitExportAssignment(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -76383,11 +76782,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 260 /* ExportDeclaration */ || - node.kind === 254 /* ImportDeclaration */ || - node.kind === 255 /* ImportClause */ || - (node.kind === 253 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 265 /* ExternalModuleReference */)) { + if (node.kind === 261 /* ExportDeclaration */ || + node.kind === 255 /* ImportDeclaration */ || + node.kind === 256 /* ImportClause */ || + (node.kind === 254 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 266 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -76411,19 +76810,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: return visitConstructor(node); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // Property declarations are not TypeScript syntax, but they must be visited // for the decorator transformation. return visitPropertyDeclaration(node); - case 167 /* IndexSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 161 /* MethodDeclaration */: + case 168 /* IndexSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 162 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 222 /* SemicolonClassElement */: + case 223 /* SemicolonClassElement */: return node; default: return ts.Debug.failBadSyntaxKind(node); @@ -76459,62 +76858,62 @@ var ts; case 118 /* ProtectedKeyword */: case 122 /* AbstractKeyword */: case 81 /* ConstKeyword */: - case 130 /* DeclareKeyword */: - case 138 /* ReadonlyKeyword */: + case 131 /* DeclareKeyword */: + case 139 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided // falls through - case 174 /* ArrayType */: - case 175 /* TupleType */: - case 176 /* OptionalType */: - case 177 /* RestType */: - case 173 /* TypeLiteral */: - case 168 /* TypePredicate */: - case 155 /* TypeParameter */: + case 175 /* ArrayType */: + case 176 /* TupleType */: + case 177 /* OptionalType */: + case 178 /* RestType */: + case 174 /* TypeLiteral */: + case 169 /* TypePredicate */: + case 156 /* TypeParameter */: case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 128 /* BooleanKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 137 /* NeverKeyword */: + case 149 /* UnknownKeyword */: + case 129 /* BooleanKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 138 /* NeverKeyword */: case 110 /* VoidKeyword */: - case 144 /* SymbolKeyword */: - case 171 /* ConstructorType */: - case 170 /* FunctionType */: - case 172 /* TypeQuery */: - case 169 /* TypeReference */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 180 /* ConditionalType */: - case 182 /* ParenthesizedType */: - case 183 /* ThisType */: - case 184 /* TypeOperator */: - case 185 /* IndexedAccessType */: - case 186 /* MappedType */: - case 187 /* LiteralType */: + case 145 /* SymbolKeyword */: + case 172 /* ConstructorType */: + case 171 /* FunctionType */: + case 173 /* TypeQuery */: + case 170 /* TypeReference */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 181 /* ConditionalType */: + case 183 /* ParenthesizedType */: + case 184 /* ThisType */: + case 185 /* TypeOperator */: + case 186 /* IndexedAccessType */: + case 187 /* MappedType */: + case 188 /* LiteralType */: // TypeScript type nodes are elided. // falls through - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: // TypeScript index signatures are elided. // falls through - case 157 /* Decorator */: + case 158 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. // falls through - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. return undefined; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects return visitPropertyDeclaration(node); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: // TypeScript namespace export declarations are elided. return undefined; - case 162 /* Constructor */: + case 163 /* Constructor */: return visitConstructor(node); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return ts.createNotEmittedStatement(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: // This may be a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -76524,7 +76923,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: // This may be a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -76534,35 +76933,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: // This may be a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 156 /* Parameter */: + case 157 /* Parameter */: // This may be a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -76572,35 +76971,35 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return visitCallExpression(node); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return visitNewExpression(node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); default: @@ -77013,12 +77412,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -77171,7 +77570,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 159 /* PropertyDeclaration */ + ? member.kind === 160 /* PropertyDeclaration */ // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it // should not invoke `Object.getOwnPropertyDescriptor`. ? ts.createVoidZero() @@ -77294,10 +77693,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */ - || kind === 159 /* PropertyDeclaration */; + return kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */ + || kind === 160 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -77307,7 +77706,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 161 /* MethodDeclaration */; + return node.kind === 162 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -77318,12 +77717,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return true; } return false; @@ -77340,15 +77739,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 159 /* PropertyDeclaration */: - case 156 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 157 /* Parameter */: return serializeTypeNode(node.type); - case 164 /* SetAccessor */: - case 163 /* GetAccessor */: + case 165 /* SetAccessor */: + case 164 /* GetAccessor */: return serializeTypeNode(getAccessorTypeNode(node)); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 161 /* MethodDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 162 /* MethodDeclaration */: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); @@ -77385,7 +77784,7 @@ var ts; return ts.createArrayLiteral(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 163 /* GetAccessor */) { + if (container && node.kind === 164 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -77431,30 +77830,30 @@ var ts; } switch (node.kind) { case 110 /* VoidKeyword */: - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: case 100 /* NullKeyword */: - case 137 /* NeverKeyword */: + case 138 /* NeverKeyword */: return ts.createVoidZero(); - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: return ts.createIdentifier("Function"); - case 174 /* ArrayType */: - case 175 /* TupleType */: + case 175 /* ArrayType */: + case 176 /* TupleType */: return ts.createIdentifier("Array"); - case 168 /* TypePredicate */: - case 128 /* BooleanKeyword */: + case 169 /* TypePredicate */: + case 129 /* BooleanKeyword */: return ts.createIdentifier("Boolean"); - case 143 /* StringKeyword */: + case 144 /* StringKeyword */: return ts.createIdentifier("String"); - case 141 /* ObjectKeyword */: + case 142 /* ObjectKeyword */: return ts.createIdentifier("Object"); - case 187 /* LiteralType */: + case 188 /* LiteralType */: switch (node.literal.kind) { case 10 /* StringLiteral */: return ts.createIdentifier("String"); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: case 8 /* NumericLiteral */: return ts.createIdentifier("Number"); case 9 /* BigIntLiteral */: @@ -77465,34 +77864,34 @@ var ts; default: return ts.Debug.failBadSyntaxKind(node.literal); } - case 140 /* NumberKeyword */: + case 141 /* NumberKeyword */: return ts.createIdentifier("Number"); - case 151 /* BigIntKeyword */: + case 152 /* BigIntKeyword */: return getGlobalBigIntNameWithFallback(); - case 144 /* SymbolKeyword */: + case 145 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return serializeTypeReferenceNode(node); - case 179 /* IntersectionType */: - case 178 /* UnionType */: + case 180 /* IntersectionType */: + case 179 /* UnionType */: return serializeTypeList(node.types); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return serializeTypeList([node.trueType, node.falseType]); - case 184 /* TypeOperator */: - if (node.operator === 138 /* ReadonlyKeyword */) { + case 185 /* TypeOperator */: + if (node.operator === 139 /* ReadonlyKeyword */) { return serializeTypeNode(node.type); } break; - case 172 /* TypeQuery */: - case 185 /* IndexedAccessType */: - case 186 /* MappedType */: - case 173 /* TypeLiteral */: + case 173 /* TypeQuery */: + case 186 /* IndexedAccessType */: + case 187 /* MappedType */: + case 174 /* TypeLiteral */: case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 183 /* ThisType */: - case 188 /* ImportType */: + case 149 /* UnknownKeyword */: + case 184 /* ThisType */: + case 189 /* ImportType */: break; default: return ts.Debug.failBadSyntaxKind(node); @@ -77505,13 +77904,13 @@ var ts; var serializedUnion; for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { var typeNode = types_20[_i]; - while (typeNode.kind === 182 /* ParenthesizedType */) { + while (typeNode.kind === 183 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 137 /* NeverKeyword */) { + if (typeNode.kind === 138 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 146 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 147 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var serializedIndividual = serializeTypeNode(typeNode); @@ -77620,7 +78019,7 @@ var ts; name.original = undefined; name.parent = ts.getParseTreeNode(currentLexicalScope); // ensure the parent is set to a parse tree node. return name; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return serializeQualifiedNameAsExpression(node); } } @@ -78180,12 +78579,12 @@ var ts; // enums in any other scope are emitted as a `let` declaration. var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)) - ], currentLexicalScope.kind === 290 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); + ], currentLexicalScope.kind === 291 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 248 /* EnumDeclaration */) { + if (node.kind === 249 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -78310,7 +78709,7 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 250 /* ModuleBlock */) { + if (body.kind === 251 /* ModuleBlock */) { saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; @@ -78356,13 +78755,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (body.kind !== 250 /* ModuleBlock */) { + if (body.kind !== 251 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 249 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 250 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -78412,7 +78811,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 256 /* NamespaceImport */) { + if (node.kind === 257 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -78660,16 +79059,16 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(75 /* Identifier */); - context.enableSubstitution(282 /* ShorthandPropertyAssignment */); + context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(249 /* ModuleDeclaration */); + context.enableEmitNotification(250 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 249 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 250 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 248 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 249 /* EnumDeclaration */; } /** * Hook for node emit. @@ -78730,9 +79129,9 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -78770,9 +79169,9 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 290 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 249 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 248 /* EnumDeclaration */); + if (container && container.kind !== 291 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 250 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 249 /* EnumDeclaration */); if (substitute) { return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), /*location*/ node); @@ -78923,40 +79322,40 @@ var ts; if (!(node.transformFlags & 4194304 /* ContainsClassFields */)) return node; switch (node.kind) { - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: return visitClassLike(node); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return visitPropertyAccessExpression(node); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return visitPrefixUnaryExpression(node); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return visitPostfixUnaryExpression(node, /*valueIsDiscarded*/ false); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return visitCallExpression(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node); case 76 /* PrivateIdentifier */: return visitPrivateIdentifier(node); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return visitExpressionStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); } return ts.visitEachChild(node, visitor, context); } function visitorDestructuringTarget(node) { switch (node.kind) { - case 193 /* ObjectLiteralExpression */: - case 192 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return visitAssignmentPattern(node); default: return visitor(node); @@ -78979,20 +79378,20 @@ var ts; */ function classElementVisitor(node) { switch (node.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: // Constructors for classes using class fields are transformed in // `visitClassDeclaration` or `visitClassExpression`. return undefined; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 161 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 162 /* MethodDeclaration */: // Visit the name of the member (if it's a computed property name). return ts.visitEachChild(node, classElementVisitor, context); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 222 /* SemicolonClassElement */: + case 223 /* SemicolonClassElement */: return node; default: return visitor(node); @@ -79758,31 +80157,31 @@ var ts; case 126 /* AsyncKeyword */: // ES2017 async modifier should be elided for targets < ES2017 return undefined; - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return visitAwaitExpression(node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 102 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 162 /* Constructor */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 163 /* Constructor */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -79791,27 +80190,27 @@ var ts; function asyncBodyVisitor(node) { if (ts.isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatementInAsyncBody(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatementInAsyncBody(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatementInAsyncBody(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatementInAsyncBody(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClauseInAsyncBody(node); - case 223 /* Block */: - case 237 /* SwitchStatement */: - case 251 /* CaseBlock */: - case 277 /* CaseClause */: - case 278 /* DefaultClause */: - case 240 /* TryStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 227 /* IfStatement */: - case 236 /* WithStatement */: - case 238 /* LabeledStatement */: + case 224 /* Block */: + case 238 /* SwitchStatement */: + case 252 /* CaseBlock */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: + case 241 /* TryStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 228 /* IfStatement */: + case 237 /* WithStatement */: + case 239 /* LabeledStatement */: return ts.visitEachChild(node, asyncBodyVisitor, context); default: return ts.Debug.assertNever(node, "Unhandled node."); @@ -80016,7 +80415,7 @@ var ts; var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 202 /* ArrowFunction */; + var isArrowFunction = node.kind === 203 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current @@ -80107,17 +80506,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(196 /* CallExpression */); - context.enableSubstitution(194 /* PropertyAccessExpression */); - context.enableSubstitution(195 /* ElementAccessExpression */); + context.enableSubstitution(197 /* CallExpression */); + context.enableSubstitution(195 /* PropertyAccessExpression */); + context.enableSubstitution(196 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(245 /* ClassDeclaration */); - context.enableEmitNotification(161 /* MethodDeclaration */); - context.enableEmitNotification(163 /* GetAccessor */); - context.enableEmitNotification(164 /* SetAccessor */); - context.enableEmitNotification(162 /* Constructor */); + context.enableEmitNotification(246 /* ClassDeclaration */); + context.enableEmitNotification(162 /* MethodDeclaration */); + context.enableEmitNotification(164 /* GetAccessor */); + context.enableEmitNotification(165 /* SetAccessor */); + context.enableEmitNotification(163 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(225 /* VariableStatement */); + context.enableEmitNotification(226 /* VariableStatement */); } } /** @@ -80165,11 +80564,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -80201,11 +80600,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 245 /* ClassDeclaration */ - || kind === 162 /* Constructor */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */; + return kind === 246 /* ClassDeclaration */ + || kind === 163 /* Constructor */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -80373,64 +80772,64 @@ var ts; return node; } switch (node.kind) { - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return visitAwaitExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return visitYieldExpression(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitReturnStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitLabeledStatement(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node, noDestructuringValue); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClause(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return visitVoidExpression(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return doWithLexicalThis(visitConstructorDeclaration, node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return doWithLexicalThis(visitMethodDeclaration, node); - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: return doWithLexicalThis(visitGetAccessorDeclaration, node); - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: return doWithLexicalThis(visitSetAccessorDeclaration, node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return doWithLexicalThis(visitFunctionDeclaration, node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return doWithLexicalThis(visitFunctionExpression, node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return visitArrowFunction(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return visitParameter(node); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return visitExpressionStatement(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, noDestructuringValue); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 102 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return doWithLexicalThis(visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -80464,7 +80863,7 @@ var ts; function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2 /* Async */) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 232 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 233 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node); @@ -80476,7 +80875,7 @@ var ts; var objects = []; for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { var e = elements_4[_i]; - if (e.kind === 283 /* SpreadAssignment */) { + if (e.kind === 284 /* SpreadAssignment */) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -80485,7 +80884,7 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - chunkObject = ts.append(chunkObject, e.kind === 281 /* PropertyAssignment */ + chunkObject = ts.append(chunkObject, e.kind === 282 /* PropertyAssignment */ ? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } @@ -80519,7 +80918,7 @@ var ts; // If we translate the above to `__assign({}, k, l)`, the `l` will evaluate before `k` is spread and we // end up with `{ a: 1, b: 2, c: 3 }` var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 193 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 194 /* ObjectLiteralExpression */) { objects.unshift(ts.createObjectLiteral()); } var expression = objects[0]; @@ -80897,17 +81296,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(196 /* CallExpression */); - context.enableSubstitution(194 /* PropertyAccessExpression */); - context.enableSubstitution(195 /* ElementAccessExpression */); + context.enableSubstitution(197 /* CallExpression */); + context.enableSubstitution(195 /* PropertyAccessExpression */); + context.enableSubstitution(196 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(245 /* ClassDeclaration */); - context.enableEmitNotification(161 /* MethodDeclaration */); - context.enableEmitNotification(163 /* GetAccessor */); - context.enableEmitNotification(164 /* SetAccessor */); - context.enableEmitNotification(162 /* Constructor */); + context.enableEmitNotification(246 /* ClassDeclaration */); + context.enableEmitNotification(162 /* MethodDeclaration */); + context.enableEmitNotification(164 /* GetAccessor */); + context.enableEmitNotification(165 /* SetAccessor */); + context.enableEmitNotification(163 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(225 /* VariableStatement */); + context.enableEmitNotification(226 /* VariableStatement */); } } /** @@ -80955,11 +81354,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -80991,11 +81390,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 245 /* ClassDeclaration */ - || kind === 162 /* Constructor */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */; + return kind === 246 /* ClassDeclaration */ + || kind === 163 /* Constructor */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -81093,7 +81492,7 @@ var ts; return node; } switch (node.kind) { - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -81125,21 +81524,21 @@ var ts; return node; } switch (node.kind) { - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: - case 196 /* CallExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: + case 197 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { var updated = visitOptionalExpression(node, /*captureThisArg*/ false, /*isDelete*/ false); ts.Debug.assertNotNode(updated, ts.isSyntheticReference); return updated; } return ts.visitEachChild(node, visitor, context); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (node.operatorToken.kind === 60 /* QuestionQuestionToken */) { return transformNullishCoalescingExpression(node); } return ts.visitEachChild(node, visitor, context); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return visitDeleteExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -81179,7 +81578,7 @@ var ts; thisArg = expression; } } - expression = node.kind === 194 /* PropertyAccessExpression */ + expression = node.kind === 195 /* PropertyAccessExpression */ ? ts.updatePropertyAccess(node, expression, ts.visitNode(node.name, visitor, ts.isIdentifier)) : ts.updateElementAccess(node, expression, ts.visitNode(node.argumentExpression, visitor, ts.isExpression)); return thisArg ? ts.createSyntheticReferenceExpression(expression, thisArg) : expression; @@ -81193,10 +81592,10 @@ var ts; } function visitNonOptionalExpression(node, captureThisArg, isDelete) { switch (node.kind) { - case 200 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 196 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); + case 201 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); + case 197 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); default: return ts.visitNode(node, visitor, ts.isExpression); } } @@ -81215,8 +81614,8 @@ var ts; for (var i = 0; i < chain.length; i++) { var segment = chain[i]; switch (segment.kind) { - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: if (i === chain.length - 1 && captureThisArg) { if (shouldCaptureInTempVariable(rightExpression)) { thisArg = ts.createTempVariable(hoistVariableDeclaration); @@ -81226,11 +81625,11 @@ var ts; thisArg = rightExpression; } } - rightExpression = segment.kind === 194 /* PropertyAccessExpression */ + rightExpression = segment.kind === 195 /* PropertyAccessExpression */ ? ts.createPropertyAccess(rightExpression, ts.visitNode(segment.name, visitor, ts.isIdentifier)) : ts.createElementAccess(rightExpression, ts.visitNode(segment.argumentExpression, visitor, ts.isExpression)); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (i === 0 && leftThisArg) { rightExpression = ts.createFunctionCall(rightExpression, leftThisArg.kind === 102 /* SuperKeyword */ ? ts.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression)); } @@ -81328,13 +81727,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 266 /* JsxElement */: + case 267 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ false); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -81344,13 +81743,13 @@ var ts; switch (node.kind) { case 11 /* JsxText */: return visitJsxText(node); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return visitJsxExpression(node); - case 266 /* JsxElement */: + case 267 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ true); default: return ts.Debug.failBadSyntaxKind(node); @@ -81425,7 +81824,7 @@ var ts; literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile); return ts.setTextRange(literal, node); } - else if (node.kind === 276 /* JsxExpression */) { + else if (node.kind === 277 /* JsxExpression */) { if (node.expression === undefined) { return ts.createTrue(); } @@ -81519,7 +81918,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 266 /* JsxElement */) { + if (node.kind === 267 /* JsxElement */) { return getTagName(node.openingElement); } else { @@ -81825,7 +82224,7 @@ var ts; return node; } switch (node.kind) { - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -82038,13 +82437,13 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 - && node.kind === 235 /* ReturnStatement */ + && node.kind === 236 /* ReturnStatement */ && !node.expression; } function shouldVisitNode(node) { return (node.transformFlags & 256 /* ContainsES2015 */) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 223 /* Block */))) + || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 224 /* Block */))) || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatement(node)) || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0; } @@ -82066,63 +82465,63 @@ var ts; switch (node.kind) { case 120 /* StaticKeyword */: return undefined; // elide static keyword - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return visitClassDeclaration(node); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return visitClassExpression(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return visitParameter(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return visitArrowFunction(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return visitFunctionExpression(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return visitVariableDeclaration(node); case 75 /* Identifier */: return visitIdentifier(node); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return visitSwitchStatement(node); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return visitCaseBlock(node); - case 223 /* Block */: + case 224 /* Block */: return visitBlock(node, /*isFunctionBody*/ false); - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitLabeledStatement(node); - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node, /*outermostLabeledStatement*/ undefined); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return visitExpressionStatement(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClause(node); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return visitCallExpression(node); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return visitNewExpression(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 14 /* NoSubstitutionTemplateLiteral */: case 15 /* TemplateHead */: @@ -82133,28 +82532,28 @@ var ts; return visitStringLiteral(node); case 8 /* NumericLiteral */: return visitNumericLiteral(node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: return visitTemplateExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return visitYieldExpression(node); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return visitSpreadElement(node); case 102 /* SuperKeyword */: return visitSuperKeyword(/*isExpressionOfCall*/ false); case 104 /* ThisKeyword */: return visitThisKeyword(node); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return visitMetaProperty(node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return visitAccessorDeclaration(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitReturnStatement(node); default: return ts.visitEachChild(node, visitor, context); @@ -82245,14 +82644,14 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 234 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 235 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; var label = node.label; if (!label) { - if (node.kind === 234 /* BreakStatement */) { + if (node.kind === 235 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -82263,7 +82662,7 @@ var ts; } } else { - if (node.kind === 234 /* BreakStatement */) { + if (node.kind === 235 /* BreakStatement */) { labelMarker = "break-" + label.escapedText; setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker); } @@ -82659,11 +83058,11 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 235 /* ReturnStatement */) { + if (statement.kind === 236 /* ReturnStatement */) { return true; } // An if-statement with two covered branches is covered. - else if (statement.kind === 227 /* IfStatement */) { + else if (statement.kind === 228 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && @@ -82671,7 +83070,7 @@ var ts; } } // A block is covered if it has a last statement which is covered. - else if (statement.kind === 223 /* Block */) { + else if (statement.kind === 224 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -82869,7 +83268,7 @@ var ts; * @param node A node. */ function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 202 /* ArrowFunction */) { + if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 203 /* ArrowFunction */) { insertCaptureThisForNode(statements, node, ts.createThis()); return true; } @@ -82890,22 +83289,22 @@ var ts; if (hierarchyFacts & 16384 /* NewTarget */) { var newTarget = void 0; switch (node.kind) { - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return statements; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // Methods and accessors cannot be constructors, so 'new.target' will // always return 'undefined'. newTarget = ts.createVoidZero(); break; - case 162 /* Constructor */: + case 163 /* Constructor */: // Class constructors can only be called with `new`, so `this.constructor` // should be relatively safe to use. newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"); break; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: // Functions can be called or constructed, and may have a `this` due to // being a member or when calling an imported function via `other_1.f()`. newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), 98 /* InstanceOfKeyword */, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"), ts.createVoidZero()); @@ -82937,20 +83336,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 222 /* SemicolonClassElement */: + case 223 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 162 /* Constructor */: + case 163 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -83152,7 +83551,7 @@ var ts; : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 244 /* FunctionDeclaration */ || node.kind === 201 /* FunctionExpression */)) { + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 245 /* FunctionDeclaration */ || node.kind === 202 /* FunctionExpression */)) { name = ts.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */); @@ -83196,7 +83595,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 202 /* ArrowFunction */); + ts.Debug.assert(node.kind === 203 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -83264,9 +83663,9 @@ var ts; function visitExpressionStatement(node) { // If we are here it is most likely because our expression is a destructuring assignment. switch (node.expression.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return ts.updateExpressionStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return ts.updateExpressionStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } return ts.visitEachChild(node, visitor, context); @@ -83285,9 +83684,9 @@ var ts; // expression. If we are in a state where we do not need the destructuring value, // we pass that information along to the children that care about it. switch (node.expression.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return ts.updateParen(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return ts.updateParen(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } } @@ -83501,14 +83900,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -83696,7 +84095,7 @@ var ts; && i < numInitialPropertiesWithoutYield) { numInitialPropertiesWithoutYield = i; } - if (property.name.kind === 154 /* ComputedPropertyName */) { + if (property.name.kind === 155 /* ComputedPropertyName */) { numInitialProperties = i; break; } @@ -83817,11 +84216,11 @@ var ts; } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 230 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 231 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); - case 232 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); - case 228 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); - case 229 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); + case 231 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); + case 232 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); + case 233 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); + case 229 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); + case 230 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); default: return ts.Debug.failBadSyntaxKind(node, "IterationStatement expected"); } } @@ -83846,11 +84245,11 @@ var ts; function createConvertedLoopState(node) { var loopInitializer; switch (node.kind) { - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 243 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 244 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -84249,20 +84648,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -84369,7 +84768,7 @@ var ts; var updated; var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 163 /* GetAccessor */) { + if (node.kind === 164 /* GetAccessor */) { updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -84861,13 +85260,13 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(104 /* ThisKeyword */); - context.enableEmitNotification(162 /* Constructor */); - context.enableEmitNotification(161 /* MethodDeclaration */); - context.enableEmitNotification(163 /* GetAccessor */); - context.enableEmitNotification(164 /* SetAccessor */); - context.enableEmitNotification(202 /* ArrowFunction */); - context.enableEmitNotification(201 /* FunctionExpression */); - context.enableEmitNotification(244 /* FunctionDeclaration */); + context.enableEmitNotification(163 /* Constructor */); + context.enableEmitNotification(162 /* MethodDeclaration */); + context.enableEmitNotification(164 /* GetAccessor */); + context.enableEmitNotification(165 /* SetAccessor */); + context.enableEmitNotification(203 /* ArrowFunction */); + context.enableEmitNotification(202 /* FunctionExpression */); + context.enableEmitNotification(245 /* FunctionDeclaration */); } } /** @@ -84908,10 +85307,10 @@ var ts; */ function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 191 /* BindingElement */: - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 242 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 243 /* VariableDeclaration */: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } @@ -84993,11 +85392,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 226 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 227 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 196 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 197 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -85005,7 +85404,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 213 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 214 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -85045,15 +85444,15 @@ var ts; if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(268 /* JsxOpeningElement */); - context.enableEmitNotification(269 /* JsxClosingElement */); - context.enableEmitNotification(267 /* JsxSelfClosingElement */); + context.enableEmitNotification(269 /* JsxOpeningElement */); + context.enableEmitNotification(270 /* JsxClosingElement */); + context.enableEmitNotification(268 /* JsxSelfClosingElement */); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(194 /* PropertyAccessExpression */); - context.enableSubstitution(281 /* PropertyAssignment */); + context.enableSubstitution(195 /* PropertyAccessExpression */); + context.enableSubstitution(282 /* PropertyAssignment */); return ts.chainBundle(transformSourceFile); /** * Transforms an ES5 source file to ES3. @@ -85072,9 +85471,9 @@ var ts; */ function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 268 /* JsxOpeningElement */: - case 269 /* JsxClosingElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 270 /* JsxClosingElement */: + case 268 /* JsxSelfClosingElement */: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -85409,13 +85808,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 228 /* DoStatement */: + case 229 /* DoStatement */: return visitDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return visitWhileStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return visitSwitchStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -85428,24 +85827,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return visitFunctionExpression(node); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return visitAccessorDeclaration(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatement(node); - case 234 /* BreakStatement */: + case 235 /* BreakStatement */: return visitBreakStatement(node); - case 233 /* ContinueStatement */: + case 234 /* ContinueStatement */: return visitContinueStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 262144 /* ContainsYield */) { @@ -85466,21 +85865,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return visitConditionalExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return visitYieldExpression(node); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return visitCallExpression(node); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -85493,9 +85892,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return visitFunctionExpression(node); default: return ts.Debug.failBadSyntaxKind(node); @@ -85703,7 +86102,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -85715,7 +86114,7 @@ var ts; // _a.b = %sent%; target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -86091,35 +86490,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 223 /* Block */: + case 224 /* Block */: return transformAndEmitBlock(node); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return transformAndEmitIfStatement(node); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return transformAndEmitDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return transformAndEmitForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 233 /* ContinueStatement */: + case 234 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 234 /* BreakStatement */: + case 235 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return transformAndEmitWithStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -86549,7 +86948,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 278 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 279 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -86562,7 +86961,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 277 /* CaseClause */) { + if (clause.kind === 278 /* CaseClause */) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -87791,11 +88190,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(209 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(207 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(208 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(290 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(210 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(208 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(209 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(291 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var currentSourceFile; // The current file. @@ -88119,23 +88518,23 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return visitImportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return visitExportDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitExportAssignment(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return visitClassDeclaration(node); - case 328 /* MergeDeclarationMarker */: + case 329 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 329 /* EndOfDeclarationMarker */: + case 330 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, moduleExpressionElementVisitor, context); @@ -88162,24 +88561,24 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var elem = _a[_i]; switch (elem.kind) { - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return false; default: ts.Debug.assertNever(elem, "Unhandled object member kind"); } @@ -88679,7 +89078,7 @@ var ts; // // To balance the declaration, add the exports of the elided variable // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -88734,10 +89133,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 257 /* NamedImports */: + case 258 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding, /* liveBinding */ true); @@ -88950,7 +89349,7 @@ var ts; * @param emit A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -89014,10 +89413,10 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return substituteBinaryExpression(node); - case 208 /* PostfixUnaryExpression */: - case 207 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -89038,7 +89437,7 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 290 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 291 /* SourceFile */) { return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), /*location*/ node); } @@ -89113,7 +89512,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 208 /* PostfixUnaryExpression */ + var expression = node.kind === 209 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 45 /* PlusPlusToken */ ? 63 /* PlusEqualsToken */ : 64 /* MinusEqualsToken */), ts.createLiteral(1)), /*location*/ node) : node; @@ -89212,12 +89611,12 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols - context.enableSubstitution(209 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(207 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(208 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(219 /* MetaProperty */); // Substitutes 'import.meta' - context.enableEmitNotification(290 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols + context.enableSubstitution(210 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(208 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(209 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(220 /* MetaProperty */); // Substitutes 'import.meta' + context.enableEmitNotification(291 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var exportFunctionsMap = []; // The export function associated with a source file. @@ -89441,7 +89840,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 260 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 261 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -89466,7 +89865,7 @@ var ts; } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 260 /* ExportDeclaration */) { + if (externalImport.kind !== 261 /* ExportDeclaration */) { continue; } if (!externalImport.exportClause) { @@ -89549,19 +89948,19 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); // TODO: GH#18217 switch (entry.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // falls through - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(ts.createExpressionStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { if (ts.isNamedExports(entry.exportClause)) { @@ -89620,13 +90019,13 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return visitImportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return visitExportDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -89806,7 +90205,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 290 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 291 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -89870,7 +90269,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -89932,10 +90331,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 257 /* NamedImports */: + case 258 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -90115,43 +90514,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return visitClassDeclaration(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatement(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatement(node); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return visitDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return visitWhileStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitLabeledStatement(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return visitWithStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return visitSwitchStatement(node); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return visitCaseBlock(node); - case 277 /* CaseClause */: + case 278 /* CaseClause */: return visitCaseClause(node); - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: return visitDefaultClause(node); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return visitTryStatement(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClause(node); - case 223 /* Block */: + case 224 /* Block */: return visitBlock(node); - case 328 /* MergeDeclarationMarker */: + case 329 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 329 /* EndOfDeclarationMarker */: + case 330 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -90398,7 +90797,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 290 /* SourceFile */; + return container !== undefined && container.kind === 291 /* SourceFile */; } else { return false; @@ -90431,7 +90830,7 @@ var ts; * @param emitCallback A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -90481,7 +90880,7 @@ var ts; */ function substituteUnspecified(node) { switch (node.kind) { - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return substituteShorthandPropertyAssignment(node); } return node; @@ -90517,12 +90916,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return substituteBinaryExpression(node); - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return substituteMetaProperty(node); } return node; @@ -90615,14 +91014,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 208 /* PostfixUnaryExpression */ + var expression = node.kind === 209 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) { var exportName = exportedNames_5[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 208 /* PostfixUnaryExpression */) { + if (node.kind === 209 /* PostfixUnaryExpression */) { expression = node.operator === 45 /* PlusPlusToken */ ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -90650,7 +91049,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 290 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 291 /* SourceFile */) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -90689,7 +91088,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(290 /* SourceFile */); + context.enableEmitNotification(291 /* SourceFile */); context.enableSubstitution(75 /* Identifier */); var helperNameSubstitutions; return ts.chainBundle(transformSourceFile); @@ -90714,12 +91113,12 @@ var ts; } function visitor(node) { switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // Elide `import=` as it is not legal with --module ES6 return undefined; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitExportAssignment(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: var exportDecl = node; return visitExportDeclaration(exportDecl); } @@ -90850,7 +91249,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.kind === 246 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90879,7 +91278,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.kind === 246 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90926,7 +91325,7 @@ var ts; return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]); } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { + if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90935,8 +91334,8 @@ var ts; } // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit // The only exception here is if the constructor was marked as private. we are not emitting the constructor parameters at all. - else if (node.kind === 159 /* PropertyDeclaration */ || node.kind === 194 /* PropertyAccessExpression */ || node.kind === 158 /* PropertySignature */ || - (node.kind === 156 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { + else if (node.kind === 160 /* PropertyDeclaration */ || node.kind === 195 /* PropertyAccessExpression */ || node.kind === 159 /* PropertySignature */ || + (node.kind === 157 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -90945,7 +91344,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 245 /* ClassDeclaration */ || node.kind === 156 /* Parameter */) { + else if (node.parent.kind === 246 /* ClassDeclaration */ || node.kind === 157 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90970,7 +91369,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (node.kind === 164 /* SetAccessor */) { + if (node.kind === 165 /* SetAccessor */) { // Getters can infer the return type from the returned expression, but setters cannot, so the // "_from_external_module_1_but_cannot_be_named" case cannot occur. if (ts.hasModifier(node, 32 /* Static */)) { @@ -91009,26 +91408,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 165 /* CallSignature */: + case 166 /* CallSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.hasModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -91036,7 +91435,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.kind === 246 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -91050,7 +91449,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -91075,30 +91474,30 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 166 /* ConstructSignature */: - case 171 /* ConstructorType */: + case 167 /* ConstructSignature */: + case 172 /* ConstructorType */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 165 /* CallSignature */: + case 166 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -91106,7 +91505,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 246 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91119,15 +91518,15 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 244 /* FunctionDeclaration */: - case 170 /* FunctionType */: + case 245 /* FunctionDeclaration */: + case 171 /* FunctionType */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - case 164 /* SetAccessor */: - case 163 /* GetAccessor */: + case 165 /* SetAccessor */: + case 164 /* GetAccessor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91141,39 +91540,39 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 186 /* MappedType */: + case 187 /* MappedType */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 171 /* ConstructorType */: - case 166 /* ConstructSignature */: + case 172 /* ConstructorType */: + case 167 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 165 /* CallSignature */: + case 166 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 246 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 170 /* FunctionType */: - case 244 /* FunctionDeclaration */: + case 171 /* FunctionType */: + case 245 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -91188,7 +91587,7 @@ var ts; function getHeritageClauseVisibilityError() { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 245 /* ClassDeclaration */) { + if (node.parent.parent.kind === 246 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible diagnosticMessage = ts.isHeritageClause(node.parent) && node.parent.token === 113 /* ImplementsKeyword */ ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : @@ -91239,7 +91638,7 @@ var ts; } function isInternalDeclaration(node, currentSourceFile) { var parseTreeNode = ts.getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 156 /* Parameter */) { + if (parseTreeNode && parseTreeNode.kind === 157 /* Parameter */) { var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : undefined; var text = currentSourceFile.text; @@ -91398,10 +91797,10 @@ var ts; return result; } function transformRoot(node) { - if (node.kind === 290 /* SourceFile */ && node.isDeclarationFile) { + if (node.kind === 291 /* SourceFile */ && node.isDeclarationFile) { return node; } - if (node.kind === 291 /* Bundle */) { + if (node.kind === 292 /* Bundle */) { isBundledEmit = true; refs = ts.createMap(); libs = ts.createMap(); @@ -91424,14 +91823,14 @@ var ts; resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules) needsDeclare = false; var statements = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile, /*bundled*/ true)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); - var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(130 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); + var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(131 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); return newFile; } needsDeclare = true; var updated = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); return ts.updateSourceFileNode(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); }), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 293 /* InputFiles */) { + if (prepend.kind === 294 /* InputFiles */) { var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal); hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib; collectReferences(sourceFile, refs); @@ -91572,7 +91971,7 @@ var ts; return name; } else { - if (name.kind === 190 /* ArrayBindingPattern */) { + if (name.kind === 191 /* ArrayBindingPattern */) { return ts.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement)); } else { @@ -91580,7 +91979,7 @@ var ts; } } function visitBindingElement(elem) { - if (elem.kind === 215 /* OmittedExpression */) { + if (elem.kind === 216 /* OmittedExpression */) { return elem; } return ts.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined); @@ -91618,7 +92017,7 @@ var ts; // Literal const declarations will have an initializer ensured rather than a type return; } - var shouldUseResolverType = node.kind === 156 /* Parameter */ && + var shouldUseResolverType = node.kind === 157 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { @@ -91627,7 +92026,7 @@ var ts; if (!ts.getParseTreeNode(node)) { return type ? ts.visitNode(type, visitDeclarationSubtree) : ts.createKeywordTypeNode(125 /* AnyKeyword */); } - if (node.kind === 164 /* SetAccessor */) { + if (node.kind === 165 /* SetAccessor */) { // Set accessors with no associated type node (from it's param or get accessor return) are `any` since they are never contextually typed right now // (The inferred type here will be void, but the old declaration emitter printed `any`, so this replicates that) return ts.createKeywordTypeNode(125 /* AnyKeyword */); @@ -91638,12 +92037,12 @@ var ts; oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node); } - if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { + if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); } - if (node.kind === 156 /* Parameter */ - || node.kind === 159 /* PropertyDeclaration */ - || node.kind === 158 /* PropertySignature */) { + if (node.kind === 157 /* Parameter */ + || node.kind === 160 /* PropertyDeclaration */ + || node.kind === 159 /* PropertySignature */) { if (!node.initializer) return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType)); return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); @@ -91660,20 +92059,20 @@ var ts; function isDeclarationAndNotVisible(node) { node = ts.getParseTreeNode(node); switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 249 /* ModuleDeclaration */: - case 246 /* InterfaceDeclaration */: - case 245 /* ClassDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 248 /* EnumDeclaration */: + case 245 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 247 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: return !resolver.isDeclarationVisible(node); // The following should be doing their own visibility checks based on filtering their members - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return !getBindingNameVisible(node); - case 253 /* ImportEqualsDeclaration */: - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: - case 259 /* ExportAssignment */: + case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 260 /* ExportAssignment */: return false; } return false; @@ -91754,7 +92153,7 @@ var ts; function rewriteModuleSpecifier(parent, input) { if (!input) return undefined; // TODO: GH#18217 - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 249 /* ModuleDeclaration */ && parent.kind !== 188 /* ImportType */); + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 250 /* ModuleDeclaration */ && parent.kind !== 189 /* ImportType */); if (ts.isStringLiteralLike(input)) { if (isBundledEmit) { var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent); @@ -91774,7 +92173,7 @@ var ts; function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 265 /* ExternalModuleReference */) { + if (decl.moduleReference.kind === 266 /* ExternalModuleReference */) { // Rewrite external module names if necessary var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl); return ts.updateImportEqualsDeclaration(decl, @@ -91801,7 +92200,7 @@ var ts; return visibleDefaultBinding && ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, /*namedBindings*/ undefined, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)); } - if (decl.importClause.namedBindings.kind === 256 /* NamespaceImport */) { + if (decl.importClause.namedBindings.kind === 257 /* NamespaceImport */) { // Namespace import (optionally with visible default) var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : /*namedBindings*/ undefined; return visibleDefaultBinding || namedBindings ? ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, namedBindings, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined; @@ -91890,7 +92289,7 @@ var ts; // We'd see a TDZ violation at runtime var canProduceDiagnostic = ts.canProduceDiagnostics(input); var oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 173 /* TypeLiteral */ || input.kind === 186 /* MappedType */) && input.parent.kind !== 247 /* TypeAliasDeclaration */); + var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 174 /* TypeLiteral */ || input.kind === 187 /* MappedType */) && input.parent.kind !== 248 /* TypeAliasDeclaration */); // Emit methods which are private as properties with no type information if (ts.isMethodDeclaration(input) || ts.isMethodSignature(input)) { if (ts.hasModifier(input, 8 /* Private */)) { @@ -91911,38 +92310,38 @@ var ts; } if (isProcessedComponent(input)) { switch (input.kind) { - case 216 /* ExpressionWithTypeArguments */: { + case 217 /* ExpressionWithTypeArguments */: { if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateExpressionWithTypeArguments(node, ts.parenthesizeTypeParameters(node.typeArguments), node.expression)); } - case 169 /* TypeReference */: { + case 170 /* TypeReference */: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateTypeReferenceNode(node, node.typeName, ts.parenthesizeTypeParameters(node.typeArguments))); } - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: return cleanup(ts.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); - case 162 /* Constructor */: { + case 163 /* Constructor */: { // A constructor declaration may not have a type annotation - var ctor = ts.createSignatureDeclaration(162 /* Constructor */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0 /* None */), + var ctor = ts.createSignatureDeclaration(163 /* Constructor */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0 /* None */), /*type*/ undefined); ctor.modifiers = ts.createNodeArray(ensureModifiers(input)); return cleanup(ctor); } - case 161 /* MethodDeclaration */: { + case 162 /* MethodDeclaration */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } - var sig = ts.createSignatureDeclaration(160 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); + var sig = ts.createSignatureDeclaration(161 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); sig.name = input.name; sig.modifiers = ts.createNodeArray(ensureModifiers(input)); sig.questionToken = input.questionToken; return cleanup(sig); } - case 163 /* GetAccessor */: { + case 164 /* GetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -91951,7 +92350,7 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8 /* Private */)), ensureType(input, accessorType), /*body*/ undefined)); } - case 164 /* SetAccessor */: { + case 165 /* SetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -91959,31 +92358,31 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8 /* Private */)), /*body*/ undefined)); } - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updateProperty(input, /*decorators*/ undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 160 /* MethodSignature */: { + case 161 /* MethodSignature */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updateMethodSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), input.name, input.questionToken)); } - case 165 /* CallSignature */: { + case 166 /* CallSignature */: { return cleanup(ts.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 167 /* IndexSignature */: { + case 168 /* IndexSignature */: { return cleanup(ts.updateIndexSignature(input, /*decorators*/ undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || ts.createKeywordTypeNode(125 /* AnyKeyword */))); } - case 242 /* VariableDeclaration */: { + case 243 /* VariableDeclaration */: { if (ts.isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -91991,13 +92390,13 @@ var ts; suppressNewDiagnosticContexts = true; // Variable declaration types also suppress new diagnostic contexts, provided the contexts wouldn't be made for binding pattern types return cleanup(ts.updateTypeScriptVariableDeclaration(input, input.name, /*exclaimationToken*/ undefined, ensureType(input, input.type), ensureNoInitializer(input))); } - case 155 /* TypeParameter */: { + case 156 /* TypeParameter */: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(ts.updateTypeParameterDeclaration(input, input.name, /*constraint*/ undefined, /*defaultType*/ undefined)); } return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context)); } - case 180 /* ConditionalType */: { + case 181 /* ConditionalType */: { // We have to process conditional types in a special way because for visibility purposes we need to push a new enclosingDeclaration // just for the `infer` types in the true branch. It's an implicit declaration scope that only applies to _part_ of the type. var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree); @@ -92009,13 +92408,13 @@ var ts; var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree); return cleanup(ts.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 170 /* FunctionType */: { + case 171 /* FunctionType */: { return cleanup(ts.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 171 /* ConstructorType */: { + case 172 /* ConstructorType */: { return cleanup(ts.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 188 /* ImportType */: { + case 189 /* ImportType */: { if (!ts.isLiteralImportTypeNode(input)) return cleanup(input); return cleanup(ts.updateImportTypeNode(input, ts.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf)); @@ -92044,7 +92443,7 @@ var ts; } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 161 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); + return node.parent.kind === 162 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -92054,7 +92453,7 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 260 /* ExportDeclaration */: { + case 261 /* ExportDeclaration */: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -92064,7 +92463,7 @@ var ts; return ts.updateExportDeclaration(input, /*decorators*/ undefined, input.modifiers, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier), input.isTypeOnly); } - case 259 /* ExportAssignment */: { + case 260 /* ExportAssignment */: { // Always visible if the parent node isn't dropped for being not visible if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; @@ -92080,7 +92479,7 @@ var ts; errorNode: input }); }; var varDecl = ts.createVariableDeclaration(newId, resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); return [statement, ts.updateExportAssignment(input, input.decorators, input.modifiers, newId)]; } } @@ -92105,10 +92504,10 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 253 /* ImportEqualsDeclaration */: { + case 254 /* ImportEqualsDeclaration */: { return transformImportEqualsDeclaration(input); } - case 254 /* ImportDeclaration */: { + case 255 /* ImportDeclaration */: { return transformImportDeclaration(input); } } @@ -92129,14 +92528,14 @@ var ts; } var previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 247 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all + case 248 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all return cleanup(ts.updateTypeAliasDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode))); - case 246 /* InterfaceDeclaration */: { + case 247 /* InterfaceDeclaration */: { return cleanup(ts.updateInterfaceDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree))); } - case 244 /* FunctionDeclaration */: { + case 245 /* FunctionDeclaration */: { // Generators lose their generator-ness, excepting their return type var clean = cleanup(ts.updateFunctionDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), @@ -92184,10 +92583,10 @@ var ts; return clean; } } - case 249 /* ModuleDeclaration */: { + case 250 /* ModuleDeclaration */: { needsDeclare = false; var inner = input.body; - if (inner && inner.kind === 250 /* ModuleBlock */) { + if (inner && inner.kind === 251 /* ModuleBlock */) { var oldNeedsScopeFix = needsScopeFixMarker; var oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; @@ -92230,7 +92629,7 @@ var ts; /*decorators*/ undefined, mods, input.name, body)); } } - case 245 /* ClassDeclaration */: { + case 246 /* ClassDeclaration */: { var modifiers = ts.createNodeArray(ensureModifiers(input)); var typeParameters = ensureTypeParams(input, input.typeParameters); var ctor = ts.getFirstConstructorWithBody(input); @@ -92291,7 +92690,7 @@ var ts; typeName: input.name }); }; var varDecl = ts.createVariableDeclaration(newId_1, resolver.createTypeOfExpression(extendsClause_1.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); var heritageClauses = ts.createNodeArray(ts.map(input.heritageClauses, function (clause) { if (clause.token === 90 /* ExtendsKeyword */) { var oldDiag_2 = getSymbolAccessibilityDiagnostic; @@ -92311,10 +92710,10 @@ var ts; /*decorators*/ undefined, modifiers, input.name, typeParameters, heritageClauses, members)); } } - case 225 /* VariableStatement */: { + case 226 /* VariableStatement */: { return cleanup(transformVariableStatement(input)); } - case 248 /* EnumDeclaration */: { + case 249 /* EnumDeclaration */: { return cleanup(ts.updateEnumDeclaration(input, /*decorators*/ undefined, ts.createNodeArray(ensureModifiers(input)), input.name, ts.createNodeArray(ts.mapDefined(input.members, function (m) { if (shouldStripInternal(m)) return; @@ -92333,7 +92732,7 @@ var ts; if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 249 /* ModuleDeclaration */) { + if (input.kind === 250 /* ModuleDeclaration */) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -92354,7 +92753,7 @@ var ts; return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); })); } function recreateBindingElement(e) { - if (e.kind === 215 /* OmittedExpression */) { + if (e.kind === 216 /* OmittedExpression */) { return; } if (e.name) { @@ -92404,7 +92803,7 @@ var ts; function ensureModifierFlags(node) { var mask = 3071 /* All */ ^ (4 /* Public */ | 256 /* Async */); // No async modifiers in declaration files var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */; - var parentIsFile = node.parent.kind === 290 /* SourceFile */; + var parentIsFile = node.parent.kind === 291 /* SourceFile */; if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) { mask ^= 2 /* Ambient */; additions = 0 /* None */; @@ -92433,7 +92832,7 @@ var ts; } ts.transformDeclarations = transformDeclarations; function isAlwaysType(node) { - if (node.kind === 246 /* InterfaceDeclaration */) { + if (node.kind === 247 /* InterfaceDeclaration */) { return true; } return false; @@ -92458,7 +92857,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 163 /* GetAccessor */ + return accessor.kind === 164 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -92467,52 +92866,52 @@ var ts; } function canHaveLiteralInitializer(node) { switch (node.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return !ts.hasModifier(node, 8 /* Private */); - case 156 /* Parameter */: - case 242 /* VariableDeclaration */: + case 157 /* Parameter */: + case 243 /* VariableDeclaration */: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 249 /* ModuleDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 246 /* InterfaceDeclaration */: - case 245 /* ClassDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 248 /* EnumDeclaration */: - case 225 /* VariableStatement */: - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: - case 259 /* ExportAssignment */: + case 245 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 247 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: + case 226 /* VariableStatement */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 260 /* ExportAssignment */: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 166 /* ConstructSignature */: - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 167 /* IndexSignature */: - case 242 /* VariableDeclaration */: - case 155 /* TypeParameter */: - case 216 /* ExpressionWithTypeArguments */: - case 169 /* TypeReference */: - case 180 /* ConditionalType */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 188 /* ImportType */: + case 167 /* ConstructSignature */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 168 /* IndexSignature */: + case 243 /* VariableDeclaration */: + case 156 /* TypeParameter */: + case 217 /* ExpressionWithTypeArguments */: + case 170 /* TypeReference */: + case 181 /* ConditionalType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 189 /* ImportType */: return true; } return false; @@ -92645,7 +93044,7 @@ var ts; * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(331 /* Count */); + var enabledSyntaxKindFeatures = new Array(332 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -93009,7 +93408,7 @@ var ts; /*@internal*/ function getOutputPathsFor(sourceFile, host, forceDtsPaths) { var options = host.getCompilerOptions(); - if (sourceFile.kind === 291 /* Bundle */) { + if (sourceFile.kind === 292 /* Bundle */) { return getOutputPathsForBundle(options, forceDtsPaths); } else { @@ -93339,7 +93738,7 @@ var ts; mapRoot: compilerOptions.mapRoot, extendedDiagnostics: compilerOptions.extendedDiagnostics, }); - if (forceDtsEmit && declarationTransform.transformed[0].kind === 290 /* SourceFile */) { + if (forceDtsEmit && declarationTransform.transformed[0].kind === 291 /* SourceFile */) { var sourceFile = declarationTransform.transformed[0]; exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit; } @@ -93362,8 +93761,8 @@ var ts; ts.forEachChild(node, collectLinkedAliases); } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) { - var bundle = sourceFileOrBundle.kind === 291 /* Bundle */ ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 290 /* SourceFile */ ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 292 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 291 /* SourceFile */ ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; var sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -93404,7 +93803,7 @@ var ts; } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { return (mapOptions.sourceMap || mapOptions.inlineSourceMap) - && (sourceFileOrBundle.kind !== 290 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); + && (sourceFileOrBundle.kind !== 291 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); } function getSourceRoot(mapOptions) { // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the @@ -93515,7 +93914,7 @@ var ts; }; function createSourceFilesFromBundleBuildInfo(bundle, buildInfoDirectory, host) { var sourceFiles = bundle.sourceFiles.map(function (fileName) { - var sourceFile = ts.createNode(290 /* SourceFile */, 0, 0); + var sourceFile = ts.createNode(291 /* SourceFile */, 0, 0); sourceFile.fileName = ts.getRelativePathFromDirectory(host.getCurrentDirectory(), ts.getNormalizedAbsolutePath(fileName, buildInfoDirectory), !host.useCaseSensitiveFileNames()); sourceFile.text = ""; sourceFile.statements = ts.createNodeArray(); @@ -93527,7 +93926,7 @@ var ts; sourceFile.text = prologueInfo.text; sourceFile.end = prologueInfo.text.length; sourceFile.statements = ts.createNodeArray(prologueInfo.directives.map(function (directive) { - var statement = ts.createNode(226 /* ExpressionStatement */, directive.pos, directive.end); + var statement = ts.createNode(227 /* ExpressionStatement */, directive.pos, directive.end); statement.expression = ts.createNode(10 /* StringLiteral */, directive.expression.pos, directive.expression.end); statement.expression.text = directive.expression.text; return statement; @@ -93704,9 +94103,9 @@ var ts; break; } switch (node.kind) { - case 290 /* SourceFile */: return printFile(node); - case 291 /* Bundle */: return printBundle(node); - case 292 /* UnparsedSource */: return printUnparsedSource(node); + case 291 /* SourceFile */: return printFile(node); + case 292 /* Bundle */: return printBundle(node); + case 293 /* UnparsedSource */: return printUnparsedSource(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); @@ -93957,12 +94356,12 @@ var ts; } // falls through case 2 /* Comments */: - if (!commentsDisabled && node.kind !== 290 /* SourceFile */) { + if (!commentsDisabled && node.kind !== 291 /* SourceFile */) { return pipelineEmitWithComments; } // falls through case 3 /* SourceMaps */: - if (!sourceMapsDisabled && node.kind !== 290 /* SourceFile */ && !ts.isInJsonFile(node)) { + if (!sourceMapsDisabled && node.kind !== 291 /* SourceFile */ && !ts.isInJsonFile(node)) { return pipelineEmitWithSourceMap; } // falls through @@ -94004,15 +94403,15 @@ var ts; case 16 /* TemplateMiddle */: case 17 /* TemplateTail */: return emitLiteral(node, /*jsxAttributeEscape*/ false); - case 292 /* UnparsedSource */: - case 286 /* UnparsedPrepend */: + case 293 /* UnparsedSource */: + case 287 /* UnparsedPrepend */: return emitUnparsedSourceOrPrepend(node); - case 285 /* UnparsedPrologue */: + case 286 /* UnparsedPrologue */: return writeUnparsedNode(node); - case 287 /* UnparsedText */: - case 288 /* UnparsedInternalText */: + case 288 /* UnparsedText */: + case 289 /* UnparsedInternalText */: return emitUnparsedTextLike(node); - case 289 /* UnparsedSyntheticReference */: + case 290 /* UnparsedSyntheticReference */: return emitUnparsedSyntheticReference(node); // Identifiers case 75 /* Identifier */: @@ -94022,260 +94421,260 @@ var ts; return emitPrivateIdentifier(node); // Parse tree nodes // Names - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return emitQualifiedName(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return emitTypeParameter(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return emitParameter(node); - case 157 /* Decorator */: + case 158 /* Decorator */: return emitDecorator(node); // Type members - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: return emitPropertySignature(node); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 160 /* MethodSignature */: + case 161 /* MethodSignature */: return emitMethodSignature(node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return emitConstructor(node); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return emitAccessorDeclaration(node); - case 165 /* CallSignature */: + case 166 /* CallSignature */: return emitCallSignature(node); - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: return emitConstructSignature(node); - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: return emitIndexSignature(node); // Types - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return emitTypePredicate(node); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return emitTypeReference(node); - case 170 /* FunctionType */: + case 171 /* FunctionType */: return emitFunctionType(node); - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 171 /* ConstructorType */: + case 172 /* ConstructorType */: return emitConstructorType(node); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return emitTypeQuery(node); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return emitTypeLiteral(node); - case 174 /* ArrayType */: + case 175 /* ArrayType */: return emitArrayType(node); - case 175 /* TupleType */: + case 176 /* TupleType */: return emitTupleType(node); - case 176 /* OptionalType */: + case 177 /* OptionalType */: return emitOptionalType(node); - case 178 /* UnionType */: + case 179 /* UnionType */: return emitUnionType(node); - case 179 /* IntersectionType */: + case 180 /* IntersectionType */: return emitIntersectionType(node); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return emitConditionalType(node); - case 181 /* InferType */: + case 182 /* InferType */: return emitInferType(node); - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return emitParenthesizedType(node); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 183 /* ThisType */: + case 184 /* ThisType */: return emitThisType(); - case 184 /* TypeOperator */: + case 185 /* TypeOperator */: return emitTypeOperator(node); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 186 /* MappedType */: + case 187 /* MappedType */: return emitMappedType(node); - case 187 /* LiteralType */: + case 188 /* LiteralType */: return emitLiteralType(node); - case 188 /* ImportType */: + case 189 /* ImportType */: return emitImportTypeNode(node); - case 295 /* JSDocAllType */: + case 296 /* JSDocAllType */: writePunctuation("*"); return; - case 296 /* JSDocUnknownType */: + case 297 /* JSDocUnknownType */: writePunctuation("?"); return; - case 297 /* JSDocNullableType */: + case 298 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 298 /* JSDocNonNullableType */: + case 299 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 299 /* JSDocOptionalType */: + case 300 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 177 /* RestType */: - case 301 /* JSDocVariadicType */: + case 178 /* RestType */: + case 302 /* JSDocVariadicType */: return emitRestOrJSDocVariadicType(node); // Binding patterns - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return emitBindingElement(node); // Misc - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return emitTemplateSpan(node); - case 222 /* SemicolonClassElement */: + case 223 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 223 /* Block */: + case 224 /* Block */: return emitBlock(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return emitVariableStatement(node); - case 224 /* EmptyStatement */: + case 225 /* EmptyStatement */: return emitEmptyStatement(/*isEmbeddedStatement*/ false); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return emitExpressionStatement(node); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return emitIfStatement(node); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return emitDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return emitWhileStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return emitForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return emitForInStatement(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return emitForOfStatement(node); - case 233 /* ContinueStatement */: + case 234 /* ContinueStatement */: return emitContinueStatement(node); - case 234 /* BreakStatement */: + case 235 /* BreakStatement */: return emitBreakStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return emitReturnStatement(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return emitWithStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return emitSwitchStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return emitLabeledStatement(node); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return emitThrowStatement(node); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return emitTryStatement(node); - case 241 /* DebuggerStatement */: + case 242 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return emitClassDeclaration(node); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return emitModuleBlock(node); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return emitCaseBlock(node); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return emitImportDeclaration(node); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return emitImportClause(node); - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return emitNamespaceImport(node); - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: return emitNamespaceExport(node); - case 257 /* NamedImports */: + case 258 /* NamedImports */: return emitNamedImports(node); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return emitImportSpecifier(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return emitExportAssignment(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return emitExportDeclaration(node); - case 261 /* NamedExports */: + case 262 /* NamedExports */: return emitNamedExports(node); - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: return emitExportSpecifier(node); - case 264 /* MissingDeclaration */: + case 265 /* MissingDeclaration */: return; // Module references - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 11 /* JsxText */: return emitJsxText(node); - case 268 /* JsxOpeningElement */: - case 271 /* JsxOpeningFragment */: + case 269 /* JsxOpeningElement */: + case 272 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 269 /* JsxClosingElement */: - case 272 /* JsxClosingFragment */: + case 270 /* JsxClosingElement */: + case 273 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return emitJsxAttribute(node); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return emitJsxAttributes(node); - case 275 /* JsxSpreadAttribute */: + case 276 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 277 /* CaseClause */: + case 278 /* CaseClause */: return emitCaseClause(node); - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: return emitDefaultClause(node); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: return emitHeritageClause(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 284 /* EnumMember */: + case 285 /* EnumMember */: return emitEnumMember(node); // JSDoc nodes (only used in codefixes currently) - case 317 /* JSDocParameterTag */: - case 323 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: + case 324 /* JSDocPropertyTag */: return emitJSDocPropertyLikeTag(node); - case 318 /* JSDocReturnTag */: - case 320 /* JSDocTypeTag */: - case 319 /* JSDocThisTag */: - case 316 /* JSDocEnumTag */: + case 319 /* JSDocReturnTag */: + case 321 /* JSDocTypeTag */: + case 320 /* JSDocThisTag */: + case 317 /* JSDocEnumTag */: return emitJSDocSimpleTypedTag(node); - case 308 /* JSDocImplementsTag */: - case 307 /* JSDocAugmentsTag */: + case 309 /* JSDocImplementsTag */: + case 308 /* JSDocAugmentsTag */: return emitJSDocHeritageTag(node); - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); - case 322 /* JSDocTypedefTag */: + case 323 /* JSDocTypedefTag */: return emitJSDocTypedefTag(node); - case 315 /* JSDocCallbackTag */: + case 316 /* JSDocCallbackTag */: return emitJSDocCallbackTag(node); - case 305 /* JSDocSignature */: + case 306 /* JSDocSignature */: return emitJSDocSignature(node); - case 304 /* JSDocTypeLiteral */: + case 305 /* JSDocTypeLiteral */: return emitJSDocTypeLiteral(node); - case 310 /* JSDocClassTag */: - case 306 /* JSDocTag */: + case 311 /* JSDocClassTag */: + case 307 /* JSDocTag */: return emitJSDocSimpleTag(node); - case 303 /* JSDocComment */: + case 304 /* JSDocComment */: return emitJSDoc(node); // Transformation nodes (ignored) } @@ -94312,71 +94711,71 @@ var ts; writeTokenNode(node, writeKeyword); return; // Expressions - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return emitCallExpression(node); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return emitNewExpression(node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return emitFunctionExpression(node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return emitArrowFunction(node); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return emitDeleteExpression(node); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return emitVoidExpression(node); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return emitAwaitExpression(node); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return emitBinaryExpression(node); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return emitConditionalExpression(node); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: return emitTemplateExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return emitYieldExpression(node); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return emitSpreadExpression(node); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return emitClassExpression(node); - case 215 /* OmittedExpression */: + case 216 /* OmittedExpression */: return; - case 217 /* AsExpression */: + case 218 /* AsExpression */: return emitAsExpression(node); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: return emitNonNullExpression(node); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return emitMetaProperty(node); // JSX - case 266 /* JsxElement */: + case 267 /* JsxElement */: return emitJsxElement(node); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return emitJsxFragment(node); // Transformation nodes - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: return emitCommaList(node); } } @@ -94418,7 +94817,7 @@ var ts; } function emitHelpers(node) { var helpersEmitted = false; - var bundle = node.kind === 291 /* Bundle */ ? node : undefined; + var bundle = node.kind === 292 /* Bundle */ ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -94518,7 +94917,7 @@ var ts; var pos = getTextPosWithWriteLine(); writeUnparsedNode(unparsed); if (bundleFileInfo) { - updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 287 /* UnparsedText */ ? + updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 288 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */); } @@ -94591,7 +94990,7 @@ var ts; emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 300 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 301 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { @@ -94653,7 +95052,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - writeKeyword(node.kind === 163 /* GetAccessor */ ? "get" : "set"); + writeKeyword(node.kind === 164 /* GetAccessor */ ? "get" : "set"); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -94836,7 +95235,7 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - if (node.readonlyToken.kind !== 138 /* ReadonlyKeyword */) { + if (node.readonlyToken.kind !== 139 /* ReadonlyKeyword */) { writeKeyword("readonly"); } writeSpace(); @@ -94927,7 +95326,7 @@ var ts; } function emitPropertyAccessExpression(node) { var expression = ts.cast(emitExpression(node.expression), ts.isExpression); - var token = ts.getDotOrQuestionDotToken(node); + var token = node.questionDotToken || ts.createNode(24 /* DotToken */, node.expression.end, node.name.pos); var indentBeforeDot = needsIndentation(node, node.expression, token); var indentAfterDot = needsIndentation(node, token, node.name); increaseIndentIf(indentBeforeDot, /*writeSpaceIfNotIndenting*/ false); @@ -94938,7 +95337,12 @@ var ts; if (shouldEmitDotDot) { writePunctuation("."); } - emitTokenWithComment(token.kind, node.expression.end, writePunctuation, node); + if (node.questionDotToken) { + emit(token); + } + else { + emitTokenWithComment(token.kind, node.expression.end, writePunctuation, node); + } increaseIndentIf(indentAfterDot, /*writeSpaceIfNotIndenting*/ false); emit(node.name); decreaseIndentIf(indentBeforeDot, indentAfterDot); @@ -95056,7 +95460,7 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 207 /* PrefixUnaryExpression */ + return operand.kind === 208 /* PrefixUnaryExpression */ && ((node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */)) || (node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */))); } @@ -95244,7 +95648,7 @@ var ts; if (node.elseStatement) { writeLineOrSpace(node); emitTokenWithComment(87 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 227 /* IfStatement */) { + if (node.elseStatement.kind === 228 /* IfStatement */) { writeSpace(); emit(node.elseStatement); } @@ -95307,7 +95711,7 @@ var ts; emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - emitTokenWithComment(152 /* OfKeyword */, node.initializer.end, writeKeyword, node); + emitTokenWithComment(153 /* OfKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); @@ -95315,7 +95719,7 @@ var ts; } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 243 /* VariableDeclarationList */) { + if (node.kind === 244 /* VariableDeclarationList */) { emit(node); } else { @@ -95611,7 +96015,7 @@ var ts; var body = node.body; if (!body) return writeTrailingSemicolon(); - while (body.kind === 249 /* ModuleDeclaration */) { + while (body.kind === 250 /* ModuleDeclaration */) { writePunctuation("."); emit(body.name); body = body.body; @@ -95656,7 +96060,7 @@ var ts; if (node.importClause) { emit(node.importClause); writeSpace(); - emitTokenWithComment(149 /* FromKeyword */, node.importClause.end, writeKeyword, node); + emitTokenWithComment(150 /* FromKeyword */, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -95664,7 +96068,7 @@ var ts; } function emitImportClause(node) { if (node.isTypeOnly) { - emitTokenWithComment(145 /* TypeKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(146 /* TypeKeyword */, node.pos, writeKeyword, node); writeSpace(); } emit(node.name); @@ -95704,7 +96108,7 @@ var ts; var nextPos = emitTokenWithComment(89 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { - nextPos = emitTokenWithComment(145 /* TypeKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(146 /* TypeKeyword */, nextPos, writeKeyword, node); writeSpace(); } if (node.exportClause) { @@ -95716,7 +96120,7 @@ var ts; if (node.moduleSpecifier) { writeSpace(); var fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(149 /* FromKeyword */, fromPos, writeKeyword, node); + emitTokenWithComment(150 /* FromKeyword */, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } @@ -95727,7 +96131,7 @@ var ts; writeSpace(); nextPos = emitTokenWithComment(123 /* AsKeyword */, nextPos, writeKeyword, node); writeSpace(); - nextPos = emitTokenWithComment(136 /* NamespaceKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(137 /* NamespaceKeyword */, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeTrailingSemicolon(); @@ -95947,7 +96351,7 @@ var ts; } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 320 /* JSDocTypeTag */ && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 321 /* JSDocTypeTag */ && !node.comment) { writeSpace(); emit(node.tags[0]); } @@ -95981,7 +96385,7 @@ var ts; function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 294 /* JSDocTypeExpression */) { + if (tag.typeExpression.kind === 295 /* JSDocTypeExpression */) { emitJSDocTypeExpression(tag.typeExpression); } else { @@ -96000,7 +96404,7 @@ var ts; emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 304 /* JSDocTypeLiteral */) { + if (tag.typeExpression && tag.typeExpression.kind === 305 /* JSDocTypeLiteral */) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -96780,7 +97184,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 200 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 201 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -96845,84 +97249,84 @@ var ts; if (!node) return; switch (node.kind) { - case 223 /* Block */: + case 224 /* Block */: ts.forEach(node.statements, generateNames); break; - case 238 /* LabeledStatement */: - case 236 /* WithStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 239 /* LabeledStatement */: + case 237 /* WithStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: generateNames(node.statement); break; - case 227 /* IfStatement */: + case 228 /* IfStatement */: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: - case 231 /* ForInStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: + case 232 /* ForInStatement */: generateNames(node.initializer); generateNames(node.statement); break; - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: generateNames(node.caseBlock); break; - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: ts.forEach(node.clauses, generateNames); break; - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: ts.forEach(node.statements, generateNames); break; - case 240 /* TryStatement */: + case 241 /* TryStatement */: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 280 /* CatchClause */: + case 281 /* CatchClause */: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: generateNames(node.declarationList); break; - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: ts.forEach(node.declarations, generateNames); break; - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 191 /* BindingElement */: - case 245 /* ClassDeclaration */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 192 /* BindingElement */: + case 246 /* ClassDeclaration */: generateNameIfNeeded(node.name); break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: generateNameIfNeeded(node.name); if (ts.getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) { ts.forEach(node.parameters, generateNames); generateNames(node.body); } break; - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: ts.forEach(node.elements, generateNames); break; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: generateNames(node.importClause); break; - case 255 /* ImportClause */: + case 256 /* ImportClause */: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: generateNameIfNeeded(node.name); break; - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: generateNameIfNeeded(node.name); break; - case 257 /* NamedImports */: + case 258 /* NamedImports */: ts.forEach(node.elements, generateNames); break; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -96931,12 +97335,12 @@ var ts; if (!node) return; switch (node.kind) { - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: generateNameIfNeeded(node.name); break; } @@ -97118,23 +97522,23 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16 /* Optimistic */), !!(flags & 8 /* ReservedInNestedScopes */)); - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 259 /* ExportAssignment */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 260 /* ExportAssignment */: return generateNameForExportDefault(); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return generateNameForClassExpression(); - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return generateNameForMethodOrAccessor(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return makeTempVariableName(0 /* Auto */, /*reserveInNestedScopes*/ true); default: return makeTempVariableName(0 /* Auto */); @@ -97182,7 +97586,7 @@ var ts; hasWrittenComment = false; var emitFlags = ts.getEmitFlags(node); var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var isEmittedNode = node.kind !== 325 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 326 /* NotEmittedStatement */; // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is "preserve" we will not do any transformation. // It is expensive to walk entire tree just to set one kind of node to have no comments. var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 11 /* JsxText */; @@ -97206,7 +97610,7 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 243 /* VariableDeclarationList */) { + if (node.kind === 244 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -97465,7 +97869,7 @@ var ts; else { var _a = ts.getSourceMapRange(node), pos = _a.pos, end = _a.end, _b = _a.source, source = _b === void 0 ? sourceMapSource : _b; var emitFlags = ts.getEmitFlags(node); - if (node.kind !== 325 /* NotEmittedStatement */ + if (node.kind !== 326 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitSourcePos(source, skipSourceTrivia(source, pos)); @@ -97478,7 +97882,7 @@ var ts; else { pipelinePhase(hint, node); } - if (node.kind !== 325 /* NotEmittedStatement */ + if (node.kind !== 326 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitSourcePos(source, end); @@ -97938,7 +98342,6 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var ignoreDiagnosticCommentRegEx = /(^\s*$)|(^\s*\/\/\/?\s*(@ts-ignore)?)/; function findConfigFile(searchPath, fileExists, configName) { if (configName === void 0) { configName = "tsconfig.json"; } return ts.forEachAncestorDirectory(searchPath, function (ancestor) { @@ -98508,6 +98911,7 @@ var ts; }; } function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) { + var _a; var createProgramOptions = ts.isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions; // TODO: GH#18217 var rootNames = createProgramOptions.rootNames, options = createProgramOptions.options, configFileParsingDiagnostics = createProgramOptions.configFileParsingDiagnostics, projectReferences = createProgramOptions.projectReferences; var oldProgram = createProgramOptions.oldProgram; @@ -98604,7 +99008,16 @@ var ts; var projectReferenceRedirects; var mapFromFileToProjectReferenceRedirects; var mapFromToProjectReferenceRedirectSource; - var useSourceOfProjectReferenceRedirect = !!host.useSourceOfProjectReferenceRedirect && host.useSourceOfProjectReferenceRedirect(); + var useSourceOfProjectReferenceRedirect = !!((_a = host.useSourceOfProjectReferenceRedirect) === null || _a === void 0 ? void 0 : _a.call(host)) && + !options.disableSourceOfProjectReferenceRedirect; + var onProgramCreateComplete = updateHostForUseSourceOfProjectReferenceRedirect({ + compilerHost: host, + useSourceOfProjectReferenceRedirect: useSourceOfProjectReferenceRedirect, + toPath: toPath, + getResolvedProjectReferences: getResolvedProjectReferences, + getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, + forEachResolvedProjectReference: forEachResolvedProjectReference + }); var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); // We set `structuralIsReused` to `undefined` because `tryReuseStructureFromOldProgram` calls `tryReuseStructureFromOldProgram` which checks // `structuralIsReused`, which would be a TDZ violation if it was not set in advance to `undefined`. @@ -98617,12 +99030,6 @@ var ts; if (!resolvedProjectReferences) { resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); } - if (host.setResolvedProjectReferenceCallbacks) { - host.setResolvedProjectReferenceCallbacks({ - getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, - forEachResolvedProjectReference: forEachResolvedProjectReference - }); - } if (rootNames.length) { for (var _i = 0, resolvedProjectReferences_1 = resolvedProjectReferences; _i < resolvedProjectReferences_1.length; _i++) { var parsedRef = resolvedProjectReferences_1[_i]; @@ -98631,8 +99038,8 @@ var ts; var out = parsedRef.commandLine.options.outFile || parsedRef.commandLine.options.out; if (useSourceOfProjectReferenceRedirect) { if (out || ts.getEmitModuleKind(parsedRef.commandLine.options) === ts.ModuleKind.None) { - for (var _a = 0, _b = parsedRef.commandLine.fileNames; _a < _b.length; _a++) { - var fileName = _b[_a]; + for (var _b = 0, _c = parsedRef.commandLine.fileNames; _b < _c.length; _b++) { + var fileName = _c[_b]; processSourceFile(fileName, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined); } } @@ -98642,8 +99049,8 @@ var ts; processSourceFile(ts.changeExtension(out, ".d.ts"), /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined); } else if (ts.getEmitModuleKind(parsedRef.commandLine.options) === ts.ModuleKind.None) { - for (var _c = 0, _d = parsedRef.commandLine.fileNames; _c < _d.length; _c++) { - var fileName = _d[_c]; + for (var _d = 0, _e = parsedRef.commandLine.fileNames; _d < _e.length; _d++) { + var fileName = _e[_d]; if (!ts.fileExtensionIs(fileName, ".d.ts" /* Dts */) && !ts.fileExtensionIs(fileName, ".json" /* Json */)) { processSourceFile(ts.getOutputDeclarationFileName(fileName, parsedRef.commandLine, !host.useCaseSensitiveFileNames()), /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined); } @@ -98695,8 +99102,8 @@ var ts; // not part of the new program. if (oldProgram && host.onReleaseOldSourceFile) { var oldSourceFiles = oldProgram.getSourceFiles(); - for (var _e = 0, oldSourceFiles_1 = oldSourceFiles; _e < oldSourceFiles_1.length; _e++) { - var oldSourceFile = oldSourceFiles_1[_e]; + for (var _f = 0, oldSourceFiles_1 = oldSourceFiles; _f < oldSourceFiles_1.length; _f++) { + var oldSourceFile = oldSourceFiles_1[_f]; var newFile = getSourceFileByPath(oldSourceFile.resolvedPath); if (shouldCreateNewSourceFile || !newFile || // old file wasnt redirect but new file is @@ -98761,8 +99168,10 @@ var ts; forEachResolvedProjectReference: forEachResolvedProjectReference, isSourceOfProjectReferenceRedirect: isSourceOfProjectReferenceRedirect, emitBuildInfo: emitBuildInfo, - getProbableSymlinks: getProbableSymlinks + getProbableSymlinks: getProbableSymlinks, + useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); }, }; + onProgramCreateComplete(); verifyCompilerOptions(); ts.performance.mark("afterProgram"); ts.performance.measure("Program", "beforeProgram", "afterProgram"); @@ -99008,12 +99417,6 @@ var ts; } if (projectReferences) { resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); - if (host.setResolvedProjectReferenceCallbacks) { - host.setResolvedProjectReferenceCallbacks({ - getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, - forEachResolvedProjectReference: forEachResolvedProjectReference - }); - } } // check if program source files has changed in the way that can affect structure of the program var newSourceFiles = []; @@ -99337,19 +99740,19 @@ var ts; } var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName); var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName); - var diagnostics; - for (var _i = 0, _a = [fileProcessingDiagnosticsInFile, programDiagnosticsInFile]; _i < _a.length; _i++) { - var diags = _a[_i]; - if (diags) { - for (var _b = 0, diags_4 = diags; _b < diags_4.length; _b++) { - var diag = diags_4[_b]; - if (shouldReportDiagnostic(diag)) { - diagnostics = ts.append(diagnostics, diag); - } - } - } + return getMergedProgramDiagnostics(sourceFile, fileProcessingDiagnosticsInFile, programDiagnosticsInFile); + } + function getMergedProgramDiagnostics(sourceFile) { + var allDiagnostics = []; + for (var _i = 1; _i < arguments.length; _i++) { + allDiagnostics[_i - 1] = arguments[_i]; } - return diagnostics || ts.emptyArray; + var _a; + var flatDiagnostics = ts.flatten(allDiagnostics); + if (!((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { + return flatDiagnostics; + } + return getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics).diagnostics; } function getDeclarationDiagnostics(sourceFile, cancellationToken) { var options = program.getCompilerOptions(); @@ -99413,49 +99816,66 @@ var ts; sourceFile.scriptKind === 5 /* External */ || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */); var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray; var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray; - var diagnostics; - for (var _i = 0, _a = [bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined]; _i < _a.length; _i++) { - var diags = _a[_i]; - if (diags) { - for (var _b = 0, diags_5 = diags; _b < diags_5.length; _b++) { - var diag = diags_5[_b]; - if (shouldReportDiagnostic(diag)) { - diagnostics = ts.append(diagnostics, diag); - } - } - } - } - return diagnostics || ts.emptyArray; + return getMergedBindAndCheckDiagnostics(sourceFile, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined); }); } + function getMergedBindAndCheckDiagnostics(sourceFile) { + var allDiagnostics = []; + for (var _i = 1; _i < arguments.length; _i++) { + allDiagnostics[_i - 1] = arguments[_i]; + } + var _a; + var flatDiagnostics = ts.flatten(allDiagnostics); + if (!((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { + return flatDiagnostics; + } + var _b = getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics), diagnostics = _b.diagnostics, directives = _b.directives; + for (var _c = 0, _d = directives.getUnusedExpectations(); _c < _d.length; _c++) { + var errorExpectation = _d[_c]; + diagnostics.push(ts.createDiagnosticForRange(sourceFile, errorExpectation.range, ts.Diagnostics.Unused_ts_expect_error_directive)); + } + return diagnostics; + } + /** + * Creates a map of comment directives along with the diagnostics immediately preceded by one of them. + * Comments that match to any of those diagnostics are marked as used. + */ + function getDiagnosticsWithPrecedingDirectives(sourceFile, commentDirectives, flatDiagnostics) { + // Diagnostics are only reported if there is no comment directive preceding them + // This will modify the directives map by marking "used" ones with a corresponding diagnostic + var directives = ts.createCommentDirectivesMap(sourceFile, commentDirectives); + var diagnostics = flatDiagnostics.filter(function (diagnostic) { return markPrecedingCommentDirectiveLine(diagnostic, directives) === -1; }); + return { diagnostics: diagnostics, directives: directives }; + } function getSuggestionDiagnostics(sourceFile, cancellationToken) { return runWithCancellationToken(function () { return getDiagnosticsProducingTypeChecker().getSuggestionDiagnostics(sourceFile, cancellationToken); }); } /** - * Skip errors if previous line start with '// @ts-ignore' comment, not counting non-empty non-comment lines + * @returns The line index marked as preceding the diagnostic, or -1 if none was. */ - function shouldReportDiagnostic(diagnostic) { + function markPrecedingCommentDirectiveLine(diagnostic, directives) { var file = diagnostic.file, start = diagnostic.start; - if (file) { - var lineStarts = ts.getLineStarts(file); - var line = ts.computeLineAndCharacterOfPosition(lineStarts, start).line; // TODO: GH#18217 - while (line > 0) { - var previousLineText = file.text.slice(lineStarts[line - 1], lineStarts[line]); - var result = ignoreDiagnosticCommentRegEx.exec(previousLineText); - if (!result) { - // non-empty line - return true; - } - if (result[3]) { - // @ts-ignore - return false; - } - line--; + if (!file) { + return -1; + } + // Start out with the line just before the text + var lineStarts = ts.getLineStarts(file); + var line = ts.computeLineAndCharacterOfPosition(lineStarts, start).line - 1; // TODO: GH#18217 + while (line >= 0) { + // As soon as that line is known to have a comment directive, use that + if (directives.markUsed(line)) { + return line; + } + // Stop searching if the line is not empty and not a comment + var lineText = file.text.slice(lineStarts[line - 1], lineStarts[line]).trim(); + if (lineText !== "" && !/^(\s*)\/\/(.*)$/.test(lineText)) { + return -1; } + line--; } - return true; + return -1; } function getJSSyntacticDiagnosticsForFile(sourceFile) { return runWithCancellationToken(function () { @@ -99467,22 +99887,22 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 156 /* Parameter */: - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: + case 157 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); return "skip"; } // falls through - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: - case 242 /* VariableDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: + case 243 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); @@ -99490,58 +99910,58 @@ var ts; } } switch (node.kind) { - case 255 /* ImportClause */: + case 256 /* ImportClause */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node.parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); return "skip"; } break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); return "skip"; } break; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_TypeScript_files)); return "skip"; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 113 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: var interfaceKeyword = ts.tokenToString(114 /* InterfaceKeyword */); ts.Debug.assertIsDefined(interfaceKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); return "skip"; - case 249 /* ModuleDeclaration */: - var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(136 /* NamespaceKeyword */) : ts.tokenToString(135 /* ModuleKeyword */); + case 250 /* ModuleDeclaration */: + var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(137 /* NamespaceKeyword */) : ts.tokenToString(136 /* ModuleKeyword */); ts.Debug.assertIsDefined(moduleKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); return "skip"; - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); return "skip"; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: var enumKeyword = ts.Debug.checkDefined(ts.tokenToString(88 /* EnumKeyword */)); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); return "skip"; - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 217 /* AsExpression */: + case 218 /* AsExpression */: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } } @@ -99550,29 +99970,29 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); } switch (parent.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } // falls through - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - checkModifiers(parent.modifiers, parent.kind === 225 /* VariableStatement */); + checkModifiers(parent.modifiers, parent.kind === 226 /* VariableStatement */); return "skip"; } break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -99584,19 +100004,19 @@ var ts; return "skip"; } break; - case 156 /* Parameter */: + case 157 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 216 /* ExpressionWithTypeArguments */: - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: - case 198 /* TaggedTemplateExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 217 /* ExpressionWithTypeArguments */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 199 /* TaggedTemplateExpression */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); @@ -99618,8 +100038,8 @@ var ts; case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - case 138 /* ReadonlyKeyword */: - case 130 /* DeclareKeyword */: + case 139 /* ReadonlyKeyword */: + case 131 /* DeclareKeyword */: case 122 /* AbstractKeyword */: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind))); break; @@ -100861,6 +101281,155 @@ var ts; } } ts.createProgram = createProgram; + function updateHostForUseSourceOfProjectReferenceRedirect(host) { + var mapOfDeclarationDirectories; + var symlinkedDirectories; + var symlinkedFiles; + var originalFileExists = host.compilerHost.fileExists; + var originalDirectoryExists = host.compilerHost.directoryExists; + var originalGetDirectories = host.compilerHost.getDirectories; + var originalRealpath = host.compilerHost.realpath; + if (!host.useSourceOfProjectReferenceRedirect) + return ts.noop; + // This implementation of fileExists checks if the file being requested is + // .d.ts file for the referenced Project. + // If it is it returns true irrespective of whether that file exists on host + host.compilerHost.fileExists = function (file) { + if (originalFileExists.call(host.compilerHost, file)) + return true; + if (!host.getResolvedProjectReferences()) + return false; + if (!ts.isDeclarationFileName(file)) + return false; + // Project references go to source file instead of .d.ts file + return fileOrDirectoryExistsUsingSource(file, /*isFile*/ true); + }; + if (originalDirectoryExists) { + // This implementation of directoryExists checks if the directory being requested is + // directory of .d.ts file for the referenced Project. + // If it is it returns true irrespective of whether that directory exists on host + host.compilerHost.directoryExists = function (path) { + if (originalDirectoryExists.call(host.compilerHost, path)) { + handleDirectoryCouldBeSymlink(path); + return true; + } + if (!host.getResolvedProjectReferences()) + return false; + if (!mapOfDeclarationDirectories) { + mapOfDeclarationDirectories = ts.createMap(); + host.forEachResolvedProjectReference(function (ref) { + if (!ref) + return; + var out = ref.commandLine.options.outFile || ref.commandLine.options.out; + if (out) { + mapOfDeclarationDirectories.set(ts.getDirectoryPath(host.toPath(out)), true); + } + else { + // Set declaration's in different locations only, if they are next to source the directory present doesnt change + var declarationDir = ref.commandLine.options.declarationDir || ref.commandLine.options.outDir; + if (declarationDir) { + mapOfDeclarationDirectories.set(host.toPath(declarationDir), true); + } + } + }); + } + return fileOrDirectoryExistsUsingSource(path, /*isFile*/ false); + }; + } + if (originalGetDirectories) { + // Call getDirectories only if directory actually present on the host + // This is needed to ensure that we arent getting directories that we fake about presence for + host.compilerHost.getDirectories = function (path) { + return !host.getResolvedProjectReferences() || (originalDirectoryExists && originalDirectoryExists.call(host.compilerHost, path)) ? + originalGetDirectories.call(host.compilerHost, path) : + []; + }; + } + // This is something we keep for life time of the host + if (originalRealpath) { + host.compilerHost.realpath = function (s) { + return (symlinkedFiles === null || symlinkedFiles === void 0 ? void 0 : symlinkedFiles.get(host.toPath(s))) || + originalRealpath.call(host.compilerHost, s); + }; + } + return onProgramCreateComplete; + function onProgramCreateComplete() { + host.compilerHost.fileExists = originalFileExists; + host.compilerHost.directoryExists = originalDirectoryExists; + host.compilerHost.getDirectories = originalGetDirectories; + // DO not revert realpath as it could be used later + } + function fileExistsIfProjectReferenceDts(file) { + var source = host.getSourceOfProjectReferenceRedirect(file); + return source !== undefined ? + ts.isString(source) ? originalFileExists.call(host.compilerHost, source) : true : + undefined; + } + function directoryExistsIfProjectReferenceDeclDir(dir) { + var dirPath = host.toPath(dir); + var dirPathWithTrailingDirectorySeparator = "" + dirPath + ts.directorySeparator; + return ts.forEachKey(mapOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath || + // Any parent directory of declaration dir + ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) || + // Any directory inside declaration dir + ts.startsWith(dirPath, declDirPath + "/"); }); + } + function handleDirectoryCouldBeSymlink(directory) { + if (!host.getResolvedProjectReferences()) + return; + // Because we already watch node_modules, handle symlinks in there + if (!originalRealpath || !ts.stringContains(directory, ts.nodeModulesPathPart)) + return; + if (!symlinkedDirectories) + symlinkedDirectories = ts.createMap(); + var directoryPath = ts.ensureTrailingDirectorySeparator(host.toPath(directory)); + if (symlinkedDirectories.has(directoryPath)) + return; + var real = ts.normalizePath(originalRealpath.call(host.compilerHost, directory)); + var realPath; + if (real === directory || + (realPath = ts.ensureTrailingDirectorySeparator(host.toPath(real))) === directoryPath) { + // not symlinked + symlinkedDirectories.set(directoryPath, false); + return; + } + symlinkedDirectories.set(directoryPath, { + real: ts.ensureTrailingDirectorySeparator(real), + realPath: realPath + }); + } + function fileOrDirectoryExistsUsingSource(fileOrDirectory, isFile) { + var fileOrDirectoryExistsUsingSource = isFile ? + function (file) { return fileExistsIfProjectReferenceDts(file); } : + function (dir) { return directoryExistsIfProjectReferenceDeclDir(dir); }; + // Check current directory or file + var result = fileOrDirectoryExistsUsingSource(fileOrDirectory); + if (result !== undefined) + return result; + if (!symlinkedDirectories) + return false; + var fileOrDirectoryPath = host.toPath(fileOrDirectory); + if (!ts.stringContains(fileOrDirectoryPath, ts.nodeModulesPathPart)) + return false; + if (isFile && symlinkedFiles && symlinkedFiles.has(fileOrDirectoryPath)) + return true; + // If it contains node_modules check if its one of the symlinked path we know of + return ts.firstDefinedIterator(symlinkedDirectories.entries(), function (_a) { + var directoryPath = _a[0], symlinkedDirectory = _a[1]; + if (!symlinkedDirectory || !ts.startsWith(fileOrDirectoryPath, directoryPath)) + return undefined; + var result = fileOrDirectoryExistsUsingSource(fileOrDirectoryPath.replace(directoryPath, symlinkedDirectory.realPath)); + if (isFile && result) { + if (!symlinkedFiles) + symlinkedFiles = ts.createMap(); + // Store the real path for the file' + var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory()); + symlinkedFiles.set(fileOrDirectoryPath, "" + symlinkedDirectory.real + absolutePath.replace(new RegExp(directoryPath, "i"), "")); + } + return result; + }) || false; + } + } /*@internal*/ function handleNoEmitOptions(program, sourceFile, cancellationToken) { var options = program.getCompilerOptions(); @@ -101481,6 +102050,7 @@ var ts; state.affectedFilesPendingEmit = oldState.affectedFilesPendingEmit.slice(); state.affectedFilesPendingEmitKind = ts.cloneMapOrUndefined(oldState.affectedFilesPendingEmitKind); state.affectedFilesPendingEmitIndex = oldState.affectedFilesPendingEmitIndex; + state.seenAffectedFiles = ts.createMap(); } } // Update changed files and copy semantic diagnostics if we can @@ -101526,8 +102096,8 @@ var ts; if (oldCompilerOptions && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) { // Add all files to affectedFilesPendingEmit since emit changed newProgram.getSourceFiles().forEach(function (f) { return addToAffectedFilesPendingEmit(state, f.resolvedPath, 1 /* Full */); }); - ts.Debug.assert(state.seenAffectedFiles === undefined); - state.seenAffectedFiles = ts.createMap(); + ts.Debug.assert(!state.seenAffectedFiles || !state.seenAffectedFiles.size); + state.seenAffectedFiles = state.seenAffectedFiles || ts.createMap(); } state.emittedBuildInfo = !state.changedFilesSet.size && !state.affectedFilesPendingEmit; return state; @@ -102407,13 +102977,13 @@ var ts; return true; } ts.canWatchDirectory = canWatchDirectory; - ts.maxNumberOfFilesToIterateForInvalidation = 256; function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) { var filesWithChangedSetOfUnresolvedImports; var filesWithInvalidatedResolutions; var filesWithInvalidatedNonRelativeUnresolvedImports; - var allFilesHaveInvalidatedResolution = false; var nonRelativeExternalModuleResolutions = ts.createMultiMap(); + var resolutionsWithFailedLookups = []; + var resolvedFileToResolution = ts.createMultiMap(); var getCurrentDirectory = ts.memoize(function () { return resolutionHost.getCurrentDirectory(); }); // TODO: GH#18217 var cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost(); // The resolvedModuleNames and resolvedTypeReferenceDirectives are the cache of resolutions per file. @@ -102477,7 +103047,8 @@ var ts; closeTypeRootsWatch(); resolvedModuleNames.clear(); resolvedTypeReferenceDirectives.clear(); - allFilesHaveInvalidatedResolution = false; + resolvedFileToResolution.clear(); + resolutionsWithFailedLookups.length = 0; // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update // (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution) clearPerDirectoryResolutions(); @@ -102499,7 +103070,7 @@ var ts; return !!value && !!value.length; } function createHasInvalidatedResolution(forceAllFilesAsInvalidated) { - if (allFilesHaveInvalidatedResolution || forceAllFilesAsInvalidated) { + if (forceAllFilesAsInvalidated) { // Any file asked would have invalidated resolution filesWithInvalidatedResolutions = undefined; return ts.returnTrue; @@ -102517,7 +103088,6 @@ var ts; nonRelativeExternalModuleResolutions.clear(); } function finishCachingPerDirectoryResolution() { - allFilesHaveInvalidatedResolution = false; filesWithInvalidatedNonRelativeUnresolvedImports = undefined; clearPerDirectoryResolutions(); directoryWatchesOfFailedLookups.forEach(function (watcher, path) { @@ -102528,6 +103098,7 @@ var ts; }); } function resolveModuleName(moduleName, containingFile, compilerOptions, host, redirectedReference) { + var _a; var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference); // return result immediately only if global cache support is not enabled or if it is .ts, .tsx or .d.ts if (!resolutionHost.getGlobalCache) { @@ -102538,15 +103109,20 @@ var ts; if (globalCache !== undefined && !ts.isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && ts.extensionIsTS(primaryResult.resolvedModule.extension))) { // create different collection of failed lookup locations for second pass // if it will fail and we've already found something during the first pass - we don't want to pollute its results - var _a = ts.loadModuleFromGlobalCache(ts.Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName), resolutionHost.projectName, compilerOptions, host, globalCache), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations; + var _b = ts.loadModuleFromGlobalCache(ts.Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName), resolutionHost.projectName, compilerOptions, host, globalCache), resolvedModule = _b.resolvedModule, failedLookupLocations = _b.failedLookupLocations; if (resolvedModule) { - return { resolvedModule: resolvedModule, failedLookupLocations: ts.addRange(primaryResult.failedLookupLocations, failedLookupLocations) }; + // Modify existing resolution so its saved in the directory cache as well + primaryResult.resolvedModule = resolvedModule; + (_a = primaryResult.failedLookupLocations).push.apply(_a, failedLookupLocations); + return primaryResult; } } // Default return the result from the first pass return primaryResult; } - function resolveNamesWithLocalCache(names, containingFile, redirectedReference, cache, perDirectoryCacheWithRedirects, loader, getResolutionWithResolvedFileName, shouldRetryResolution, reusedNames, logChanges) { + function resolveNamesWithLocalCache(_a) { + var names = _a.names, containingFile = _a.containingFile, redirectedReference = _a.redirectedReference, cache = _a.cache, perDirectoryCacheWithRedirects = _a.perDirectoryCacheWithRedirects, loader = _a.loader, getResolutionWithResolvedFileName = _a.getResolutionWithResolvedFileName, shouldRetryResolution = _a.shouldRetryResolution, reusedNames = _a.reusedNames, logChanges = _a.logChanges; + var _b; var path = resolutionHost.toPath(containingFile); var resolutionsInFile = cache.get(path) || cache.set(path, ts.createMap()).get(path); var dirPath = ts.getDirectoryPath(path); @@ -102571,7 +103147,7 @@ var ts; var resolution = resolutionsInFile.get(name); // Resolution is valid if it is present and not invalidated if (!seenNamesInFile.has(name) && - allFilesHaveInvalidatedResolution || unmatchedRedirects || !resolution || resolution.isInvalidated || + unmatchedRedirects || !resolution || resolution.isInvalidated || // If the name is unresolved import that was invalidated, recalculate (hasInvalidatedNonRelativeUnresolvedImport && !ts.isExternalModuleNameRelative(name) && shouldRetryResolution(resolution))) { var existingResolution = resolution; @@ -102580,13 +103156,13 @@ var ts; resolution = resolutionInDirectory; } else { - resolution = loader(name, containingFile, compilerOptions, resolutionHost, redirectedReference); + resolution = loader(name, containingFile, compilerOptions, ((_b = resolutionHost.getCompilerHost) === null || _b === void 0 ? void 0 : _b.call(resolutionHost)) || resolutionHost, redirectedReference); perDirectoryResolution.set(name, resolution); } resolutionsInFile.set(name, resolution); - watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution); + watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName); if (existingResolution) { - stopWatchFailedLookupLocationOfResolution(existingResolution); + stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName); } if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) { filesWithChangedSetOfUnresolvedImports.push(path); @@ -102601,7 +103177,7 @@ var ts; // Stop watching and remove the unused name resolutionsInFile.forEach(function (resolution, name) { if (!seenNamesInFile.has(name) && !ts.contains(reusedNames, name)) { - stopWatchFailedLookupLocationOfResolution(resolution); + stopWatchFailedLookupLocationOfResolution(resolution, path, getResolutionWithResolvedFileName); resolutionsInFile.delete(name); } }); @@ -102625,21 +103201,35 @@ var ts; } } function resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference) { - return resolveNamesWithLocalCache(typeDirectiveNames, containingFile, redirectedReference, resolvedTypeReferenceDirectives, perDirectoryResolvedTypeReferenceDirectives, ts.resolveTypeReferenceDirective, getResolvedTypeReferenceDirective, - /*shouldRetryResolution*/ function (resolution) { return resolution.resolvedTypeReferenceDirective === undefined; }, - /*reusedNames*/ undefined, /*logChanges*/ false); + return resolveNamesWithLocalCache({ + names: typeDirectiveNames, + containingFile: containingFile, + redirectedReference: redirectedReference, + cache: resolvedTypeReferenceDirectives, + perDirectoryCacheWithRedirects: perDirectoryResolvedTypeReferenceDirectives, + loader: ts.resolveTypeReferenceDirective, + getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective, + shouldRetryResolution: function (resolution) { return resolution.resolvedTypeReferenceDirective === undefined; }, + }); } function resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference) { - return resolveNamesWithLocalCache(moduleNames, containingFile, redirectedReference, resolvedModuleNames, perDirectoryResolvedModuleNames, resolveModuleName, getResolvedModule, - /*shouldRetryResolution*/ function (resolution) { return !resolution.resolvedModule || !ts.resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension); }, reusedNames, logChangesWhenResolvingModule); + return resolveNamesWithLocalCache({ + names: moduleNames, + containingFile: containingFile, + redirectedReference: redirectedReference, + cache: resolvedModuleNames, + perDirectoryCacheWithRedirects: perDirectoryResolvedModuleNames, + loader: resolveModuleName, + getResolutionWithResolvedFileName: getResolvedModule, + shouldRetryResolution: function (resolution) { return !resolution.resolvedModule || !ts.resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension); }, + reusedNames: reusedNames, + logChanges: logChangesWhenResolvingModule + }); } function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName, containingFile) { var cache = resolvedModuleNames.get(resolutionHost.toPath(containingFile)); return cache && cache.get(moduleName); } - function isNodeModulesDirectory(dirPath) { - return ts.endsWith(dirPath, "/node_modules"); - } function isNodeModulesAtTypesDirectory(dirPath) { return ts.endsWith(dirPath, "/node_modules/@types"); } @@ -102675,7 +103265,7 @@ var ts; dirPath = ts.getDirectoryPath(dirPath); } // If the directory is node_modules use it to watch, always watch it recursively - if (isNodeModulesDirectory(dirPath)) { + if (ts.isNodeModulesDirectory(dirPath)) { return canWatchDirectory(ts.getDirectoryPath(dirPath)) ? { dir: dir, dirPath: dirPath } : undefined; } var nonRecursive = true; @@ -102699,26 +103289,33 @@ var ts; function isPathWithDefaultFailedLookupExtension(path) { return ts.fileExtensionIsOneOf(path, failedLookupDefaultExtensions); } - function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution) { - // No need to set the resolution refCount - if (resolution.failedLookupLocations && resolution.failedLookupLocations.length) { - if (resolution.refCount) { - resolution.refCount++; + function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName) { + if (resolution.refCount) { + resolution.refCount++; + ts.Debug.assertDefined(resolution.files); + } + else { + resolution.refCount = 1; + ts.Debug.assert(resolution.files === undefined); + if (ts.isExternalModuleNameRelative(name)) { + watchFailedLookupLocationOfResolution(resolution); } else { - resolution.refCount = 1; - if (ts.isExternalModuleNameRelative(name)) { - watchFailedLookupLocationOfResolution(resolution); - } - else { - nonRelativeExternalModuleResolutions.add(name, resolution); - } + nonRelativeExternalModuleResolutions.add(name, resolution); + } + var resolved = getResolutionWithResolvedFileName(resolution); + if (resolved && resolved.resolvedFileName) { + resolvedFileToResolution.add(resolutionHost.toPath(resolved.resolvedFileName), resolution); } } + (resolution.files || (resolution.files = [])).push(filePath); } function watchFailedLookupLocationOfResolution(resolution) { ts.Debug.assert(!!resolution.refCount); var failedLookupLocations = resolution.failedLookupLocations; + if (!failedLookupLocations.length) + return; + resolutionsWithFailedLookups.push(resolution); var setAtRoot = false; for (var _i = 0, failedLookupLocations_1 = failedLookupLocations; _i < failedLookupLocations_1.length; _i++) { var failedLookupLocation = failedLookupLocations_1[_i]; @@ -102746,14 +103343,11 @@ var ts; setDirectoryWatcher(rootDir, rootPath, /*nonRecursive*/ true); // TODO: GH#18217 } } - function setRefCountToUndefined(resolution) { - resolution.refCount = undefined; - } function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name) { var program = resolutionHost.getCurrentProgram(); - var updateResolution = program && program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name) ? - setRefCountToUndefined : watchFailedLookupLocationOfResolution; - resolutions.forEach(updateResolution); + if (!program || !program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name)) { + resolutions.forEach(watchFailedLookupLocationOfResolution); + } } function setDirectoryWatcher(dir, dirPath, nonRecursive) { var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); @@ -102765,14 +103359,20 @@ var ts; directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath, nonRecursive), refCount: 1, nonRecursive: nonRecursive }); } } - function stopWatchFailedLookupLocationOfResolution(resolution) { - if (!resolution.refCount) { - return; - } + function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName) { + ts.unorderedRemoveItem(ts.Debug.assertDefined(resolution.files), filePath); resolution.refCount--; if (resolution.refCount) { return; } + var resolved = getResolutionWithResolvedFileName(resolution); + if (resolved && resolved.resolvedFileName) { + resolvedFileToResolution.remove(resolutionHost.toPath(resolved.resolvedFileName), resolution); + } + if (!ts.unorderedRemoveItem(resolutionsWithFailedLookups, resolution)) { + // If not watching failed lookups, it wont be there in resolutionsWithFailedLookups + return; + } var failedLookupLocations = resolution.failedLookupLocations; var removeAtRoot = false; for (var _i = 0, failedLookupLocations_2 = failedLookupLocations; _i < failedLookupLocations_2.length; _i++) { @@ -102815,16 +103415,16 @@ var ts; // Since the file existence changed, update the sourceFiles cache cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); } - if (!allFilesHaveInvalidatedResolution && invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath)) { + if (invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath)) { resolutionHost.onInvalidatedResolution(); } }, nonRecursive ? 0 /* None */ : 1 /* Recursive */); } - function removeResolutionsOfFileFromCache(cache, filePath) { + function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName) { // Deleted file, stop watching failed lookups for all the resolutions in the file var resolutions = cache.get(filePath); if (resolutions) { - resolutions.forEach(stopWatchFailedLookupLocationOfResolution); + resolutions.forEach(function (resolution) { return stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName); }); cache.delete(filePath); } } @@ -102845,57 +103445,26 @@ var ts; resolvedProjectReference.commandLine.fileNames.forEach(function (f) { return removeResolutionsOfFile(resolutionHost.toPath(f)); }); } function removeResolutionsOfFile(filePath) { - removeResolutionsOfFileFromCache(resolvedModuleNames, filePath); - removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath); - } - function invalidateResolutionCache(cache, isInvalidatedResolution, getResolutionWithResolvedFileName) { - var seen = ts.createMap(); - cache.forEach(function (resolutions, containingFilePath) { - var dirPath = ts.getDirectoryPath(containingFilePath); - var seenInDir = seen.get(dirPath); - if (!seenInDir) { - seenInDir = ts.createMap(); - seen.set(dirPath, seenInDir); - } - resolutions.forEach(function (resolution, name) { - if (seenInDir.has(name)) { - return; - } - seenInDir.set(name, true); - if (!resolution.isInvalidated && isInvalidatedResolution(resolution, getResolutionWithResolvedFileName)) { - // Mark the file as needing re-evaluation of module resolution instead of using it blindly. - resolution.isInvalidated = true; - (filesWithInvalidatedResolutions || (filesWithInvalidatedResolutions = ts.createMap())).set(containingFilePath, true); - // When its a file with inferred types resolution, invalidate type reference directive resolution - if (ts.endsWith(containingFilePath, ts.inferredTypesContainingFile)) { - resolutionHost.onChangedAutomaticTypeDirectiveNames(); - } - } - }); - }); - } - function hasReachedResolutionIterationLimit() { - var maxSize = resolutionHost.maxNumberOfFilesToIterateForInvalidation || ts.maxNumberOfFilesToIterateForInvalidation; - return resolvedModuleNames.size > maxSize || resolvedTypeReferenceDirectives.size > maxSize; - } - function invalidateResolutions(isInvalidatedResolution) { - // If more than maxNumberOfFilesToIterateForInvalidation present, - // just invalidated all files and recalculate the resolutions for files instead - if (hasReachedResolutionIterationLimit()) { - allFilesHaveInvalidatedResolution = true; - return; + removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule); + removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective); + } + function invalidateResolution(resolution) { + resolution.isInvalidated = true; + var changedInAutoTypeReferenced = false; + for (var _i = 0, _a = ts.Debug.assertDefined(resolution.files); _i < _a.length; _i++) { + var containingFilePath = _a[_i]; + (filesWithInvalidatedResolutions || (filesWithInvalidatedResolutions = ts.createMap())).set(containingFilePath, true); + // When its a file with inferred types resolution, invalidate type reference directive resolution + changedInAutoTypeReferenced = changedInAutoTypeReferenced || containingFilePath.endsWith(ts.inferredTypesContainingFile); + } + if (changedInAutoTypeReferenced) { + resolutionHost.onChangedAutomaticTypeDirectiveNames(); } - invalidateResolutionCache(resolvedModuleNames, isInvalidatedResolution, getResolvedModule); - invalidateResolutionCache(resolvedTypeReferenceDirectives, isInvalidatedResolution, getResolvedTypeReferenceDirective); } function invalidateResolutionOfFile(filePath) { removeResolutionsOfFile(filePath); - invalidateResolutions( // Resolution is invalidated if the resulting file name is same as the deleted file path - function (resolution, getResolutionWithResolvedFileName) { - var result = getResolutionWithResolvedFileName(resolution); - return !!result && resolutionHost.toPath(result.resolvedFileName) === filePath; // TODO: GH#18217 - }); + ts.forEach(resolvedFileToResolution.get(filePath), invalidateResolution); } function setFilesWithInvalidatedNonRelativeUnresolvedImports(filesMap) { ts.Debug.assert(filesWithInvalidatedNonRelativeUnresolvedImports === filesMap || filesWithInvalidatedNonRelativeUnresolvedImports === undefined); @@ -102921,8 +103490,8 @@ var ts; // Some file or directory in the watching directory is created // Return early if it does not have any of the watching extension or not the custom failed lookup path var dirOfFileOrDirectory = ts.getDirectoryPath(fileOrDirectoryPath); - if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || isNodeModulesDirectory(fileOrDirectoryPath) || - isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || isNodeModulesDirectory(dirOfFileOrDirectory)) { + if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || ts.isNodeModulesDirectory(fileOrDirectoryPath) || + isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || ts.isNodeModulesDirectory(dirOfFileOrDirectory)) { // Invalidate any resolution from this directory isChangedFailedLookupLocation = function (location) { var locationPath = resolutionHost.toPath(location); @@ -102941,20 +103510,21 @@ var ts; isChangedFailedLookupLocation = function (location) { return resolutionHost.toPath(location) === fileOrDirectoryPath; }; } } - var hasChangedFailedLookupLocation = function (resolution) { return ts.some(resolution.failedLookupLocations, isChangedFailedLookupLocation); }; - var invalidatedFilesCount = filesWithInvalidatedResolutions && filesWithInvalidatedResolutions.size; - invalidateResolutions( + var invalidated = false; // Resolution is invalidated if the resulting file name is same as the deleted file path - hasChangedFailedLookupLocation); - return allFilesHaveInvalidatedResolution || filesWithInvalidatedResolutions && filesWithInvalidatedResolutions.size !== invalidatedFilesCount; + for (var _i = 0, resolutionsWithFailedLookups_1 = resolutionsWithFailedLookups; _i < resolutionsWithFailedLookups_1.length; _i++) { + var resolution = resolutionsWithFailedLookups_1[_i]; + if (resolution.failedLookupLocations.some(isChangedFailedLookupLocation)) { + invalidateResolution(resolution); + invalidated = true; + } + } + return invalidated; } function closeTypeRootsWatch() { ts.clearMap(typeRootsWatches, ts.closeFileWatcher); } function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath) { - if (allFilesHaveInvalidatedResolution) { - return undefined; - } if (isInDirectoryPath(rootPath, typeRootPath)) { return rootPath; } @@ -103153,38 +103723,52 @@ var ts; function comparePathsByNumberOfDirectorySeparators(a, b) { return ts.compareValues(numberOfDirectorySeparators(a), numberOfDirectorySeparators(b)); } - /** - * Looks for existing imports that use symlinks to this module. - * Symlinks will be returned first so they are preferred over the real path. - */ - function getAllModulePaths(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap) { + function forEachFileNameOfModule(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap, preferSymlinks, cb) { var redirects = redirectTargetsMap.get(importedFileName); var importedFileNames = redirects ? __spreadArrays(redirects, [importedFileName]) : [importedFileName]; var cwd = host.getCurrentDirectory ? host.getCurrentDirectory() : ""; var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); }); + if (!preferSymlinks) { + var result_10 = ts.forEach(targets, cb); + if (result_10) + return result_10; + } var links = host.getProbableSymlinks ? host.getProbableSymlinks(files) : ts.discoverProbableSymlinks(files, getCanonicalFileName, cwd); - var result = []; var compareStrings = (!host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames()) ? ts.compareStringsCaseSensitive : ts.compareStringsCaseInsensitive; - links.forEach(function (resolved, path) { + var result = ts.forEachEntry(links, function (resolved, path) { if (ts.startsWithDirectory(importingFileName, resolved, getCanonicalFileName)) { - return; // Don't want to a package to globally import from itself + return undefined; // Don't want to a package to globally import from itself } var target = ts.find(targets, function (t) { return compareStrings(t.slice(0, resolved.length + 1), resolved + "/") === 0 /* EqualTo */; }); if (target === undefined) - return; + return undefined; var relative = ts.getRelativePathFromDirectory(resolved, target, getCanonicalFileName); var option = ts.resolvePath(path, relative); if (!host.fileExists || host.fileExists(option)) { - result.push(option); + var result_11 = cb(option); + if (result_11) + return result_11; } }); - result.push.apply(result, targets); - if (result.length < 2) - return result; + return result || + (preferSymlinks ? ts.forEach(targets, cb) : undefined); + } + moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule; + /** + * Looks for existing imports that use symlinks to this module. + * Symlinks will be returned first so they are preferred over the real path. + */ + function getAllModulePaths(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap) { + var cwd = host.getCurrentDirectory ? host.getCurrentDirectory() : ""; + var allFileNames = ts.createMap(); + forEachFileNameOfModule(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap, + /*preferSymlinks*/ true, function (path) { + // dont return value, so we collect everything + allFileNames.set(path, getCanonicalFileName(path)); + }); // Sort by paths closest to importing file Name directory - var allFileNames = ts.arrayToMap(result, ts.identity, getCanonicalFileName); var sortedPaths = []; var _loop_18 = function (directory) { var directoryStart = ts.ensureTrailingDirectorySeparator(directory); @@ -103719,10 +104303,6 @@ var ts; */ function createProgramHost(system, createProgram) { var getDefaultLibLocation = ts.memoize(function () { return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath())); }); - var host = system; - // TODO: `host` is unused! - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - host; return { useCaseSensitiveFileNames: function () { return system.useCaseSensitiveFileNames; }, getNewLine: function () { return system.newLine; }, @@ -103739,7 +104319,6 @@ var ts; trace: function (s) { return system.write(s + system.newLine); }, createDirectory: function (path) { return system.createDirectory(path); }, writeFile: function (path, data, writeByteOrderMark) { return system.writeFile(path, data, writeByteOrderMark); }, - onCachedDirectoryStructureHostCreate: function (cacheHost) { return host = cacheHost || system; }, createHash: ts.maybeBind(system, system.createHash), createProgram: createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram }; @@ -103867,9 +104446,6 @@ var ts; var canConfigFileJsonReportNoInputFiles = false; var hasChangedConfigFileParsingErrors = false; var cachedDirectoryStructureHost = configFileName === undefined ? undefined : ts.createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames); - if (cachedDirectoryStructureHost && host.onCachedDirectoryStructureHostCreate) { - host.onCachedDirectoryStructureHostCreate(cachedDirectoryStructureHost); - } var directoryStructureHost = cachedDirectoryStructureHost || host; var parseConfigFileHost = ts.parseConfigHostFromCompilerHostLike(host, directoryStructureHost); // From tsc we want to get already parsed result and hence check for rootFileNames @@ -103910,6 +104486,7 @@ var ts; // Members for ResolutionCacheHost compilerHost.toPath = toPath; compilerHost.getCompilationSettings = function () { return compilerOptions; }; + compilerHost.useSourceOfProjectReferenceRedirect = ts.maybeBind(host, host.useSourceOfProjectReferenceRedirect); compilerHost.watchDirectoryOfFailedLookupLocation = function (dir, cb, flags) { return watchDirectory(host, dir, cb, flags, watchOptions, ts.WatchType.FailedLookupLocations); }; compilerHost.watchTypeRootsDirectory = function (dir, cb, flags) { return watchDirectory(host, dir, cb, flags, watchOptions, ts.WatchType.TypeRoots); }; compilerHost.getCachedDirectoryStructureHost = function () { return cachedDirectoryStructureHost; }; @@ -103919,7 +104496,6 @@ var ts; scheduleProgramUpdate(); }; compilerHost.fileIsOpen = ts.returnFalse; - compilerHost.maxNumberOfFilesToIterateForInvalidation = host.maxNumberOfFilesToIterateForInvalidation; compilerHost.getCurrentProgram = getCurrentProgram; compilerHost.writeLog = writeLog; // Cache for the module resolution @@ -103952,8 +104528,8 @@ var ts; // Update the wild card directory watch watchConfigFileWildCardDirectories(); return configFileName ? - { getCurrentProgram: getCurrentBuilderProgram, getProgram: synchronizeProgram, close: close } : - { getCurrentProgram: getCurrentBuilderProgram, getProgram: synchronizeProgram, updateRootFileNames: updateRootFileNames, close: close }; + { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close: close } : + { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames: updateRootFileNames, close: close }; function close() { resolutionCache.clear(); ts.clearMap(sourceFilesCache, function (value) { @@ -104001,7 +104577,7 @@ var ts; else { createNewProgram(hasInvalidatedResolution); } - if (host.afterProgramCreate) { + if (host.afterProgramCreate && program !== builderProgram) { host.afterProgramCreate(builderProgram); } return builderProgram; @@ -104017,6 +104593,7 @@ var ts; resolutionCache.startCachingPerDirectoryResolution(); compilerHost.hasInvalidatedResolution = hasInvalidatedResolution; compilerHost.hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames; + hasChangedAutomaticTypeDirectiveNames = false; builderProgram = createProgram(rootFileNames, compilerOptions, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences); resolutionCache.finishCachingPerDirectoryResolution(); // Update watches @@ -104061,7 +104638,7 @@ var ts; // If file is missing on host from cache, we can definitely say file doesnt exist // otherwise we need to ensure from the disk if (isFileMissingOnHost(sourceFilesCache.get(path))) { - return true; + return false; } return directoryStructureHost.fileExists(fileName); } @@ -104158,16 +104735,19 @@ var ts; host.clearTimeout(timerToUpdateProgram); } writeLog("Scheduling update"); - timerToUpdateProgram = host.setTimeout(updateProgram, 250); + timerToUpdateProgram = host.setTimeout(updateProgramWithWatchStatus, 250); } function scheduleProgramReload() { ts.Debug.assert(!!configFileName); reloadLevel = ts.ConfigFileProgramReloadLevel.Full; scheduleProgramUpdate(); } - function updateProgram() { + function updateProgramWithWatchStatus() { timerToUpdateProgram = undefined; reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation); + updateProgram(); + } + function updateProgram() { switch (reloadLevel) { case ts.ConfigFileProgramReloadLevel.Partial: ts.perfLogger.logStartUpdateProgram("PartialConfigReload"); @@ -104183,6 +104763,7 @@ var ts; break; } ts.perfLogger.logStopUpdateProgram("Done"); + return getCurrentBuilderProgram(); } function reloadFileNamesFromConfigFile() { writeLog("Reloading new file names and options"); @@ -106257,6 +106838,7 @@ var ts; placeOpenBraceOnNewLineForFunctions: false, placeOpenBraceOnNewLineForControlBlocks: false, semicolons: SemicolonPreference.Ignore, + trimTrailingWhitespace: true }; } ts.getDefaultFormatCodeSettings = getDefaultFormatCodeSettings; @@ -106487,37 +107069,37 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ts.isInJSFile(node) && ts.getJSDocEnumTag(node) ? 7 /* All */ : 1 /* Value */; - case 156 /* Parameter */: - case 191 /* BindingElement */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 280 /* CatchClause */: - case 273 /* JsxAttribute */: + case 157 /* Parameter */: + case 192 /* BindingElement */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 281 /* CatchClause */: + case 274 /* JsxAttribute */: return 1 /* Value */; - case 155 /* TypeParameter */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 173 /* TypeLiteral */: + case 156 /* TypeParameter */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 174 /* TypeLiteral */: return 2 /* Type */; - case 322 /* JSDocTypedefTag */: + case 323 /* JSDocTypedefTag */: // If it has no name node, it shares the name with the value declaration below it. return node.name === undefined ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */; - case 284 /* EnumMember */: - case 245 /* ClassDeclaration */: + case 285 /* EnumMember */: + case 246 /* ClassDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } @@ -106527,16 +107109,16 @@ var ts; else { return 4 /* Namespace */; } - case 248 /* EnumDeclaration */: - case 257 /* NamedImports */: - case 258 /* ImportSpecifier */: - case 253 /* ImportEqualsDeclaration */: - case 254 /* ImportDeclaration */: - case 259 /* ExportAssignment */: - case 260 /* ExportDeclaration */: + case 249 /* EnumDeclaration */: + case 258 /* NamedImports */: + case 259 /* ImportSpecifier */: + case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 260 /* ExportAssignment */: + case 261 /* ExportDeclaration */: return 7 /* All */; // An external module can be a Value - case 290 /* SourceFile */: + case 291 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 7 /* All */; @@ -106544,10 +107126,10 @@ var ts; ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { node = getAdjustedReferenceLocation(node); - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { return 1 /* Value */; } - else if (node.parent.kind === 259 /* ExportAssignment */ || node.parent.kind === 265 /* ExternalModuleReference */) { + else if (node.parent.kind === 260 /* ExportAssignment */ || node.parent.kind === 266 /* ExternalModuleReference */) { return 7 /* All */; } else if (isInRightSideOfInternalImportEqualsDeclaration(node)) { @@ -106579,11 +107161,11 @@ var ts; // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - var name = node.kind === 153 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; - return name && name.parent.kind === 253 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; + var name = node.kind === 154 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; + return name && name.parent.kind === 254 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 153 /* QualifiedName */) { + while (node.parent.kind === 154 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -106595,27 +107177,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 153 /* QualifiedName */) { - while (root.parent && root.parent.kind === 153 /* QualifiedName */) { + if (root.parent.kind === 154 /* QualifiedName */) { + while (root.parent && root.parent.kind === 154 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 169 /* TypeReference */ && !isLastClause; + return root.parent.kind === 170 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 194 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 194 /* PropertyAccessExpression */) { + if (root.parent.kind === 195 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 195 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 216 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 279 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 217 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 280 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 245 /* ClassDeclaration */ && root.parent.parent.token === 113 /* ImplementsKeyword */) || - (decl.kind === 246 /* InterfaceDeclaration */ && root.parent.parent.token === 90 /* ExtendsKeyword */); + return (decl.kind === 246 /* ClassDeclaration */ && root.parent.parent.token === 113 /* ImplementsKeyword */) || + (decl.kind === 247 /* InterfaceDeclaration */ && root.parent.parent.token === 90 /* ExtendsKeyword */); } return false; } @@ -106626,15 +107208,15 @@ var ts; switch (node.kind) { case 104 /* ThisKeyword */: return !ts.isExpressionNode(node); - case 183 /* ThisType */: + case 184 /* ThisType */: return true; } switch (node.parent.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return true; - case 188 /* ImportType */: + case 189 /* ImportType */: return !node.parent.isTypeOf; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent); } return false; @@ -106701,7 +107283,7 @@ var ts; ts.climbPastPropertyOrElementAccess = climbPastPropertyOrElementAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 238 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 239 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -106762,22 +107344,22 @@ var ts; ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 281 /* PropertyAssignment */: - case 284 /* EnumMember */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 249 /* ModuleDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 282 /* PropertyAssignment */: + case 285 /* EnumMember */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 250 /* ModuleDeclaration */: return ts.getNameOfDeclaration(node.parent) === node; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return true; - case 187 /* LiteralType */: - return node.parent.parent.kind === 185 /* IndexedAccessType */; + case 188 /* LiteralType */: + return node.parent.parent.kind === 186 /* IndexedAccessType */; default: return false; } @@ -106801,17 +107383,17 @@ var ts; return undefined; } switch (node.kind) { - case 290 /* SourceFile */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 249 /* ModuleDeclaration */: + case 291 /* SourceFile */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 250 /* ModuleDeclaration */: return node; } } @@ -106819,54 +107401,54 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: return ts.isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return "module" /* moduleElement */; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return "class" /* classElement */; - case 246 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; - case 247 /* TypeAliasDeclaration */: - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: + case 247 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; + case 248 /* TypeAliasDeclaration */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: return "type" /* typeElement */; - case 248 /* EnumDeclaration */: return "enum" /* enumElement */; - case 242 /* VariableDeclaration */: + case 249 /* EnumDeclaration */: return "enum" /* enumElement */; + case 243 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 202 /* ArrowFunction */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return "function" /* functionElement */; - case 163 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; - case 164 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 164 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; + case 165 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: return "method" /* memberFunctionElement */; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: var initializer = node.initializer; return ts.isFunctionLike(initializer) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */; - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 282 /* ShorthandPropertyAssignment */: - case 283 /* SpreadAssignment */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 283 /* ShorthandPropertyAssignment */: + case 284 /* SpreadAssignment */: return "property" /* memberVariableElement */; - case 167 /* IndexSignature */: return "index" /* indexSignatureElement */; - case 166 /* ConstructSignature */: return "construct" /* constructSignatureElement */; - case 165 /* CallSignature */: return "call" /* callSignatureElement */; - case 162 /* Constructor */: return "constructor" /* constructorImplementationElement */; - case 155 /* TypeParameter */: return "type parameter" /* typeParameterElement */; - case 284 /* EnumMember */: return "enum member" /* enumMemberElement */; - case 156 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 253 /* ImportEqualsDeclaration */: - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: - case 256 /* NamespaceImport */: - case 262 /* NamespaceExport */: + case 168 /* IndexSignature */: return "index" /* indexSignatureElement */; + case 167 /* ConstructSignature */: return "construct" /* constructSignatureElement */; + case 166 /* CallSignature */: return "call" /* callSignatureElement */; + case 163 /* Constructor */: return "constructor" /* constructorImplementationElement */; + case 156 /* TypeParameter */: return "type parameter" /* typeParameterElement */; + case 285 /* EnumMember */: return "enum member" /* enumMemberElement */; + case 157 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; + case 254 /* ImportEqualsDeclaration */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: + case 257 /* NamespaceImport */: + case 263 /* NamespaceExport */: return "alias" /* alias */; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var kind = ts.getAssignmentDeclarationKind(node); var right = node.right; switch (kind) { @@ -106895,7 +107477,7 @@ var ts; } case 75 /* Identifier */: return ts.isImportClause(node.parent) ? "alias" /* alias */ : "" /* unknown */; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: var scriptKind = getNodeKind(node.expression); // If the expression didn't come back with something (like it does for an identifiers) return scriptKind === "" /* unknown */ ? "const" /* constElement */ : scriptKind; @@ -106918,7 +107500,7 @@ var ts; return true; case 75 /* Identifier */: // 'this' as a parameter - return ts.identifierIsThisKeyword(node) && node.parent.kind === 156 /* Parameter */; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 157 /* Parameter */; default: return false; } @@ -106983,42 +107565,42 @@ var ts; return false; } switch (n.kind) { - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 193 /* ObjectLiteralExpression */: - case 189 /* ObjectBindingPattern */: - case 173 /* TypeLiteral */: - case 223 /* Block */: - case 250 /* ModuleBlock */: - case 251 /* CaseBlock */: - case 257 /* NamedImports */: - case 261 /* NamedExports */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 194 /* ObjectLiteralExpression */: + case 190 /* ObjectBindingPattern */: + case 174 /* TypeLiteral */: + case 224 /* Block */: + case 251 /* ModuleBlock */: + case 252 /* CaseBlock */: + case 258 /* NamedImports */: + case 262 /* NamedExports */: return nodeEndsWith(n, 19 /* CloseBraceToken */, sourceFile); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 197 /* NewExpression */: + case 198 /* NewExpression */: if (!n.arguments) { return true; } // falls through - case 196 /* CallExpression */: - case 200 /* ParenthesizedExpression */: - case 182 /* ParenthesizedType */: + case 197 /* CallExpression */: + case 201 /* ParenthesizedExpression */: + case 183 /* ParenthesizedType */: return nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 166 /* ConstructSignature */: - case 165 /* CallSignature */: - case 202 /* ArrowFunction */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 167 /* ConstructSignature */: + case 166 /* CallSignature */: + case 203 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -107028,65 +107610,65 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 21 /* CloseParenToken */, sourceFile); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return !!n.body && isCompletedNode(n.body, sourceFile); - case 227 /* IfStatement */: + case 228 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 26 /* SemicolonToken */, sourceFile); - case 192 /* ArrayLiteralExpression */: - case 190 /* ArrayBindingPattern */: - case 195 /* ElementAccessExpression */: - case 154 /* ComputedPropertyName */: - case 175 /* TupleType */: + case 193 /* ArrayLiteralExpression */: + case 191 /* ArrayBindingPattern */: + case 196 /* ElementAccessExpression */: + case 155 /* ComputedPropertyName */: + case 176 /* TupleType */: return nodeEndsWith(n, 23 /* CloseBracketToken */, sourceFile); - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 23 /* CloseBracketToken */, sourceFile); - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicity always consider them non-completed return false; - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 229 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 230 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 228 /* DoStatement */: + case 229 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; return hasChildOfKind(n, 111 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 204 /* TypeOfExpression */: - case 203 /* DeleteExpression */: - case 205 /* VoidExpression */: - case 212 /* YieldExpression */: - case 213 /* SpreadElement */: + case 205 /* TypeOfExpression */: + case 204 /* DeleteExpression */: + case 206 /* VoidExpression */: + case 213 /* YieldExpression */: + case 214 /* SpreadElement */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 260 /* ExportDeclaration */: - case 254 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: return ts.nodeIsPresent(n.moduleSpecifier); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -107193,11 +107775,11 @@ var ts; function getAdjustedLocationForDeclaration(node, forRename) { if (!forRename) { switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return getAdjustedLocationForClass(node); - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return getAdjustedLocationForFunction(node); } } @@ -107292,11 +107874,11 @@ var ts; node.kind === 94 /* FunctionKeyword */ ? ts.isFunctionDeclaration(parent) || ts.isFunctionExpression(node) : node.kind === 114 /* InterfaceKeyword */ ? ts.isInterfaceDeclaration(parent) : node.kind === 88 /* EnumKeyword */ ? ts.isEnumDeclaration(parent) : - node.kind === 145 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : - node.kind === 136 /* NamespaceKeyword */ || node.kind === 135 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : + node.kind === 146 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : + node.kind === 137 /* NamespaceKeyword */ || node.kind === 136 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : node.kind === 96 /* ImportKeyword */ ? ts.isImportEqualsDeclaration(parent) : - node.kind === 131 /* GetKeyword */ ? ts.isGetAccessorDeclaration(parent) : - node.kind === 142 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { + node.kind === 132 /* GetKeyword */ ? ts.isGetAccessorDeclaration(parent) : + node.kind === 143 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { var location = getAdjustedLocationForDeclaration(parent, forRename); if (location) { return location; @@ -107310,7 +107892,7 @@ var ts; return decl.name; } } - if (node.kind === 145 /* TypeKeyword */) { + if (node.kind === 146 /* TypeKeyword */) { // import /**/type [|name|] from ...; // import /**/type { [|name|] } from ...; // import /**/type { propertyName as [|name|] } from ...; @@ -107377,12 +107959,12 @@ var ts; } } // import name = /**/require("[|module|]"); - if (node.kind === 139 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { + if (node.kind === 140 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { return parent.expression; } // import ... /**/from "[|module|]"; // export ... /**/from "[|module|]"; - if (node.kind === 149 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { + if (node.kind === 150 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { return parent.moduleSpecifier; } // class ... /**/extends [|name|] ... @@ -107407,7 +107989,7 @@ var ts; } } // ... T extends /**/infer [|U|] ? ... - if (node.kind === 132 /* InferKeyword */ && ts.isInferTypeNode(parent)) { + if (node.kind === 133 /* InferKeyword */ && ts.isInferTypeNode(parent)) { return parent.typeParameter.name; } // { [ [|K|] /**/in keyof T]: ... } @@ -107415,12 +107997,12 @@ var ts; return parent.name; } // /**/keyof [|T|] - if (node.kind === 134 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 134 /* KeyOfKeyword */ && + if (node.kind === 135 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 135 /* KeyOfKeyword */ && ts.isTypeReferenceNode(parent.type)) { return parent.type.typeName; } // /**/readonly [|name|][] - if (node.kind === 138 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 138 /* ReadonlyKeyword */ && + if (node.kind === 139 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 139 /* ReadonlyKeyword */ && ts.isArrayTypeNode(parent.type) && ts.isTypeReferenceNode(parent.type.elementType)) { return parent.type.elementType.typeName; } @@ -107457,7 +108039,7 @@ var ts; // for (... /**/in [|name|]) // for (... /**/of [|name|]) if (node.kind === 97 /* InKeyword */ && ts.isForInStatement(parent) || - node.kind === 152 /* OfKeyword */ && ts.isForOfStatement(parent)) { + node.kind === 153 /* OfKeyword */ && ts.isForOfStatement(parent)) { return ts.skipOuterExpressions(parent.expression); } } @@ -107598,7 +108180,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 290 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); + ts.Debug.assert(startNode !== undefined || n.kind === 291 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. @@ -107668,17 +108250,17 @@ var ts; return true; } //
{ |
or
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 276 /* JsxExpression */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 277 /* JsxExpression */) { return true; } //
{ // | // } < /div> - if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 276 /* JsxExpression */) { + if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 277 /* JsxExpression */) { return true; } //
|
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 269 /* JsxClosingElement */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 270 /* JsxClosingElement */) { return true; } return false; @@ -107819,7 +108401,7 @@ var ts; // falls through case 108 /* TypeOfKeyword */: case 90 /* ExtendsKeyword */: - case 134 /* KeyOfKeyword */: + case 135 /* KeyOfKeyword */: case 24 /* DotToken */: case 51 /* BarToken */: case 57 /* QuestionToken */: @@ -107874,16 +108456,16 @@ var ts; result.push("export" /* exportedModifier */); if (node.flags & 8388608 /* Ambient */) result.push("declare" /* ambientModifier */); - if (node.kind === 259 /* ExportAssignment */) + if (node.kind === 260 /* ExportAssignment */) result.push("export" /* exportedModifier */); return result.length > 0 ? result.join(",") : "" /* none */; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 169 /* TypeReference */ || node.kind === 196 /* CallExpression */) { + if (node.kind === 170 /* TypeReference */ || node.kind === 197 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 245 /* ClassDeclaration */ || node.kind === 246 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 246 /* ClassDeclaration */ || node.kind === 247 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -107928,18 +108510,18 @@ var ts; } ts.cloneCompilerOptions = cloneCompilerOptions; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 192 /* ArrayLiteralExpression */ || - node.kind === 193 /* ObjectLiteralExpression */) { + if (node.kind === 193 /* ArrayLiteralExpression */ || + node.kind === 194 /* ObjectLiteralExpression */) { // [a,b,c] from: // [a, b, c] = someExpression; - if (node.parent.kind === 209 /* BinaryExpression */ && + if (node.parent.kind === 210 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */) { return true; } // [a, b, c] from: // for([a, b, c] of expression) - if (node.parent.kind === 232 /* ForOfStatement */ && + if (node.parent.kind === 233 /* ForOfStatement */ && node.parent.initializer === node) { return true; } @@ -107947,7 +108529,7 @@ var ts; // [x, [a, b, c] ] = someExpression // or // {x, a: {a, b, c} } = someExpression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 281 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 282 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -107993,29 +108575,29 @@ var ts; ts.typeKeywords = [ 125 /* AnyKeyword */, 124 /* AssertsKeyword */, - 151 /* BigIntKeyword */, - 128 /* BooleanKeyword */, + 152 /* BigIntKeyword */, + 129 /* BooleanKeyword */, 91 /* FalseKeyword */, - 134 /* KeyOfKeyword */, - 137 /* NeverKeyword */, + 135 /* KeyOfKeyword */, + 138 /* NeverKeyword */, 100 /* NullKeyword */, - 140 /* NumberKeyword */, - 141 /* ObjectKeyword */, - 138 /* ReadonlyKeyword */, - 143 /* StringKeyword */, - 144 /* SymbolKeyword */, + 141 /* NumberKeyword */, + 142 /* ObjectKeyword */, + 139 /* ReadonlyKeyword */, + 144 /* StringKeyword */, + 145 /* SymbolKeyword */, 106 /* TrueKeyword */, 110 /* VoidKeyword */, - 146 /* UndefinedKeyword */, - 147 /* UniqueKeyword */, - 148 /* UnknownKeyword */, + 147 /* UndefinedKeyword */, + 148 /* UniqueKeyword */, + 149 /* UnknownKeyword */, ]; function isTypeKeyword(kind) { return ts.contains(ts.typeKeywords, kind); } ts.isTypeKeyword = isTypeKeyword; function isTypeKeywordToken(node) { - return node.kind === 145 /* TypeKeyword */; + return node.kind === 146 /* TypeKeyword */; } ts.isTypeKeywordToken = isTypeKeywordToken; /** True if the symbol is for an external module, as opposed to a namespace. */ @@ -108048,7 +108630,7 @@ var ts; } ts.skipConstraint = skipConstraint; function getNameFromPropertyName(name) { - return name.kind === 154 /* ComputedPropertyName */ + return name.kind === 155 /* ComputedPropertyName */ // treat computed property names where expression is string/numeric literal as just string/numeric literal ? ts.isStringOrNumericLiteralLike(name.expression) ? name.expression.text : undefined : ts.isPrivateIdentifier(name) ? ts.idText(name) : ts.getTextOfIdentifierOrLiteral(name); @@ -108195,7 +108777,7 @@ var ts; } ts.findModifier = findModifier; function insertImport(changes, sourceFile, importDecl, blankLineBetween) { - var importKindPredicate = importDecl.kind === 225 /* VariableStatement */ ? ts.isRequireVariableDeclarationStatement : ts.isAnyImportSyntax; + var importKindPredicate = importDecl.kind === 226 /* VariableStatement */ ? ts.isRequireVariableDeclarationStatement : ts.isAnyImportSyntax; var lastImportDeclaration = ts.findLast(sourceFile.statements, function (statement) { return importKindPredicate(statement); }); if (lastImportDeclaration) { changes.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl); @@ -108241,7 +108823,7 @@ var ts; // Display-part writer helpers // #region function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 156 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 157 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -108538,14 +109120,14 @@ var ts; var symbol = checker.getSymbolAtLocation(node.name); var renameInfo = symbol && renameMap.get(String(ts.getSymbolId(symbol))); if (renameInfo && renameInfo.text !== (node.name || node.propertyName).getText()) { - clone = ts.createBindingElement(node.dotDotDotToken, node.propertyName || node.name, renameInfo, node.initializer); + clone = ts.setOriginalNode(ts.createBindingElement(node.dotDotDotToken, node.propertyName || node.name, renameInfo, node.initializer), node); } } else if (renameMap && checker && ts.isIdentifier(node)) { var symbol = checker.getSymbolAtLocation(node); var renameInfo = symbol && renameMap.get(String(ts.getSymbolId(symbol))); if (renameInfo) { - clone = ts.createIdentifier(renameInfo.text); + clone = ts.setOriginalNode(ts.createIdentifier(renameInfo.text), node); } } if (!clone) { @@ -108705,15 +109287,15 @@ var ts; function getContextualTypeFromParent(node, checker) { var parent = node.parent; switch (parent.kind) { - case 197 /* NewExpression */: + case 198 /* NewExpression */: return checker.getContextualType(parent); - case 209 /* BinaryExpression */: { + case 210 /* BinaryExpression */: { var _a = parent, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node); } - case 277 /* CaseClause */: + case 278 /* CaseClause */: return parent.expression === node ? getSwitchedType(parent, checker) : undefined; default: return checker.getContextualType(node); @@ -108752,8 +109334,8 @@ var ts; switch (node.kind) { case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 211 /* TemplateExpression */: - case 198 /* TaggedTemplateExpression */: + case 212 /* TemplateExpression */: + case 199 /* TaggedTemplateExpression */: return true; default: return false; @@ -108792,41 +109374,41 @@ var ts; } ts.getTypeNodeIfAccessible = getTypeNodeIfAccessible; function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) { - return kind === 165 /* CallSignature */ - || kind === 166 /* ConstructSignature */ - || kind === 167 /* IndexSignature */ - || kind === 158 /* PropertySignature */ - || kind === 160 /* MethodSignature */; + return kind === 166 /* CallSignature */ + || kind === 167 /* ConstructSignature */ + || kind === 168 /* IndexSignature */ + || kind === 159 /* PropertySignature */ + || kind === 161 /* MethodSignature */; } ts.syntaxRequiresTrailingCommaOrSemicolonOrASI = syntaxRequiresTrailingCommaOrSemicolonOrASI; function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) { - return kind === 244 /* FunctionDeclaration */ - || kind === 162 /* Constructor */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */; + return kind === 245 /* FunctionDeclaration */ + || kind === 163 /* Constructor */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */; } ts.syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI = syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI; function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) { - return kind === 249 /* ModuleDeclaration */; + return kind === 250 /* ModuleDeclaration */; } ts.syntaxRequiresTrailingModuleBlockOrSemicolonOrASI = syntaxRequiresTrailingModuleBlockOrSemicolonOrASI; function syntaxRequiresTrailingSemicolonOrASI(kind) { - return kind === 225 /* VariableStatement */ - || kind === 226 /* ExpressionStatement */ - || kind === 228 /* DoStatement */ - || kind === 233 /* ContinueStatement */ - || kind === 234 /* BreakStatement */ - || kind === 235 /* ReturnStatement */ - || kind === 239 /* ThrowStatement */ - || kind === 241 /* DebuggerStatement */ - || kind === 159 /* PropertyDeclaration */ - || kind === 247 /* TypeAliasDeclaration */ - || kind === 254 /* ImportDeclaration */ - || kind === 253 /* ImportEqualsDeclaration */ - || kind === 260 /* ExportDeclaration */ - || kind === 252 /* NamespaceExportDeclaration */ - || kind === 259 /* ExportAssignment */; + return kind === 226 /* VariableStatement */ + || kind === 227 /* ExpressionStatement */ + || kind === 229 /* DoStatement */ + || kind === 234 /* ContinueStatement */ + || kind === 235 /* BreakStatement */ + || kind === 236 /* ReturnStatement */ + || kind === 240 /* ThrowStatement */ + || kind === 242 /* DebuggerStatement */ + || kind === 160 /* PropertyDeclaration */ + || kind === 248 /* TypeAliasDeclaration */ + || kind === 255 /* ImportDeclaration */ + || kind === 254 /* ImportEqualsDeclaration */ + || kind === 261 /* ExportDeclaration */ + || kind === 253 /* NamespaceExportDeclaration */ + || kind === 260 /* ExportAssignment */; } ts.syntaxRequiresTrailingSemicolonOrASI = syntaxRequiresTrailingSemicolonOrASI; ts.syntaxMayBeASICandidate = ts.or(syntaxRequiresTrailingCommaOrSemicolonOrASI, syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI, syntaxRequiresTrailingModuleBlockOrSemicolonOrASI, syntaxRequiresTrailingSemicolonOrASI); @@ -108856,7 +109438,7 @@ var ts; return false; } // See comment in parser’s `parseDoStatement` - if (node.kind === 228 /* DoStatement */) { + if (node.kind === 229 /* DoStatement */) { return true; } var topNode = ts.findAncestor(node, function (ancestor) { return !ancestor.parent; }); @@ -109116,6 +109698,10 @@ var ts; return symbol.name; } ts.getNameForExportedSymbol = getNameForExportedSymbol; + function startsWithUnderscore(name) { + return name.charCodeAt(0) === 95 /* _ */; + } + ts.startsWithUnderscore = startsWithUnderscore; // #endregion })(ts || (ts = {})); var ts; @@ -109219,10 +109805,10 @@ var ts; } break; case 125 /* AnyKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: if (angleBracketStack > 0 && !syntacticClassifierAbsent) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, @@ -109411,9 +109997,9 @@ var ts; return true; } switch (keyword2) { - case 131 /* GetKeyword */: - case 142 /* SetKeyword */: - case 129 /* ConstructorKeyword */: + case 132 /* GetKeyword */: + case 143 /* SetKeyword */: + case 130 /* ConstructorKeyword */: case 120 /* StaticKeyword */: return true; // Allow things like "public get", "public constructor" and "public static". default: @@ -109554,10 +110140,10 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 249 /* ModuleDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 244 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 245 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -109777,18 +110363,18 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); // e.g. "param" pos = tag.tagName.end; switch (tag.kind) { - case 317 /* JSDocParameterTag */: + case 318 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); pos = tag.end; break; - case 320 /* JSDocTypeTag */: + case 321 /* JSDocTypeTag */: processElement(tag.typeExpression); pos = tag.end; break; - case 318 /* JSDocReturnTag */: + case 319 /* JSDocReturnTag */: processElement(tag.typeExpression); pos = tag.end; break; @@ -109939,22 +110525,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 268 /* JsxOpeningElement */: + case 269 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -109983,17 +110569,17 @@ var ts; var parent = token.parent; if (tokenKind === 62 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (parent.kind === 242 /* VariableDeclaration */ || - parent.kind === 159 /* PropertyDeclaration */ || - parent.kind === 156 /* Parameter */ || - parent.kind === 273 /* JsxAttribute */) { + if (parent.kind === 243 /* VariableDeclaration */ || + parent.kind === 160 /* PropertyDeclaration */ || + parent.kind === 157 /* Parameter */ || + parent.kind === 274 /* JsxAttribute */) { return 5 /* operator */; } } - if (parent.kind === 209 /* BinaryExpression */ || - parent.kind === 207 /* PrefixUnaryExpression */ || - parent.kind === 208 /* PostfixUnaryExpression */ || - parent.kind === 210 /* ConditionalExpression */) { + if (parent.kind === 210 /* BinaryExpression */ || + parent.kind === 208 /* PrefixUnaryExpression */ || + parent.kind === 209 /* PostfixUnaryExpression */ || + parent.kind === 211 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -110006,7 +110592,7 @@ var ts; return 25 /* bigintLiteral */; } else if (tokenKind === 10 /* StringLiteral */) { - return token && token.parent.kind === 273 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token && token.parent.kind === 274 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 13 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -110022,32 +110608,32 @@ var ts; else if (tokenKind === 75 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 156 /* Parameter */: + case 157 /* Parameter */: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -110171,11 +110757,11 @@ var ts; function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host) { var parent = node.parent; switch (parent.kind) { - case 187 /* LiteralType */: + case 188 /* LiteralType */: switch (parent.parent.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(parent)), isNewIdentifier: false }; - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: // Get all apparent property names // i.e. interface Foo { // foo: string; @@ -110183,9 +110769,9 @@ var ts; // } // let x: Foo["/*completion position*/"] return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(parent.parent.objectType)); - case 188 /* ImportType */: + case 189 /* ImportType */: return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) }; - case 178 /* UnionType */: { + case 179 /* UnionType */: { if (!ts.isTypeReferenceNode(parent.parent.parent)) return undefined; var alreadyUsedTypes_1 = getAlreadyUsedTypesInStringLiteralUnion(parent.parent, parent); @@ -110195,7 +110781,7 @@ var ts; default: return undefined; } - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: if (ts.isObjectLiteralExpression(parent.parent) && parent.name === node) { // Get quoted name of properties of the object literal expression // i.e. interface ConfigFiles { @@ -110212,7 +110798,7 @@ var ts; return stringLiteralCompletionsFromProperties(typeChecker.getContextualType(parent.parent)); } return fromContextualType(); - case 195 /* ElementAccessExpression */: { + case 196 /* ElementAccessExpression */: { var _a = parent, expression = _a.expression, argumentExpression = _a.argumentExpression; if (node === argumentExpression) { // Get all names of properties on the expression @@ -110225,8 +110811,8 @@ var ts; } return undefined; } - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: if (!ts.isRequireCall(parent, /*checkArgumentIsStringLiteralLike*/ false) && !ts.isImportCall(parent)) { var argumentInfo = ts.SignatureHelp.getArgumentInfoForCompletions(node, position, sourceFile); // Get string literal completions from specialized signatures of the target @@ -110235,9 +110821,9 @@ var ts; return argumentInfo ? getStringLiteralCompletionsFromSignature(argumentInfo, typeChecker) : fromContextualType(); } // falls through (is `require("")` or `import("")`) - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: - case 265 /* ExternalModuleReference */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 266 /* ExternalModuleReference */: // Get all known external module names or complete a path to a module // i.e. import * as ns from "/*completion position*/"; // var y = import("/*completion position*/"); @@ -111188,11 +111774,11 @@ var ts; return ts.getContextualTypeFromParent(previousToken, checker); case 62 /* EqualsToken */: switch (parent.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return checker.getContextualType(parent.initializer); // TODO: GH#18217 - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return checker.getTypeAtLocation(parent.left); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return checker.getContextualTypeForJsxAttribute(parent); default: return undefined; @@ -111202,7 +111788,7 @@ var ts; case 78 /* CaseKeyword */: return ts.getSwitchedType(ts.cast(parent, ts.isCaseClause), checker); case 18 /* OpenBraceToken */: - return ts.isJsxExpression(parent) && parent.parent.kind !== 266 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; + return ts.isJsxExpression(parent) && parent.parent.kind !== 267 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; default: var argInfo = ts.SignatureHelp.getArgumentInfoForCompletions(previousToken, position, sourceFile); return argInfo ? @@ -111221,7 +111807,7 @@ var ts; return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker)); } function isModuleSymbol(symbol) { - return symbol.declarations.some(function (d) { return d.kind === 290 /* SourceFile */; }); + return symbol.declarations.some(function (d) { return d.kind === 291 /* SourceFile */; }); } function getCompletionData(program, log, sourceFile, isUncheckedFile, position, preferences, detailsEntryId, host) { var typeChecker = program.getTypeChecker(); @@ -111272,11 +111858,11 @@ var ts; if (tag.tagName.pos <= position && position <= tag.tagName.end) { return { kind: 1 /* JsDocTagName */ }; } - if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 294 /* JSDocTypeExpression */) { + if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 295 /* JSDocTypeExpression */) { currentToken = ts.getTokenAtPosition(sourceFile, position); if (!currentToken || (!ts.isDeclarationName(currentToken) && - (currentToken.parent.kind !== 323 /* JSDocPropertyTag */ || + (currentToken.parent.kind !== 324 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken))) { // Use as type location if inside tag's type expression insideJsDocTagTypeExpression = isCurrentlyEditingNode(tag.typeExpression); @@ -111328,7 +111914,7 @@ var ts; isRightOfDot = contextToken.kind === 24 /* DotToken */; isRightOfQuestionDot = contextToken.kind === 28 /* QuestionDotToken */; switch (parent.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: propertyAccessToConvert = parent; node = propertyAccessToConvert.expression; if (node.end === contextToken.pos && @@ -111340,14 +111926,14 @@ var ts; return undefined; } break; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: node = parent.left; break; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: node = parent.name; break; - case 188 /* ImportType */: - case 219 /* MetaProperty */: + case 189 /* ImportType */: + case 220 /* MetaProperty */: node = parent; break; default: @@ -111360,7 +111946,7 @@ var ts; // // If the tagname is a property access expression, we will then walk up to the top most of property access expression. // Then, try to get a JSX container and its associated attributes type. - if (parent && parent.kind === 194 /* PropertyAccessExpression */) { + if (parent && parent.kind === 195 /* PropertyAccessExpression */) { contextToken = parent; parent = parent.parent; } @@ -111368,38 +111954,38 @@ var ts; if (currentToken.parent === location) { switch (currentToken.kind) { case 31 /* GreaterThanToken */: - if (currentToken.parent.kind === 266 /* JsxElement */ || currentToken.parent.kind === 268 /* JsxOpeningElement */) { + if (currentToken.parent.kind === 267 /* JsxElement */ || currentToken.parent.kind === 269 /* JsxOpeningElement */) { location = currentToken; } break; case 43 /* SlashToken */: - if (currentToken.parent.kind === 267 /* JsxSelfClosingElement */) { + if (currentToken.parent.kind === 268 /* JsxSelfClosingElement */) { location = currentToken; } break; } } switch (parent.kind) { - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: if (contextToken.kind === 43 /* SlashToken */) { isStartingCloseTag = true; location = contextToken; } break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (!binaryExpressionMayBeOpenTag(parent)) { break; } // falls through - case 267 /* JsxSelfClosingElement */: - case 266 /* JsxElement */: - case 268 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 267 /* JsxElement */: + case 269 /* JsxOpeningElement */: if (contextToken.kind === 29 /* LessThanToken */) { isRightOfOpenTag = true; location = contextToken; } break; - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: switch (previousToken.kind) { case 62 /* EqualsToken */: isJsxInitializer = true; @@ -111479,11 +112065,11 @@ var ts; }; function isTagWithTypeExpression(tag) { switch (tag.kind) { - case 317 /* JSDocParameterTag */: - case 323 /* JSDocPropertyTag */: - case 318 /* JSDocReturnTag */: - case 320 /* JSDocTypeTag */: - case 322 /* JSDocTypedefTag */: + case 318 /* JSDocParameterTag */: + case 324 /* JSDocPropertyTag */: + case 319 /* JSDocReturnTag */: + case 321 /* JSDocTypeTag */: + case 323 /* JSDocTypedefTag */: return true; default: return false; @@ -111528,7 +112114,7 @@ var ts; // If the module is merged with a value, we must get the type of the class and add its propertes (for inherited static methods). if (!isTypeLocation && symbol.declarations && - symbol.declarations.some(function (d) { return d.kind !== 290 /* SourceFile */ && d.kind !== 249 /* ModuleDeclaration */ && d.kind !== 248 /* EnumDeclaration */; })) { + symbol.declarations.some(function (d) { return d.kind !== 291 /* SourceFile */ && d.kind !== 250 /* ModuleDeclaration */ && d.kind !== 249 /* EnumDeclaration */; })) { var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType(); var insertQuestionDot = false; if (type.isNullableType()) { @@ -111575,7 +112161,7 @@ var ts; if (isRightOfQuestionDot && ts.some(type.getCallSignatures())) { isNewIdentifierLocation = true; } - var propertyAccess = node.kind === 188 /* ImportType */ ? node : node.parent; + var propertyAccess = node.kind === 189 /* ImportType */ ? node : node.parent; if (isUncheckedFile) { // In javascript files, for union types, we don't just get the members that // the individual types have in common, we also include all the members that @@ -111731,7 +112317,7 @@ var ts; } } // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` - if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 290 /* SourceFile */) { + if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 291 /* SourceFile */) { var thisType = typeChecker.tryGetThisTypeAt(scopeNode, /*includeGlobalThis*/ false); if (thisType) { for (var _a = 0, _b = getPropertiesForCompletion(thisType, typeChecker); _a < _b.length; _a++) { @@ -111781,10 +112367,10 @@ var ts; } function isSnippetScope(scopeNode) { switch (scopeNode.kind) { - case 290 /* SourceFile */: - case 211 /* TemplateExpression */: - case 276 /* JsxExpression */: - case 223 /* Block */: + case 291 /* SourceFile */: + case 212 /* TemplateExpression */: + case 277 /* JsxExpression */: + case 224 /* Block */: return true; default: return ts.isStatement(scopeNode); @@ -111830,27 +112416,27 @@ var ts; function isContextTokenValueLocation(contextToken) { return contextToken && contextToken.kind === 108 /* TypeOfKeyword */ && - (contextToken.parent.kind === 172 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); + (contextToken.parent.kind === 173 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); } function isContextTokenTypeLocation(contextToken) { if (contextToken) { var parentKind = contextToken.parent.kind; switch (contextToken.kind) { case 58 /* ColonToken */: - return parentKind === 159 /* PropertyDeclaration */ || - parentKind === 158 /* PropertySignature */ || - parentKind === 156 /* Parameter */ || - parentKind === 242 /* VariableDeclaration */ || + return parentKind === 160 /* PropertyDeclaration */ || + parentKind === 159 /* PropertySignature */ || + parentKind === 157 /* Parameter */ || + parentKind === 243 /* VariableDeclaration */ || ts.isFunctionLikeKind(parentKind); case 62 /* EqualsToken */: - return parentKind === 247 /* TypeAliasDeclaration */; + return parentKind === 248 /* TypeAliasDeclaration */; case 123 /* AsKeyword */: - return parentKind === 217 /* AsExpression */; + return parentKind === 218 /* AsExpression */; case 29 /* LessThanToken */: - return parentKind === 169 /* TypeReference */ || - parentKind === 199 /* TypeAssertionExpression */; + return parentKind === 170 /* TypeReference */ || + parentKind === 200 /* TypeAssertionExpression */; case 90 /* ExtendsKeyword */: - return parentKind === 155 /* TypeParameter */; + return parentKind === 156 /* TypeParameter */; } } return false; @@ -112061,7 +112647,7 @@ var ts; return true; } if (contextToken.kind === 31 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 268 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 269 /* JsxOpeningElement */) { // Two possibilities: // 1.
/**/ // - contextToken: GreaterThanToken (before cursor) @@ -112071,10 +112657,10 @@ var ts; // - contextToken: GreaterThanToken (before cursor) // - location: GreaterThanToken (after cursor) // - same parent (JSXOpeningElement) - return location.parent.kind !== 268 /* JsxOpeningElement */; + return location.parent.kind !== 269 /* JsxOpeningElement */; } - if (contextToken.parent.kind === 269 /* JsxClosingElement */ || contextToken.parent.kind === 267 /* JsxSelfClosingElement */) { - return !!contextToken.parent.parent && contextToken.parent.parent.kind === 266 /* JsxElement */; + if (contextToken.parent.kind === 270 /* JsxClosingElement */ || contextToken.parent.kind === 268 /* JsxSelfClosingElement */) { + return !!contextToken.parent.parent && contextToken.parent.parent.kind === 267 /* JsxElement */; } } return false; @@ -112085,40 +112671,40 @@ var ts; // Previous token may have been a keyword that was converted to an identifier. switch (keywordForNode(previousToken)) { case 27 /* CommaToken */: - return containingNodeKind === 196 /* CallExpression */ // func( a, | - || containingNodeKind === 162 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 197 /* NewExpression */ // new C(a, | - || containingNodeKind === 192 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 209 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 170 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 197 /* CallExpression */ // func( a, | + || containingNodeKind === 163 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 198 /* NewExpression */ // new C(a, | + || containingNodeKind === 193 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 210 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 171 /* FunctionType */; // var x: (s: string, list| case 20 /* OpenParenToken */: - return containingNodeKind === 196 /* CallExpression */ // func( | - || containingNodeKind === 162 /* Constructor */ // constructor( | - || containingNodeKind === 197 /* NewExpression */ // new C(a| - || containingNodeKind === 200 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 182 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 197 /* CallExpression */ // func( | + || containingNodeKind === 163 /* Constructor */ // constructor( | + || containingNodeKind === 198 /* NewExpression */ // new C(a| + || containingNodeKind === 201 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 183 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 22 /* OpenBracketToken */: - return containingNodeKind === 192 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 167 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 154 /* ComputedPropertyName */; // [ | /* this can become an index signature */ - case 135 /* ModuleKeyword */: // module | - case 136 /* NamespaceKeyword */: // namespace | + return containingNodeKind === 193 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 168 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 155 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + case 136 /* ModuleKeyword */: // module | + case 137 /* NamespaceKeyword */: // namespace | return true; case 24 /* DotToken */: - return containingNodeKind === 249 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 250 /* ModuleDeclaration */; // module A.| case 18 /* OpenBraceToken */: - return containingNodeKind === 245 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 246 /* ClassDeclaration */; // class A{ | case 62 /* EqualsToken */: - return containingNodeKind === 242 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 209 /* BinaryExpression */; // x = a| + return containingNodeKind === 243 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 210 /* BinaryExpression */; // x = a| case 15 /* TemplateHead */: - return containingNodeKind === 211 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 212 /* TemplateExpression */; // `aa ${| case 16 /* TemplateMiddle */: - return containingNodeKind === 221 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 222 /* TemplateSpan */; // `aa ${10} dd ${| case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - return containingNodeKind === 159 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 160 /* PropertyDeclaration */; // class A{ public | } } return false; @@ -112145,7 +112731,7 @@ var ts; completionKind = 0 /* ObjectPropertyDeclaration */; var typeMembers; var existingMembers; - if (objectLikeContainer.kind === 193 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 194 /* ObjectLiteralExpression */) { var instantiatedType = typeChecker.getContextualType(objectLikeContainer); var completionsType = instantiatedType && typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */); if (!instantiatedType || !completionsType) @@ -112155,7 +112741,7 @@ var ts; existingMembers = objectLikeContainer.properties; } else { - ts.Debug.assert(objectLikeContainer.kind === 189 /* ObjectBindingPattern */); + ts.Debug.assert(objectLikeContainer.kind === 190 /* ObjectBindingPattern */); // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -112166,12 +112752,12 @@ var ts; // through type declaration or inference. // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - // type of parameter will flow in from the contextual type of the function - var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 232 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 156 /* Parameter */) { + var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 233 /* ForOfStatement */; + if (!canGetType && rootDeclaration.kind === 157 /* Parameter */) { if (ts.isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); } - else if (rootDeclaration.parent.kind === 161 /* MethodDeclaration */ || rootDeclaration.parent.kind === 164 /* SetAccessor */) { + else if (rootDeclaration.parent.kind === 162 /* MethodDeclaration */ || rootDeclaration.parent.kind === 165 /* SetAccessor */) { canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -112221,7 +112807,7 @@ var ts; return 0 /* Continue */; // cursor is in an import clause // try to show exported member for imported module - var moduleSpecifier = (namedImportsOrExports.kind === 257 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; + var moduleSpecifier = (namedImportsOrExports.kind === 258 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); // TODO: GH#18217 if (!moduleSpecifierSymbol) return 2 /* Fail */; @@ -112343,11 +112929,11 @@ var ts; case 30 /* LessThanSlashToken */: case 43 /* SlashToken */: case 75 /* Identifier */: - case 194 /* PropertyAccessExpression */: - case 274 /* JsxAttributes */: - case 273 /* JsxAttribute */: - case 275 /* JsxSpreadAttribute */: - if (parent && (parent.kind === 267 /* JsxSelfClosingElement */ || parent.kind === 268 /* JsxOpeningElement */)) { + case 195 /* PropertyAccessExpression */: + case 275 /* JsxAttributes */: + case 274 /* JsxAttribute */: + case 276 /* JsxSpreadAttribute */: + if (parent && (parent.kind === 268 /* JsxSelfClosingElement */ || parent.kind === 269 /* JsxOpeningElement */)) { if (contextToken.kind === 31 /* GreaterThanToken */) { var precedingToken = ts.findPrecedingToken(contextToken.pos, sourceFile, /*startNode*/ undefined); if (!parent.typeArguments || (precedingToken && precedingToken.kind === 43 /* SlashToken */)) @@ -112355,7 +112941,7 @@ var ts; } return parent; } - else if (parent.kind === 273 /* JsxAttribute */) { + else if (parent.kind === 274 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -112367,7 +112953,7 @@ var ts; // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 10 /* StringLiteral */: - if (parent && ((parent.kind === 273 /* JsxAttribute */) || (parent.kind === 275 /* JsxSpreadAttribute */))) { + if (parent && ((parent.kind === 274 /* JsxAttribute */) || (parent.kind === 276 /* JsxSpreadAttribute */))) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -112377,8 +112963,8 @@ var ts; break; case 19 /* CloseBraceToken */: if (parent && - parent.kind === 276 /* JsxExpression */ && - parent.parent && parent.parent.kind === 273 /* JsxAttribute */) { + parent.kind === 277 /* JsxExpression */ && + parent.parent && parent.parent.kind === 274 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -112386,7 +112972,7 @@ var ts; // each JsxAttribute can have initializer as JsxExpression return parent.parent.parent.parent; } - if (parent && parent.kind === 275 /* JsxSpreadAttribute */) { + if (parent && parent.kind === 276 /* JsxSpreadAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -112406,51 +112992,51 @@ var ts; var containingNodeKind = parent.kind; switch (contextToken.kind) { case 27 /* CommaToken */: - return containingNodeKind === 242 /* VariableDeclaration */ || + return containingNodeKind === 243 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken) || - containingNodeKind === 225 /* VariableStatement */ || - containingNodeKind === 248 /* EnumDeclaration */ || // enum a { foo, | + containingNodeKind === 226 /* VariableStatement */ || + containingNodeKind === 249 /* EnumDeclaration */ || // enum a { foo, | isFunctionLikeButNotConstructor(containingNodeKind) || - containingNodeKind === 246 /* InterfaceDeclaration */ || // interface A= contextToken.pos); case 24 /* DotToken */: - return containingNodeKind === 190 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 191 /* ArrayBindingPattern */; // var [.| case 58 /* ColonToken */: - return containingNodeKind === 191 /* BindingElement */; // var {x :html| + return containingNodeKind === 192 /* BindingElement */; // var {x :html| case 22 /* OpenBracketToken */: - return containingNodeKind === 190 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 191 /* ArrayBindingPattern */; // var [x| case 20 /* OpenParenToken */: - return containingNodeKind === 280 /* CatchClause */ || + return containingNodeKind === 281 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); case 18 /* OpenBraceToken */: - return containingNodeKind === 248 /* EnumDeclaration */; // enum a { | + return containingNodeKind === 249 /* EnumDeclaration */; // enum a { | case 29 /* LessThanToken */: - return containingNodeKind === 245 /* ClassDeclaration */ || // class A< | - containingNodeKind === 214 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 246 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 247 /* TypeAliasDeclaration */ || // type List< | + return containingNodeKind === 246 /* ClassDeclaration */ || // class A< | + containingNodeKind === 215 /* ClassExpression */ || // var C = class D< | + containingNodeKind === 247 /* InterfaceDeclaration */ || // interface A< | + containingNodeKind === 248 /* TypeAliasDeclaration */ || // type List< | ts.isFunctionLikeKind(containingNodeKind); case 120 /* StaticKeyword */: - return containingNodeKind === 159 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); + return containingNodeKind === 160 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); case 25 /* DotDotDotToken */: - return containingNodeKind === 156 /* Parameter */ || - (!!parent.parent && parent.parent.kind === 190 /* ArrayBindingPattern */); // var [...z| + return containingNodeKind === 157 /* Parameter */ || + (!!parent.parent && parent.parent.kind === 191 /* ArrayBindingPattern */); // var [...z| case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - return containingNodeKind === 156 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); + return containingNodeKind === 157 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); case 123 /* AsKeyword */: - return containingNodeKind === 258 /* ImportSpecifier */ || - containingNodeKind === 263 /* ExportSpecifier */ || - containingNodeKind === 256 /* NamespaceImport */; - case 131 /* GetKeyword */: - case 142 /* SetKeyword */: + return containingNodeKind === 259 /* ImportSpecifier */ || + containingNodeKind === 264 /* ExportSpecifier */ || + containingNodeKind === 257 /* NamespaceImport */; + case 132 /* GetKeyword */: + case 143 /* SetKeyword */: return !isFromObjectTypeDeclaration(contextToken); case 80 /* ClassKeyword */: case 88 /* EnumKeyword */: @@ -112461,7 +113047,7 @@ var ts; case 115 /* LetKeyword */: case 81 /* ConstKeyword */: case 121 /* YieldKeyword */: - case 145 /* TypeKeyword */: // type htm| + case 146 /* TypeKeyword */: // type htm| return true; case 41 /* AsteriskToken */: return ts.isFunctionLike(contextToken.parent) && !ts.isMethodDeclaration(contextToken.parent); @@ -112487,7 +113073,7 @@ var ts; case 122 /* AbstractKeyword */: case 80 /* ClassKeyword */: case 81 /* ConstKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 88 /* EnumKeyword */: case 94 /* FunctionKeyword */: case 114 /* InterfaceKeyword */: @@ -112509,7 +113095,7 @@ var ts; && !(ts.isClassLike(contextToken.parent) && (contextToken !== previousToken || position > previousToken.end)); } function isFunctionLikeButNotConstructor(kind) { - return ts.isFunctionLikeKind(kind) && kind !== 162 /* Constructor */; + return ts.isFunctionLikeKind(kind) && kind !== 163 /* Constructor */; } function isDotOfNumericLiteral(contextToken) { if (contextToken.kind === 8 /* NumericLiteral */) { @@ -112519,7 +113105,7 @@ var ts; return false; } function isVariableDeclarationListButNotTypeArgument(node) { - return node.parent.kind === 243 /* VariableDeclarationList */ + return node.parent.kind === 244 /* VariableDeclarationList */ && !ts.isPossiblyTypeArgumentPosition(node, sourceFile, typeChecker); } /** @@ -112537,13 +113123,13 @@ var ts; for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 281 /* PropertyAssignment */ && - m.kind !== 282 /* ShorthandPropertyAssignment */ && - m.kind !== 191 /* BindingElement */ && - m.kind !== 161 /* MethodDeclaration */ && - m.kind !== 163 /* GetAccessor */ && - m.kind !== 164 /* SetAccessor */ && - m.kind !== 283 /* SpreadAssignment */) { + if (m.kind !== 282 /* PropertyAssignment */ && + m.kind !== 283 /* ShorthandPropertyAssignment */ && + m.kind !== 192 /* BindingElement */ && + m.kind !== 162 /* MethodDeclaration */ && + m.kind !== 164 /* GetAccessor */ && + m.kind !== 165 /* SetAccessor */ && + m.kind !== 284 /* SpreadAssignment */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -112614,10 +113200,10 @@ var ts; for (var _i = 0, existingMembers_2 = existingMembers; _i < existingMembers_2.length; _i++) { var m = existingMembers_2[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 159 /* PropertyDeclaration */ && - m.kind !== 161 /* MethodDeclaration */ && - m.kind !== 163 /* GetAccessor */ && - m.kind !== 164 /* SetAccessor */) { + if (m.kind !== 160 /* PropertyDeclaration */ && + m.kind !== 162 /* MethodDeclaration */ && + m.kind !== 164 /* GetAccessor */ && + m.kind !== 165 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -112658,7 +113244,7 @@ var ts; if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 273 /* JsxAttribute */) { + if (attr.kind === 274 /* JsxAttribute */) { seenNames.set(attr.name.escapedText, true); } else if (ts.isJsxSpreadAttribute(attr)) { @@ -112708,7 +113294,7 @@ var ts; var _keywordCompletions = []; var allKeywordsCompletions = ts.memoize(function () { var res = []; - for (var i = 77 /* FirstKeyword */; i <= 152 /* LastKeyword */; i++) { + for (var i = 77 /* FirstKeyword */; i <= 153 /* LastKeyword */; i++) { res.push({ name: ts.tokenToString(i), kind: "keyword" /* keyword */, @@ -112734,12 +113320,12 @@ var ts; return false; case 1 /* All */: return isFunctionLikeBodyKeyword(kind) - || kind === 130 /* DeclareKeyword */ - || kind === 135 /* ModuleKeyword */ - || kind === 145 /* TypeKeyword */ - || kind === 136 /* NamespaceKeyword */ + || kind === 131 /* DeclareKeyword */ + || kind === 136 /* ModuleKeyword */ + || kind === 146 /* TypeKeyword */ + || kind === 137 /* NamespaceKeyword */ || kind === 123 /* AsKeyword */ - || ts.isTypeKeyword(kind) && kind !== 146 /* UndefinedKeyword */; + || ts.isTypeKeyword(kind) && kind !== 147 /* UndefinedKeyword */; case 5 /* FunctionLikeBodyKeywords */: return isFunctionLikeBodyKeyword(kind); case 2 /* ClassElementKeywords */: @@ -112761,46 +113347,46 @@ var ts; switch (kind) { case 122 /* AbstractKeyword */: case 125 /* AnyKeyword */: - case 151 /* BigIntKeyword */: - case 128 /* BooleanKeyword */: - case 130 /* DeclareKeyword */: + case 152 /* BigIntKeyword */: + case 129 /* BooleanKeyword */: + case 131 /* DeclareKeyword */: case 88 /* EnumKeyword */: - case 150 /* GlobalKeyword */: + case 151 /* GlobalKeyword */: case 113 /* ImplementsKeyword */: - case 132 /* InferKeyword */: + case 133 /* InferKeyword */: case 114 /* InterfaceKeyword */: - case 133 /* IsKeyword */: - case 134 /* KeyOfKeyword */: - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: - case 137 /* NeverKeyword */: - case 140 /* NumberKeyword */: - case 141 /* ObjectKeyword */: + case 134 /* IsKeyword */: + case 135 /* KeyOfKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: + case 138 /* NeverKeyword */: + case 141 /* NumberKeyword */: + case 142 /* ObjectKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 119 /* PublicKeyword */: - case 138 /* ReadonlyKeyword */: - case 143 /* StringKeyword */: - case 144 /* SymbolKeyword */: - case 145 /* TypeKeyword */: - case 147 /* UniqueKeyword */: - case 148 /* UnknownKeyword */: + case 139 /* ReadonlyKeyword */: + case 144 /* StringKeyword */: + case 145 /* SymbolKeyword */: + case 146 /* TypeKeyword */: + case 148 /* UniqueKeyword */: + case 149 /* UnknownKeyword */: return true; default: return false; } } function isInterfaceOrTypeLiteralCompletionKeyword(kind) { - return kind === 138 /* ReadonlyKeyword */; + return kind === 139 /* ReadonlyKeyword */; } function isClassMemberCompletionKeyword(kind) { switch (kind) { case 122 /* AbstractKeyword */: - case 129 /* ConstructorKeyword */: - case 131 /* GetKeyword */: - case 142 /* SetKeyword */: + case 130 /* ConstructorKeyword */: + case 132 /* GetKeyword */: + case 143 /* SetKeyword */: case 126 /* AsyncKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: return true; default: return ts.isClassMemberModifier(kind); @@ -112859,7 +113445,7 @@ var ts; function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) { // class c { method() { } | method2() { } } switch (location.kind) { - case 324 /* SyntaxList */: + case 325 /* SyntaxList */: return ts.tryCast(location.parent, ts.isObjectTypeDeclaration); case 1 /* EndOfFileToken */: var cls = ts.tryCast(ts.lastOrUndefined(ts.cast(location.parent, ts.isSourceFile).statements), ts.isObjectTypeDeclaration); @@ -113027,11 +113613,11 @@ var ts; case 111 /* WhileKeyword */: case 86 /* DoKeyword */: return useParent(node.parent, function (n) { return ts.isIterationStatement(n, /*lookInLabeledStatements*/ true); }, getLoopBreakContinueOccurrences); - case 129 /* ConstructorKeyword */: - return getFromAllDeclarations(ts.isConstructorDeclaration, [129 /* ConstructorKeyword */]); - case 131 /* GetKeyword */: - case 142 /* SetKeyword */: - return getFromAllDeclarations(ts.isAccessor, [131 /* GetKeyword */, 142 /* SetKeyword */]); + case 130 /* ConstructorKeyword */: + return getFromAllDeclarations(ts.isConstructorDeclaration, [130 /* ConstructorKeyword */]); + case 132 /* GetKeyword */: + case 143 /* SetKeyword */: + return getFromAllDeclarations(ts.isAccessor, [132 /* GetKeyword */, 143 /* SetKeyword */]); case 127 /* AwaitKeyword */: return useParent(node.parent, ts.isAwaitExpression, getAsyncAndAwaitOccurrences); case 126 /* AsyncKeyword */: @@ -113079,7 +113665,7 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 290 /* SourceFile */) { + if (ts.isFunctionBlock(parent) || parent.kind === 291 /* SourceFile */) { return parent; } // A throw-statement is only owned by a try-statement if the try-statement has @@ -113111,16 +113697,16 @@ var ts; function getBreakOrContinueOwner(statement) { return ts.findAncestor(statement, function (node) { switch (node.kind) { - case 237 /* SwitchStatement */: - if (statement.kind === 233 /* ContinueStatement */) { + case 238 /* SwitchStatement */: + if (statement.kind === 234 /* ContinueStatement */) { return false; } // falls through - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 229 /* WhileStatement */: - case 228 /* DoStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 230 /* WhileStatement */: + case 229 /* DoStatement */: return !statement.label || isLabeledBy(node, statement.label.escapedText); default: // Don't cross function boundaries. @@ -113136,11 +113722,11 @@ var ts; // Types of node whose children might have modifiers. var container = declaration.parent; switch (container.kind) { - case 250 /* ModuleBlock */: - case 290 /* SourceFile */: - case 223 /* Block */: - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 251 /* ModuleBlock */: + case 291 /* SourceFile */: + case 224 /* Block */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: // Container is either a class declaration or the declaration is a classDeclaration if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) { return __spreadArrays(declaration.members, [declaration]); @@ -113148,14 +113734,14 @@ var ts; else { return container.statements; } - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 244 /* FunctionDeclaration */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: return __spreadArrays(container.parameters, (ts.isClassLike(container.parent) ? container.parent.members : [])); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 173 /* TypeLiteral */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 174 /* TypeLiteral */: var nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. @@ -113188,7 +113774,7 @@ var ts; var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 93 /* ForKeyword */, 111 /* WhileKeyword */, 86 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 228 /* DoStatement */) { + if (loopNode.kind === 229 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 111 /* WhileKeyword */)) { @@ -113208,13 +113794,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -113581,10 +114167,10 @@ var ts; if (cancellationToken) cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (!isAvailableThroughGlobal) { var parent = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent.kind === 242 /* VariableDeclaration */) { + if (exportKind === 2 /* ExportEquals */ && parent.kind === 243 /* VariableDeclaration */) { var name = parent.name; if (name.kind === 75 /* Identifier */) { directImports.push(name); @@ -113597,20 +114183,20 @@ var ts; break; case 75 /* Identifier */: // for 'const x = require("y"); break; // TODO: GH#23879 - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: handleNamespaceImport(direct, direct.name, ts.hasModifier(direct, 1 /* Export */), /*alreadyAddedDirect*/ false); break; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: directImports.push(direct); var namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 256 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 257 /* NamespaceImport */) { handleNamespaceImport(direct, namedBindings.name, /*isReExport*/ false, /*alreadyAddedDirect*/ true); } else if (!isAvailableThroughGlobal && ts.isDefaultImport(direct)) { addIndirectUser(getSourceFileLikeForImportDeclaration(direct)); // Add a check for indirect uses to handle synthetic default imports } break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: if (!direct.exportClause) { // This is `export * from "foo"`, so imports of this module may import the export too. handleDirectImports(getContainingModuleSymbol(direct, checker)); @@ -113620,7 +114206,7 @@ var ts; directImports.push(direct); } break; - case 188 /* ImportType */: + case 189 /* ImportType */: directImports.push(direct); break; default: @@ -113637,7 +114223,7 @@ var ts; } else if (!isAvailableThroughGlobal) { var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - ts.Debug.assert(sourceFileLike.kind === 290 /* SourceFile */ || sourceFileLike.kind === 249 /* ModuleDeclaration */); + ts.Debug.assert(sourceFileLike.kind === 291 /* SourceFile */ || sourceFileLike.kind === 250 /* ModuleDeclaration */); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUsers(sourceFileLike); } @@ -113694,7 +114280,7 @@ var ts; } return { importSearches: importSearches, singleReferences: singleReferences }; function handleImport(decl) { - if (decl.kind === 253 /* ImportEqualsDeclaration */) { + if (decl.kind === 254 /* ImportEqualsDeclaration */) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } @@ -113704,7 +114290,7 @@ var ts; handleNamespaceImportLike(decl); return; } - if (decl.kind === 188 /* ImportType */) { + if (decl.kind === 189 /* ImportType */) { if (decl.qualifier) { var firstIdentifier = ts.getFirstIdentifier(decl.qualifier); if (firstIdentifier.escapedText === ts.symbolName(exportSymbol)) { @@ -113720,7 +114306,7 @@ var ts; if (decl.moduleSpecifier.kind !== 10 /* StringLiteral */) { return; } - if (decl.kind === 260 /* ExportDeclaration */) { + if (decl.kind === 261 /* ExportDeclaration */) { if (decl.exportClause && ts.isNamedExports(decl.exportClause)) { searchForNamedImport(decl.exportClause); } @@ -113729,10 +114315,10 @@ var ts; var _a = decl.importClause || { name: undefined, namedBindings: undefined }, name = _a.name, namedBindings = _a.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: handleNamespaceImportLike(namedBindings.name); break; - case 257 /* NamedImports */: + case 258 /* NamedImports */: // 'default' might be accessed as a named import `{ default as foo }`. if (exportKind === 0 /* Named */ || exportKind === 1 /* Default */) { searchForNamedImport(namedBindings); @@ -113782,7 +114368,7 @@ var ts; } } else { - var localSymbol = element.kind === 263 /* ExportSpecifier */ && element.propertyName + var localSymbol = element.kind === 264 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol. : checker.getSymbolAtLocation(name); addSearch(name, localSymbol); @@ -113811,7 +114397,7 @@ var ts; for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { var referencingFile = sourceFiles_1[_i]; var searchSourceFile = searchModuleSymbol.valueDeclaration; - if (searchSourceFile.kind === 290 /* SourceFile */) { + if (searchSourceFile.kind === 291 /* SourceFile */) { for (var _a = 0, _b = referencingFile.referencedFiles; _a < _b.length; _a++) { var ref = _b[_a]; if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { @@ -113859,7 +114445,7 @@ var ts; } /** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */ function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return ts.forEach(sourceFileLike.kind === 290 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return ts.forEach(sourceFileLike.kind === 291 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); }); } @@ -113874,15 +114460,15 @@ var ts; else { forEachPossibleImportOrExportStatement(sourceFile, function (statement) { switch (statement.kind) { - case 260 /* ExportDeclaration */: - case 254 /* ImportDeclaration */: { + case 261 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: { var decl = statement; if (decl.moduleSpecifier && ts.isStringLiteral(decl.moduleSpecifier)) { action(decl, decl.moduleSpecifier); } break; } - case 253 /* ImportEqualsDeclaration */: { + case 254 /* ImportEqualsDeclaration */: { var decl = statement; if (isExternalModuleImportEquals(decl)) { action(decl, decl.moduleReference.expression); @@ -113906,7 +114492,7 @@ var ts; var parent = node.parent; var grandParent = parent.parent; if (symbol.exportSymbol) { - if (parent.kind === 194 /* PropertyAccessExpression */) { + if (parent.kind === 195 /* PropertyAccessExpression */) { // When accessing an export of a JS module, there's no alias. The symbol will still be flagged as an export even though we're at the use. // So check that we are at the declaration. return symbol.declarations.some(function (d) { return d === parent; }) && ts.isBinaryExpression(grandParent) @@ -114036,13 +114622,13 @@ var ts; function isNodeImport(node) { var parent = node.parent; switch (parent.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return parent.name === node && isExternalModuleImportEquals(parent); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. return !parent.propertyName; - case 255 /* ImportClause */: - case 256 /* NamespaceImport */: + case 256 /* ImportClause */: + case 257 /* NamespaceImport */: ts.Debug.assert(parent.name === node); return true; default: @@ -114075,21 +114661,21 @@ var ts; return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 196 /* CallExpression */) { + if (node.kind === 197 /* CallExpression */) { return node.getSourceFile(); } var parent = node.parent; - if (parent.kind === 290 /* SourceFile */) { + if (parent.kind === 291 /* SourceFile */) { return parent; } - ts.Debug.assert(parent.kind === 250 /* ModuleBlock */); + ts.Debug.assert(parent.kind === 251 /* ModuleBlock */); return ts.cast(parent.parent, isAmbientModuleDeclaration); } function isAmbientModuleDeclaration(node) { - return node.kind === 249 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; + return node.kind === 250 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; } function isExternalModuleImportEquals(eq) { - return eq.moduleReference.kind === 265 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; + return eq.moduleReference.kind === 266 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; } })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); @@ -114191,7 +114777,7 @@ var ts; if (!node) return undefined; switch (node.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return !ts.isVariableDeclarationList(node.parent) || node.parent.declarations.length !== 1 ? node : ts.isVariableStatement(node.parent.parent) ? @@ -114199,27 +114785,27 @@ var ts; ts.isForInOrOfStatement(node.parent.parent) ? getContextNode(node.parent.parent) : node.parent; - case 191 /* BindingElement */: + case 192 /* BindingElement */: return getContextNode(node.parent.parent); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return node.parent.parent.parent; - case 263 /* ExportSpecifier */: - case 256 /* NamespaceImport */: + case 264 /* ExportSpecifier */: + case 257 /* NamespaceImport */: return node.parent.parent; - case 255 /* ImportClause */: + case 256 /* ImportClause */: return node.parent; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return ts.isExpressionStatement(node.parent) ? node.parent : node; - case 232 /* ForOfStatement */: - case 231 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 232 /* ForInStatement */: return { start: node.initializer, end: node.expression }; - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(ts.findAncestor(node.parent, function (node) { return ts.isBinaryExpression(node) || ts.isForInOrOfStatement(node); @@ -114280,13 +114866,13 @@ var ts; } FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { return undefined; } var checker = program.getTypeChecker(); // If invoked directly on a shorthand property assignment, then return // the declaration of the symbol being assigned (not the symbol being assigned to). - if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { var result_1 = []; Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_1.push(nodeEntry(node)); }); return result_1; @@ -114436,13 +115022,13 @@ var ts; if (symbol) { return getDefinitionKindAndDisplayParts(symbol, checker, node); } - else if (node.kind === 193 /* ObjectLiteralExpression */) { + else if (node.kind === 194 /* ObjectLiteralExpression */) { return { kind: "interface" /* interfaceElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("object literal"), ts.punctuationPart(21 /* CloseParenToken */)] }; } - else if (node.kind === 214 /* ClassExpression */) { + else if (node.kind === 215 /* ClassExpression */) { return { kind: "local class" /* localClassElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("anonymous local class"), ts.punctuationPart(21 /* CloseParenToken */)] @@ -114492,7 +115078,7 @@ var ts; return node.kind === 84 /* DefaultKeyword */ || !!ts.getDeclarationFromName(node) || ts.isLiteralComputedPropertyDeclarationName(node) - || (node.kind === 129 /* ConstructorKeyword */ && ts.isConstructorDeclaration(node.parent)); + || (node.kind === 130 /* ConstructorKeyword */ && ts.isConstructorDeclaration(node.parent)); } /** * True if 'decl' provides a value, as in `function f() {}`; @@ -114503,47 +115089,47 @@ var ts; if (!!(decl.flags & 8388608 /* Ambient */)) return true; switch (decl.kind) { - case 209 /* BinaryExpression */: - case 191 /* BindingElement */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 210 /* BinaryExpression */: + case 192 /* BindingElement */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: case 84 /* DefaultKeyword */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 263 /* ExportSpecifier */: - case 255 /* ImportClause */: // default import - case 253 /* ImportEqualsDeclaration */: - case 258 /* ImportSpecifier */: - case 246 /* InterfaceDeclaration */: - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: - case 273 /* JsxAttribute */: - case 249 /* ModuleDeclaration */: - case 252 /* NamespaceExportDeclaration */: - case 256 /* NamespaceImport */: - case 262 /* NamespaceExport */: - case 156 /* Parameter */: - case 282 /* ShorthandPropertyAssignment */: - case 247 /* TypeAliasDeclaration */: - case 155 /* TypeParameter */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 264 /* ExportSpecifier */: + case 256 /* ImportClause */: // default import + case 254 /* ImportEqualsDeclaration */: + case 259 /* ImportSpecifier */: + case 247 /* InterfaceDeclaration */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: + case 274 /* JsxAttribute */: + case 250 /* ModuleDeclaration */: + case 253 /* NamespaceExportDeclaration */: + case 257 /* NamespaceImport */: + case 263 /* NamespaceExport */: + case 157 /* Parameter */: + case 283 /* ShorthandPropertyAssignment */: + case 248 /* TypeAliasDeclaration */: + case 156 /* TypeParameter */: return true; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // In `({ x: y } = 0);`, `x` is not a write access. (Won't call this function for `y`.) return !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent); - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return !!decl.body; - case 242 /* VariableDeclaration */: - case 159 /* PropertyDeclaration */: + case 243 /* VariableDeclaration */: + case 160 /* PropertyDeclaration */: return !!decl.initializer || ts.isCatchClause(decl.parent); - case 160 /* MethodSignature */: - case 158 /* PropertySignature */: - case 323 /* JSDocPropertyTag */: - case 317 /* JSDocParameterTag */: + case 161 /* MethodSignature */: + case 159 /* PropertySignature */: + case 324 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: return false; default: return ts.Debug.failBadSyntaxKind(decl); @@ -114704,10 +115290,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; switch (decl.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: // Don't include the source file itself. (This may not be ideal behavior, but awkward to include an entire file as a reference.) break; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: if (sourceFilesSet.has(decl.getSourceFile().fileName)) { references.push(nodeEntry(decl.name)); } @@ -114736,9 +115322,9 @@ var ts; } /** As in a `readonly prop: any` or `constructor(readonly prop: any)`, not a `readonly any[]`. */ function isReadonlyTypeOperator(node) { - return node.kind === 138 /* ReadonlyKeyword */ + return node.kind === 139 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(node.parent) - && node.parent.operator === 138 /* ReadonlyKeyword */; + && node.parent.operator === 139 /* ReadonlyKeyword */; } /** getReferencedSymbols for special node kinds. */ function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { @@ -114749,12 +115335,12 @@ var ts; } // A modifier readonly (like on a property declaration) is not special; // a readonly type keyword (like `readonly string[]`) is. - if (node.kind === 138 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { + if (node.kind === 139 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { return undefined; } // Likewise, when we *are* looking for a special keyword, make sure we // *don’t* include readonly member modifiers. - return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 138 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); + return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 139 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); } // Labels if (ts.isJumpStatementTarget(node)) { @@ -114815,7 +115401,7 @@ var ts; } function getSpecialSearchKind(node) { switch (node.kind) { - case 129 /* ConstructorKeyword */: + case 130 /* ConstructorKeyword */: return 1 /* Constructor */; case 75 /* Identifier */: if (ts.isClassLike(node.parent)) { @@ -115055,7 +115641,7 @@ var ts; // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 201 /* FunctionExpression */ || valueDeclaration.kind === 214 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 202 /* FunctionExpression */ || valueDeclaration.kind === 215 /* ClassExpression */)) { return valueDeclaration; } if (!declarations) { @@ -115065,7 +115651,7 @@ var ts; if (flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.find(declarations, function (d) { return ts.hasModifier(d, 8 /* Private */) || ts.isPrivateIdentifierPropertyDeclaration(d); }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 245 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 246 /* ClassDeclaration */); } // Else this is a public property and could be accessed from anywhere. return undefined; @@ -115094,7 +115680,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (!container || container.kind === 290 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 291 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { // This is a global variable and not an external module, any declaration defined // within this scope is visible outside the file return undefined; @@ -115463,15 +116049,15 @@ var ts; if (constructorSymbol && constructorSymbol.declarations) { for (var _i = 0, _a = constructorSymbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - var ctrKeyword = ts.findChildOfKind(decl, 129 /* ConstructorKeyword */, sourceFile); - ts.Debug.assert(decl.kind === 162 /* Constructor */ && !!ctrKeyword); + var ctrKeyword = ts.findChildOfKind(decl, 130 /* ConstructorKeyword */, sourceFile); + ts.Debug.assert(decl.kind === 163 /* Constructor */ && !!ctrKeyword); addNode(ctrKeyword); } } if (classSymbol.exports) { classSymbol.exports.forEach(function (member) { var decl = member.valueDeclaration; - if (decl && decl.kind === 161 /* MethodDeclaration */) { + if (decl && decl.kind === 162 /* MethodDeclaration */) { var body = decl.body; if (body) { forEachDescendantOfKind(body, 104 /* ThisKeyword */, function (thisKeyword) { @@ -115495,7 +116081,7 @@ var ts; } for (var _i = 0, _a = constructor.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - ts.Debug.assert(decl.kind === 162 /* Constructor */); + ts.Debug.assert(decl.kind === 163 /* Constructor */); var body = decl.body; if (body) { forEachDescendantOfKind(body, 102 /* SuperKeyword */, function (node) { @@ -115525,7 +116111,7 @@ var ts; if (refNode.kind !== 75 /* Identifier */) { return; } - if (refNode.parent.kind === 282 /* ShorthandPropertyAssignment */) { + if (refNode.parent.kind === 283 /* ShorthandPropertyAssignment */) { // Go ahead and dereference the shorthand assignment by going to its definition getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); } @@ -115545,7 +116131,7 @@ var ts; } else if (ts.isFunctionLike(typeHavingNode) && typeHavingNode.body) { var body = typeHavingNode.body; - if (body.kind === 223 /* Block */) { + if (body.kind === 224 /* Block */) { ts.forEachReturnStatement(body, function (returnStatement) { if (returnStatement.expression) addIfImplementation(returnStatement.expression); @@ -115573,13 +116159,13 @@ var ts; */ function isImplementationExpression(node) { switch (node.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isImplementationExpression(node.expression); - case 202 /* ArrowFunction */: - case 201 /* FunctionExpression */: - case 193 /* ObjectLiteralExpression */: - case 214 /* ClassExpression */: - case 192 /* ArrayLiteralExpression */: + case 203 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 194 /* ObjectLiteralExpression */: + case 215 /* ClassExpression */: + case 193 /* ArrayLiteralExpression */: return true; default: return false; @@ -115632,13 +116218,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -115659,41 +116245,41 @@ var ts; return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references: references }]; } function isParameterName(node) { - return node.kind === 75 /* Identifier */ && node.parent.kind === 156 /* Parameter */ && node.parent.name === node; + return node.kind === 75 /* Identifier */ && node.parent.kind === 157 /* Parameter */ && node.parent.name === node; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); // Whether 'this' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // falls through - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { return undefined; } // falls through - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. default: return undefined; } - var references = ts.flatMap(searchSpaceNode.kind === 290 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { + var references = ts.flatMap(searchSpaceNode.kind === 291 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { cancellationToken.throwIfCancellationRequested(); return getPossibleSymbolReferenceNodes(sourceFile, "this", ts.isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter(function (node) { if (!ts.isThis(node)) { @@ -115701,19 +116287,19 @@ var ts; } var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); switch (searchSpaceNode.kind) { - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: return searchSpaceNode.symbol === container.symbol; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: return ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol; - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: // Make sure the container belongs to the same class // and has the appropriate static modifier from the original container. return container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag; - case 290 /* SourceFile */: - return container.kind === 290 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); + case 291 /* SourceFile */: + return container.kind === 291 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); } }); }).map(function (n) { return nodeEntry(n); }); @@ -115796,7 +116382,7 @@ var ts; ts.Debug.assert(paramProps.length === 2 && !!(paramProps[0].flags & 1 /* FunctionScopedVariable */) && !!(paramProps[1].flags & 4 /* Property */)); // is [parameter, property] return fromRoot(symbol.flags & 1 /* FunctionScopedVariable */ ? paramProps[1] : paramProps[0]); } - var exportSpecifier = ts.getDeclarationOfKind(symbol, 263 /* ExportSpecifier */); + var exportSpecifier = ts.getDeclarationOfKind(symbol, 264 /* ExportSpecifier */); if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) { var localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); if (localSymbol) { @@ -115841,7 +116427,7 @@ var ts; }); } function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { - var bindingElement = ts.getDeclarationOfKind(symbol, 191 /* BindingElement */); + var bindingElement = ts.getDeclarationOfKind(symbol, 192 /* BindingElement */); if (bindingElement && ts.isObjectBindingElementWithoutPropertyName(bindingElement)) { return ts.getPropertySymbolFromBindingElement(checker, bindingElement); } @@ -116237,55 +116823,55 @@ var ts; } switch (node.kind) { case 75 /* Identifier */: - case 253 /* ImportEqualsDeclaration */: - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: // do not descend into nodes that cannot contain callable nodes return; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: // do not descend into the type side of an assertion collect(node.expression); return; - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: // do not descend into the type of a variable or parameter declaration collect(node.name); collect(node.initializer); return; - case 196 /* CallExpression */: + case 197 /* CallExpression */: // do not descend into the type arguments of a call expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 197 /* NewExpression */: + case 198 /* NewExpression */: // do not descend into the type arguments of a new expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: // do not descend into the type arguments of a tagged template expression recordCallSite(node); collect(node.tag); collect(node.template); return; - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: // do not descend into the type arguments of a JsxOpeningLikeElement recordCallSite(node); collect(node.tagName); collect(node.attributes); return; - case 157 /* Decorator */: + case 158 /* Decorator */: recordCallSite(node); collect(node.expression); return; - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: recordCallSite(node); ts.forEachChild(node, collect); break; @@ -116335,22 +116921,22 @@ var ts; var callSites = []; var collect = createCallSiteCollector(program, callSites); switch (node.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: collectCallSitesOfSourceFile(node, collect); break; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: collectCallSitesOfModuleDeclaration(node, collect); break; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect); break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: collectCallSitesOfClassLikeDeclaration(node, collect); break; default: @@ -116647,7 +117233,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { var shorthandSymbol_1 = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); return shorthandSymbol_1 ? shorthandSymbol_1.declarations.map(function (decl) { return createDefinitionInfo(decl, typeChecker, shorthandSymbol_1, node); }) : []; } @@ -116816,11 +117402,11 @@ var ts; return true; } switch (declaration.kind) { - case 255 /* ImportClause */: - case 253 /* ImportEqualsDeclaration */: + case 256 /* ImportClause */: + case 254 /* ImportEqualsDeclaration */: return true; - case 258 /* ImportSpecifier */: - return declaration.parent.kind === 257 /* NamedImports */; + case 259 /* ImportSpecifier */: + return declaration.parent.kind === 258 /* NamedImports */; default: return false; } @@ -116834,7 +117420,7 @@ var ts; function getConstructSignatureDefinition() { // Applicable only if we are in a new expression, or we are on a constructor declaration // and in either case the symbol has a construct signature definition, i.e. class - if (symbol.flags & 32 /* Class */ && !(symbol.flags & 16 /* Function */) && (ts.isNewExpressionTarget(node) || node.kind === 129 /* ConstructorKeyword */)) { + if (symbol.flags & 32 /* Class */ && !(symbol.flags & 16 /* Function */) && (ts.isNewExpressionTarget(node) || node.kind === 130 /* ConstructorKeyword */)) { var cls = ts.find(filteredDeclarations, ts.isClassLike) || ts.Debug.fail("Expected declaration to have at least one class-like declaration"); return getSignatureDefinition(cls.members, /*selectConstructors*/ true); } @@ -116907,9 +117493,9 @@ var ts; } function isConstructorLike(node) { switch (node.kind) { - case 162 /* Constructor */: - case 171 /* ConstructorType */: - case 166 /* ConstructSignature */: + case 163 /* Constructor */: + case 172 /* ConstructorType */: + case 167 /* ConstructSignature */: return true; default: return false; @@ -117027,11 +117613,11 @@ var ts; JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; function getCommentHavingNodes(declaration) { switch (declaration.kind) { - case 317 /* JSDocParameterTag */: - case 323 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: + case 324 /* JSDocPropertyTag */: return [declaration]; - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: return [declaration, declaration.parent]; default: return ts.getJSDocCommentsAndTags(declaration); @@ -117052,18 +117638,18 @@ var ts; function getCommentText(tag) { var comment = tag.comment; switch (tag.kind) { - case 308 /* JSDocImplementsTag */: + case 309 /* JSDocImplementsTag */: return withNode(tag.class); - case 307 /* JSDocAugmentsTag */: + case 308 /* JSDocAugmentsTag */: return withNode(tag.class); - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return withList(tag.typeParameters); - case 320 /* JSDocTypeTag */: + case 321 /* JSDocTypeTag */: return withNode(tag.typeExpression); - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 323 /* JSDocPropertyTag */: - case 317 /* JSDocParameterTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 324 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: var name = tag.name; return name ? withNode(name) : comment; default: @@ -117232,23 +117818,23 @@ var ts; } function getCommentOwnerInfoWorker(commentOwner) { switch (commentOwner.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 160 /* MethodSignature */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 161 /* MethodSignature */: var parameters = commentOwner.parameters; return { commentOwner: commentOwner, parameters: parameters }; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return getCommentOwnerInfoWorker(commentOwner.initializer); - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 158 /* PropertySignature */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 247 /* TypeAliasDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 159 /* PropertySignature */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 248 /* TypeAliasDeclaration */: return { commentOwner: commentOwner }; - case 225 /* VariableStatement */: { + case 226 /* VariableStatement */: { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; var parameters_1 = varDeclarations.length === 1 && varDeclarations[0].initializer @@ -117256,14 +117842,14 @@ var ts; : undefined; return { commentOwner: commentOwner, parameters: parameters_1 }; } - case 290 /* SourceFile */: + case 291 /* SourceFile */: return "quit"; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: // If in walking up the tree, we hit a a nested namespace declaration, // then we must be somewhere within a dotted namespace name; however we don't // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. - return commentOwner.parent.kind === 249 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; - case 209 /* BinaryExpression */: { + return commentOwner.parent.kind === 250 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; + case 210 /* BinaryExpression */: { var be = commentOwner; if (ts.getAssignmentDeclarationKind(be) === 0 /* None */) { return "quit"; @@ -117271,7 +117857,7 @@ var ts; var parameters_2 = ts.isFunctionLike(be.right) ? be.right.parameters : ts.emptyArray; return { commentOwner: commentOwner, parameters: parameters_2 }; } - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: var init = commentOwner.initializer; if (init && (ts.isFunctionExpression(init) || ts.isArrowFunction(init))) { return { commentOwner: commentOwner, parameters: init.parameters }; @@ -117287,14 +117873,14 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 200 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 201 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return rightHandSide.parameters; - case 214 /* ClassExpression */: { + case 215 /* ClassExpression */: { var ctr = ts.find(rightHandSide.members, ts.isConstructorDeclaration); return ctr ? ctr.parameters : ts.emptyArray; } @@ -117356,9 +117942,9 @@ var ts; } function shouldKeepItem(declaration, checker) { switch (declaration.kind) { - case 255 /* ImportClause */: - case 258 /* ImportSpecifier */: - case 253 /* ImportEqualsDeclaration */: + case 256 /* ImportClause */: + case 259 /* ImportSpecifier */: + case 254 /* ImportEqualsDeclaration */: var importer = checker.getSymbolAtLocation(declaration.name); // TODO: GH#18217 var imported = checker.getAliasedSymbol(importer); return importer.escapedName !== imported.escapedName; @@ -117368,7 +117954,7 @@ var ts; } function tryAddSingleDeclarationName(declaration, containers) { var name = ts.getNameOfDeclaration(declaration); - return !!name && (pushLiteral(name, containers) || name.kind === 154 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); + return !!name && (pushLiteral(name, containers) || name.kind === 155 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); } // Only added the names of computed properties if they're simple dotted expressions, like: // @@ -117385,7 +117971,7 @@ var ts; // First, if we started with a computed property name, then add all but the last // portion into the container array. var name = ts.getNameOfDeclaration(declaration); - if (name && name.kind === 154 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { + if (name && name.kind === 155 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { return ts.emptyArray; } // Don't include the last portion. @@ -117592,7 +118178,7 @@ var ts; return; } switch (node.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it. var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); @@ -117604,21 +118190,21 @@ var ts; } } break; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 161 /* MethodSignature */: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 255 /* ImportClause */: + case 256 /* ImportClause */: var importClause = node; // Handle default import case e.g.: // import d from "mod"; @@ -117630,7 +118216,7 @@ var ts; // import {a, b as B} from "mod"; var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 256 /* NamespaceImport */) { + if (namedBindings.kind === 257 /* NamespaceImport */) { addLeafNode(namedBindings); } else { @@ -117641,17 +118227,17 @@ var ts; } } break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: addNodeWithRecursiveChild(node, node.name); break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: var expression = node.expression; // Use the expression as the name of the SpreadAssignment, otherwise show as . ts.isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node); break; - case 191 /* BindingElement */: - case 281 /* PropertyAssignment */: - case 242 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 282 /* PropertyAssignment */: + case 243 /* VariableDeclaration */: var _e = node, name = _e.name, initializer = _e.initializer; if (ts.isBindingPattern(name)) { addChildrenRecursively(name); @@ -117666,7 +118252,7 @@ var ts; addNodeWithRecursiveChild(node, initializer); } break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: var nameNode = node.name; // If we see a function declaration track as a possible ES5 class if (nameNode && ts.isIdentifier(nameNode)) { @@ -117674,11 +118260,11 @@ var ts; } addNodeWithRecursiveChild(node, node.body); break; - case 202 /* ArrowFunction */: - case 201 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 202 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: startNode(node); for (var _f = 0, _g = node.members; _f < _g.length; _f++) { var member = _g[_f]; @@ -117688,9 +118274,9 @@ var ts; } endNode(); break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: startNode(node); for (var _h = 0, _j = node.members; _h < _j.length; _h++) { var member = _j[_h]; @@ -117698,20 +118284,20 @@ var ts; } endNode(); break; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 259 /* ExportAssignment */: - case 263 /* ExportSpecifier */: - case 253 /* ImportEqualsDeclaration */: - case 167 /* IndexSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 247 /* TypeAliasDeclaration */: + case 260 /* ExportAssignment */: + case 264 /* ExportSpecifier */: + case 254 /* ImportEqualsDeclaration */: + case 168 /* IndexSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 248 /* TypeAliasDeclaration */: addLeafNode(node); break; - case 196 /* CallExpression */: - case 209 /* BinaryExpression */: { + case 197 /* CallExpression */: + case 210 /* BinaryExpression */: { var special = ts.getAssignmentDeclarationKind(node); switch (special) { case 1 /* ExportsProperty */: @@ -117953,12 +118539,12 @@ var ts; return false; } switch (a.kind) { - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return ts.hasModifier(a, 32 /* Static */) === ts.hasModifier(b, 32 /* Static */); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return areSameModule(a, b); default: return true; @@ -117974,7 +118560,7 @@ var ts; // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'! function areSameModule(a, b) { // TODO: GH#18217 - return a.body.kind === b.body.kind && (a.body.kind !== 249 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 250 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); } /** Merge source into target. Source should be thrown away after this is called. */ function merge(target, source) { @@ -118004,7 +118590,7 @@ var ts; * So `new()` can still come before an `aardvark` method. */ function tryGetName(node) { - if (node.kind === 249 /* ModuleDeclaration */) { + if (node.kind === 250 /* ModuleDeclaration */) { return getModuleName(node); } var declName = ts.getNameOfDeclaration(node); @@ -118013,16 +118599,16 @@ var ts; return propertyName && ts.unescapeLeadingUnderscores(propertyName); } switch (node.kind) { - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 214 /* ClassExpression */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 215 /* ClassExpression */: return getFunctionOrClassName(node); default: return undefined; } } function getItemName(node, name) { - if (node.kind === 249 /* ModuleDeclaration */) { + if (node.kind === 250 /* ModuleDeclaration */) { return cleanText(getModuleName(node)); } if (name) { @@ -118034,18 +118620,18 @@ var ts; } } switch (node.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return ts.isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; - case 202 /* ArrowFunction */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 203 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: if (ts.getModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -118053,13 +118639,13 @@ var ts; // (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the // navigation bar. return getFunctionOrClassName(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return "constructor"; - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: return "new()"; - case 165 /* CallSignature */: + case 166 /* CallSignature */: return "()"; - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: return "[]"; default: return ""; @@ -118092,19 +118678,19 @@ var ts; } // Some nodes are otherwise important enough to always include in the primary navigation menu. switch (navigationBarNodeKind(item)) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 248 /* EnumDeclaration */: - case 246 /* InterfaceDeclaration */: - case 249 /* ModuleDeclaration */: - case 290 /* SourceFile */: - case 247 /* TypeAliasDeclaration */: - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 249 /* EnumDeclaration */: + case 247 /* InterfaceDeclaration */: + case 250 /* ModuleDeclaration */: + case 291 /* SourceFile */: + case 248 /* TypeAliasDeclaration */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: return true; - case 202 /* ArrowFunction */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -118114,10 +118700,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 250 /* ModuleBlock */: - case 290 /* SourceFile */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: + case 251 /* ModuleBlock */: + case 291 /* SourceFile */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: return true; default: return false; @@ -118177,7 +118763,7 @@ var ts; // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 249 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 250 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } @@ -118191,13 +118777,13 @@ var ts; return decl.body && ts.isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 154 /* ComputedPropertyName */; + return !member.name || member.name.kind === 155 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 290 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); + return node.kind === 291 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); } function getModifiers(node) { - if (node.parent && node.parent.kind === 242 /* VariableDeclaration */) { + if (node.parent && node.parent.kind === 243 /* VariableDeclaration */) { node = node.parent; } return ts.getNodeModifiers(node); @@ -118255,9 +118841,9 @@ var ts; } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 202 /* ArrowFunction */: - case 201 /* FunctionExpression */: - case 214 /* ClassExpression */: + case 203 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 215 /* ClassExpression */: return true; default: return false; @@ -118765,7 +119351,7 @@ var ts; } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 223 /* Block */: + case 224 /* Block */: if (ts.isFunctionLike(n.parent)) { return functionSpan(n.parent, n, sourceFile); } @@ -118773,16 +119359,16 @@ var ts; // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. switch (n.parent.kind) { - case 228 /* DoStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 230 /* ForStatement */: - case 227 /* IfStatement */: - case 229 /* WhileStatement */: - case 236 /* WithStatement */: - case 280 /* CatchClause */: + case 229 /* DoStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 231 /* ForStatement */: + case 228 /* IfStatement */: + case 230 /* WhileStatement */: + case 237 /* WithStatement */: + case 281 /* CatchClause */: return spanForNode(n.parent); - case 240 /* TryStatement */: + case 241 /* TryStatement */: // Could be the try-block, or the finally-block. var tryStatement = n.parent; if (tryStatement.tryBlock === n) { @@ -118799,26 +119385,29 @@ var ts; // the span of the block, independent of any parent span. return createOutliningSpan(ts.createTextSpanFromNode(n, sourceFile), "code" /* Code */); } - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return spanForNode(n.parent); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 251 /* CaseBlock */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 252 /* CaseBlock */: return spanForNode(n); - case 193 /* ObjectLiteralExpression */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: + return spanForNodeArray(n.statements); + case 194 /* ObjectLiteralExpression */: return spanForObjectOrArrayLiteral(n); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return spanForObjectOrArrayLiteral(n, 22 /* OpenBracketToken */); - case 266 /* JsxElement */: + case 267 /* JsxElement */: return spanForJSXElement(n); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return spanForJSXFragment(n); - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: return spanForJSXAttributes(n.attributes); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: return spanForTemplateLiteral(n); } @@ -118861,13 +119450,16 @@ var ts; var closeToken = ts.findChildOfKind(n, close, sourceFile); return openToken && closeToken && spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart); } + function spanForNodeArray(nodeArray) { + return nodeArray.length ? createOutliningSpan(ts.createTextSpanFromRange(nodeArray), "code" /* Code */) : undefined; + } } function functionSpan(node, body, sourceFile) { var openToken = ts.isNodeArrayMultiLine(node.parameters, sourceFile) ? ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile) : ts.findChildOfKind(body, 18 /* OpenBraceToken */, sourceFile); var closeToken = ts.findChildOfKind(body, 19 /* CloseBraceToken */, sourceFile); - return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 202 /* ArrowFunction */); + return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 203 /* ArrowFunction */); } function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart) { if (autoCollapse === void 0) { autoCollapse = false; } @@ -119402,10 +119994,10 @@ var ts; */ function tryConsumeDeclare() { var token = ts.scanner.getToken(); - if (token === 130 /* DeclareKeyword */) { + if (token === 131 /* DeclareKeyword */) { // declare module "mod" token = nextToken(); - if (token === 135 /* ModuleKeyword */) { + if (token === 136 /* ModuleKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { recordAmbientExternalModule(); @@ -119427,7 +120019,7 @@ var ts; token = nextToken(); if (token === 20 /* OpenParenToken */) { token = nextToken(); - if (token === 10 /* StringLiteral */) { + if (token === 10 /* StringLiteral */ || token === 14 /* NoSubstitutionTemplateLiteral */) { // import("mod"); recordModuleName(); return true; @@ -119441,7 +120033,7 @@ var ts; else { if (token === 75 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 149 /* FromKeyword */) { + if (token === 150 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import d from "mod"; @@ -119472,7 +120064,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 149 /* FromKeyword */) { + if (token === 150 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import {a as A} from "mod"; @@ -119488,7 +120080,7 @@ var ts; token = nextToken(); if (token === 75 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 149 /* FromKeyword */) { + if (token === 150 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import * as NS from "mod" @@ -119518,7 +120110,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 149 /* FromKeyword */) { + if (token === 150 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export {a as A} from "mod"; @@ -119530,7 +120122,7 @@ var ts; } else if (token === 41 /* AsteriskToken */) { token = nextToken(); - if (token === 149 /* FromKeyword */) { + if (token === 150 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export * from "mod" @@ -119553,13 +120145,15 @@ var ts; } return false; } - function tryConsumeRequireCall(skipCurrentToken) { + function tryConsumeRequireCall(skipCurrentToken, allowTemplateLiterals) { + if (allowTemplateLiterals === void 0) { allowTemplateLiterals = false; } var token = skipCurrentToken ? nextToken() : ts.scanner.getToken(); - if (token === 139 /* RequireKeyword */) { + if (token === 140 /* RequireKeyword */) { token = nextToken(); if (token === 20 /* OpenParenToken */) { token = nextToken(); - if (token === 10 /* StringLiteral */) { + if (token === 10 /* StringLiteral */ || + allowTemplateLiterals && token === 14 /* NoSubstitutionTemplateLiteral */) { // require("mod"); recordModuleName(); } @@ -119576,7 +120170,7 @@ var ts; return true; } token = nextToken(); - if (token === 10 /* StringLiteral */) { + if (token === 10 /* StringLiteral */ || token === 14 /* NoSubstitutionTemplateLiteral */) { // looks like define ("modname", ... - skip string literal and comma token = nextToken(); if (token === 27 /* CommaToken */) { @@ -119596,7 +120190,7 @@ var ts; // scan until ']' or EOF while (token !== 23 /* CloseBracketToken */ && token !== 1 /* EndOfFileToken */) { // record string literals as module names - if (token === 10 /* StringLiteral */) { + if (token === 10 /* StringLiteral */ || token === 14 /* NoSubstitutionTemplateLiteral */) { recordModuleName(); } token = nextToken(); @@ -119631,7 +120225,8 @@ var ts; if (tryConsumeDeclare() || tryConsumeImport() || tryConsumeExport() || - (detectJavaScriptImports && (tryConsumeRequireCall(/*skipCurrentToken*/ false) || tryConsumeDefine()))) { + (detectJavaScriptImports && (tryConsumeRequireCall(/*skipCurrentToken*/ false, /*allowTemplateLiterals*/ true) || + tryConsumeDefine()))) { continue; } else { @@ -119707,14 +120302,14 @@ var ts; return getRenameInfoError(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); } // Cannot rename `default` as in `import { default as foo } from "./someModule"; - if (ts.isIdentifier(node) && node.originalKeywordKind === 84 /* DefaultKeyword */ && symbol.parent.flags & 1536 /* Module */) { + if (ts.isIdentifier(node) && node.originalKeywordKind === 84 /* DefaultKeyword */ && symbol.parent && symbol.parent.flags & 1536 /* Module */) { return undefined; } if (ts.isStringLiteralLike(node) && ts.tryGetImportFromModuleSpecifier(node)) { return options && options.allowRenameOfImportPath ? getRenameInfoForModule(node, sourceFile, symbol) : undefined; } var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 154 /* ComputedPropertyName */) + var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 155 /* ComputedPropertyName */) ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node)) : undefined; var displayName = specifierName || typeChecker.symbolToString(symbol); @@ -119926,14 +120521,14 @@ var ts; ts.Debug.assertEqual(closeBraceToken.kind, 19 /* CloseBraceToken */); // Group `-/+readonly` and `-/+?` var groupedWithPlusMinusTokens = groupChildren(children, function (child) { - return child === node.readonlyToken || child.kind === 138 /* ReadonlyKeyword */ || + return child === node.readonlyToken || child.kind === 139 /* ReadonlyKeyword */ || child === node.questionToken || child.kind === 57 /* QuestionToken */; }); // Group type parameter with surrounding brackets var groupedWithBrackets = groupChildren(groupedWithPlusMinusTokens, function (_a) { var kind = _a.kind; return kind === 22 /* OpenBracketToken */ || - kind === 155 /* TypeParameter */ || + kind === 156 /* TypeParameter */ || kind === 23 /* CloseBracketToken */; }); return [ @@ -120040,7 +120635,7 @@ var ts; } function createSyntaxList(children) { ts.Debug.assertGreaterThanOrEqual(children.length, 1); - var syntaxList = ts.createNode(324 /* SyntaxList */, children[0].pos, ts.last(children).end); + var syntaxList = ts.createNode(325 /* SyntaxList */, children[0].pos, ts.last(children).end); syntaxList._children = children; return syntaxList; } @@ -120049,14 +120644,14 @@ var ts; return kind === 18 /* OpenBraceToken */ || kind === 22 /* OpenBracketToken */ || kind === 20 /* OpenParenToken */ - || kind === 268 /* JsxOpeningElement */; + || kind === 269 /* JsxOpeningElement */; } function isListCloser(token) { var kind = token && token.kind; return kind === 19 /* CloseBraceToken */ || kind === 23 /* CloseBracketToken */ || kind === 21 /* CloseParenToken */ - || kind === 269 /* JsxClosingElement */; + || kind === 270 /* JsxClosingElement */; } })(SmartSelectionRange = ts.SmartSelectionRange || (ts.SmartSelectionRange = {})); })(ts || (ts = {})); @@ -120261,10 +120856,10 @@ var ts; } return undefined; } - else if (ts.isTemplateHead(node) && parent.parent.kind === 198 /* TaggedTemplateExpression */) { + else if (ts.isTemplateHead(node) && parent.parent.kind === 199 /* TaggedTemplateExpression */) { var templateExpression = parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 211 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 212 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } @@ -120331,17 +120926,17 @@ var ts; return undefined; var parent = startingToken.parent; switch (parent.kind) { - case 200 /* ParenthesizedExpression */: - case 161 /* MethodDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 201 /* ParenthesizedExpression */: + case 162 /* MethodDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: var info = getArgumentOrParameterListInfo(startingToken, sourceFile); if (!info) return undefined; var argumentIndex = info.argumentIndex, argumentCount = info.argumentCount, argumentsSpan = info.argumentsSpan; var contextualType = ts.isMethodDeclaration(parent) ? checker.getContextualTypeForObjectLiteralElement(parent) : checker.getContextualType(parent); return contextualType && { contextualType: contextualType, argumentIndex: argumentIndex, argumentCount: argumentCount, argumentsSpan: argumentsSpan }; - case 209 /* BinaryExpression */: { + case 210 /* BinaryExpression */: { var highestBinary = getHighestBinary(parent); var contextualType_1 = checker.getContextualType(highestBinary); var argumentIndex_1 = startingToken.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent) - 1; @@ -120465,7 +121060,7 @@ var ts; // | | // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 211 /* TemplateExpression */) { + if (template.kind === 212 /* TemplateExpression */) { var lastSpan = ts.last(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -120812,11 +121407,11 @@ var ts; function containsTopLevelCommonjs(sourceFile) { return sourceFile.statements.some(function (statement) { switch (statement.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return statement.declarationList.declarations.some(function (decl) { return !!decl.initializer && ts.isRequireCall(propertyAccessLeftHandSide(decl.initializer), /*checkArgumentIsStringLiteralLike*/ true); }); - case 226 /* ExpressionStatement */: { + case 227 /* ExpressionStatement */: { var expression = statement.expression; if (!ts.isBinaryExpression(expression)) return ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true); @@ -120833,12 +121428,12 @@ var ts; } function importNameForConvertToDefaultImport(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: var importClause = node.importClause, moduleSpecifier = node.moduleSpecifier; - return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 256 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) + return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 257 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : undefined; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return node.name; default: return undefined; @@ -120896,9 +121491,9 @@ var ts; // should be kept up to date with getTransformationBody in convertToAsyncFunction.ts function isFixablePromiseArgument(arg) { switch (arg.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); // falls through case 100 /* NullKeyword */: @@ -120913,7 +121508,7 @@ var ts; } function canBeConvertedToClass(node) { var _a, _b, _c, _d; - if (node.kind === 201 /* FunctionExpression */) { + if (node.kind === 202 /* FunctionExpression */) { if (ts.isVariableDeclaration(node.parent) && ((_a = node.symbol.members) === null || _a === void 0 ? void 0 : _a.size)) { return true; } @@ -120921,7 +121516,7 @@ var ts; var symbol = decl === null || decl === void 0 ? void 0 : decl.symbol; return !!(symbol && (((_b = symbol.exports) === null || _b === void 0 ? void 0 : _b.size) || ((_c = symbol.members) === null || _c === void 0 ? void 0 : _c.size))); } - if (node.kind === 244 /* FunctionDeclaration */) { + if (node.kind === 245 /* FunctionDeclaration */) { return !!((_d = node.symbol.members) === null || _d === void 0 ? void 0 : _d.size); } return false; @@ -120940,7 +121535,7 @@ var ts; } var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32 /* Class */) { - return ts.getDeclarationOfKind(symbol, 214 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 215 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; } if (flags & 384 /* Enum */) @@ -121026,11 +121621,11 @@ var ts; // If we requested completions after `x.` at the top-level, we may be at a source file location. switch (location.parent && location.parent.kind) { // If we've typed a character of the attribute name, will be 'JsxAttribute', else will be 'JsxOpeningElement'. - case 268 /* JsxOpeningElement */: - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: return location.kind === 75 /* Identifier */ ? "property" /* memberVariableElement */ : "JSX attribute" /* jsxAttribute */; - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return "JSX attribute" /* jsxAttribute */; default: return "property" /* memberVariableElement */; @@ -121074,7 +121669,7 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (location.parent && location.parent.kind === 194 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 195 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -121094,7 +121689,7 @@ var ts; } if (callExpressionLike) { signature = typeChecker.getResolvedSignature(callExpressionLike); // TODO: GH#18217 - var useConstructSignatures = callExpressionLike.kind === 197 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 102 /* SuperKeyword */); + var useConstructSignatures = callExpressionLike.kind === 198 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 102 /* SuperKeyword */); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -121150,29 +121745,29 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || // name of function declaration - (location.kind === 129 /* ConstructorKeyword */ && location.parent.kind === 162 /* Constructor */)) { // At constructor keyword of constructor declaration + (location.kind === 130 /* ConstructorKeyword */ && location.parent.kind === 163 /* Constructor */)) { // At constructor keyword of constructor declaration // get the signature from the declaration and write it var functionDeclaration_1 = location.parent; // Use function declaration to write the signatures only if the symbol corresponding to this declaration var locationIsSymbolDeclaration = symbol.declarations && ts.find(symbol.declarations, function (declaration) { - return declaration === (location.kind === 129 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); + return declaration === (location.kind === 130 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); }); if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 162 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration_1.kind === 163 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); // TODO: GH#18217 } else { signature = allSignatures[0]; } - if (functionDeclaration_1.kind === 162 /* Constructor */) { + if (functionDeclaration_1.kind === 163 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = "constructor" /* constructorImplementationElement */; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 165 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 166 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -121183,7 +121778,7 @@ var ts; } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { addAliasPrefixIfNecessary(); - if (ts.getDeclarationOfKind(symbol, 214 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 215 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -121206,7 +121801,7 @@ var ts; } if ((symbolFlags & 524288 /* TypeAlias */) && (semanticMeaning & 2 /* Type */)) { prefixNextMeaning(); - displayParts.push(ts.keywordPart(145 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(146 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); @@ -121227,9 +121822,9 @@ var ts; } if (symbolFlags & 1536 /* Module */ && !isThisExpression) { prefixNextMeaning(); - var declaration = ts.getDeclarationOfKind(symbol, 249 /* ModuleDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 250 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 75 /* Identifier */; - displayParts.push(ts.keywordPart(isNamespace ? 136 /* NamespaceKeyword */ : 135 /* ModuleKeyword */)); + displayParts.push(ts.keywordPart(isNamespace ? 137 /* NamespaceKeyword */ : 136 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -121248,7 +121843,7 @@ var ts; } else { // Method/function type parameter - var decl = ts.getDeclarationOfKind(symbol, 155 /* TypeParameter */); + var decl = ts.getDeclarationOfKind(symbol, 156 /* TypeParameter */); if (decl === undefined) return ts.Debug.fail(); var declaration = decl.parent; @@ -121256,21 +121851,21 @@ var ts; if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); // TODO: GH#18217 - if (declaration.kind === 166 /* ConstructSignature */) { + if (declaration.kind === 167 /* ConstructSignature */) { displayParts.push(ts.keywordPart(99 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 165 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 166 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } - else if (declaration.kind === 247 /* TypeAliasDeclaration */) { + else if (declaration.kind === 248 /* TypeAliasDeclaration */) { // Type alias type parameter // For example // type list = T[]; // Both T will go through same code path addInPrefix(); - displayParts.push(ts.keywordPart(145 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(146 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -121282,7 +121877,7 @@ var ts; symbolKind = "enum member" /* enumMemberElement */; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 284 /* EnumMember */) { + if (declaration.kind === 285 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -121312,17 +121907,17 @@ var ts; } } switch (symbol.declarations[0].kind) { - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(136 /* NamespaceKeyword */)); + displayParts.push(ts.keywordPart(137 /* NamespaceKeyword */)); break; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 62 /* EqualsToken */ : 84 /* DefaultKeyword */)); break; - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); break; default: @@ -121331,13 +121926,13 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 253 /* ImportEqualsDeclaration */) { + if (declaration.kind === 254 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(62 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(139 /* RequireKeyword */)); + displayParts.push(ts.keywordPart(140 /* RequireKeyword */)); displayParts.push(ts.punctuationPart(20 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(21 /* CloseParenToken */)); @@ -121410,10 +122005,10 @@ var ts; // For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo` // there documentation comments might be attached to the right hand side symbol of their declarations. // The pattern of such special property access is that the parent symbol is the symbol of the file. - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 290 /* SourceFile */; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 291 /* SourceFile */; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 209 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 210 /* BinaryExpression */) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -121531,16 +122126,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 201 /* FunctionExpression */) { + if (declaration.kind === 202 /* FunctionExpression */) { return true; } - if (declaration.kind !== 242 /* VariableDeclaration */ && declaration.kind !== 244 /* FunctionDeclaration */) { + if (declaration.kind !== 243 /* VariableDeclaration */ && declaration.kind !== 245 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { // Reached source file or module block - if (parent.kind === 290 /* SourceFile */ || parent.kind === 250 /* ModuleBlock */) { + if (parent.kind === 291 /* SourceFile */ || parent.kind === 251 /* ModuleBlock */) { return false; } } @@ -121840,10 +122435,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 273 /* JsxAttribute */: - case 268 /* JsxOpeningElement */: - case 269 /* JsxClosingElement */: - case 267 /* JsxSelfClosingElement */: + case 274 /* JsxAttribute */: + case 269 /* JsxOpeningElement */: + case 270 /* JsxClosingElement */: + case 268 /* JsxSelfClosingElement */: // May parse an identifier like `module-layout`; that will be scanned as a keyword at first, but we should parse the whole thing to get an identifier. return ts.isKeyword(node.kind) || node.kind === 75 /* Identifier */; } @@ -122035,7 +122630,7 @@ var ts; (function (formatting) { function getAllRules() { var allTokens = []; - for (var token = 0 /* FirstToken */; token <= 152 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 153 /* LastToken */; token++) { if (token !== 1 /* EndOfFileToken */) { allTokens.push(token); } @@ -122050,9 +122645,9 @@ var ts; var anyToken = { tokens: allTokens, isSpecific: false }; var anyTokenIncludingMultilineComments = tokenRangeFrom(__spreadArrays(allTokens, [3 /* MultiLineCommentTrivia */])); var anyTokenIncludingEOF = tokenRangeFrom(__spreadArrays(allTokens, [1 /* EndOfFileToken */])); - var keywords = tokenRangeFromRange(77 /* FirstKeyword */, 152 /* LastKeyword */); + var keywords = tokenRangeFromRange(77 /* FirstKeyword */, 153 /* LastKeyword */); var binaryOperators = tokenRangeFromRange(29 /* FirstBinaryOperator */, 74 /* LastBinaryOperator */); - var binaryKeywordOperators = [97 /* InKeyword */, 98 /* InstanceOfKeyword */, 152 /* OfKeyword */, 123 /* AsKeyword */, 133 /* IsKeyword */]; + var binaryKeywordOperators = [97 /* InKeyword */, 98 /* InstanceOfKeyword */, 153 /* OfKeyword */, 123 /* AsKeyword */, 134 /* IsKeyword */]; var unaryPrefixOperators = [45 /* PlusPlusToken */, 46 /* MinusMinusToken */, 54 /* TildeToken */, 53 /* ExclamationToken */]; var unaryPrefixExpressions = [ 8 /* NumericLiteral */, 9 /* BigIntLiteral */, 75 /* Identifier */, 20 /* OpenParenToken */, @@ -122126,7 +122721,7 @@ var ts; // Though, we do extra check on the context to make sure we are dealing with get/set node. Example: // get x() {} // set x(val) {} - rule("SpaceAfterGetSetInMember", [131 /* GetKeyword */, 142 /* SetKeyword */], 75 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), + rule("SpaceAfterGetSetInMember", [132 /* GetKeyword */, 143 /* SetKeyword */], 75 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), rule("NoSpaceBetweenYieldKeywordAndStar", 121 /* YieldKeyword */, 41 /* AsteriskToken */, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 16 /* DeleteSpace */), rule("SpaceBetweenYieldOrYieldStarAndOperand", [121 /* YieldKeyword */, 41 /* AsteriskToken */], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 4 /* InsertSpace */), rule("NoSpaceBetweenReturnAndSemicolon", 101 /* ReturnKeyword */, 26 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), @@ -122150,34 +122745,34 @@ var ts; rule("NoSpaceAfterEqualInJsxAttribute", 62 /* EqualsToken */, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // TypeScript-specific rules // Use of module as a function call. e.g.: import m2 = module("m2"); - rule("NoSpaceAfterModuleImport", [135 /* ModuleKeyword */, 139 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("NoSpaceAfterModuleImport", [136 /* ModuleKeyword */, 140 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // Add a space around certain TypeScript keywords rule("SpaceAfterCertainTypeScriptKeywords", [ 122 /* AbstractKeyword */, 80 /* ClassKeyword */, - 130 /* DeclareKeyword */, + 131 /* DeclareKeyword */, 84 /* DefaultKeyword */, 88 /* EnumKeyword */, 89 /* ExportKeyword */, 90 /* ExtendsKeyword */, - 131 /* GetKeyword */, + 132 /* GetKeyword */, 113 /* ImplementsKeyword */, 96 /* ImportKeyword */, 114 /* InterfaceKeyword */, - 135 /* ModuleKeyword */, - 136 /* NamespaceKeyword */, + 136 /* ModuleKeyword */, + 137 /* NamespaceKeyword */, 117 /* PrivateKeyword */, 119 /* PublicKeyword */, 118 /* ProtectedKeyword */, - 138 /* ReadonlyKeyword */, - 142 /* SetKeyword */, + 139 /* ReadonlyKeyword */, + 143 /* SetKeyword */, 120 /* StaticKeyword */, - 145 /* TypeKeyword */, - 149 /* FromKeyword */, - 134 /* KeyOfKeyword */, - 132 /* InferKeyword */, + 146 /* TypeKeyword */, + 150 /* FromKeyword */, + 135 /* KeyOfKeyword */, + 133 /* InferKeyword */, ], anyToken, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [90 /* ExtendsKeyword */, 113 /* ImplementsKeyword */, 149 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), + rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [90 /* ExtendsKeyword */, 113 /* ImplementsKeyword */, 150 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { rule("SpaceAfterModuleName", 10 /* StringLiteral */, 18 /* OpenBraceToken */, [isModuleDeclContext], 4 /* InsertSpace */), // Lambda expressions @@ -122208,8 +122803,8 @@ var ts; 119 /* PublicKeyword */, 117 /* PrivateKeyword */, 118 /* ProtectedKeyword */, - 131 /* GetKeyword */, - 142 /* SetKeyword */, + 132 /* GetKeyword */, + 143 /* SetKeyword */, 22 /* OpenBracketToken */, 41 /* AsteriskToken */, ], [isEndOfDecoratorContextOnSameLine], 4 /* InsertSpace */), @@ -122220,8 +122815,8 @@ var ts; // These rules are applied after high priority var userConfigurableRules = [ // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses - rule("SpaceAfterConstructor", 129 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("NoSpaceAfterConstructor", 129 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("SpaceAfterConstructor", 130 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), + rule("NoSpaceAfterConstructor", 130 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), rule("SpaceAfterComma", 27 /* CommaToken */, anyToken, [isOptionEnabled("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNextTokenNotCloseBracket, isNextTokenNotCloseParen], 4 /* InsertSpace */), rule("NoSpaceAfterComma", 27 /* CommaToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext], 16 /* DeleteSpace */), // Insert space after function keyword for anonymous functions @@ -122249,6 +122844,9 @@ var ts; rule("NoSpaceBetweenEmptyBraceBrackets", 18 /* OpenBraceToken */, 19 /* CloseBraceToken */, [isNonJsxSameLineTokenContext, isObjectContext], 16 /* DeleteSpace */), rule("NoSpaceAfterOpenBrace", 18 /* OpenBraceToken */, anyToken, [isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), rule("NoSpaceBeforeCloseBrace", anyToken, 19 /* CloseBraceToken */, [isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + // Insert a space after opening and before closing empty brace brackets + rule("SpaceBetweenEmptyBraceBrackets", 18 /* OpenBraceToken */, 19 /* CloseBraceToken */, [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces")], 4 /* InsertSpace */), + rule("NoSpaceBetweenEmptyBraceBrackets", 18 /* OpenBraceToken */, 19 /* CloseBraceToken */, [isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // Insert space after opening and before closing template string braces rule("SpaceAfterTemplateHeadAndMiddle", [15 /* TemplateHead */, 16 /* TemplateMiddle */], anyToken, [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), rule("SpaceBeforeTemplateMiddleAndTail", anyToken, [16 /* TemplateMiddle */, 17 /* TemplateTail */], [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), @@ -122360,51 +122958,51 @@ var ts; return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; }; } function isForContext(context) { - return context.contextNode.kind === 230 /* ForStatement */; + return context.contextNode.kind === 231 /* ForStatement */; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return context.contextNode.operatorToken.kind !== 27 /* CommaToken */; - case 210 /* ConditionalExpression */: - case 180 /* ConditionalType */: - case 217 /* AsExpression */: - case 263 /* ExportSpecifier */: - case 258 /* ImportSpecifier */: - case 168 /* TypePredicate */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: + case 211 /* ConditionalExpression */: + case 181 /* ConditionalType */: + case 218 /* AsExpression */: + case 264 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 169 /* TypePredicate */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 191 /* BindingElement */: + case 192 /* BindingElement */: // equals in type X = ... // falls through - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: // equal in import a = module('a'); // falls through - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // equal in let a = 0 // falls through - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: // equal in p = 0 // falls through - case 156 /* Parameter */: - case 284 /* EnumMember */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 157 /* Parameter */: + case 285 /* EnumMember */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: // "in" keyword in [P in keyof T]: T[P] // falls through - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return context.currentTokenSpan.kind === 97 /* InKeyword */ || context.nextTokenSpan.kind === 97 /* InKeyword */ || context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 232 /* ForOfStatement */: - return context.currentTokenSpan.kind === 152 /* OfKeyword */ || context.nextTokenSpan.kind === 152 /* OfKeyword */; + case 233 /* ForOfStatement */: + return context.currentTokenSpan.kind === 153 /* OfKeyword */ || context.nextTokenSpan.kind === 153 /* OfKeyword */; } return false; } @@ -122416,22 +123014,22 @@ var ts; } function isTypeAnnotationContext(context) { var contextKind = context.contextNode.kind; - return contextKind === 159 /* PropertyDeclaration */ || - contextKind === 158 /* PropertySignature */ || - contextKind === 156 /* Parameter */ || - contextKind === 242 /* VariableDeclaration */ || + return contextKind === 160 /* PropertyDeclaration */ || + contextKind === 159 /* PropertySignature */ || + contextKind === 157 /* Parameter */ || + contextKind === 243 /* VariableDeclaration */ || ts.isFunctionLikeKind(contextKind); } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 210 /* ConditionalExpression */ || - context.contextNode.kind === 180 /* ConditionalType */; + return context.contextNode.kind === 211 /* ConditionalExpression */ || + context.contextNode.kind === 181 /* ConditionalType */; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 189 /* ObjectBindingPattern */ || - context.contextNode.kind === 186 /* MappedType */ || + return context.contextNode.kind === 190 /* ObjectBindingPattern */ || + context.contextNode.kind === 187 /* MappedType */ || isSingleLineBlockContext(context); } // This check is done before an open brace in a control construct, a function, or a typescript block declaration @@ -122457,34 +123055,34 @@ var ts; return true; } switch (node.kind) { - case 223 /* Block */: - case 251 /* CaseBlock */: - case 193 /* ObjectLiteralExpression */: - case 250 /* ModuleBlock */: + case 224 /* Block */: + case 252 /* CaseBlock */: + case 194 /* ObjectLiteralExpression */: + case 251 /* ModuleBlock */: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: // falls through - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // case SyntaxKind.MethodSignature: // falls through - case 165 /* CallSignature */: - case 201 /* FunctionExpression */: - case 162 /* Constructor */: - case 202 /* ArrowFunction */: + case 166 /* CallSignature */: + case 202 /* FunctionExpression */: + case 163 /* Constructor */: + case 203 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: // falls through - case 246 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one + case 247 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one return true; } return false; @@ -122493,40 +123091,40 @@ var ts; return !isFunctionDeclContext(context); } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 244 /* FunctionDeclaration */ || context.contextNode.kind === 201 /* FunctionExpression */; + return context.contextNode.kind === 245 /* FunctionDeclaration */ || context.contextNode.kind === 202 /* FunctionExpression */; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 173 /* TypeLiteral */: - case 249 /* ModuleDeclaration */: - case 260 /* ExportDeclaration */: - case 261 /* NamedExports */: - case 254 /* ImportDeclaration */: - case 257 /* NamedImports */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 174 /* TypeLiteral */: + case 250 /* ModuleDeclaration */: + case 261 /* ExportDeclaration */: + case 262 /* NamedExports */: + case 255 /* ImportDeclaration */: + case 258 /* NamedImports */: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 245 /* ClassDeclaration */: - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: - case 280 /* CatchClause */: - case 250 /* ModuleBlock */: - case 237 /* SwitchStatement */: + case 246 /* ClassDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 281 /* CatchClause */: + case 251 /* ModuleBlock */: + case 238 /* SwitchStatement */: return true; - case 223 /* Block */: { + case 224 /* Block */: { var blockParent = context.currentTokenParent.parent; // In a codefix scenario, we can't rely on parents being set. So just always return true. - if (!blockParent || blockParent.kind !== 202 /* ArrowFunction */ && blockParent.kind !== 201 /* FunctionExpression */) { + if (!blockParent || blockParent.kind !== 203 /* ArrowFunction */ && blockParent.kind !== 202 /* FunctionExpression */) { return true; } } @@ -122535,32 +123133,32 @@ var ts; } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 227 /* IfStatement */: - case 237 /* SwitchStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 229 /* WhileStatement */: - case 240 /* TryStatement */: - case 228 /* DoStatement */: - case 236 /* WithStatement */: + case 228 /* IfStatement */: + case 238 /* SwitchStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 230 /* WhileStatement */: + case 241 /* TryStatement */: + case 229 /* DoStatement */: + case 237 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: // falls through - case 280 /* CatchClause */: + case 281 /* CatchClause */: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 193 /* ObjectLiteralExpression */; + return context.contextNode.kind === 194 /* ObjectLiteralExpression */; } function isFunctionCallContext(context) { - return context.contextNode.kind === 196 /* CallExpression */; + return context.contextNode.kind === 197 /* CallExpression */; } function isNewContext(context) { - return context.contextNode.kind === 197 /* NewExpression */; + return context.contextNode.kind === 198 /* NewExpression */; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -122575,28 +123173,28 @@ var ts; return context.nextTokenSpan.kind !== 21 /* CloseParenToken */; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 202 /* ArrowFunction */; + return context.contextNode.kind === 203 /* ArrowFunction */; } function isImportTypeContext(context) { - return context.contextNode.kind === 188 /* ImportType */; + return context.contextNode.kind === 189 /* ImportType */; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 11 /* JsxText */; } function isNonJsxElementOrFragmentContext(context) { - return context.contextNode.kind !== 266 /* JsxElement */ && context.contextNode.kind !== 270 /* JsxFragment */; + return context.contextNode.kind !== 267 /* JsxElement */ && context.contextNode.kind !== 271 /* JsxFragment */; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 276 /* JsxExpression */ || context.contextNode.kind === 275 /* JsxSpreadAttribute */; + return context.contextNode.kind === 277 /* JsxExpression */ || context.contextNode.kind === 276 /* JsxSpreadAttribute */; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 273 /* JsxAttribute */; + return context.nextTokenParent.kind === 274 /* JsxAttribute */; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 273 /* JsxAttribute */; + return context.contextNode.kind === 274 /* JsxAttribute */; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 267 /* JsxSelfClosingElement */; + return context.contextNode.kind === 268 /* JsxSelfClosingElement */; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -122611,45 +123209,45 @@ var ts; while (ts.isExpressionNode(node)) { node = node.parent; } - return node.kind === 157 /* Decorator */; + return node.kind === 158 /* Decorator */; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 243 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 244 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; } function isModuleDeclContext(context) { - return context.contextNode.kind === 249 /* ModuleDeclaration */; + return context.contextNode.kind === 250 /* ModuleDeclaration */; } function isObjectTypeContext(context) { - return context.contextNode.kind === 173 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 174 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 166 /* ConstructSignature */; + return context.contextNode.kind === 167 /* ConstructSignature */; } function isTypeArgumentOrParameterOrAssertion(token, parent) { if (token.kind !== 29 /* LessThanToken */ && token.kind !== 31 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 169 /* TypeReference */: - case 199 /* TypeAssertionExpression */: - case 247 /* TypeAliasDeclaration */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 216 /* ExpressionWithTypeArguments */: + case 170 /* TypeReference */: + case 200 /* TypeAssertionExpression */: + case 248 /* TypeAliasDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 217 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -122660,28 +123258,28 @@ var ts; isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 199 /* TypeAssertionExpression */; + return context.contextNode.kind === 200 /* TypeAssertionExpression */; } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 110 /* VoidKeyword */ && context.currentTokenParent.kind === 205 /* VoidExpression */; + return context.currentTokenSpan.kind === 110 /* VoidKeyword */ && context.currentTokenParent.kind === 206 /* VoidExpression */; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 212 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 213 /* YieldExpression */ && context.contextNode.expression !== undefined; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 218 /* NonNullExpression */; + return context.contextNode.kind === 219 /* NonNullExpression */; } function isNotStatementConditionContext(context) { return !isStatementConditionContext(context); } function isStatementConditionContext(context) { switch (context.contextNode.kind) { - case 227 /* IfStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 228 /* IfStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return true; default: return false; @@ -122706,12 +123304,12 @@ var ts; return nextTokenKind === 19 /* CloseBraceToken */ || nextTokenKind === 1 /* EndOfFileToken */; } - if (nextTokenKind === 222 /* SemicolonClassElement */ || + if (nextTokenKind === 223 /* SemicolonClassElement */ || nextTokenKind === 26 /* SemicolonToken */) { return false; } - if (context.contextNode.kind === 246 /* InterfaceDeclaration */ || - context.contextNode.kind === 247 /* TypeAliasDeclaration */) { + if (context.contextNode.kind === 247 /* InterfaceDeclaration */ || + context.contextNode.kind === 248 /* TypeAliasDeclaration */) { // Can’t remove semicolon after `foo`; it would parse as a method declaration: // // interface I { @@ -122725,9 +123323,9 @@ var ts; if (ts.isPropertyDeclaration(context.currentTokenParent)) { return !context.currentTokenParent.initializer; } - return context.currentTokenParent.kind !== 230 /* ForStatement */ - && context.currentTokenParent.kind !== 224 /* EmptyStatement */ - && context.currentTokenParent.kind !== 222 /* SemicolonClassElement */ + return context.currentTokenParent.kind !== 231 /* ForStatement */ + && context.currentTokenParent.kind !== 225 /* EmptyStatement */ + && context.currentTokenParent.kind !== 223 /* SemicolonClassElement */ && nextTokenKind !== 22 /* OpenBracketToken */ && nextTokenKind !== 20 /* OpenParenToken */ && nextTokenKind !== 39 /* PlusToken */ @@ -122735,7 +123333,7 @@ var ts; && nextTokenKind !== 43 /* SlashToken */ && nextTokenKind !== 13 /* RegularExpressionLiteral */ && nextTokenKind !== 27 /* CommaToken */ - && nextTokenKind !== 211 /* TemplateExpression */ + && nextTokenKind !== 212 /* TemplateExpression */ && nextTokenKind !== 15 /* TemplateHead */ && nextTokenKind !== 14 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 24 /* DotToken */; @@ -122826,12 +123424,12 @@ var ts; return map; } function getRuleBucketIndex(row, column) { - ts.Debug.assert(row <= 152 /* LastKeyword */ && column <= 152 /* LastKeyword */, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 153 /* LastKeyword */ && column <= 153 /* LastKeyword */, "Must compute formatting context from tokens"); return (row * mapRowLength) + column; } var maskBitSize = 5; var mask = 31; // MaskBitSize bits - var mapRowLength = 152 /* LastToken */ + 1; + var mapRowLength = 153 /* LastToken */ + 1; var RulesPosition; (function (RulesPosition) { RulesPosition[RulesPosition["StopRulesSpecific"] = 0] = "StopRulesSpecific"; @@ -123019,17 +123617,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: var body = parent.body; - return !!body && body.kind === 250 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); - case 290 /* SourceFile */: - case 223 /* Block */: - case 250 /* ModuleBlock */: + return !!body && body.kind === 251 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); + case 291 /* SourceFile */: + case 224 /* Block */: + case 251 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -123186,7 +123784,9 @@ var ts; var leadingTrivia = formattingScanner.getCurrentLeadingTrivia(); if (leadingTrivia) { indentTriviaItems(leadingTrivia, initialIndentation, /*indentNextTokenOrTrivia*/ false, function (item) { return processRange(item, sourceFile.getLineAndCharacterOfPosition(item.pos), enclosingNode, enclosingNode, /*dynamicIndentation*/ undefined); }); - trimTrailingWhitespacesForRemainingRange(); + if (options.trimTrailingWhitespace !== false) { + trimTrailingWhitespacesForRemainingRange(); + } } } return edits; @@ -123254,19 +123854,19 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 245 /* ClassDeclaration */: return 80 /* ClassKeyword */; - case 246 /* InterfaceDeclaration */: return 114 /* InterfaceKeyword */; - case 244 /* FunctionDeclaration */: return 94 /* FunctionKeyword */; - case 248 /* EnumDeclaration */: return 248 /* EnumDeclaration */; - case 163 /* GetAccessor */: return 131 /* GetKeyword */; - case 164 /* SetAccessor */: return 142 /* SetKeyword */; - case 161 /* MethodDeclaration */: + case 246 /* ClassDeclaration */: return 80 /* ClassKeyword */; + case 247 /* InterfaceDeclaration */: return 114 /* InterfaceKeyword */; + case 245 /* FunctionDeclaration */: return 94 /* FunctionKeyword */; + case 249 /* EnumDeclaration */: return 249 /* EnumDeclaration */; + case 164 /* GetAccessor */: return 132 /* GetKeyword */; + case 165 /* SetAccessor */: return 143 /* SetKeyword */; + case 162 /* MethodDeclaration */: if (node.asteriskToken) { return 41 /* AsteriskToken */; } // falls through - case 159 /* PropertyDeclaration */: - case 156 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 157 /* Parameter */: var name = ts.getNameOfDeclaration(node); if (name) { return name.kind; @@ -123323,15 +123923,15 @@ var ts; case 43 /* SlashToken */: case 31 /* GreaterThanToken */: switch (container.kind) { - case 268 /* JsxOpeningElement */: - case 269 /* JsxClosingElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 270 /* JsxClosingElement */: + case 268 /* JsxSelfClosingElement */: return false; } break; case 22 /* OpenBracketToken */: case 23 /* CloseBracketToken */: - if (container.kind !== 186 /* MappedType */) { + if (container.kind !== 187 /* MappedType */) { return false; } break; @@ -123434,7 +124034,7 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 157 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 158 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); if (child.kind === 11 /* JsxText */) { @@ -123454,7 +124054,7 @@ var ts; } } childContextNode = node; - if (isFirstListItem && parent.kind === 192 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent.kind === 193 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -123626,7 +124226,7 @@ var ts; function processPair(currentItem, currentStartLine, currentParent, previousItem, previousStartLine, previousParent, contextNode, dynamicIndentation) { formattingContext.updateContext(previousItem, previousParent, currentItem, currentParent, contextNode); var rules = getRules(formattingContext); - var trimTrailingWhitespaces = false; + var trimTrailingWhitespaces = formattingContext.options.trimTrailingWhitespace !== false; var lineAction = 0 /* None */; if (rules) { // Apply rules in reverse order so that higher priority rules (which are first in the array) @@ -123653,11 +124253,11 @@ var ts; ts.Debug.assert(lineAction === 0 /* None */); } // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line - trimTrailingWhitespaces = !(rule.action & 16 /* DeleteSpace */) && rule.flags !== 1 /* CanDeleteNewLines */; + trimTrailingWhitespaces = trimTrailingWhitespaces && !(rule.action & 16 /* DeleteSpace */) && rule.flags !== 1 /* CanDeleteNewLines */; }); } else { - trimTrailingWhitespaces = currentItem.kind !== 1 /* EndOfFileToken */; + trimTrailingWhitespaces = trimTrailingWhitespaces && currentItem.kind !== 1 /* EndOfFileToken */; } if (currentStartLine !== previousStartLine && trimTrailingWhitespaces) { // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line @@ -123897,12 +124497,12 @@ var ts; formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { - case 162 /* Constructor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 202 /* ArrowFunction */: + case 163 /* Constructor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 203 /* ArrowFunction */: if (node.typeParameters === list) { return 29 /* LessThanToken */; } @@ -123910,8 +124510,8 @@ var ts; return 20 /* OpenParenToken */; } break; - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } @@ -123919,12 +124519,12 @@ var ts; return 20 /* OpenParenToken */; } break; - case 169 /* TypeReference */: + case 170 /* TypeReference */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } break; - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return 18 /* OpenBraceToken */; } return 0 /* Unknown */; @@ -124042,7 +124642,7 @@ var ts; if (options.indentStyle === ts.IndentStyle.Block) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 209 /* BinaryExpression */) { + if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 210 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -124196,7 +124796,7 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 290 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 291 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -124244,7 +124844,7 @@ var ts; } SmartIndenter.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 227 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 228 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 87 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -124282,40 +124882,40 @@ var ts; } function getListByRange(start, end, node, sourceFile) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return getList(node.typeArguments); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return getList(node.properties); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return getList(node.elements); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return getList(node.members); - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 162 /* Constructor */: - case 171 /* ConstructorType */: - case 166 /* ConstructSignature */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 163 /* Constructor */: + case 172 /* ConstructorType */: + case 167 /* ConstructSignature */: return getList(node.typeParameters) || getList(node.parameters); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 321 /* JSDocTemplateTag */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 322 /* JSDocTemplateTag */: return getList(node.typeParameters); - case 197 /* NewExpression */: - case 196 /* CallExpression */: + case 198 /* NewExpression */: + case 197 /* CallExpression */: return getList(node.typeArguments) || getList(node.arguments); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return getList(node.declarations); - case 257 /* NamedImports */: - case 261 /* NamedExports */: + case 258 /* NamedImports */: + case 262 /* NamedExports */: return getList(node.elements); - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: return getList(node.elements); } function getList(list) { @@ -124338,7 +124938,7 @@ var ts; return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options); } function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) { - if (node.parent && node.parent.kind === 243 /* VariableDeclarationList */) { + if (node.parent && node.parent.kind === 244 /* VariableDeclarationList */) { // VariableDeclarationList has no wrapping tokens return -1 /* Unknown */; } @@ -124411,87 +125011,87 @@ var ts; function nodeWillIndentChild(settings, parent, child, sourceFile, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 226 /* ExpressionStatement */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 192 /* ArrayLiteralExpression */: - case 223 /* Block */: - case 250 /* ModuleBlock */: - case 193 /* ObjectLiteralExpression */: - case 173 /* TypeLiteral */: - case 186 /* MappedType */: - case 175 /* TupleType */: - case 251 /* CaseBlock */: - case 278 /* DefaultClause */: - case 277 /* CaseClause */: - case 200 /* ParenthesizedExpression */: - case 194 /* PropertyAccessExpression */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 225 /* VariableStatement */: - case 259 /* ExportAssignment */: - case 235 /* ReturnStatement */: - case 210 /* ConditionalExpression */: - case 190 /* ArrayBindingPattern */: - case 189 /* ObjectBindingPattern */: - case 268 /* JsxOpeningElement */: - case 271 /* JsxOpeningFragment */: - case 267 /* JsxSelfClosingElement */: - case 276 /* JsxExpression */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 156 /* Parameter */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 182 /* ParenthesizedType */: - case 198 /* TaggedTemplateExpression */: - case 206 /* AwaitExpression */: - case 261 /* NamedExports */: - case 257 /* NamedImports */: - case 263 /* ExportSpecifier */: - case 258 /* ImportSpecifier */: - case 159 /* PropertyDeclaration */: + case 227 /* ExpressionStatement */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 193 /* ArrayLiteralExpression */: + case 224 /* Block */: + case 251 /* ModuleBlock */: + case 194 /* ObjectLiteralExpression */: + case 174 /* TypeLiteral */: + case 187 /* MappedType */: + case 176 /* TupleType */: + case 252 /* CaseBlock */: + case 279 /* DefaultClause */: + case 278 /* CaseClause */: + case 201 /* ParenthesizedExpression */: + case 195 /* PropertyAccessExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 226 /* VariableStatement */: + case 260 /* ExportAssignment */: + case 236 /* ReturnStatement */: + case 211 /* ConditionalExpression */: + case 191 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 269 /* JsxOpeningElement */: + case 272 /* JsxOpeningFragment */: + case 268 /* JsxSelfClosingElement */: + case 277 /* JsxExpression */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 157 /* Parameter */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 183 /* ParenthesizedType */: + case 199 /* TaggedTemplateExpression */: + case 207 /* AwaitExpression */: + case 262 /* NamedExports */: + case 258 /* NamedImports */: + case 264 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 160 /* PropertyDeclaration */: return true; - case 242 /* VariableDeclaration */: - case 281 /* PropertyAssignment */: - case 209 /* BinaryExpression */: - if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 193 /* ObjectLiteralExpression */) { // TODO: GH#18217 + case 243 /* VariableDeclaration */: + case 282 /* PropertyAssignment */: + case 210 /* BinaryExpression */: + if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 194 /* ObjectLiteralExpression */) { // TODO: GH#18217 return rangeIsOnOneLine(sourceFile, child); } - if (parent.kind !== 209 /* BinaryExpression */) { + if (parent.kind !== 210 /* BinaryExpression */) { return true; } break; - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 230 /* ForStatement */: - case 227 /* IfStatement */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 202 /* ArrowFunction */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - return childKind !== 223 /* Block */; - case 260 /* ExportDeclaration */: - return childKind !== 261 /* NamedExports */; - case 254 /* ImportDeclaration */: - return childKind !== 255 /* ImportClause */ || - (!!child.namedBindings && child.namedBindings.kind !== 257 /* NamedImports */); - case 266 /* JsxElement */: - return childKind !== 269 /* JsxClosingElement */; - case 270 /* JsxFragment */: - return childKind !== 272 /* JsxClosingFragment */; - case 179 /* IntersectionType */: - case 178 /* UnionType */: - if (childKind === 173 /* TypeLiteral */) { + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 231 /* ForStatement */: + case 228 /* IfStatement */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 203 /* ArrowFunction */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + return childKind !== 224 /* Block */; + case 261 /* ExportDeclaration */: + return childKind !== 262 /* NamedExports */; + case 255 /* ImportDeclaration */: + return childKind !== 256 /* ImportClause */ || + (!!child.namedBindings && child.namedBindings.kind !== 258 /* NamedImports */); + case 267 /* JsxElement */: + return childKind !== 270 /* JsxClosingElement */; + case 271 /* JsxFragment */: + return childKind !== 273 /* JsxClosingFragment */; + case 180 /* IntersectionType */: + case 179 /* UnionType */: + if (childKind === 174 /* TypeLiteral */) { return false; } // falls through @@ -124502,11 +125102,11 @@ var ts; SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent) { switch (kind) { - case 235 /* ReturnStatement */: - case 239 /* ThrowStatement */: - case 233 /* ContinueStatement */: - case 234 /* BreakStatement */: - return parent.kind !== 223 /* Block */; + case 236 /* ReturnStatement */: + case 240 /* ThrowStatement */: + case 234 /* ContinueStatement */: + case 235 /* BreakStatement */: + return parent.kind !== 224 /* Block */; default: return false; } @@ -124648,7 +125248,7 @@ var ts; * Checks if 'candidate' argument is a legal separator in the list that contains 'node' as an element */ function isSeparator(node, candidate) { - return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 193 /* ObjectLiteralExpression */)); + return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 194 /* ObjectLiteralExpression */)); } function spaces(count) { var s = ""; @@ -124825,7 +125425,7 @@ var ts; } } else { - endNode = node.kind !== 242 /* VariableDeclaration */ && node.questionToken ? node.questionToken : node.name; + endNode = node.kind !== 243 /* VariableDeclaration */ && node.questionToken ? node.questionToken : node.name; } this.insertNodeAt(sourceFile, endNode.end, type, { prefix: ": " }); return true; @@ -124979,18 +125579,18 @@ var ts; }; ChangeTracker.prototype.getInsertNodeAfterOptionsWorker = function (node) { switch (node.kind) { - case 245 /* ClassDeclaration */: - case 249 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 250 /* ModuleDeclaration */: return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: case 10 /* StringLiteral */: case 75 /* Identifier */: return { prefix: ", " }; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return { suffix: "," + this.newLineCharacter }; case 89 /* ExportKeyword */: return { prefix: " " }; - case 156 /* Parameter */: + case 157 /* Parameter */: return {}; default: ts.Debug.assert(ts.isStatement(node) || ts.isClassOrTypeElement(node)); // Else we haven't handled this kind of node yet -- add it @@ -124999,7 +125599,7 @@ var ts; }; ChangeTracker.prototype.insertName = function (sourceFile, node, name) { ts.Debug.assert(!node.name); - if (node.kind === 202 /* ArrowFunction */) { + if (node.kind === 203 /* ArrowFunction */) { var arrow = ts.findChildOfKind(node, 38 /* EqualsGreaterThanToken */, sourceFile); var lparen = ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile); if (lparen) { @@ -125013,14 +125613,14 @@ var ts; // Replacing full range of arrow to get rid of the leading space -- replace ` =>` with `)` this.replaceRange(sourceFile, arrow, ts.createToken(21 /* CloseParenToken */)); } - if (node.body.kind !== 223 /* Block */) { + if (node.body.kind !== 224 /* Block */) { // `() => 0` => `function f() { return 0; }` this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [ts.createToken(18 /* OpenBraceToken */), ts.createToken(101 /* ReturnKeyword */)], { joiner: " ", suffix: " " }); this.insertNodesAt(sourceFile, node.body.end, [ts.createToken(26 /* SemicolonToken */), ts.createToken(19 /* CloseBraceToken */)], { joiner: " " }); } } else { - var pos = ts.findChildOfKind(node, node.kind === 201 /* FunctionExpression */ ? 94 /* FunctionKeyword */ : 80 /* ClassKeyword */, sourceFile).end; + var pos = ts.findChildOfKind(node, node.kind === 202 /* FunctionExpression */ ? 94 /* FunctionKeyword */ : 80 /* ClassKeyword */, sourceFile).end; this.insertNodeAt(sourceFile, pos, ts.createIdentifier(name), { prefix: " " }); } }; @@ -125278,7 +125878,9 @@ var ts; : format(change.node); // strip initial indentation (spaces or tabs) if text will be inserted in the middle of the line var noIndent = (options.preserveLeadingWhitespace || options.indentation !== undefined || ts.getLineStartPositionForPosition(pos, sourceFile) === pos) ? text : text.replace(/^\s+/, ""); - return (options.prefix || "") + noIndent + (options.suffix || ""); + return (options.prefix || "") + noIndent + + ((!options.suffix || ts.endsWith(noIndent, options.suffix)) + ? "" : options.suffix); } function getFormatCodeSettingsForWriting(_a, sourceFile) { var options = _a.options; @@ -125583,14 +126185,14 @@ var ts; } textChanges_3.isValidLocationToAddComment = isValidLocationToAddComment; function needSemicolonBetween(a, b) { - return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 154 /* ComputedPropertyName */ + return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 155 /* ComputedPropertyName */ || ts.isStatementButNotDeclaration(a) && ts.isStatementButNotDeclaration(b); // TODO: only if b would start with a `(` or `[` } var deleteDeclaration; (function (deleteDeclaration_1) { function deleteDeclaration(changes, deletedNodesInLists, sourceFile, node) { switch (node.kind) { - case 156 /* Parameter */: { + case 157 /* Parameter */: { var oldFunction = node.parent; if (ts.isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && @@ -125605,15 +126207,15 @@ var ts; } break; } - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: var isFirstImport = sourceFile.imports.length && node === ts.first(sourceFile.imports).parent || node === ts.find(sourceFile.statements, ts.isImportDeclaration); deleteNode(changes, sourceFile, node, // For first import, leave header comment in place isFirstImport ? { leadingTriviaOption: LeadingTriviaOption.Exclude } : undefined); break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: var pattern = node.parent; - var preserveComma = pattern.kind === 190 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); + var preserveComma = pattern.kind === 191 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); if (preserveComma) { deleteNode(changes, sourceFile, node); } @@ -125621,13 +126223,13 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node); break; - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); break; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: var namedImports = node.parent; if (namedImports.elements.length === 1) { deleteImportBinding(changes, sourceFile, namedImports); @@ -125636,7 +126238,7 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: deleteImportBinding(changes, sourceFile, node); break; default: @@ -125683,13 +126285,13 @@ var ts; // Delete the entire import declaration // |import * as ns from './file'| // |import { a } from './file'| - var importDecl = ts.getAncestor(node, 254 /* ImportDeclaration */); + var importDecl = ts.getAncestor(node, 255 /* ImportDeclaration */); deleteNode(changes, sourceFile, importDecl); } } function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) { var parent = node.parent; - if (parent.kind === 280 /* CatchClause */) { + if (parent.kind === 281 /* CatchClause */) { // TODO: There's currently no unused diagnostic for this, could be a suggestion changes.deleteNodeRange(sourceFile, ts.findChildOfKind(parent, 20 /* OpenParenToken */, sourceFile), ts.findChildOfKind(parent, 21 /* CloseParenToken */, sourceFile)); return; @@ -125700,14 +126302,14 @@ var ts; } var gp = parent.parent; switch (gp.kind) { - case 232 /* ForOfStatement */: - case 231 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 232 /* ForInStatement */: changes.replaceNode(sourceFile, node, ts.createObjectLiteral()); break; - case 230 /* ForStatement */: + case 231 /* ForStatement */: deleteNode(changes, sourceFile, parent); break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: deleteNode(changes, sourceFile, gp); break; default: @@ -125886,8 +126488,8 @@ var ts; var token = ts.getTokenAtPosition(sourceFile, pos); var assertion = ts.Debug.checkDefined(ts.findAncestor(token, function (n) { return ts.isAsExpression(n) || ts.isTypeAssertion(n); }), "Expected to find an assertion expression"); var replacement = ts.isAsExpression(assertion) - ? ts.createAsExpression(assertion.expression, ts.createKeywordTypeNode(148 /* UnknownKeyword */)) - : ts.createTypeAssertion(ts.createKeywordTypeNode(148 /* UnknownKeyword */), assertion.expression); + ? ts.createAsExpression(assertion.expression, ts.createKeywordTypeNode(149 /* UnknownKeyword */)) + : ts.createTypeAssertion(ts.createKeywordTypeNode(149 /* UnknownKeyword */), assertion.expression); changeTracker.replaceNode(sourceFile, assertion.expression, replacement); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -126118,7 +126720,7 @@ var ts; } var declaration = ts.tryCast(symbol.valueDeclaration, ts.isVariableDeclaration); var variableName = declaration && ts.tryCast(declaration.name, ts.isIdentifier); - var variableStatement = ts.getAncestor(declaration, 225 /* VariableStatement */); + var variableStatement = ts.getAncestor(declaration, 226 /* VariableStatement */); if (!declaration || !variableStatement || declaration.type || !declaration.initializer || @@ -126196,10 +126798,10 @@ var ts; function isInsideAwaitableBody(node) { return node.kind & 32768 /* AwaitContext */ || !!ts.findAncestor(node, function (ancestor) { return ancestor.parent && ts.isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || - ts.isBlock(ancestor) && (ancestor.parent.kind === 244 /* FunctionDeclaration */ || - ancestor.parent.kind === 201 /* FunctionExpression */ || - ancestor.parent.kind === 202 /* ArrowFunction */ || - ancestor.parent.kind === 161 /* MethodDeclaration */); + ts.isBlock(ancestor) && (ancestor.parent.kind === 245 /* FunctionDeclaration */ || + ancestor.parent.kind === 202 /* FunctionExpression */ || + ancestor.parent.kind === 203 /* ArrowFunction */ || + ancestor.parent.kind === 162 /* MethodDeclaration */); }); } function makeChange(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) { @@ -126318,10 +126920,10 @@ var ts; function isPossiblyPartOfDestructuring(node) { switch (node.kind) { case 75 /* Identifier */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return true; default: return false; @@ -126336,7 +126938,7 @@ var ts; function isPossiblyPartOfCommaSeperatedInitializer(node) { switch (node.kind) { case 75 /* Identifier */: - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: case 27 /* CommaToken */: return true; default: @@ -126385,9 +126987,9 @@ var ts; return; } var declaration = token.parent; - if (declaration.kind === 159 /* PropertyDeclaration */ && + if (declaration.kind === 160 /* PropertyDeclaration */ && (!fixedNodes || fixedNodes.tryAdd(declaration))) { - changeTracker.insertModifierBefore(sourceFile, 130 /* DeclareKeyword */, declaration); + changeTracker.insertModifierBefore(sourceFile, 131 /* DeclareKeyword */, declaration); } } })(codefix = ts.codefix || (ts.codefix = {})); @@ -126522,26 +127124,26 @@ var ts; } function isDeclarationWithType(node) { return ts.isFunctionLikeDeclaration(node) || - node.kind === 242 /* VariableDeclaration */ || - node.kind === 158 /* PropertySignature */ || - node.kind === 159 /* PropertyDeclaration */; + node.kind === 243 /* VariableDeclaration */ || + node.kind === 159 /* PropertySignature */ || + node.kind === 160 /* PropertyDeclaration */; } function transformJSDocType(node) { switch (node.kind) { - case 295 /* JSDocAllType */: - case 296 /* JSDocUnknownType */: + case 296 /* JSDocAllType */: + case 297 /* JSDocUnknownType */: return ts.createTypeReferenceNode("any", ts.emptyArray); - case 299 /* JSDocOptionalType */: + case 300 /* JSDocOptionalType */: return transformJSDocOptionalType(node); - case 298 /* JSDocNonNullableType */: + case 299 /* JSDocNonNullableType */: return transformJSDocType(node.type); - case 297 /* JSDocNullableType */: + case 298 /* JSDocNullableType */: return transformJSDocNullableType(node); - case 301 /* JSDocVariadicType */: + case 302 /* JSDocVariadicType */: return transformJSDocVariadicType(node); - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: return transformJSDocFunctionType(node); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return transformJSDocTypeReference(node); default: var visited = ts.visitEachChild(node, transformJSDocType, /*context*/ undefined); // TODO: GH#18217 @@ -126563,7 +127165,7 @@ var ts; } function transformJSDocParameter(node) { var index = node.parent.parameters.indexOf(node); - var isRest = node.type.kind === 301 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 + var isRest = node.type.kind === 302 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 var name = node.name || (isRest ? "rest" : "arg" + index); var dotdotdot = isRest ? ts.createToken(25 /* DotDotDotToken */) : node.dotDotDotToken; return ts.createParameter(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer); @@ -126603,8 +127205,8 @@ var ts; var index = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, - /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 140 /* NumberKeyword */ ? "n" : "s", - /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 140 /* NumberKeyword */ ? "number" : "string", []), + /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 141 /* NumberKeyword */ ? "n" : "s", + /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 141 /* NumberKeyword */ ? "number" : "string", []), /*initializer*/ undefined); var indexSignature = ts.createTypeLiteralNode([ts.createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]); ts.setEmitFlags(indexSignature, 1 /* SingleLine */); @@ -126862,7 +127464,7 @@ var ts; function annotate(changes, importAdder, sourceFile, declaration, type, program, host) { var typeNode = ts.getTypeNodeIfAccessible(type, declaration, program, host); if (typeNode) { - if (ts.isInJSFile(sourceFile) && declaration.kind !== 158 /* PropertySignature */) { + if (ts.isInJSFile(sourceFile) && declaration.kind !== 159 /* PropertySignature */) { var parent = ts.isVariableDeclaration(declaration) ? ts.tryCast(declaration.parent.parent, ts.isVariableStatement) : declaration; if (!parent) { return; @@ -126911,13 +127513,13 @@ var ts; return !!merged; }); }); var tag = ts.createJSDocComment(comments.join("\n"), ts.createNodeArray(__spreadArrays((oldTags || ts.emptyArray), unmergedNewTags))); - var jsDocNode = parent.kind === 202 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; + var jsDocNode = parent.kind === 203 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; jsDocNode.jsDoc = parent.jsDoc; jsDocNode.jsDocCache = parent.jsDocCache; changes.insertJsdocCommentBefore(sourceFile, jsDocNode, tag); } function getJsDocNodeForArrowFunction(signature) { - if (signature.parent.kind === 159 /* PropertyDeclaration */) { + if (signature.parent.kind === 160 /* PropertyDeclaration */) { return signature.parent; } return signature.parent.parent; @@ -126927,14 +127529,14 @@ var ts; return undefined; } switch (oldTag.kind) { - case 317 /* JSDocParameterTag */: { + case 318 /* JSDocParameterTag */: { var oldParam = oldTag; var newParam = newTag; return ts.isIdentifier(oldParam.name) && ts.isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? ts.createJSDocParamTag(newParam.name, newParam.isBracketed, newParam.typeExpression, oldParam.comment) : undefined; } - case 318 /* JSDocReturnTag */: + case 319 /* JSDocReturnTag */: return ts.createJSDocReturnTag(newTag.typeExpression, oldTag.comment); } } @@ -126959,18 +127561,18 @@ var ts; function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) { var searchToken; switch (containingFunction.kind) { - case 162 /* Constructor */: - searchToken = ts.findChildOfKind(containingFunction, 129 /* ConstructorKeyword */, sourceFile); + case 163 /* Constructor */: + searchToken = ts.findChildOfKind(containingFunction, 130 /* ConstructorKeyword */, sourceFile); break; - case 202 /* ArrowFunction */: - case 201 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 202 /* FunctionExpression */: var parent = containingFunction.parent; searchToken = ts.isVariableDeclaration(parent) && ts.isIdentifier(parent.name) ? parent.name : containingFunction.name; break; - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: searchToken = containingFunction.name; break; } @@ -127112,24 +127714,24 @@ var ts; node = node.parent; } switch (node.parent.kind) { - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: addCandidateType(usage, checker.getVoidType()); break; - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: usage.isNumber = true; break; - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: inferTypeFromPrefixUnaryExpression(node.parent, usage); break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: inferTypeFromBinaryExpression(node, node.parent, usage); break; - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: inferTypeFromSwitchStatementLabel(node.parent, usage); break; - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: if (node.parent.expression === node) { inferTypeFromCallExpression(node.parent, usage); } @@ -127137,20 +127739,20 @@ var ts; inferTypeFromContextualType(node, usage); } break; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: inferTypeFromPropertyAccessExpression(node.parent, usage); break; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: inferTypeFromPropertyElementExpression(node.parent, node, usage); break; - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: inferTypeFromPropertyAssignment(node.parent, usage); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: inferTypeFromPropertyDeclaration(node.parent, usage); break; - case 242 /* VariableDeclaration */: { + case 243 /* VariableDeclaration */: { var _a = node.parent, name = _a.name, initializer = _a.initializer; if (node === name) { if (initializer) { // This can happen for `let x = null;` which still has an implicit-any error. @@ -127269,7 +127871,7 @@ var ts; case 56 /* BarBarToken */: case 60 /* QuestionQuestionToken */: if (node === parent.left && - (node.parent.parent.kind === 242 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { + (node.parent.parent.kind === 243 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { // var x = x || {}; // TODO: use getFalsyflagsOfType addCandidateType(usage, checker.getTypeAtLocation(parent.right)); @@ -127297,7 +127899,7 @@ var ts; } } calculateUsageOfNode(parent, call.return_); - if (parent.kind === 196 /* CallExpression */) { + if (parent.kind === 197 /* CallExpression */) { (usage.calls || (usage.calls = [])).push(call); } else { @@ -127513,6 +128115,9 @@ var ts; else if (genericType.flags & 3145728 /* UnionOrIntersection */) { return ts.flatMap(genericType.types, function (t) { return inferTypeParameters(t, usageType, typeParameter); }); } + else if (genericType.flags & 134217728 /* Awaited */) { + return inferTypeParameters(genericType.awaitedType, usageType, typeParameter); + } else if (ts.getObjectFlags(genericType) & 4 /* Reference */ && ts.getObjectFlags(usageType) & 4 /* Reference */) { // this is wrong because we need a reference to the targetType to, so we can check that it's also a reference var genericArgs = checker.getTypeArguments(genericType); @@ -127616,12 +128221,12 @@ var ts; var precedingNode; var newClassDeclaration; switch (ctorDeclaration.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: precedingNode = ctorDeclaration; changes.delete(sourceFile, ctorDeclaration); newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: precedingNode = ctorDeclaration.parent.parent; newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration); if (ctorDeclaration.parent.declarations.length === 1) { @@ -127676,7 +128281,7 @@ var ts; return; } // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 226 /* ExpressionStatement */ + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 227 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; changes.delete(sourceFile, nodeToDelete); if (!assignmentBinaryExpression.right) { @@ -127684,7 +128289,7 @@ var ts; /*type*/ undefined, /*initializer*/ undefined); } switch (assignmentBinaryExpression.right.kind) { - case 201 /* FunctionExpression */: { + case 202 /* FunctionExpression */: { var functionExpression = assignmentBinaryExpression.right; var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(functionExpression, 126 /* AsyncKeyword */)); var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, @@ -127692,12 +128297,12 @@ var ts; ts.copyLeadingComments(assignmentBinaryExpression, method, sourceFile); return method; } - case 202 /* ArrowFunction */: { + case 203 /* ArrowFunction */: { var arrowFunction = assignmentBinaryExpression.right; var arrowFunctionBody = arrowFunction.body; var bodyBlock = void 0; // case 1: () => { return [1,2,3] } - if (arrowFunctionBody.kind === 223 /* Block */) { + if (arrowFunctionBody.kind === 224 /* Block */) { bodyBlock = arrowFunctionBody; } // case 2: () => [1,2,3] @@ -127725,7 +128330,7 @@ var ts; } function createClassFromVariableDeclaration(node) { var initializer = node.initializer; - if (!initializer || initializer.kind !== 201 /* FunctionExpression */) { + if (!initializer || initializer.kind !== 202 /* FunctionExpression */) { return undefined; } if (node.name.kind !== 75 /* Identifier */) { @@ -127797,27 +128402,21 @@ var ts; return; } var synthNamesMap = ts.createMap(); - var originalTypeMap = ts.createMap(); - var allVarNames = []; var isInJavascript = ts.isInJSFile(functionToConvert); var setOfExpressionsToReturn = getAllPromiseExpressionsToReturn(functionToConvert, checker); - var functionToConvertRenamed = renameCollidingVarNames(functionToConvert, checker, synthNamesMap, context, setOfExpressionsToReturn, originalTypeMap, allVarNames); - var constIdentifiers = getConstIdentifiers(synthNamesMap); + var functionToConvertRenamed = renameCollidingVarNames(functionToConvert, checker, synthNamesMap, context.sourceFile); var returnStatements = functionToConvertRenamed.body && ts.isBlock(functionToConvertRenamed.body) ? getReturnStatementsWithPromiseHandlers(functionToConvertRenamed.body) : ts.emptyArray; - var transformer = { checker: checker, synthNamesMap: synthNamesMap, allVarNames: allVarNames, setOfExpressionsToReturn: setOfExpressionsToReturn, constIdentifiers: constIdentifiers, originalTypeMap: originalTypeMap, isInJSFile: isInJavascript }; + var transformer = { checker: checker, synthNamesMap: synthNamesMap, setOfExpressionsToReturn: setOfExpressionsToReturn, isInJSFile: isInJavascript }; if (!returnStatements.length) { return; } // add the async keyword changes.insertLastModifierBefore(sourceFile, 126 /* AsyncKeyword */, functionToConvert); - function startTransformation(node, nodeToReplace) { - var newNodes = transformExpression(node, transformer, node); - changes.replaceNodeWithNodes(sourceFile, nodeToReplace, newNodes); - } - var _loop_13 = function (statement) { - ts.forEachChild(statement, function visit(node) { + var _loop_13 = function (returnStatement) { + ts.forEachChild(returnStatement, function visit(node) { if (ts.isCallExpression(node)) { - startTransformation(node, statement); + var newNodes = transformExpression(node, transformer); + changes.replaceNodeWithNodes(sourceFile, returnStatement, newNodes); } else if (!ts.isFunctionLike(node)) { ts.forEachChild(node, visit); @@ -127825,8 +128424,8 @@ var ts; }); }; for (var _i = 0, returnStatements_1 = returnStatements; _i < returnStatements_1.length; _i++) { - var statement = returnStatements_1[_i]; - _loop_13(statement); + var returnStatement = returnStatements_1[_i]; + _loop_13(returnStatement); } } function getReturnStatementsWithPromiseHandlers(body) { @@ -127837,16 +128436,6 @@ var ts; }); return res; } - // Returns the identifiers that are never reassigned in the refactor - function getConstIdentifiers(synthNamesMap) { - var constIdentifiers = []; - synthNamesMap.forEach(function (val) { - if (val.numberOfAssignmentsOriginal === 0) { - constIdentifiers.push(val.identifier); - } - }); - return constIdentifiers; - } /* Finds all of the expressions of promise type that should not be saved in a variable during the refactor */ @@ -127856,16 +128445,16 @@ var ts; } var setOfExpressionsToReturn = ts.createMap(); ts.forEachChild(func.body, function visit(node) { - if (isPromiseReturningExpression(node, checker, "then")) { + if (isPromiseReturningCallExpression(node, checker, "then")) { setOfExpressionsToReturn.set(ts.getNodeId(node).toString(), true); ts.forEach(node.arguments, visit); } - else if (isPromiseReturningExpression(node, checker, "catch")) { + else if (isPromiseReturningCallExpression(node, checker, "catch")) { setOfExpressionsToReturn.set(ts.getNodeId(node).toString(), true); // if .catch() is the last call in the chain, move leftward in the chain until we hit something else that should be returned ts.forEachChild(node, visit); } - else if (isPromiseReturningExpression(node, checker)) { + else if (isPromiseTypedExpression(node, checker)) { setOfExpressionsToReturn.set(ts.getNodeId(node).toString(), true); // don't recurse here, since we won't refactor any children or arguments of the expression } @@ -127875,16 +128464,22 @@ var ts; }); return setOfExpressionsToReturn; } - /* - Returns true if node is a promise returning expression - If name is not undefined, node is a promise returning call of name - */ - function isPromiseReturningExpression(node, checker, name) { - var isNodeExpression = name ? ts.isCallExpression(node) : ts.isExpression(node); - var isExpressionOfName = isNodeExpression && (!name || ts.hasPropertyAccessExpressionWithName(node, name)); + function isPromiseReturningCallExpression(node, checker, name) { + if (!ts.isCallExpression(node)) + return false; + var isExpressionOfName = ts.hasPropertyAccessExpressionWithName(node, name); var nodeType = isExpressionOfName && checker.getTypeAtLocation(node); return !!(nodeType && checker.getPromisedTypeOfPromise(nodeType)); } + function isParameterOfPromiseCallback(node, checker) { + return ts.isParameter(node) && (isPromiseReturningCallExpression(node.parent.parent, checker, "then") || + isPromiseReturningCallExpression(node.parent.parent, checker, "catch")); + } + function isPromiseTypedExpression(node, checker) { + if (!ts.isExpression(node)) + return false; + return !!checker.getPromisedTypeOfPromise(checker.getTypeAtLocation(node)); + } function declaredInFile(symbol, sourceFile) { return symbol.valueDeclaration && symbol.valueDeclaration.getSourceFile() === sourceFile; } @@ -127893,31 +128488,36 @@ var ts; This function collects all existing identifier names and names of identifiers that will be created in the refactor. It then checks for any collisions and renames them through getSynthesizedDeepClone */ - function renameCollidingVarNames(nodeToRename, checker, synthNamesMap, context, setOfAllExpressionsToReturn, originalType, allVarNames) { + function renameCollidingVarNames(nodeToRename, checker, synthNamesMap, sourceFile) { + var variableNames = []; var identsToRenameMap = ts.createMap(); // key is the symbol id - var collidingSymbolMap = ts.createMap(); + var collidingSymbolMap = ts.createMultiMap(); ts.forEachChild(nodeToRename, function visit(node) { if (!ts.isIdentifier(node)) { ts.forEachChild(node, visit); return; } var symbol = checker.getSymbolAtLocation(node); - var isDefinedInFile = symbol && declaredInFile(symbol, context.sourceFile); + var isDefinedInFile = symbol && declaredInFile(symbol, sourceFile); if (symbol && isDefinedInFile) { var type = checker.getTypeAtLocation(node); + // Note - the choice of the last call signature is arbitrary var lastCallSignature = getLastCallSignature(type, checker); var symbolIdString = ts.getSymbolId(symbol).toString(); - // if the identifier refers to a function we want to add the new synthesized variable for the declaration (ex. blob in let blob = res(arg)) - // Note - the choice of the last call signature is arbitrary + // If the identifier refers to a function, we want to add the new synthesized variable for the declaration. Example: + // fetch('...').then(response => { ... }) + // will eventually become + // const response = await fetch('...') + // so we push an entry for 'response'. if (lastCallSignature && !ts.isFunctionLikeDeclaration(node.parent) && !synthNamesMap.has(symbolIdString)) { var firstParameter = ts.firstOrUndefined(lastCallSignature.parameters); var ident = firstParameter && ts.isParameter(firstParameter.valueDeclaration) && ts.tryCast(firstParameter.valueDeclaration.name, ts.isIdentifier) || ts.createOptimisticUniqueName("result"); var synthName = getNewNameIfConflict(ident, collidingSymbolMap); synthNamesMap.set(symbolIdString, synthName); - allVarNames.push({ identifier: synthName.identifier, symbol: symbol }); - addNameToFrequencyMap(collidingSymbolMap, ident.text, symbol); + variableNames.push({ identifier: synthName.identifier, symbol: symbol }); + collidingSymbolMap.add(ident.text, symbol); } - // we only care about identifiers that are parameters, declarations, or binding elements (don't care about other uses) + // We only care about identifiers that are parameters, variable declarations, or binding elements else if (node.parent && (ts.isParameter(node.parent) || ts.isVariableDeclaration(node.parent) || ts.isBindingElement(node.parent))) { var originalName = node.text; var collidingSymbols = collidingSymbolMap.get(originalName); @@ -127926,96 +128526,65 @@ var ts; var newName = getNewNameIfConflict(node, collidingSymbolMap); identsToRenameMap.set(symbolIdString, newName.identifier); synthNamesMap.set(symbolIdString, newName); - allVarNames.push({ identifier: newName.identifier, symbol: symbol }); - addNameToFrequencyMap(collidingSymbolMap, originalName, symbol); + variableNames.push({ identifier: newName.identifier, symbol: symbol }); + collidingSymbolMap.add(originalName, symbol); } else { var identifier = ts.getSynthesizedDeepClone(node); identsToRenameMap.set(symbolIdString, identifier); - synthNamesMap.set(symbolIdString, createSynthIdentifier(identifier, [], allVarNames.filter(function (elem) { return elem.identifier.text === node.text; }).length /*, numberOfAssignmentsSynthesized: 0*/)); - if ((ts.isParameter(node.parent) && isExpressionOrCallOnTypePromise(node.parent.parent)) || ts.isVariableDeclaration(node.parent)) { - allVarNames.push({ identifier: identifier, symbol: symbol }); - addNameToFrequencyMap(collidingSymbolMap, originalName, symbol); + synthNamesMap.set(symbolIdString, createSynthIdentifier(identifier)); + if (isParameterOfPromiseCallback(node.parent, checker) || ts.isVariableDeclaration(node.parent)) { + variableNames.push({ identifier: identifier, symbol: symbol }); + collidingSymbolMap.add(originalName, symbol); } } } } }); - return ts.getSynthesizedDeepCloneWithRenames(nodeToRename, /*includeTrivia*/ true, identsToRenameMap, checker, deepCloneCallback); - function isExpressionOrCallOnTypePromise(child) { - var node = child.parent; - if (ts.isCallExpression(node) || ts.isIdentifier(node) && !setOfAllExpressionsToReturn.get(ts.getNodeId(node).toString())) { - var nodeType = checker.getTypeAtLocation(node); - var isPromise = nodeType && checker.getPromisedTypeOfPromise(nodeType); - return !!isPromise; - } - return false; - } - function deepCloneCallback(node, clone) { - if (ts.isIdentifier(node)) { - var symbol = checker.getSymbolAtLocation(node); - var symboldIdString = symbol && ts.getSymbolId(symbol).toString(); - var renameInfo = symbol && synthNamesMap.get(symboldIdString); - if (renameInfo) { - var type = checker.getTypeAtLocation(node); - originalType.set(ts.getNodeId(clone).toString(), type); - } - } - var val = setOfAllExpressionsToReturn.get(ts.getNodeId(node).toString()); - if (val !== undefined) { - setOfAllExpressionsToReturn.delete(ts.getNodeId(node).toString()); - setOfAllExpressionsToReturn.set(ts.getNodeId(clone).toString(), val); - } - } - } - function addNameToFrequencyMap(renamedVarNameFrequencyMap, originalName, symbol) { - if (renamedVarNameFrequencyMap.has(originalName)) { - renamedVarNameFrequencyMap.get(originalName).push(symbol); - } - else { - renamedVarNameFrequencyMap.set(originalName, [symbol]); - } + return ts.getSynthesizedDeepCloneWithRenames(nodeToRename, /*includeTrivia*/ true, identsToRenameMap, checker); } function getNewNameIfConflict(name, originalNames) { var numVarsSameName = (originalNames.get(name.text) || ts.emptyArray).length; - var numberOfAssignmentsOriginal = 0; var identifier = numVarsSameName === 0 ? name : ts.createIdentifier(name.text + "_" + numVarsSameName); - return createSynthIdentifier(identifier, [], numberOfAssignmentsOriginal); + return createSynthIdentifier(identifier); + } + function silentFail() { + codeActionSucceeded = false; + return ts.emptyArray; } // dispatch function to recursively build the refactoring // should be kept up to date with isFixablePromiseHandler in suggestionDiagnostics.ts - function transformExpression(node, transformer, outermostParent, prevArgName) { - if (!node) { - return ts.emptyArray; - } - var originalType = ts.isIdentifier(node) && transformer.originalTypeMap.get(ts.getNodeId(node).toString()); - var nodeType = originalType || transformer.checker.getTypeAtLocation(node); - if (ts.isCallExpression(node) && ts.hasPropertyAccessExpressionWithName(node, "then") && nodeType && !!transformer.checker.getPromisedTypeOfPromise(nodeType)) { - return transformThen(node, transformer, outermostParent, prevArgName); - } - else if (ts.isCallExpression(node) && ts.hasPropertyAccessExpressionWithName(node, "catch") && nodeType && !!transformer.checker.getPromisedTypeOfPromise(nodeType)) { + function transformExpression(node, transformer, prevArgName) { + if (isPromiseReturningCallExpression(node, transformer.checker, "then")) { + if (node.arguments.length === 0) + return silentFail(); + return transformThen(node, transformer, prevArgName); + } + if (isPromiseReturningCallExpression(node, transformer.checker, "catch")) { + if (node.arguments.length === 0) + return silentFail(); return transformCatch(node, transformer, prevArgName); } - else if (ts.isPropertyAccessExpression(node)) { - return transformExpression(node.expression, transformer, outermostParent, prevArgName); + if (ts.isPropertyAccessExpression(node)) { + return transformExpression(node.expression, transformer, prevArgName); } - else if (nodeType && transformer.checker.getPromisedTypeOfPromise(nodeType)) { - return transformPromiseCall(node, transformer, prevArgName); + var nodeType = transformer.checker.getTypeAtLocation(node); + if (nodeType && transformer.checker.getPromisedTypeOfPromise(nodeType)) { + ts.Debug.assertNode(node.original.parent, ts.isPropertyAccessExpression); + return transformPromiseExpressionOfPropertyAccess(node, transformer, prevArgName); } - codeActionSucceeded = false; - return ts.emptyArray; + return silentFail(); } function transformCatch(node, transformer, prevArgName) { var func = node.arguments[0]; var argName = getArgBindingName(func, transformer); - var shouldReturn = transformer.setOfExpressionsToReturn.get(ts.getNodeId(node).toString()); var possibleNameForVarDecl; /* If there is another call in the chain after the .catch() we are transforming, we will need to save the result of both paths (try block and catch block) To do this, we will need to synthesize a variable that we were not aware of while we were adding identifiers to the synthNamesMap We will use the prevArgName and then update the synthNamesMap with a new variable name for the next transformation step */ - if (prevArgName && !shouldReturn) { + if (prevArgName && !shouldReturn(node, transformer)) { if (isSynthIdentifier(prevArgName)) { possibleNameForVarDecl = prevArgName; transformer.synthNamesMap.forEach(function (val, key) { @@ -128028,13 +128597,12 @@ var ts; else { possibleNameForVarDecl = createSynthIdentifier(ts.createOptimisticUniqueName("result"), prevArgName.types); } - possibleNameForVarDecl.numberOfAssignmentsOriginal = 2; // Try block and catch block - // update the constIdentifiers list - if (transformer.constIdentifiers.some(function (elem) { return elem.text === possibleNameForVarDecl.identifier.text; })) { - transformer.constIdentifiers.push(createUniqueSynthName(possibleNameForVarDecl).identifier); - } + // We are about to write a 'let' variable declaration, but `transformExpression` for both + // the try block and catch block will assign to this name. Setting this flag indicates + // that future assignments should be written as `name = value` instead of `const name = value`. + possibleNameForVarDecl.hasBeenDeclared = true; } - var tryBlock = ts.createBlock(transformExpression(node.expression, transformer, node, possibleNameForVarDecl)); + var tryBlock = ts.createBlock(transformExpression(node.expression, transformer, possibleNameForVarDecl)); var transformationBody = getTransformationBody(func, possibleNameForVarDecl, argName, node, transformer); var catchArg = argName ? isSynthIdentifier(argName) ? argName.identifier.text : argName.bindingPattern : "e"; var catchVariableDeclaration = ts.createVariableDeclaration(catchArg); @@ -128044,7 +128612,7 @@ var ts; */ var varDeclList; var varDeclIdentifier; - if (possibleNameForVarDecl && !shouldReturn) { + if (possibleNameForVarDecl && !shouldReturn(node, transformer)) { varDeclIdentifier = ts.getSynthesizedDeepClone(possibleNameForVarDecl.identifier); var typeArray = possibleNameForVarDecl.types; var unionType = transformer.checker.getUnionType(typeArray, 2 /* Subtype */); @@ -128057,68 +128625,53 @@ var ts; && ts.createVariableStatement(/* modifiers */ undefined, ts.createVariableDeclarationList([ts.createVariableDeclaration(ts.getSynthesizedDeepCloneWithRenames(prevArgName.bindingPattern), /* type */ undefined, varDeclIdentifier)], 2 /* Const */)); return ts.compact([varDeclList, tryStatement, destructuredResult]); } - function getIdentifierTextsFromBindingName(bindingName) { - if (ts.isIdentifier(bindingName)) - return [bindingName.text]; - return ts.flatMap(bindingName.elements, function (element) { - if (ts.isOmittedExpression(element)) - return []; - return getIdentifierTextsFromBindingName(element.name); - }); - } function createUniqueSynthName(prevArgName) { var renamedPrevArg = ts.createOptimisticUniqueName(prevArgName.identifier.text); return createSynthIdentifier(renamedPrevArg); } - function transformThen(node, transformer, outermostParent, prevArgName) { - var _a = node.arguments, res = _a[0], rej = _a[1]; - if (!res) { - return transformExpression(node.expression, transformer, outermostParent); - } - var argNameRes = getArgBindingName(res, transformer); - var transformationBody = getTransformationBody(res, prevArgName, argNameRes, node, transformer); - if (rej) { - var argNameRej = getArgBindingName(rej, transformer); - var tryBlock = ts.createBlock(transformExpression(node.expression, transformer, node, argNameRes).concat(transformationBody)); - var transformationBody2 = getTransformationBody(rej, prevArgName, argNameRej, node, transformer); - var catchArg = argNameRej ? isSynthIdentifier(argNameRej) ? argNameRej.identifier.text : argNameRej.bindingPattern : "e"; + function transformThen(node, transformer, prevArgName) { + var _a = node.arguments, onFulfilled = _a[0], onRejected = _a[1]; + var onFulfilledArgumentName = getArgBindingName(onFulfilled, transformer); + var transformationBody = getTransformationBody(onFulfilled, prevArgName, onFulfilledArgumentName, node, transformer); + if (onRejected) { + var onRejectedArgumentName = getArgBindingName(onRejected, transformer); + var tryBlock = ts.createBlock(transformExpression(node.expression, transformer, onFulfilledArgumentName).concat(transformationBody)); + var transformationBody2 = getTransformationBody(onRejected, prevArgName, onRejectedArgumentName, node, transformer); + var catchArg = onRejectedArgumentName ? isSynthIdentifier(onRejectedArgumentName) ? onRejectedArgumentName.identifier.text : onRejectedArgumentName.bindingPattern : "e"; var catchVariableDeclaration = ts.createVariableDeclaration(catchArg); var catchClause = ts.createCatchClause(catchVariableDeclaration, ts.createBlock(transformationBody2)); return [ts.createTry(tryBlock, catchClause, /* finallyBlock */ undefined)]; } - return transformExpression(node.expression, transformer, node, argNameRes).concat(transformationBody); + return transformExpression(node.expression, transformer, onFulfilledArgumentName).concat(transformationBody); } - function getFlagOfBindingName(bindingName, constIdentifiers) { - var identifiers = getIdentifierTextsFromBindingName(getNode(bindingName)); - var inArr = constIdentifiers.some(function (elem) { return ts.contains(identifiers, elem.text); }); - return inArr ? 2 /* Const */ : 1 /* Let */; - } - function transformPromiseCall(node, transformer, prevArgName) { - var shouldReturn = transformer.setOfExpressionsToReturn.get(ts.getNodeId(node).toString()); - // the identifier is empty when the handler (.then()) ignores the argument - In this situation we do not need to save the result of the promise returning call - var originalNodeParent = node.original ? node.original.parent : node.parent; - if (prevArgName && !shouldReturn && (!originalNodeParent || ts.isPropertyAccessExpression(originalNodeParent))) { - return createTransformedStatement(prevArgName, ts.createAwait(node), transformer); - } - else if (!prevArgName && !shouldReturn && (!originalNodeParent || ts.isPropertyAccessExpression(originalNodeParent))) { - return [ts.createStatement(ts.createAwait(node))]; + /** + * Transforms the 'x' part of `x.then(...)`, or the 'y()' part of `y.catch(...)`, where 'x' and 'y()' are Promises. + */ + function transformPromiseExpressionOfPropertyAccess(node, transformer, prevArgName) { + if (shouldReturn(node, transformer)) { + return [ts.createReturn(ts.getSynthesizedDeepClone(node))]; } - return [ts.createReturn(ts.getSynthesizedDeepClone(node))]; + return createVariableOrAssignmentOrExpressionStatement(prevArgName, ts.createAwait(node)); } - function createTransformedStatement(prevArgName, rightHandSide, transformer) { - if (!prevArgName || isEmpty(prevArgName)) { + function createVariableOrAssignmentOrExpressionStatement(variableName, rightHandSide) { + if (!variableName || isEmptyBindingName(variableName)) { // if there's no argName to assign to, there still might be side effects - return [ts.createStatement(rightHandSide)]; + return [ts.createExpressionStatement(rightHandSide)]; } - if (isSynthIdentifier(prevArgName) && prevArgName.types.length < prevArgName.numberOfAssignmentsOriginal) { + if (isSynthIdentifier(variableName) && variableName.hasBeenDeclared) { // if the variable has already been declared, we don't need "let" or "const" - return [ts.createStatement(ts.createAssignment(ts.getSynthesizedDeepClone(prevArgName.identifier), rightHandSide))]; + return [ts.createExpressionStatement(ts.createAssignment(ts.getSynthesizedDeepClone(variableName.identifier), rightHandSide))]; } - return [ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(ts.getSynthesizedDeepClone(getNode(prevArgName)), /*type*/ undefined, rightHandSide)], getFlagOfBindingName(prevArgName, transformer.constIdentifiers))))]; + return [ + ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList([ + ts.createVariableDeclaration(ts.getSynthesizedDeepClone(getNode(variableName)), + /*type*/ undefined, rightHandSide) + ], 2 /* Const */)) + ]; } // should be kept up to date with isFixablePromiseArgument in suggestionDiagnostics.ts function getTransformationBody(func, prevArgName, argName, parent, transformer) { - var shouldReturn = transformer.setOfExpressionsToReturn.get(ts.getNodeId(parent).toString()); switch (func.kind) { case 100 /* NullKeyword */: // do not produce a transformed statement for a null argument @@ -128129,24 +128682,23 @@ var ts; break; } var synthCall = ts.createCall(ts.getSynthesizedDeepClone(func), /*typeArguments*/ undefined, isSynthIdentifier(argName) ? [argName.identifier] : []); - if (shouldReturn) { + if (shouldReturn(parent, transformer)) { return [ts.createReturn(synthCall)]; } - var type = transformer.originalTypeMap.get(ts.getNodeId(func).toString()) || transformer.checker.getTypeAtLocation(func); + var type = transformer.checker.getTypeAtLocation(func); var callSignatures = transformer.checker.getSignaturesOfType(type, 0 /* Call */); if (!callSignatures.length) { // if identifier in handler has no call signatures, it's invalid - codeActionSucceeded = false; - break; + return silentFail(); } var returnType = callSignatures[0].getReturnType(); - var varDeclOrAssignment = createTransformedStatement(prevArgName, ts.createAwait(synthCall), transformer); + var varDeclOrAssignment = createVariableOrAssignmentOrExpressionStatement(prevArgName, ts.createAwait(synthCall)); if (prevArgName) { prevArgName.types.push(returnType); } return varDeclOrAssignment; - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: { + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: { var funcBody = func.body; // Arrow functions with block bodies { } will enter this control flow if (ts.isBlock(funcBody)) { @@ -128164,8 +128716,9 @@ var ts; refactoredStmts.push(statement); } } - return shouldReturn ? refactoredStmts.map(function (s) { return ts.getSynthesizedDeepClone(s); }) : - removeReturns(refactoredStmts, prevArgName, transformer, seenReturnStatement); + return shouldReturn(parent, transformer) + ? refactoredStmts.map(function (s) { return ts.getSynthesizedDeepClone(s); }) + : removeReturns(refactoredStmts, prevArgName, transformer, seenReturnStatement); } else { var innerRetStmts = ts.isFixablePromiseHandler(funcBody) ? [ts.createReturn(funcBody)] : ts.emptyArray; @@ -128177,8 +128730,8 @@ var ts; var returnType_1 = getLastCallSignature(type_1, transformer.checker).getReturnType(); var rightHandSide = ts.getSynthesizedDeepClone(funcBody); var possiblyAwaitedRightHandSide = !!transformer.checker.getPromisedTypeOfPromise(returnType_1) ? ts.createAwait(rightHandSide) : rightHandSide; - if (!shouldReturn) { - var transformedStatement = createTransformedStatement(prevArgName, possiblyAwaitedRightHandSide, transformer); + if (!shouldReturn(parent, transformer)) { + var transformedStatement = createVariableOrAssignmentOrExpressionStatement(prevArgName, possiblyAwaitedRightHandSide); if (prevArgName) { prevArgName.types.push(returnType_1); } @@ -128191,8 +128744,7 @@ var ts; } default: // If no cases apply, we've found a transformation body we don't know how to handle, so the refactoring should no-op to avoid deleting code. - codeActionSucceeded = false; - break; + return silentFail(); } return ts.emptyArray; } @@ -128206,12 +128758,12 @@ var ts; var stmt = stmts_1[_i]; if (ts.isReturnStatement(stmt)) { if (stmt.expression) { - var possiblyAwaitedExpression = isPromiseReturningExpression(stmt.expression, transformer.checker) ? ts.createAwait(stmt.expression) : stmt.expression; + var possiblyAwaitedExpression = isPromiseTypedExpression(stmt.expression, transformer.checker) ? ts.createAwait(stmt.expression) : stmt.expression; if (prevArgName === undefined) { ret.push(ts.createExpressionStatement(possiblyAwaitedExpression)); } else { - ret.push(ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(getNode(prevArgName), /*type*/ undefined, possiblyAwaitedExpression)], getFlagOfBindingName(prevArgName, transformer.constIdentifiers))))); + ret.push(ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(getNode(prevArgName), /*type*/ undefined, possiblyAwaitedExpression)], 2 /* Const */)))); } } } @@ -128221,7 +128773,7 @@ var ts; } // if block has no return statement, need to define prevArgName as undefined to prevent undeclared variables if (!seenReturnStatement && prevArgName !== undefined) { - ret.push(ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(getNode(prevArgName), /*type*/ undefined, ts.createIdentifier("undefined"))], getFlagOfBindingName(prevArgName, transformer.constIdentifiers))))); + ret.push(ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(getNode(prevArgName), /*type*/ undefined, ts.createIdentifier("undefined"))], 2 /* Const */)))); } return ret; } @@ -128231,7 +128783,7 @@ var ts; var stmt = innerRetStmts_1[_i]; ts.forEachChild(stmt, function visit(node) { if (ts.isCallExpression(node)) { - var temp = transformExpression(node, transformer, node, prevArgName); + var temp = transformExpression(node, transformer, prevArgName); innerCbBody = innerCbBody.concat(temp); if (innerCbBody.length > 0) { return; @@ -128245,7 +128797,6 @@ var ts; return innerCbBody; } function getArgBindingName(funcNode, transformer) { - var numberOfAssignmentsOriginal = 0; var types = []; var name; if (ts.isFunctionLikeDeclaration(funcNode)) { @@ -128277,10 +128828,10 @@ var ts; var originalNode = getOriginalNode(identifier); var symbol = getSymbol(originalNode); if (!symbol) { - return createSynthIdentifier(identifier, types, numberOfAssignmentsOriginal); + return createSynthIdentifier(identifier, types); } var mapEntry = transformer.synthNamesMap.get(ts.getSymbolId(symbol).toString()); - return mapEntry || createSynthIdentifier(identifier, types, numberOfAssignmentsOriginal); + return mapEntry || createSynthIdentifier(identifier, types); } function getSymbol(node) { return node.symbol ? node.symbol : transformer.checker.getSymbolAtLocation(node); @@ -128289,22 +128840,21 @@ var ts; return node.original ? node.original : node; } } - function isEmpty(bindingName) { + function isEmptyBindingName(bindingName) { if (!bindingName) { return true; } if (isSynthIdentifier(bindingName)) { return !bindingName.identifier.text; } - return ts.every(bindingName.elements, isEmpty); + return ts.every(bindingName.elements, isEmptyBindingName); } function getNode(bindingName) { return isSynthIdentifier(bindingName) ? bindingName.identifier : bindingName.bindingPattern; } - function createSynthIdentifier(identifier, types, numberOfAssignmentsOriginal) { + function createSynthIdentifier(identifier, types) { if (types === void 0) { types = []; } - if (numberOfAssignmentsOriginal === void 0) { numberOfAssignmentsOriginal = 0; } - return { kind: 0 /* Identifier */, identifier: identifier, types: types, numberOfAssignmentsOriginal: numberOfAssignmentsOriginal }; + return { kind: 0 /* Identifier */, identifier: identifier, types: types, hasBeenDeclared: false }; } function createSynthBindingPattern(bindingPattern, elements, types) { if (elements === void 0) { elements = ts.emptyArray; } @@ -128317,6 +128867,9 @@ var ts; function isSynthBindingPattern(bindingName) { return bindingName.kind === 1 /* BindingPattern */; } + function shouldReturn(expression, transformer) { + return !!expression.original && transformer.setOfExpressionsToReturn.has(ts.getNodeId(expression.original).toString()); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -128350,10 +128903,10 @@ var ts; } var importNode = ts.importFromModuleSpecifier(moduleSpecifier); switch (importNode.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: changes.replaceNode(importingFile, importNode, ts.makeImport(importNode.name, /*namedImports*/ undefined, moduleSpecifier, quotePreference)); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (ts.isRequireCall(importNode, /*checkArgumentIsStringLiteralLike*/ false)) { changes.replaceNode(importingFile, importNode, ts.createPropertyAccess(ts.getSynthesizedDeepClone(importNode), "default")); } @@ -128406,20 +128959,20 @@ var ts; } function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, quotePreference) { switch (statement.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); return false; - case 226 /* ExpressionStatement */: { + case 227 /* ExpressionStatement */: { var expression = statement.expression; switch (expression.kind) { - case 196 /* CallExpression */: { + case 197 /* CallExpression */: { if (ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true)) { // For side-effecting require() call, just make a side-effecting import. changes.replaceNode(sourceFile, statement, ts.makeImport(/*name*/ undefined, /*namedImports*/ undefined, expression.arguments[0], quotePreference)); } return false; } - case 209 /* BinaryExpression */: { + case 210 /* BinaryExpression */: { var operatorToken = expression.operatorToken; return operatorToken.kind === 62 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports); } @@ -128461,8 +129014,8 @@ var ts; /** Converts `const name = require("moduleSpecifier").propertyName` */ function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, quotePreference) { switch (name.kind) { - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: { + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: { // `const [a, b] = require("c").d` --> `import { d } from "c"; const [a, b] = d;` var tmp = makeUniqueName(propertyName, identifiers); return [ @@ -128513,16 +129066,16 @@ var ts; function tryChangeModuleExportsObject(object) { var statements = ts.mapAllOrFail(object.properties, function (prop) { switch (prop.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. // falls through - case 282 /* ShorthandPropertyAssignment */: - case 283 /* SpreadAssignment */: + case 283 /* ShorthandPropertyAssignment */: + case 284 /* SpreadAssignment */: return undefined; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.createToken(89 /* ExportKeyword */)], prop); default: ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind " + prop.kind); @@ -128586,7 +129139,7 @@ var ts; function convertExportsDotXEquals_replaceNode(name, exported) { var modifiers = [ts.createToken(89 /* ExportKeyword */)]; switch (exported.kind) { - case 201 /* FunctionExpression */: { + case 202 /* FunctionExpression */: { var expressionName = exported.name; if (expressionName && expressionName.text !== name) { // `exports.f = function g() {}` -> `export const f = function g() {}` @@ -128594,10 +129147,10 @@ var ts; } } // falls through - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: // `exports.f = function() {}` --> `export function f() {}` return functionExpressionToDeclaration(name, modifiers, exported); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: // `exports.C = class {}` --> `export class C {}` return classExpressionToDeclaration(name, modifiers, exported); default: @@ -128615,7 +129168,7 @@ var ts; */ function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target, quotePreference) { switch (name.kind) { - case 189 /* ObjectBindingPattern */: { + case 190 /* ObjectBindingPattern */: { var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) { return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name) ? undefined @@ -128628,7 +129181,7 @@ var ts; } } // falls through -- object destructuring has an interesting pattern and must be a variable declaration - case 190 /* ArrayBindingPattern */: { + case 191 /* ArrayBindingPattern */: { /* import x from "x"; const [a, b, c] = x; @@ -128711,11 +129264,11 @@ var ts; function isFreeIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return parent.name !== node; - case 191 /* BindingElement */: + case 192 /* BindingElement */: return parent.propertyName !== node; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return parent.propertyName !== node; default: return true; @@ -129173,11 +129726,11 @@ var ts; function getTargetModuleFromNamespaceLikeImport(declaration, checker) { var _a; switch (declaration.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return checker.resolveExternalModuleName(declaration.initializer.arguments[0]); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return checker.getAliasedSymbol(declaration.symbol); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: var namespaceImport = ts.tryCast((_a = declaration.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings, ts.isNamespaceImport); return namespaceImport && checker.getAliasedSymbol(namespaceImport.symbol); default: @@ -129187,11 +129740,11 @@ var ts; function getNamespaceLikeImportText(declaration) { var _a, _b, _c; switch (declaration.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return (_a = ts.tryCast(declaration.name, ts.isIdentifier)) === null || _a === void 0 ? void 0 : _a.text; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return declaration.name.text; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return (_c = ts.tryCast((_b = declaration.importClause) === null || _b === void 0 ? void 0 : _b.namedBindings, ts.isNamespaceImport)) === null || _c === void 0 ? void 0 : _c.name.text; default: return ts.Debug.assertNever(declaration); @@ -129200,10 +129753,10 @@ var ts; function tryAddToExistingImport(existingImports, canUseTypeOnlyImport) { return ts.firstDefined(existingImports, function (_a) { var declaration = _a.declaration, importKind = _a.importKind; - if (declaration.kind === 253 /* ImportEqualsDeclaration */) + if (declaration.kind === 254 /* ImportEqualsDeclaration */) return undefined; - if (declaration.kind === 242 /* VariableDeclaration */) { - return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 189 /* ObjectBindingPattern */ + if (declaration.kind === 243 /* VariableDeclaration */) { + return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 190 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind: importKind, moduleSpecifier: declaration.initializer.arguments[0].text, canUseTypeOnlyImport: false } : undefined; } @@ -129211,7 +129764,7 @@ var ts; if (!importClause) return undefined; var name = importClause.name, namedBindings = importClause.namedBindings; - return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 257 /* NamedImports */) + return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 258 /* NamedImports */) ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: importClause, importKind: importKind, moduleSpecifier: declaration.moduleSpecifier.getText(), canUseTypeOnlyImport: canUseTypeOnlyImport } : undefined; }); @@ -129224,7 +129777,7 @@ var ts; if (ts.isRequireVariableDeclaration(i.parent, /*requireStringLiteralLikeArgument*/ true)) { return checker.resolveExternalModuleName(moduleSpecifier) === moduleSymbol ? { declaration: i.parent, importKind: importKind } : undefined; } - if (i.kind === 254 /* ImportDeclaration */ || i.kind === 253 /* ImportEqualsDeclaration */) { + if (i.kind === 255 /* ImportDeclaration */ || i.kind === 254 /* ImportEqualsDeclaration */) { return checker.getSymbolAtLocation(moduleSpecifier) === moduleSymbol ? { declaration: i, importKind: importKind } : undefined; } }); @@ -129267,9 +129820,9 @@ var ts; } function newImportInfoFromExistingSpecifier(_a, preferTypeOnlyImport, useRequire) { var declaration = _a.declaration, importKind = _a.importKind; - var moduleSpecifier = declaration.kind === 254 /* ImportDeclaration */ ? declaration.moduleSpecifier : - declaration.kind === 242 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : - declaration.moduleReference.kind === 265 /* ExternalModuleReference */ ? declaration.moduleReference.expression : + var moduleSpecifier = declaration.kind === 255 /* ImportDeclaration */ ? declaration.moduleSpecifier : + declaration.kind === 243 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : + declaration.moduleReference.kind === 266 /* ExternalModuleReference */ ? declaration.moduleReference.expression : undefined; return moduleSpecifier && ts.isStringLiteral(moduleSpecifier) ? { kind: 3 /* AddNew */, moduleSpecifier: moduleSpecifier.text, importKind: importKind, typeOnly: preferTypeOnlyImport, useRequire: useRequire } @@ -129480,7 +130033,7 @@ var ts; } } function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, canUseTypeOnlyImport) { - if (clause.kind === 189 /* ObjectBindingPattern */) { + if (clause.kind === 190 /* ObjectBindingPattern */) { if (defaultImport) { addElementToBindingPattern(clause, defaultImport, "default"); } @@ -129590,9 +130143,9 @@ var ts; } function forEachExternalModuleToImportFrom(program, host, from, filterByPackageJson, cb) { var filteredCount = 0; - var packageJson = filterByPackageJson && createAutoImportFilter(from, program, host); + var moduleSpecifierResolutionHost = createModuleSpecifierResolutionHost(program, host); + var packageJson = filterByPackageJson && createAutoImportFilter(from, program, host, moduleSpecifierResolutionHost); var allSourceFiles = program.getSourceFiles(); - var globalTypingsCache = host.getGlobalTypingsCacheLocation && host.getGlobalTypingsCacheLocation(); forEachExternalModule(program.getTypeChecker(), allSourceFiles, function (module, sourceFile) { if (sourceFile === undefined) { if (!packageJson || packageJson.allowsImportingAmbientModule(module, allSourceFiles)) { @@ -129604,7 +130157,7 @@ var ts; } else if (sourceFile && sourceFile !== from && - isImportablePath(from.fileName, sourceFile.fileName, ts.hostGetCanonicalFileName(host), globalTypingsCache)) { + isImportableFile(program, from, sourceFile, moduleSpecifierResolutionHost)) { if (!packageJson || packageJson.allowsImportingSourceFile(sourceFile, allSourceFiles)) { cb(module); } @@ -129630,6 +130183,19 @@ var ts; } } } + function isImportableFile(program, from, to, moduleSpecifierResolutionHost) { + var _a; + var getCanonicalFileName = ts.hostGetCanonicalFileName(moduleSpecifierResolutionHost); + var globalTypingsCache = (_a = moduleSpecifierResolutionHost.getGlobalTypingsCacheLocation) === null || _a === void 0 ? void 0 : _a.call(moduleSpecifierResolutionHost); + return !!ts.moduleSpecifiers.forEachFileNameOfModule(program.getSourceFiles(), from.fileName, to.fileName, ts.hostGetCanonicalFileName(moduleSpecifierResolutionHost), moduleSpecifierResolutionHost, program.redirectTargetsMap, + /*preferSymlinks*/ false, function (toPath) { + var toFile = program.getSourceFile(toPath); + // Determine to import using toPath only if toPath is what we were looking at + // or there doesnt exist the file in the program by the symlink + return (toFile === to || !toFile) && + isImportablePath(from.fileName, toPath, getCanonicalFileName, globalTypingsCache); + }); + } /** * Don't include something from a `node_modules` that isn't actually reachable by a global import. * A relative import to node_modules is usually a bad idea. @@ -129673,12 +130239,10 @@ var ts; return !ts.isStringANonContextualKeyword(res) ? res || "_" : "_" + res; } codefix.moduleSpecifierToValidIdentifier = moduleSpecifierToValidIdentifier; - function createAutoImportFilter(fromFile, program, host) { - var packageJsons = host.getPackageJsonsVisibleToFile && host.getPackageJsonsVisibleToFile(fromFile.fileName) || ts.getPackageJsonsVisibleToFile(fromFile.fileName, host); - var dependencyGroups = 1 /* Dependencies */ | 2 /* DevDependencies */ | 8 /* OptionalDependencies */; + function createModuleSpecifierResolutionHost(program, host) { // Mix in `getProbablySymlinks` from Program when host doesn't have it // in order for non-Project hosts to have a symlinks cache. - var moduleSpecifierResolutionHost = { + return { directoryExists: ts.maybeBind(host, host.directoryExists), fileExists: ts.maybeBind(host, host.fileExists), getCurrentDirectory: ts.maybeBind(host, host.getCurrentDirectory), @@ -129687,8 +130251,13 @@ var ts; getProbableSymlinks: ts.maybeBind(host, host.getProbableSymlinks) || program.getProbableSymlinks, getGlobalTypingsCacheLocation: ts.maybeBind(host, host.getGlobalTypingsCacheLocation), }; + } + function createAutoImportFilter(fromFile, program, host, moduleSpecifierResolutionHost) { + if (moduleSpecifierResolutionHost === void 0) { moduleSpecifierResolutionHost = createModuleSpecifierResolutionHost(program, host); } + var packageJsons = host.getPackageJsonsVisibleToFile && host.getPackageJsonsVisibleToFile(fromFile.fileName) || ts.getPackageJsonsVisibleToFile(fromFile.fileName, host); + var dependencyGroups = 1 /* Dependencies */ | 2 /* DevDependencies */ | 8 /* OptionalDependencies */; var usesNodeCoreModules; - return { allowsImportingAmbientModule: allowsImportingAmbientModule, allowsImportingSourceFile: allowsImportingSourceFile, allowsImportingSpecifier: allowsImportingSpecifier }; + return { allowsImportingAmbientModule: allowsImportingAmbientModule, allowsImportingSourceFile: allowsImportingSourceFile, allowsImportingSpecifier: allowsImportingSpecifier, moduleSpecifierResolutionHost: moduleSpecifierResolutionHost }; function moduleSpecifierIsCoveredByPackageJson(specifier) { var packageName = getNodeModuleRootSpecifier(specifier); for (var _i = 0, packageJsons_1 = packageJsons; _i < packageJsons_1.length; _i++) { @@ -129960,7 +130529,7 @@ var ts; } else { var typeNode = getTypeNode(program.getTypeChecker(), parentDeclaration, token); - addPropertyDeclaration(changes, declSourceFile, parentDeclaration, token.text, typeNode, makeStatic); + addPropertyDeclaration(changes, declSourceFile, parentDeclaration, token.text, typeNode, makeStatic ? 32 /* Static */ : 0); } } }; @@ -130040,7 +130609,7 @@ var ts; function addMissingMemberInJs(changeTracker, declSourceFile, classDeclaration, token, makeStatic) { var tokenName = token.text; if (makeStatic) { - if (classDeclaration.kind === 214 /* ClassExpression */) { + if (classDeclaration.kind === 215 /* ClassExpression */) { return; } var className = classDeclaration.name.getText(); @@ -130076,12 +130645,19 @@ var ts; } function getActionsForAddMissingMemberInTypeScriptFile(context, declSourceFile, classDeclaration, token, makeStatic) { var typeNode = getTypeNode(context.program.getTypeChecker(), classDeclaration, token); - var addProp = createAddPropertyDeclarationAction(context, declSourceFile, classDeclaration, makeStatic, token.text, typeNode); - return makeStatic || ts.isPrivateIdentifier(token) ? [addProp] : [addProp, createAddIndexSignatureAction(context, declSourceFile, classDeclaration, token.text, typeNode)]; + var actions = [createAddPropertyDeclarationAction(context, declSourceFile, classDeclaration, token.text, typeNode, makeStatic ? 32 /* Static */ : 0)]; + if (makeStatic || ts.isPrivateIdentifier(token)) { + return actions; + } + if (ts.startsWithUnderscore(token.text)) { + actions.unshift(createAddPropertyDeclarationAction(context, declSourceFile, classDeclaration, token.text, typeNode, 8 /* Private */)); + } + actions.push(createAddIndexSignatureAction(context, declSourceFile, classDeclaration, token.text, typeNode)); + return actions; } function getTypeNode(checker, classDeclaration, token) { var typeNode; - if (token.parent.parent.kind === 209 /* BinaryExpression */) { + if (token.parent.parent.kind === 210 /* BinaryExpression */) { var binaryExpression = token.parent.parent; var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); @@ -130093,14 +130669,17 @@ var ts; } return typeNode || ts.createKeywordTypeNode(125 /* AnyKeyword */); } - function createAddPropertyDeclarationAction(context, declSourceFile, classDeclaration, makeStatic, tokenName, typeNode) { - var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addPropertyDeclaration(t, declSourceFile, classDeclaration, tokenName, typeNode, makeStatic); }); - return codefix.createCodeFixAction(fixName, changes, [makeStatic ? ts.Diagnostics.Declare_static_property_0 : ts.Diagnostics.Declare_property_0, tokenName], fixId, ts.Diagnostics.Add_all_missing_members); + function createAddPropertyDeclarationAction(context, declSourceFile, classDeclaration, tokenName, typeNode, modifierFlags) { + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addPropertyDeclaration(t, declSourceFile, classDeclaration, tokenName, typeNode, modifierFlags); }); + if (modifierFlags & 8 /* Private */) { + return codefix.createCodeFixActionWithoutFixAll(fixName, changes, [ts.Diagnostics.Declare_private_property_0, tokenName]); + } + return codefix.createCodeFixAction(fixName, changes, [modifierFlags & 32 /* Static */ ? ts.Diagnostics.Declare_static_property_0 : ts.Diagnostics.Declare_property_0, tokenName], fixId, ts.Diagnostics.Add_all_missing_members); } - function addPropertyDeclaration(changeTracker, declSourceFile, classDeclaration, tokenName, typeNode, makeStatic) { + function addPropertyDeclaration(changeTracker, declSourceFile, classDeclaration, tokenName, typeNode, modifierFlags) { var property = ts.createProperty( /*decorators*/ undefined, - /*modifiers*/ makeStatic ? [ts.createToken(120 /* StaticKeyword */)] : undefined, tokenName, + /*modifiers*/ modifierFlags ? ts.createNodeArray(ts.createModifiersFromModifierFlags(modifierFlags)) : undefined, tokenName, /*questionToken*/ undefined, typeNode, /*initializer*/ undefined); var lastProp = getNodeToInsertPropertyAfter(classDeclaration); @@ -130124,7 +130703,7 @@ var ts; } function createAddIndexSignatureAction(context, declSourceFile, classDeclaration, tokenName, typeNode) { // Index signatures cannot have the static modifier. - var stringTypeNode = ts.createKeywordTypeNode(143 /* StringKeyword */); + var stringTypeNode = ts.createKeywordTypeNode(144 /* StringKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -130148,7 +130727,7 @@ var ts; } function addMethodDeclaration(context, changeTracker, declSourceFile, typeDecl, token, callExpression, makeStatic, inJs, preferences) { var methodDeclaration = codefix.createMethodFromCallExpression(context, callExpression, token.text, inJs, makeStatic, preferences, typeDecl); - var containingMethodDeclaration = ts.getAncestor(callExpression, 161 /* MethodDeclaration */); + var containingMethodDeclaration = ts.getAncestor(callExpression, 162 /* MethodDeclaration */); if (containingMethodDeclaration && containingMethodDeclaration.parent === typeDecl) { changeTracker.insertNodeAfter(declSourceFile, containingMethodDeclaration, methodDeclaration); } @@ -130167,7 +130746,10 @@ var ts; return !!(type && type.flags & 132 /* StringLike */); }); var enumMember = ts.createEnumMember(token, hasStringInitializer ? ts.createStringLiteral(token.text) : undefined); - changes.replaceNode(enumDeclaration.getSourceFile(), enumDeclaration, ts.updateEnumDeclaration(enumDeclaration, enumDeclaration.decorators, enumDeclaration.modifiers, enumDeclaration.name, ts.concatenate(enumDeclaration.members, ts.singleElementArray(enumMember)))); + changes.replaceNode(enumDeclaration.getSourceFile(), enumDeclaration, ts.updateEnumDeclaration(enumDeclaration, enumDeclaration.decorators, enumDeclaration.modifiers, enumDeclaration.name, ts.concatenate(enumDeclaration.members, ts.singleElementArray(enumMember))), { + leadingTriviaOption: ts.textChanges.LeadingTriviaOption.IncludeAll, + trailingTriviaOption: ts.textChanges.TrailingTriviaOption.Exclude + }); } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); @@ -130212,7 +130794,7 @@ var ts; (function (codefix) { var fixName = "fixCannotFindModule"; var fixIdInstallTypesPackage = "installTypesPackage"; - var errorCodeCannotFindModule = ts.Diagnostics.Cannot_find_module_0.code; + var errorCodeCannotFindModule = ts.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations.code; var errorCodes = [ errorCodeCannotFindModule, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code, @@ -130704,7 +131286,7 @@ var ts; return [createDeleteFix(delVar, ts.Diagnostics.Remove_variable_statement)]; } var result = []; - if (token.kind === 132 /* InferKeyword */) { + if (token.kind === 133 /* InferKeyword */) { var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return changeInferToUnknown(t, sourceFile, token); }); var name = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name.text; result.push(codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Replace_infer_0_with_unknown, name], fixIdInfer, ts.Diagnostics.Replace_all_unused_infer_with_unknown)); @@ -130736,7 +131318,7 @@ var ts; tryPrefixDeclaration(changes, diag.code, sourceFile, token); break; case fixIdDelete: { - if (token.kind === 132 /* InferKeyword */) + if (token.kind === 133 /* InferKeyword */) break; // Can't delete var importDecl = tryGetFullImport(token); if (importDecl) { @@ -130755,7 +131337,7 @@ var ts; break; } case fixIdInfer: - if (token.kind === 132 /* InferKeyword */) { + if (token.kind === 133 /* InferKeyword */) { changeInferToUnknown(changes, sourceFile, token); } break; @@ -130766,7 +131348,7 @@ var ts; }, }); function changeInferToUnknown(changes, sourceFile, token) { - changes.replaceNode(sourceFile, token.parent, ts.createKeywordTypeNode(148 /* UnknownKeyword */)); + changes.replaceNode(sourceFile, token.parent, ts.createKeywordTypeNode(149 /* UnknownKeyword */)); } function createDeleteFix(changes, diag) { return codefix.createCodeFixAction(fixName, changes, diag, fixIdDelete, ts.Diagnostics.Delete_all_unused_declarations); @@ -130782,7 +131364,7 @@ var ts; if (token.kind !== 18 /* OpenBraceToken */ || !ts.isObjectBindingPattern(token.parent)) return false; var decl = token.parent.parent; - if (decl.kind === 156 /* Parameter */) { + if (decl.kind === 157 /* Parameter */) { tryDeleteParameter(changes, sourceFile, decl, checker, sourceFiles, isFixAll); } else { @@ -130793,7 +131375,7 @@ var ts; function tryDeleteFullVariableStatement(sourceFile, token, changes) { var declarationList = ts.tryCast(token.parent, ts.isVariableDeclarationList); if (declarationList && declarationList.getChildren(sourceFile)[0] === token) { - changes.delete(sourceFile, declarationList.parent.kind === 225 /* VariableStatement */ ? declarationList.parent : declarationList); + changes.delete(sourceFile, declarationList.parent.kind === 226 /* VariableStatement */ ? declarationList.parent : declarationList); return true; } return false; @@ -130802,7 +131384,7 @@ var ts; // Don't offer to prefix a property. if (errorCode === ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code) return; - if (token.kind === 132 /* InferKeyword */) { + if (token.kind === 133 /* InferKeyword */) { token = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name; } if (ts.isIdentifier(token) && canPrefix(token)) { @@ -130811,14 +131393,14 @@ var ts; } function canPrefix(token) { switch (token.parent.kind) { - case 156 /* Parameter */: - case 155 /* TypeParameter */: + case 157 /* Parameter */: + case 156 /* TypeParameter */: return true; - case 242 /* VariableDeclaration */: { + case 243 /* VariableDeclaration */: { var varDecl = token.parent; switch (varDecl.parent.parent.kind) { - case 232 /* ForOfStatement */: - case 231 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 232 /* ForInStatement */: return true; } } @@ -130865,17 +131447,17 @@ var ts; function mayDeleteParameter(p, checker, isFixAll) { var parent = p.parent; switch (parent.kind) { - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: // Don't remove a parameter if this overrides something. var symbol = checker.getSymbolAtLocation(parent.name); if (ts.isMemberSymbolInBaseType(symbol, checker)) return false; // falls through - case 162 /* Constructor */: - case 244 /* FunctionDeclaration */: + case 163 /* Constructor */: + case 245 /* FunctionDeclaration */: return true; - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: { + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: { // Can't remove a non-last parameter in a callback. Can remove a parameter in code-fix-all if future parameters are also unused. var parameters = parent.parameters; var index = parameters.indexOf(p); @@ -130884,7 +131466,7 @@ var ts; ? parameters.slice(index + 1).every(function (p) { return p.name.kind === 75 /* Identifier */ && !p.symbol.isReferenced; }) : index === parameters.length - 1; } - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: // Setter must have a parameter return false; default: @@ -130933,7 +131515,7 @@ var ts; var container = (ts.isBlock(statement.parent) ? statement.parent : statement).parent; if (!ts.isBlock(statement.parent) || statement === ts.first(statement.parent.statements)) { switch (container.kind) { - case 227 /* IfStatement */: + case 228 /* IfStatement */: if (container.elseStatement) { if (ts.isBlock(statement.parent)) { break; @@ -130944,8 +131526,8 @@ var ts; return; } // falls through - case 229 /* WhileStatement */: - case 230 /* ForStatement */: + case 230 /* WhileStatement */: + case 231 /* ForStatement */: changes.delete(sourceFile, container); return; } @@ -131018,7 +131600,7 @@ var ts; var typeNode = info.typeNode, type = info.type; var original = typeNode.getText(sourceFile); var actions = [fix(type, fixIdPlain, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)]; - if (typeNode.kind === 297 /* JSDocNullableType */) { + if (typeNode.kind === 298 /* JSDocNullableType */) { // for nullable types, suggest the flow-compatible `T | null | undefined` // in addition to the jsdoc/closure-compatible `T | null` actions.push(fix(checker.getNullableType(type, 32768 /* Undefined */), fixIdNullable, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)); @@ -131038,7 +131620,7 @@ var ts; if (!info) return; var typeNode = info.typeNode, type = info.type; - var fixedType = typeNode.kind === 297 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; + var fixedType = typeNode.kind === 298 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; doChange(changes, sourceFile, typeNode, fixedType, checker); }); } @@ -131055,22 +131637,22 @@ var ts; // NOTE: Some locations are not handled yet: // MappedTypeNode.typeParameters and SignatureDeclaration.typeParameters, as well as CallExpression.typeArguments switch (node.kind) { - case 217 /* AsExpression */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 244 /* FunctionDeclaration */: - case 163 /* GetAccessor */: - case 167 /* IndexSignature */: - case 186 /* MappedType */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 156 /* Parameter */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 164 /* SetAccessor */: - case 247 /* TypeAliasDeclaration */: - case 199 /* TypeAssertionExpression */: - case 242 /* VariableDeclaration */: + case 218 /* AsExpression */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 245 /* FunctionDeclaration */: + case 164 /* GetAccessor */: + case 168 /* IndexSignature */: + case 187 /* MappedType */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 157 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 165 /* SetAccessor */: + case 248 /* TypeAliasDeclaration */: + case 200 /* TypeAssertionExpression */: + case 243 /* VariableDeclaration */: return true; default: return false; @@ -131080,6 +131662,51 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "fixMissingCallParentheses"; + var errorCodes = [ + ts.Diagnostics.This_condition_will_always_return_true_since_the_function_is_always_defined_Did_you_mean_to_call_it_instead.code, + ]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + fixIds: [fixId], + getCodeActions: function (context) { + var sourceFile = context.sourceFile, span = context.span; + var callName = getCallName(sourceFile, span.start); + if (!callName) + return; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, callName); }); + return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_missing_call_parentheses, fixId, ts.Diagnostics.Add_all_missing_call_parentheses)]; + }, + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var callName = getCallName(diag.file, diag.start); + if (callName) + doChange(changes, diag.file, callName); + }); } + }); + function doChange(changes, sourceFile, name) { + changes.replaceNodeWithText(sourceFile, name, name.text + "()"); + } + function getCallName(sourceFile, start) { + var token = ts.getTokenAtPosition(sourceFile, start); + if (ts.isPropertyAccessExpression(token.parent)) { + var current = token.parent; + while (ts.isPropertyAccessExpression(current.parent)) { + current = current.parent; + } + return current.name; + } + if (ts.isIdentifier(token)) { + return token; + } + return undefined; + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var codefix; (function (codefix) { @@ -131127,14 +131754,14 @@ var ts; } var insertBefore; switch (containingFunction.kind) { - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: insertBefore = containingFunction.name; break; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: insertBefore = ts.findChildOfKind(containingFunction, 94 /* FunctionKeyword */, sourceFile); break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: insertBefore = ts.findChildOfKind(containingFunction, 20 /* OpenParenToken */, sourceFile) || ts.first(containingFunction.parameters); break; default: @@ -131265,8 +131892,8 @@ var ts; var optional = !!(symbol.flags & 16777216 /* Optional */); var ambient = !!(enclosingDeclaration.flags & 8388608 /* Ambient */); switch (declaration.kind) { - case 158 /* PropertySignature */: - case 159 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 160 /* PropertyDeclaration */: var flags = preferences.quotePreference === "single" ? 268435456 /* UseSingleQuotesForStringLiteralType */ : undefined; var typeNode = checker.typeToTypeNode(type, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context)); if (importAdder) { @@ -131280,8 +131907,8 @@ var ts; /*decorators*/ undefined, modifiers, name, optional ? ts.createToken(57 /* QuestionToken */) : undefined, typeNode, /*initializer*/ undefined)); break; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: { + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: { var typeNode_1 = checker.typeToTypeNode(type, enclosingDeclaration, /*flags*/ undefined, getNoopSymbolTrackerWithResolver(context)); var allAccessors = ts.getAllAccessorDeclarations(declarations, declaration); var orderedAccessors = allAccessors.secondAccessor @@ -131310,8 +131937,8 @@ var ts; } break; } - case 160 /* MethodSignature */: - case 161 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 162 /* MethodDeclaration */: // The signature for the implementation appears as an entry in `signatures` iff // there is only one signature. // If there are overloads and an implementation signature, it appears as an @@ -131356,7 +131983,7 @@ var ts; var program = context.program; var checker = program.getTypeChecker(); var scriptTarget = ts.getEmitScriptTarget(program.getCompilerOptions()); - var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 161 /* MethodDeclaration */, enclosingDeclaration, 1 /* NoTruncation */ | 256 /* SuppressAnyReturnType */, getNoopSymbolTrackerWithResolver(context)); + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 162 /* MethodDeclaration */, enclosingDeclaration, 1 /* NoTruncation */ | 256 /* SuppressAnyReturnType */, getNoopSymbolTrackerWithResolver(context)); if (!signatureDeclaration) { return undefined; } @@ -131618,7 +132245,7 @@ var ts; }); function getActionsForUsageOfInvalidImport(context) { var sourceFile = context.sourceFile; - var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 196 /* CallExpression */ : 197 /* NewExpression */; + var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 197 /* CallExpression */ : 198 /* NewExpression */; var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start), function (a) { return a.kind === targetKind; }); if (!node) { return []; @@ -131737,7 +132364,7 @@ var ts; return codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Add_undefined_type_to_property_0, propertyDeclaration.name.getText()], fixIdAddUndefinedType, ts.Diagnostics.Add_undefined_type_to_all_uninitialized_properties); } function addUndefinedType(changeTracker, propertyDeclarationSourceFile, propertyDeclaration) { - var undefinedTypeNode = ts.createKeywordTypeNode(146 /* UndefinedKeyword */); + var undefinedTypeNode = ts.createKeywordTypeNode(147 /* UndefinedKeyword */); var type = propertyDeclaration.type; // TODO: GH#18217 var types = ts.isUnionTypeNode(type) ? type.types.concat(undefinedTypeNode) : [type, undefinedTypeNode]; changeTracker.replaceNode(propertyDeclarationSourceFile, type, ts.createUnionTypeNode(types)); @@ -131913,7 +132540,7 @@ var ts; function getImportTypeNode(sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos); ts.Debug.assert(token.kind === 96 /* ImportKeyword */, "This token should be an ImportKeyword"); - ts.Debug.assert(token.parent.kind === 188 /* ImportType */, "Token parent should be an ImportType"); + ts.Debug.assert(token.parent.kind === 189 /* ImportType */, "Token parent should be an ImportType"); return token.parent; } function doChange(changes, sourceFile, importType) { @@ -131965,7 +132592,7 @@ var ts; var otherMembers = members.filter(function (member) { return !ts.isIndexSignatureDeclaration(member); }); var parameter = ts.first(indexSignature.parameters); var mappedTypeParameter = ts.createTypeParameterDeclaration(ts.cast(parameter.name, ts.isIdentifier), parameter.type); - var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(138 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); + var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(139 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); var intersectionType = ts.createIntersectionTypeNode(__spreadArrays(ts.getAllSuperTypeNodes(container), [ mappedIntersectionType ], (otherMembers.length ? [ts.createTypeLiteralNode(otherMembers)] : ts.emptyArray))); @@ -132089,6 +132716,46 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "fixExpectedComma"; + var expectedErrorCode = ts.Diagnostics._0_expected.code; + var errorCodes = [expectedErrorCode]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var info = getInfo(sourceFile, context.span.start, context.errorCode); + if (!info) { + return undefined; + } + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, info); }); + return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Change_0_to_1, ";", ","], fixId, [ts.Diagnostics.Change_0_to_1, ";", ","])]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var info = getInfo(diag.file, diag.start, diag.code); + if (info) + doChange(changes, context.sourceFile, info); + }); }, + }); + function getInfo(sourceFile, pos, _) { + var node = ts.getTokenAtPosition(sourceFile, pos); + return (node.kind === 26 /* SemicolonToken */ && + node.parent && + (ts.isObjectLiteralExpression(node.parent) || + ts.isArrayLiteralExpression(node.parent))) ? { node: node } : undefined; + } + function doChange(changes, sourceFile, _a) { + var node = _a.node; + var newNode = ts.createNode(27 /* CommaToken */); + changes.replaceNode(sourceFile, node, newNode); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var refactor; (function (refactor) { @@ -132126,16 +132793,16 @@ var ts; return undefined; } switch (exportNode.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 249 /* ModuleDeclaration */: { + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 250 /* ModuleDeclaration */: { var node = exportNode; return node.name && ts.isIdentifier(node.name) ? { exportNode: node, exportName: node.name, wasDefault: wasDefault, exportingModuleSymbol: exportingModuleSymbol } : undefined; } - case 225 /* VariableStatement */: { + case 226 /* VariableStatement */: { var vs = exportNode; // Must be `export const x = something;`. if (!(vs.declarationList.flags & 2 /* Const */) || vs.declarationList.declarations.length !== 1) { @@ -132163,12 +132830,12 @@ var ts; else { var exportKeyword = ts.Debug.checkDefined(ts.findModifier(exportNode, 89 /* ExportKeyword */), "Should find an export keyword in modifier list"); switch (exportNode.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: changes.insertNodeAfter(exportingSourceFile, exportKeyword, ts.createToken(84 /* DefaultKeyword */)); break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // If 'x' isn't used in this file, `export const x = 0;` --> `export default 0;` if (!ts.FindAllReferences.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile)) { // We checked in `getInfo` that an initializer exists. @@ -132176,9 +132843,9 @@ var ts; break; } // falls through - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 249 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 250 /* ModuleDeclaration */: // `export type T = number;` -> `type T = number; export default T;` changes.deleteModifier(exportingSourceFile, exportKeyword); changes.insertNodeAfter(exportingSourceFile, exportNode, ts.createExportDefault(ts.createIdentifier(exportName.text))); @@ -132205,18 +132872,18 @@ var ts; function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) { var parent = ref.parent; switch (parent.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: // `a.default` --> `a.foo` changes.replaceNode(importingSourceFile, ref, ts.createIdentifier(exportName)); break; - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: { + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: { var spec = parent; // `default as foo` --> `foo`, `default as bar` --> `foo as bar` changes.replaceNode(importingSourceFile, spec, makeImportSpecifier(exportName, spec.name.text)); break; } - case 255 /* ImportClause */: { + case 256 /* ImportClause */: { var clause = parent; ts.Debug.assert(clause.name === ref, "Import clause name should match provided ref"); var spec = makeImportSpecifier(exportName, ref.text); @@ -132225,7 +132892,7 @@ var ts; // `import foo from "./a";` --> `import { foo } from "./a";` changes.replaceNode(importingSourceFile, ref, ts.createNamedImports([spec])); } - else if (namedBindings.kind === 256 /* NamespaceImport */) { + else if (namedBindings.kind === 257 /* NamespaceImport */) { // `import foo, * as a from "./a";` --> `import * as a from ".a/"; import { foo } from "./a";` changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) }); var quotePreference = ts.isStringLiteral(clause.parent.moduleSpecifier) ? ts.quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : 1 /* Double */; @@ -132246,11 +132913,11 @@ var ts; function changeNamedToDefaultImport(importingSourceFile, ref, changes) { var parent = ref.parent; switch (parent.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: // `a.foo` --> `a.default` changes.replaceNode(importingSourceFile, ref, ts.createIdentifier("default")); break; - case 258 /* ImportSpecifier */: { + case 259 /* ImportSpecifier */: { // `import { foo } from "./a";` --> `import foo from "./a";` // `import { foo as bar } from "./a";` --> `import bar from "./a";` var defaultImport = ts.createIdentifier(parent.name.text); @@ -132263,7 +132930,7 @@ var ts; } break; } - case 263 /* ExportSpecifier */: { + case 264 /* ExportSpecifier */: { // `export { foo } from "./a";` --> `export { default as foo } from "./a";` // `export { foo as bar } from "./a";` --> `export { default as bar } from "./a";` // `export { foo as default } from "./a";` --> `export { default } from "./a";` @@ -132296,8 +132963,8 @@ var ts; var i = getImportToConvert(context); if (!i) return ts.emptyArray; - var description = i.kind === 256 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; - var actionName = i.kind === 256 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; + var description = i.kind === 257 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; + var actionName = i.kind === 257 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; return [{ name: refactorName, description: description, actions: [{ name: actionName, description: description }] }]; }, getEditsForAction: function (context, actionName) { @@ -132319,7 +132986,7 @@ var ts; } function doChange(sourceFile, program, changes, toConvert) { var checker = program.getTypeChecker(); - if (toConvert.kind === 256 /* NamespaceImport */) { + if (toConvert.kind === 257 /* NamespaceImport */) { doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())); } else { @@ -132666,20 +133333,20 @@ var ts; function checkForStaticContext(nodeToCheck, containingClass) { var current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 159 /* PropertyDeclaration */) { + if (current.kind === 160 /* PropertyDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 156 /* Parameter */) { + else if (current.kind === 157 /* Parameter */) { var ctorOrMethod = ts.getContainingFunction(current); - if (ctorOrMethod.kind === 162 /* Constructor */) { + if (ctorOrMethod.kind === 163 /* Constructor */) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 161 /* MethodDeclaration */) { + else if (current.kind === 162 /* MethodDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } @@ -132722,7 +133389,7 @@ var ts; return true; } if (ts.isDeclaration(node)) { - var declaringNode = (node.kind === 242 /* VariableDeclaration */) ? node.parent.parent : node; + var declaringNode = (node.kind === 243 /* VariableDeclaration */) ? node.parent.parent : node; if (ts.hasModifier(declaringNode, 1 /* Export */)) { // TODO: GH#18217 Silly to use `errors ||` since it's definitely not defined (see top of `visit`) // Also, if we're only pushing one error, just use `let error: Diagnostic | undefined`! @@ -132734,13 +133401,13 @@ var ts; } // Some things can't be extracted in certain situations switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractImport)); return true; case 102 /* SuperKeyword */: // For a super *constructor call*, we have to be extracting the entire class, // but a super *method call* simply implies a 'this' reference - if (node.parent.kind === 196 /* CallExpression */) { + if (node.parent.kind === 197 /* CallExpression */) { // Super constructor call var containingClass_1 = ts.getContainingClass(node); // TODO:GH#18217 if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { @@ -132755,8 +133422,8 @@ var ts; } if (ts.isFunctionLikeDeclaration(node) || ts.isClassLike(node)) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: if (ts.isSourceFile(node.parent) && node.parent.externalModuleIndicator === undefined) { // You cannot extract global declarations (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); @@ -132768,21 +133435,21 @@ var ts; } var savedPermittedJumps = permittedJumps; switch (node.kind) { - case 227 /* IfStatement */: + case 228 /* IfStatement */: permittedJumps = 0 /* None */; break; - case 240 /* TryStatement */: + case 241 /* TryStatement */: // forbid all jumps inside try blocks permittedJumps = 0 /* None */; break; - case 223 /* Block */: - if (node.parent && node.parent.kind === 240 /* TryStatement */ && node.parent.finallyBlock === node) { + case 224 /* Block */: + if (node.parent && node.parent.kind === 241 /* TryStatement */ && node.parent.finallyBlock === node) { // allow unconditional returns from finally blocks permittedJumps = 4 /* Return */; } break; - case 278 /* DefaultClause */: - case 277 /* CaseClause */: + case 279 /* DefaultClause */: + case 278 /* CaseClause */: // allow unlabeled break inside case clauses permittedJumps |= 1 /* Break */; break; @@ -132794,19 +133461,19 @@ var ts; break; } switch (node.kind) { - case 183 /* ThisType */: + case 184 /* ThisType */: case 104 /* ThisKeyword */: rangeFacts |= RangeFacts.UsesThis; break; - case 238 /* LabeledStatement */: { + case 239 /* LabeledStatement */: { var label = node.label; (seenLabels || (seenLabels = [])).push(label.escapedText); ts.forEachChild(node, visit); seenLabels.pop(); break; } - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: { + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: { var label = node.label; if (label) { if (!ts.contains(seenLabels, label.escapedText)) { @@ -132815,20 +133482,20 @@ var ts; } } else { - if (!(permittedJumps & (node.kind === 234 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + if (!(permittedJumps & (node.kind === 235 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { // attempt to break or continue in a forbidden context (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: rangeFacts |= RangeFacts.IsAsyncFunction; break; - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: rangeFacts |= RangeFacts.IsGenerator; break; - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: if (permittedJumps & 4 /* Return */) { rangeFacts |= RangeFacts.HasReturn; } @@ -132882,7 +133549,7 @@ var ts; while (true) { current = current.parent; // A function parameter's initializer is actually in the outer scope, not the function declaration - if (current.kind === 156 /* Parameter */) { + if (current.kind === 157 /* Parameter */) { // Skip all the way to the outer scope of the function that declared this parameter current = ts.findAncestor(current, function (parent) { return ts.isFunctionLikeDeclaration(parent); }).parent; } @@ -132893,7 +133560,7 @@ var ts; // * Module/namespace or source file if (isScope(current)) { scopes.push(current); - if (current.kind === 290 /* SourceFile */) { + if (current.kind === 291 /* SourceFile */) { return scopes; } } @@ -132983,32 +133650,32 @@ var ts; } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: return "constructor"; - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: return scope.name ? "function '" + scope.name.text + "'" : "anonymous function"; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return "arrow function"; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return "method '" + scope.name.getText() + "'"; - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: return "'get " + scope.name.getText() + "'"; - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: return "'set " + scope.name.getText() + "'"; default: throw ts.Debug.assertNever(scope, "Unexpected scope kind " + scope.kind); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 245 /* ClassDeclaration */ + return scope.kind === 246 /* ClassDeclaration */ ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration" : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 250 /* ModuleBlock */ + return scope.kind === 251 /* ModuleBlock */ ? "namespace '" + scope.parent.name.getText() + "'" : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } @@ -133228,9 +133895,9 @@ var ts; while (ts.isParenthesizedTypeNode(withoutParens)) { withoutParens = withoutParens.type; } - return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 146 /* UndefinedKeyword */; }) + return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 147 /* UndefinedKeyword */; }) ? clone - : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(146 /* UndefinedKeyword */)]); + : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(147 /* UndefinedKeyword */)]); } } /** @@ -133259,7 +133926,7 @@ var ts; if (rangeFacts & RangeFacts.InStaticRegion) { modifiers.push(ts.createToken(120 /* StaticKeyword */)); } - modifiers.push(ts.createToken(138 /* ReadonlyKeyword */)); + modifiers.push(ts.createToken(139 /* ReadonlyKeyword */)); var newVariable = ts.createProperty( /*decorators*/ undefined, modifiers, localNameText, /*questionToken*/ undefined, variableType, initializer); @@ -133288,7 +133955,7 @@ var ts; var localReference = ts.createIdentifier(localNameText); changeTracker.replaceNode(context.file, node, localReference); } - else if (node.parent.kind === 226 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { + else if (node.parent.kind === 227 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { // If the parent is an expression statement and the target scope is the immediately enclosing one, // replace the statement with the declaration. var newVariableStatement = ts.createVariableStatement( @@ -133307,7 +133974,7 @@ var ts; changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false); } // Consume - if (node.parent.kind === 226 /* ExpressionStatement */) { + if (node.parent.kind === 227 /* ExpressionStatement */) { // If the parent is an expression statement, delete it. changeTracker.delete(context.file, node.parent); } @@ -133451,7 +134118,7 @@ var ts; return { body: ts.createBlock(statements, /*multiLine*/ true), returnValueProperty: undefined }; } function visitor(node) { - if (!ignoreReturns && node.kind === 235 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { + if (!ignoreReturns && node.kind === 236 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { var assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); if (node.expression) { if (!returnValueProperty) { @@ -133629,7 +134296,7 @@ var ts; var scope = scopes_1[_i]; usagesPerScope.push({ usages: ts.createMap(), typeParameterUsages: ts.createMap(), substitutions: ts.createMap() }); substitutionsPerScope.push(ts.createMap()); - functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 244 /* FunctionDeclaration */ + functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 245 /* FunctionDeclaration */ ? [ts.createDiagnosticForNode(scope, Messages.cannotExtractToOtherFunctionLike)] : []); var constantErrors = []; @@ -133945,30 +134612,30 @@ var ts; function isExtractableExpression(node) { var parent = node.parent; switch (parent.kind) { - case 284 /* EnumMember */: + case 285 /* EnumMember */: return false; } switch (node.kind) { case 10 /* StringLiteral */: - return parent.kind !== 254 /* ImportDeclaration */ && - parent.kind !== 258 /* ImportSpecifier */; - case 213 /* SpreadElement */: - case 189 /* ObjectBindingPattern */: - case 191 /* BindingElement */: + return parent.kind !== 255 /* ImportDeclaration */ && + parent.kind !== 259 /* ImportSpecifier */; + case 214 /* SpreadElement */: + case 190 /* ObjectBindingPattern */: + case 192 /* BindingElement */: return false; case 75 /* Identifier */: - return parent.kind !== 191 /* BindingElement */ && - parent.kind !== 258 /* ImportSpecifier */ && - parent.kind !== 263 /* ExportSpecifier */; + return parent.kind !== 192 /* BindingElement */ && + parent.kind !== 259 /* ImportSpecifier */ && + parent.kind !== 264 /* ExportSpecifier */; } return true; } function isBlockLike(node) { switch (node.kind) { - case 223 /* Block */: - case 290 /* SourceFile */: - case 250 /* ModuleBlock */: - case 277 /* CaseClause */: + case 224 /* Block */: + case 291 /* SourceFile */: + case 251 /* ModuleBlock */: + case 278 /* CaseClause */: return true; default: return false; @@ -134132,7 +134799,7 @@ var ts; } function doTypedefChange(changes, file, name, info) { var firstStatement = info.firstStatement, selection = info.selection, typeParameters = info.typeParameters; - var node = ts.createNode(322 /* JSDocTypedefTag */); + var node = ts.createNode(323 /* JSDocTypedefTag */); node.tagName = ts.createIdentifier("typedef"); // TODO: jsdoc factory https://github.com/Microsoft/TypeScript/pull/29539 node.fullName = ts.createIdentifier(name); node.name = node.fullName; @@ -134140,10 +134807,10 @@ var ts; var templates = []; ts.forEach(typeParameters, function (typeParameter) { var constraint = ts.getEffectiveConstraintOfTypeParameter(typeParameter); - var template = ts.createNode(321 /* JSDocTemplateTag */); + var template = ts.createNode(322 /* JSDocTemplateTag */); template.tagName = ts.createIdentifier("template"); template.constraint = constraint && ts.cast(constraint, ts.isJSDocTypeExpression); - var parameter = ts.createNode(155 /* TypeParameter */); + var parameter = ts.createNode(156 /* TypeParameter */); parameter.name = typeParameter.name; template.typeParameters = ts.createNodeArray([parameter]); templates.push(template); @@ -134237,9 +134904,6 @@ var ts; var modifiers = ts.append(!isJS ? [ts.createToken(accessModifier)] : undefined, isStatic ? ts.createToken(120 /* StaticKeyword */) : undefined); return modifiers && ts.createNodeArray(modifiers); } - function startsWithUnderscore(name) { - return name.charCodeAt(0) === 95 /* _ */; - } function getConvertibleFieldAtPosition(context) { var file = context.file, startPosition = context.startPosition, endPosition = context.endPosition; var node = ts.getTokenAtPosition(file, startPosition); @@ -134250,14 +134914,14 @@ var ts; || !isConvertibleName(declaration.name) || (ts.getModifierFlags(declaration) | meaning) !== meaning) return undefined; var name = declaration.name.text; - var startWithUnderscore = startsWithUnderscore(name); + var startWithUnderscore = ts.startsWithUnderscore(name); var fieldName = createPropertyName(startWithUnderscore ? name : ts.getUniqueName("_" + name, file), declaration.name); var accessorName = createPropertyName(startWithUnderscore ? ts.getUniqueName(name.substring(1), file) : name, declaration.name); return { isStatic: ts.hasStaticModifier(declaration), isReadonly: ts.hasReadonlyModifier(declaration), type: ts.getTypeAnnotationNode(declaration), - container: declaration.kind === 156 /* Parameter */ ? declaration.parent.parent : declaration.parent, + container: declaration.kind === 157 /* Parameter */ ? declaration.parent.parent : declaration.parent, originalName: declaration.name.text, declaration: declaration, fieldName: fieldName, @@ -134400,11 +135064,11 @@ var ts; } function isPureImport(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return true; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return !ts.hasModifier(node, 1 /* Export */); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return node.declarationList.declarations.every(function (d) { return !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ true); }); default: return false; @@ -134492,12 +135156,12 @@ var ts; } function getNamespaceLikeImport(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 256 /* NamespaceImport */ ? + case 255 /* ImportDeclaration */: + return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 257 /* NamespaceImport */ ? node.importClause.namedBindings.name : undefined; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return node.name; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ts.tryCast(node.name, ts.isIdentifier); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); @@ -134528,20 +135192,20 @@ var ts; var newNamespaceId = ts.createIdentifier(newNamespaceName); var newModuleString = ts.createLiteral(newModuleSpecifier); switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(newNamespaceId)), newModuleString); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return ts.createImportEqualsDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, newNamespaceId, ts.createExternalModuleReference(newModuleString)); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ts.createVariableDeclaration(newNamespaceId, /*type*/ undefined, createRequireCall(newModuleString)); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); } } function moduleSpecifierFromImport(i) { - return (i.kind === 254 /* ImportDeclaration */ ? i.moduleSpecifier - : i.kind === 253 /* ImportEqualsDeclaration */ ? i.moduleReference.expression + return (i.kind === 255 /* ImportDeclaration */ ? i.moduleSpecifier + : i.kind === 254 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0]); } function forEachImportInStatement(statement, cb) { @@ -134611,15 +135275,15 @@ var ts; } function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) { switch (importDecl.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused); break; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: if (isUnused(importDecl.name)) { changes.delete(sourceFile, importDecl); } break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused); break; default: @@ -134632,7 +135296,7 @@ var ts; var _a = importDecl.importClause, name = _a.name, namedBindings = _a.namedBindings; var defaultUnused = !name || isUnused(name); var namedBindingsUnused = !namedBindings || - (namedBindings.kind === 256 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); + (namedBindings.kind === 257 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); if (defaultUnused && namedBindingsUnused) { changes.delete(sourceFile, importDecl); } @@ -134644,7 +135308,7 @@ var ts; if (namedBindingsUnused) { changes.replaceNode(sourceFile, importDecl.importClause, ts.updateImportClause(importDecl.importClause, name, /*namedBindings*/ undefined, importDecl.importClause.isTypeOnly)); } - else if (namedBindings.kind === 257 /* NamedImports */) { + else if (namedBindings.kind === 258 /* NamedImports */) { for (var _i = 0, _b = namedBindings.elements; _i < _b.length; _i++) { var element = _b[_i]; if (isUnused(element.name)) @@ -134662,9 +135326,9 @@ var ts; changes.delete(sourceFile, name); } break; - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: break; - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: if (name.elements.every(function (e) { return ts.isIdentifier(e.name) && isUnused(e.name); })) { changes.delete(sourceFile, ts.isVariableDeclarationList(varDecl.parent) && varDecl.parent.declarations.length === 1 ? varDecl.parent.parent : varDecl); } @@ -134791,13 +135455,13 @@ var ts; // Below should all be utilities function isInImport(decl) { switch (decl.kind) { - case 253 /* ImportEqualsDeclaration */: - case 258 /* ImportSpecifier */: - case 255 /* ImportClause */: + case 254 /* ImportEqualsDeclaration */: + case 259 /* ImportSpecifier */: + case 256 /* ImportClause */: return true; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return isVariableDeclarationInImport(decl); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return ts.isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent); default: return false; @@ -134809,7 +135473,7 @@ var ts; } function filterImport(i, moduleSpecifier, keep) { switch (i.kind) { - case 254 /* ImportDeclaration */: { + case 255 /* ImportDeclaration */: { var clause = i.importClause; if (!clause) return undefined; @@ -134819,9 +135483,9 @@ var ts; ? ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(defaultImport, namedBindings), moduleSpecifier) : undefined; } - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return keep(i.name) ? i : undefined; - case 242 /* VariableDeclaration */: { + case 243 /* VariableDeclaration */: { var name = filterBindingName(i.name, keep); return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : undefined; } @@ -134830,7 +135494,7 @@ var ts; } } function filterNamedBindings(namedBindings, keep) { - if (namedBindings.kind === 256 /* NamespaceImport */) { + if (namedBindings.kind === 257 /* NamespaceImport */) { return keep(namedBindings.name) ? namedBindings : undefined; } else { @@ -134842,9 +135506,9 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return keep(name) ? name : undefined; - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: return name; - case 189 /* ObjectBindingPattern */: { + case 190 /* ObjectBindingPattern */: { // We can't handle nested destructurings or property names well here, so just copy them all. var newElements = name.elements.filter(function (prop) { return prop.propertyName || !ts.isIdentifier(prop.name) || keep(prop.name); }); return newElements.length ? ts.createObjectBindingPattern(newElements) : undefined; @@ -134901,13 +135565,13 @@ var ts; } function isNonVariableTopLevelDeclaration(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 254 /* ImportEqualsDeclaration */: return true; default: return false; @@ -134915,17 +135579,17 @@ var ts; } function forEachTopLevelDeclaration(statement, cb) { switch (statement.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 254 /* ImportEqualsDeclaration */: return cb(statement); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return ts.firstDefined(statement.declarationList.declarations, function (decl) { return forEachTopLevelDeclarationInBindingName(decl.name, cb); }); - case 226 /* ExpressionStatement */: { + case 227 /* ExpressionStatement */: { var expression = statement.expression; return ts.isBinaryExpression(expression) && ts.getAssignmentDeclarationKind(expression) === 1 /* ExportsProperty */ ? cb(statement) @@ -134937,8 +135601,8 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return cb(ts.cast(name.parent, function (x) { return ts.isVariableDeclaration(x) || ts.isBindingElement(x); })); - case 190 /* ArrayBindingPattern */: - case 189 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: return ts.firstDefined(name.elements, function (em) { return ts.isOmittedExpression(em) ? undefined : forEachTopLevelDeclarationInBindingName(em.name, cb); }); default: return ts.Debug.assertNever(name, "Unexpected name kind " + name.kind); @@ -134949,9 +135613,9 @@ var ts; } function getTopLevelDeclarationStatement(d) { switch (d.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return d.parent.parent; - case 191 /* BindingElement */: + case 192 /* BindingElement */: return getTopLevelDeclarationStatement(ts.cast(d.parent.parent, function (p) { return ts.isVariableDeclaration(p) || ts.isBindingElement(p); })); default: return d; @@ -134984,23 +135648,23 @@ var ts; function addEs6Export(d) { var modifiers = ts.concatenate([ts.createModifier(89 /* ExportKeyword */)], d.modifiers); switch (d.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(d, d.decorators, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return ts.updateClassDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return ts.updateVariableStatement(d, modifiers, d.declarationList); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return ts.updateModuleDeclaration(d, d.decorators, modifiers, d.name, d.body); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return ts.updateEnumDeclaration(d, d.decorators, modifiers, d.name, d.members); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.type); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(d, d.decorators, modifiers, d.name, d.moduleReference); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return ts.Debug.fail(); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(d, "Unexpected declaration kind " + d.kind); @@ -135011,18 +135675,18 @@ var ts; } function getNamesToExportInCommonJS(decl) { switch (decl.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: return [decl.name.text]; // TODO: GH#18217 - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return ts.mapDefined(decl.declarationList.declarations, function (d) { return ts.isIdentifier(d.name) ? d.name.text : undefined; }); - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 254 /* ImportEqualsDeclaration */: return ts.emptyArray; - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return ts.Debug.fail("Can't export an ExpressionStatement"); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(decl, "Unexpected decl kind " + decl.kind); @@ -135292,15 +135956,15 @@ var ts; var parent = functionReference.parent; switch (parent.kind) { // foo(...) or super(...) or new Foo(...) - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: var callOrNewExpression = ts.tryCast(parent, ts.isCallOrNewExpression); if (callOrNewExpression && callOrNewExpression.expression === functionReference) { return callOrNewExpression; } break; // x.foo(...) - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) { var callOrNewExpression_1 = ts.tryCast(propertyAccessExpression.parent, ts.isCallOrNewExpression); @@ -135310,7 +135974,7 @@ var ts; } break; // x["foo"](...) - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) { var callOrNewExpression_2 = ts.tryCast(elementAccessExpression.parent, ts.isCallOrNewExpression); @@ -135329,14 +135993,14 @@ var ts; var parent = reference.parent; switch (parent.kind) { // `C.foo` - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.expression === reference) { return propertyAccessExpression; } break; // `C["foo"]` - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.expression === reference) { return elementAccessExpression; @@ -135378,11 +136042,11 @@ var ts; if (!isValidParameterNodeArray(functionDeclaration.parameters, checker)) return false; switch (functionDeclaration.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return isSingleImplementation(functionDeclaration, checker); - case 162 /* Constructor */: + case 163 /* Constructor */: if (ts.isClassDeclaration(functionDeclaration.parent)) { return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker); } @@ -135390,8 +136054,8 @@ var ts; return isValidVariableDeclaration(functionDeclaration.parent.parent) && isSingleImplementation(functionDeclaration, checker); } - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return isValidVariableDeclaration(functionDeclaration.parent); } return false; @@ -135562,7 +136226,7 @@ var ts; } function getClassNames(constructorDeclaration) { switch (constructorDeclaration.parent.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: var classDeclaration = constructorDeclaration.parent; if (classDeclaration.name) return [classDeclaration.name]; @@ -135570,7 +136234,7 @@ var ts; // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(classDeclaration, 84 /* DefaultKeyword */), "Nameless class declaration should be a default export"); return [defaultModifier]; - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: var classExpression = constructorDeclaration.parent; var variableDeclaration = constructorDeclaration.parent.parent; var className = classExpression.name; @@ -135581,25 +136245,25 @@ var ts; } function getFunctionNames(functionDeclaration) { switch (functionDeclaration.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: if (functionDeclaration.name) return [functionDeclaration.name]; // If the function declaration doesn't have a name, it should have a default modifier. // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(functionDeclaration, 84 /* DefaultKeyword */), "Nameless function declaration should be a default export"); return [defaultModifier]; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return [functionDeclaration.name]; - case 162 /* Constructor */: - var ctrKeyword = ts.Debug.checkDefined(ts.findChildOfKind(functionDeclaration, 129 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); - if (functionDeclaration.parent.kind === 214 /* ClassExpression */) { + case 163 /* Constructor */: + var ctrKeyword = ts.Debug.checkDefined(ts.findChildOfKind(functionDeclaration, 130 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); + if (functionDeclaration.parent.kind === 215 /* ClassExpression */) { var variableDeclaration = functionDeclaration.parent.parent; return [variableDeclaration.name, ctrKeyword]; } return [ctrKeyword]; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return [functionDeclaration.parent.name]; - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: if (functionDeclaration.name) return [functionDeclaration.name, functionDeclaration.parent.name]; return [functionDeclaration.parent.name]; @@ -135850,8 +136514,8 @@ var ts; if (!children.length) { return undefined; } - var child = ts.find(children, function (kid) { return kid.kind < 294 /* FirstJSDocNode */ || kid.kind > 323 /* LastJSDocNode */; }); - return child.kind < 153 /* FirstNode */ ? + var child = ts.find(children, function (kid) { return kid.kind < 295 /* FirstJSDocNode */ || kid.kind > 324 /* LastJSDocNode */; }); + return child.kind < 154 /* FirstNode */ ? child : child.getFirstToken(sourceFile); }; @@ -135862,7 +136526,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 153 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 154 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { return ts.forEachChild(this, cbNode, cbNodeArray); @@ -135920,7 +136584,7 @@ var ts; } } function createSyntaxList(nodes, parent) { - var list = createNode(324 /* SyntaxList */, nodes.pos, nodes.end, parent); + var list = createNode(325 /* SyntaxList */, nodes.pos, nodes.end, parent); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { @@ -136234,7 +136898,7 @@ var ts; __extends(SourceFileObject, _super); function SourceFileObject(kind, pos, end) { var _this = _super.call(this, kind, pos, end) || this; - _this.kind = 290 /* SourceFile */; + _this.kind = 291 /* SourceFile */; return _this; } SourceFileObject.prototype.update = function (newText, textChangeRange) { @@ -136293,10 +136957,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -136316,31 +136980,31 @@ var ts; } ts.forEachChild(node, visit); break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 248 /* EnumDeclaration */: - case 249 /* ModuleDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 263 /* ExportSpecifier */: - case 258 /* ImportSpecifier */: - case 255 /* ImportClause */: - case 256 /* NamespaceImport */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 173 /* TypeLiteral */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: + case 250 /* ModuleDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 264 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 256 /* ImportClause */: + case 257 /* NamespaceImport */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 174 /* TypeLiteral */: addDeclaration(node); ts.forEachChild(node, visit); break; - case 156 /* Parameter */: + case 157 /* Parameter */: // Only consider parameter properties if (!ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { break; } // falls through - case 242 /* VariableDeclaration */: - case 191 /* BindingElement */: { + case 243 /* VariableDeclaration */: + case 192 /* BindingElement */: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -136351,12 +137015,12 @@ var ts; } } // falls through - case 284 /* EnumMember */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 285 /* EnumMember */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: addDeclaration(node); break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; var exportDeclaration = node; @@ -136369,7 +137033,7 @@ var ts; } } break; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -136381,7 +137045,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 256 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 257 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -136390,7 +137054,7 @@ var ts; } } break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) !== 0 /* None */) { addDeclaration(node); } @@ -136716,6 +137380,7 @@ var ts; return sourceFile; } function synchronizeHostData() { + var _a; ts.Debug.assert(!syntaxOnly); // perform fast check if host supports it if (host.getProjectVersion) { @@ -136797,12 +137462,10 @@ var ts; return host.resolveTypeReferenceDirectives.apply(host, args); }; } - if (host.setResolvedProjectReferenceCallbacks) { - compilerHost.setResolvedProjectReferenceCallbacks = function (callbacks) { return host.setResolvedProjectReferenceCallbacks(callbacks); }; - } if (host.useSourceOfProjectReferenceRedirect) { compilerHost.useSourceOfProjectReferenceRedirect = function () { return host.useSourceOfProjectReferenceRedirect(); }; } + (_a = host.setCompilerHost) === null || _a === void 0 ? void 0 : _a.call(host, compilerHost); var documentRegistryBucketKey = documentRegistry.getKeyForCompilationSettings(newSettings); var options = { rootNames: rootFileNames, @@ -136888,7 +137551,7 @@ var ts; // We do not support the scenario where a host can modify a registered // file's script kind, i.e. in one project some file is treated as ".ts" // and in another as ".js" - ts.Debug.assertEqual(hostFileInformation.scriptKind, oldSourceFile.scriptKind, "Registered script kind should match new script kind.", path); + ts.Debug.assertEqual(hostFileInformation.scriptKind, oldSourceFile.scriptKind, "Registered script kind should match new script kind."); return documentRegistry.updateDocumentWithKey(fileName, path, newSettings, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind); } // We didn't already have the file. Fall through and acquire it from the registry. @@ -137010,12 +137673,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return !ts.isLabelName(node) && !ts.isTagName(node); - case 194 /* PropertyAccessExpression */: - case 153 /* QualifiedName */: + case 195 /* PropertyAccessExpression */: + case 154 /* QualifiedName */: // Don't return quickInfo if inside the comment in `a/**/.b` return !ts.isInComment(sourceFile, position); case 104 /* ThisKeyword */: - case 183 /* ThisType */: + case 184 /* ThisType */: case 102 /* SuperKeyword */: return true; default: @@ -137117,15 +137780,15 @@ var ts; return undefined; } switch (node.kind) { - case 194 /* PropertyAccessExpression */: - case 153 /* QualifiedName */: + case 195 /* PropertyAccessExpression */: + case 154 /* QualifiedName */: case 10 /* StringLiteral */: case 91 /* FalseKeyword */: case 106 /* TrueKeyword */: case 100 /* NullKeyword */: case 102 /* SuperKeyword */: case 104 /* ThisKeyword */: - case 183 /* ThisType */: + case 184 /* ThisType */: case 75 /* Identifier */: break; // Cant create the text span @@ -137142,7 +137805,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 249 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 250 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -137619,7 +138282,7 @@ var ts; */ function literalIsName(node) { return ts.isDeclarationName(node) || - node.parent.kind === 265 /* ExternalModuleReference */ || + node.parent.kind === 266 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node); } @@ -137637,13 +138300,13 @@ var ts; case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: - if (node.parent.kind === 154 /* ComputedPropertyName */) { + if (node.parent.kind === 155 /* ComputedPropertyName */) { return ts.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; } // falls through case 75 /* Identifier */: return ts.isObjectLiteralElement(node.parent) && - (node.parent.parent.kind === 193 /* ObjectLiteralExpression */ || node.parent.parent.kind === 274 /* JsxAttributes */) && + (node.parent.parent.kind === 194 /* ObjectLiteralExpression */ || node.parent.parent.kind === 275 /* JsxAttributes */) && node.parent.name === node ? node.parent : undefined; } return undefined; @@ -137685,7 +138348,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 195 /* ElementAccessExpression */ && + node.parent.kind === 196 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /** @@ -137765,114 +138428,114 @@ var ts; if (node) { var parent = node.parent; switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 242 /* VariableDeclaration */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 243 /* VariableDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return spanInVariableDeclaration(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return spanInParameterDeclaration(node); - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 162 /* Constructor */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 163 /* Constructor */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 223 /* Block */: + case 224 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // falls through - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return spanInBlock(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return spanInBlock(node.block); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: // Span on while(...) return textSpanEndingAtNextToken(node, node.expression); - case 228 /* DoStatement */: + case 229 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 241 /* DebuggerStatement */: + case 242 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 227 /* IfStatement */: + case 228 /* IfStatement */: // set on if(..) span return textSpanEndingAtNextToken(node, node.expression); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return spanInForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: // span of for (a in ...) return textSpanEndingAtNextToken(node, node.expression); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: // span in initializer return spanInInitializerOfForLike(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: // span on switch(...) return textSpanEndingAtNextToken(node, node.expression); - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 240 /* TryStatement */: + case 241 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } // falls through - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 191 /* BindingElement */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 192 /* BindingElement */: // span on complete node return textSpan(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 157 /* Decorator */: + case 158 /* Decorator */: return spanInNodeArray(parent.decorators); - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: return undefined; // Tokens: case 26 /* SemicolonToken */: @@ -137902,7 +138565,7 @@ var ts; case 79 /* CatchKeyword */: case 92 /* FinallyKeyword */: return spanInNextNode(node); - case 152 /* OfKeyword */: + case 153 /* OfKeyword */: return spanInOfKeyword(node); default: // Destructuring pattern in destructuring assignment @@ -137915,13 +138578,13 @@ var ts; // `a` or `...c` or `d: x` from // `[a, b, ...c]` or `{ a, b }` or `{ d: x }` from destructuring pattern if ((node.kind === 75 /* Identifier */ || - node.kind === 213 /* SpreadElement */ || - node.kind === 281 /* PropertyAssignment */ || - node.kind === 282 /* ShorthandPropertyAssignment */) && + node.kind === 214 /* SpreadElement */ || + node.kind === 282 /* PropertyAssignment */ || + node.kind === 283 /* ShorthandPropertyAssignment */) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(parent)) { return textSpan(node); } - if (node.kind === 209 /* BinaryExpression */) { + if (node.kind === 210 /* BinaryExpression */) { var _a = node, left = _a.left, operatorToken = _a.operatorToken; // Set breakpoint in destructuring pattern if its destructuring assignment // [a, b, c] or {a, b, c} of @@ -137943,22 +138606,22 @@ var ts; } if (ts.isExpressionNode(node)) { switch (parent.kind) { - case 228 /* DoStatement */: + case 229 /* DoStatement */: // Set span as if on while keyword return spanInPreviousNode(node); - case 157 /* Decorator */: + case 158 /* Decorator */: // Set breakpoint on the decorator emit return spanInNode(node.parent); - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: return textSpan(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (node.parent.operatorToken.kind === 27 /* CommaToken */) { // If this is a comma expression, the breakpoint is possible in this expression return textSpan(node); } break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: if (node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); @@ -137967,21 +138630,21 @@ var ts; } } switch (node.parent.kind) { - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // If this is name of property assignment, set breakpoint in the initializer if (node.parent.name === node && !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } break; - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: // Breakpoint in type assertion goes to its operand if (node.parent.type === node) { return spanInNextNode(node.parent.type); } break; - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: { + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: { // initializer of variable/parameter declaration go to previous node var _b = node.parent, initializer = _b.initializer, type = _b.type; if (initializer === node || type === node || ts.isAssignmentOperator(node.kind)) { @@ -137989,7 +138652,7 @@ var ts; } break; } - case 209 /* BinaryExpression */: { + case 210 /* BinaryExpression */: { var left = node.parent.left; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { // If initializer of destructuring assignment move to previous token @@ -138019,7 +138682,7 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 231 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 232 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } var parent = variableDeclaration.parent; @@ -138031,7 +138694,7 @@ var ts; // or its declaration from 'for of' if (variableDeclaration.initializer || ts.hasModifier(variableDeclaration, 1 /* Export */) || - parent.parent.kind === 232 /* ForOfStatement */) { + parent.parent.kind === 233 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } if (ts.isVariableDeclarationList(variableDeclaration.parent) && @@ -138072,7 +138735,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasModifier(functionDeclaration, 1 /* Export */) || - (functionDeclaration.parent.kind === 245 /* ClassDeclaration */ && functionDeclaration.kind !== 162 /* Constructor */); + (functionDeclaration.parent.kind === 246 /* ClassDeclaration */ && functionDeclaration.kind !== 163 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -138095,26 +138758,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // Set on parent if on same line otherwise on first statement // falls through - case 229 /* WhileStatement */: - case 227 /* IfStatement */: - case 231 /* ForInStatement */: + case 230 /* WhileStatement */: + case 228 /* IfStatement */: + case 232 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 243 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 244 /* VariableDeclarationList */) { // Declaration list - set breakpoint in first declaration var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -138139,21 +138802,21 @@ var ts; } function spanInBindingPattern(bindingPattern) { // Set breakpoint in first binding element - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 215 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 216 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } // Empty binding pattern of binding element, set breakpoint on binding element - if (bindingPattern.parent.kind === 191 /* BindingElement */) { + if (bindingPattern.parent.kind === 192 /* BindingElement */) { return textSpan(bindingPattern.parent); } // Variable declaration is used as the span return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 190 /* ArrayBindingPattern */ && node.kind !== 189 /* ObjectBindingPattern */); - var elements = node.kind === 192 /* ArrayLiteralExpression */ ? node.elements : node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 215 /* OmittedExpression */ ? element : undefined; }); + ts.Debug.assert(node.kind !== 191 /* ArrayBindingPattern */ && node.kind !== 190 /* ObjectBindingPattern */); + var elements = node.kind === 193 /* ArrayLiteralExpression */ ? node.elements : node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 216 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } @@ -138161,18 +138824,18 @@ var ts; // just nested element in another destructuring assignment // set breakpoint on assignment when parent is destructuring assignment // Otherwise set breakpoint for this element - return textSpan(node.parent.kind === 209 /* BinaryExpression */ ? node.parent : node); + return textSpan(node.parent.kind === 210 /* BinaryExpression */ ? node.parent : node); } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -138180,25 +138843,25 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: // If this is not an instantiated module block, no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } // falls through - case 248 /* EnumDeclaration */: - case 245 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 246 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 223 /* Block */: + case 224 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // falls through - case 280 /* CatchClause */: + case 281 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -138206,7 +138869,7 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -138222,7 +138885,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -138237,12 +138900,12 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 228 /* DoStatement */ || // Go to while keyword and do action instead - node.parent.kind === 196 /* CallExpression */ || - node.parent.kind === 197 /* NewExpression */) { + if (node.parent.kind === 229 /* DoStatement */ || // Go to while keyword and do action instead + node.parent.kind === 197 /* CallExpression */ || + node.parent.kind === 198 /* NewExpression */) { return spanInPreviousNode(node); } - if (node.parent.kind === 200 /* ParenthesizedExpression */) { + if (node.parent.kind === 201 /* ParenthesizedExpression */) { return spanInNextNode(node); } // Default to parent node @@ -138251,21 +138914,21 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 162 /* Constructor */: - case 229 /* WhileStatement */: - case 228 /* DoStatement */: - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 200 /* ParenthesizedExpression */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 163 /* Constructor */: + case 230 /* WhileStatement */: + case 229 /* DoStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 201 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -138275,20 +138938,20 @@ var ts; function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration if (ts.isFunctionLike(node.parent) || - node.parent.kind === 281 /* PropertyAssignment */ || - node.parent.kind === 156 /* Parameter */) { + node.parent.kind === 282 /* PropertyAssignment */ || + node.parent.kind === 157 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 199 /* TypeAssertionExpression */) { + if (node.parent.kind === 200 /* TypeAssertionExpression */) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 228 /* DoStatement */) { + if (node.parent.kind === 229 /* DoStatement */) { // Set span on while expression return textSpanEndingAtNextToken(node, node.parent.expression); } @@ -138296,7 +138959,7 @@ var ts; return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 232 /* ForOfStatement */) { + if (node.parent.kind === 233 /* ForOfStatement */) { // Set using next token return spanInNextNode(node); } diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js index 27253a5adb0b4..b3343dddd59e2 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -3042,233 +3042,234 @@ var ts; SyntaxKind[SyntaxKind["AnyKeyword"] = 125] = "AnyKeyword"; SyntaxKind[SyntaxKind["AsyncKeyword"] = 126] = "AsyncKeyword"; SyntaxKind[SyntaxKind["AwaitKeyword"] = 127] = "AwaitKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 128] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 129] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 130] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 131] = "GetKeyword"; - SyntaxKind[SyntaxKind["InferKeyword"] = 132] = "InferKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 133] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 134] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 135] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 136] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 137] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 138] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 139] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 140] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 141] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 142] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 143] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 144] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 145] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 146] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 147] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["UnknownKeyword"] = 148] = "UnknownKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 149] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 150] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["BigIntKeyword"] = 151] = "BigIntKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 152] = "OfKeyword"; + SyntaxKind[SyntaxKind["AwaitedKeyword"] = 128] = "AwaitedKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 129] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 130] = "ConstructorKeyword"; + SyntaxKind[SyntaxKind["DeclareKeyword"] = 131] = "DeclareKeyword"; + SyntaxKind[SyntaxKind["GetKeyword"] = 132] = "GetKeyword"; + SyntaxKind[SyntaxKind["InferKeyword"] = 133] = "InferKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 134] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 135] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 136] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 137] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 138] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 139] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 140] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 141] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 142] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 143] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 144] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 145] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 146] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 147] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 148] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["UnknownKeyword"] = 149] = "UnknownKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 150] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 151] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["BigIntKeyword"] = 152] = "BigIntKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 153] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 153] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 154] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 154] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 155] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 155] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 156] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 157] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 156] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 157] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 158] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 158] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 159] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 160] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 161] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 162] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 163] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 164] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 165] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 166] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 167] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 159] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 160] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 161] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 162] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 163] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 164] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 165] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 166] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 167] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 168] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 168] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 169] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 170] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 171] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 172] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 173] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 174] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 175] = "TupleType"; - SyntaxKind[SyntaxKind["OptionalType"] = 176] = "OptionalType"; - SyntaxKind[SyntaxKind["RestType"] = 177] = "RestType"; - SyntaxKind[SyntaxKind["UnionType"] = 178] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 179] = "IntersectionType"; - SyntaxKind[SyntaxKind["ConditionalType"] = 180] = "ConditionalType"; - SyntaxKind[SyntaxKind["InferType"] = 181] = "InferType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 182] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 183] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 184] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 185] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 186] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 187] = "LiteralType"; - SyntaxKind[SyntaxKind["ImportType"] = 188] = "ImportType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 169] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 170] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 171] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 172] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 173] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 174] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 175] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 176] = "TupleType"; + SyntaxKind[SyntaxKind["OptionalType"] = 177] = "OptionalType"; + SyntaxKind[SyntaxKind["RestType"] = 178] = "RestType"; + SyntaxKind[SyntaxKind["UnionType"] = 179] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 180] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 181] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 182] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 183] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 184] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 185] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 186] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 187] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 188] = "LiteralType"; + SyntaxKind[SyntaxKind["ImportType"] = 189] = "ImportType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 189] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 190] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 191] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 190] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 191] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 192] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 192] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 193] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 194] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 195] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 196] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 197] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 198] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 199] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 200] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 201] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 202] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 203] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 204] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 205] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 206] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 207] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 208] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 209] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 210] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 211] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 212] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 213] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 214] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 215] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 216] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 217] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 218] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 219] = "MetaProperty"; - SyntaxKind[SyntaxKind["SyntheticExpression"] = 220] = "SyntheticExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 193] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 194] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 195] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 196] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 197] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 198] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 199] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 200] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 201] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 202] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 203] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 204] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 205] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 206] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 207] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 208] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 209] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 210] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 211] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 212] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 213] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 214] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 215] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 216] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 217] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 218] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 219] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 220] = "MetaProperty"; + SyntaxKind[SyntaxKind["SyntheticExpression"] = 221] = "SyntheticExpression"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 221] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 222] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 222] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 223] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 223] = "Block"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 224] = "EmptyStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 225] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 226] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 227] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 228] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 229] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 230] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 231] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 232] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 233] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 234] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 235] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 236] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 237] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 238] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 239] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 240] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 241] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 242] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 243] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 244] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 245] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 246] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 247] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 248] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 249] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 250] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 251] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 252] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 253] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 254] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 255] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 256] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 257] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 258] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 259] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 260] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 261] = "NamedExports"; - SyntaxKind[SyntaxKind["NamespaceExport"] = 262] = "NamespaceExport"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 263] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 264] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 224] = "Block"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 225] = "EmptyStatement"; + SyntaxKind[SyntaxKind["VariableStatement"] = 226] = "VariableStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 227] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 228] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 229] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 230] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 231] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 232] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 233] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 234] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 235] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 236] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 237] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 238] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 239] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 240] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 241] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 242] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 243] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 244] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 245] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 246] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 247] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 248] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 249] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 250] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 251] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 252] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 253] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 254] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 255] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 256] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 257] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 258] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 259] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 260] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 261] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 262] = "NamedExports"; + SyntaxKind[SyntaxKind["NamespaceExport"] = 263] = "NamespaceExport"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 264] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 265] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 265] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 266] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 266] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 267] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 268] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 269] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 270] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 271] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 272] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 273] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 274] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 275] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 276] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 267] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 268] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 269] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 270] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 271] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 272] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 273] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 274] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 275] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 276] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 277] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 277] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 278] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 279] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 280] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 278] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 279] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 280] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 281] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 281] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 282] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 283] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 282] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 283] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 284] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 284] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 285] = "EnumMember"; // Unparsed - SyntaxKind[SyntaxKind["UnparsedPrologue"] = 285] = "UnparsedPrologue"; - SyntaxKind[SyntaxKind["UnparsedPrepend"] = 286] = "UnparsedPrepend"; - SyntaxKind[SyntaxKind["UnparsedText"] = 287] = "UnparsedText"; - SyntaxKind[SyntaxKind["UnparsedInternalText"] = 288] = "UnparsedInternalText"; - SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 289] = "UnparsedSyntheticReference"; + SyntaxKind[SyntaxKind["UnparsedPrologue"] = 286] = "UnparsedPrologue"; + SyntaxKind[SyntaxKind["UnparsedPrepend"] = 287] = "UnparsedPrepend"; + SyntaxKind[SyntaxKind["UnparsedText"] = 288] = "UnparsedText"; + SyntaxKind[SyntaxKind["UnparsedInternalText"] = 289] = "UnparsedInternalText"; + SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 290] = "UnparsedSyntheticReference"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 290] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 291] = "Bundle"; - SyntaxKind[SyntaxKind["UnparsedSource"] = 292] = "UnparsedSource"; - SyntaxKind[SyntaxKind["InputFiles"] = 293] = "InputFiles"; + SyntaxKind[SyntaxKind["SourceFile"] = 291] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 292] = "Bundle"; + SyntaxKind[SyntaxKind["UnparsedSource"] = 293] = "UnparsedSource"; + SyntaxKind[SyntaxKind["InputFiles"] = 294] = "InputFiles"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 294] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 295] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 295] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 296] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 296] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 297] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 298] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 299] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 300] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 301] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 297] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 298] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 299] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 300] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 301] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 302] = "JSDocVariadicType"; // https://jsdoc.app/about-namepaths.html - SyntaxKind[SyntaxKind["JSDocNamepathType"] = 302] = "JSDocNamepathType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 303] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 304] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocSignature"] = 305] = "JSDocSignature"; - SyntaxKind[SyntaxKind["JSDocTag"] = 306] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 307] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 308] = "JSDocImplementsTag"; - SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 309] = "JSDocAuthorTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 310] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocPublicTag"] = 311] = "JSDocPublicTag"; - SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 312] = "JSDocPrivateTag"; - SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 313] = "JSDocProtectedTag"; - SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 314] = "JSDocReadonlyTag"; - SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 315] = "JSDocCallbackTag"; - SyntaxKind[SyntaxKind["JSDocEnumTag"] = 316] = "JSDocEnumTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 317] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 318] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocThisTag"] = 319] = "JSDocThisTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 320] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 321] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 322] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 323] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocNamepathType"] = 303] = "JSDocNamepathType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 304] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 305] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocSignature"] = 306] = "JSDocSignature"; + SyntaxKind[SyntaxKind["JSDocTag"] = 307] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 308] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 309] = "JSDocImplementsTag"; + SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 310] = "JSDocAuthorTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 311] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocPublicTag"] = 312] = "JSDocPublicTag"; + SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 313] = "JSDocPrivateTag"; + SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 314] = "JSDocProtectedTag"; + SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 315] = "JSDocReadonlyTag"; + SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 316] = "JSDocCallbackTag"; + SyntaxKind[SyntaxKind["JSDocEnumTag"] = 317] = "JSDocEnumTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 318] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 319] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocThisTag"] = 320] = "JSDocThisTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 321] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 322] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 323] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 324] = "JSDocPropertyTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 324] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 325] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 325] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 326] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 327] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 328] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 329] = "EndOfDeclarationMarker"; - SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 330] = "SyntheticReferenceExpression"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 326] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 327] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 328] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 329] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 330] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 331] = "SyntheticReferenceExpression"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 331] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 332] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 62] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 74] = "LastAssignment"; @@ -3277,15 +3278,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 77] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 112] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 77] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 152] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 153] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 113] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 121] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 168] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 188] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 169] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 189] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 18] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 74] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 152] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 153] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -3294,15 +3295,15 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 17] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 29] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 74] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstStatement"] = 225] = "FirstStatement"; - SyntaxKind[SyntaxKind["LastStatement"] = 241] = "LastStatement"; - SyntaxKind[SyntaxKind["FirstNode"] = 153] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 294] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 323] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 306] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 323] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstStatement"] = 226] = "FirstStatement"; + SyntaxKind[SyntaxKind["LastStatement"] = 242] = "LastStatement"; + SyntaxKind[SyntaxKind["FirstNode"] = 154] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 295] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 324] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 307] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 324] = "LastJSDocTagNode"; /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 122] = "FirstContextualKeyword"; - /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 152] = "LastContextualKeyword"; + /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 153] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -3458,6 +3459,12 @@ var ts; FlowFlags[FlowFlags["Label"] = 12] = "Label"; FlowFlags[FlowFlags["Condition"] = 96] = "Condition"; })(FlowFlags = ts.FlowFlags || (ts.FlowFlags = {})); + /* @internal */ + var CommentDirectiveType; + (function (CommentDirectiveType) { + CommentDirectiveType[CommentDirectiveType["ExpectError"] = 0] = "ExpectError"; + CommentDirectiveType[CommentDirectiveType["Ignore"] = 1] = "Ignore"; + })(CommentDirectiveType = ts.CommentDirectiveType || (ts.CommentDirectiveType = {})); var OperationCanceledException = /** @class */ (function () { function OperationCanceledException() { } @@ -3842,6 +3849,7 @@ var ts; TypeFlags[TypeFlags["Conditional"] = 16777216] = "Conditional"; TypeFlags[TypeFlags["Substitution"] = 33554432] = "Substitution"; TypeFlags[TypeFlags["NonPrimitive"] = 67108864] = "NonPrimitive"; + TypeFlags[TypeFlags["Awaited"] = 134217728] = "Awaited"; /* @internal */ TypeFlags[TypeFlags["AnyOrUnknown"] = 3] = "AnyOrUnknown"; /* @internal */ @@ -3870,10 +3878,10 @@ var ts; TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType"; TypeFlags[TypeFlags["TypeVariable"] = 8650752] = "TypeVariable"; - TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 58982400] = "InstantiableNonPrimitive"; + TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 193200128] = "InstantiableNonPrimitive"; TypeFlags[TypeFlags["InstantiablePrimitive"] = 4194304] = "InstantiablePrimitive"; - TypeFlags[TypeFlags["Instantiable"] = 63176704] = "Instantiable"; - TypeFlags[TypeFlags["StructuredOrInstantiable"] = 66846720] = "StructuredOrInstantiable"; + TypeFlags[TypeFlags["Instantiable"] = 197394432] = "Instantiable"; + TypeFlags[TypeFlags["StructuredOrInstantiable"] = 201064448] = "StructuredOrInstantiable"; /* @internal */ TypeFlags[TypeFlags["ObjectFlagsType"] = 3899393] = "ObjectFlagsType"; /* @internal */ @@ -3882,10 +3890,10 @@ var ts; TypeFlags[TypeFlags["Substructure"] = 66584576] = "Substructure"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 133970943] = "Narrowable"; + TypeFlags[TypeFlags["Narrowable"] = 268188671] = "Narrowable"; TypeFlags[TypeFlags["NotUnionOrUnit"] = 67637251] = "NotUnionOrUnit"; /* @internal */ - TypeFlags[TypeFlags["NotPrimitiveUnion"] = 66994211] = "NotPrimitiveUnion"; + TypeFlags[TypeFlags["NotPrimitiveUnion"] = 201211939] = "NotPrimitiveUnion"; // The following flags are aggregated during union and intersection type construction /* @internal */ TypeFlags[TypeFlags["IncludesMask"] = 71041023] = "IncludesMask"; @@ -3984,6 +3992,7 @@ var ts; SignatureFlags[SignatureFlags["HasLiteralTypes"] = 2] = "HasLiteralTypes"; SignatureFlags[SignatureFlags["IsInnerCallChain"] = 4] = "IsInnerCallChain"; SignatureFlags[SignatureFlags["IsOuterCallChain"] = 8] = "IsOuterCallChain"; + SignatureFlags[SignatureFlags["IsUntypedSignatureInJSFile"] = 16] = "IsUntypedSignatureInJSFile"; // We do not propagate `IsInnerCallChain` to instantiated signatures, as that would result in us // attempting to add `| undefined` on each recursive call to `getReturnTypeOfSignature` when // instantiating the return type. @@ -3995,6 +4004,15 @@ var ts; IndexKind[IndexKind["String"] = 0] = "String"; IndexKind[IndexKind["Number"] = 1] = "Number"; })(IndexKind = ts.IndexKind || (ts.IndexKind = {})); + /* @internal */ + var TypeMapKind; + (function (TypeMapKind) { + TypeMapKind[TypeMapKind["Simple"] = 0] = "Simple"; + TypeMapKind[TypeMapKind["Array"] = 1] = "Array"; + TypeMapKind[TypeMapKind["Function"] = 2] = "Function"; + TypeMapKind[TypeMapKind["Composite"] = 3] = "Composite"; + TypeMapKind[TypeMapKind["Merged"] = 4] = "Merged"; + })(TypeMapKind = ts.TypeMapKind || (ts.TypeMapKind = {})); var InferencePriority; (function (InferencePriority) { InferencePriority[InferencePriority["NakedTypeVariable"] = 1] = "NakedTypeVariable"; @@ -6588,6 +6606,10 @@ var ts; } } ts.forEachAncestorDirectory = forEachAncestorDirectory; + function isNodeModulesDirectory(dirPath) { + return ts.endsWith(dirPath, "/node_modules"); + } + ts.isNodeModulesDirectory = isNodeModulesDirectory; })(ts || (ts = {})); // // generated from './diagnosticInformationMap.generated.ts' by 'src/compiler' @@ -6898,7 +6920,7 @@ var ts; Cannot_find_name_0: diag(2304, ts.DiagnosticCategory.Error, "Cannot_find_name_0_2304", "Cannot find name '{0}'."), Module_0_has_no_exported_member_1: diag(2305, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_2305", "Module '{0}' has no exported member '{1}'."), File_0_is_not_a_module: diag(2306, ts.DiagnosticCategory.Error, "File_0_is_not_a_module_2306", "File '{0}' is not a module."), - Cannot_find_module_0: diag(2307, ts.DiagnosticCategory.Error, "Cannot_find_module_0_2307", "Cannot find module '{0}'."), + Cannot_find_module_0_or_its_corresponding_type_declarations: diag(2307, ts.DiagnosticCategory.Error, "Cannot_find_module_0_or_its_corresponding_type_declarations_2307", "Cannot find module '{0}' or its corresponding type declarations."), Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: diag(2308, ts.DiagnosticCategory.Error, "Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308", "Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."), An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: diag(2309, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", "An export assignment cannot be used in a module with other exported elements."), Type_0_recursively_references_itself_as_a_base_type: diag(2310, ts.DiagnosticCategory.Error, "Type_0_recursively_references_itself_as_a_base_type_2310", "Type '{0}' recursively references itself as a base type."), @@ -7158,6 +7180,7 @@ var ts; No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments: diag(2575, ts.DiagnosticCategory.Error, "No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575", "No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."), Property_0_is_a_static_member_of_type_1: diag(2576, ts.DiagnosticCategory.Error, "Property_0_is_a_static_member_of_type_1_2576", "Property '{0}' is a static member of type '{1}'"), Return_type_annotation_circularly_references_itself: diag(2577, ts.DiagnosticCategory.Error, "Return_type_annotation_circularly_references_itself_2577", "Return type annotation circularly references itself."), + Unused_ts_expect_error_directive: diag(2578, ts.DiagnosticCategory.Error, "Unused_ts_expect_error_directive_2578", "Unused '@ts-expect-error' directive."), Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`."), Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`."), Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`."), @@ -7286,7 +7309,7 @@ var ts; This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided: diag(2746, ts.DiagnosticCategory.Error, "This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746", "This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."), _0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2: diag(2747, ts.DiagnosticCategory.Error, "_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747", "'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."), Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided: diag(2748, ts.DiagnosticCategory.Error, "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748", "Cannot access ambient const enums when the '--isolatedModules' flag is provided."), - _0_refers_to_a_value_but_is_being_used_as_a_type_here: diag(2749, ts.DiagnosticCategory.Error, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_2749", "'{0}' refers to a value, but is being used as a type here."), + _0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0: diag(2749, ts.DiagnosticCategory.Error, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749", "'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"), The_implementation_signature_is_declared_here: diag(2750, ts.DiagnosticCategory.Error, "The_implementation_signature_is_declared_here_2750", "The implementation signature is declared here."), Circularity_originates_in_type_at_this_location: diag(2751, ts.DiagnosticCategory.Error, "Circularity_originates_in_type_at_this_location_2751", "Circularity originates in type at this location."), The_first_export_default_is_here: diag(2752, ts.DiagnosticCategory.Error, "The_first_export_default_is_here_2752", "The first export default is here."), @@ -7321,6 +7344,7 @@ var ts; The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access: diag(2781, ts.DiagnosticCategory.Error, "The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781", "The left-hand side of a 'for...of' statement may not be an optional property access."), _0_needs_an_explicit_type_annotation: diag(2782, ts.DiagnosticCategory.Message, "_0_needs_an_explicit_type_annotation_2782", "'{0}' needs an explicit type annotation."), _0_is_specified_more_than_once_so_this_usage_will_be_overwritten: diag(2783, ts.DiagnosticCategory.Error, "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783", "'{0}' is specified more than once, so this usage will be overwritten."), + get_and_set_accessors_cannot_declare_this_parameters: diag(2784, ts.DiagnosticCategory.Error, "get_and_set_accessors_cannot_declare_this_parameters_2784", "'get' and 'set' accessors cannot declare 'this' parameters."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -7455,6 +7479,7 @@ var ts; Unknown_watch_option_0_Did_you_mean_1: diag(5079, ts.DiagnosticCategory.Error, "Unknown_watch_option_0_Did_you_mean_1_5079", "Unknown watch option '{0}'. Did you mean '{1}'?"), Watch_option_0_requires_a_value_of_type_1: diag(5080, ts.DiagnosticCategory.Error, "Watch_option_0_requires_a_value_of_type_1_5080", "Watch option '{0}' requires a value of type {1}."), Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0: diag(5081, ts.DiagnosticCategory.Error, "Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081", "Cannot find a tsconfig.json file at the current directory: {0}."), + _0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1: diag(5082, ts.DiagnosticCategory.Error, "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082", "'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6000, ts.DiagnosticCategory.Message, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, ts.DiagnosticCategory.Message, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, ts.DiagnosticCategory.Message, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -7867,6 +7892,7 @@ var ts; Import_default_0_from_module_1: diag(90032, ts.DiagnosticCategory.Message, "Import_default_0_from_module_1_90032", "Import default '{0}' from module \"{1}\""), Add_default_import_0_to_existing_import_declaration_from_1: diag(90033, ts.DiagnosticCategory.Message, "Add_default_import_0_to_existing_import_declaration_from_1_90033", "Add default import '{0}' to existing import declaration from \"{1}\""), Add_parameter_name: diag(90034, ts.DiagnosticCategory.Message, "Add_parameter_name_90034", "Add parameter name"), + Declare_private_property_0: diag(90035, ts.DiagnosticCategory.Message, "Declare_private_property_0_90035", "Declare private property '{0}'"), Declare_a_private_field_named_0: diag(90053, ts.DiagnosticCategory.Message, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), @@ -7932,6 +7958,8 @@ var ts; Add_all_missing_imports: diag(95064, ts.DiagnosticCategory.Message, "Add_all_missing_imports_95064", "Add all missing imports"), Convert_to_async_function: diag(95065, ts.DiagnosticCategory.Message, "Convert_to_async_function_95065", "Convert to async function"), Convert_all_to_async_functions: diag(95066, ts.DiagnosticCategory.Message, "Convert_all_to_async_functions_95066", "Convert all to async functions"), + Add_missing_call_parentheses: diag(95067, ts.DiagnosticCategory.Message, "Add_missing_call_parentheses_95067", "Add missing call parentheses"), + Add_all_missing_call_parentheses: diag(95068, ts.DiagnosticCategory.Message, "Add_all_missing_call_parentheses_95068", "Add all missing call parentheses"), Add_unknown_conversion_for_non_overlapping_types: diag(95069, ts.DiagnosticCategory.Message, "Add_unknown_conversion_for_non_overlapping_types_95069", "Add 'unknown' conversion for non-overlapping types"), Add_unknown_to_all_conversions_of_non_overlapping_types: diag(95070, ts.DiagnosticCategory.Message, "Add_unknown_to_all_conversions_of_non_overlapping_types_95070", "Add 'unknown' to all conversions of non-overlapping types"), Add_missing_new_operator_to_call: diag(95071, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_call_95071", "Add missing 'new' operator to call"), @@ -8007,8 +8035,8 @@ var ts; any: 125 /* AnyKeyword */, as: 123 /* AsKeyword */, asserts: 124 /* AssertsKeyword */, - bigint: 151 /* BigIntKeyword */, - boolean: 128 /* BooleanKeyword */, + bigint: 152 /* BigIntKeyword */, + boolean: 129 /* BooleanKeyword */, break: 77 /* BreakKeyword */, case: 78 /* CaseKeyword */, catch: 79 /* CatchKeyword */, @@ -8016,9 +8044,9 @@ var ts; continue: 82 /* ContinueKeyword */, const: 81 /* ConstKeyword */ }, - _a["" + "constructor"] = 129 /* ConstructorKeyword */, + _a["" + "constructor"] = 130 /* ConstructorKeyword */, _a.debugger = 83 /* DebuggerKeyword */, - _a.declare = 130 /* DeclareKeyword */, + _a.declare = 131 /* DeclareKeyword */, _a.default = 84 /* DefaultKeyword */, _a.delete = 85 /* DeleteKeyword */, _a.do = 86 /* DoKeyword */, @@ -8029,49 +8057,49 @@ var ts; _a.false = 91 /* FalseKeyword */, _a.finally = 92 /* FinallyKeyword */, _a.for = 93 /* ForKeyword */, - _a.from = 149 /* FromKeyword */, + _a.from = 150 /* FromKeyword */, _a.function = 94 /* FunctionKeyword */, - _a.get = 131 /* GetKeyword */, + _a.get = 132 /* GetKeyword */, _a.if = 95 /* IfKeyword */, _a.implements = 113 /* ImplementsKeyword */, _a.import = 96 /* ImportKeyword */, _a.in = 97 /* InKeyword */, - _a.infer = 132 /* InferKeyword */, + _a.infer = 133 /* InferKeyword */, _a.instanceof = 98 /* InstanceOfKeyword */, _a.interface = 114 /* InterfaceKeyword */, - _a.is = 133 /* IsKeyword */, - _a.keyof = 134 /* KeyOfKeyword */, + _a.is = 134 /* IsKeyword */, + _a.keyof = 135 /* KeyOfKeyword */, _a.let = 115 /* LetKeyword */, - _a.module = 135 /* ModuleKeyword */, - _a.namespace = 136 /* NamespaceKeyword */, - _a.never = 137 /* NeverKeyword */, + _a.module = 136 /* ModuleKeyword */, + _a.namespace = 137 /* NamespaceKeyword */, + _a.never = 138 /* NeverKeyword */, _a.new = 99 /* NewKeyword */, _a.null = 100 /* NullKeyword */, - _a.number = 140 /* NumberKeyword */, - _a.object = 141 /* ObjectKeyword */, + _a.number = 141 /* NumberKeyword */, + _a.object = 142 /* ObjectKeyword */, _a.package = 116 /* PackageKeyword */, _a.private = 117 /* PrivateKeyword */, _a.protected = 118 /* ProtectedKeyword */, _a.public = 119 /* PublicKeyword */, - _a.readonly = 138 /* ReadonlyKeyword */, - _a.require = 139 /* RequireKeyword */, - _a.global = 150 /* GlobalKeyword */, + _a.readonly = 139 /* ReadonlyKeyword */, + _a.require = 140 /* RequireKeyword */, + _a.global = 151 /* GlobalKeyword */, _a.return = 101 /* ReturnKeyword */, - _a.set = 142 /* SetKeyword */, + _a.set = 143 /* SetKeyword */, _a.static = 120 /* StaticKeyword */, - _a.string = 143 /* StringKeyword */, + _a.string = 144 /* StringKeyword */, _a.super = 102 /* SuperKeyword */, _a.switch = 103 /* SwitchKeyword */, - _a.symbol = 144 /* SymbolKeyword */, + _a.symbol = 145 /* SymbolKeyword */, _a.this = 104 /* ThisKeyword */, _a.throw = 105 /* ThrowKeyword */, _a.true = 106 /* TrueKeyword */, _a.try = 107 /* TryKeyword */, - _a.type = 145 /* TypeKeyword */, + _a.type = 146 /* TypeKeyword */, _a.typeof = 108 /* TypeOfKeyword */, - _a.undefined = 146 /* UndefinedKeyword */, - _a.unique = 147 /* UniqueKeyword */, - _a.unknown = 148 /* UnknownKeyword */, + _a.undefined = 147 /* UndefinedKeyword */, + _a.unique = 148 /* UniqueKeyword */, + _a.unknown = 149 /* UnknownKeyword */, _a.var = 109 /* VarKeyword */, _a.void = 110 /* VoidKeyword */, _a.while = 111 /* WhileKeyword */, @@ -8079,7 +8107,8 @@ var ts; _a.yield = 121 /* YieldKeyword */, _a.async = 126 /* AsyncKeyword */, _a.await = 127 /* AwaitKeyword */, - _a.of = 152 /* OfKeyword */, + _a.awaited = 128 /* AwaitedKeyword */, + _a.of = 153 /* OfKeyword */, _a); var textToKeyword = ts.createMapFromTemplate(textToKeywordObj); var textToToken = ts.createMapFromTemplate(__assign(__assign({}, textToKeywordObj), { "{": 18 /* OpenBraceToken */, "}": 19 /* CloseBraceToken */, "(": 20 /* OpenParenToken */, ")": 21 /* CloseParenToken */, "[": 22 /* OpenBracketToken */, "]": 23 /* CloseBracketToken */, ".": 24 /* DotToken */, "...": 25 /* DotDotDotToken */, ";": 26 /* SemicolonToken */, ",": 27 /* CommaToken */, "<": 29 /* LessThanToken */, ">": 31 /* GreaterThanToken */, "<=": 32 /* LessThanEqualsToken */, ">=": 33 /* GreaterThanEqualsToken */, "==": 34 /* EqualsEqualsToken */, "!=": 35 /* ExclamationEqualsToken */, "===": 36 /* EqualsEqualsEqualsToken */, "!==": 37 /* ExclamationEqualsEqualsToken */, "=>": 38 /* EqualsGreaterThanToken */, "+": 39 /* PlusToken */, "-": 40 /* MinusToken */, "**": 42 /* AsteriskAsteriskToken */, "*": 41 /* AsteriskToken */, "/": 43 /* SlashToken */, "%": 44 /* PercentToken */, "++": 45 /* PlusPlusToken */, "--": 46 /* MinusMinusToken */, "<<": 47 /* LessThanLessThanToken */, ">": 48 /* GreaterThanGreaterThanToken */, ">>>": 49 /* GreaterThanGreaterThanGreaterThanToken */, "&": 50 /* AmpersandToken */, "|": 51 /* BarToken */, "^": 52 /* CaretToken */, "!": 53 /* ExclamationToken */, "~": 54 /* TildeToken */, "&&": 55 /* AmpersandAmpersandToken */, "||": 56 /* BarBarToken */, "?": 57 /* QuestionToken */, "??": 60 /* QuestionQuestionToken */, "?.": 28 /* QuestionDotToken */, ":": 58 /* ColonToken */, "=": 62 /* EqualsToken */, "+=": 63 /* PlusEqualsToken */, "-=": 64 /* MinusEqualsToken */, "*=": 65 /* AsteriskEqualsToken */, "**=": 66 /* AsteriskAsteriskEqualsToken */, "/=": 67 /* SlashEqualsToken */, "%=": 68 /* PercentEqualsToken */, "<<=": 69 /* LessThanLessThanEqualsToken */, ">>=": 70 /* GreaterThanGreaterThanEqualsToken */, ">>>=": 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */, "&=": 72 /* AmpersandEqualsToken */, "|=": 73 /* BarEqualsToken */, "^=": 74 /* CaretEqualsToken */, "@": 59 /* AtToken */, "`": 61 /* BacktickToken */ })); @@ -8137,6 +8166,10 @@ var ts; */ var unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 895, 895, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1488, 1514, 1519, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2144, 2154, 2208, 2228, 2230, 2237, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2432, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2556, 2556, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2809, 2809, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3133, 3160, 3162, 3168, 3169, 3200, 3200, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3412, 3414, 3423, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6264, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6430, 6480, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7401, 7404, 7406, 7411, 7413, 7414, 7418, 7418, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12443, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42653, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43261, 43262, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43488, 43492, 43494, 43503, 43514, 43518, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43646, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66335, 66349, 66378, 66384, 66421, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68096, 68112, 68115, 68117, 68119, 68121, 68149, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68324, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68899, 69376, 69404, 69415, 69415, 69424, 69445, 69600, 69622, 69635, 69687, 69763, 69807, 69840, 69864, 69891, 69926, 69956, 69956, 69968, 70002, 70006, 70006, 70019, 70066, 70081, 70084, 70106, 70106, 70108, 70108, 70144, 70161, 70163, 70187, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70366, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70461, 70461, 70480, 70480, 70493, 70497, 70656, 70708, 70727, 70730, 70751, 70751, 70784, 70831, 70852, 70853, 70855, 70855, 71040, 71086, 71128, 71131, 71168, 71215, 71236, 71236, 71296, 71338, 71352, 71352, 71424, 71450, 71680, 71723, 71840, 71903, 71935, 71935, 72096, 72103, 72106, 72144, 72161, 72161, 72163, 72163, 72192, 72192, 72203, 72242, 72250, 72250, 72272, 72272, 72284, 72329, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72750, 72768, 72768, 72818, 72847, 72960, 72966, 72968, 72969, 72971, 73008, 73030, 73030, 73056, 73061, 73063, 73064, 73066, 73097, 73112, 73112, 73440, 73458, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92880, 92909, 92928, 92975, 92992, 92995, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94032, 94032, 94099, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 123136, 123180, 123191, 123197, 123214, 123214, 123584, 123627, 124928, 125124, 125184, 125251, 125259, 125259, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101]; var unicodeESNextIdentifierPart = [48, 57, 65, 90, 95, 95, 97, 122, 170, 170, 181, 181, 183, 183, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 895, 895, 902, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1519, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2045, 2045, 2048, 2093, 2112, 2139, 2144, 2154, 2208, 2228, 2230, 2237, 2259, 2273, 2275, 2403, 2406, 2415, 2417, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2556, 2556, 2558, 2558, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2809, 2815, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3072, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3168, 3171, 3174, 3183, 3200, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3328, 3331, 3333, 3340, 3342, 3344, 3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3558, 3567, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4969, 4977, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6264, 6272, 6314, 6320, 6389, 6400, 6430, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6832, 6845, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418, 7424, 7673, 7675, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42737, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43047, 43072, 43123, 43136, 43205, 43216, 43225, 43232, 43255, 43259, 43259, 43261, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43488, 43518, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65071, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66045, 66045, 66176, 66204, 66208, 66256, 66272, 66272, 66304, 66335, 66349, 66378, 66384, 66426, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68099, 68101, 68102, 68108, 68115, 68117, 68119, 68121, 68149, 68152, 68154, 68159, 68159, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68326, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68903, 68912, 68921, 69376, 69404, 69415, 69415, 69424, 69456, 69600, 69622, 69632, 69702, 69734, 69743, 69759, 69818, 69840, 69864, 69872, 69881, 69888, 69940, 69942, 69951, 69956, 69958, 69968, 70003, 70006, 70006, 70016, 70084, 70089, 70092, 70096, 70106, 70108, 70108, 70144, 70161, 70163, 70199, 70206, 70206, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70378, 70384, 70393, 70400, 70403, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70459, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70730, 70736, 70745, 70750, 70751, 70784, 70853, 70855, 70855, 70864, 70873, 71040, 71093, 71096, 71104, 71128, 71133, 71168, 71232, 71236, 71236, 71248, 71257, 71296, 71352, 71360, 71369, 71424, 71450, 71453, 71467, 71472, 71481, 71680, 71738, 71840, 71913, 71935, 71935, 72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263, 72263, 72272, 72345, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72758, 72760, 72768, 72784, 72793, 72818, 72847, 72850, 72871, 72873, 72886, 72960, 72966, 72968, 72969, 72971, 73014, 73018, 73018, 73020, 73021, 73023, 73031, 73040, 73049, 73056, 73061, 73063, 73064, 73066, 73102, 73104, 73105, 73107, 73112, 73120, 73129, 73440, 73462, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 92880, 92909, 92912, 92916, 92928, 92982, 92992, 92995, 93008, 93017, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94031, 94087, 94095, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113821, 113822, 119141, 119145, 119149, 119154, 119163, 119170, 119173, 119179, 119210, 119213, 119362, 119364, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 120782, 120831, 121344, 121398, 121403, 121452, 121461, 121461, 121476, 121476, 121499, 121503, 121505, 121519, 122880, 122886, 122888, 122904, 122907, 122913, 122915, 122916, 122918, 122922, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123214, 123584, 123641, 124928, 125124, 125136, 125142, 125184, 125259, 125264, 125273, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 917760, 917999]; + /** + * Test for whether a comment's text contains a `@ts-expect-error` or `@ts-ignore` directive. + */ + var commentDirectiveRegEx = /^\s*\/\/\/?\s*@(ts-expect-error|ts-ignore)/; function lookupInUnicodeMap(code, map) { // Bail out quickly if it couldn't possibly be in the map. if (code < map[0]) { @@ -8703,6 +8736,7 @@ var ts; var token; var tokenValue; var tokenFlags; + var commentDirectives; var inJSDocType = 0; setText(text, start, length); var scanner = { @@ -8718,6 +8752,7 @@ var ts; isIdentifier: function () { return token === 75 /* Identifier */ || token > 112 /* LastReservedWord */; }, isReservedWord: function () { return token >= 77 /* FirstReservedWord */ && token <= 112 /* LastReservedWord */; }, isUnterminated: function () { return (tokenFlags & 4 /* Unterminated */) !== 0; }, + getCommentDirectives: function () { return commentDirectives; }, getTokenFlags: function () { return tokenFlags; }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, @@ -8733,6 +8768,7 @@ var ts; scanJsDocToken: scanJsDocToken, scan: scan, getText: getText, + clearCommentDirectives: clearCommentDirectives, setText: setText, setScriptTarget: setScriptTarget, setLanguageVariant: setLanguageVariant, @@ -9462,6 +9498,13 @@ var ts; } pos++; } + var type = getDirectiveFromComment(text.slice(tokenPos, pos)); + if (type !== undefined) { + commentDirectives = ts.append(commentDirectives, { + range: { pos: tokenPos, end: pos }, + type: type, + }); + } if (skipTrivia) { continue; } @@ -9816,6 +9859,19 @@ var ts; } return token; } + function getDirectiveFromComment(text) { + var match = commentDirectiveRegEx.exec(text); + if (!match) { + return undefined; + } + switch (match[1]) { + case "ts-expect-error": + return 0 /* ExpectError */; + case "ts-ignore": + return 1 /* Ignore */; + } + return undefined; + } /** * Unconditionally back up and scan a template expression portion. */ @@ -10055,6 +10111,7 @@ var ts; var saveToken = token; var saveTokenValue = tokenValue; var saveTokenFlags = tokenFlags; + var saveErrorExpectations = commentDirectives; setText(text, start, length); var result = callback(); end = saveEnd; @@ -10064,6 +10121,7 @@ var ts; token = saveToken; tokenValue = saveTokenValue; tokenFlags = saveTokenFlags; + commentDirectives = saveErrorExpectations; return result; } function lookAhead(callback) { @@ -10075,6 +10133,9 @@ var ts; function getText() { return text; } + function clearCommentDirectives() { + commentDirectives = undefined; + } function setText(newText, start, length) { text = newText || ""; end = length === undefined ? text.length : start + length; @@ -10382,9 +10443,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 155 /* TypeParameter */) { + if (d && d.kind === 156 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 246 /* InterfaceDeclaration */) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 247 /* InterfaceDeclaration */) { return current; } } @@ -10392,7 +10453,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node, parent) { - return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 162 /* Constructor */; + return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 163 /* Constructor */; } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -10422,14 +10483,14 @@ var ts; node = walkUpBindingElementsAndPatterns(node); } var flags = getFlags(node); - if (node.kind === 242 /* VariableDeclaration */) { + if (node.kind === 243 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 243 /* VariableDeclarationList */) { + if (node && node.kind === 244 /* VariableDeclarationList */) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 225 /* VariableStatement */) { + if (node && node.kind === 226 /* VariableStatement */) { flags |= getFlags(node); } return flags; @@ -10578,30 +10639,30 @@ var ts; } // Covers remaining cases (returning undefined if none match). switch (hostNode.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: var expr = hostNode.expression; - if (expr.kind === 209 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { + if (expr.kind === 210 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { expr = expr.left; } switch (expr.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return expr.name; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: var arg = expr.argumentExpression; if (isIdentifier(arg)) { return arg; } } break; - case 200 /* ParenthesizedExpression */: { + case 201 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 238 /* LabeledStatement */: { + case 239 /* LabeledStatement */: { if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -10638,16 +10699,16 @@ var ts; switch (declaration.kind) { case 75 /* Identifier */: return declaration; - case 323 /* JSDocPropertyTag */: - case 317 /* JSDocParameterTag */: { + case 324 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: { var name = declaration.name; - if (name.kind === 153 /* QualifiedName */) { + if (name.kind === 154 /* QualifiedName */) { return name.right; } break; } - case 196 /* CallExpression */: - case 209 /* BinaryExpression */: { + case 197 /* CallExpression */: + case 210 /* BinaryExpression */: { var expr_1 = declaration; switch (ts.getAssignmentDeclarationKind(expr_1)) { case 1 /* ExportsProperty */: @@ -10663,15 +10724,15 @@ var ts; return undefined; } } - case 322 /* JSDocTypedefTag */: + case 323 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 316 /* JSDocEnumTag */: + case 317 /* JSDocEnumTag */: return nameForNamelessJSDocTypedef(declaration); - case 259 /* ExportAssignment */: { + case 260 /* ExportAssignment */: { var expression = declaration.expression; return isIdentifier(expression) ? expression : undefined; } - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: var expr = declaration; if (ts.isBindableStaticElementAccessExpression(expr)) { return expr.argumentExpression; @@ -10907,7 +10968,7 @@ var ts; return ts.emptyArray; } if (ts.isJSDocTypeAlias(node)) { - ts.Debug.assert(node.parent.kind === 303 /* JSDocComment */); + ts.Debug.assert(node.parent.kind === 304 /* JSDocComment */); return ts.flatMap(node.parent.tags, function (tag) { return isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; }); } if (node.typeParameters) { @@ -10978,11 +11039,11 @@ var ts; ts.isIdentifier = isIdentifier; // Names function isQualifiedName(node) { - return node.kind === 153 /* QualifiedName */; + return node.kind === 154 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 154 /* ComputedPropertyName */; + return node.kind === 155 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; function isPrivateIdentifier(node) { @@ -10995,164 +11056,164 @@ var ts; ts.isIdentifierOrPrivateIdentifier = isIdentifierOrPrivateIdentifier; // Signature elements function isTypeParameterDeclaration(node) { - return node.kind === 155 /* TypeParameter */; + return node.kind === 156 /* TypeParameter */; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 156 /* Parameter */; + return node.kind === 157 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 157 /* Decorator */; + return node.kind === 158 /* Decorator */; } ts.isDecorator = isDecorator; // TypeMember function isPropertySignature(node) { - return node.kind === 158 /* PropertySignature */; + return node.kind === 159 /* PropertySignature */; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 159 /* PropertyDeclaration */; + return node.kind === 160 /* PropertyDeclaration */; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 160 /* MethodSignature */; + return node.kind === 161 /* MethodSignature */; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 161 /* MethodDeclaration */; + return node.kind === 162 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 162 /* Constructor */; + return node.kind === 163 /* Constructor */; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 163 /* GetAccessor */; + return node.kind === 164 /* GetAccessor */; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 164 /* SetAccessor */; + return node.kind === 165 /* SetAccessor */; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 165 /* CallSignature */; + return node.kind === 166 /* CallSignature */; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 166 /* ConstructSignature */; + return node.kind === 167 /* ConstructSignature */; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 167 /* IndexSignature */; + return node.kind === 168 /* IndexSignature */; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; /* @internal */ function isGetOrSetAccessorDeclaration(node) { - return node.kind === 164 /* SetAccessor */ || node.kind === 163 /* GetAccessor */; + return node.kind === 165 /* SetAccessor */ || node.kind === 164 /* GetAccessor */; } ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration; // Type function isTypePredicateNode(node) { - return node.kind === 168 /* TypePredicate */; + return node.kind === 169 /* TypePredicate */; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 169 /* TypeReference */; + return node.kind === 170 /* TypeReference */; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 170 /* FunctionType */; + return node.kind === 171 /* FunctionType */; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 171 /* ConstructorType */; + return node.kind === 172 /* ConstructorType */; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 172 /* TypeQuery */; + return node.kind === 173 /* TypeQuery */; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 173 /* TypeLiteral */; + return node.kind === 174 /* TypeLiteral */; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 174 /* ArrayType */; + return node.kind === 175 /* ArrayType */; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 175 /* TupleType */; + return node.kind === 176 /* TupleType */; } ts.isTupleTypeNode = isTupleTypeNode; function isUnionTypeNode(node) { - return node.kind === 178 /* UnionType */; + return node.kind === 179 /* UnionType */; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 179 /* IntersectionType */; + return node.kind === 180 /* IntersectionType */; } ts.isIntersectionTypeNode = isIntersectionTypeNode; function isConditionalTypeNode(node) { - return node.kind === 180 /* ConditionalType */; + return node.kind === 181 /* ConditionalType */; } ts.isConditionalTypeNode = isConditionalTypeNode; function isInferTypeNode(node) { - return node.kind === 181 /* InferType */; + return node.kind === 182 /* InferType */; } ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 182 /* ParenthesizedType */; + return node.kind === 183 /* ParenthesizedType */; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 183 /* ThisType */; + return node.kind === 184 /* ThisType */; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 184 /* TypeOperator */; + return node.kind === 185 /* TypeOperator */; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 185 /* IndexedAccessType */; + return node.kind === 186 /* IndexedAccessType */; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 186 /* MappedType */; + return node.kind === 187 /* MappedType */; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 187 /* LiteralType */; + return node.kind === 188 /* LiteralType */; } ts.isLiteralTypeNode = isLiteralTypeNode; function isImportTypeNode(node) { - return node.kind === 188 /* ImportType */; + return node.kind === 189 /* ImportType */; } ts.isImportTypeNode = isImportTypeNode; // Binding patterns function isObjectBindingPattern(node) { - return node.kind === 189 /* ObjectBindingPattern */; + return node.kind === 190 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 190 /* ArrayBindingPattern */; + return node.kind === 191 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 191 /* BindingElement */; + return node.kind === 192 /* BindingElement */; } ts.isBindingElement = isBindingElement; // Expression function isArrayLiteralExpression(node) { - return node.kind === 192 /* ArrayLiteralExpression */; + return node.kind === 193 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 193 /* ObjectLiteralExpression */; + return node.kind === 194 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 194 /* PropertyAccessExpression */; + return node.kind === 195 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isPropertyAccessChain(node) { @@ -11160,7 +11221,7 @@ var ts; } ts.isPropertyAccessChain = isPropertyAccessChain; function isElementAccessExpression(node) { - return node.kind === 195 /* ElementAccessExpression */; + return node.kind === 196 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isElementAccessChain(node) { @@ -11168,7 +11229,7 @@ var ts; } ts.isElementAccessChain = isElementAccessChain; function isCallExpression(node) { - return node.kind === 196 /* CallExpression */; + return node.kind === 197 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isCallChain(node) { @@ -11178,9 +11239,9 @@ var ts; function isOptionalChain(node) { var kind = node.kind; return !!(node.flags & 32 /* OptionalChain */) && - (kind === 194 /* PropertyAccessExpression */ - || kind === 195 /* ElementAccessExpression */ - || kind === 196 /* CallExpression */); + (kind === 195 /* PropertyAccessExpression */ + || kind === 196 /* ElementAccessExpression */ + || kind === 197 /* CallExpression */); } ts.isOptionalChain = isOptionalChain; /* @internal */ @@ -11214,19 +11275,19 @@ var ts; } ts.isOutermostOptionalChain = isOutermostOptionalChain; function isNullishCoalesce(node) { - return node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; + return node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; } ts.isNullishCoalesce = isNullishCoalesce; function isNewExpression(node) { - return node.kind === 197 /* NewExpression */; + return node.kind === 198 /* NewExpression */; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 198 /* TaggedTemplateExpression */; + return node.kind === 199 /* TaggedTemplateExpression */; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertion(node) { - return node.kind === 199 /* TypeAssertionExpression */; + return node.kind === 200 /* TypeAssertionExpression */; } ts.isTypeAssertion = isTypeAssertion; function isConstTypeReference(node) { @@ -11235,384 +11296,384 @@ var ts; } ts.isConstTypeReference = isConstTypeReference; function isParenthesizedExpression(node) { - return node.kind === 200 /* ParenthesizedExpression */; + return node.kind === 201 /* ParenthesizedExpression */; } ts.isParenthesizedExpression = isParenthesizedExpression; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 326 /* PartiallyEmittedExpression */) { + while (node.kind === 327 /* PartiallyEmittedExpression */) { node = node.expression; } return node; } ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; function isFunctionExpression(node) { - return node.kind === 201 /* FunctionExpression */; + return node.kind === 202 /* FunctionExpression */; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 202 /* ArrowFunction */; + return node.kind === 203 /* ArrowFunction */; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 203 /* DeleteExpression */; + return node.kind === 204 /* DeleteExpression */; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 204 /* TypeOfExpression */; + return node.kind === 205 /* TypeOfExpression */; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 205 /* VoidExpression */; + return node.kind === 206 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 206 /* AwaitExpression */; + return node.kind === 207 /* AwaitExpression */; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 207 /* PrefixUnaryExpression */; + return node.kind === 208 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 208 /* PostfixUnaryExpression */; + return node.kind === 209 /* PostfixUnaryExpression */; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 209 /* BinaryExpression */; + return node.kind === 210 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 210 /* ConditionalExpression */; + return node.kind === 211 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 211 /* TemplateExpression */; + return node.kind === 212 /* TemplateExpression */; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 212 /* YieldExpression */; + return node.kind === 213 /* YieldExpression */; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 213 /* SpreadElement */; + return node.kind === 214 /* SpreadElement */; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 214 /* ClassExpression */; + return node.kind === 215 /* ClassExpression */; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 215 /* OmittedExpression */; + return node.kind === 216 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 216 /* ExpressionWithTypeArguments */; + return node.kind === 217 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 217 /* AsExpression */; + return node.kind === 218 /* AsExpression */; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 218 /* NonNullExpression */; + return node.kind === 219 /* NonNullExpression */; } ts.isNonNullExpression = isNonNullExpression; function isMetaProperty(node) { - return node.kind === 219 /* MetaProperty */; + return node.kind === 220 /* MetaProperty */; } ts.isMetaProperty = isMetaProperty; // Misc function isTemplateSpan(node) { - return node.kind === 221 /* TemplateSpan */; + return node.kind === 222 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 222 /* SemicolonClassElement */; + return node.kind === 223 /* SemicolonClassElement */; } ts.isSemicolonClassElement = isSemicolonClassElement; // Block function isBlock(node) { - return node.kind === 223 /* Block */; + return node.kind === 224 /* Block */; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 225 /* VariableStatement */; + return node.kind === 226 /* VariableStatement */; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 224 /* EmptyStatement */; + return node.kind === 225 /* EmptyStatement */; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 226 /* ExpressionStatement */; + return node.kind === 227 /* ExpressionStatement */; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 227 /* IfStatement */; + return node.kind === 228 /* IfStatement */; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 228 /* DoStatement */; + return node.kind === 229 /* DoStatement */; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 229 /* WhileStatement */; + return node.kind === 230 /* WhileStatement */; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 230 /* ForStatement */; + return node.kind === 231 /* ForStatement */; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 231 /* ForInStatement */; + return node.kind === 232 /* ForInStatement */; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 232 /* ForOfStatement */; + return node.kind === 233 /* ForOfStatement */; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 233 /* ContinueStatement */; + return node.kind === 234 /* ContinueStatement */; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 234 /* BreakStatement */; + return node.kind === 235 /* BreakStatement */; } ts.isBreakStatement = isBreakStatement; function isBreakOrContinueStatement(node) { - return node.kind === 234 /* BreakStatement */ || node.kind === 233 /* ContinueStatement */; + return node.kind === 235 /* BreakStatement */ || node.kind === 234 /* ContinueStatement */; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isReturnStatement(node) { - return node.kind === 235 /* ReturnStatement */; + return node.kind === 236 /* ReturnStatement */; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 236 /* WithStatement */; + return node.kind === 237 /* WithStatement */; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 237 /* SwitchStatement */; + return node.kind === 238 /* SwitchStatement */; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 238 /* LabeledStatement */; + return node.kind === 239 /* LabeledStatement */; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 239 /* ThrowStatement */; + return node.kind === 240 /* ThrowStatement */; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 240 /* TryStatement */; + return node.kind === 241 /* TryStatement */; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 241 /* DebuggerStatement */; + return node.kind === 242 /* DebuggerStatement */; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 242 /* VariableDeclaration */; + return node.kind === 243 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 243 /* VariableDeclarationList */; + return node.kind === 244 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 244 /* FunctionDeclaration */; + return node.kind === 245 /* FunctionDeclaration */; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 245 /* ClassDeclaration */; + return node.kind === 246 /* ClassDeclaration */; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 246 /* InterfaceDeclaration */; + return node.kind === 247 /* InterfaceDeclaration */; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 247 /* TypeAliasDeclaration */; + return node.kind === 248 /* TypeAliasDeclaration */; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 248 /* EnumDeclaration */; + return node.kind === 249 /* EnumDeclaration */; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 249 /* ModuleDeclaration */; + return node.kind === 250 /* ModuleDeclaration */; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 250 /* ModuleBlock */; + return node.kind === 251 /* ModuleBlock */; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 251 /* CaseBlock */; + return node.kind === 252 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 252 /* NamespaceExportDeclaration */; + return node.kind === 253 /* NamespaceExportDeclaration */; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */; + return node.kind === 254 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 254 /* ImportDeclaration */; + return node.kind === 255 /* ImportDeclaration */; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 255 /* ImportClause */; + return node.kind === 256 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 256 /* NamespaceImport */; + return node.kind === 257 /* NamespaceImport */; } ts.isNamespaceImport = isNamespaceImport; function isNamespaceExport(node) { - return node.kind === 262 /* NamespaceExport */; + return node.kind === 263 /* NamespaceExport */; } ts.isNamespaceExport = isNamespaceExport; function isNamedExportBindings(node) { - return node.kind === 262 /* NamespaceExport */ || node.kind === 261 /* NamedExports */; + return node.kind === 263 /* NamespaceExport */ || node.kind === 262 /* NamedExports */; } ts.isNamedExportBindings = isNamedExportBindings; function isNamedImports(node) { - return node.kind === 257 /* NamedImports */; + return node.kind === 258 /* NamedImports */; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 258 /* ImportSpecifier */; + return node.kind === 259 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 259 /* ExportAssignment */; + return node.kind === 260 /* ExportAssignment */; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 260 /* ExportDeclaration */; + return node.kind === 261 /* ExportDeclaration */; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 261 /* NamedExports */; + return node.kind === 262 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 263 /* ExportSpecifier */; + return node.kind === 264 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 264 /* MissingDeclaration */; + return node.kind === 265 /* MissingDeclaration */; } ts.isMissingDeclaration = isMissingDeclaration; // Module References function isExternalModuleReference(node) { - return node.kind === 265 /* ExternalModuleReference */; + return node.kind === 266 /* ExternalModuleReference */; } ts.isExternalModuleReference = isExternalModuleReference; // JSX function isJsxElement(node) { - return node.kind === 266 /* JsxElement */; + return node.kind === 267 /* JsxElement */; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 267 /* JsxSelfClosingElement */; + return node.kind === 268 /* JsxSelfClosingElement */; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 268 /* JsxOpeningElement */; + return node.kind === 269 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 269 /* JsxClosingElement */; + return node.kind === 270 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 270 /* JsxFragment */; + return node.kind === 271 /* JsxFragment */; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 271 /* JsxOpeningFragment */; + return node.kind === 272 /* JsxOpeningFragment */; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 272 /* JsxClosingFragment */; + return node.kind === 273 /* JsxClosingFragment */; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 273 /* JsxAttribute */; + return node.kind === 274 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 274 /* JsxAttributes */; + return node.kind === 275 /* JsxAttributes */; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 275 /* JsxSpreadAttribute */; + return node.kind === 276 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 276 /* JsxExpression */; + return node.kind === 277 /* JsxExpression */; } ts.isJsxExpression = isJsxExpression; // Clauses function isCaseClause(node) { - return node.kind === 277 /* CaseClause */; + return node.kind === 278 /* CaseClause */; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 278 /* DefaultClause */; + return node.kind === 279 /* DefaultClause */; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 279 /* HeritageClause */; + return node.kind === 280 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 280 /* CatchClause */; + return node.kind === 281 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 281 /* PropertyAssignment */; + return node.kind === 282 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 282 /* ShorthandPropertyAssignment */; + return node.kind === 283 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 283 /* SpreadAssignment */; + return node.kind === 284 /* SpreadAssignment */; } ts.isSpreadAssignment = isSpreadAssignment; // Enum function isEnumMember(node) { - return node.kind === 284 /* EnumMember */; + return node.kind === 285 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Top-level nodes function isSourceFile(node) { - return node.kind === 290 /* SourceFile */; + return node.kind === 291 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 291 /* Bundle */; + return node.kind === 292 /* Bundle */; } ts.isBundle = isBundle; function isUnparsedSource(node) { - return node.kind === 292 /* UnparsedSource */; + return node.kind === 293 /* UnparsedSource */; } ts.isUnparsedSource = isUnparsedSource; function isUnparsedPrepend(node) { - return node.kind === 286 /* UnparsedPrepend */; + return node.kind === 287 /* UnparsedPrepend */; } ts.isUnparsedPrepend = isUnparsedPrepend; function isUnparsedTextLike(node) { switch (node.kind) { - case 287 /* UnparsedText */: - case 288 /* UnparsedInternalText */: + case 288 /* UnparsedText */: + case 289 /* UnparsedInternalText */: return true; default: return false; @@ -11621,125 +11682,125 @@ var ts; ts.isUnparsedTextLike = isUnparsedTextLike; function isUnparsedNode(node) { return isUnparsedTextLike(node) || - node.kind === 285 /* UnparsedPrologue */ || - node.kind === 289 /* UnparsedSyntheticReference */; + node.kind === 286 /* UnparsedPrologue */ || + node.kind === 290 /* UnparsedSyntheticReference */; } ts.isUnparsedNode = isUnparsedNode; // JSDoc function isJSDocTypeExpression(node) { - return node.kind === 294 /* JSDocTypeExpression */; + return node.kind === 295 /* JSDocTypeExpression */; } ts.isJSDocTypeExpression = isJSDocTypeExpression; function isJSDocAllType(node) { - return node.kind === 295 /* JSDocAllType */; + return node.kind === 296 /* JSDocAllType */; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 296 /* JSDocUnknownType */; + return node.kind === 297 /* JSDocUnknownType */; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 297 /* JSDocNullableType */; + return node.kind === 298 /* JSDocNullableType */; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 298 /* JSDocNonNullableType */; + return node.kind === 299 /* JSDocNonNullableType */; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 299 /* JSDocOptionalType */; + return node.kind === 300 /* JSDocOptionalType */; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 300 /* JSDocFunctionType */; + return node.kind === 301 /* JSDocFunctionType */; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 301 /* JSDocVariadicType */; + return node.kind === 302 /* JSDocVariadicType */; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDoc(node) { - return node.kind === 303 /* JSDocComment */; + return node.kind === 304 /* JSDocComment */; } ts.isJSDoc = isJSDoc; function isJSDocAuthorTag(node) { - return node.kind === 309 /* JSDocAuthorTag */; + return node.kind === 310 /* JSDocAuthorTag */; } ts.isJSDocAuthorTag = isJSDocAuthorTag; function isJSDocAugmentsTag(node) { - return node.kind === 307 /* JSDocAugmentsTag */; + return node.kind === 308 /* JSDocAugmentsTag */; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocImplementsTag(node) { - return node.kind === 308 /* JSDocImplementsTag */; + return node.kind === 309 /* JSDocImplementsTag */; } ts.isJSDocImplementsTag = isJSDocImplementsTag; function isJSDocClassTag(node) { - return node.kind === 310 /* JSDocClassTag */; + return node.kind === 311 /* JSDocClassTag */; } ts.isJSDocClassTag = isJSDocClassTag; function isJSDocPublicTag(node) { - return node.kind === 311 /* JSDocPublicTag */; + return node.kind === 312 /* JSDocPublicTag */; } ts.isJSDocPublicTag = isJSDocPublicTag; function isJSDocPrivateTag(node) { - return node.kind === 312 /* JSDocPrivateTag */; + return node.kind === 313 /* JSDocPrivateTag */; } ts.isJSDocPrivateTag = isJSDocPrivateTag; function isJSDocProtectedTag(node) { - return node.kind === 313 /* JSDocProtectedTag */; + return node.kind === 314 /* JSDocProtectedTag */; } ts.isJSDocProtectedTag = isJSDocProtectedTag; function isJSDocReadonlyTag(node) { - return node.kind === 314 /* JSDocReadonlyTag */; + return node.kind === 315 /* JSDocReadonlyTag */; } ts.isJSDocReadonlyTag = isJSDocReadonlyTag; function isJSDocEnumTag(node) { - return node.kind === 316 /* JSDocEnumTag */; + return node.kind === 317 /* JSDocEnumTag */; } ts.isJSDocEnumTag = isJSDocEnumTag; function isJSDocThisTag(node) { - return node.kind === 319 /* JSDocThisTag */; + return node.kind === 320 /* JSDocThisTag */; } ts.isJSDocThisTag = isJSDocThisTag; function isJSDocParameterTag(node) { - return node.kind === 317 /* JSDocParameterTag */; + return node.kind === 318 /* JSDocParameterTag */; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 318 /* JSDocReturnTag */; + return node.kind === 319 /* JSDocReturnTag */; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocTypeTag(node) { - return node.kind === 320 /* JSDocTypeTag */; + return node.kind === 321 /* JSDocTypeTag */; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 321 /* JSDocTemplateTag */; + return node.kind === 322 /* JSDocTemplateTag */; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 322 /* JSDocTypedefTag */; + return node.kind === 323 /* JSDocTypedefTag */; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocPropertyTag(node) { - return node.kind === 323 /* JSDocPropertyTag */; + return node.kind === 324 /* JSDocPropertyTag */; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocPropertyLikeTag(node) { - return node.kind === 323 /* JSDocPropertyTag */ || node.kind === 317 /* JSDocParameterTag */; + return node.kind === 324 /* JSDocPropertyTag */ || node.kind === 318 /* JSDocParameterTag */; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isJSDocTypeLiteral(node) { - return node.kind === 304 /* JSDocTypeLiteral */; + return node.kind === 305 /* JSDocTypeLiteral */; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; function isJSDocCallbackTag(node) { - return node.kind === 315 /* JSDocCallbackTag */; + return node.kind === 316 /* JSDocCallbackTag */; } ts.isJSDocCallbackTag = isJSDocCallbackTag; function isJSDocSignature(node) { - return node.kind === 305 /* JSDocSignature */; + return node.kind === 306 /* JSDocSignature */; } ts.isJSDocSignature = isJSDocSignature; // #endregion @@ -11750,7 +11811,7 @@ var ts; // they may be used with transformations. /* @internal */ function isSyntaxList(n) { - return n.kind === 324 /* SyntaxList */; + return n.kind === 325 /* SyntaxList */; } ts.isSyntaxList = isSyntaxList; /* @internal */ @@ -11760,7 +11821,7 @@ var ts; ts.isNode = isNode; /* @internal */ function isNodeKind(kind) { - return kind >= 153 /* FirstNode */; + return kind >= 154 /* FirstNode */; } ts.isNodeKind = isNodeKind; /** @@ -11769,7 +11830,7 @@ var ts; * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 152 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 153 /* LastToken */; } ts.isToken = isToken; // Node Arrays @@ -11810,12 +11871,12 @@ var ts; ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isTypeOnlyImportOrExportDeclaration(node) { switch (node.kind) { - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return node.parent.isTypeOnly; - case 255 /* ImportClause */: + case 256 /* ImportClause */: return node.isTypeOnly; default: return false; @@ -11850,13 +11911,13 @@ var ts; case 122 /* AbstractKeyword */: case 126 /* AsyncKeyword */: case 81 /* ConstKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 84 /* DefaultKeyword */: case 89 /* ExportKeyword */: case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: case 120 /* StaticKeyword */: return true; } @@ -11879,23 +11940,24 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 153 /* QualifiedName */ + return kind === 154 /* QualifiedName */ || kind === 75 /* Identifier */; } ts.isEntityName = isEntityName; function isPropertyName(node) { var kind = node.kind; return kind === 75 /* Identifier */ + || kind === 76 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 154 /* ComputedPropertyName */; + || kind === 155 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 75 /* Identifier */ - || kind === 189 /* ObjectBindingPattern */ - || kind === 190 /* ArrayBindingPattern */; + || kind === 190 /* ObjectBindingPattern */ + || kind === 191 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Functions @@ -11910,13 +11972,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return true; default: return false; @@ -11925,14 +11987,14 @@ var ts; /* @internal */ function isFunctionLikeKind(kind) { switch (kind) { - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 305 /* JSDocSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 170 /* FunctionType */: - case 300 /* JSDocFunctionType */: - case 171 /* ConstructorType */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 306 /* JSDocSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 171 /* FunctionType */: + case 301 /* JSDocFunctionType */: + case 172 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -11947,29 +12009,29 @@ var ts; // Classes function isClassElement(node) { var kind = node.kind; - return kind === 162 /* Constructor */ - || kind === 159 /* PropertyDeclaration */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */ - || kind === 167 /* IndexSignature */ - || kind === 222 /* SemicolonClassElement */; + return kind === 163 /* Constructor */ + || kind === 160 /* PropertyDeclaration */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */ + || kind === 168 /* IndexSignature */ + || kind === 223 /* SemicolonClassElement */; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */); + return node && (node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 163 /* GetAccessor */ || node.kind === 164 /* SetAccessor */); + return node && (node.kind === 164 /* GetAccessor */ || node.kind === 165 /* SetAccessor */); } ts.isAccessor = isAccessor; /* @internal */ function isMethodOrAccessor(node) { switch (node.kind) { - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return true; default: return false; @@ -11979,11 +12041,11 @@ var ts; // Type members function isTypeElement(node) { var kind = node.kind; - return kind === 166 /* ConstructSignature */ - || kind === 165 /* CallSignature */ - || kind === 158 /* PropertySignature */ - || kind === 160 /* MethodSignature */ - || kind === 167 /* IndexSignature */; + return kind === 167 /* ConstructSignature */ + || kind === 166 /* CallSignature */ + || kind === 159 /* PropertySignature */ + || kind === 161 /* MethodSignature */ + || kind === 168 /* IndexSignature */; } ts.isTypeElement = isTypeElement; function isClassOrTypeElement(node) { @@ -11992,12 +12054,12 @@ var ts; ts.isClassOrTypeElement = isClassOrTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 281 /* PropertyAssignment */ - || kind === 282 /* ShorthandPropertyAssignment */ - || kind === 283 /* SpreadAssignment */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */; + return kind === 282 /* PropertyAssignment */ + || kind === 283 /* ShorthandPropertyAssignment */ + || kind === 284 /* SpreadAssignment */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type @@ -12012,8 +12074,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 170 /* FunctionType */: - case 171 /* ConstructorType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: return true; } return false; @@ -12024,8 +12086,8 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 190 /* ArrayBindingPattern */ - || kind === 189 /* ObjectBindingPattern */; + return kind === 191 /* ArrayBindingPattern */ + || kind === 190 /* ObjectBindingPattern */; } return false; } @@ -12033,15 +12095,15 @@ var ts; /* @internal */ function isAssignmentPattern(node) { var kind = node.kind; - return kind === 192 /* ArrayLiteralExpression */ - || kind === 193 /* ObjectLiteralExpression */; + return kind === 193 /* ArrayLiteralExpression */ + || kind === 194 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; /* @internal */ function isArrayBindingElement(node) { var kind = node.kind; - return kind === 191 /* BindingElement */ - || kind === 215 /* OmittedExpression */; + return kind === 192 /* BindingElement */ + || kind === 216 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -12050,9 +12112,9 @@ var ts; /* @internal */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 191 /* BindingElement */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 192 /* BindingElement */: return true; } return false; @@ -12073,8 +12135,8 @@ var ts; /* @internal */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 189 /* ObjectBindingPattern */: - case 193 /* ObjectLiteralExpression */: + case 190 /* ObjectBindingPattern */: + case 194 /* ObjectLiteralExpression */: return true; } return false; @@ -12086,8 +12148,8 @@ var ts; /* @internal */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 190 /* ArrayBindingPattern */: - case 192 /* ArrayLiteralExpression */: + case 191 /* ArrayBindingPattern */: + case 193 /* ArrayLiteralExpression */: return true; } return false; @@ -12096,26 +12158,26 @@ var ts; /* @internal */ function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { var kind = node.kind; - return kind === 194 /* PropertyAccessExpression */ - || kind === 153 /* QualifiedName */ - || kind === 188 /* ImportType */; + return kind === 195 /* PropertyAccessExpression */ + || kind === 154 /* QualifiedName */ + || kind === 189 /* ImportType */; } ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode; // Expression function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 194 /* PropertyAccessExpression */ - || kind === 153 /* QualifiedName */; + return kind === 195 /* PropertyAccessExpression */ + || kind === 154 /* QualifiedName */; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 198 /* TaggedTemplateExpression */: - case 157 /* Decorator */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 199 /* TaggedTemplateExpression */: + case 158 /* Decorator */: return true; default: return false; @@ -12123,12 +12185,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 196 /* CallExpression */ || node.kind === 197 /* NewExpression */; + return node.kind === 197 /* CallExpression */ || node.kind === 198 /* NewExpression */; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 211 /* TemplateExpression */ + return kind === 212 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; @@ -12139,33 +12201,33 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: - case 197 /* NewExpression */: - case 196 /* CallExpression */: - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 270 /* JsxFragment */: - case 198 /* TaggedTemplateExpression */: - case 192 /* ArrayLiteralExpression */: - case 200 /* ParenthesizedExpression */: - case 193 /* ObjectLiteralExpression */: - case 214 /* ClassExpression */: - case 201 /* FunctionExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: + case 198 /* NewExpression */: + case 197 /* CallExpression */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 271 /* JsxFragment */: + case 199 /* TaggedTemplateExpression */: + case 193 /* ArrayLiteralExpression */: + case 201 /* ParenthesizedExpression */: + case 194 /* ObjectLiteralExpression */: + case 215 /* ClassExpression */: + case 202 /* FunctionExpression */: case 75 /* Identifier */: case 13 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: case 91 /* FalseKeyword */: case 100 /* NullKeyword */: case 104 /* ThisKeyword */: case 106 /* TrueKeyword */: case 102 /* SuperKeyword */: - case 218 /* NonNullExpression */: - case 219 /* MetaProperty */: + case 219 /* NonNullExpression */: + case 220 /* MetaProperty */: case 96 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression return true; default: @@ -12179,13 +12241,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: - case 203 /* DeleteExpression */: - case 204 /* TypeOfExpression */: - case 205 /* VoidExpression */: - case 206 /* AwaitExpression */: - case 199 /* TypeAssertionExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: + case 204 /* DeleteExpression */: + case 205 /* TypeOfExpression */: + case 206 /* VoidExpression */: + case 207 /* AwaitExpression */: + case 200 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -12194,9 +12256,9 @@ var ts; /* @internal */ function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return true; - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; default: @@ -12215,15 +12277,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 210 /* ConditionalExpression */: - case 212 /* YieldExpression */: - case 202 /* ArrowFunction */: - case 209 /* BinaryExpression */: - case 213 /* SpreadElement */: - case 217 /* AsExpression */: - case 215 /* OmittedExpression */: - case 327 /* CommaListExpression */: - case 326 /* PartiallyEmittedExpression */: + case 211 /* ConditionalExpression */: + case 213 /* YieldExpression */: + case 203 /* ArrowFunction */: + case 210 /* BinaryExpression */: + case 214 /* SpreadElement */: + case 218 /* AsExpression */: + case 216 /* OmittedExpression */: + case 328 /* CommaListExpression */: + case 327 /* PartiallyEmittedExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -12231,23 +12293,23 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 199 /* TypeAssertionExpression */ - || kind === 217 /* AsExpression */; + return kind === 200 /* TypeAssertionExpression */ + || kind === 218 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; /* @internal */ function isPartiallyEmittedExpression(node) { - return node.kind === 326 /* PartiallyEmittedExpression */; + return node.kind === 327 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; /* @internal */ function isNotEmittedStatement(node) { - return node.kind === 325 /* NotEmittedStatement */; + return node.kind === 326 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; /* @internal */ function isSyntheticReference(node) { - return node.kind === 330 /* SyntheticReferenceExpression */; + return node.kind === 331 /* SyntheticReferenceExpression */; } ts.isSyntheticReference = isSyntheticReference; /* @internal */ @@ -12258,13 +12320,13 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return true; - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -12293,7 +12355,7 @@ var ts; ts.isExternalModuleIndicator = isExternalModuleIndicator; /* @internal */ function isForInOrOfStatement(node) { - return node.kind === 231 /* ForInStatement */ || node.kind === 232 /* ForOfStatement */; + return node.kind === 232 /* ForInStatement */ || node.kind === 233 /* ForOfStatement */; } ts.isForInOrOfStatement = isForInOrOfStatement; // Element @@ -12317,114 +12379,114 @@ var ts; /* @internal */ function isModuleBody(node) { var kind = node.kind; - return kind === 250 /* ModuleBlock */ - || kind === 249 /* ModuleDeclaration */ + return kind === 251 /* ModuleBlock */ + || kind === 250 /* ModuleDeclaration */ || kind === 75 /* Identifier */; } ts.isModuleBody = isModuleBody; /* @internal */ function isNamespaceBody(node) { var kind = node.kind; - return kind === 250 /* ModuleBlock */ - || kind === 249 /* ModuleDeclaration */; + return kind === 251 /* ModuleBlock */ + || kind === 250 /* ModuleDeclaration */; } ts.isNamespaceBody = isNamespaceBody; /* @internal */ function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 75 /* Identifier */ - || kind === 249 /* ModuleDeclaration */; + || kind === 250 /* ModuleDeclaration */; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; /* @internal */ function isNamedImportBindings(node) { var kind = node.kind; - return kind === 257 /* NamedImports */ - || kind === 256 /* NamespaceImport */; + return kind === 258 /* NamedImports */ + || kind === 257 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; /* @internal */ function isModuleOrEnumDeclaration(node) { - return node.kind === 249 /* ModuleDeclaration */ || node.kind === 248 /* EnumDeclaration */; + return node.kind === 250 /* ModuleDeclaration */ || node.kind === 249 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 202 /* ArrowFunction */ - || kind === 191 /* BindingElement */ - || kind === 245 /* ClassDeclaration */ - || kind === 214 /* ClassExpression */ - || kind === 162 /* Constructor */ - || kind === 248 /* EnumDeclaration */ - || kind === 284 /* EnumMember */ - || kind === 263 /* ExportSpecifier */ - || kind === 244 /* FunctionDeclaration */ - || kind === 201 /* FunctionExpression */ - || kind === 163 /* GetAccessor */ - || kind === 255 /* ImportClause */ - || kind === 253 /* ImportEqualsDeclaration */ - || kind === 258 /* ImportSpecifier */ - || kind === 246 /* InterfaceDeclaration */ - || kind === 273 /* JsxAttribute */ - || kind === 161 /* MethodDeclaration */ - || kind === 160 /* MethodSignature */ - || kind === 249 /* ModuleDeclaration */ - || kind === 252 /* NamespaceExportDeclaration */ - || kind === 256 /* NamespaceImport */ - || kind === 262 /* NamespaceExport */ - || kind === 156 /* Parameter */ - || kind === 281 /* PropertyAssignment */ - || kind === 159 /* PropertyDeclaration */ - || kind === 158 /* PropertySignature */ - || kind === 164 /* SetAccessor */ - || kind === 282 /* ShorthandPropertyAssignment */ - || kind === 247 /* TypeAliasDeclaration */ - || kind === 155 /* TypeParameter */ - || kind === 242 /* VariableDeclaration */ - || kind === 322 /* JSDocTypedefTag */ - || kind === 315 /* JSDocCallbackTag */ - || kind === 323 /* JSDocPropertyTag */; + return kind === 203 /* ArrowFunction */ + || kind === 192 /* BindingElement */ + || kind === 246 /* ClassDeclaration */ + || kind === 215 /* ClassExpression */ + || kind === 163 /* Constructor */ + || kind === 249 /* EnumDeclaration */ + || kind === 285 /* EnumMember */ + || kind === 264 /* ExportSpecifier */ + || kind === 245 /* FunctionDeclaration */ + || kind === 202 /* FunctionExpression */ + || kind === 164 /* GetAccessor */ + || kind === 256 /* ImportClause */ + || kind === 254 /* ImportEqualsDeclaration */ + || kind === 259 /* ImportSpecifier */ + || kind === 247 /* InterfaceDeclaration */ + || kind === 274 /* JsxAttribute */ + || kind === 162 /* MethodDeclaration */ + || kind === 161 /* MethodSignature */ + || kind === 250 /* ModuleDeclaration */ + || kind === 253 /* NamespaceExportDeclaration */ + || kind === 257 /* NamespaceImport */ + || kind === 263 /* NamespaceExport */ + || kind === 157 /* Parameter */ + || kind === 282 /* PropertyAssignment */ + || kind === 160 /* PropertyDeclaration */ + || kind === 159 /* PropertySignature */ + || kind === 165 /* SetAccessor */ + || kind === 283 /* ShorthandPropertyAssignment */ + || kind === 248 /* TypeAliasDeclaration */ + || kind === 156 /* TypeParameter */ + || kind === 243 /* VariableDeclaration */ + || kind === 323 /* JSDocTypedefTag */ + || kind === 316 /* JSDocCallbackTag */ + || kind === 324 /* JSDocPropertyTag */; } function isDeclarationStatementKind(kind) { - return kind === 244 /* FunctionDeclaration */ - || kind === 264 /* MissingDeclaration */ - || kind === 245 /* ClassDeclaration */ - || kind === 246 /* InterfaceDeclaration */ - || kind === 247 /* TypeAliasDeclaration */ - || kind === 248 /* EnumDeclaration */ - || kind === 249 /* ModuleDeclaration */ - || kind === 254 /* ImportDeclaration */ - || kind === 253 /* ImportEqualsDeclaration */ - || kind === 260 /* ExportDeclaration */ - || kind === 259 /* ExportAssignment */ - || kind === 252 /* NamespaceExportDeclaration */; + return kind === 245 /* FunctionDeclaration */ + || kind === 265 /* MissingDeclaration */ + || kind === 246 /* ClassDeclaration */ + || kind === 247 /* InterfaceDeclaration */ + || kind === 248 /* TypeAliasDeclaration */ + || kind === 249 /* EnumDeclaration */ + || kind === 250 /* ModuleDeclaration */ + || kind === 255 /* ImportDeclaration */ + || kind === 254 /* ImportEqualsDeclaration */ + || kind === 261 /* ExportDeclaration */ + || kind === 260 /* ExportAssignment */ + || kind === 253 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 234 /* BreakStatement */ - || kind === 233 /* ContinueStatement */ - || kind === 241 /* DebuggerStatement */ - || kind === 228 /* DoStatement */ - || kind === 226 /* ExpressionStatement */ - || kind === 224 /* EmptyStatement */ - || kind === 231 /* ForInStatement */ - || kind === 232 /* ForOfStatement */ - || kind === 230 /* ForStatement */ - || kind === 227 /* IfStatement */ - || kind === 238 /* LabeledStatement */ - || kind === 235 /* ReturnStatement */ - || kind === 237 /* SwitchStatement */ - || kind === 239 /* ThrowStatement */ - || kind === 240 /* TryStatement */ - || kind === 225 /* VariableStatement */ - || kind === 229 /* WhileStatement */ - || kind === 236 /* WithStatement */ - || kind === 325 /* NotEmittedStatement */ - || kind === 329 /* EndOfDeclarationMarker */ - || kind === 328 /* MergeDeclarationMarker */; + return kind === 235 /* BreakStatement */ + || kind === 234 /* ContinueStatement */ + || kind === 242 /* DebuggerStatement */ + || kind === 229 /* DoStatement */ + || kind === 227 /* ExpressionStatement */ + || kind === 225 /* EmptyStatement */ + || kind === 232 /* ForInStatement */ + || kind === 233 /* ForOfStatement */ + || kind === 231 /* ForStatement */ + || kind === 228 /* IfStatement */ + || kind === 239 /* LabeledStatement */ + || kind === 236 /* ReturnStatement */ + || kind === 238 /* SwitchStatement */ + || kind === 240 /* ThrowStatement */ + || kind === 241 /* TryStatement */ + || kind === 226 /* VariableStatement */ + || kind === 230 /* WhileStatement */ + || kind === 237 /* WithStatement */ + || kind === 326 /* NotEmittedStatement */ + || kind === 330 /* EndOfDeclarationMarker */ + || kind === 329 /* MergeDeclarationMarker */; } /* @internal */ function isDeclaration(node) { - if (node.kind === 155 /* TypeParameter */) { - return (node.parent && node.parent.kind !== 321 /* JSDocTemplateTag */) || ts.isInJSFile(node); + if (node.kind === 156 /* TypeParameter */) { + return (node.parent && node.parent.kind !== 322 /* JSDocTemplateTag */) || ts.isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -12451,10 +12513,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 223 /* Block */) + if (node.kind !== 224 /* Block */) return false; if (node.parent !== undefined) { - if (node.parent.kind === 240 /* TryStatement */ || node.parent.kind === 280 /* CatchClause */) { + if (node.parent.kind === 241 /* TryStatement */ || node.parent.kind === 281 /* CatchClause */) { return false; } } @@ -12464,8 +12526,8 @@ var ts; /* @internal */ function isModuleReference(node) { var kind = node.kind; - return kind === 265 /* ExternalModuleReference */ - || kind === 153 /* QualifiedName */ + return kind === 266 /* ExternalModuleReference */ + || kind === 154 /* QualifiedName */ || kind === 75 /* Identifier */; } ts.isModuleReference = isModuleReference; @@ -12475,70 +12537,70 @@ var ts; var kind = node.kind; return kind === 104 /* ThisKeyword */ || kind === 75 /* Identifier */ - || kind === 194 /* PropertyAccessExpression */; + || kind === 195 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; /* @internal */ function isJsxChild(node) { var kind = node.kind; - return kind === 266 /* JsxElement */ - || kind === 276 /* JsxExpression */ - || kind === 267 /* JsxSelfClosingElement */ + return kind === 267 /* JsxElement */ + || kind === 277 /* JsxExpression */ + || kind === 268 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ - || kind === 270 /* JsxFragment */; + || kind === 271 /* JsxFragment */; } ts.isJsxChild = isJsxChild; /* @internal */ function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 273 /* JsxAttribute */ - || kind === 275 /* JsxSpreadAttribute */; + return kind === 274 /* JsxAttribute */ + || kind === 276 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; /* @internal */ function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 10 /* StringLiteral */ - || kind === 276 /* JsxExpression */; + || kind === 277 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 268 /* JsxOpeningElement */ - || kind === 267 /* JsxSelfClosingElement */; + return kind === 269 /* JsxOpeningElement */ + || kind === 268 /* JsxSelfClosingElement */; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 277 /* CaseClause */ - || kind === 278 /* DefaultClause */; + return kind === 278 /* CaseClause */ + || kind === 279 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; // JSDoc /** True if node is of some JSDoc syntax kind. */ /* @internal */ function isJSDocNode(node) { - return node.kind >= 294 /* FirstJSDocNode */ && node.kind <= 323 /* LastJSDocNode */; + return node.kind >= 295 /* FirstJSDocNode */ && node.kind <= 324 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node) { - return node.kind === 303 /* JSDocComment */ || node.kind === 302 /* JSDocNamepathType */ || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); + return node.kind === 304 /* JSDocComment */ || node.kind === 303 /* JSDocNamepathType */ || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; // TODO: determine what this does before making it public. /* @internal */ function isJSDocTag(node) { - return node.kind >= 306 /* FirstJSDocTagNode */ && node.kind <= 323 /* LastJSDocTagNode */; + return node.kind >= 307 /* FirstJSDocTagNode */ && node.kind <= 324 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 164 /* SetAccessor */; + return node.kind === 165 /* SetAccessor */; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 163 /* GetAccessor */; + return node.kind === 164 /* GetAccessor */; } ts.isGetAccessor = isGetAccessor; /** True if has jsdoc nodes attached to it. */ @@ -12564,13 +12626,13 @@ var ts; /** True if has initializer node attached to it. */ function hasOnlyExpressionInitializer(node) { switch (node.kind) { - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 191 /* BindingElement */: - case 158 /* PropertySignature */: - case 159 /* PropertyDeclaration */: - case 281 /* PropertyAssignment */: - case 284 /* EnumMember */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 192 /* BindingElement */: + case 159 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 282 /* PropertyAssignment */: + case 285 /* EnumMember */: return true; default: return false; @@ -12578,12 +12640,12 @@ var ts; } ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; function isObjectLiteralElement(node) { - return node.kind === 273 /* JsxAttribute */ || node.kind === 275 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); + return node.kind === 274 /* JsxAttribute */ || node.kind === 276 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); } ts.isObjectLiteralElement = isObjectLiteralElement; /* @internal */ function isTypeReferenceType(node) { - return node.kind === 169 /* TypeReference */ || node.kind === 216 /* ExpressionWithTypeArguments */; + return node.kind === 170 /* TypeReference */ || node.kind === 217 /* ExpressionWithTypeArguments */; } ts.isTypeReferenceType = isTypeReferenceType; var MAX_SMI_X86 = 1073741823; @@ -12877,7 +12939,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 290 /* SourceFile */) { + while (node && node.kind !== 291 /* SourceFile */) { node = node.parent; } return node; @@ -12885,11 +12947,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 223 /* Block */: - case 251 /* CaseBlock */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 224 /* Block */: + case 252 /* CaseBlock */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: return true; } return false; @@ -13041,6 +13103,33 @@ var ts; text.charCodeAt(start + 2) === 33 /* exclamation */; } ts.isPinnedComment = isPinnedComment; + function createCommentDirectivesMap(sourceFile, commentDirectives) { + var directivesByLine = ts.createMapFromEntries(commentDirectives.map(function (commentDirective) { return ([ + "" + ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.pos).line, + commentDirective, + ]); })); + var usedLines = ts.createMap(); + return { getUnusedExpectations: getUnusedExpectations, markUsed: markUsed }; + function getUnusedExpectations() { + return ts.arrayFrom(directivesByLine.entries()) + .filter(function (_a) { + var line = _a[0], directive = _a[1]; + return directive.type === 0 /* ExpectError */ && !usedLines.get(line); + }) + .map(function (_a) { + var _ = _a[0], directive = _a[1]; + return directive; + }); + } + function markUsed(line) { + if (!directivesByLine.has("" + line)) { + return false; + } + usedLines.set("" + line, true); + return true; + } + } + ts.createCommentDirectivesMap = createCommentDirectivesMap; function getTokenPosOfNode(node, sourceFile, includeJsDoc) { // With nodes that have no width (i.e. 'Missing' nodes), we actually *don't* // want to skip trivia because this will launch us forward to the next token. @@ -13057,7 +13146,7 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 324 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 325 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -13182,7 +13271,7 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 242 /* VariableDeclaration */ && node.parent.kind === 280 /* CatchClause */; + return node.kind === 243 /* VariableDeclaration */ && node.parent.kind === 281 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { @@ -13214,11 +13303,11 @@ var ts; ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { // The only kind of module that can be missing a body is a shorthand ambient module. - return node && node.kind === 249 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 250 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 290 /* SourceFile */ || - node.kind === 249 /* ModuleDeclaration */ || + return node.kind === 291 /* SourceFile */ || + node.kind === 250 /* ModuleDeclaration */ || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -13235,9 +13324,9 @@ var ts; // - defined in the top level scope and source file is an external module // - defined inside ambient module declaration located in the top level scope and source file not an external module switch (node.parent.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: return ts.isExternalModule(node.parent); - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -13290,22 +13379,22 @@ var ts; ts.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile; function isBlockScope(node, parentNode) { switch (node.kind) { - case 290 /* SourceFile */: - case 251 /* CaseBlock */: - case 280 /* CatchClause */: - case 249 /* ModuleDeclaration */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 291 /* SourceFile */: + case 252 /* CaseBlock */: + case 281 /* CatchClause */: + case 250 /* ModuleDeclaration */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return true; - case 223 /* Block */: + case 224 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return !ts.isFunctionLike(parentNode); @@ -13315,9 +13404,9 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: - case 305 /* JSDocSignature */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: + case 306 /* JSDocSignature */: return true; default: ts.assertType(node); @@ -13327,25 +13416,25 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isDeclarationWithTypeParameterChildren(node) { switch (node.kind) { - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 160 /* MethodSignature */: - case 167 /* IndexSignature */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 300 /* JSDocFunctionType */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 321 /* JSDocTemplateTag */: - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 161 /* MethodSignature */: + case 168 /* IndexSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 301 /* JSDocFunctionType */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 322 /* JSDocTemplateTag */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return true; default: ts.assertType(node); @@ -13355,8 +13444,8 @@ var ts; ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren; function isAnyImportSyntax(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: return true; default: return false; @@ -13365,15 +13454,15 @@ var ts; ts.isAnyImportSyntax = isAnyImportSyntax; function isLateVisibilityPaintedStatement(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 225 /* VariableStatement */: - case 245 /* ClassDeclaration */: - case 244 /* FunctionDeclaration */: - case 249 /* ModuleDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 226 /* VariableStatement */: + case 246 /* ClassDeclaration */: + case 245 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: return true; default: return false; @@ -13410,7 +13499,7 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: if (isStringOrNumericLiteralLike(name.expression)) return ts.escapeLeadingUnderscores(name.expression.text); return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames"); @@ -13426,9 +13515,9 @@ var ts; case 76 /* PrivateIdentifier */: case 75 /* Identifier */: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: if (ts.isIdentifier(name.name) || ts.isPrivateIdentifier(name.name)) { return entityNameToString(name.expression) + "." + entityNameToString(name.name); } @@ -13469,6 +13558,17 @@ var ts; }; } ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; + function createDiagnosticForRange(sourceFile, range, message) { + return { + file: sourceFile, + start: range.pos, + length: range.end - range.pos, + code: message.code, + category: message.category, + messageText: message.message, + }; + } + ts.createDiagnosticForRange = createDiagnosticForRange; function getSpanOfTokenAtPosition(sourceFile, pos) { var scanner = ts.createScanner(sourceFile.languageVersion, /*skipTrivia*/ true, sourceFile.languageVariant, sourceFile.text, /*onError:*/ undefined, pos); scanner.scan(); @@ -13478,7 +13578,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 223 /* Block */) { + if (node.body && node.body.kind === 224 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -13492,7 +13592,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -13501,28 +13601,28 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 242 /* VariableDeclaration */: - case 191 /* BindingElement */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 247 /* TypeAliasDeclaration */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 243 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 248 /* TypeAliasDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: errorNode = node.name; break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: var start = ts.skipTrivia(sourceFile.text, node.pos); var end = node.statements.length > 0 ? node.statements[0].pos : node.end; return ts.createTextSpanFromBounds(start, end); @@ -13574,11 +13674,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 196 /* CallExpression */ && n.expression.kind === 102 /* SuperKeyword */; + return n.kind === 197 /* CallExpression */ && n.expression.kind === 102 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 196 /* CallExpression */ && n.expression.kind === 96 /* ImportKeyword */; + return n.kind === 197 /* CallExpression */ && n.expression.kind === 96 /* ImportKeyword */; } ts.isImportCall = isImportCall; function isImportMeta(n) { @@ -13592,7 +13692,7 @@ var ts; } ts.isLiteralImportTypeNode = isLiteralImportTypeNode; function isPrologueDirective(node) { - return node.kind === 226 /* ExpressionStatement */ + return node.kind === 227 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -13601,11 +13701,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 156 /* Parameter */ || - node.kind === 155 /* TypeParameter */ || - node.kind === 201 /* FunctionExpression */ || - node.kind === 202 /* ArrowFunction */ || - node.kind === 200 /* ParenthesizedExpression */) ? + var commentRanges = (node.kind === 157 /* Parameter */ || + node.kind === 156 /* TypeParameter */ || + node.kind === 202 /* FunctionExpression */ || + node.kind === 203 /* ArrowFunction */ || + node.kind === 201 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' @@ -13621,48 +13721,48 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (168 /* FirstTypeNode */ <= node.kind && node.kind <= 188 /* LastTypeNode */) { + if (169 /* FirstTypeNode */ <= node.kind && node.kind <= 189 /* LastTypeNode */) { return true; } switch (node.kind) { case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 143 /* StringKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: - case 141 /* ObjectKeyword */: - case 146 /* UndefinedKeyword */: - case 137 /* NeverKeyword */: + case 149 /* UnknownKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 144 /* StringKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: + case 142 /* ObjectKeyword */: + case 147 /* UndefinedKeyword */: + case 138 /* NeverKeyword */: return true; case 110 /* VoidKeyword */: - return node.parent.kind !== 205 /* VoidExpression */; - case 216 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 206 /* VoidExpression */; + case 217 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); - case 155 /* TypeParameter */: - return node.parent.kind === 186 /* MappedType */ || node.parent.kind === 181 /* InferType */; + case 156 /* TypeParameter */: + return node.parent.kind === 187 /* MappedType */ || node.parent.kind === 182 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 75 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 153 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 154 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 75 /* Identifier */ || node.kind === 153 /* QualifiedName */ || node.kind === 194 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + ts.Debug.assert(node.kind === 75 /* Identifier */ || node.kind === 154 /* QualifiedName */ || node.kind === 195 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 153 /* QualifiedName */: - case 194 /* PropertyAccessExpression */: + case 154 /* QualifiedName */: + case 195 /* PropertyAccessExpression */: case 104 /* ThisKeyword */: { var parent = node.parent; - if (parent.kind === 172 /* TypeQuery */) { + if (parent.kind === 173 /* TypeQuery */) { return false; } - if (parent.kind === 188 /* ImportType */) { + if (parent.kind === 189 /* ImportType */) { return !parent.isTypeOf; } // Do not recursively call isPartOfTypeNode on the parent. In the example: @@ -13671,40 +13771,40 @@ var ts; // // Calling isPartOfTypeNode would consider the qualified name A.B a type node. // Only C and A.B.C are type nodes. - if (168 /* FirstTypeNode */ <= parent.kind && parent.kind <= 188 /* LastTypeNode */) { + if (169 /* FirstTypeNode */ <= parent.kind && parent.kind <= 189 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return node === parent.constraint; - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return node === parent.constraint; - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 156 /* Parameter */: - case 242 /* VariableDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 157 /* Parameter */: + case 243 /* VariableDeclaration */: return node === parent.type; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return node === parent.type; - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: return node === parent.type; - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: return node === parent.type; - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: return ts.contains(parent.typeArguments, node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -13729,23 +13829,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitor(node); - case 251 /* CaseBlock */: - case 223 /* Block */: - case 227 /* IfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 236 /* WithStatement */: - case 237 /* SwitchStatement */: - case 277 /* CaseClause */: - case 278 /* DefaultClause */: - case 238 /* LabeledStatement */: - case 240 /* TryStatement */: - case 280 /* CatchClause */: + case 252 /* CaseBlock */: + case 224 /* Block */: + case 228 /* IfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 237 /* WithStatement */: + case 238 /* SwitchStatement */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: + case 239 /* LabeledStatement */: + case 241 /* TryStatement */: + case 281 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -13755,23 +13855,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 248 /* EnumDeclaration */: - case 246 /* InterfaceDeclaration */: - case 249 /* ModuleDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: + case 247 /* InterfaceDeclaration */: + case 250 /* ModuleDeclaration */: + case 248 /* TypeAliasDeclaration */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, skip them to avoid the work. return; default: if (ts.isFunctionLike(node)) { - if (node.name && node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 155 /* ComputedPropertyName */) { // Note that we will not include methods/accessors of a class because they would require // first descending into the class. This is by design. traverse(node.name.expression); @@ -13794,10 +13894,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 174 /* ArrayType */) { + if (node && node.kind === 175 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 169 /* TypeReference */) { + else if (node && node.kind === 170 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -13807,12 +13907,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 246 /* InterfaceDeclaration */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 173 /* TypeLiteral */: + case 247 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 174 /* TypeLiteral */: return node.members; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return node.properties; } } @@ -13820,14 +13920,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 191 /* BindingElement */: - case 284 /* EnumMember */: - case 156 /* Parameter */: - case 281 /* PropertyAssignment */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 282 /* ShorthandPropertyAssignment */: - case 242 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 285 /* EnumMember */: + case 157 /* Parameter */: + case 282 /* PropertyAssignment */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 283 /* ShorthandPropertyAssignment */: + case 243 /* VariableDeclaration */: return true; } } @@ -13839,8 +13939,8 @@ var ts; } ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 243 /* VariableDeclarationList */ - && node.parent.parent.kind === 225 /* VariableStatement */; + return node.parent.kind === 244 /* VariableDeclarationList */ + && node.parent.parent.kind === 226 /* VariableStatement */; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -13851,13 +13951,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return true; } return false; @@ -13868,7 +13968,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 238 /* LabeledStatement */) { + if (node.statement.kind !== 239 /* LabeledStatement */) { return node.statement; } node = node.statement; @@ -13876,17 +13976,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 223 /* Block */ && ts.isFunctionLike(node.parent); + return node && node.kind === 224 /* Block */ && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 161 /* MethodDeclaration */ && node.parent.kind === 193 /* ObjectLiteralExpression */; + return node && node.kind === 162 /* MethodDeclaration */ && node.parent.kind === 194 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 161 /* MethodDeclaration */ && - (node.parent.kind === 193 /* ObjectLiteralExpression */ || - node.parent.kind === 214 /* ClassExpression */); + return node.kind === 162 /* MethodDeclaration */ && + (node.parent.kind === 194 /* ObjectLiteralExpression */ || + node.parent.kind === 215 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -13899,7 +13999,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return objectLiteral.properties.filter(function (property) { - if (property.kind === 281 /* PropertyAssignment */) { + if (property.kind === 282 /* PropertyAssignment */) { var propName = getTextOfPropertyName(property.name); return key === propName || (!!key2 && key2 === propName); } @@ -13940,14 +14040,14 @@ var ts; } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { - ts.Debug.assert(node.kind !== 290 /* SourceFile */); + ts.Debug.assert(node.kind !== 291 /* SourceFile */); while (true) { node = node.parent; if (!node) { return ts.Debug.fail(); // If we never pass in a SourceFile, this should be unreachable, since we'll stop when we reach that. } switch (node.kind) { - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: // If the grandparent node is an object literal (as opposed to a class), // then the computed property is not a 'this' container. // A computed property name in a class needs to be a this container @@ -13962,9 +14062,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 157 /* Decorator */: + case 158 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 156 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 157 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -13975,26 +14075,26 @@ var ts; node = node.parent; } break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 249 /* ModuleDeclaration */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 248 /* EnumDeclaration */: - case 290 /* SourceFile */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 250 /* ModuleDeclaration */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 249 /* EnumDeclaration */: + case 291 /* SourceFile */: return node; } } @@ -14004,9 +14104,9 @@ var ts; var container = getThisContainer(node, /*includeArrowFunctions*/ false); if (container) { switch (container.kind) { - case 162 /* Constructor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 163 /* Constructor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: return container; } } @@ -14028,27 +14128,27 @@ var ts; return node; } switch (node.kind) { - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: node = node.parent; break; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return node; - case 157 /* Decorator */: + case 158 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 156 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 157 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -14064,14 +14164,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 201 /* FunctionExpression */ || func.kind === 202 /* ArrowFunction */) { + if (func.kind === 202 /* FunctionExpression */ || func.kind === 203 /* ArrowFunction */) { var prev = func; var parent = func.parent; - while (parent.kind === 200 /* ParenthesizedExpression */) { + while (parent.kind === 201 /* ParenthesizedExpression */) { prev = parent; parent = parent.parent; } - if (parent.kind === 196 /* CallExpression */ && parent.expression === prev) { + if (parent.kind === 197 /* CallExpression */ && parent.expression === prev) { return parent; } } @@ -14087,7 +14187,7 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 194 /* PropertyAccessExpression */ || kind === 195 /* ElementAccessExpression */) + return (kind === 195 /* PropertyAccessExpression */ || kind === 196 /* ElementAccessExpression */) && node.expression.kind === 102 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; @@ -14096,20 +14196,20 @@ var ts; */ function isThisProperty(node) { var kind = node.kind; - return (kind === 194 /* PropertyAccessExpression */ || kind === 195 /* ElementAccessExpression */) + return (kind === 195 /* PropertyAccessExpression */ || kind === 196 /* ElementAccessExpression */) && node.expression.kind === 104 /* ThisKeyword */; } ts.isThisProperty = isThisProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return node.typeName; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 75 /* Identifier */: - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return node; } return undefined; @@ -14117,10 +14217,10 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { switch (node.kind) { - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return node.tag; - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: return node.tagName; default: return node.expression; @@ -14133,25 +14233,25 @@ var ts; return false; } switch (node.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: // classes are valid targets return true; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return parent.kind === 245 /* ClassDeclaration */; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 161 /* MethodDeclaration */: + return parent.kind === 246 /* ClassDeclaration */; + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 162 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && parent.kind === 245 /* ClassDeclaration */; - case 156 /* Parameter */: + && parent.kind === 246 /* ClassDeclaration */; + case 157 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return parent.body !== undefined - && (parent.kind === 162 /* Constructor */ - || parent.kind === 161 /* MethodDeclaration */ - || parent.kind === 164 /* SetAccessor */) - && grandparent.kind === 245 /* ClassDeclaration */; + && (parent.kind === 163 /* Constructor */ + || parent.kind === 162 /* MethodDeclaration */ + || parent.kind === 165 /* SetAccessor */) + && grandparent.kind === 246 /* ClassDeclaration */; } return false; } @@ -14167,10 +14267,10 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); // TODO: GH#18217 - case 161 /* MethodDeclaration */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 165 /* SetAccessor */: return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); // TODO: GH#18217 default: return false; @@ -14179,9 +14279,9 @@ var ts; ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 268 /* JsxOpeningElement */ || - parent.kind === 267 /* JsxSelfClosingElement */ || - parent.kind === 269 /* JsxClosingElement */) { + if (parent.kind === 269 /* JsxOpeningElement */ || + parent.kind === 268 /* JsxSelfClosingElement */ || + parent.kind === 270 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -14194,44 +14294,44 @@ var ts; case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: case 13 /* RegularExpressionLiteral */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 198 /* TaggedTemplateExpression */: - case 217 /* AsExpression */: - case 199 /* TypeAssertionExpression */: - case 218 /* NonNullExpression */: - case 200 /* ParenthesizedExpression */: - case 201 /* FunctionExpression */: - case 214 /* ClassExpression */: - case 202 /* ArrowFunction */: - case 205 /* VoidExpression */: - case 203 /* DeleteExpression */: - case 204 /* TypeOfExpression */: - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: - case 209 /* BinaryExpression */: - case 210 /* ConditionalExpression */: - case 213 /* SpreadElement */: - case 211 /* TemplateExpression */: - case 215 /* OmittedExpression */: - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 270 /* JsxFragment */: - case 212 /* YieldExpression */: - case 206 /* AwaitExpression */: - case 219 /* MetaProperty */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 199 /* TaggedTemplateExpression */: + case 218 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 219 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: + case 202 /* FunctionExpression */: + case 215 /* ClassExpression */: + case 203 /* ArrowFunction */: + case 206 /* VoidExpression */: + case 204 /* DeleteExpression */: + case 205 /* TypeOfExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: + case 210 /* BinaryExpression */: + case 211 /* ConditionalExpression */: + case 214 /* SpreadElement */: + case 212 /* TemplateExpression */: + case 216 /* OmittedExpression */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 271 /* JsxFragment */: + case 213 /* YieldExpression */: + case 207 /* AwaitExpression */: + case 220 /* MetaProperty */: return true; - case 153 /* QualifiedName */: - while (node.parent.kind === 153 /* QualifiedName */) { + case 154 /* QualifiedName */: + while (node.parent.kind === 154 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 172 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 173 /* TypeQuery */ || isJSXTagName(node); case 75 /* Identifier */: - if (node.parent.kind === 172 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 173 /* TypeQuery */ || isJSXTagName(node)) { return true; } // falls through @@ -14249,49 +14349,49 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 284 /* EnumMember */: - case 281 /* PropertyAssignment */: - case 191 /* BindingElement */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 285 /* EnumMember */: + case 282 /* PropertyAssignment */: + case 192 /* BindingElement */: return parent.initializer === node; - case 226 /* ExpressionStatement */: - case 227 /* IfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 235 /* ReturnStatement */: - case 236 /* WithStatement */: - case 237 /* SwitchStatement */: - case 277 /* CaseClause */: - case 239 /* ThrowStatement */: + case 227 /* ExpressionStatement */: + case 228 /* IfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 236 /* ReturnStatement */: + case 237 /* WithStatement */: + case 238 /* SwitchStatement */: + case 278 /* CaseClause */: + case 240 /* ThrowStatement */: return parent.expression === node; - case 230 /* ForStatement */: + case 231 /* ForStatement */: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 243 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 244 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 243 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 244 /* VariableDeclarationList */) || forInStatement.expression === node; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: return node === parent.expression; - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return node === parent.expression; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return node === parent.expression; - case 157 /* Decorator */: - case 276 /* JsxExpression */: - case 275 /* JsxSpreadAttribute */: - case 283 /* SpreadAssignment */: + case 158 /* Decorator */: + case 277 /* JsxExpression */: + case 276 /* JsxSpreadAttribute */: + case 284 /* SpreadAssignment */: return true; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return parent.objectAssignmentInitializer === node; default: return isExpressionNode(parent); @@ -14299,14 +14399,14 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isPartOfTypeQuery(node) { - while (node.kind === 153 /* QualifiedName */ || node.kind === 75 /* Identifier */) { + while (node.kind === 154 /* QualifiedName */ || node.kind === 75 /* Identifier */) { node = node.parent; } - return node.kind === 172 /* TypeQuery */; + return node.kind === 173 /* TypeQuery */; } ts.isPartOfTypeQuery = isPartOfTypeQuery; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 265 /* ExternalModuleReference */; + return node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 266 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -14315,7 +14415,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 265 /* ExternalModuleReference */; + return node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 266 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJS(file) { @@ -14347,11 +14447,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 143 /* StringKeyword */ || node.typeArguments[0].kind === 140 /* NumberKeyword */); + (node.typeArguments[0].kind === 144 /* StringKeyword */ || node.typeArguments[0].kind === 141 /* NumberKeyword */); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, requireStringLiteralLikeArgument) { - if (callExpression.kind !== 196 /* CallExpression */) { + if (callExpression.kind !== 197 /* CallExpression */) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -14483,11 +14583,11 @@ var ts; function getExpandoInitializer(initializer, isPrototypeAssignment) { if (ts.isCallExpression(initializer)) { var e = skipParentheses(initializer.expression); - return e.kind === 201 /* FunctionExpression */ || e.kind === 202 /* ArrowFunction */ ? initializer : undefined; + return e.kind === 202 /* FunctionExpression */ || e.kind === 203 /* ArrowFunction */ ? initializer : undefined; } - if (initializer.kind === 201 /* FunctionExpression */ || - initializer.kind === 214 /* ClassExpression */ || - initializer.kind === 202 /* ArrowFunction */) { + if (initializer.kind === 202 /* FunctionExpression */ || + initializer.kind === 215 /* ClassExpression */ || + initializer.kind === 203 /* ArrowFunction */) { return initializer; } if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -14713,7 +14813,7 @@ var ts; // exports.name = expr OR module.exports.name = expr OR exports["name"] = expr ... return 1 /* ExportsProperty */; } - if (isBindableStaticNameExpression(lhs, /*excludeThisKeyword*/ true) || (ts.isElementAccessExpression(lhs) && isDynamicName(lhs) && lhs.expression.kind !== 104 /* ThisKeyword */)) { + if (isBindableStaticNameExpression(lhs, /*excludeThisKeyword*/ true) || (ts.isElementAccessExpression(lhs) && isDynamicName(lhs))) { // F.G...x = expr return 5 /* Property */; } @@ -14734,7 +14834,7 @@ var ts; ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment; function isSpecialPropertyDeclaration(expr) { return isInJSFile(expr) && - expr.parent && expr.parent.kind === 226 /* ExpressionStatement */ && + expr.parent && expr.parent.kind === 227 /* ExpressionStatement */ && (!ts.isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!ts.getJSDocTypeTag(expr.parent); } @@ -14744,7 +14844,7 @@ var ts; return false; } var decl = symbol.valueDeclaration; - return decl.kind === 244 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); + return decl.kind === 245 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); } ts.isFunctionSymbol = isFunctionSymbol; function importFromModuleSpecifier(node) { @@ -14753,14 +14853,14 @@ var ts; ts.importFromModuleSpecifier = importFromModuleSpecifier; function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: return node.parent; - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: return node.parent.parent; - case 196 /* CallExpression */: + case 197 /* CallExpression */: return isImportCall(node.parent) || isRequireCall(node.parent, /*checkArg*/ false) ? node.parent : undefined; - case 187 /* LiteralType */: + case 188 /* LiteralType */: ts.Debug.assert(ts.isStringLiteral(node)); return ts.tryCast(node.parent.parent, ts.isImportTypeNode); default: @@ -14770,12 +14870,12 @@ var ts; ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier; function getExternalModuleName(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: return node.moduleSpecifier; - case 253 /* ImportEqualsDeclaration */: - return node.moduleReference.kind === 265 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; - case 188 /* ImportType */: + case 254 /* ImportEqualsDeclaration */: + return node.moduleReference.kind === 266 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; + case 189 /* ImportType */: return isLiteralImportTypeNode(node) ? node.argument.literal : undefined; default: return ts.Debug.assertNever(node); @@ -14784,11 +14884,11 @@ var ts; ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return node; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return node.exportClause && ts.tryCast(node.exportClause, ts.isNamespaceExport); default: return ts.Debug.assertNever(node); @@ -14796,7 +14896,7 @@ var ts; } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 254 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; + return node.kind === 255 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function forEachImportClauseDeclaration(node, action) { @@ -14817,13 +14917,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 156 /* Parameter */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 282 /* ShorthandPropertyAssignment */: - case 281 /* PropertyAssignment */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 157 /* Parameter */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 283 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -14837,7 +14937,7 @@ var ts; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function isJSDocTypeAlias(node) { - return node.kind === 322 /* JSDocTypedefTag */ || node.kind === 315 /* JSDocCallbackTag */ || node.kind === 316 /* JSDocEnumTag */; + return node.kind === 323 /* JSDocTypedefTag */ || node.kind === 316 /* JSDocCallbackTag */ || node.kind === 317 /* JSDocEnumTag */; } ts.isJSDocTypeAlias = isJSDocTypeAlias; function isTypeAlias(node) { @@ -14862,12 +14962,12 @@ var ts; } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: var v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return node.initializer; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return node.initializer; } } @@ -14878,7 +14978,7 @@ var ts; function getNestedModuleDeclaration(node) { return ts.isModuleDeclaration(node) && node.body && - node.body.kind === 249 /* ModuleDeclaration */ + node.body.kind === 250 /* ModuleDeclaration */ ? node.body : undefined; } @@ -14893,11 +14993,11 @@ var ts; if (ts.hasJSDocNodes(node)) { result = ts.append(result, ts.last(node.jsDoc)); } - if (node.kind === 156 /* Parameter */) { + if (node.kind === 157 /* Parameter */) { result = ts.addRange(result, ts.getJSDocParameterTags(node)); break; } - if (node.kind === 155 /* TypeParameter */) { + if (node.kind === 156 /* TypeParameter */) { result = ts.addRange(result, ts.getJSDocTypeParameterTags(node)); break; } @@ -14908,10 +15008,10 @@ var ts; ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags; function getNextJSDocCommentLocation(node) { var parent = node.parent; - if (parent.kind === 281 /* PropertyAssignment */ || - parent.kind === 259 /* ExportAssignment */ || - parent.kind === 159 /* PropertyDeclaration */ || - parent.kind === 226 /* ExpressionStatement */ && node.kind === 194 /* PropertyAccessExpression */ || + if (parent.kind === 282 /* PropertyAssignment */ || + parent.kind === 260 /* ExportAssignment */ || + parent.kind === 160 /* PropertyDeclaration */ || + parent.kind === 227 /* ExpressionStatement */ && node.kind === 195 /* PropertyAccessExpression */ || getNestedModuleDeclaration(parent) || ts.isBinaryExpression(node) && node.operatorToken.kind === 62 /* EqualsToken */) { return parent; @@ -14985,7 +15085,7 @@ var ts; ts.hasRestParameter = hasRestParameter; function isRestParameter(node) { var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type; - return node.dotDotDotToken !== undefined || !!type && type.kind === 301 /* JSDocVariadicType */; + return node.dotDotDotToken !== undefined || !!type && type.kind === 302 /* JSDocVariadicType */; } ts.isRestParameter = isRestParameter; function hasTypeArguments(node) { @@ -15002,31 +15102,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 62 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 200 /* ParenthesizedExpression */: - case 192 /* ArrayLiteralExpression */: - case 213 /* SpreadElement */: - case 218 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: + case 193 /* ArrayLiteralExpression */: + case 214 /* SpreadElement */: + case 219 /* NonNullExpression */: node = parent; break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } node = parent.parent; break; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: if (parent.name === node) { return 0 /* None */; } @@ -15053,22 +15153,22 @@ var ts; */ function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 223 /* Block */: - case 225 /* VariableStatement */: - case 236 /* WithStatement */: - case 227 /* IfStatement */: - case 237 /* SwitchStatement */: - case 251 /* CaseBlock */: - case 277 /* CaseClause */: - case 278 /* DefaultClause */: - case 238 /* LabeledStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 240 /* TryStatement */: - case 280 /* CatchClause */: + case 224 /* Block */: + case 226 /* VariableStatement */: + case 237 /* WithStatement */: + case 228 /* IfStatement */: + case 238 /* SwitchStatement */: + case 252 /* CaseBlock */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: + case 239 /* LabeledStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 241 /* TryStatement */: + case 281 /* CatchClause */: return true; } return false; @@ -15085,33 +15185,33 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 182 /* ParenthesizedType */); + return walkUp(node, 183 /* ParenthesizedType */); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 200 /* ParenthesizedExpression */); + return walkUp(node, 201 /* ParenthesizedExpression */); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; function skipParentheses(node) { - while (node.kind === 200 /* ParenthesizedExpression */) { + while (node.kind === 201 /* ParenthesizedExpression */) { node = node.expression; } return node; } ts.skipParentheses = skipParentheses; function skipParenthesesUp(node) { - while (node.kind === 200 /* ParenthesizedExpression */) { + while (node.kind === 201 /* ParenthesizedExpression */) { node = node.parent; } return node; } // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped function isDeleteTarget(node) { - if (node.kind !== 194 /* PropertyAccessExpression */ && node.kind !== 195 /* ElementAccessExpression */) { + if (node.kind !== 195 /* PropertyAccessExpression */ && node.kind !== 196 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 203 /* DeleteExpression */; + return node && node.kind === 204 /* DeleteExpression */; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -15164,7 +15264,7 @@ var ts; ts.getDeclarationFromName = getDeclarationFromName; function isLiteralComputedPropertyDeclarationName(node) { return isStringOrNumericLiteralLike(node) && - node.parent.kind === 154 /* ComputedPropertyName */ && + node.parent.kind === 155 /* ComputedPropertyName */ && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -15172,32 +15272,32 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 284 /* EnumMember */: - case 281 /* PropertyAssignment */: - case 194 /* PropertyAccessExpression */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 285 /* EnumMember */: + case 282 /* PropertyAssignment */: + case 195 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: // Name on right hand side of dot in a type query or type reference if (parent.right === node) { - while (parent.kind === 153 /* QualifiedName */) { + while (parent.kind === 154 /* QualifiedName */) { parent = parent.parent; } - return parent.kind === 172 /* TypeQuery */ || parent.kind === 169 /* TypeReference */; + return parent.kind === 173 /* TypeQuery */ || parent.kind === 170 /* TypeReference */; } return false; - case 191 /* BindingElement */: - case 258 /* ImportSpecifier */: + case 192 /* BindingElement */: + case 259 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 263 /* ExportSpecifier */: - case 273 /* JsxAttribute */: + case 264 /* ExportSpecifier */: + case 274 /* JsxAttribute */: // Any name in an export specifier or JSX Attribute return true; } @@ -15217,33 +15317,33 @@ var ts; // {} // {name: } function isAliasSymbolDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */ || - node.kind === 252 /* NamespaceExportDeclaration */ || - node.kind === 255 /* ImportClause */ && !!node.name || - node.kind === 256 /* NamespaceImport */ || - node.kind === 262 /* NamespaceExport */ || - node.kind === 258 /* ImportSpecifier */ || - node.kind === 263 /* ExportSpecifier */ || - node.kind === 259 /* ExportAssignment */ && exportAssignmentIsAlias(node) || + return node.kind === 254 /* ImportEqualsDeclaration */ || + node.kind === 253 /* NamespaceExportDeclaration */ || + node.kind === 256 /* ImportClause */ && !!node.name || + node.kind === 257 /* NamespaceImport */ || + node.kind === 263 /* NamespaceExport */ || + node.kind === 259 /* ImportSpecifier */ || + node.kind === 264 /* ExportSpecifier */ || + node.kind === 260 /* ExportAssignment */ && exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableExpression(node.parent.right) || - node.kind === 282 /* ShorthandPropertyAssignment */ || - node.kind === 281 /* PropertyAssignment */ && isAliasableExpression(node.initializer); + node.kind === 283 /* ShorthandPropertyAssignment */ || + node.kind === 282 /* PropertyAssignment */ && isAliasableExpression(node.initializer); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getAliasDeclarationFromName(node) { switch (node.parent.kind) { - case 255 /* ImportClause */: - case 258 /* ImportSpecifier */: - case 256 /* NamespaceImport */: - case 263 /* ExportSpecifier */: - case 259 /* ExportAssignment */: - case 253 /* ImportEqualsDeclaration */: + case 256 /* ImportClause */: + case 259 /* ImportSpecifier */: + case 257 /* NamespaceImport */: + case 264 /* ExportSpecifier */: + case 260 /* ExportAssignment */: + case 254 /* ImportEqualsDeclaration */: return node.parent; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: do { node = node.parent; - } while (node.parent.kind === 153 /* QualifiedName */); + } while (node.parent.kind === 154 /* QualifiedName */); return getAliasDeclarationFromName(node); } } @@ -15262,7 +15362,7 @@ var ts; } ts.getExportAssignmentExpression = getExportAssignmentExpression; function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 282 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 281 /* PropertyAssignment */ ? node.initializer : + return node.kind === 283 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 282 /* PropertyAssignment */ ? node.initializer : node.parent.right; } ts.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression; @@ -15328,11 +15428,11 @@ var ts; } ts.getAncestor = getAncestor; function isKeyword(token) { - return 77 /* FirstKeyword */ <= token && token <= 152 /* LastKeyword */; + return 77 /* FirstKeyword */ <= token && token <= 153 /* LastKeyword */; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 122 /* FirstContextualKeyword */ <= token && token <= 152 /* LastContextualKeyword */; + return 122 /* FirstContextualKeyword */ <= token && token <= 153 /* LastContextualKeyword */; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -15376,14 +15476,14 @@ var ts; } var flags = 0 /* Normal */; switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 161 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 162 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } // falls through - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: if (hasModifier(node, 256 /* Async */)) { flags |= 2 /* Async */; } @@ -15397,10 +15497,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: return node.body !== undefined && node.asteriskToken === undefined && hasModifier(node, 256 /* Async */); @@ -15433,7 +15533,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - if (!(name.kind === 154 /* ComputedPropertyName */ || name.kind === 195 /* ElementAccessExpression */)) { + if (!(name.kind === 155 /* ComputedPropertyName */ || name.kind === 196 /* ElementAccessExpression */)) { return false; } var expr = ts.isElementAccessExpression(name) ? name.argumentExpression : name.expression; @@ -15459,7 +15559,7 @@ var ts; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -15522,11 +15622,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 156 /* Parameter */; + return root.kind === 157 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 191 /* BindingElement */) { + while (node.kind === 192 /* BindingElement */) { node = node.parent.parent; } return node; @@ -15534,15 +15634,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 162 /* Constructor */ - || kind === 201 /* FunctionExpression */ - || kind === 244 /* FunctionDeclaration */ - || kind === 202 /* ArrowFunction */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */ - || kind === 249 /* ModuleDeclaration */ - || kind === 290 /* SourceFile */; + return kind === 163 /* Constructor */ + || kind === 202 /* FunctionExpression */ + || kind === 245 /* FunctionDeclaration */ + || kind === 203 /* ArrowFunction */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */ + || kind === 250 /* ModuleDeclaration */ + || kind === 291 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -15561,23 +15661,23 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 197 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 198 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 197 /* NewExpression */: + case 198 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 207 /* PrefixUnaryExpression */: - case 204 /* TypeOfExpression */: - case 205 /* VoidExpression */: - case 203 /* DeleteExpression */: - case 206 /* AwaitExpression */: - case 210 /* ConditionalExpression */: - case 212 /* YieldExpression */: + case 208 /* PrefixUnaryExpression */: + case 205 /* TypeOfExpression */: + case 206 /* VoidExpression */: + case 204 /* DeleteExpression */: + case 207 /* AwaitExpression */: + case 211 /* ConditionalExpression */: + case 213 /* YieldExpression */: return 1 /* Right */; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (operator) { case 42 /* AsteriskAsteriskToken */: case 62 /* EqualsToken */: @@ -15601,15 +15701,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 197 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 198 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 209 /* BinaryExpression */) { + if (expression.kind === 210 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 207 /* PrefixUnaryExpression */ || expression.kind === 208 /* PostfixUnaryExpression */) { + else if (expression.kind === 208 /* PrefixUnaryExpression */ || expression.kind === 209 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -15619,15 +15719,15 @@ var ts; ts.getOperator = getOperator; function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: return 0; - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return 1; - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return 2; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return 4; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (operatorKind) { case 27 /* CommaToken */: return 0; @@ -15648,21 +15748,21 @@ var ts; default: return getBinaryOperatorPrecedence(operatorKind); } - case 207 /* PrefixUnaryExpression */: - case 204 /* TypeOfExpression */: - case 205 /* VoidExpression */: - case 203 /* DeleteExpression */: - case 206 /* AwaitExpression */: + case 208 /* PrefixUnaryExpression */: + case 205 /* TypeOfExpression */: + case 206 /* VoidExpression */: + case 204 /* DeleteExpression */: + case 207 /* AwaitExpression */: return 16; - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return 17; - case 196 /* CallExpression */: + case 197 /* CallExpression */: return 18; - case 197 /* NewExpression */: + case 198 /* NewExpression */: return hasArguments ? 19 : 18; - case 198 /* TaggedTemplateExpression */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 199 /* TaggedTemplateExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return 19; case 104 /* ThisKeyword */: case 102 /* SuperKeyword */: @@ -15673,19 +15773,19 @@ var ts; case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 214 /* ClassExpression */: - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 270 /* JsxFragment */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 215 /* ClassExpression */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 271 /* JsxFragment */: case 13 /* RegularExpressionLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 211 /* TemplateExpression */: - case 200 /* ParenthesizedExpression */: - case 215 /* OmittedExpression */: + case 212 /* TemplateExpression */: + case 201 /* ParenthesizedExpression */: + case 216 /* OmittedExpression */: return 20; default: return -1; @@ -16287,10 +16387,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 163 /* GetAccessor */) { + if (accessor.kind === 164 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 164 /* SetAccessor */) { + else if (accessor.kind === 165 /* SetAccessor */) { setAccessor = accessor; } else { @@ -16310,10 +16410,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 163 /* GetAccessor */ && !getAccessor) { + if (member.kind === 164 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 164 /* SetAccessor */ && !setAccessor) { + if (member.kind === 165 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -16362,7 +16462,7 @@ var ts; ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations; /** template tags are only available when a typedef isn't already using them */ function isNonTypeAliasTemplate(tag) { - return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 303 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); + return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 304 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); } /** * Gets the effective type annotation of the value parameter of a set accessor. If the node @@ -16586,7 +16686,7 @@ var ts; } ts.getSelectedModifierFlags = getSelectedModifierFlags; function getModifierFlags(node) { - if (node.kind >= 0 /* FirstToken */ && node.kind <= 152 /* LastToken */) { + if (node.kind >= 0 /* FirstToken */ && node.kind <= 153 /* LastToken */) { return 0 /* None */; } if (node.modifierFlagsCache & 536870912 /* HasComputedFlags */) { @@ -16628,11 +16728,11 @@ var ts; case 117 /* PrivateKeyword */: return 8 /* Private */; case 122 /* AbstractKeyword */: return 128 /* Abstract */; case 89 /* ExportKeyword */: return 1 /* Export */; - case 130 /* DeclareKeyword */: return 2 /* Ambient */; + case 131 /* DeclareKeyword */: return 2 /* Ambient */; case 81 /* ConstKeyword */: return 2048 /* Const */; case 84 /* DefaultKeyword */: return 512 /* Default */; case 126 /* AsyncKeyword */: return 256 /* Async */; - case 138 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 139 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } @@ -16672,8 +16772,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 193 /* ObjectLiteralExpression */ - || kind === 192 /* ArrayLiteralExpression */; + return kind === 194 /* ObjectLiteralExpression */ + || kind === 193 /* ArrayLiteralExpression */; } return false; } @@ -16690,12 +16790,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: do { node = node.left; } while (node.kind !== 75 /* Identifier */); return node; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 75 /* Identifier */); @@ -16705,14 +16805,19 @@ var ts; ts.getFirstIdentifier = getFirstIdentifier; function isDottedName(node) { return node.kind === 75 /* Identifier */ || node.kind === 104 /* ThisKeyword */ || node.kind === 102 /* SuperKeyword */ || - node.kind === 194 /* PropertyAccessExpression */ && isDottedName(node.expression) || - node.kind === 200 /* ParenthesizedExpression */ && isDottedName(node.expression); + node.kind === 195 /* PropertyAccessExpression */ && isDottedName(node.expression) || + node.kind === 201 /* ParenthesizedExpression */ && isDottedName(node.expression); } ts.isDottedName = isDottedName; function isPropertyAccessEntityNameExpression(node) { return ts.isPropertyAccessExpression(node) && isEntityNameExpression(node.expression); } ts.isPropertyAccessEntityNameExpression = isPropertyAccessEntityNameExpression; + function isConstructorAccessExpression(expr) { + return (ts.isPropertyAccessExpression(expr) && ts.idText(expr.name) === "constructor" || + ts.isElementAccessExpression(expr) && ts.isStringLiteralLike(expr.argumentExpression) && expr.argumentExpression.text === "constructor"); + } + ts.isConstructorAccessExpression = isConstructorAccessExpression; function tryGetPropertyAccessOrIdentifierToString(expr) { if (ts.isPropertyAccessExpression(expr)) { var baseStr = tryGetPropertyAccessOrIdentifierToString(expr.expression); @@ -16731,17 +16836,17 @@ var ts; } ts.isPrototypeAccess = isPrototypeAccess; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 153 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 154 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 193 /* ObjectLiteralExpression */ && + return expression.kind === 194 /* ObjectLiteralExpression */ && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 192 /* ArrayLiteralExpression */ && + return expression.kind === 193 /* ArrayLiteralExpression */ && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -17039,8 +17144,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 248 /* EnumDeclaration */: - case 249 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: + case 250 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -17117,35 +17222,35 @@ var ts; if (!parent) return 0 /* Read */; switch (parent.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return accessKind(parent); - case 208 /* PostfixUnaryExpression */: - case 207 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: var operator = parent.operator; return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 62 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return parent.name !== node ? 0 /* Read */ : accessKind(parent); - case 281 /* PropertyAssignment */: { + case 282 /* PropertyAssignment */: { var parentAccess = accessKind(parent.parent); // In `({ x: varname }) = { x: 1 }`, the left `x` is a read, the right `x` is a write. return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess; } - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: // Assume it's the local variable being accessed, since we don't check public properties for --noUnusedLocals. return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return accessKind(parent); default: return 0 /* Read */; } function writeOrReadWrite() { // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect. - return parent.parent && skipParenthesesUp(parent.parent).kind === 226 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; + return parent.parent && skipParenthesesUp(parent.parent).kind === 227 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; } } function reverseAccessKind(a) { @@ -17294,39 +17399,39 @@ var ts; } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; function isTypeNodeKind(kind) { - return (kind >= 168 /* FirstTypeNode */ && kind <= 188 /* LastTypeNode */) + return (kind >= 169 /* FirstTypeNode */ && kind <= 189 /* LastTypeNode */) || kind === 125 /* AnyKeyword */ - || kind === 148 /* UnknownKeyword */ - || kind === 140 /* NumberKeyword */ - || kind === 151 /* BigIntKeyword */ - || kind === 141 /* ObjectKeyword */ - || kind === 128 /* BooleanKeyword */ - || kind === 143 /* StringKeyword */ - || kind === 144 /* SymbolKeyword */ + || kind === 149 /* UnknownKeyword */ + || kind === 141 /* NumberKeyword */ + || kind === 152 /* BigIntKeyword */ + || kind === 142 /* ObjectKeyword */ + || kind === 129 /* BooleanKeyword */ + || kind === 144 /* StringKeyword */ + || kind === 145 /* SymbolKeyword */ || kind === 104 /* ThisKeyword */ || kind === 110 /* VoidKeyword */ - || kind === 146 /* UndefinedKeyword */ + || kind === 147 /* UndefinedKeyword */ || kind === 100 /* NullKeyword */ - || kind === 137 /* NeverKeyword */ - || kind === 216 /* ExpressionWithTypeArguments */ - || kind === 295 /* JSDocAllType */ - || kind === 296 /* JSDocUnknownType */ - || kind === 297 /* JSDocNullableType */ - || kind === 298 /* JSDocNonNullableType */ - || kind === 299 /* JSDocOptionalType */ - || kind === 300 /* JSDocFunctionType */ - || kind === 301 /* JSDocVariadicType */; + || kind === 138 /* NeverKeyword */ + || kind === 217 /* ExpressionWithTypeArguments */ + || kind === 296 /* JSDocAllType */ + || kind === 297 /* JSDocUnknownType */ + || kind === 298 /* JSDocNullableType */ + || kind === 299 /* JSDocNonNullableType */ + || kind === 300 /* JSDocOptionalType */ + || kind === 301 /* JSDocFunctionType */ + || kind === 302 /* JSDocVariadicType */; } ts.isTypeNodeKind = isTypeNodeKind; function isAccessExpression(node) { - return node.kind === 194 /* PropertyAccessExpression */ || node.kind === 195 /* ElementAccessExpression */; + return node.kind === 195 /* PropertyAccessExpression */ || node.kind === 196 /* ElementAccessExpression */; } ts.isAccessExpression = isAccessExpression; function getNameOfAccessExpression(node) { - if (node.kind === 194 /* PropertyAccessExpression */) { + if (node.kind === 195 /* PropertyAccessExpression */) { return node.name; } - ts.Debug.assert(node.kind === 195 /* ElementAccessExpression */); + ts.Debug.assert(node.kind === 196 /* ElementAccessExpression */); return node.argumentExpression; } ts.getNameOfAccessExpression = getNameOfAccessExpression; @@ -17340,12 +17445,8 @@ var ts; } } ts.isBundleFileTextLike = isBundleFileTextLike; - function getDotOrQuestionDotToken(node) { - return node.questionDotToken || ts.createNode(24 /* DotToken */, node.expression.end, node.name.pos); - } - ts.getDotOrQuestionDotToken = getDotOrQuestionDotToken; function isNamedImportsOrExports(node) { - return node.kind === 257 /* NamedImports */ || node.kind === 261 /* NamedExports */; + return node.kind === 258 /* NamedImports */ || node.kind === 262 /* NamedExports */; } ts.isNamedImportsOrExports = isNamedImportsOrExports; function Symbol(flags, name) { @@ -18423,34 +18524,44 @@ var ts; function isValidTypeOnlyAliasUseSite(useSite) { return !!(useSite.flags & 8388608 /* Ambient */) || isPartOfTypeQuery(useSite) - || isFirstIdentifierOfNonEmittingHeritageClause(useSite) + || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !isExpressionNode(useSite); } ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite; function typeOnlyDeclarationIsExport(typeOnlyDeclaration) { - return typeOnlyDeclaration.kind === 263 /* ExportSpecifier */; + return typeOnlyDeclaration.kind === 264 /* ExportSpecifier */; } ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport; function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { - while (node.kind === 75 /* Identifier */ || node.kind === 194 /* PropertyAccessExpression */) { + while (node.kind === 75 /* Identifier */ || node.kind === 195 /* PropertyAccessExpression */) { node = node.parent; } - if (node.kind !== 154 /* ComputedPropertyName */) { + if (node.kind !== 155 /* ComputedPropertyName */) { return false; } if (hasModifier(node.parent, 128 /* Abstract */)) { return true; } var containerKind = node.parent.parent.kind; - return containerKind === 246 /* InterfaceDeclaration */ || containerKind === 173 /* TypeLiteral */; + return containerKind === 247 /* InterfaceDeclaration */ || containerKind === 174 /* TypeLiteral */; } - /** Returns true for the first identifier of 1) an `implements` clause, and 2) an `extends` clause of an interface. */ - function isFirstIdentifierOfNonEmittingHeritageClause(node) { - var _a, _b; - // Number of parents to climb from identifier is 2 for `implements I`, 3 for `implements x.I` - var heritageClause = (_a = ts.tryCast(node.parent.parent, ts.isHeritageClause)) !== null && _a !== void 0 ? _a : ts.tryCast((_b = node.parent.parent) === null || _b === void 0 ? void 0 : _b.parent, ts.isHeritageClause); - return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 246 /* InterfaceDeclaration */; + /** Returns true for an identifier in 1) an `implements` clause, and 2) an `extends` clause of an interface. */ + function isIdentifierInNonEmittingHeritageClause(node) { + if (node.kind !== 75 /* Identifier */) + return false; + var heritageClause = findAncestor(node.parent, function (parent) { + switch (parent.kind) { + case 280 /* HeritageClause */: + return true; + case 195 /* PropertyAccessExpression */: + case 217 /* ExpressionWithTypeArguments */: + return false; + default: + return "quit"; + } + }); + return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 247 /* InterfaceDeclaration */; } })(ts || (ts = {})); var ts; @@ -18470,7 +18581,7 @@ var ts; var PrivateIdentifierConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 290 /* SourceFile */) { + if (kind === 291 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 75 /* Identifier */) { @@ -18525,19 +18636,19 @@ var ts; * that they appear in the source code. The language service depends on this property to locate nodes by position. */ function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 152 /* LastToken */) { + if (!node || node.kind <= 153 /* LastToken */) { return; } switch (node.kind) { - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -18545,9 +18656,9 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 156 /* Parameter */: + case 157 /* Parameter */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || @@ -18555,7 +18666,7 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -18563,51 +18674,51 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.initializer); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -18619,359 +18730,359 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return visitNode(cbNode, node.assertsModifier) || visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return visitNodes(cbNode, cbNodes, node.members); - case 174 /* ArrayType */: + case 175 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 175 /* TupleType */: + case 176 /* TupleType */: return visitNodes(cbNode, cbNodes, node.elementTypes); - case 178 /* UnionType */: - case 179 /* IntersectionType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: return visitNodes(cbNode, cbNodes, node.types); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return visitNode(cbNode, node.checkType) || visitNode(cbNode, node.extendsType) || visitNode(cbNode, node.trueType) || visitNode(cbNode, node.falseType); - case 181 /* InferType */: + case 182 /* InferType */: return visitNode(cbNode, node.typeParameter); - case 188 /* ImportType */: + case 189 /* ImportType */: return visitNode(cbNode, node.argument) || visitNode(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 182 /* ParenthesizedType */: - case 184 /* TypeOperator */: + case 183 /* ParenthesizedType */: + case 185 /* TypeOperator */: return visitNode(cbNode, node.type); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 186 /* MappedType */: + case 187 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 187 /* LiteralType */: + case 188 /* LiteralType */: return visitNode(cbNode, node.literal); - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: return visitNodes(cbNode, cbNodes, node.elements); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return visitNodes(cbNode, cbNodes, node.properties); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.name); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.argumentExpression); - case 196 /* CallExpression */: - case 197 /* NewExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.template); - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 217 /* AsExpression */: + case 218 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return visitNode(cbNode, node.name); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 223 /* Block */: - case 250 /* ModuleBlock */: + case 224 /* Block */: + case 251 /* ModuleBlock */: return visitNodes(cbNode, cbNodes, node.statements); - case 290 /* SourceFile */: + case 291 /* SourceFile */: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return visitNodes(cbNode, cbNodes, node.declarations); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 233 /* ContinueStatement */: - case 234 /* BreakStatement */: + case 234 /* ContinueStatement */: + case 235 /* BreakStatement */: return visitNode(cbNode, node.label); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return visitNodes(cbNode, cbNodes, node.clauses); - case 277 /* CaseClause */: + case 278 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: return visitNodes(cbNode, cbNodes, node.statements); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 157 /* Decorator */: + case 158 /* Decorator */: return visitNode(cbNode, node.expression); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 284 /* EnumMember */: + case 285 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: return visitNode(cbNode, node.name); - case 257 /* NamedImports */: - case 261 /* NamedExports */: + case 258 /* NamedImports */: + case 262 /* NamedExports */: return visitNodes(cbNode, cbNodes, node.elements); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: return visitNodes(cbNode, cbNodes, node.types); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 264 /* MissingDeclaration */: + case 265 /* MissingDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators); - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 266 /* JsxElement */: + case 267 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.attributes); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return visitNodes(cbNode, cbNodes, node.properties); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 275 /* JsxSpreadAttribute */: + case 276 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 176 /* OptionalType */: - case 177 /* RestType */: - case 294 /* JSDocTypeExpression */: - case 298 /* JSDocNonNullableType */: - case 297 /* JSDocNullableType */: - case 299 /* JSDocOptionalType */: - case 301 /* JSDocVariadicType */: + case 177 /* OptionalType */: + case 178 /* RestType */: + case 295 /* JSDocTypeExpression */: + case 299 /* JSDocNonNullableType */: + case 298 /* JSDocNullableType */: + case 300 /* JSDocOptionalType */: + case 302 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 303 /* JSDocComment */: + case 304 /* JSDocComment */: return visitNodes(cbNode, cbNodes, node.tags); - case 317 /* JSDocParameterTag */: - case 323 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: + case 324 /* JSDocPropertyTag */: return visitNode(cbNode, node.tagName) || (node.isNameFirst ? visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression) : visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name)); - case 309 /* JSDocAuthorTag */: + case 310 /* JSDocAuthorTag */: return visitNode(cbNode, node.tagName); - case 308 /* JSDocImplementsTag */: + case 309 /* JSDocImplementsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 307 /* JSDocAugmentsTag */: + case 308 /* JSDocAugmentsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); - case 322 /* JSDocTypedefTag */: + case 323 /* JSDocTypedefTag */: return visitNode(cbNode, node.tagName) || (node.typeExpression && - node.typeExpression.kind === 294 /* JSDocTypeExpression */ + node.typeExpression.kind === 295 /* JSDocTypeExpression */ ? visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) : visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression)); - case 315 /* JSDocCallbackTag */: + case 316 /* JSDocCallbackTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); - case 318 /* JSDocReturnTag */: - case 320 /* JSDocTypeTag */: - case 319 /* JSDocThisTag */: - case 316 /* JSDocEnumTag */: + case 319 /* JSDocReturnTag */: + case 321 /* JSDocTypeTag */: + case 320 /* JSDocThisTag */: + case 317 /* JSDocEnumTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.typeExpression); - case 305 /* JSDocSignature */: + case 306 /* JSDocSignature */: return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); - case 304 /* JSDocTypeLiteral */: + case 305 /* JSDocTypeLiteral */: return ts.forEach(node.jsDocPropertyTags, cbNode); - case 306 /* JSDocTag */: - case 310 /* JSDocClassTag */: - case 311 /* JSDocPublicTag */: - case 312 /* JSDocPrivateTag */: - case 313 /* JSDocProtectedTag */: - case 314 /* JSDocReadonlyTag */: + case 307 /* JSDocTag */: + case 311 /* JSDocClassTag */: + case 312 /* JSDocPublicTag */: + case 313 /* JSDocPrivateTag */: + case 314 /* JSDocProtectedTag */: + case 315 /* JSDocReadonlyTag */: return visitNode(cbNode, node.tagName); - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } } @@ -19260,7 +19371,7 @@ var ts; sourceFile.endOfFileToken = parseTokenNode(); } else { - var statement = createNode(226 /* ExpressionStatement */); + var statement = createNode(227 /* ExpressionStatement */); switch (token()) { case 22 /* OpenBracketToken */: statement.expression = parseArrayLiteralExpression(); @@ -19344,6 +19455,7 @@ var ts; } function clearState() { // Clear out the text the scanner is pointing at, so it doesn't keep anything alive unnecessarily. + scanner.clearCommentDirectives(); scanner.setText(""); scanner.setOnError(undefined); // Clear any data. We don't want to accidentally hold onto it for too long. @@ -19370,6 +19482,7 @@ var ts; ts.Debug.assert(token() === 1 /* EndOfFileToken */); sourceFile.endOfFileToken = addJSDocComment(parseTokenNode()); setExternalModuleIndicator(sourceFile); + sourceFile.commentDirectives = scanner.getCommentDirectives(); sourceFile.nodeCount = nodeCount; sourceFile.identifierCount = identifierCount; sourceFile.identifiers = identifiers; @@ -19410,7 +19523,7 @@ var ts; function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(290 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(291 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -19742,7 +19855,7 @@ var ts; } function createNodeWithJSDoc(kind, pos) { var node = createNode(kind, pos); - if (scanner.getTokenFlags() & 2 /* PrecedingJSDocComment */) { + if (scanner.getTokenFlags() & 2 /* PrecedingJSDocComment */ && (kind !== 227 /* ExpressionStatement */ || token() !== 20 /* OpenParenToken */)) { addJSDocComment(node); } return node; @@ -19854,7 +19967,7 @@ var ts; // PropertyName [Yield]: // LiteralPropertyName // ComputedPropertyName[?Yield] - var node = createNode(154 /* ComputedPropertyName */); + var node = createNode(155 /* ComputedPropertyName */); parseExpected(22 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -19896,15 +20009,15 @@ var ts; if (token() === 84 /* DefaultKeyword */) { return lookAhead(nextTokenCanFollowDefaultKeyword); } - if (token() === 145 /* TypeKeyword */) { + if (token() === 146 /* TypeKeyword */) { return lookAhead(nextTokenCanFollowExportModifier); } return canFollowExportModifier(); case 84 /* DefaultKeyword */: return nextTokenCanFollowDefaultKeyword(); case 120 /* StaticKeyword */: - case 131 /* GetKeyword */: - case 142 /* SetKeyword */: + case 132 /* GetKeyword */: + case 143 /* SetKeyword */: nextToken(); return canFollowModifier(); default: @@ -20314,20 +20427,20 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 162 /* Constructor */: - case 167 /* IndexSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 159 /* PropertyDeclaration */: - case 222 /* SemicolonClassElement */: + case 163 /* Constructor */: + case 168 /* IndexSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 223 /* SemicolonClassElement */: return true; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: // Method declarations are not necessarily reusable. An object-literal // may have a method calls "constructor(...)" and we must reparse that // into an actual .ConstructorDeclaration. var methodDeclaration = node; var nameIsConstructor = methodDeclaration.name.kind === 75 /* Identifier */ && - methodDeclaration.name.originalKeywordKind === 129 /* ConstructorKeyword */; + methodDeclaration.name.originalKeywordKind === 130 /* ConstructorKeyword */; return !nameIsConstructor; } } @@ -20336,8 +20449,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: return true; } } @@ -20346,58 +20459,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 225 /* VariableStatement */: - case 223 /* Block */: - case 227 /* IfStatement */: - case 226 /* ExpressionStatement */: - case 239 /* ThrowStatement */: - case 235 /* ReturnStatement */: - case 237 /* SwitchStatement */: - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 230 /* ForStatement */: - case 229 /* WhileStatement */: - case 236 /* WithStatement */: - case 224 /* EmptyStatement */: - case 240 /* TryStatement */: - case 238 /* LabeledStatement */: - case 228 /* DoStatement */: - case 241 /* DebuggerStatement */: - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 260 /* ExportDeclaration */: - case 259 /* ExportAssignment */: - case 249 /* ModuleDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 245 /* FunctionDeclaration */: + case 226 /* VariableStatement */: + case 224 /* Block */: + case 228 /* IfStatement */: + case 227 /* ExpressionStatement */: + case 240 /* ThrowStatement */: + case 236 /* ReturnStatement */: + case 238 /* SwitchStatement */: + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 231 /* ForStatement */: + case 230 /* WhileStatement */: + case 237 /* WithStatement */: + case 225 /* EmptyStatement */: + case 241 /* TryStatement */: + case 239 /* LabeledStatement */: + case 229 /* DoStatement */: + case 242 /* DebuggerStatement */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 261 /* ExportDeclaration */: + case 260 /* ExportAssignment */: + case 250 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 284 /* EnumMember */; + return node.kind === 285 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 166 /* ConstructSignature */: - case 160 /* MethodSignature */: - case 167 /* IndexSignature */: - case 158 /* PropertySignature */: - case 165 /* CallSignature */: + case 167 /* ConstructSignature */: + case 161 /* MethodSignature */: + case 168 /* IndexSignature */: + case 159 /* PropertySignature */: + case 166 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 242 /* VariableDeclaration */) { + if (node.kind !== 243 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -20418,7 +20531,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 156 /* Parameter */) { + if (node.kind !== 157 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -20557,7 +20670,7 @@ var ts; return entity; } function createQualifiedName(entity, name) { - var node = createNode(153 /* QualifiedName */, entity.pos); + var node = createNode(154 /* QualifiedName */, entity.pos); node.left = entity; node.right = name; return finishNode(node); @@ -20598,7 +20711,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression(isTaggedTemplate) { - var template = createNode(211 /* TemplateExpression */); + var template = createNode(212 /* TemplateExpression */); template.head = parseTemplateHead(isTaggedTemplate); ts.Debug.assert(template.head.kind === 15 /* TemplateHead */, "Template head has wrong token kind"); var list = []; @@ -20610,7 +20723,7 @@ var ts; return finishNode(template); } function parseTemplateSpan(isTaggedTemplate) { - var span = createNode(221 /* TemplateSpan */); + var span = createNode(222 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token() === 19 /* CloseBraceToken */) { @@ -20676,7 +20789,7 @@ var ts; } // TYPES function parseTypeReference() { - var node = createNode(169 /* TypeReference */); + var node = createNode(170 /* TypeReference */); node.typeName = parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29 /* LessThanToken */) { node.typeArguments = parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */); @@ -20686,14 +20799,14 @@ var ts; // If true, we should abort parsing an error function. function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return ts.nodeIsMissing(node.typeName); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: { + case 171 /* FunctionType */: + case 172 /* ConstructorType */: { var _a = node, parameters = _a.parameters, type = _a.type; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -20701,20 +20814,20 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(168 /* TypePredicate */, lhs.pos); + var node = createNode(169 /* TypePredicate */, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(183 /* ThisType */); + var node = createNode(184 /* ThisType */); nextToken(); return finishNode(node); } function parseJSDocAllType(postFixEquals) { - var result = createNode(295 /* JSDocAllType */); + var result = createNode(296 /* JSDocAllType */); if (postFixEquals) { - return createPostfixType(299 /* JSDocOptionalType */, result); + return createPostfixType(300 /* JSDocOptionalType */, result); } else { nextToken(); @@ -20722,7 +20835,7 @@ var ts; return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(298 /* JSDocNonNullableType */); + var result = createNode(299 /* JSDocNonNullableType */); nextToken(); result.type = parseNonArrayType(); return finishNode(result); @@ -20746,28 +20859,28 @@ var ts; token() === 31 /* GreaterThanToken */ || token() === 62 /* EqualsToken */ || token() === 51 /* BarToken */) { - var result = createNode(296 /* JSDocUnknownType */, pos); + var result = createNode(297 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(297 /* JSDocNullableType */, pos); + var result = createNode(298 /* JSDocNullableType */, pos); result.type = parseType(); return finishNode(result); } } function parseJSDocFunctionType() { if (lookAhead(nextTokenIsOpenParen)) { - var result = createNodeWithJSDoc(300 /* JSDocFunctionType */); + var result = createNodeWithJSDoc(301 /* JSDocFunctionType */); nextToken(); fillSignature(58 /* ColonToken */, 4 /* Type */ | 32 /* JSDoc */, result); return finishNode(result); } - var node = createNode(169 /* TypeReference */); + var node = createNode(170 /* TypeReference */); node.typeName = parseIdentifierName(); return finishNode(node); } function parseJSDocParameter() { - var parameter = createNode(156 /* Parameter */); + var parameter = createNode(157 /* Parameter */); if (token() === 104 /* ThisKeyword */ || token() === 99 /* NewKeyword */) { parameter.name = parseIdentifierName(); parseExpected(58 /* ColonToken */); @@ -20777,9 +20890,9 @@ var ts; } function parseJSDocType() { scanner.setInJSDocType(true); - var moduleSpecifier = parseOptionalToken(135 /* ModuleKeyword */); + var moduleSpecifier = parseOptionalToken(136 /* ModuleKeyword */); if (moduleSpecifier) { - var moduleTag = createNode(302 /* JSDocNamepathType */, moduleSpecifier.pos); + var moduleTag = createNode(303 /* JSDocNamepathType */, moduleSpecifier.pos); terminate: while (true) { switch (token()) { case 19 /* CloseBraceToken */: @@ -20798,23 +20911,23 @@ var ts; var type = parseTypeOrTypePredicate(); scanner.setInJSDocType(false); if (dotdotdot) { - var variadic = createNode(301 /* JSDocVariadicType */, dotdotdot.pos); + var variadic = createNode(302 /* JSDocVariadicType */, dotdotdot.pos); variadic.type = type; type = finishNode(variadic); } if (token() === 62 /* EqualsToken */) { - return createPostfixType(299 /* JSDocOptionalType */, type); + return createPostfixType(300 /* JSDocOptionalType */, type); } return type; } function parseTypeQuery() { - var node = createNode(172 /* TypeQuery */); + var node = createNode(173 /* TypeQuery */); parseExpected(108 /* TypeOfKeyword */); node.exprName = parseEntityName(/*allowReservedWords*/ true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(155 /* TypeParameter */); + var node = createNode(156 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(90 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the @@ -20859,7 +20972,7 @@ var ts; isStartOfType(/*inStartOfParameter*/ !isJSDocParameter); } function parseParameter() { - var node = createNodeWithJSDoc(156 /* Parameter */); + var node = createNodeWithJSDoc(157 /* Parameter */); if (token() === 104 /* ThisKeyword */) { node.name = createIdentifier(/*isIdentifier*/ true); node.type = parseParameterType(); @@ -20960,7 +21073,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 166 /* ConstructSignature */) { + if (kind === 167 /* ConstructSignature */) { parseExpected(99 /* NewKeyword */); } fillSignature(58 /* ColonToken */, 4 /* Type */, node); @@ -21021,7 +21134,7 @@ var ts; return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(node) { - node.kind = 167 /* IndexSignature */; + node.kind = 168 /* IndexSignature */; node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -21031,13 +21144,13 @@ var ts; node.name = parsePropertyName(); node.questionToken = parseOptionalToken(57 /* QuestionToken */); if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - node.kind = 160 /* MethodSignature */; + node.kind = 161 /* MethodSignature */; // Method signatures don't exist in expression contexts. So they have neither // [Yield] nor [Await] fillSignature(58 /* ColonToken */, 4 /* Type */, node); } else { - node.kind = 158 /* PropertySignature */; + node.kind = 159 /* PropertySignature */; node.type = parseTypeAnnotation(); if (token() === 62 /* EqualsToken */) { // Although type literal properties cannot not have initializers, we attempt @@ -21083,10 +21196,10 @@ var ts; } function parseTypeMember() { if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - return parseSignatureMember(165 /* CallSignature */); + return parseSignatureMember(166 /* CallSignature */); } if (token() === 99 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(166 /* ConstructSignature */); + return parseSignatureMember(167 /* ConstructSignature */); } var node = createNodeWithJSDoc(0 /* Unknown */); node.modifiers = parseModifiers(); @@ -21112,7 +21225,7 @@ var ts; return false; } function parseTypeLiteral() { - var node = createNode(173 /* TypeLiteral */); + var node = createNode(174 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -21130,27 +21243,27 @@ var ts; function isStartOfMappedType() { nextToken(); if (token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { - return nextToken() === 138 /* ReadonlyKeyword */; + return nextToken() === 139 /* ReadonlyKeyword */; } - if (token() === 138 /* ReadonlyKeyword */) { + if (token() === 139 /* ReadonlyKeyword */) { nextToken(); } return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 97 /* InKeyword */; } function parseMappedTypeParameter() { - var node = createNode(155 /* TypeParameter */); + var node = createNode(156 /* TypeParameter */); node.name = parseIdentifier(); parseExpected(97 /* InKeyword */); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(186 /* MappedType */); + var node = createNode(187 /* MappedType */); parseExpected(18 /* OpenBraceToken */); - if (token() === 138 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { + if (token() === 139 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { node.readonlyToken = parseTokenNode(); - if (node.readonlyToken.kind !== 138 /* ReadonlyKeyword */) { - parseExpectedToken(138 /* ReadonlyKeyword */); + if (node.readonlyToken.kind !== 139 /* ReadonlyKeyword */) { + parseExpectedToken(139 /* ReadonlyKeyword */); } } parseExpected(22 /* OpenBracketToken */); @@ -21170,23 +21283,23 @@ var ts; function parseTupleElementType() { var pos = getNodePos(); if (parseOptional(25 /* DotDotDotToken */)) { - var node = createNode(177 /* RestType */, pos); + var node = createNode(178 /* RestType */, pos); node.type = parseType(); return finishNode(node); } var type = parseType(); - if (!(contextFlags & 4194304 /* JSDoc */) && type.kind === 297 /* JSDocNullableType */ && type.pos === type.type.pos) { - type.kind = 176 /* OptionalType */; + if (!(contextFlags & 4194304 /* JSDoc */) && type.kind === 298 /* JSDocNullableType */ && type.pos === type.type.pos) { + type.kind = 177 /* OptionalType */; } return type; } function parseTupleType() { - var node = createNode(175 /* TupleType */); + var node = createNode(176 /* TupleType */); node.elementTypes = parseBracketedList(21 /* TupleElementTypes */, parseTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(182 /* ParenthesizedType */); + var node = createNode(183 /* ParenthesizedType */); parseExpected(20 /* OpenParenToken */); node.type = parseType(); parseExpected(21 /* CloseParenToken */); @@ -21194,7 +21307,7 @@ var ts; } function parseFunctionOrConstructorType() { var pos = getNodePos(); - var kind = parseOptional(99 /* NewKeyword */) ? 171 /* ConstructorType */ : 170 /* FunctionType */; + var kind = parseOptional(99 /* NewKeyword */) ? 172 /* ConstructorType */ : 171 /* FunctionType */; var node = createNodeWithJSDoc(kind, pos); fillSignature(38 /* EqualsGreaterThanToken */, 4 /* Type */, node); return finishNode(node); @@ -21204,10 +21317,10 @@ var ts; return token() === 24 /* DotToken */ ? undefined : node; } function parseLiteralTypeNode(negative) { - var node = createNode(187 /* LiteralType */); + var node = createNode(188 /* LiteralType */); var unaryMinusExpression; if (negative) { - unaryMinusExpression = createNode(207 /* PrefixUnaryExpression */); + unaryMinusExpression = createNode(208 /* PrefixUnaryExpression */); unaryMinusExpression.operator = 40 /* MinusToken */; nextToken(); } @@ -21228,7 +21341,7 @@ var ts; } function parseImportType() { sourceFile.flags |= 1048576 /* PossiblyContainsDynamicImport */; - var node = createNode(188 /* ImportType */); + var node = createNode(189 /* ImportType */); if (parseOptional(108 /* TypeOfKeyword */)) { node.isTypeOf = true; } @@ -21251,15 +21364,15 @@ var ts; function parseNonArrayType() { switch (token()) { case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 144 /* SymbolKeyword */: - case 128 /* BooleanKeyword */: - case 146 /* UndefinedKeyword */: - case 137 /* NeverKeyword */: - case 141 /* ObjectKeyword */: + case 149 /* UnknownKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 145 /* SymbolKeyword */: + case 129 /* BooleanKeyword */: + case 147 /* UndefinedKeyword */: + case 138 /* NeverKeyword */: + case 142 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 41 /* AsteriskToken */: @@ -21290,7 +21403,7 @@ var ts; return parseTokenNode(); case 104 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 133 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 134 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -21316,20 +21429,20 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 128 /* BooleanKeyword */: - case 138 /* ReadonlyKeyword */: - case 144 /* SymbolKeyword */: - case 147 /* UniqueKeyword */: + case 149 /* UnknownKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 129 /* BooleanKeyword */: + case 139 /* ReadonlyKeyword */: + case 145 /* SymbolKeyword */: + case 148 /* UniqueKeyword */: case 110 /* VoidKeyword */: - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: case 100 /* NullKeyword */: case 104 /* ThisKeyword */: case 108 /* TypeOfKeyword */: - case 137 /* NeverKeyword */: + case 138 /* NeverKeyword */: case 18 /* OpenBraceToken */: case 22 /* OpenBracketToken */: case 29 /* LessThanToken */: @@ -21341,12 +21454,12 @@ var ts; case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: - case 141 /* ObjectKeyword */: + case 142 /* ObjectKeyword */: case 41 /* AsteriskToken */: case 57 /* QuestionToken */: case 53 /* ExclamationToken */: case 25 /* DotDotDotToken */: - case 132 /* InferKeyword */: + case 133 /* InferKeyword */: case 96 /* ImportKeyword */: case 124 /* AssertsKeyword */: return true; @@ -21371,26 +21484,26 @@ var ts; while (!scanner.hasPrecedingLineBreak()) { switch (token()) { case 53 /* ExclamationToken */: - type = createPostfixType(298 /* JSDocNonNullableType */, type); + type = createPostfixType(299 /* JSDocNonNullableType */, type); break; case 57 /* QuestionToken */: // If not in JSDoc and next token is start of a type we have a conditional type if (!(contextFlags & 4194304 /* JSDoc */) && lookAhead(nextTokenIsStartOfType)) { return type; } - type = createPostfixType(297 /* JSDocNullableType */, type); + type = createPostfixType(298 /* JSDocNullableType */, type); break; case 22 /* OpenBracketToken */: parseExpected(22 /* OpenBracketToken */); if (isStartOfType()) { - var node = createNode(185 /* IndexedAccessType */, type.pos); + var node = createNode(186 /* IndexedAccessType */, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(23 /* CloseBracketToken */); type = finishNode(node); } else { - var node = createNode(174 /* ArrayType */, type.pos); + var node = createNode(175 /* ArrayType */, type.pos); node.elementType = type; parseExpected(23 /* CloseBracketToken */); type = finishNode(node); @@ -21409,16 +21522,16 @@ var ts; return finishNode(postfix); } function parseTypeOperator(operator) { - var node = createNode(184 /* TypeOperator */); + var node = createNode(185 /* TypeOperator */); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); return finishNode(node); } function parseInferType() { - var node = createNode(181 /* InferType */); - parseExpected(132 /* InferKeyword */); - var typeParameter = createNode(155 /* TypeParameter */); + var node = createNode(182 /* InferType */); + parseExpected(133 /* InferKeyword */); + var typeParameter = createNode(156 /* TypeParameter */); typeParameter.name = parseIdentifier(); node.typeParameter = finishNode(typeParameter); return finishNode(node); @@ -21426,11 +21539,12 @@ var ts; function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 134 /* KeyOfKeyword */: - case 147 /* UniqueKeyword */: - case 138 /* ReadonlyKeyword */: + case 135 /* KeyOfKeyword */: + case 148 /* UniqueKeyword */: + case 139 /* ReadonlyKeyword */: + case 128 /* AwaitedKeyword */: return parseTypeOperator(operator); - case 132 /* InferKeyword */: + case 133 /* InferKeyword */: return parseInferType(); } return parsePostfixTypeOrHigher(); @@ -21451,10 +21565,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(179 /* IntersectionType */, parseTypeOperatorOrHigher, 50 /* AmpersandToken */); + return parseUnionOrIntersectionType(180 /* IntersectionType */, parseTypeOperatorOrHigher, 50 /* AmpersandToken */); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(178 /* UnionType */, parseIntersectionTypeOrHigher, 51 /* BarToken */); + return parseUnionOrIntersectionType(179 /* UnionType */, parseIntersectionTypeOrHigher, 51 /* BarToken */); } function isStartOfFunctionType() { if (token() === 29 /* LessThanToken */) { @@ -21511,7 +21625,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(168 /* TypePredicate */, typePredicateVariable.pos); + var node = createNode(169 /* TypePredicate */, typePredicateVariable.pos); node.assertsModifier = undefined; node.parameterName = typePredicateVariable; node.type = type; @@ -21523,16 +21637,16 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 133 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 134 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } } function parseAssertsTypePredicate() { - var node = createNode(168 /* TypePredicate */); + var node = createNode(169 /* TypePredicate */); node.assertsModifier = parseExpectedToken(124 /* AssertsKeyword */); node.parameterName = token() === 104 /* ThisKeyword */ ? parseThisTypeNode() : parseIdentifier(); - node.type = parseOptional(133 /* IsKeyword */) ? parseType() : undefined; + node.type = parseOptional(134 /* IsKeyword */) ? parseType() : undefined; return finishNode(node); } function parseType() { @@ -21546,7 +21660,7 @@ var ts; } var type = parseUnionTypeOrHigher(); if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(90 /* ExtendsKeyword */)) { - var node = createNode(180 /* ConditionalType */, type.pos); + var node = createNode(181 /* ConditionalType */, type.pos); node.checkType = type; // The type following 'extends' is not permitted to be another conditional type node.extendsType = parseTypeWorker(/*noConditionalTypes*/ true); @@ -21741,7 +21855,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(212 /* YieldExpression */); + var node = createNode(213 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -21763,13 +21877,13 @@ var ts; ts.Debug.assert(token() === 38 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(202 /* ArrowFunction */, asyncModifier.pos); + node = createNode(203 /* ArrowFunction */, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(202 /* ArrowFunction */, identifier.pos); + node = createNode(203 /* ArrowFunction */, identifier.pos); } - var parameter = createNode(156 /* Parameter */, identifier.pos); + var parameter = createNode(157 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); @@ -21974,7 +22088,7 @@ var ts; return 0 /* False */; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNodeWithJSDoc(202 /* ArrowFunction */); + var node = createNodeWithJSDoc(203 /* ArrowFunction */); node.modifiers = parseModifiersForArrowFunction(); var isAsync = hasModifierOfKind(node, 126 /* AsyncKeyword */) ? 2 /* Await */ : 0 /* None */; // Arrow functions are never generators. @@ -22040,7 +22154,7 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(210 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(211 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -22055,7 +22169,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 97 /* InKeyword */ || t === 152 /* OfKeyword */; + return t === 97 /* InKeyword */ || t === 153 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -22120,39 +22234,39 @@ var ts; return ts.getBinaryOperatorPrecedence(token()) > 0; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(209 /* BinaryExpression */, left.pos); + var node = createNode(210 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(217 /* AsExpression */, left.pos); + var node = createNode(218 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(207 /* PrefixUnaryExpression */); + var node = createNode(208 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(203 /* DeleteExpression */); + var node = createNode(204 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(204 /* TypeOfExpression */); + var node = createNode(205 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(205 /* VoidExpression */); + var node = createNode(206 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -22168,7 +22282,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(206 /* AwaitExpression */); + var node = createNode(207 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -22212,7 +22326,7 @@ var ts; if (token() === 42 /* AsteriskAsteriskToken */) { var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); var end = simpleUnaryExpression.end; - if (simpleUnaryExpression.kind === 199 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 200 /* TypeAssertionExpression */) { parseErrorAt(pos, end, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -22309,7 +22423,7 @@ var ts; */ function parseUpdateExpression() { if (token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) { - var node = createNode(207 /* PrefixUnaryExpression */); + var node = createNode(208 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -22322,7 +22436,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(208 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(209 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -22378,7 +22492,7 @@ var ts; var fullStart = scanner.getStartPos(); nextToken(); // advance past the 'import' nextToken(); // advance past the dot - var node = createNode(219 /* MetaProperty */, fullStart); + var node = createNode(220 /* MetaProperty */, fullStart); node.keywordToken = 96 /* ImportKeyword */; node.name = parseIdentifierName(); expression = finishNode(node); @@ -22461,7 +22575,7 @@ var ts; } // If we have seen "super" it must be followed by '(' or '.'. // If it wasn't then just try to parse out a '.' and report an error. - var node = createNode(194 /* PropertyAccessExpression */, expression.pos); + var node = createNode(195 /* PropertyAccessExpression */, expression.pos); node.expression = expression; parseExpectedToken(24 /* DotToken */, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); // private names will never work with `super` (`super.#foo`), but that's a semantic error, not syntactic @@ -22471,8 +22585,8 @@ var ts; function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 268 /* JsxOpeningElement */) { - var node = createNode(266 /* JsxElement */, opening.pos); + if (opening.kind === 269 /* JsxOpeningElement */) { + var node = createNode(267 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -22481,15 +22595,15 @@ var ts; } result = finishNode(node); } - else if (opening.kind === 271 /* JsxOpeningFragment */) { - var node = createNode(270 /* JsxFragment */, opening.pos); + else if (opening.kind === 272 /* JsxOpeningFragment */) { + var node = createNode(271 /* JsxFragment */, opening.pos); node.openingFragment = opening; node.children = parseJsxChildren(node.openingFragment); node.closingFragment = parseJsxClosingFragment(inExpressionContext); result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 267 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 268 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -22504,7 +22618,7 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(209 /* BinaryExpression */, result.pos); + var badNode = createNode(210 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -22563,7 +22677,7 @@ var ts; return createNodeArray(list, listPos); } function parseJsxAttributes() { - var jsxAttributes = createNode(274 /* JsxAttributes */); + var jsxAttributes = createNode(275 /* JsxAttributes */); jsxAttributes.properties = parseList(13 /* JsxAttributes */, parseJsxAttribute); return finishNode(jsxAttributes); } @@ -22572,7 +22686,7 @@ var ts; parseExpected(29 /* LessThanToken */); if (token() === 31 /* GreaterThanToken */) { // See below for explanation of scanJsxText - var node_1 = createNode(271 /* JsxOpeningFragment */, fullStart); + var node_1 = createNode(272 /* JsxOpeningFragment */, fullStart); scanJsxText(); return finishNode(node_1); } @@ -22584,7 +22698,7 @@ var ts; // Closing tag, so scan the immediately-following text with the JSX scanning instead // of regular scanning to avoid treating illegal characters (e.g. '#') as immediate // scanning errors - node = createNode(268 /* JsxOpeningElement */, fullStart); + node = createNode(269 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -22596,7 +22710,7 @@ var ts; parseExpected(31 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(267 /* JsxSelfClosingElement */, fullStart); + node = createNode(268 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.typeArguments = typeArguments; @@ -22613,7 +22727,7 @@ var ts; var expression = token() === 104 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ false); expression = finishNode(propertyAccess); @@ -22621,7 +22735,7 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(276 /* JsxExpression */); + var node = createNode(277 /* JsxExpression */); if (!parseExpected(18 /* OpenBraceToken */)) { return undefined; } @@ -22647,7 +22761,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(273 /* JsxAttribute */); + var node = createNode(274 /* JsxAttribute */); node.name = parseIdentifierName(); if (token() === 62 /* EqualsToken */) { switch (scanJsxAttributeValue()) { @@ -22662,7 +22776,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(275 /* JsxSpreadAttribute */); + var node = createNode(276 /* JsxSpreadAttribute */); parseExpected(18 /* OpenBraceToken */); parseExpected(25 /* DotDotDotToken */); node.expression = parseExpression(); @@ -22670,7 +22784,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(269 /* JsxClosingElement */); + var node = createNode(270 /* JsxClosingElement */); parseExpected(30 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -22683,7 +22797,7 @@ var ts; return finishNode(node); } function parseJsxClosingFragment(inExpressionContext) { - var node = createNode(272 /* JsxClosingFragment */); + var node = createNode(273 /* JsxClosingFragment */); parseExpected(30 /* LessThanSlashToken */); if (ts.tokenIsIdentifierOrKeyword(token())) { parseErrorAtRange(parseJsxElementName(), ts.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment); @@ -22698,7 +22812,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(199 /* TypeAssertionExpression */); + var node = createNode(200 /* TypeAssertionExpression */); parseExpected(29 /* LessThanToken */); node.type = parseType(); parseExpected(31 /* GreaterThanToken */); @@ -22716,7 +22830,7 @@ var ts; && lookAhead(nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate); } function parsePropertyAccessExpressionRest(expression, questionDotToken) { - var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ true); @@ -22729,7 +22843,7 @@ var ts; return finishNode(propertyAccess); } function parseElementAccessExpressionRest(expression, questionDotToken) { - var indexedAccess = createNode(195 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(196 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; indexedAccess.questionDotToken = questionDotToken; if (token() === 23 /* CloseBracketToken */) { @@ -22765,7 +22879,7 @@ var ts; } if (!questionDotToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(218 /* NonNullExpression */, expression.pos); + var nonNullExpression = createNode(219 /* NonNullExpression */, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; @@ -22786,7 +22900,7 @@ var ts; return token() === 14 /* NoSubstitutionTemplateLiteral */ || token() === 15 /* TemplateHead */; } function parseTaggedTemplateRest(tag, questionDotToken, typeArguments) { - var tagExpression = createNode(198 /* TaggedTemplateExpression */, tag.pos); + var tagExpression = createNode(199 /* TaggedTemplateExpression */, tag.pos); tagExpression.tag = tag; tagExpression.questionDotToken = questionDotToken; tagExpression.typeArguments = typeArguments; @@ -22814,7 +22928,7 @@ var ts; expression = parseTaggedTemplateRest(expression, questionDotToken, typeArguments); continue; } - var callExpr = createNode(196 /* CallExpression */, expression.pos); + var callExpr = createNode(197 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.typeArguments = typeArguments; @@ -22827,7 +22941,7 @@ var ts; } } else if (token() === 20 /* OpenParenToken */) { - var callExpr = createNode(196 /* CallExpression */, expression.pos); + var callExpr = createNode(197 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.arguments = parseArgumentList(); @@ -22839,7 +22953,7 @@ var ts; } if (questionDotToken) { // We failed to parse anything, so report a missing identifier here. - var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = createMissingNode(75 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.Identifier_expected); @@ -22958,28 +23072,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNodeWithJSDoc(200 /* ParenthesizedExpression */); + var node = createNodeWithJSDoc(201 /* ParenthesizedExpression */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(213 /* SpreadElement */); + var node = createNode(214 /* SpreadElement */); parseExpected(25 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 25 /* DotDotDotToken */ ? parseSpreadElement() : - token() === 27 /* CommaToken */ ? createNode(215 /* OmittedExpression */) : + token() === 27 /* CommaToken */ ? createNode(216 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(192 /* ArrayLiteralExpression */); + var node = createNode(193 /* ArrayLiteralExpression */); parseExpected(22 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -22991,17 +23105,17 @@ var ts; function parseObjectLiteralElement() { var node = createNodeWithJSDoc(0 /* Unknown */); if (parseOptionalToken(25 /* DotDotDotToken */)) { - node.kind = 283 /* SpreadAssignment */; + node.kind = 284 /* SpreadAssignment */; node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); - if (parseContextualModifier(131 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 163 /* GetAccessor */); + if (parseContextualModifier(132 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 164 /* GetAccessor */); } - if (parseContextualModifier(142 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 164 /* SetAccessor */); + if (parseContextualModifier(143 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 165 /* SetAccessor */); } var asteriskToken = parseOptionalToken(41 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); @@ -23019,7 +23133,7 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 58 /* ColonToken */); if (isShorthandPropertyAssignment) { - node.kind = 282 /* ShorthandPropertyAssignment */; + node.kind = 283 /* ShorthandPropertyAssignment */; var equalsToken = parseOptionalToken(62 /* EqualsToken */); if (equalsToken) { node.equalsToken = equalsToken; @@ -23027,20 +23141,26 @@ var ts; } } else { - node.kind = 281 /* PropertyAssignment */; + node.kind = 282 /* PropertyAssignment */; parseExpected(58 /* ColonToken */); node.initializer = allowInAnd(parseAssignmentExpressionOrHigher); } return finishNode(node); } function parseObjectLiteralExpression() { - var node = createNode(193 /* ObjectLiteralExpression */); + var node = createNode(194 /* ObjectLiteralExpression */); + var openBracePosition = scanner.getTokenPos(); parseExpected(18 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; } node.properties = parseDelimitedList(12 /* ObjectLiteralMembers */, parseObjectLiteralElement, /*considerSemicolonAsDelimiter*/ true); - parseExpected(19 /* CloseBraceToken */); + if (!parseExpected(19 /* CloseBraceToken */)) { + var lastError = ts.lastOrUndefined(parseDiagnostics); + if (lastError && lastError.code === ts.Diagnostics._0_expected.code) { + ts.addRelatedInfo(lastError, ts.createFileDiagnostic(sourceFile, openBracePosition, 1, ts.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here)); + } + } return finishNode(node); } function parseFunctionExpression() { @@ -23053,7 +23173,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(/*val*/ false); } - var node = createNodeWithJSDoc(201 /* FunctionExpression */); + var node = createNodeWithJSDoc(202 /* FunctionExpression */); node.modifiers = parseModifiers(); parseExpected(94 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(41 /* AsteriskToken */); @@ -23078,7 +23198,7 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(99 /* NewKeyword */); if (parseOptional(24 /* DotToken */)) { - var node_2 = createNode(219 /* MetaProperty */, fullStart); + var node_2 = createNode(220 /* MetaProperty */, fullStart); node_2.keywordToken = 99 /* NewKeyword */; node_2.name = parseIdentifierName(); return finishNode(node_2); @@ -23095,7 +23215,7 @@ var ts; } break; } - var node = createNode(197 /* NewExpression */, fullStart); + var node = createNode(198 /* NewExpression */, fullStart); node.expression = expression; node.typeArguments = typeArguments; if (node.typeArguments || token() === 20 /* OpenParenToken */) { @@ -23105,7 +23225,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(223 /* Block */); + var node = createNode(224 /* Block */); var openBracePosition = scanner.getTokenPos(); if (parseExpected(18 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { @@ -23144,12 +23264,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(224 /* EmptyStatement */); + var node = createNode(225 /* EmptyStatement */); parseExpected(26 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(227 /* IfStatement */); + var node = createNode(228 /* IfStatement */); parseExpected(95 /* IfKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23159,7 +23279,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(228 /* DoStatement */); + var node = createNode(229 /* DoStatement */); parseExpected(86 /* DoKeyword */); node.statement = parseStatement(); parseExpected(111 /* WhileKeyword */); @@ -23174,7 +23294,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(229 /* WhileStatement */); + var node = createNode(230 /* WhileStatement */); parseExpected(111 /* WhileKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23197,8 +23317,8 @@ var ts; } } var forOrForInOrForOfStatement; - if (awaitToken ? parseExpected(152 /* OfKeyword */) : parseOptional(152 /* OfKeyword */)) { - var forOfStatement = createNode(232 /* ForOfStatement */, pos); + if (awaitToken ? parseExpected(153 /* OfKeyword */) : parseOptional(153 /* OfKeyword */)) { + var forOfStatement = createNode(233 /* ForOfStatement */, pos); forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); @@ -23206,14 +23326,14 @@ var ts; forOrForInOrForOfStatement = forOfStatement; } else if (parseOptional(97 /* InKeyword */)) { - var forInStatement = createNode(231 /* ForInStatement */, pos); + var forInStatement = createNode(232 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } else { - var forStatement = createNode(230 /* ForStatement */, pos); + var forStatement = createNode(231 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(26 /* SemicolonToken */); if (token() !== 26 /* SemicolonToken */ && token() !== 21 /* CloseParenToken */) { @@ -23231,7 +23351,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 234 /* BreakStatement */ ? 77 /* BreakKeyword */ : 82 /* ContinueKeyword */); + parseExpected(kind === 235 /* BreakStatement */ ? 77 /* BreakKeyword */ : 82 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -23239,7 +23359,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(235 /* ReturnStatement */); + var node = createNode(236 /* ReturnStatement */); parseExpected(101 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -23248,7 +23368,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(236 /* WithStatement */); + var node = createNode(237 /* WithStatement */); parseExpected(112 /* WithKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23257,7 +23377,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(277 /* CaseClause */); + var node = createNode(278 /* CaseClause */); parseExpected(78 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(58 /* ColonToken */); @@ -23265,7 +23385,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(278 /* DefaultClause */); + var node = createNode(279 /* DefaultClause */); parseExpected(84 /* DefaultKeyword */); parseExpected(58 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); @@ -23275,12 +23395,12 @@ var ts; return token() === 78 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(237 /* SwitchStatement */); + var node = createNode(238 /* SwitchStatement */); parseExpected(103 /* SwitchKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); - var caseBlock = createNode(251 /* CaseBlock */); + var caseBlock = createNode(252 /* CaseBlock */); parseExpected(18 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(19 /* CloseBraceToken */); @@ -23295,7 +23415,7 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(239 /* ThrowStatement */); + var node = createNode(240 /* ThrowStatement */); parseExpected(105 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -23303,7 +23423,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(240 /* TryStatement */); + var node = createNode(241 /* TryStatement */); parseExpected(107 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); node.catchClause = token() === 79 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -23316,7 +23436,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(280 /* CatchClause */); + var result = createNode(281 /* CatchClause */); parseExpected(79 /* CatchKeyword */); if (parseOptional(20 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -23330,7 +23450,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(241 /* DebuggerStatement */); + var node = createNode(242 /* DebuggerStatement */); parseExpected(83 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -23339,15 +23459,15 @@ var ts; // Avoiding having to do the lookahead for a labeled statement by just trying to parse // out an expression, seeing if it is identifier and then seeing if it is followed by // a colon. - var node = createNodeWithJSDoc(0 /* Unknown */); + var node = createNodeWithJSDoc(token() === 75 /* Identifier */ ? 0 /* Unknown */ : 227 /* ExpressionStatement */); var expression = allowInAnd(parseExpression); if (expression.kind === 75 /* Identifier */ && parseOptional(58 /* ColonToken */)) { - node.kind = 238 /* LabeledStatement */; + node.kind = 239 /* LabeledStatement */; node.label = expression; node.statement = parseStatement(); } else { - node.kind = 226 /* ExpressionStatement */; + node.kind = 227 /* ExpressionStatement */; node.expression = expression; parseSemicolon(); } @@ -23401,25 +23521,25 @@ var ts; // // could be legal, it would add complexity for very little gain. case 114 /* InterfaceKeyword */: - case 145 /* TypeKeyword */: + case 146 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 122 /* AbstractKeyword */: case 126 /* AsyncKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 119 /* PublicKeyword */: - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 150 /* GlobalKeyword */: + case 151 /* GlobalKeyword */: nextToken(); return token() === 18 /* OpenBraceToken */ || token() === 75 /* Identifier */ || token() === 89 /* ExportKeyword */; case 96 /* ImportKeyword */: @@ -23428,7 +23548,7 @@ var ts; token() === 18 /* OpenBraceToken */ || ts.tokenIsIdentifierOrKeyword(token()); case 89 /* ExportKeyword */: var currentToken_1 = nextToken(); - if (currentToken_1 === 145 /* TypeKeyword */) { + if (currentToken_1 === 146 /* TypeKeyword */) { currentToken_1 = lookAhead(nextToken); } if (currentToken_1 === 62 /* EqualsToken */ || currentToken_1 === 41 /* AsteriskToken */ || @@ -23482,19 +23602,19 @@ var ts; case 89 /* ExportKeyword */: return isStartOfDeclaration(); case 126 /* AsyncKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 114 /* InterfaceKeyword */: - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: - case 145 /* TypeKeyword */: - case 150 /* GlobalKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: + case 146 /* TypeKeyword */: + case 151 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 120 /* StaticKeyword */: - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: // When these don't start a declaration, they may be the start of a class member if an identifier // immediately follows. Otherwise they're an identifier in an expression statement. return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); @@ -23518,16 +23638,16 @@ var ts; case 18 /* OpenBraceToken */: return parseBlock(/*ignoreMissingOpenBrace*/ false); case 109 /* VarKeyword */: - return parseVariableStatement(createNodeWithJSDoc(242 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(243 /* VariableDeclaration */)); case 115 /* LetKeyword */: if (isLetDeclaration()) { - return parseVariableStatement(createNodeWithJSDoc(242 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(243 /* VariableDeclaration */)); } break; case 94 /* FunctionKeyword */: - return parseFunctionDeclaration(createNodeWithJSDoc(244 /* FunctionDeclaration */)); + return parseFunctionDeclaration(createNodeWithJSDoc(245 /* FunctionDeclaration */)); case 80 /* ClassKeyword */: - return parseClassDeclaration(createNodeWithJSDoc(245 /* ClassDeclaration */)); + return parseClassDeclaration(createNodeWithJSDoc(246 /* ClassDeclaration */)); case 95 /* IfKeyword */: return parseIfStatement(); case 86 /* DoKeyword */: @@ -23537,9 +23657,9 @@ var ts; case 93 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 82 /* ContinueKeyword */: - return parseBreakOrContinueStatement(233 /* ContinueStatement */); + return parseBreakOrContinueStatement(234 /* ContinueStatement */); case 77 /* BreakKeyword */: - return parseBreakOrContinueStatement(234 /* BreakStatement */); + return parseBreakOrContinueStatement(235 /* BreakStatement */); case 101 /* ReturnKeyword */: return parseReturnStatement(); case 112 /* WithKeyword */: @@ -23560,10 +23680,10 @@ var ts; return parseDeclaration(); case 126 /* AsyncKeyword */: case 114 /* InterfaceKeyword */: - case 145 /* TypeKeyword */: - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: - case 130 /* DeclareKeyword */: + case 146 /* TypeKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: + case 131 /* DeclareKeyword */: case 81 /* ConstKeyword */: case 88 /* EnumKeyword */: case 89 /* ExportKeyword */: @@ -23573,8 +23693,8 @@ var ts; case 119 /* PublicKeyword */: case 122 /* AbstractKeyword */: case 120 /* StaticKeyword */: - case 138 /* ReadonlyKeyword */: - case 150 /* GlobalKeyword */: + case 139 /* ReadonlyKeyword */: + case 151 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -23583,7 +23703,7 @@ var ts; return parseExpressionOrLabeledStatement(); } function isDeclareModifier(modifier) { - return modifier.kind === 130 /* DeclareKeyword */; + return modifier.kind === 131 /* DeclareKeyword */; } function parseDeclaration() { var modifiers = lookAhead(function () { return (parseDecorators(), parseModifiers()); }); @@ -23631,13 +23751,13 @@ var ts; return parseClassDeclaration(node); case 114 /* InterfaceKeyword */: return parseInterfaceDeclaration(node); - case 145 /* TypeKeyword */: + case 146 /* TypeKeyword */: return parseTypeAliasDeclaration(node); case 88 /* EnumKeyword */: return parseEnumDeclaration(node); - case 150 /* GlobalKeyword */: - case 135 /* ModuleKeyword */: - case 136 /* NamespaceKeyword */: + case 151 /* GlobalKeyword */: + case 136 /* ModuleKeyword */: + case 137 /* NamespaceKeyword */: return parseModuleDeclaration(node); case 96 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(node); @@ -23656,7 +23776,7 @@ var ts; if (node.decorators || node.modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var missing = createMissingNode(264 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(265 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; @@ -23679,16 +23799,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token() === 27 /* CommaToken */) { - return createNode(215 /* OmittedExpression */); + return createNode(216 /* OmittedExpression */); } - var node = createNode(191 /* BindingElement */); + var node = createNode(192 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(191 /* BindingElement */); + var node = createNode(192 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -23704,14 +23824,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(189 /* ObjectBindingPattern */); + var node = createNode(190 /* ObjectBindingPattern */); parseExpected(18 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(19 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(190 /* ArrayBindingPattern */); + var node = createNode(191 /* ArrayBindingPattern */); parseExpected(22 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(23 /* CloseBracketToken */); @@ -23736,7 +23856,7 @@ var ts; return parseVariableDeclaration(/*allowExclamation*/ true); } function parseVariableDeclaration(allowExclamation) { - var node = createNode(242 /* VariableDeclaration */); + var node = createNode(243 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(ts.Diagnostics.Private_identifiers_are_not_allowed_in_variable_declarations); if (allowExclamation && node.name.kind === 75 /* Identifier */ && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { @@ -23749,7 +23869,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(243 /* VariableDeclarationList */); + var node = createNode(244 /* VariableDeclarationList */); switch (token()) { case 109 /* VarKeyword */: break; @@ -23772,7 +23892,7 @@ var ts; // So we need to look ahead to determine if 'of' should be treated as a keyword in // this context. // The checker will then give an error that there is an empty declaration list. - if (token() === 152 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 153 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -23787,13 +23907,13 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; } function parseVariableStatement(node) { - node.kind = 225 /* VariableStatement */; + node.kind = 226 /* VariableStatement */; node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(node) { - node.kind = 244 /* FunctionDeclaration */; + node.kind = 245 /* FunctionDeclaration */; parseExpected(94 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(41 /* AsteriskToken */); node.name = hasModifierOfKind(node, 84 /* DefaultKeyword */) ? parseOptionalIdentifier() : parseIdentifier(); @@ -23804,8 +23924,8 @@ var ts; return finishNode(node); } function parseConstructorName() { - if (token() === 129 /* ConstructorKeyword */) { - return parseExpected(129 /* ConstructorKeyword */); + if (token() === 130 /* ConstructorKeyword */) { + return parseExpected(130 /* ConstructorKeyword */); } if (token() === 10 /* StringLiteral */ && lookAhead(nextToken) === 20 /* OpenParenToken */) { return tryParse(function () { @@ -23817,7 +23937,7 @@ var ts; function tryParseConstructorDeclaration(node) { return tryParse(function () { if (parseConstructorName()) { - node.kind = 162 /* Constructor */; + node.kind = 163 /* Constructor */; fillSignature(58 /* ColonToken */, 0 /* None */, node); node.body = parseFunctionBlockOrSemicolon(0 /* None */, ts.Diagnostics.or_expected); return finishNode(node); @@ -23825,7 +23945,7 @@ var ts; }); } function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) { - node.kind = 161 /* MethodDeclaration */; + node.kind = 162 /* MethodDeclaration */; node.asteriskToken = asteriskToken; var isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; var isAsync = hasModifierOfKind(node, 126 /* AsyncKeyword */) ? 2 /* Await */ : 0 /* None */; @@ -23834,7 +23954,7 @@ var ts; return finishNode(node); } function parsePropertyDeclaration(node) { - node.kind = 159 /* PropertyDeclaration */; + node.kind = 160 /* PropertyDeclaration */; if (!node.questionToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -23896,7 +24016,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 142 /* SetKeyword */ || idToken === 131 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 143 /* SetKeyword */ || idToken === 132 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -23928,7 +24048,7 @@ var ts; if (!parseOptional(59 /* AtToken */)) { break; } - var decorator = createNode(157 /* Decorator */, decoratorStart); + var decorator = createNode(158 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); (list || (list = [])).push(decorator); @@ -23978,20 +24098,20 @@ var ts; } function parseClassElement() { if (token() === 26 /* SemicolonToken */) { - var result = createNode(222 /* SemicolonClassElement */); + var result = createNode(223 /* SemicolonClassElement */); nextToken(); return finishNode(result); } var node = createNodeWithJSDoc(0 /* Unknown */); node.decorators = parseDecorators(); node.modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); - if (parseContextualModifier(131 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 163 /* GetAccessor */); + if (parseContextualModifier(132 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 164 /* GetAccessor */); } - if (parseContextualModifier(142 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 164 /* SetAccessor */); + if (parseContextualModifier(143 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 165 /* SetAccessor */); } - if (token() === 129 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { + if (token() === 130 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { var constructorDeclaration = tryParseConstructorDeclaration(node); if (constructorDeclaration) { return constructorDeclaration; @@ -24028,10 +24148,10 @@ var ts; return ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 214 /* ClassExpression */); + return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 215 /* ClassExpression */); } function parseClassDeclaration(node) { - return parseClassDeclarationOrExpression(node, 245 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(node, 246 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(node, kind) { node.kind = kind; @@ -24074,14 +24194,14 @@ var ts; function parseHeritageClause() { var tok = token(); ts.Debug.assert(tok === 90 /* ExtendsKeyword */ || tok === 113 /* ImplementsKeyword */); // isListElement() should ensure this. - var node = createNode(279 /* HeritageClause */); + var node = createNode(280 /* HeritageClause */); node.token = tok; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); return finishNode(node); } function parseExpressionWithTypeArguments() { - var node = createNode(216 /* ExpressionWithTypeArguments */); + var node = createNode(217 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); node.typeArguments = tryParseTypeArguments(); return finishNode(node); @@ -24097,7 +24217,7 @@ var ts; return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(node) { - node.kind = 246 /* InterfaceDeclaration */; + node.kind = 247 /* InterfaceDeclaration */; parseExpected(114 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); @@ -24106,8 +24226,8 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(node) { - node.kind = 247 /* TypeAliasDeclaration */; - parseExpected(145 /* TypeKeyword */); + node.kind = 248 /* TypeAliasDeclaration */; + parseExpected(146 /* TypeKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(62 /* EqualsToken */); @@ -24120,13 +24240,13 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNodeWithJSDoc(284 /* EnumMember */); + var node = createNodeWithJSDoc(285 /* EnumMember */); node.name = parsePropertyName(); node.initializer = allowInAnd(parseInitializer); return finishNode(node); } function parseEnumDeclaration(node) { - node.kind = 248 /* EnumDeclaration */; + node.kind = 249 /* EnumDeclaration */; parseExpected(88 /* EnumKeyword */); node.name = parseIdentifier(); if (parseExpected(18 /* OpenBraceToken */)) { @@ -24139,7 +24259,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(250 /* ModuleBlock */); + var node = createNode(251 /* ModuleBlock */); if (parseExpected(18 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(19 /* CloseBraceToken */); @@ -24150,7 +24270,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(node, flags) { - node.kind = 249 /* ModuleDeclaration */; + node.kind = 250 /* ModuleDeclaration */; // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 16 /* Namespace */; @@ -24162,8 +24282,8 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(node) { - node.kind = 249 /* ModuleDeclaration */; - if (token() === 150 /* GlobalKeyword */) { + node.kind = 250 /* ModuleDeclaration */; + if (token() === 151 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation node.name = parseIdentifier(); node.flags |= 1024 /* GlobalAugmentation */; @@ -24182,15 +24302,15 @@ var ts; } function parseModuleDeclaration(node) { var flags = 0; - if (token() === 150 /* GlobalKeyword */) { + if (token() === 151 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(node); } - else if (parseOptional(136 /* NamespaceKeyword */)) { + else if (parseOptional(137 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(135 /* ModuleKeyword */); + parseExpected(136 /* ModuleKeyword */); if (token() === 10 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(node); } @@ -24198,7 +24318,7 @@ var ts; return parseModuleOrNamespaceDeclaration(node, flags); } function isExternalModuleReference() { - return token() === 139 /* RequireKeyword */ && + return token() === 140 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -24208,9 +24328,9 @@ var ts; return nextToken() === 43 /* SlashToken */; } function parseNamespaceExportDeclaration(node) { - node.kind = 252 /* NamespaceExportDeclaration */; + node.kind = 253 /* NamespaceExportDeclaration */; parseExpected(123 /* AsKeyword */); - parseExpected(136 /* NamespaceKeyword */); + parseExpected(137 /* NamespaceKeyword */); node.name = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -24223,7 +24343,7 @@ var ts; identifier = parseIdentifier(); } var isTypeOnly = false; - if (token() !== 149 /* FromKeyword */ && + if (token() !== 150 /* FromKeyword */ && (identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) === "type" && (isIdentifier() || tokenAfterImportDefinitelyProducesImportDeclaration())) { isTypeOnly = true; @@ -24233,7 +24353,7 @@ var ts; return parseImportEqualsDeclaration(node, identifier, isTypeOnly); } // Import statement - node.kind = 254 /* ImportDeclaration */; + node.kind = 255 /* ImportDeclaration */; // ImportDeclaration: // import ImportClause from ModuleSpecifier ; // import ModuleSpecifier; @@ -24242,7 +24362,7 @@ var ts; token() === 18 /* OpenBraceToken */ // import { ) { node.importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); - parseExpected(149 /* FromKeyword */); + parseExpected(150 /* FromKeyword */); } node.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -24254,10 +24374,10 @@ var ts; function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { // In `import id ___`, the current token decides whether to produce // an ImportDeclaration or ImportEqualsDeclaration. - return token() === 27 /* CommaToken */ || token() === 149 /* FromKeyword */; + return token() === 27 /* CommaToken */ || token() === 150 /* FromKeyword */; } function parseImportEqualsDeclaration(node, identifier, isTypeOnly) { - node.kind = 253 /* ImportEqualsDeclaration */; + node.kind = 254 /* ImportEqualsDeclaration */; node.name = identifier; parseExpected(62 /* EqualsToken */); node.moduleReference = parseModuleReference(); @@ -24275,7 +24395,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(255 /* ImportClause */, fullStart); + var importClause = createNode(256 /* ImportClause */, fullStart); importClause.isTypeOnly = isTypeOnly; if (identifier) { // ImportedDefaultBinding: @@ -24286,7 +24406,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(27 /* CommaToken */)) { - importClause.namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(257 /* NamedImports */); + importClause.namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(258 /* NamedImports */); } return finishNode(importClause); } @@ -24296,8 +24416,8 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(265 /* ExternalModuleReference */); - parseExpected(139 /* RequireKeyword */); + var node = createNode(266 /* ExternalModuleReference */); + parseExpected(140 /* RequireKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = parseModuleSpecifier(); parseExpected(21 /* CloseParenToken */); @@ -24319,7 +24439,7 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(256 /* NamespaceImport */); + var namespaceImport = createNode(257 /* NamespaceImport */); parseExpected(41 /* AsteriskToken */); parseExpected(123 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -24334,14 +24454,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 257 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); + node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 258 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(263 /* ExportSpecifier */); + return parseImportOrExportSpecifier(264 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(258 /* ImportSpecifier */); + return parseImportOrExportSpecifier(259 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -24366,34 +24486,34 @@ var ts; else { node.name = identifierName; } - if (kind === 258 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 259 /* ImportSpecifier */ && checkIdentifierIsKeyword) { parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseNamespaceExport(pos) { - var node = createNode(262 /* NamespaceExport */, pos); + var node = createNode(263 /* NamespaceExport */, pos); node.name = parseIdentifier(); return finishNode(node); } function parseExportDeclaration(node) { - node.kind = 260 /* ExportDeclaration */; - node.isTypeOnly = parseOptional(145 /* TypeKeyword */); + node.kind = 261 /* ExportDeclaration */; + node.isTypeOnly = parseOptional(146 /* TypeKeyword */); var namespaceExportPos = scanner.getStartPos(); if (parseOptional(41 /* AsteriskToken */)) { if (parseOptional(123 /* AsKeyword */)) { node.exportClause = parseNamespaceExport(namespaceExportPos); } - parseExpected(149 /* FromKeyword */); + parseExpected(150 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(261 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(262 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 149 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(149 /* FromKeyword */); + if (token() === 150 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(150 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -24401,7 +24521,7 @@ var ts; return finishNode(node); } function parseExportAssignment(node) { - node.kind = 259 /* ExportAssignment */; + node.kind = 260 /* ExportAssignment */; if (parseOptional(62 /* EqualsToken */)) { node.isExportEquals = true; } @@ -24421,10 +24541,10 @@ var ts; } function isAnExternalModuleIndicatorNode(node) { return hasModifierOfKind(node, 89 /* ExportKeyword */) - || node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 265 /* ExternalModuleReference */ - || node.kind === 254 /* ImportDeclaration */ - || node.kind === 259 /* ExportAssignment */ - || node.kind === 260 /* ExportDeclaration */ ? node : undefined; + || node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 266 /* ExternalModuleReference */ + || node.kind === 255 /* ImportDeclaration */ + || node.kind === 260 /* ExportAssignment */ + || node.kind === 261 /* ExportDeclaration */ ? node : undefined; } function getImportMetaIfNecessary(sourceFile) { return sourceFile.flags & 2097152 /* PossiblyContainsImportMeta */ ? @@ -24490,7 +24610,7 @@ var ts; JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; // Parses out a JSDoc type expression. function parseJSDocTypeExpression(mayOmitBraces) { - var result = createNode(294 /* JSDocTypeExpression */); + var result = createNode(295 /* JSDocTypeExpression */); var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(18 /* OpenBraceToken */); result.type = doInsideOfContext(4194304 /* JSDoc */, parseJSDocType); if (!mayOmitBraces || hasBrace) { @@ -24653,7 +24773,7 @@ var ts; } } function createJSDocComment() { - var result = createNode(303 /* JSDocComment */, start); + var result = createNode(304 /* JSDocComment */, start); result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd); result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -24723,19 +24843,19 @@ var ts; break; case "class": case "constructor": - tag = parseSimpleTag(start, 310 /* JSDocClassTag */, tagName); + tag = parseSimpleTag(start, 311 /* JSDocClassTag */, tagName); break; case "public": - tag = parseSimpleTag(start, 311 /* JSDocPublicTag */, tagName); + tag = parseSimpleTag(start, 312 /* JSDocPublicTag */, tagName); break; case "private": - tag = parseSimpleTag(start, 312 /* JSDocPrivateTag */, tagName); + tag = parseSimpleTag(start, 313 /* JSDocPrivateTag */, tagName); break; case "protected": - tag = parseSimpleTag(start, 313 /* JSDocProtectedTag */, tagName); + tag = parseSimpleTag(start, 314 /* JSDocProtectedTag */, tagName); break; case "readonly": - tag = parseSimpleTag(start, 314 /* JSDocReadonlyTag */, tagName); + tag = parseSimpleTag(start, 315 /* JSDocReadonlyTag */, tagName); break; case "this": tag = parseThisTag(start, tagName); @@ -24870,7 +24990,7 @@ var ts; return comments.length === 0 ? undefined : comments.join(""); } function parseUnknownTag(start, tagName) { - var result = createNode(306 /* JSDocTag */, start); + var result = createNode(307 /* JSDocTag */, start); result.tagName = tagName; return finishNode(result); } @@ -24915,9 +25035,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 141 /* ObjectKeyword */: + case 142 /* ObjectKeyword */: return true; - case 174 /* ArrayType */: + case 175 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; @@ -24933,8 +25053,8 @@ var ts; typeExpression = tryParseTypeExpression(); } var result = target === 1 /* Property */ ? - createNode(323 /* JSDocPropertyTag */, start) : - createNode(317 /* JSDocParameterTag */, start); + createNode(324 /* JSDocPropertyTag */, start) : + createNode(318 /* JSDocParameterTag */, start); var comment = parseTagComments(indent + scanner.getStartPos() - start); var nestedTypeLiteral = target !== 4 /* CallbackParameter */ && parseNestedTypeLiteral(typeExpression, name, target, indent); if (nestedTypeLiteral) { @@ -24951,20 +25071,20 @@ var ts; } function parseNestedTypeLiteral(typeExpression, name, target, indent) { if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { - var typeLiteralExpression = createNode(294 /* JSDocTypeExpression */, scanner.getTokenPos()); + var typeLiteralExpression = createNode(295 /* JSDocTypeExpression */, scanner.getTokenPos()); var child = void 0; var jsdocTypeLiteral = void 0; var start_3 = scanner.getStartPos(); var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) { - if (child.kind === 317 /* JSDocParameterTag */ || child.kind === 323 /* JSDocPropertyTag */) { + if (child.kind === 318 /* JSDocParameterTag */ || child.kind === 324 /* JSDocPropertyTag */) { children = ts.append(children, child); } } if (children) { - jsdocTypeLiteral = createNode(304 /* JSDocTypeLiteral */, start_3); + jsdocTypeLiteral = createNode(305 /* JSDocTypeLiteral */, start_3); jsdocTypeLiteral.jsDocPropertyTags = children; - if (typeExpression.type.kind === 174 /* ArrayType */) { + if (typeExpression.type.kind === 175 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typeLiteralExpression.type = finishNode(jsdocTypeLiteral); @@ -24976,7 +25096,7 @@ var ts; if (ts.some(tags, ts.isJSDocReturnTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(318 /* JSDocReturnTag */, start); + var result = createNode(319 /* JSDocReturnTag */, start); result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); @@ -24985,13 +25105,13 @@ var ts; if (ts.some(tags, ts.isJSDocTypeTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(320 /* JSDocTypeTag */, start); + var result = createNode(321 /* JSDocTypeTag */, start); result.tagName = tagName; result.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); return finishNode(result); } function parseAuthorTag(start, tagName, indent) { - var result = createNode(309 /* JSDocAuthorTag */, start); + var result = createNode(310 /* JSDocAuthorTag */, start); result.tagName = tagName; var authorInfoWithEmail = tryParse(function () { return tryParseAuthorNameAndEmail(); }); if (!authorInfoWithEmail) { @@ -25045,20 +25165,20 @@ var ts; } } function parseImplementsTag(start, tagName) { - var result = createNode(308 /* JSDocImplementsTag */, start); + var result = createNode(309 /* JSDocImplementsTag */, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseAugmentsTag(start, tagName) { - var result = createNode(307 /* JSDocAugmentsTag */, start); + var result = createNode(308 /* JSDocAugmentsTag */, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseExpressionWithTypeArgumentsForAugments() { var usedBrace = parseOptional(18 /* OpenBraceToken */); - var node = createNode(216 /* ExpressionWithTypeArguments */); + var node = createNode(217 /* ExpressionWithTypeArguments */); node.expression = parsePropertyAccessEntityNameExpression(); node.typeArguments = tryParseTypeArguments(); var res = finishNode(node); @@ -25070,7 +25190,7 @@ var ts; function parsePropertyAccessEntityNameExpression() { var node = parseJSDocIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var prop = createNode(194 /* PropertyAccessExpression */, node.pos); + var prop = createNode(195 /* PropertyAccessExpression */, node.pos); prop.expression = node; prop.name = parseJSDocIdentifierName(); node = finishNode(prop); @@ -25083,14 +25203,14 @@ var ts; return finishNode(tag); } function parseThisTag(start, tagName) { - var tag = createNode(319 /* JSDocThisTag */, start); + var tag = createNode(320 /* JSDocThisTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); return finishNode(tag); } function parseEnumTag(start, tagName) { - var tag = createNode(316 /* JSDocEnumTag */, start); + var tag = createNode(317 /* JSDocEnumTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); @@ -25099,7 +25219,7 @@ var ts; function parseTypedefTag(start, tagName, indent) { var typeExpression = tryParseTypeExpression(); skipWhitespaceOrAsterisk(); - var typedefTag = createNode(322 /* JSDocTypedefTag */, start); + var typedefTag = createNode(323 /* JSDocTypedefTag */, start); typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(); typedefTag.name = getJSDocTypeAliasName(typedefTag.fullName); @@ -25113,9 +25233,9 @@ var ts; var childTypeTag = void 0; while (child = tryParse(function () { return parseChildPropertyTag(indent); })) { if (!jsdocTypeLiteral) { - jsdocTypeLiteral = createNode(304 /* JSDocTypeLiteral */, start); + jsdocTypeLiteral = createNode(305 /* JSDocTypeLiteral */, start); } - if (child.kind === 320 /* JSDocTypeTag */) { + if (child.kind === 321 /* JSDocTypeTag */) { if (childTypeTag) { break; } @@ -25128,7 +25248,7 @@ var ts; } } if (jsdocTypeLiteral) { - if (typeExpression && typeExpression.type.kind === 174 /* ArrayType */) { + if (typeExpression && typeExpression.type.kind === 175 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? @@ -25147,7 +25267,7 @@ var ts; } var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (parseOptional(24 /* DotToken */)) { - var jsDocNamespaceNode = createNode(249 /* ModuleDeclaration */, pos); + var jsDocNamespaceNode = createNode(250 /* ModuleDeclaration */, pos); if (nested) { jsDocNamespaceNode.flags |= 4 /* NestedNamespace */; } @@ -25161,14 +25281,14 @@ var ts; return typeNameOrNamespaceName; } function parseCallbackTag(start, tagName, indent) { - var callbackTag = createNode(315 /* JSDocCallbackTag */, start); + var callbackTag = createNode(316 /* JSDocCallbackTag */, start); callbackTag.tagName = tagName; callbackTag.fullName = parseJSDocTypeNameWithNamespace(); callbackTag.name = getJSDocTypeAliasName(callbackTag.fullName); skipWhitespace(); callbackTag.comment = parseTagComments(indent); var child; - var jsdocSignature = createNode(305 /* JSDocSignature */, start); + var jsdocSignature = createNode(306 /* JSDocSignature */, start); jsdocSignature.parameters = []; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent); })) { jsdocSignature.parameters = ts.append(jsdocSignature.parameters, child); @@ -25176,7 +25296,7 @@ var ts; var returnTag = tryParse(function () { if (parseOptionalJsdoc(59 /* AtToken */)) { var tag = parseTag(indent); - if (tag && tag.kind === 318 /* JSDocReturnTag */) { + if (tag && tag.kind === 319 /* JSDocReturnTag */) { return tag; } } @@ -25221,7 +25341,7 @@ var ts; case 59 /* AtToken */: if (canParseTag) { var child = tryParseChildTag(target, indent); - if (child && (child.kind === 317 /* JSDocParameterTag */ || child.kind === 323 /* JSDocPropertyTag */) && + if (child && (child.kind === 318 /* JSDocParameterTag */ || child.kind === 324 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; @@ -25285,13 +25405,13 @@ var ts; var typeParametersPos = getNodePos(); do { skipWhitespace(); - var typeParameter = createNode(155 /* TypeParameter */); + var typeParameter = createNode(156 /* TypeParameter */); typeParameter.name = parseJSDocIdentifierName(ts.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces); finishNode(typeParameter); skipWhitespaceOrAsterisk(); typeParameters.push(typeParameter); } while (parseOptionalJsdoc(27 /* CommaToken */)); - var result = createNode(321 /* JSDocTemplateTag */, start); + var result = createNode(322 /* JSDocTemplateTag */, start); result.tagName = tagName; result.constraint = constraint; result.typeParameters = createNodeArray(typeParameters, typeParametersPos); @@ -26098,7 +26218,9 @@ var ts; ["esnext.symbol", "lib.es2019.symbol.d.ts"], ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"], ["esnext.intl", "lib.esnext.intl.d.ts"], - ["esnext.bigint", "lib.es2020.bigint.d.ts"] + ["esnext.bigint", "lib.es2020.bigint.d.ts"], + ["esnext.string", "lib.esnext.string.d.ts"], + ["esnext.promise", "lib.esnext.promise.d.ts"] ]; /** * An array of supported "lib" reference file names used to determine the order for inclusion @@ -27598,7 +27720,7 @@ var ts; function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) { var result = returnValue ? {} : undefined; var _loop_3 = function (element) { - if (element.kind !== 281 /* PropertyAssignment */) { + if (element.kind !== 282 /* PropertyAssignment */) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); return "continue"; } @@ -27689,13 +27811,13 @@ var ts; case 8 /* NumericLiteral */: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { break; // not valid JSON syntax } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; // Currently having element option declaration in the tsconfig with type "object" @@ -27712,7 +27834,7 @@ var ts; return convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined); } - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -28897,7 +29019,12 @@ var ts; ts.Debug.assert(ts.extensionIsTS(resolved.extension)); return { fileName: resolved.path, packageId: resolved.packageId }; } - function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations) { + function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, resultFromCache) { + var _a; + if (resultFromCache) { + (_a = resultFromCache.failedLookupLocations).push.apply(_a, failedLookupLocations); + return resultFromCache; + } return { resolvedModule: resolved && { resolvedFileName: resolved.path, originalPath: resolved.originalPath === true ? undefined : resolved.originalPath, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, failedLookupLocations: failedLookupLocations @@ -29589,15 +29716,12 @@ var ts; } ts.nodeModuleNameResolver = nodeModuleNameResolver; function nodeModuleNameResolverWorker(moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference) { + var _a, _b; var traceEnabled = isTraceEnabled(compilerOptions, host); var failedLookupLocations = []; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations }; var result = ts.forEach(extensions, function (ext) { return tryResolve(ext); }); - if (result && result.value) { - var _a = result.value, resolved = _a.resolved, isExternalLibraryImport = _a.isExternalLibraryImport; - return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations); - } - return { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; + return createResolvedModuleWithFailedLookupLocations((_a = result === null || result === void 0 ? void 0 : result.value) === null || _a === void 0 ? void 0 : _a.resolved, (_b = result === null || result === void 0 ? void 0 : result.value) === null || _b === void 0 ? void 0 : _b.isExternalLibraryImport, failedLookupLocations, state.resultFromCache); function tryResolve(extensions) { var loader = function (extensions, candidate, onlyRecordFailures, state) { return nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, /*considerPackageJson*/ true); }; var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, state); @@ -30034,13 +30158,12 @@ var ts; } ts.unmangleScopedPackageName = unmangleScopedPackageName; function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, state) { - var _a; var result = cache && cache.get(containingDirectory); if (result) { if (state.traceEnabled) { trace(state.host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory); } - (_a = state.failedLookupLocations).push.apply(_a, result.failedLookupLocations); + state.resultFromCache = result; return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, originalPath: result.resolvedModule.originalPath || true, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId } }; } } @@ -30051,7 +30174,7 @@ var ts; var containingDirectory = ts.getDirectoryPath(containingFile); var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); // No originalPath because classic resolution doesn't resolve realPath - return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations); + return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations, state.resultFromCache); function tryResolve(extensions) { var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state); if (resolvedUsingSettings) { @@ -30096,7 +30219,7 @@ var ts; var failedLookupLocations = []; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations }; var resolved = loadModuleFromImmediateNodeModulesDirectory(Extensions.DtsOnly, moduleName, globalCache, state, /*typesScopeOnly*/ false); - return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations); + return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations, state.resultFromCache); } ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache; /** @@ -30139,26 +30262,26 @@ var ts; // A module is uninstantiated if it contains only switch (node.kind) { // 1. interface declarations, type alias declarations - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: if (ts.isEnumConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: if (!(ts.hasModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } break; // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: var exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 261 /* NamedExports */) { + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 262 /* NamedExports */) { var state = 0 /* NonInstantiated */; for (var _i = 0, _a = exportDeclaration.exportClause.elements; _i < _a.length; _i++) { var specifier = _a[_i]; @@ -30174,7 +30297,7 @@ var ts; } break; // 5. other uninstantiated module declarations. - case 250 /* ModuleBlock */: { + case 251 /* ModuleBlock */: { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateCached(n, visited); @@ -30196,7 +30319,7 @@ var ts; }); return state_1; } - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 75 /* Identifier */: // Only jsdoc typedef definition can exist in jsdoc namespace, and it should @@ -30404,7 +30527,7 @@ var ts; // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { - if (node.kind === 259 /* ExportAssignment */) { + if (node.kind === 260 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } var name = ts.getNameOfDeclaration(node); @@ -30413,7 +30536,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 154 /* ComputedPropertyName */) { + if (name.kind === 155 /* ComputedPropertyName */) { var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteralLike(nameExpression)) { @@ -30441,36 +30564,36 @@ var ts; return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: return "__constructor" /* Constructor */; - case 170 /* FunctionType */: - case 165 /* CallSignature */: - case 305 /* JSDocSignature */: + case 171 /* FunctionType */: + case 166 /* CallSignature */: + case 306 /* JSDocSignature */: return "__call" /* Call */; - case 171 /* ConstructorType */: - case 166 /* ConstructSignature */: + case 172 /* ConstructorType */: + case 167 /* ConstructSignature */: return "__new" /* New */; - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: return "__index" /* Index */; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 290 /* SourceFile */: + case 291 /* SourceFile */: // json file should behave as // module.exports = ... return "export=" /* ExportEquals */; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) { // module.exports = ... return "export=" /* ExportEquals */; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */); - case 156 /* Parameter */: + case 157 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 300 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); + ts.Debug.assert(node.parent.kind === 301 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); var functionType = node.parent; var index = functionType.parameters.indexOf(node); return "arg" + index; @@ -30570,7 +30693,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (node.kind === 259 /* ExportAssignment */ && !node.isExportEquals)) { + (node.kind === 260 /* ExportAssignment */ && !node.isExportEquals)) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName_1 = false; multipleDefaultExports_1 = true; @@ -30609,7 +30732,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 263 /* ExportSpecifier */ || (node.kind === 253 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 264 /* ExportSpecifier */ || (node.kind === 254 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -30676,7 +30799,7 @@ var ts; // for it. We must clear this so we don't accidentally move any stale data forward from // a previous compilation. if (containerFlags & 1 /* IsContainer */) { - if (node.kind !== 202 /* ArrowFunction */) { + if (node.kind !== 203 /* ArrowFunction */) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -30709,7 +30832,7 @@ var ts; } // We create a return control flow graph for IIFEs and constructors. For constructors // we use the return control flow graph in strict property initialization checks. - currentReturnTarget = isIIFE || node.kind === 162 /* Constructor */ ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 163 /* Constructor */ ? createBranchLabel() : undefined; currentExceptionTarget = undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; @@ -30724,13 +30847,13 @@ var ts; node.flags |= 512 /* HasExplicitReturn */; node.endFlowNode = currentFlow; } - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 162 /* Constructor */) { + if (node.kind === 163 /* Constructor */) { node.returnFlowNode = currentFlow; } } @@ -30774,8 +30897,8 @@ var ts; } } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, function (n) { return n.kind === 244 /* FunctionDeclaration */ ? bind(n) : undefined; }); - bindEach(nodes, function (n) { return n.kind !== 244 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind === 245 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind !== 245 /* FunctionDeclaration */ ? bind(n) : undefined; }); } function bindEach(nodes, bindFunction) { if (bindFunction === void 0) { bindFunction = bind; } @@ -30807,90 +30930,90 @@ var ts; bindJSDoc(node); return; } - if (node.kind >= 225 /* FirstStatement */ && node.kind <= 241 /* LastStatement */ && !options.allowUnreachableCode) { + if (node.kind >= 226 /* FirstStatement */ && node.kind <= 242 /* LastStatement */ && !options.allowUnreachableCode) { node.flowNode = currentFlow; } switch (node.kind) { - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: bindWhileStatement(node); break; - case 228 /* DoStatement */: + case 229 /* DoStatement */: bindDoStatement(node); break; - case 230 /* ForStatement */: + case 231 /* ForStatement */: bindForStatement(node); break; - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 227 /* IfStatement */: + case 228 /* IfStatement */: bindIfStatement(node); break; - case 235 /* ReturnStatement */: - case 239 /* ThrowStatement */: + case 236 /* ReturnStatement */: + case 240 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 240 /* TryStatement */: + case 241 /* TryStatement */: bindTryStatement(node); break; - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: bindSwitchStatement(node); break; - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: bindCaseBlock(node); break; - case 277 /* CaseClause */: + case 278 /* CaseClause */: bindCaseClause(node); break; - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: bindExpressionStatement(node); break; - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: bindLabeledStatement(node); break; - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: bindAccessExpressionFlow(node); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: bindCallExpressionFlow(node); break; - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: bindJSDocTypeAlias(node); break; // In source files and blocks, bind functions first to match hoisting that occurs at runtime - case 290 /* SourceFile */: { + case 291 /* SourceFile */: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 223 /* Block */: - case 250 /* ModuleBlock */: + case 224 /* Block */: + case 251 /* ModuleBlock */: bindEachFunctionsFirst(node.statements); break; default: @@ -30903,18 +31026,18 @@ var ts; switch (expr.kind) { case 75 /* Identifier */: case 104 /* ThisKeyword */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return containsNarrowableReference(expr); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return hasNarrowableArgument(expr); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return isNarrowingExpression(expr.expression); } return false; @@ -30936,7 +31059,7 @@ var ts; } } } - if (expr.expression.kind === 194 /* PropertyAccessExpression */ && + if (expr.expression.kind === 195 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { return true; } @@ -30969,9 +31092,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 62 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -31047,26 +31170,26 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 227 /* IfStatement */: - case 229 /* WhileStatement */: - case 228 /* DoStatement */: + case 228 /* IfStatement */: + case 230 /* WhileStatement */: + case 229 /* DoStatement */: return parent.expression === node; - case 230 /* ForStatement */: - case 210 /* ConditionalExpression */: + case 231 /* ForStatement */: + case 211 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 200 /* ParenthesizedExpression */) { + if (node.kind === 201 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 207 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { + else if (node.kind === 208 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 209 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || + return node.kind === 210 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */); } @@ -31108,7 +31231,7 @@ var ts; } function setContinueTarget(node, target) { var label = activeLabelList; - while (label && node.parent.kind === 238 /* LabeledStatement */) { + while (label && node.parent.kind === 239 /* LabeledStatement */) { label.continueTarget = target; label = label.next; node = node.parent; @@ -31159,12 +31282,12 @@ var ts; bind(node.expression); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 232 /* ForOfStatement */) { + if (node.kind === 233 /* ForOfStatement */) { bind(node.awaitModifier); } addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 243 /* VariableDeclarationList */) { + if (node.initializer.kind !== 244 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -31186,7 +31309,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 235 /* ReturnStatement */) { + if (node.kind === 236 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -31203,7 +31326,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 234 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 235 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -31303,7 +31426,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 278 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 279 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). Note, we no longer need // this property in control flow analysis, it's there only for backwards compatibility. @@ -31352,7 +31475,7 @@ var ts; bind(node.expression); // A top level call expression with a dotted function name and at least one argument // is potentially an assertion and is therefore included in the control flow. - if (node.expression.kind === 196 /* CallExpression */) { + if (node.expression.kind === 197 /* CallExpression */) { var call = node.expression; if (ts.isDottedName(call.expression)) { currentFlow = createFlowCall(currentFlow, call); @@ -31378,7 +31501,7 @@ var ts; currentFlow = finishFlowLabel(postStatementLabel); } function bindDestructuringTargetFlow(node) { - if (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { + if (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -31389,10 +31512,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); } - else if (node.kind === 192 /* ArrayLiteralExpression */) { + else if (node.kind === 193 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 213 /* SpreadElement */) { + if (e.kind === 214 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -31400,16 +31523,16 @@ var ts; } } } - else if (node.kind === 193 /* ObjectLiteralExpression */) { + else if (node.kind === 194 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 281 /* PropertyAssignment */) { + if (p.kind === 282 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 282 /* ShorthandPropertyAssignment */) { + else if (p.kind === 283 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 283 /* SpreadAssignment */) { + else if (p.kind === 284 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -31531,7 +31654,7 @@ var ts; var operator = node.operatorToken.kind; if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 62 /* EqualsToken */ && node.left.kind === 195 /* ElementAccessExpression */) { + if (operator === 62 /* EqualsToken */ && node.left.kind === 196 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -31593,7 +31716,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 194 /* PropertyAccessExpression */) { + if (node.expression.kind === 195 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -31632,14 +31755,14 @@ var ts; } function bindJSDocTypeAlias(node) { node.tagName.parent = node; - if (node.kind !== 316 /* JSDocEnumTag */ && node.fullName) { + if (node.kind !== 317 /* JSDocEnumTag */ && node.fullName) { setParentPointers(node, node.fullName); } } function bindJSDocClassTag(node) { bindEachChild(node); var host = ts.getHostSignatureFromJSDoc(node); - if (host && host.kind !== 161 /* MethodDeclaration */) { + if (host && host.kind !== 162 /* MethodDeclaration */) { addDeclarationToSymbol(host.symbol, host, 32 /* Class */); } } @@ -31653,13 +31776,13 @@ var ts; function bindOptionalChainRest(node) { bind(node.questionDotToken); switch (node.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: bind(node.name); break; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: bind(node.argumentExpression); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: bindEach(node.typeArguments); bindEach(node.arguments); break; @@ -31715,7 +31838,7 @@ var ts; // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = ts.skipParentheses(node.expression); - if (expr.kind === 201 /* FunctionExpression */ || expr.kind === 202 /* ArrowFunction */) { + if (expr.kind === 202 /* FunctionExpression */ || expr.kind === 203 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -31724,7 +31847,7 @@ var ts; bindEachChild(node); } } - if (node.expression.kind === 194 /* PropertyAccessExpression */) { + if (node.expression.kind === 195 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (ts.isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -31733,54 +31856,54 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 193 /* ObjectLiteralExpression */: - case 173 /* TypeLiteral */: - case 304 /* JSDocTypeLiteral */: - case 274 /* JsxAttributes */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 194 /* ObjectLiteralExpression */: + case 174 /* TypeLiteral */: + case 305 /* JSDocTypeLiteral */: + case 275 /* JsxAttributes */: return 1 /* IsContainer */; - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 249 /* ModuleDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 186 /* MappedType */: + case 250 /* ModuleDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 187 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 290 /* SourceFile */: + case 291 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } // falls through - case 162 /* Constructor */: - case 244 /* FunctionDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 165 /* CallSignature */: - case 305 /* JSDocSignature */: - case 300 /* JSDocFunctionType */: - case 170 /* FunctionType */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 171 /* ConstructorType */: + case 163 /* Constructor */: + case 245 /* FunctionDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 166 /* CallSignature */: + case 306 /* JSDocSignature */: + case 301 /* JSDocFunctionType */: + case 171 /* FunctionType */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 172 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 280 /* CatchClause */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: - case 251 /* CaseBlock */: + case 281 /* CatchClause */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: + case 252 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 223 /* Block */: + case 224 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -31813,45 +31936,45 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 290 /* SourceFile */: + case 291 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 173 /* TypeLiteral */: - case 304 /* JSDocTypeLiteral */: - case 193 /* ObjectLiteralExpression */: - case 246 /* InterfaceDeclaration */: - case 274 /* JsxAttributes */: + case 174 /* TypeLiteral */: + case 305 /* JSDocTypeLiteral */: + case 194 /* ObjectLiteralExpression */: + case 247 /* InterfaceDeclaration */: + case 275 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 305 /* JSDocSignature */: - case 167 /* IndexSignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 300 /* JSDocFunctionType */: - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 247 /* TypeAliasDeclaration */: - case 186 /* MappedType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 306 /* JSDocSignature */: + case 168 /* IndexSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 301 /* JSDocFunctionType */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 248 /* TypeAliasDeclaration */: + case 187 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -31952,7 +32075,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 283 /* SpreadAssignment */ || prop.name.kind !== 75 /* Identifier */) { + if (prop.kind === 284 /* SpreadAssignment */ || prop.name.kind !== 75 /* Identifier */) { continue; } var identifier = prop.name; @@ -31964,7 +32087,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 281 /* PropertyAssignment */ || prop.kind === 282 /* ShorthandPropertyAssignment */ || prop.kind === 161 /* MethodDeclaration */ + var currentKind = prop.kind === 282 /* PropertyAssignment */ || prop.kind === 283 /* ShorthandPropertyAssignment */ || prop.kind === 162 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen.get(identifier.escapedText); @@ -31996,10 +32119,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (ts.isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -32185,8 +32308,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 290 /* SourceFile */ && - blockScopeContainer.kind !== 249 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 291 /* SourceFile */ && + blockScopeContainer.kind !== 250 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -32281,7 +32404,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 152 /* LastToken */) { + if (node.kind > 153 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -32357,14 +32480,14 @@ var ts; } // falls through case 104 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 282 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 283 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); case 76 /* PrivateIdentifier */: return checkPrivateIdentifier(node); - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: var expr = node; if (currentFlow && isNarrowableReference(expr)) { expr.flowNode = currentFlow; @@ -32379,7 +32502,7 @@ var ts; declareSymbol(file.locals, /*parent*/ undefined, expr.expression, 1 /* FunctionScopedVariable */ | 134217728 /* ModuleExports */, 111550 /* FunctionScopedVariableExcludes */); } break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var specialKind = ts.getAssignmentDeclarationKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -32407,78 +32530,78 @@ var ts; ts.Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return checkStrictModeCatchClause(node); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return checkStrictModeWithStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return checkStrictModeLabeledStatement(node); - case 183 /* ThisType */: + case 184 /* ThisType */: seenThisKeyword = true; return; - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: break; // Binding the children will handle everything - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return bindTypeParameter(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return bindParameter(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 191 /* BindingElement */: + case 192 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return bindPropertyWorker(node); - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 284 /* EnumMember */: + case 285 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */); - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */); - case 170 /* FunctionType */: - case 300 /* JSDocFunctionType */: - case 305 /* JSDocSignature */: - case 171 /* ConstructorType */: + case 171 /* FunctionType */: + case 301 /* JSDocFunctionType */: + case 306 /* JSDocSignature */: + case 172 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 173 /* TypeLiteral */: - case 304 /* JSDocTypeLiteral */: - case 186 /* MappedType */: + case 174 /* TypeLiteral */: + case 305 /* JSDocTypeLiteral */: + case 187 /* MappedType */: return bindAnonymousTypeWorker(node); - case 310 /* JSDocClassTag */: + case 311 /* JSDocClassTag */: return bindJSDocClassTag(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return bindFunctionExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: var assignmentKind = ts.getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7 /* ObjectDefinePropertyValue */: @@ -32497,65 +32620,65 @@ var ts; } break; // Members of classes, interfaces, and modules - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return bindJsxAttributes(node); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 253 /* ImportEqualsDeclaration */: - case 256 /* NamespaceImport */: - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 254 /* ImportEqualsDeclaration */: + case 257 /* NamespaceImport */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return bindImportClause(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return bindExportDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return bindExportAssignment(node); - case 290 /* SourceFile */: + case 291 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 223 /* Block */: + case 224 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } // falls through - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 317 /* JSDocParameterTag */: - if (node.parent.kind === 305 /* JSDocSignature */) { + case 318 /* JSDocParameterTag */: + if (node.parent.kind === 306 /* JSDocSignature */) { return bindParameter(node); } - if (node.parent.kind !== 304 /* JSDocTypeLiteral */) { + if (node.parent.kind !== 305 /* JSDocTypeLiteral */) { break; } // falls through - case 323 /* JSDocPropertyTag */: + case 324 /* JSDocPropertyTag */: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 299 /* JSDocOptionalType */ ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 300 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); } } @@ -32711,8 +32834,8 @@ var ts; } var thisContainer = ts.getThisContainer(node, /*includeArrowFunctions*/ false); switch (thisContainer.kind) { - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: var constructorSymbol = thisContainer.symbol; // For `f.prototype.m = function() { this.x = 0; }`, `this.x = 0` should modify `f`'s members, not the function expression. if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -32734,11 +32857,11 @@ var ts; addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */); } break; - case 162 /* Constructor */: - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 163 /* Constructor */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // this.foo assignment in a JavaScript class // Bind this property to the containing class var containingClass = thisContainer.parent; @@ -32750,7 +32873,7 @@ var ts; declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, /*isReplaceableByMethod*/ true); } break; - case 290 /* SourceFile */: + case 291 /* SourceFile */: // this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script if (ts.hasDynamicName(node)) { break; @@ -32780,7 +32903,7 @@ var ts; if (node.expression.kind === 104 /* ThisKeyword */) { bindThisPropertyAssignment(node); } - else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 290 /* SourceFile */) { + else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 291 /* SourceFile */) { if (ts.isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } @@ -32820,7 +32943,7 @@ var ts; } function bindObjectDefinePropertyAssignment(node) { var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - var isToplevel = node.parent.parent.kind === 290 /* SourceFile */; + var isToplevel = node.parent.parent.kind === 291 /* SourceFile */; namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, /*isPrototypeProperty*/ false, /*containerIsClass*/ false); bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, /*isPrototypeProperty*/ false); } @@ -32922,8 +33045,8 @@ var ts; } function isTopLevelNamespaceAssignment(propertyAccess) { return ts.isBinaryExpression(propertyAccess.parent) - ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 290 /* SourceFile */ - : propertyAccess.parent.parent.kind === 290 /* SourceFile */; + ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 291 /* SourceFile */ + : propertyAccess.parent.parent.kind === 291 /* SourceFile */; } function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { var namespaceSymbol = lookupSymbolForPropertyAccess(name); @@ -33002,7 +33125,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 245 /* ClassDeclaration */) { + if (node.kind === 246 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */); } else { @@ -33065,7 +33188,7 @@ var ts; } } function bindParameter(node) { - if (node.kind === 317 /* JSDocParameterTag */ && container.kind !== 305 /* JSDocSignature */) { + if (node.kind === 318 /* JSDocParameterTag */ && container.kind !== 306 /* JSDocSignature */) { return; } if (inStrictMode && !(node.flags & 8388608 /* Ambient */)) { @@ -33142,7 +33265,7 @@ var ts; declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); } } - else if (node.parent.kind === 181 /* InferType */) { + else if (node.parent.kind === 182 /* InferType */) { var container_2 = getInferTypeContainer(node.parent); if (container_2) { if (!container_2.locals) { @@ -33170,11 +33293,11 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 224 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 225 /* EmptyStatement */) || // report error on class declarations - node.kind === 245 /* ClassDeclaration */ || + node.kind === 246 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 249 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); + (node.kind === 250 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); if (reportError) { currentFlow = reportedUnreachableFlow; if (!options.allowUnreachableCode) { @@ -33218,12 +33341,12 @@ var ts; } function isPurelyTypeDeclaration(s) { switch (s.kind) { - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: return true; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return getModuleInstanceState(s) !== 1 /* Instantiated */; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return ts.hasModifier(s, 2048 /* Const */); default: return false; @@ -33272,58 +33395,58 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 196 /* CallExpression */: + case 197 /* CallExpression */: return computeCallExpression(node, subtreeFlags); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return computeNewExpression(node, subtreeFlags); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return computeModuleDeclaration(node, subtreeFlags); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return computeParenthesizedExpression(node, subtreeFlags); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return computeBinaryExpression(node, subtreeFlags); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return computeExpressionStatement(node, subtreeFlags); - case 156 /* Parameter */: + case 157 /* Parameter */: return computeParameter(node, subtreeFlags); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return computeArrowFunction(node, subtreeFlags); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return computeFunctionExpression(node, subtreeFlags); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return computeFunctionDeclaration(node, subtreeFlags); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return computeVariableDeclaration(node, subtreeFlags); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return computeVariableDeclarationList(node, subtreeFlags); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return computeVariableStatement(node, subtreeFlags); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return computeLabeledStatement(node, subtreeFlags); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return computeClassDeclaration(node, subtreeFlags); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return computeClassExpression(node, subtreeFlags); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: return computeHeritageClause(node, subtreeFlags); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return computeCatchClause(node, subtreeFlags); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 162 /* Constructor */: + case 163 /* Constructor */: return computeConstructor(node, subtreeFlags); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return computePropertyDeclaration(node, subtreeFlags); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return computeMethod(node, subtreeFlags); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return computeAccessor(node, subtreeFlags); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return computeImportEquals(node, subtreeFlags); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return computePropertyAccess(node, subtreeFlags); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return computeElementAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); @@ -33374,12 +33497,12 @@ var ts; if (operatorTokenKind === 60 /* QuestionQuestionToken */) { transformFlags |= 8 /* AssertES2020 */; } - else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 193 /* ObjectLiteralExpression */) { + else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 194 /* ObjectLiteralExpression */) { // Destructuring object assignments with are ES2015 syntax // and possibly ES2018 if they contain rest transformFlags |= 32 /* AssertES2018 */ | 256 /* AssertES2015 */ | 1024 /* AssertDestructuringAssignment */; } - else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 192 /* ArrayLiteralExpression */) { + else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 193 /* ArrayLiteralExpression */) { // Destructuring assignments are ES2015 syntax. transformFlags |= 256 /* AssertES2015 */ | 1024 /* AssertDestructuringAssignment */; } @@ -33427,8 +33550,8 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (expressionKind === 217 /* AsExpression */ - || expressionKind === 199 /* TypeAssertionExpression */) { + if (expressionKind === 218 /* AsExpression */ + || expressionKind === 200 /* TypeAssertionExpression */) { transformFlags |= 1 /* AssertTypeScript */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; @@ -33776,13 +33899,13 @@ var ts; // async is ES2017 syntax, but may be ES2018 syntax (for async generators) transformFlags |= 32 /* AssertES2018 */ | 64 /* AssertES2017 */; break; - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: // await is ES2017 syntax, but may be ES2018 syntax (for async generators) transformFlags |= 32 /* AssertES2018 */ | 64 /* AssertES2017 */ | 524288 /* ContainsAwait */; break; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: - case 326 /* PartiallyEmittedExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: + case 327 /* PartiallyEmittedExpression */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; excludeFlags = 536870912 /* OuterExpressionExcludes */; @@ -33791,27 +33914,27 @@ var ts; case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 122 /* AbstractKeyword */: - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: case 81 /* ConstKeyword */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: - case 218 /* NonNullExpression */: - case 138 /* ReadonlyKeyword */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: + case 219 /* NonNullExpression */: + case 139 /* ReadonlyKeyword */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; break; - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: case 11 /* JsxText */: - case 269 /* JsxClosingElement */: - case 270 /* JsxFragment */: - case 271 /* JsxOpeningFragment */: - case 272 /* JsxClosingFragment */: - case 273 /* JsxAttribute */: - case 274 /* JsxAttributes */: - case 275 /* JsxSpreadAttribute */: - case 276 /* JsxExpression */: + case 270 /* JsxClosingElement */: + case 271 /* JsxFragment */: + case 272 /* JsxOpeningFragment */: + case 273 /* JsxClosingFragment */: + case 274 /* JsxAttribute */: + case 275 /* JsxAttributes */: + case 276 /* JsxSpreadAttribute */: + case 277 /* JsxExpression */: // These nodes are Jsx syntax. transformFlags |= 2 /* AssertJsx */; break; @@ -33824,16 +33947,16 @@ var ts; break; } // falls through - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: if (ts.hasInvalidEscape(node.template)) { transformFlags |= 32 /* AssertES2018 */; break; } // falls through - case 211 /* TemplateExpression */: - case 282 /* ShorthandPropertyAssignment */: + case 212 /* TemplateExpression */: + case 283 /* ShorthandPropertyAssignment */: case 120 /* StaticKeyword */: - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: // These nodes are ES6 syntax. transformFlags |= 256 /* AssertES2015 */; break; @@ -33850,70 +33973,70 @@ var ts; case 9 /* BigIntLiteral */: transformFlags |= 4 /* AssertESNext */; break; - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: // This node is either ES2015 syntax or ES2017 syntax (if it is a for-await-of). if (node.awaitModifier) { transformFlags |= 32 /* AssertES2018 */; } transformFlags |= 256 /* AssertES2015 */; break; - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: // This node is either ES2015 syntax (in a generator) or ES2017 syntax (in an async // generator). transformFlags |= 32 /* AssertES2018 */ | 256 /* AssertES2015 */ | 262144 /* ContainsYield */; break; case 125 /* AnyKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 137 /* NeverKeyword */: - case 141 /* ObjectKeyword */: - case 143 /* StringKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 138 /* NeverKeyword */: + case 142 /* ObjectKeyword */: + case 144 /* StringKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: case 110 /* VoidKeyword */: - case 155 /* TypeParameter */: - case 158 /* PropertySignature */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 168 /* TypePredicate */: - case 169 /* TypeReference */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 172 /* TypeQuery */: - case 173 /* TypeLiteral */: - case 174 /* ArrayType */: - case 175 /* TupleType */: - case 176 /* OptionalType */: - case 177 /* RestType */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 180 /* ConditionalType */: - case 181 /* InferType */: - case 182 /* ParenthesizedType */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 183 /* ThisType */: - case 184 /* TypeOperator */: - case 185 /* IndexedAccessType */: - case 186 /* MappedType */: - case 187 /* LiteralType */: - case 252 /* NamespaceExportDeclaration */: + case 156 /* TypeParameter */: + case 159 /* PropertySignature */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 169 /* TypePredicate */: + case 170 /* TypeReference */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 173 /* TypeQuery */: + case 174 /* TypeLiteral */: + case 175 /* ArrayType */: + case 176 /* TupleType */: + case 177 /* OptionalType */: + case 178 /* RestType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 181 /* ConditionalType */: + case 182 /* InferType */: + case 183 /* ParenthesizedType */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 184 /* ThisType */: + case 185 /* TypeOperator */: + case 186 /* IndexedAccessType */: + case 187 /* MappedType */: + case 188 /* LiteralType */: + case 253 /* NamespaceExportDeclaration */: // Types and signatures are TypeScript syntax, and exclude all other facts. transformFlags = 1 /* AssertTypeScript */; excludeFlags = -2 /* TypeExcludes */; break; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: // Even though computed property names are ES6, we don't treat them as such. // This is so that they can flow through PropertyName transforms unaffected. // Instead, we mark the container as ES6, so that it can properly handle the transform. transformFlags |= 32768 /* ContainsComputedPropertyName */; break; - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: transformFlags |= 256 /* AssertES2015 */ | 8192 /* ContainsRestOrSpread */; break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: transformFlags |= 32 /* AssertES2018 */ | 16384 /* ContainsObjectRestOrSpread */; break; case 102 /* SuperKeyword */: @@ -33925,28 +34048,28 @@ var ts; // Mark this node and its ancestors as containing a lexical `this` keyword. transformFlags |= 4096 /* ContainsLexicalThis */; break; - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: transformFlags |= 256 /* AssertES2015 */ | 131072 /* ContainsBindingPattern */; if (subtreeFlags & 8192 /* ContainsRestOrSpread */) { transformFlags |= 32 /* AssertES2018 */ | 16384 /* ContainsObjectRestOrSpread */; } excludeFlags = 536879104 /* BindingPatternExcludes */; break; - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: transformFlags |= 256 /* AssertES2015 */ | 131072 /* ContainsBindingPattern */; excludeFlags = 536879104 /* BindingPatternExcludes */; break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: transformFlags |= 256 /* AssertES2015 */; if (node.dotDotDotToken) { transformFlags |= 8192 /* ContainsRestOrSpread */; } break; - case 157 /* Decorator */: + case 158 /* Decorator */: // This node is TypeScript syntax, and marks its container as also being TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */ | 2048 /* ContainsTypeScriptClassSyntax */; break; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: excludeFlags = 536922112 /* ObjectLiteralExcludes */; if (subtreeFlags & 32768 /* ContainsComputedPropertyName */) { // If an ObjectLiteralExpression contains a ComputedPropertyName, then it @@ -33959,29 +34082,29 @@ var ts; transformFlags |= 32 /* AssertES2018 */; } break; - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: excludeFlags = 536879104 /* ArrayLiteralOrCallOrNewExcludes */; break; - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: // A loop containing a block scoped binding *may* need to be transformed from ES6. if (subtreeFlags & 65536 /* ContainsBlockScopedBinding */) { transformFlags |= 256 /* AssertES2015 */; } break; - case 290 /* SourceFile */: + case 291 /* SourceFile */: break; - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: transformFlags |= 4 /* AssertESNext */; break; - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: // Return statements may require an `await` in ES2018. transformFlags |= 1048576 /* ContainsHoistedDeclarationOrCompletion */ | 32 /* AssertES2018 */; break; - case 233 /* ContinueStatement */: - case 234 /* BreakStatement */: + case 234 /* ContinueStatement */: + case 235 /* BreakStatement */: transformFlags |= 1048576 /* ContainsHoistedDeclarationOrCompletion */; break; case 76 /* PrivateIdentifier */: @@ -34002,67 +34125,67 @@ var ts; * than calling this function. */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 168 /* FirstTypeNode */ && kind <= 188 /* LastTypeNode */) { + if (kind >= 169 /* FirstTypeNode */ && kind <= 189 /* LastTypeNode */) { return -2 /* TypeExcludes */; } switch (kind) { - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 192 /* ArrayLiteralExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 193 /* ArrayLiteralExpression */: return 536879104 /* ArrayLiteralOrCallOrNewExcludes */; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return 537991168 /* ModuleExcludes */; - case 156 /* Parameter */: + case 157 /* Parameter */: return 536870912 /* ParameterExcludes */; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return 538920960 /* ArrowFunctionExcludes */; - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: return 538925056 /* FunctionExcludes */; - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return 537018368 /* VariableDeclarationListExcludes */; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return 536905728 /* ClassExcludes */; - case 162 /* Constructor */: + case 163 /* Constructor */: return 538923008 /* ConstructorExcludes */; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return 538923008 /* MethodOrAccessorExcludes */; case 125 /* AnyKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 137 /* NeverKeyword */: - case 143 /* StringKeyword */: - case 141 /* ObjectKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 138 /* NeverKeyword */: + case 144 /* StringKeyword */: + case 142 /* ObjectKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: case 110 /* VoidKeyword */: - case 155 /* TypeParameter */: - case 158 /* PropertySignature */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 156 /* TypeParameter */: + case 159 /* PropertySignature */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: return -2 /* TypeExcludes */; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return 536922112 /* ObjectLiteralExcludes */; - case 280 /* CatchClause */: + case 281 /* CatchClause */: return 536887296 /* CatchClauseExcludes */; - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: return 536879104 /* BindingPatternExcludes */; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: - case 326 /* PartiallyEmittedExpression */: - case 200 /* ParenthesizedExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: + case 327 /* PartiallyEmittedExpression */: + case 201 /* ParenthesizedExpression */: case 102 /* SuperKeyword */: return 536870912 /* OuterExpressionExcludes */; - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return 536870912 /* PropertyAccessExcludes */; default: return 536870912 /* NodeExcludes */; @@ -34237,7 +34360,7 @@ var ts; // (their type resolved directly to the member deeply referenced) // So to get the intervening symbols, we need to check if there's a type // query node on any of the symbol's declarations and get symbols there - if (d.type && d.type.kind === 172 /* TypeQuery */) { + if (d.type && d.type.kind === 173 /* TypeQuery */) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -34423,6 +34546,7 @@ var ts; IntersectionState[IntersectionState["None"] = 0] = "None"; IntersectionState[IntersectionState["Source"] = 1] = "Source"; IntersectionState[IntersectionState["Target"] = 2] = "Target"; + IntersectionState[IntersectionState["ExcessCheck"] = 4] = "ExcessCheck"; })(IntersectionState || (IntersectionState = {})); var MappedTypeModifiers; (function (MappedTypeModifiers) { @@ -34465,6 +34589,11 @@ var ts; DeclarationSpaces[DeclarationSpaces["ExportType"] = 2] = "ExportType"; DeclarationSpaces[DeclarationSpaces["ExportNamespace"] = 4] = "ExportNamespace"; })(DeclarationSpaces || (DeclarationSpaces = {})); + function SymbolLinks() { + } + function NodeLinks() { + this.flags = 0; + } function getNodeId(node) { if (!node.id) { node.id = nextNodeId; @@ -34524,7 +34653,6 @@ var ts; var constraintDepth = 0; var currentNode; var emptySymbols = ts.createSymbolTable(); - var identityMapper = ts.identity; var arrayVariances = [1 /* Covariant */]; var compilerOptions = host.getCompilerOptions(); var languageVersion = ts.getEmitScriptTarget(compilerOptions); @@ -34874,6 +35002,7 @@ var ts; var literalTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); var substitutionTypes = ts.createMap(); + var awaitedTypes = ts.createMap(); var evolvingArrayTypes = []; var undefinedProperties = ts.createMap(); var unknownSymbol = createSymbol(4 /* Property */, "unknown"); @@ -34921,6 +35050,8 @@ var ts; var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); var keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; var numberOrBigIntType = getUnionType([numberType, bigintType]); + var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t; }); + var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? wildcardType : t; }); var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var emptyJsxObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); emptyJsxObjectType.objectFlags |= 4096 /* JsxAttributes */; @@ -35430,14 +35561,14 @@ var ts; if (symbol.flags & 33554432 /* Transient */) return symbol; var id = getSymbolId(symbol); - return symbolLinks[id] || (symbolLinks[id] = {}); + return symbolLinks[id] || (symbolLinks[id] = new SymbolLinks()); } function getNodeLinks(node) { var nodeId = getNodeId(node); - return nodeLinks[nodeId] || (nodeLinks[nodeId] = { flags: 0 }); + return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); } function isGlobalSourceFile(node) { - return node.kind === 290 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 291 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -35495,17 +35626,17 @@ var ts; } if (declaration.pos <= usage.pos) { // declaration is before usage - if (declaration.kind === 191 /* BindingElement */) { + if (declaration.kind === 192 /* BindingElement */) { // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) - var errorBindingElement = ts.getAncestor(usage, 191 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 192 /* BindingElement */); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 242 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 243 /* VariableDeclaration */), usage); } - else if (declaration.kind === 242 /* VariableDeclaration */) { + else if (declaration.kind === 243 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } @@ -35536,12 +35667,12 @@ var ts; // or if usage is in a type context: // 1. inside a type query (typeof in type position) // 2. inside a jsdoc comment - if (usage.parent.kind === 263 /* ExportSpecifier */ || (usage.parent.kind === 259 /* ExportAssignment */ && usage.parent.isExportEquals)) { + if (usage.parent.kind === 264 /* ExportSpecifier */ || (usage.parent.kind === 260 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } // When resolving symbols for exports, the `usage` location passed in can be the export site directly - if (usage.kind === 259 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 260 /* ExportAssignment */ && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -35561,9 +35692,9 @@ var ts; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 225 /* VariableStatement */: - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: + case 226 /* VariableStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, container)) { @@ -35584,16 +35715,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 159 /* PropertyDeclaration */ && + current.parent.kind === 160 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasModifier(current.parent, 32 /* Static */)) { - if (declaration.kind === 161 /* MethodDeclaration */) { + if (declaration.kind === 162 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -35615,19 +35746,19 @@ var ts; return "quit"; } switch (node.kind) { - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return true; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // even when stopping at any property declaration, they need to come from the same class return stopAtAnyPropertyDeclaration && (ts.isPropertyDeclaration(declaration) && node.parent === declaration.parent || ts.isParameterPropertyDeclaration(declaration, declaration.parent) && node.parent === declaration.parent.parent) ? "quit" : true; - case 223 /* Block */: + case 224 /* Block */: switch (node.parent.kind) { - case 163 /* GetAccessor */: - case 161 /* MethodDeclaration */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 162 /* MethodDeclaration */: + case 165 /* SetAccessor */: return true; default: return false; @@ -35673,12 +35804,12 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 303 /* JSDocComment */) { + if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 304 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === location.type || - lastLocation.kind === 156 /* Parameter */ || - lastLocation.kind === 155 /* TypeParameter */ + lastLocation.kind === 157 /* Parameter */ || + lastLocation.kind === 156 /* TypeParameter */ // local types not visible outside the function body : false; } @@ -35695,13 +35826,13 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 156 /* Parameter */ || + lastLocation.kind === 157 /* Parameter */ || (lastLocation === location.type && !!ts.findAncestor(result.valueDeclaration, ts.isParameter)); } } } - else if (location.kind === 180 /* ConditionalType */) { + else if (location.kind === 181 /* ConditionalType */) { // A type parameter declared using 'infer T' in a conditional type is visible only in // the true branch of the conditional type. useResult = lastLocation === location.trueType; @@ -35716,14 +35847,14 @@ var ts; } withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; // falls through - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports || emptySymbols; - if (location.kind === 290 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { + if (location.kind === 291 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. if (result = moduleExports.get("default" /* Default */)) { @@ -35747,7 +35878,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && - (ts.getDeclarationOfKind(moduleExport, 263 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 262 /* NamespaceExport */))) { + (ts.getDeclarationOfKind(moduleExport, 264 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 263 /* NamespaceExport */))) { break; } } @@ -35761,12 +35892,12 @@ var ts; } } break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -35783,9 +35914,9 @@ var ts; } } break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: // The below is used to lookup type parameters within a class or interface, as they are added to the class/interface locals // These can never be latebound, so the symbol's raw members are sufficient. `getMembersOfNode` cannot be used, as it would // trigger resolving late-bound names, which we may already be in the process of doing while we're here! @@ -35804,7 +35935,7 @@ var ts; } break loop; } - if (location.kind === 214 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 215 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -35812,7 +35943,7 @@ var ts; } } break; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: // The type parameters of a class are not in scope in the base class expression. if (lastLocation === location.expression && location.parent.token === 90 /* ExtendsKeyword */) { var container = location.parent.parent; @@ -35832,9 +35963,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 246 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 247 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -35842,24 +35973,24 @@ var ts; } } break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: // when targeting ES6 or higher there is no 'arguments' in an arrow function // for lower compile targets the resolved symbol is used to emit an error if (compilerOptions.target >= 2 /* ES2015 */) { break; } // falls through - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 244 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 245 /* FunctionDeclaration */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -35872,7 +36003,7 @@ var ts; } } break; - case 157 /* Decorator */: + case 158 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -35881,7 +36012,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 156 /* Parameter */) { + if (location.parent && location.parent.kind === 157 /* Parameter */) { location = location.parent; } // @@ -35896,25 +36027,25 @@ var ts; // declare function y(x: T): any; // @param(1 as T) // <-- T should resolve to the type alias outside of class C // class C {} - if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 245 /* ClassDeclaration */)) { + if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 246 /* ClassDeclaration */)) { location = location.parent; } break; - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: // js type aliases do not resolve names from their host, so skip past it location = ts.getJSDocHost(location); break; - case 156 /* Parameter */: + case 157 /* Parameter */: if (lastLocation && lastLocation === location.initializer) { associatedDeclarationForContainingInitializer = location; } break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: if (lastLocation && lastLocation === location.initializer) { var root = ts.getRootDeclaration(location); - if (root.kind === 156 /* Parameter */) { + if (root.kind === 157 /* Parameter */) { associatedDeclarationForContainingInitializer = location; } } @@ -35934,7 +36065,7 @@ var ts; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 290 /* SourceFile */); + ts.Debug.assert(lastLocation.kind === 291 /* SourceFile */); if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) { return lastLocation.symbol; } @@ -36051,10 +36182,10 @@ var ts; } } function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 202 /* ArrowFunction */ && location.kind !== 201 /* FunctionExpression */) { + if (location.kind !== 203 /* ArrowFunction */ && location.kind !== 202 /* FunctionExpression */) { // initializers in instance property declaration of class like entities are executed in constructor and thus deferred return ts.isTypeQueryNode(location) || ((ts.isFunctionLikeDeclaration(location) || - (location.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred + (location.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred } if (lastLocation && lastLocation === location.name) { return false; @@ -36067,12 +36198,12 @@ var ts; } function isSelfReferenceLocation(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 249 /* ModuleDeclaration */: // For `namespace N { N; }` + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 250 /* ModuleDeclaration */: // For `namespace N { N; }` return true; default: return false; @@ -36084,7 +36215,7 @@ var ts; function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 155 /* TypeParameter */) { + if (decl.kind === 156 /* TypeParameter */) { var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent; if (parent === container) { return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias)); // TODO: GH#18217 @@ -36140,9 +36271,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 75 /* Identifier */: - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -36176,7 +36307,7 @@ var ts; if (meaning & (788968 /* Type */ & ~1920 /* Namespace */)) { var symbol = resolveSymbol(resolveName(errorLocation, name, ~788968 /* Type */ & 111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); if (symbol && !(symbol.flags & 1920 /* Namespace */)) { - error(errorLocation, ts.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here, ts.unescapeLeadingUnderscores(name)); + error(errorLocation, ts.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0, ts.unescapeLeadingUnderscores(name)); return true; } } @@ -36186,7 +36317,7 @@ var ts; return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; } function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 263 /* ExportSpecifier */) { + if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 264 /* ExportSpecifier */) { error(errorLocation, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); return true; } @@ -36245,7 +36376,7 @@ var ts; return; } // Block-scoped variables cannot be used before their definition - var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 248 /* EnumDeclaration */); }); + var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 249 /* EnumDeclaration */); }); if (declaration === undefined) return ts.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); if (!(declaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { @@ -36280,13 +36411,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return node; - case 255 /* ImportClause */: + case 256 /* ImportClause */: return node.parent; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return node.parent.parent; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return node.parent.parent.parent; default: return undefined; @@ -36310,28 +36441,28 @@ var ts; * {name: } */ function isAliasSymbolDeclaration(node) { - return node.kind === 253 /* ImportEqualsDeclaration */ || - node.kind === 252 /* NamespaceExportDeclaration */ || - node.kind === 255 /* ImportClause */ && !!node.name || - node.kind === 256 /* NamespaceImport */ || - node.kind === 262 /* NamespaceExport */ || - node.kind === 258 /* ImportSpecifier */ || - node.kind === 263 /* ExportSpecifier */ || - node.kind === 259 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || + return node.kind === 254 /* ImportEqualsDeclaration */ || + node.kind === 253 /* NamespaceExportDeclaration */ || + node.kind === 256 /* ImportClause */ && !!node.name || + node.kind === 257 /* NamespaceImport */ || + node.kind === 263 /* NamespaceExport */ || + node.kind === 259 /* ImportSpecifier */ || + node.kind === 264 /* ExportSpecifier */ || + node.kind === 260 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || - node.kind === 282 /* ShorthandPropertyAssignment */ || - node.kind === 281 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); + node.kind === 283 /* ShorthandPropertyAssignment */ || + node.kind === 282 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); } function isAliasableOrJsExpression(e) { return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - if (node.moduleReference.kind === 265 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 266 /* ExternalModuleReference */) { var immediate = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var resolved_4 = resolveExternalModuleSymbol(immediate); markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved_4, /*overwriteEmpty*/ false); @@ -36632,28 +36763,28 @@ var ts; function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; } switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 259 /* ExportAssignment */: - case 209 /* BinaryExpression */: + case 260 /* ExportAssignment */: + case 210 /* BinaryExpression */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ true, dontRecursivelyResolve); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return getTargetOfPropertyAssignment(node, dontRecursivelyResolve); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve); default: return ts.Debug.fail(); @@ -36693,6 +36824,13 @@ var ts; } return links.target; } + function tryResolveAlias(symbol) { + var links = getSymbolLinks(symbol); + if (links.target !== resolvingSymbol) { + return resolveAlias(symbol); + } + return undefined; + } /** * Marks a symbol as type-only if its declaration is syntactically type-only. * If it is not itself marked type-only, but resolves to a type-only alias @@ -36798,13 +36936,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 75 /* Identifier */ || entityName.parent.kind === 153 /* QualifiedName */) { + if (entityName.kind === 75 /* Identifier */ || entityName.parent.kind === 154 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 253 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 254 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } @@ -36828,9 +36966,9 @@ var ts; return symbolFromJSPrototype; } } - else if (name.kind === 153 /* QualifiedName */ || name.kind === 194 /* PropertyAccessExpression */) { - var left = name.kind === 153 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 153 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 154 /* QualifiedName */ || name.kind === 195 /* PropertyAccessExpression */) { + var left = name.kind === 154 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 154 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -36865,7 +37003,7 @@ var ts; throw ts.Debug.assertNever(name, "Unknown entity name kind."); } ts.Debug.assert((ts.getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 259 /* ExportAssignment */)) { + if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 260 /* ExportAssignment */)) { markSymbolOfAliasDeclarationIfTypeOnly(ts.getAliasDeclarationFromName(name), symbol, /*finalTarget*/ undefined, /*overwriteEmpty*/ true); } return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); @@ -36944,7 +37082,7 @@ var ts; } } function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) { - return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : ts.Diagnostics.Cannot_find_module_0); + return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : ts.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations); } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } @@ -37087,7 +37225,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 290 /* SourceFile */)) { + if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 291 /* SourceFile */)) { var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; @@ -37374,7 +37512,7 @@ var ts; var members = node.members; for (var _i = 0, members_3 = members; _i < members_3.length; _i++) { var member = members_3[_i]; - if (member.kind === 162 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 163 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -37461,12 +37599,12 @@ var ts; } } switch (location.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } // falls through - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: var sym = getSymbolOfNode(location); // `sym` may not have exports if this module declaration is backed by the symbol for a `const` that's being rewritten // into a namespace - in such cases, it's best to just let the namespace appear empty (the const members couldn't have referred @@ -37475,9 +37613,9 @@ var ts; return { value: result }; } break; - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: // Type parameters are bound into `members` lists so they can merge across declarations // This is troublesome, since in all other respects, they behave like locals :cries: // TODO: the below is shared with similar code in `resolveName` - in fact, rephrasing all this symbol @@ -37560,7 +37698,7 @@ var ts; && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) // While exports are generally considered to be in scope, export-specifier declared symbols are _not_ // See similar comment in `resolveName` for details - && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 263 /* ExportSpecifier */))) { + && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 264 /* ExportSpecifier */))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); var candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); if (candidate) { @@ -37604,7 +37742,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 263 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 264 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -37619,10 +37757,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: continue; default: return false; @@ -37753,10 +37891,10 @@ var ts; return node && getSymbolOfNode(node); } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -37803,14 +37941,14 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 172 /* TypeQuery */ || + if (entityName.parent.kind === 173 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 154 /* ComputedPropertyName */) { + entityName.parent.kind === 155 /* ComputedPropertyName */) { // Typeof value meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 153 /* QualifiedName */ || entityName.kind === 194 /* PropertyAccessExpression */ || - entityName.parent.kind === 253 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 154 /* QualifiedName */ || entityName.kind === 195 /* PropertyAccessExpression */ || + entityName.parent.kind === 254 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -37859,10 +37997,10 @@ var ts; function signatureToStringWorker(writer) { var sigOutput; if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 171 /* ConstructorType */ : 170 /* FunctionType */; + sigOutput = kind === 1 /* Construct */ ? 172 /* ConstructorType */ : 171 /* FunctionType */; } else { - sigOutput = kind === 1 /* Construct */ ? 166 /* ConstructSignature */ : 165 /* CallSignature */; + sigOutput = kind === 1 /* Construct */ ? 167 /* ConstructSignature */ : 166 /* CallSignature */; } var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); @@ -37946,6 +38084,7 @@ var ts; getSourceFiles: function () { return host.getSourceFiles(); }, getCurrentDirectory: ts.maybeBind(host, host.getCurrentDirectory), getProbableSymlinks: ts.maybeBind(host, host.getProbableSymlinks), + useCaseSensitiveFileNames: ts.maybeBind(host, host.useCaseSensitiveFileNames) } : undefined }, encounteredError: false, visitedTypes: undefined, @@ -37977,23 +38116,23 @@ var ts; return ts.createKeywordTypeNode(125 /* AnyKeyword */); } if (type.flags & 2 /* Unknown */) { - return ts.createKeywordTypeNode(148 /* UnknownKeyword */); + return ts.createKeywordTypeNode(149 /* UnknownKeyword */); } if (type.flags & 4 /* String */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(143 /* StringKeyword */); + return ts.createKeywordTypeNode(144 /* StringKeyword */); } if (type.flags & 8 /* Number */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(140 /* NumberKeyword */); + return ts.createKeywordTypeNode(141 /* NumberKeyword */); } if (type.flags & 64 /* BigInt */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(151 /* BigIntKeyword */); + return ts.createKeywordTypeNode(152 /* BigIntKeyword */); } if (type.flags & 16 /* Boolean */) { context.approximateLength += 7; - return ts.createKeywordTypeNode(128 /* BooleanKeyword */); + return ts.createKeywordTypeNode(129 /* BooleanKeyword */); } if (type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */)) { var parentSymbol = getParentOfSymbol(type.symbol); @@ -38034,7 +38173,7 @@ var ts; } } context.approximateLength += 13; - return ts.createTypeOperatorNode(147 /* UniqueKeyword */, ts.createKeywordTypeNode(144 /* SymbolKeyword */)); + return ts.createTypeOperatorNode(148 /* UniqueKeyword */, ts.createKeywordTypeNode(145 /* SymbolKeyword */)); } if (type.flags & 16384 /* Void */) { context.approximateLength += 4; @@ -38042,7 +38181,7 @@ var ts; } if (type.flags & 32768 /* Undefined */) { context.approximateLength += 9; - return ts.createKeywordTypeNode(146 /* UndefinedKeyword */); + return ts.createKeywordTypeNode(147 /* UndefinedKeyword */); } if (type.flags & 65536 /* Null */) { context.approximateLength += 4; @@ -38050,15 +38189,15 @@ var ts; } if (type.flags & 131072 /* Never */) { context.approximateLength += 5; - return ts.createKeywordTypeNode(137 /* NeverKeyword */); + return ts.createKeywordTypeNode(138 /* NeverKeyword */); } if (type.flags & 4096 /* ESSymbol */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(144 /* SymbolKeyword */); + return ts.createKeywordTypeNode(145 /* SymbolKeyword */); } if (type.flags & 67108864 /* NonPrimitive */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(141 /* ObjectKeyword */); + return ts.createKeywordTypeNode(142 /* ObjectKeyword */); } if (isThisTypeParameter(type)) { if (context.flags & 4194304 /* InObjectTypeLiteral */) { @@ -38107,7 +38246,7 @@ var ts; } var typeNodes = mapToTypeNodes(types, context, /*isBareList*/ true); if (typeNodes && typeNodes.length > 0) { - var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 178 /* UnionType */ : 179 /* IntersectionType */, typeNodes); + var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 179 /* UnionType */ : 180 /* IntersectionType */, typeNodes); return unionOrIntersectionTypeNode; } else { @@ -38134,6 +38273,11 @@ var ts; context.approximateLength += 2; return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); } + if (type.flags & 134217728 /* Awaited */) { + var awaitedTypeNode = typeToTypeNodeHelper(type.awaitedType, context); + context.approximateLength += 9; + return ts.createTypeOperatorNode(128 /* AwaitedKeyword */, awaitedTypeNode); + } if (type.flags & 16777216 /* Conditional */) { var checkTypeNode = typeToTypeNodeHelper(type.checkType, context); var saveInferTypeParameters = context.inferTypeParameters; @@ -38146,7 +38290,7 @@ var ts; return ts.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode); } if (type.flags & 33554432 /* Substitution */) { - return typeToTypeNodeHelper(type.typeVariable, context); + return typeToTypeNodeHelper(type.baseType, context); } return ts.Debug.fail("Should be unreachable."); function createMappedTypeNodeFromType(type) { @@ -38178,7 +38322,7 @@ var ts; return symbolToTypeNode(symbol, context, isInstanceType); } // Always use 'typeof T' for type of class, enum, and module objects - else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 214 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || + else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 215 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { return symbolToTypeNode(symbol, context, 111551 /* Value */); @@ -38208,7 +38352,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 290 /* SourceFile */ || declaration.parent.kind === 250 /* ModuleBlock */; + return declaration.parent.kind === 291 /* SourceFile */ || declaration.parent.kind === 251 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -38259,12 +38403,12 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 170 /* FunctionType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 171 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 171 /* ConstructorType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 172 /* ConstructorType */, context); return signatureNode; } } @@ -38285,7 +38429,7 @@ var ts; } var elementType = typeToTypeNodeHelper(typeArguments[0], context); var arrayType = ts.createArrayTypeNode(elementType); - return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, arrayType); + return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, arrayType); } else if (type.target.objectFlags & 8 /* Tuple */) { if (typeArguments.length > 0) { @@ -38299,12 +38443,12 @@ var ts; ts.createOptionalTypeNode(tupleConstituentNodes[i]); } var tupleTypeNode = ts.createTupleTypeNode(tupleConstituentNodes); - return type.target.readonly ? ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } } if (context.encounteredError || (context.flags & 524288 /* AllowEmptyTuple */)) { var tupleTypeNode = ts.createTupleTypeNode([]); - return type.target.readonly ? ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } context.encounteredError = true; return undefined; // TODO: GH#18217 @@ -38399,11 +38543,11 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 165 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 166 /* CallSignature */, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 166 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 167 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { var indexSignature = void 0; @@ -38480,7 +38624,7 @@ var ts; var signatures = getSignaturesOfType(filterType(propertyType, function (t) { return !(t.flags & 32768 /* Undefined */); }), 0 /* Call */); for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) { var signature = signatures_1[_i]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 160 /* MethodSignature */, context); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 161 /* MethodSignature */, context); methodDeclaration.name = propertyName; methodDeclaration.questionToken = optionalToken; typeElements.push(preserveCommentsOn(methodDeclaration)); @@ -38497,7 +38641,7 @@ var ts; propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(125 /* AnyKeyword */); } context.flags = savedFlags; - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(138 /* ReadonlyKeyword */)] : undefined; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(139 /* ReadonlyKeyword */)] : undefined; if (modifiers) { context.approximateLength += 9; } @@ -38506,8 +38650,8 @@ var ts; typeElements.push(preserveCommentsOn(propertySignature)); } function preserveCommentsOn(node) { - if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 323 /* JSDocPropertyTag */; })) { - var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 323 /* JSDocPropertyTag */; }); + if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 324 /* JSDocPropertyTag */; })) { + var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 324 /* JSDocPropertyTag */; }); var commentText = d.comment; if (commentText) { ts.setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); @@ -38558,7 +38702,7 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 143 /* StringKeyword */ : 140 /* NumberKeyword */); + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 144 /* StringKeyword */ : 141 /* NumberKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -38571,7 +38715,7 @@ var ts; } context.approximateLength += (name.length + 4); return ts.createIndexSignature( - /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(138 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(139 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context) { var suppressAny = context.flags & 256 /* SuppressAnyReturnType */; @@ -38585,7 +38729,7 @@ var ts; else { typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); } - var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 162 /* Constructor */); }); + var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 163 /* Constructor */); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); @@ -38629,9 +38773,9 @@ var ts; return typeParameterToDeclarationWithConstraint(type, context, constraintNode); } function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 156 /* Parameter */); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 157 /* Parameter */); if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) { - parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 317 /* JSDocParameterTag */); + parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 318 /* JSDocParameterTag */); } var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { @@ -38643,7 +38787,7 @@ var ts; var dotDotDotToken = isRest ? ts.createToken(25 /* DotDotDotToken */) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 75 /* Identifier */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : - parameterDeclaration.name.kind === 153 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : + parameterDeclaration.name.kind === 154 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : ts.symbolName(parameterSymbol) : ts.symbolName(parameterSymbol); @@ -38662,7 +38806,7 @@ var ts; } var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags); var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited); - if (clone.kind === 191 /* BindingElement */) { + if (clone.kind === 192 /* BindingElement */) { clone.initializer = undefined; } return ts.setEmitFlags(clone, 1 /* SingleLine */ | 16777216 /* NoAsciiEscaping */); @@ -38782,10 +38926,10 @@ var ts; var typeParameterNodes; if (context.flags & 512 /* WriteTypeParametersInQualifiedName */ && index < (chain.length - 1)) { var parentSymbol = symbol; - var nextSymbol = chain[index + 1]; - if (ts.getCheckFlags(nextSymbol) & 1 /* Instantiated */) { + var nextSymbol_1 = chain[index + 1]; + if (ts.getCheckFlags(nextSymbol_1) & 1 /* Instantiated */) { var params = getTypeParametersOfClassOrInterface(parentSymbol.flags & 2097152 /* Alias */ ? resolveAlias(parentSymbol) : parentSymbol); - typeParameterNodes = mapToTypeNodes(ts.map(params, nextSymbol.mapper), context); + typeParameterNodes = mapToTypeNodes(ts.map(params, function (t) { return getMappedType(t, nextSymbol_1.mapper); }), context); } else { typeParameterNodes = typeParametersToTypeParameterDeclarations(symbol, context); @@ -38803,7 +38947,7 @@ var ts; return top; } function getSpecifierForModuleSymbol(symbol, context) { - var file = ts.getDeclarationOfKind(symbol, 290 /* SourceFile */); + var file = ts.getDeclarationOfKind(symbol, 291 /* SourceFile */); if (file && file.moduleName !== undefined) { // Use the amd name if it is available return file.moduleName; @@ -39109,8 +39253,8 @@ var ts; return initial; } function symbolTableToDeclarationStatements(symbolTable, context, bundled) { - var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 161 /* MethodDeclaration */, /*useAcessors*/ true); - var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 160 /* MethodSignature */, /*useAcessors*/ false); + var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 162 /* MethodDeclaration */, /*useAcessors*/ true); + var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 161 /* MethodSignature */, /*useAcessors*/ false); // TODO: Use `setOriginalNode` on original declaration names where possible so these declarations see some kind of // declaration mapping // We save the enclosing declaration off here so it's not adjusted by well-meaning declaration @@ -39449,8 +39593,8 @@ var ts; var baseTypes = getBaseTypes(interfaceType); var baseType = ts.length(baseTypes) ? getIntersectionType(baseTypes) : undefined; var members = ts.flatMap(getPropertiesOfType(interfaceType), function (p) { return serializePropertySymbolForInterface(p, baseType); }); - var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 165 /* CallSignature */); - var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 166 /* ConstructSignature */); + var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 166 /* CallSignature */); + var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 167 /* ConstructSignature */); var indexSignatures = serializeIndexSignatures(interfaceType, baseType); var heritageClauses = !ts.length(baseTypes) ? undefined : [ts.createHeritageClause(90 /* ExtendsKeyword */, ts.mapDefined(baseTypes, function (b) { return trySerializeAsTypeReference(b); }))]; addResult(ts.createInterfaceDeclaration( @@ -39565,7 +39709,7 @@ var ts; for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { var sig = signatures_2[_i]; // Each overload becomes a separate function declaration, in order - var decl = signatureToSignatureDeclarationHelper(sig, 244 /* FunctionDeclaration */, context); + var decl = signatureToSignatureDeclarationHelper(sig, 245 /* FunctionDeclaration */, context); decl.name = ts.createIdentifier(localName); addResult(ts.setTextRange(decl, sig.declaration), modifierFlags); } @@ -39658,7 +39802,7 @@ var ts; var staticMembers = symbol.flags & (16 /* Function */ | 512 /* ValueModule */) ? [] : ts.flatMap(ts.filter(getPropertiesOfType(staticType), function (p) { return !(p.flags & 4194304 /* Prototype */) && p.escapedName !== "prototype"; }), function (p) { return serializePropertySymbolForClass(p, /*isStatic*/ true, staticBaseType); }); - var constructors = serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 162 /* Constructor */); + var constructors = serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 163 /* Constructor */); for (var _i = 0, constructors_1 = constructors; _i < constructors_1.length; _i++) { var c = constructors_1[_i]; // A constructor's return type and type parameters are supposed to be controlled by the enclosing class declaration @@ -39690,7 +39834,7 @@ var ts; var targetName = getInternalSymbolName(target, verbatimTargetName); includePrivateSymbol(target); // the target may be within the same scope - attempt to serialize it first switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // Could be a local `import localName = ns.member` or // an external `import localName = require("whatever")` var isLocalImport = !(target.flags & 512 /* ValueModule */); @@ -39700,13 +39844,13 @@ var ts; ? symbolToName(target, context, 67108863 /* All */, /*expectsIdentifier*/ false) : ts.createExternalModuleReference(ts.createLiteral(getSpecifierForModuleSymbol(symbol, context)))), isLocalImport ? modifierFlags : 0 /* None */); break; - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: // export as namespace foo // TODO: Not part of a file's local or export symbol tables // Is bound into file.symbol.globalExports instead, which we don't currently traverse addResult(ts.createNamespaceExportDeclaration(ts.idText(node.name)), 0 /* None */); break; - case 255 /* ImportClause */: + case 256 /* ImportClause */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(ts.createIdentifier(localName), /*namedBindings*/ undefined), @@ -39715,24 +39859,24 @@ var ts; // In such cases, the `target` refers to the module itself already ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*importClause*/ undefined, ts.createNamespaceImport(ts.createIdentifier(localName))), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: addResult(ts.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createNamespaceExport(ts.createIdentifier(localName)), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*importClause*/ undefined, ts.createNamedImports([ ts.createImportSpecifier(localName !== verbatimTargetName ? ts.createIdentifier(verbatimTargetName) : undefined, ts.createIdentifier(localName)) ])), ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: // does not use localName because the symbol name in this case refers to the name in the exports table, // which we must exactly preserve var specifier = node.parent.parent.moduleSpecifier; @@ -39740,11 +39884,11 @@ var ts; // another file serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), specifier ? verbatimTargetName : targetName, specifier && ts.isStringLiteralLike(specifier) ? ts.createLiteral(specifier.text) : undefined); break; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: serializeMaybeAliasAssignment(symbol); break; - case 209 /* BinaryExpression */: - case 194 /* PropertyAccessExpression */: + case 210 /* BinaryExpression */: + case 195 /* PropertyAccessExpression */: // Could be best encoded as though an export specifier or as though an export assignment // If name is default or export=, do an export assignment // Otherwise do an export specifier @@ -39964,17 +40108,18 @@ var ts; context.flags = oldFlags; return result; function visitExistingNodeTreeSymbols(node) { - if (ts.isJSDocAllType(node)) { + // We don't _actually_ support jsdoc namepath types, emit `any` instead + if (ts.isJSDocAllType(node) || node.kind === 303 /* JSDocNamepathType */) { return ts.createKeywordTypeNode(125 /* AnyKeyword */); } if (ts.isJSDocUnknownType(node)) { - return ts.createKeywordTypeNode(148 /* UnknownKeyword */); + return ts.createKeywordTypeNode(149 /* UnknownKeyword */); } if (ts.isJSDocNullableType(node)) { return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(100 /* NullKeyword */)]); } if (ts.isJSDocOptionalType(node)) { - return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(146 /* UndefinedKeyword */)]); + return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(147 /* UndefinedKeyword */)]); } if (ts.isJSDocNonNullableType(node)) { return ts.visitNode(node.type, visitExistingNodeTreeSymbols); @@ -40243,8 +40388,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { - var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 182 /* ParenthesizedType */; }); - if (node.kind === 247 /* TypeAliasDeclaration */) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 183 /* ParenthesizedType */; }); + if (node.kind === 248 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -40252,11 +40397,11 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 250 /* ModuleBlock */ && + node.parent.kind === 251 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 290 /* SourceFile */ || ts.isAmbientModule(location); + return location.kind === 291 /* SourceFile */ || ts.isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { var nameType = getSymbolLinks(symbol).nameType; @@ -40315,17 +40460,17 @@ var ts; if (!declaration) { declaration = symbol.declarations[0]; // Declaration may be nameless, but we'll try anyway } - if (declaration.parent && declaration.parent.kind === 242 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 243 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 214 /* ClassExpression */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 215 /* ClassExpression */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } - return declaration.kind === 214 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 215 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; } } var name = getNameOfSymbolFromNameType(symbol, context); @@ -40342,28 +40487,28 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 315 /* JSDocCallbackTag */: - case 322 /* JSDocTypedefTag */: - case 316 /* JSDocEnumTag */: + case 316 /* JSDocCallbackTag */: + case 323 /* JSDocTypedefTag */: + case 317 /* JSDocEnumTag */: // Top-level jsdoc type aliases are considered exported // First parent is comment node, second is hosting declaration or token; we only care about those tokens or declarations whose parent is a source file return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent)); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // falls through - case 249 /* ModuleDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 244 /* FunctionDeclaration */: - case 248 /* EnumDeclaration */: - case 253 /* ImportEqualsDeclaration */: + case 250 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 245 /* FunctionDeclaration */: + case 249 /* EnumDeclaration */: + case 254 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; @@ -40371,54 +40516,54 @@ var ts; var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 253 /* ImportEqualsDeclaration */ && parent.kind !== 290 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { + !(node.kind !== 254 /* ImportEqualsDeclaration */ && parent.kind !== 291 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent); - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.hasModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 162 /* Constructor */: - case 166 /* ConstructSignature */: - case 165 /* CallSignature */: - case 167 /* IndexSignature */: - case 156 /* Parameter */: - case 250 /* ModuleBlock */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 173 /* TypeLiteral */: - case 169 /* TypeReference */: - case 174 /* ArrayType */: - case 175 /* TupleType */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 182 /* ParenthesizedType */: + case 163 /* Constructor */: + case 167 /* ConstructSignature */: + case 166 /* CallSignature */: + case 168 /* IndexSignature */: + case 157 /* Parameter */: + case 251 /* ModuleBlock */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 174 /* TypeLiteral */: + case 170 /* TypeReference */: + case 175 /* ArrayType */: + case 176 /* TupleType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 183 /* ParenthesizedType */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 255 /* ImportClause */: - case 256 /* NamespaceImport */: - case 258 /* ImportSpecifier */: + case 256 /* ImportClause */: + case 257 /* NamespaceImport */: + case 259 /* ImportSpecifier */: return false; // Type parameters are always visible - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: // Source file and namespace export are always visible // falls through - case 290 /* SourceFile */: - case 252 /* NamespaceExportDeclaration */: + case 291 /* SourceFile */: + case 253 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return false; default: return false; @@ -40427,10 +40572,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 259 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 260 /* ExportAssignment */) { exportSymbol = resolveName(node, node.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); } - else if (node.parent.kind === 263 /* ExportSpecifier */) { + else if (node.parent.kind === 264 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } var result; @@ -40533,12 +40678,12 @@ var ts; function getDeclarationContainer(node) { return ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 242 /* VariableDeclaration */: - case 243 /* VariableDeclarationList */: - case 258 /* ImportSpecifier */: - case 257 /* NamedImports */: - case 256 /* NamespaceImport */: - case 255 /* ImportClause */: + case 243 /* VariableDeclaration */: + case 244 /* VariableDeclarationList */: + case 259 /* ImportSpecifier */: + case 258 /* NamedImports */: + case 257 /* NamespaceImport */: + case 256 /* ImportClause */: return false; default: return true; @@ -40571,7 +40716,7 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false); } function isComputedNonLiteralName(name) { - return name.kind === 154 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); + return name.kind === 155 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); } function getRestType(source, properties, symbol) { source = filterType(source, function (t) { return !(t.flags & 98304 /* Nullable */); }); @@ -40625,7 +40770,7 @@ var ts; if (parentAccess && parentAccess.flowNode) { var propName = getDestructuringPropertyName(node); if (propName) { - var result = ts.createNode(195 /* ElementAccessExpression */, node.pos, node.end); + var result = ts.createNode(196 /* ElementAccessExpression */, node.pos, node.end); result.parent = node; result.expression = parentAccess; var literal = ts.createNode(10 /* StringLiteral */, node.pos, node.end); @@ -40640,23 +40785,23 @@ var ts; function getParentElementAccess(node) { var ancestor = node.parent.parent; switch (ancestor.kind) { - case 191 /* BindingElement */: - case 281 /* PropertyAssignment */: + case 192 /* BindingElement */: + case 282 /* PropertyAssignment */: return getSyntheticElementAccess(ancestor); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return getSyntheticElementAccess(node.parent); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ancestor.initializer; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return ancestor.right; } } function getDestructuringPropertyName(node) { var parent = node.parent; - if (node.kind === 191 /* BindingElement */ && parent.kind === 189 /* ObjectBindingPattern */) { + if (node.kind === 192 /* BindingElement */ && parent.kind === 190 /* ObjectBindingPattern */) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 281 /* PropertyAssignment */ || node.kind === 282 /* ShorthandPropertyAssignment */) { + if (node.kind === 282 /* PropertyAssignment */ || node.kind === 283 /* ShorthandPropertyAssignment */) { return getLiteralPropertyNameText(node.name); } return "" + parent.elements.indexOf(node); @@ -40677,8 +40822,12 @@ var ts; if (strictNullChecks && declaration.flags & 8388608 /* Ambient */ && ts.isParameterDeclaration(declaration)) { parentType = getNonNullableType(parentType); } + // Filter `undefined` from the type we check against if the parent has an initializer (which handles the `undefined` case implicitly) + else if (strictNullChecks && pattern.parent.initializer) { + parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */); + } var type; - if (pattern.kind === 189 /* ObjectBindingPattern */) { + if (pattern.kind === 190 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { parentType = getReducedType(parentType); if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) { @@ -40751,7 +40900,7 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 192 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 193 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } @@ -40761,11 +40910,11 @@ var ts; function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 231 /* ForInStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForInStatement */) { var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression))); return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType; } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 233 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -40784,7 +40933,7 @@ var ts; return addOptionality(declaredType, isOptional); } if ((noImplicitAny || ts.isInJSFile(declaration)) && - declaration.kind === 242 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && + declaration.kind === 243 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1 /* Export */) && !(declaration.flags & 8388608 /* Ambient */)) { // If --noImplicitAny is on or the declaration is in a Javascript file, // use control flow tracked 'any' type for non-ambient, non-exported var or let variables with no @@ -40798,11 +40947,11 @@ var ts; return autoArrayType; } } - if (declaration.kind === 156 /* Parameter */) { + if (declaration.kind === 157 /* Parameter */) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 164 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 163 /* GetAccessor */); + if (func.kind === 165 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 164 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -41017,9 +41166,9 @@ var ts; var thisContainer = ts.getThisContainer(expression, /*includeArrowFunctions*/ false); // Properties defined in a constructor (or base constructor, or javascript constructor function) don't get undefined added. // Function expressions that are assigned to the prototype count as methods. - return thisContainer.kind === 162 /* Constructor */ || - thisContainer.kind === 244 /* FunctionDeclaration */ || - (thisContainer.kind === 201 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); + return thisContainer.kind === 163 /* Constructor */ || + thisContainer.kind === 245 /* FunctionDeclaration */ || + (thisContainer.kind === 202 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { ts.Debug.assert(types.length === declarations.length); @@ -41103,7 +41252,7 @@ var ts; function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) { var elements = pattern.elements; var lastElement = ts.lastOrUndefined(elements); - var hasRestElement = !!(lastElement && lastElement.kind === 191 /* BindingElement */ && lastElement.dotDotDotToken); + var hasRestElement = !!(lastElement && lastElement.kind === 192 /* BindingElement */ && lastElement.dotDotDotToken); if (elements.length === 0 || elements.length === 1 && hasRestElement) { return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType; } @@ -41127,7 +41276,7 @@ var ts; function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { if (includePatternInType === void 0) { includePatternInType = false; } if (reportErrors === void 0) { reportErrors = false; } - return pattern.kind === 189 /* ObjectBindingPattern */ + return pattern.kind === 190 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -41166,7 +41315,7 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 156 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 157 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(declaration) { @@ -41224,7 +41373,7 @@ var ts; return reportCircularityError(symbol); } var type; - if (declaration.kind === 259 /* ExportAssignment */) { + if (declaration.kind === 260 /* ExportAssignment */) { type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration); } else if (ts.isBinaryExpression(declaration) || @@ -41295,7 +41444,7 @@ var ts; } function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { - if (accessor.kind === 163 /* GetAccessor */) { + if (accessor.kind === 164 /* GetAccessor */) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; } @@ -41329,15 +41478,15 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 163 /* GetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 164 /* GetAccessor */); error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } return type; } function resolveTypeOfAccessors(symbol) { - var getter = ts.getDeclarationOfKind(symbol, 163 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 164 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 164 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 165 /* SetAccessor */); if (getter && ts.isInJSFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -41405,9 +41554,9 @@ var ts; if (symbol.flags & 1536 /* Module */ && ts.isShorthandAmbientModuleSymbol(symbol)) { return anyType; } - else if (declaration.kind === 209 /* BinaryExpression */ || + else if (declaration.kind === 210 /* BinaryExpression */ || ts.isAccessExpression(declaration) && - declaration.parent.kind === 209 /* BinaryExpression */) { + declaration.parent.kind === 210 /* BinaryExpression */) { return getWidenedTypeForAssignmentDeclaration(symbol); } else if (symbol.flags & 512 /* ValueModule */ && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) { @@ -41474,7 +41623,7 @@ var ts; return errorType; } // Check if variable has initializer that circularly references the variable itself - if (noImplicitAny && (declaration.kind !== 156 /* Parameter */ || declaration.initializer)) { + if (noImplicitAny && (declaration.kind !== 157 /* Parameter */ || declaration.initializer)) { error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); } // Circularities could also result from parameters in function expressions that end up @@ -41573,36 +41722,36 @@ var ts; return undefined; } switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 246 /* InterfaceDeclaration */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 160 /* MethodSignature */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 300 /* JSDocFunctionType */: - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 247 /* TypeAliasDeclaration */: - case 321 /* JSDocTemplateTag */: - case 322 /* JSDocTypedefTag */: - case 316 /* JSDocEnumTag */: - case 315 /* JSDocCallbackTag */: - case 186 /* MappedType */: - case 180 /* ConditionalType */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 247 /* InterfaceDeclaration */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 161 /* MethodSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 301 /* JSDocFunctionType */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 248 /* TypeAliasDeclaration */: + case 322 /* JSDocTemplateTag */: + case 323 /* JSDocTypedefTag */: + case 317 /* JSDocEnumTag */: + case 316 /* JSDocCallbackTag */: + case 187 /* MappedType */: + case 181 /* ConditionalType */: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 186 /* MappedType */) { + if (node.kind === 187 /* MappedType */) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } - else if (node.kind === 180 /* ConditionalType */) { + else if (node.kind === 181 /* ConditionalType */) { return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node)); var thisType = includeThisTypes && - (node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */ || node.kind === 246 /* InterfaceDeclaration */ || isJSConstructor(node)) && + (node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */ || node.kind === 247 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } @@ -41610,7 +41759,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 246 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 247 /* InterfaceDeclaration */); ts.Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); } @@ -41620,9 +41769,9 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 246 /* InterfaceDeclaration */ || - node.kind === 245 /* ClassDeclaration */ || - node.kind === 214 /* ClassExpression */ || + if (node.kind === 247 /* InterfaceDeclaration */ || + node.kind === 246 /* ClassDeclaration */ || + node.kind === 215 /* ClassExpression */ || isJSConstructor(node) || ts.isTypeAlias(node)) { var declaration = node; @@ -41840,7 +41989,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 246 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 247 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getReducedType(getTypeFromTypeNode(node)); @@ -41876,7 +42025,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 246 /* InterfaceDeclaration */) { + if (declaration.kind === 247 /* InterfaceDeclaration */) { if (declaration.flags & 128 /* ContainsThis */) { return false; } @@ -41964,7 +42113,7 @@ var ts; if (ts.isStringLiteralLike(expr)) { return true; } - else if (expr.kind === 209 /* BinaryExpression */) { + else if (expr.kind === 210 /* BinaryExpression */) { return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right); } return false; @@ -41979,12 +42128,12 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return true; - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; case 75 /* Identifier */: return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return isStringConcatExpression(expr); default: return false; @@ -41998,7 +42147,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 248 /* EnumDeclaration */) { + if (declaration.kind === 249 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && ts.isStringLiteralLike(member.initializer)) { @@ -42025,7 +42174,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 248 /* EnumDeclaration */) { + if (declaration.kind === 249 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var value = getEnumMemberValue(member); @@ -42098,22 +42247,22 @@ var ts; function isThislessType(node) { switch (node.kind) { case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 151 /* BigIntKeyword */: - case 128 /* BooleanKeyword */: - case 144 /* SymbolKeyword */: - case 141 /* ObjectKeyword */: + case 149 /* UnknownKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 152 /* BigIntKeyword */: + case 129 /* BooleanKeyword */: + case 145 /* SymbolKeyword */: + case 142 /* ObjectKeyword */: case 110 /* VoidKeyword */: - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: case 100 /* NullKeyword */: - case 137 /* NeverKeyword */: - case 187 /* LiteralType */: + case 138 /* NeverKeyword */: + case 188 /* LiteralType */: return true; - case 174 /* ArrayType */: + case 175 /* ArrayType */: return isThislessType(node.elementType); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -42139,7 +42288,7 @@ var ts; function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - return (node.kind === 162 /* Constructor */ || (!!returnType && isThislessType(returnType))) && + return (node.kind === 163 /* Constructor */ || (!!returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } @@ -42155,14 +42304,14 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -42453,7 +42602,6 @@ var ts; var stringIndexInfo; var numberIndexInfo; if (ts.rangeEquals(typeParameters, typeArguments, 0, typeParameters.length)) { - mapper = identityMapper; members = source.symbol ? getMembersOfSymbol(source.symbol) : ts.createSymbolTable(source.declaredProperties); callSignatures = source.declaredCallSignatures; constructSignatures = source.declaredConstructSignatures; @@ -42957,8 +43105,7 @@ var ts; var checkType = type.checkType; var constraint = getLowerBoundOfKeyType(checkType); if (constraint !== checkType) { - var mapper = makeUnaryTypeMapper(type.root.checkType, constraint); - return getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); + return getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper)); } } return type; @@ -43007,7 +43154,7 @@ var ts; // Create a mapper from T to the current iteration type constituent. Then, if the // mapped type is itself an instantiated type, combine the iteration mapper with the // instantiation mapper. - var templateMapper = combineTypeMappers(type.mapper, createTypeMapper([typeParameter], [t])); + var templateMapper = appendTypeMapping(type.mapper, typeParameter, t); // If the current iteration type constituent is a string literal type, create a property. // Otherwise, for type string create a string index signature. if (isTypeUsableAsPropertyName(t)) { @@ -43057,6 +43204,7 @@ var ts; type = errorType; } symbol.type = type; + symbol.mapper = undefined; } return symbol.type; } @@ -43071,7 +43219,7 @@ var ts; function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? - instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), type.mapper || identityMapper) : + instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), type.mapper) : errorType); } function getConstraintDeclarationForMappedType(type) { @@ -43079,8 +43227,8 @@ var ts; } function isMappedTypeWithKeyofConstraintDeclaration(type) { var constraintDeclaration = getConstraintDeclarationForMappedType(type); // TODO: GH#18217 - return constraintDeclaration.kind === 184 /* TypeOperator */ && - constraintDeclaration.operator === 134 /* KeyOfKeyword */; + return constraintDeclaration.kind === 185 /* TypeOperator */ && + constraintDeclaration.operator === 135 /* KeyOfKeyword */; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { @@ -43088,7 +43236,7 @@ var ts; // If the constraint declaration is a 'keyof T' node, the modifiers type is T. We check // AST nodes here because, when T is a non-generic type, the logic below eagerly resolves // 'keyof T' to a literal union type and we can't recover T from that type. - type.modifiersType = instantiateType(getTypeFromTypeNode(getConstraintDeclarationForMappedType(type).type), type.mapper || identityMapper); + type.modifiersType = instantiateType(getTypeFromTypeNode(getConstraintDeclarationForMappedType(type).type), type.mapper); } else { // Otherwise, get the declared constraint type, and if the constraint type is a type parameter, @@ -43097,7 +43245,7 @@ var ts; var declaredType = getTypeFromMappedTypeNode(type.declaration); var constraint = getConstraintTypeFromMappedType(declaredType); var extendedConstraint = constraint && constraint.flags & 262144 /* TypeParameter */ ? getConstraintOfTypeParameter(constraint) : constraint; - type.modifiersType = extendedConstraint && extendedConstraint.flags & 4194304 /* Index */ ? instantiateType(extendedConstraint.type, type.mapper || identityMapper) : unknownType; + type.modifiersType = extendedConstraint && extendedConstraint.flags & 4194304 /* Index */ ? instantiateType(extendedConstraint.type, type.mapper) : unknownType; } } return type.modifiersType; @@ -43184,8 +43332,8 @@ var ts; } } // The properties of a union type are those that are present in all constituent types, so - // we only need to check the properties of the first type - if (type.flags & 1048576 /* Union */) { + // we only need to check the properties of the first type without index signature + if (type.flags & 1048576 /* Union */ && !getIndexInfoOfType(current, 0 /* String */) && !getIndexInfoOfType(current, 1 /* Number */)) { break; } } @@ -43286,8 +43434,7 @@ var ts; var simplified = getSimplifiedType(type.checkType, /*writing*/ false); var constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified; if (constraint && constraint !== type.checkType) { - var mapper = makeUnaryTypeMapper(type.root.checkType, constraint); - var instantiated = getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); + var instantiated = getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper)); if (!(instantiated.flags & 131072 /* Never */)) { return instantiated; } @@ -43306,7 +43453,7 @@ var ts; var hasDisjointDomainType = false; for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { var t = types_4[_i]; - if (t.flags & 63176704 /* Instantiable */) { + if (t.flags & 197394432 /* Instantiable */) { // We keep following constraints as long as we have an instantiable type that is known // not to be circular or infinite (hence we stop on index access types). var constraint = getConstraintOfType(t); @@ -43342,7 +43489,7 @@ var ts; return undefined; } function getBaseConstraintOfType(type) { - if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { + if (type.flags & (193200128 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { var constraint = getResolvedBaseConstraint(type); return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined; } @@ -43444,6 +43591,10 @@ var ts; constraintDepth--; return result; } + if (t.flags & 134217728 /* Awaited */) { + var basePromiseType = getBaseConstraint(t.awaitedType); + return basePromiseType ? getAwaitedType(basePromiseType) : undefined; + } if (t.flags & 33554432 /* Substitution */) { return getBaseConstraint(t.substitute); } @@ -43504,8 +43655,7 @@ var ts; if (typeVariable) { var constraint = getConstraintOfTypeParameter(typeVariable); if (constraint && (isArrayType(constraint) || isTupleType(constraint))) { - var mapper = makeUnaryTypeMapper(typeVariable, constraint); - return instantiateType(type, combineTypeMappers(mapper, type.mapper)); + return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper)); } } return type; @@ -43516,7 +43666,7 @@ var ts; * type itself. */ function getApparentType(type) { - var t = type.flags & 63176704 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; + var t = type.flags & 197394432 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; return ts.getObjectFlags(t) & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) : t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : t.flags & 132 /* StringLike */ ? globalStringType : @@ -43777,7 +43927,7 @@ var ts; ts.append(propTypes, getIndexTypeOfType(type, 1 /* Number */)); } if (propTypes.length) { - return getUnionType(propTypes, 2 /* Subtype */); + return getUnionType(propTypes); } } return undefined; @@ -43804,10 +43954,10 @@ var ts; function isJSDocOptionalParameter(node) { return ts.isInJSFile(node) && ( // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType - node.type && node.type.kind === 299 /* JSDocOptionalType */ + node.type && node.type.kind === 300 /* JSDocOptionalType */ || ts.getJSDocParameterTags(node).some(function (_a) { var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 299 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 300 /* JSDocOptionalType */; })); } function tryFindAmbientModule(moduleName, withAugmentations) { @@ -43826,7 +43976,7 @@ var ts; var signature = getSignatureFromDeclaration(node.parent); var parameterIndex = node.parent.parameters.indexOf(node); ts.Debug.assert(parameterIndex >= 0); - return parameterIndex >= getMinArgumentCount(signature); + return parameterIndex >= getMinArgumentCount(signature, /*strongArityForUntypedJS*/ true); } var iife = ts.getImmediatelyInvokedFunctionExpression(node.parent); if (iife) { @@ -43841,7 +43991,7 @@ var ts; return false; } var isBracketed = node.isBracketed, typeExpression = node.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 299 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 300 /* JSDocOptionalType */; } function createTypePredicate(kind, parameterName, parameterIndex, type) { return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; @@ -43901,6 +44051,9 @@ var ts; ts.isValueSignatureDeclaration(declaration) && !ts.hasJSDocParameterTags(declaration) && !ts.getJSDocType(declaration); + if (isUntypedSignatureInJSFile) { + flags |= 16 /* IsUntypedSignatureInJSFile */; + } // If this is a JSDoc construct signature, then skip the first parameter in the // parameter list. The first parameter represents the return type of the construct // signature. @@ -43920,30 +44073,29 @@ var ts; else { parameters.push(paramSymbol); } - if (type && type.kind === 187 /* LiteralType */) { + if (type && type.kind === 188 /* LiteralType */) { flags |= 2 /* HasLiteralTypes */; } // Record a new minimum argument count if this is not an optional parameter var isOptionalParameter_1 = isOptionalJSDocParameterTag(param) || param.initializer || param.questionToken || param.dotDotDotToken || iife && parameters.length > iife.arguments.length && !type || - isUntypedSignatureInJSFile || isJSDocOptionalParameter(param); if (!isOptionalParameter_1) { minArgumentCount = parameters.length; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 163 /* GetAccessor */ || declaration.kind === 164 /* SetAccessor */) && + if ((declaration.kind === 164 /* GetAccessor */ || declaration.kind === 165 /* SetAccessor */) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; + var otherKind = declaration.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 162 /* Constructor */ ? + var classType = declaration.kind === 163 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); @@ -44005,11 +44157,11 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - return node.name.kind === 154 /* ComputedPropertyName */ + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + return node.name.kind === 155 /* ComputedPropertyName */ && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse); @@ -44081,7 +44233,7 @@ var ts; function createTypePredicateFromTypePredicateNode(node, signature) { var parameterName = node.parameterName; var type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 183 /* ThisType */ ? + return parameterName.kind === 184 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, /*parameterName*/ undefined, /*parameterIndex*/ undefined, type) : createTypePredicate(node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */, parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type); } @@ -44124,7 +44276,7 @@ var ts; return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 162 /* Constructor */) { + if (declaration.kind === 163 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } if (ts.isJSDocConstructSignature(declaration)) { @@ -44134,12 +44286,12 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 163 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { + if (declaration.kind === 164 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 164 /* SetAccessor */); + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 165 /* SetAccessor */); var setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -44229,7 +44381,7 @@ var ts; // will result in a different declaration kind. if (!signature.isolatedSignatureType) { var kind = signature.declaration ? signature.declaration.kind : 0 /* Unknown */; - var isConstructor = kind === 162 /* Constructor */ || kind === 166 /* ConstructSignature */ || kind === 171 /* ConstructorType */; + var isConstructor = kind === 163 /* Constructor */ || kind === 167 /* ConstructSignature */ || kind === 172 /* ConstructorType */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -44243,7 +44395,7 @@ var ts; return symbol.members.get("__index" /* Index */); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 140 /* NumberKeyword */ : 143 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 141 /* NumberKeyword */ : 144 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -44277,13 +44429,13 @@ var ts; if (typeParameter.symbol) { for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.parent.kind === 181 /* InferType */) { + if (declaration.parent.kind === 182 /* InferType */) { // When an 'infer T' declaration is immediately contained in a type reference node // (such as 'Foo'), T's constraint is inferred from the constraint of the // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are // present, we form an intersection of the inferred constraint types. var grandParent = declaration.parent.parent; - if (grandParent.kind === 169 /* TypeReference */) { + if (grandParent.kind === 170 /* TypeReference */) { var typeReference = grandParent; var typeParameters = getTypeParametersForTypeReference(typeReference); if (typeParameters) { @@ -44308,7 +44460,7 @@ var ts; } // When an 'infer T' declaration is immediately contained in a rest parameter // declaration, we infer an 'unknown[]' constraint. - else if (grandParent.kind === 156 /* Parameter */ && grandParent.dotDotDotToken) { + else if (grandParent.kind === 157 /* Parameter */ && grandParent.dotDotDotToken) { inferences = ts.append(inferences, createArrayType(unknownType)); } } @@ -44325,14 +44477,24 @@ var ts; } else { var constraintDeclaration = getConstraintDeclaration(typeParameter); - typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : - getInferredTypeParameterConstraint(typeParameter) || noConstraintType; + if (!constraintDeclaration) { + typeParameter.constraint = getInferredTypeParameterConstraint(typeParameter) || noConstraintType; + } + else { + var type = getTypeFromTypeNode(constraintDeclaration); + if (type.flags & 1 /* Any */ && type !== errorType) { // Allow errorType to propegate to keep downstream errors suppressed + // use keyofConstraintType as the base constraint for mapped type key constraints (unknown isn;t assignable to that, but `any` was), + // use unknown otherwise + type = constraintDeclaration.parent.parent.kind === 187 /* MappedType */ ? keyofConstraintType : unknownType; + } + typeParameter.constraint = type; + } } } return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - var tp = ts.getDeclarationOfKind(typeParameter.symbol, 155 /* TypeParameter */); + var tp = ts.getDeclarationOfKind(typeParameter.symbol, 156 /* TypeParameter */); var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent; return host && getSymbolOfNode(host); } @@ -44412,8 +44574,8 @@ var ts; } var node = type.node; var typeArguments = !node ? ts.emptyArray : - node.kind === 169 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : - node.kind === 174 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : + node.kind === 170 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : + node.kind === 175 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments; @@ -44457,7 +44619,7 @@ var ts; return errorType; } } - if (node.kind === 169 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { + if (node.kind === 170 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { return createDeferredTypeReference(type, node, /*mapper*/ undefined); } // In a type reference, the outer type parameters of the referenced class or interface are automatically @@ -44502,9 +44664,9 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return node.typeName; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -44535,9 +44697,7 @@ var ts; // Get type from reference to named type that cannot be generic (enum or type parameter) var res = tryGetDeclaredTypeOfSymbol(symbol); if (res) { - return checkNoTypeArguments(node, symbol) ? - res.flags & 262144 /* TypeParameter */ ? getConstrainedTypeVariable(res, node) : getRegularTypeOfLiteralType(res) : - errorType; + return checkNoTypeArguments(node, symbol) ? getRegularTypeOfLiteralType(res) : errorType; } if (symbol.flags & 111551 /* Value */ && isJSDocTypeReference(node)) { var jsdocType = getTypeFromJSDocValueReference(node, symbol); @@ -44573,7 +44733,7 @@ var ts; } isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, /*requireStringLiteralLikeArgument*/ true) && !!valueType.symbol; } - var isImportTypeWithQualifier = node.kind === 188 /* ImportType */ && node.qualifier; + var isImportTypeWithQualifier = node.kind === 189 /* ImportType */ && node.qualifier; // valueType might not have a symbol, eg, {import('./b').STRING_LITERAL} if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier)) { typeType = getTypeReferenceType(node, valueType.symbol); @@ -44583,45 +44743,45 @@ var ts; } return links.resolvedJSDocType; } - function getSubstitutionType(typeVariable, substitute) { - if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === typeVariable) { - return typeVariable; + function getSubstitutionType(baseType, substitute) { + if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === baseType) { + return baseType; } - var id = getTypeId(typeVariable) + ">" + getTypeId(substitute); + var id = getTypeId(baseType) + ">" + getTypeId(substitute); var cached = substitutionTypes.get(id); if (cached) { return cached; } var result = createType(33554432 /* Substitution */); - result.typeVariable = typeVariable; + result.baseType = baseType; result.substitute = substitute; substitutionTypes.set(id, result); return result; } function isUnaryTupleTypeNode(node) { - return node.kind === 175 /* TupleType */ && node.elementTypes.length === 1; + return node.kind === 176 /* TupleType */ && node.elementTypes.length === 1; } - function getImpliedConstraint(typeVariable, checkNode, extendsNode) { - return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(typeVariable, checkNode.elementTypes[0], extendsNode.elementTypes[0]) : - getActualTypeVariable(getTypeFromTypeNode(checkNode)) === typeVariable ? getTypeFromTypeNode(extendsNode) : + function getImpliedConstraint(type, checkNode, extendsNode) { + return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elementTypes[0], extendsNode.elementTypes[0]) : + getActualTypeVariable(getTypeFromTypeNode(checkNode)) === type ? getTypeFromTypeNode(extendsNode) : undefined; } - function getConstrainedTypeVariable(typeVariable, node) { + function getConditionalFlowTypeOfType(type, node) { var constraints; - while (node && !ts.isStatement(node) && node.kind !== 303 /* JSDocComment */) { + while (node && !ts.isStatement(node) && node.kind !== 304 /* JSDocComment */) { var parent = node.parent; - if (parent.kind === 180 /* ConditionalType */ && node === parent.trueType) { - var constraint = getImpliedConstraint(typeVariable, parent.checkType, parent.extendsType); + if (parent.kind === 181 /* ConditionalType */ && node === parent.trueType) { + var constraint = getImpliedConstraint(type, parent.checkType, parent.extendsType); if (constraint) { constraints = ts.append(constraints, constraint); } } node = parent; } - return constraints ? getSubstitutionType(typeVariable, getIntersectionType(ts.append(constraints, typeVariable))) : typeVariable; + return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type; } function isJSDocTypeReference(node) { - return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 169 /* TypeReference */ || node.kind === 188 /* ImportType */); + return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 170 /* TypeReference */ || node.kind === 189 /* ImportType */); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { @@ -44734,9 +44894,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 248 /* EnumDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 249 /* EnumDeclaration */: return declaration; } } @@ -44857,19 +45017,19 @@ var ts; } function getArrayOrTupleTargetType(node) { var readonly = isReadonlyTypeOperator(node.parent); - if (node.kind === 174 /* ArrayType */ || node.elementTypes.length === 1 && node.elementTypes[0].kind === 177 /* RestType */) { + if (node.kind === 175 /* ArrayType */ || node.elementTypes.length === 1 && node.elementTypes[0].kind === 178 /* RestType */) { return readonly ? globalReadonlyArrayType : globalArrayType; } var lastElement = ts.lastOrUndefined(node.elementTypes); - var restElement = lastElement && lastElement.kind === 177 /* RestType */ ? lastElement : undefined; - var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 176 /* OptionalType */ && n !== restElement; }) + 1; + var restElement = lastElement && lastElement.kind === 178 /* RestType */ ? lastElement : undefined; + var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 177 /* OptionalType */ && n !== restElement; }) + 1; return getTupleTypeOfArity(node.elementTypes.length, minLength, !!restElement, readonly, /*associatedNames*/ undefined); } // Return true if the given type reference node is directly aliased or if it needs to be deferred // because it is possibly contained in a circular chain of eagerly resolved types. function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { - return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 174 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : - node.kind === 175 /* TupleType */ ? ts.some(node.elementTypes, mayResolveTypeAlias) : + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 175 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : + node.kind === 176 /* TupleType */ ? ts.some(node.elementTypes, mayResolveTypeAlias) : hasDefaultTypeArguments || ts.some(node.typeArguments, mayResolveTypeAlias)); } // Return true when the given node is transitively contained in type constructs that eagerly @@ -44878,15 +45038,15 @@ var ts; function isResolvedByTypeAlias(node) { var parent = node.parent; switch (parent.kind) { - case 182 /* ParenthesizedType */: - case 169 /* TypeReference */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 185 /* IndexedAccessType */: - case 180 /* ConditionalType */: - case 184 /* TypeOperator */: + case 183 /* ParenthesizedType */: + case 170 /* TypeReference */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 186 /* IndexedAccessType */: + case 181 /* ConditionalType */: + case 185 /* TypeOperator */: return isResolvedByTypeAlias(parent); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return true; } return false; @@ -44895,27 +45055,27 @@ var ts; // of a type alias. function mayResolveTypeAlias(node) { switch (node.kind) { - case 169 /* TypeReference */: + case 170 /* TypeReference */: return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node.typeName, 788968 /* Type */).flags & 524288 /* TypeAlias */); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return true; - case 184 /* TypeOperator */: - return node.operator !== 147 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); - case 182 /* ParenthesizedType */: - case 176 /* OptionalType */: - case 299 /* JSDocOptionalType */: - case 297 /* JSDocNullableType */: - case 298 /* JSDocNonNullableType */: - case 294 /* JSDocTypeExpression */: + case 185 /* TypeOperator */: + return node.operator !== 148 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); + case 183 /* ParenthesizedType */: + case 177 /* OptionalType */: + case 300 /* JSDocOptionalType */: + case 298 /* JSDocNullableType */: + case 299 /* JSDocNonNullableType */: + case 295 /* JSDocTypeExpression */: return mayResolveTypeAlias(node.type); - case 177 /* RestType */: - return node.type.kind !== 174 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); - case 178 /* UnionType */: - case 179 /* IntersectionType */: + case 178 /* RestType */: + return node.type.kind !== 175 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); + case 179 /* UnionType */: + case 180 /* IntersectionType */: return ts.some(node.types, mayResolveTypeAlias); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); } @@ -44929,18 +45089,18 @@ var ts; links.resolvedType = emptyObjectType; } else if (isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 175 /* TupleType */ && node.elementTypes.length === 0 ? target : + links.resolvedType = node.kind === 176 /* TupleType */ && node.elementTypes.length === 0 ? target : createDeferredTypeReference(target, node, /*mapper*/ undefined); } else { - var elementTypes = node.kind === 174 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); + var elementTypes = node.kind === 175 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); links.resolvedType = createTypeReference(target, elementTypes); } } return links.resolvedType; } function isReadonlyTypeOperator(node) { - return ts.isTypeOperatorNode(node) && node.operator === 138 /* ReadonlyKeyword */; + return ts.isTypeOperatorNode(node) && node.operator === 139 /* ReadonlyKeyword */; } // We represent tuple types as type references to synthesized generic interface types created by // this function. The types are of the form: @@ -45045,7 +45205,7 @@ var ts; // We ignore 'never' types in unions if (!(flags & 131072 /* Never */)) { includes |= flags & 71041023 /* IncludesMask */; - if (flags & 66846720 /* StructuredOrInstantiable */) + if (flags & 201064448 /* StructuredOrInstantiable */) includes |= 262144 /* IncludesStructuredOrInstantiable */; if (type === wildcardType) includes |= 8388608 /* IncludesWildcard */; @@ -45177,7 +45337,7 @@ var ts; neverType; } } - var objectFlags = (includes & 66994211 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | + var objectFlags = (includes & 201211939 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 268435456 /* ContainsIntersections */ : 0); return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments); } @@ -45531,7 +45691,7 @@ var ts; type = getReducedType(type); return type.flags & 1048576 /* Union */ ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : - maybeTypeOfKind(type, 58982400 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) : + maybeTypeOfKind(type, 193200128 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) : ts.getObjectFlags(type) & 32 /* Mapped */ ? filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); }) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : @@ -45553,20 +45713,24 @@ var ts; return indexType.flags & 131072 /* Never */ ? stringType : indexType; } function getTypeFromTypeOperatorNode(node) { + var _a; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 134 /* KeyOfKeyword */: + case 135 /* KeyOfKeyword */: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 147 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 144 /* SymbolKeyword */ + case 148 /* UniqueKeyword */: + links.resolvedType = node.type.kind === 145 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : errorType; break; - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: links.resolvedType = getTypeFromTypeNode(node.type); break; + case 128 /* AwaitedKeyword */: + links.resolvedType = (_a = getAwaitedType(getTypeFromTypeNode(node.type))) !== null && _a !== void 0 ? _a : unknownType; + break; default: throw ts.Debug.assertNever(node.operator); } @@ -45601,13 +45765,13 @@ var ts; if (type.flags & 2097152 /* Intersection */) { return ts.some(type.types, isJSLiteralType); } - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { return isJSLiteralType(getResolvedBaseConstraint(type)); } return false; } function getPropertyNameFromIndex(indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode : undefined; return isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? @@ -45618,7 +45782,7 @@ var ts; undefined; } function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags) { - var accessExpression = accessNode && accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode : undefined; var propName = accessNode && ts.isPrivateIdentifier(accessNode) ? undefined : getPropertyNameFromIndex(indexType, accessNode); if (propName !== undefined) { var prop = getPropertyOfType(objectType, propName); @@ -45755,9 +45919,9 @@ var ts; } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode.argumentExpression : - accessNode.kind === 185 /* IndexedAccessType */ ? accessNode.indexType : - accessNode.kind === 154 /* ComputedPropertyName */ ? accessNode.expression : + return accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode.argumentExpression : + accessNode.kind === 186 /* IndexedAccessType */ ? accessNode.indexType : + accessNode.kind === 155 /* ComputedPropertyName */ ? accessNode.expression : accessNode; } function isGenericObjectType(type) { @@ -45768,7 +45932,7 @@ var ts; } return !!(type.objectFlags & 8388608 /* IsGenericObjectType */); } - return !!(type.flags & 58982400 /* InstantiableNonPrimitive */) || isGenericMappedType(type); + return !!(type.flags & 193200128 /* InstantiableNonPrimitive */) || isGenericMappedType(type); } function isGenericIndexType(type) { if (type.flags & 3145728 /* UnionOrIntersection */) { @@ -45778,7 +45942,7 @@ var ts; } return !!(type.objectFlags & 33554432 /* IsGenericIndexType */); } - return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); + return !!(type.flags & (193200128 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); } function isThisTypeParameter(type) { return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType); @@ -45831,7 +45995,7 @@ var ts; return type[cache] = distributedOverIndex; } // Only do the inner distributions if the index can no longer be instantiated to cause index distribution again - if (!(indexType.flags & 63176704 /* Instantiable */)) { + if (!(indexType.flags & 197394432 /* Instantiable */)) { // (T | U)[K] -> T[K] | U[K] (reading) // (T | U)[K] -> T[K] & U[K] (writing) // (T & U)[K] -> T[K] & U[K] @@ -45903,7 +46067,7 @@ var ts; // object type. Note that for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in // an expression. This is to preserve backwards compatibility. For example, an element access 'this["foo"]' // has always been resolved eagerly using the constraint type of 'this' at the given location. - if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 185 /* IndexedAccessType */) && isGenericObjectType(objectType)) { + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 186 /* IndexedAccessType */) && isGenericObjectType(objectType)) { if (objectType.flags & 3 /* AnyOrUnknown */) { return objectType; } @@ -45953,7 +46117,7 @@ var ts; links.resolvedType = resolved.flags & 8388608 /* IndexedAccess */ && resolved.objectType === objectType && resolved.indexType === indexType ? - getConstrainedTypeVariable(resolved, node) : resolved; + getConditionalFlowTypeOfType(resolved, node) : resolved; } return links.resolvedType; } @@ -45973,7 +46137,7 @@ var ts; } function getActualTypeVariable(type) { if (type.flags & 33554432 /* Substitution */) { - return type.typeVariable; + return type.baseType; } if (type.flags & 8388608 /* IndexedAccess */ && (type.objectType.flags & 33554432 /* Substitution */ || type.indexType.flags & 33554432 /* Substitution */)) { @@ -46001,7 +46165,7 @@ var ts; // types rules (i.e. proper contravariance) for inferences. inferTypes(context.inferences, checkType, extendsType, 128 /* NoConstraints */ | 256 /* AlwaysStrict */); } - combinedMapper = combineTypeMappers(mapper, context.mapper); + combinedMapper = mergeTypeMappers(mapper, context.mapper); } // Instantiate the extends type including inferences for 'infer T' type parameters var inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType; @@ -46192,7 +46356,7 @@ var ts; } function getAliasSymbolForTypeNode(node) { var host = node.parent; - while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 138 /* ReadonlyKeyword */) { + while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 139 /* ReadonlyKeyword */) { host = host.parent; } return ts.isTypeAlias(host) ? getSymbolOfNode(host) : undefined; @@ -46254,7 +46418,7 @@ var ts; * this function should be called in a left folding style, with left = previous result of getSpreadType * and right = the new element to be spread. */ - function getSpreadType(left, right, symbol, objectFlags, readonly, isParentTypeNullable) { + function getSpreadType(left, right, symbol, objectFlags, readonly) { if (left.flags & 1 /* Any */ || right.flags & 1 /* Any */) { return anyType; } @@ -46270,16 +46434,16 @@ var ts; if (left.flags & 1048576 /* Union */) { var merged = tryMergeUnionOfObjectTypeAndEmptyObject(left, readonly); if (merged) { - return getSpreadType(merged, right, symbol, objectFlags, readonly, isParentTypeNullable); + return getSpreadType(merged, right, symbol, objectFlags, readonly); } - return mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly, isParentTypeNullable); }); + return mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly); }); } if (right.flags & 1048576 /* Union */) { var merged = tryMergeUnionOfObjectTypeAndEmptyObject(right, readonly); if (merged) { - return getSpreadType(left, merged, symbol, objectFlags, readonly, maybeTypeOfKind(right, 98304 /* Nullable */)); + return getSpreadType(left, merged, symbol, objectFlags, readonly); } - return mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly, maybeTypeOfKind(right, 98304 /* Nullable */)); }); + return mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly); }); } if (right.flags & (528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 132 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)) { return left; @@ -46341,14 +46505,6 @@ var ts; result.nameType = getSymbolLinks(leftProp).nameType; members.set(leftProp.escapedName, result); } - else if (strictNullChecks && - !isParentTypeNullable && - symbol && - !isFromSpreadAssignment(leftProp, symbol) && - isFromSpreadAssignment(rightProp, symbol) && - !maybeTypeOfKind(rightType, 98304 /* Nullable */)) { - error(leftProp.valueDeclaration, ts.Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, ts.unescapeLeadingUnderscores(leftProp.escapedName)); - } } else { members.set(leftProp.escapedName, getSpreadSymbol(leftProp, readonly)); @@ -46447,7 +46603,7 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 246 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 247 /* InterfaceDeclaration */)) { if (!ts.hasModifier(container, 32 /* Static */) && (!ts.isConstructorDeclaration(container) || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -46478,90 +46634,93 @@ var ts; return links.resolvedType; } function getTypeFromTypeNode(node) { + return getConditionalFlowTypeOfType(getTypeFromTypeNodeWorker(node), node); + } + function getTypeFromTypeNodeWorker(node) { switch (node.kind) { case 125 /* AnyKeyword */: - case 295 /* JSDocAllType */: - case 296 /* JSDocUnknownType */: + case 296 /* JSDocAllType */: + case 297 /* JSDocUnknownType */: return anyType; - case 148 /* UnknownKeyword */: + case 149 /* UnknownKeyword */: return unknownType; - case 143 /* StringKeyword */: + case 144 /* StringKeyword */: return stringType; - case 140 /* NumberKeyword */: + case 141 /* NumberKeyword */: return numberType; - case 151 /* BigIntKeyword */: + case 152 /* BigIntKeyword */: return bigintType; - case 128 /* BooleanKeyword */: + case 129 /* BooleanKeyword */: return booleanType; - case 144 /* SymbolKeyword */: + case 145 /* SymbolKeyword */: return esSymbolType; case 110 /* VoidKeyword */: return voidType; - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: return undefinedType; case 100 /* NullKeyword */: return nullType; - case 137 /* NeverKeyword */: + case 138 /* NeverKeyword */: return neverType; - case 141 /* ObjectKeyword */: + case 142 /* ObjectKeyword */: return node.flags & 131072 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType; - case 183 /* ThisType */: + case 184 /* ThisType */: case 104 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 187 /* LiteralType */: + case 188 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return getTypeFromTypeReference(node); - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return node.assertsModifier ? voidType : booleanType; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 174 /* ArrayType */: - case 175 /* TupleType */: + case 175 /* ArrayType */: + case 176 /* TupleType */: return getTypeFromArrayOrTupleTypeNode(node); - case 176 /* OptionalType */: + case 177 /* OptionalType */: return getTypeFromOptionalTypeNode(node); - case 178 /* UnionType */: + case 179 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 179 /* IntersectionType */: + case 180 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 297 /* JSDocNullableType */: + case 298 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 299 /* JSDocOptionalType */: + case 300 /* JSDocOptionalType */: return addOptionality(getTypeFromTypeNode(node.type)); - case 182 /* ParenthesizedType */: - case 298 /* JSDocNonNullableType */: - case 294 /* JSDocTypeExpression */: + case 183 /* ParenthesizedType */: + case 299 /* JSDocNonNullableType */: + case 295 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 177 /* RestType */: + case 178 /* RestType */: return getElementTypeOfArrayType(getTypeFromTypeNode(node.type)) || errorType; - case 301 /* JSDocVariadicType */: + case 302 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 173 /* TypeLiteral */: - case 304 /* JSDocTypeLiteral */: - case 300 /* JSDocFunctionType */: - case 305 /* JSDocSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 174 /* TypeLiteral */: + case 305 /* JSDocTypeLiteral */: + case 301 /* JSDocFunctionType */: + case 306 /* JSDocSignature */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 184 /* TypeOperator */: + case 185 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 186 /* MappedType */: + case 187 /* MappedType */: return getTypeFromMappedTypeNode(node); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return getTypeFromConditionalTypeNode(node); - case 181 /* InferType */: + case 182 /* InferType */: return getTypeFromInferTypeNode(node); - case 188 /* ImportType */: + case 189 /* ImportType */: return getTypeFromImportTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode case 75 /* Identifier */: - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: var symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -46591,27 +46750,41 @@ var ts; function instantiateSignatures(signatures, mapper) { return instantiateList(signatures, mapper, instantiateSignature); } - function makeUnaryTypeMapper(source, target) { - return function (t) { return t === source ? target : t; }; + function createTypeMapper(sources, targets) { + return sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : makeArrayTypeMapper(sources, targets); } - function makeBinaryTypeMapper(source1, target1, source2, target2) { - return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; }; + function getMappedType(type, mapper) { + switch (mapper.kind) { + case 0 /* Simple */: + return type === mapper.source ? mapper.target : type; + case 1 /* Array */: + var sources = mapper.sources; + var targets = mapper.targets; + for (var i = 0; i < sources.length; i++) { + if (type === sources[i]) { + return targets ? targets[i] : anyType; + } + } + return type; + case 2 /* Function */: + return mapper.func(type); + case 3 /* Composite */: + case 4 /* Merged */: + var t1 = getMappedType(type, mapper.mapper1); + return t1 !== type && mapper.kind === 3 /* Composite */ ? instantiateType(t1, mapper.mapper2) : getMappedType(t1, mapper.mapper2); + } + } + function makeUnaryTypeMapper(source, target) { + return { kind: 0 /* Simple */, source: source, target: target }; } function makeArrayTypeMapper(sources, targets) { - return function (t) { - for (var i = 0; i < sources.length; i++) { - if (t === sources[i]) { - return targets ? targets[i] : anyType; - } - } - return t; - }; + return { kind: 1 /* Array */, sources: sources, targets: targets }; } - function createTypeMapper(sources, targets) { - ts.Debug.assert(targets === undefined || sources.length === targets.length); - return sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : - sources.length === 2 ? makeBinaryTypeMapper(sources[0], targets ? targets[0] : anyType, sources[1], targets ? targets[1] : anyType) : - makeArrayTypeMapper(sources, targets); + function makeFunctionTypeMapper(func) { + return { kind: 2 /* Function */, func: func }; + } + function makeCompositeTypeMapper(kind, mapper1, mapper2) { + return { kind: kind, mapper1: mapper1, mapper2: mapper2 }; } function createTypeEraser(sources) { return createTypeMapper(sources, /*targets*/ undefined); @@ -46621,29 +46794,25 @@ var ts; * This is used during inference when instantiating type parameter defaults. */ function createBackreferenceMapper(context, index) { - return function (t) { return ts.findIndex(context.inferences, function (info) { return info.typeParameter === t; }) >= index ? unknownType : t; }; + return makeFunctionTypeMapper(function (t) { return ts.findIndex(context.inferences, function (info) { return info.typeParameter === t; }) >= index ? unknownType : t; }); } function combineTypeMappers(mapper1, mapper2) { - if (!mapper1) - return mapper2; - if (!mapper2) - return mapper1; - return function (t) { return instantiateType(mapper1(t), mapper2); }; + return mapper1 ? makeCompositeTypeMapper(3 /* Composite */, mapper1, mapper2) : mapper2; } - function createReplacementMapper(source, target, baseMapper) { - return function (t) { return t === source ? target : baseMapper(t); }; + function mergeTypeMappers(mapper1, mapper2) { + return mapper1 ? makeCompositeTypeMapper(4 /* Merged */, mapper1, mapper2) : mapper2; } - function permissiveMapper(type) { - return type.flags & 262144 /* TypeParameter */ ? wildcardType : type; + function prependTypeMapping(source, target, mapper) { + return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(4 /* Merged */, makeUnaryTypeMapper(source, target), mapper); + } + function appendTypeMapping(mapper, source, target) { + return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(4 /* Merged */, mapper, makeUnaryTypeMapper(source, target)); } function getRestrictiveTypeParameter(tp) { return tp.constraint === unknownType ? tp : tp.restrictiveInstantiation || (tp.restrictiveInstantiation = createTypeParameter(tp.symbol), tp.restrictiveInstantiation.constraint = unknownType, tp.restrictiveInstantiation); } - function restrictiveMapper(type) { - return type.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(type) : type; - } function cloneTypeParameter(typeParameter) { var result = createTypeParameter(typeParameter.symbol); result.target = typeParameter; @@ -46677,7 +46846,7 @@ var ts; } function instantiateSymbol(symbol, mapper) { var links = getSymbolLinks(symbol); - if (links.type && !maybeTypeOfKind(links.type, 524288 /* Object */ | 63176704 /* Instantiable */)) { + if (links.type && !couldContainTypeVariables(links.type)) { // If the type of the symbol is already resolved, and if that type could not possibly // be affected by instantiation, simply return the symbol itself. return symbol; @@ -46743,7 +46912,8 @@ var ts; // We are instantiating an anonymous type that has one or more type parameters in scope. Apply the // mapper to the type parameters to produce the effective list of type arguments, and compute the // instantiation cache key from the type IDs of the type arguments. - var typeArguments = ts.map(typeParameters, combineTypeMappers(type.mapper, mapper)); + var combinedMapper_1 = combineTypeMappers(type.mapper, mapper); + var typeArguments = ts.map(typeParameters, function (t) { return getMappedType(t, combinedMapper_1); }); var id = getTypeListId(typeArguments); var result = links.instantiations.get(id); if (!result) { @@ -46758,9 +46928,9 @@ var ts; return type; } function maybeTypeParameterReference(node) { - return !(node.kind === 153 /* QualifiedName */ || - node.parent.kind === 169 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || - node.parent.kind === 188 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); + return !(node.kind === 154 /* QualifiedName */ || + node.parent.kind === 170 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || + node.parent.kind === 189 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); } function isTypeParameterPossiblyReferenced(tp, node) { // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks @@ -46769,7 +46939,7 @@ var ts; if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container = tp.symbol.declarations[0].parent; for (var n = node; n !== container; n = n.parent) { - if (!n || n.kind === 223 /* Block */ || n.kind === 180 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { + if (!n || n.kind === 224 /* Block */ || n.kind === 181 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { return true; } } @@ -46778,12 +46948,12 @@ var ts; return true; function containsReference(node) { switch (node.kind) { - case 183 /* ThisType */: + case 184 /* ThisType */: return !!tp.isThisType; case 75 /* Identifier */: return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) && - getTypeFromTypeNode(node) === tp; - case 172 /* TypeQuery */: + getTypeFromTypeNodeWorker(node) === tp; // use worker because we're looking for === equality + case 173 /* TypeQuery */: return true; } return !!ts.forEachChild(node, containsReference); @@ -46815,8 +46985,8 @@ var ts; var mappedTypeVariable = instantiateType(typeVariable, mapper); if (typeVariable !== mappedTypeVariable) { return mapType(getReducedType(mappedTypeVariable), function (t) { - if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { - var replacementMapper = createReplacementMapper(typeVariable, t, mapper); + if (t.flags & (3 /* AnyOrUnknown */ | 193200128 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { + var replacementMapper = prependTypeMapping(typeVariable, t, mapper); return isArrayType(t) ? instantiateMappedArrayType(t, type, replacementMapper) : isTupleType(t) ? instantiateMappedTupleType(t, type, replacementMapper) : instantiateAnonymousType(type, replacementMapper); @@ -46849,7 +47019,7 @@ var ts; createTupleType(elementTypes, newMinLength, tupleType.target.hasRestElement, newReadonly, tupleType.target.associatedNames); } function instantiateMappedTypeTemplate(type, key, isOptional, mapper) { - var templateMapper = combineTypeMappers(mapper, createTypeMapper([getTypeParameterFromMappedType(type)], [key])); + var templateMapper = appendTypeMapping(mapper, getTypeParameterFromMappedType(type), key); var propType = instantiateType(getTemplateTypeFromMappedType(type.target || type), templateMapper); var modifiers = getMappedTypeModifiers(type); return strictNullChecks && modifiers & 4 /* IncludeOptional */ && !maybeTypeOfKind(propType, 32768 /* Undefined */ | 16384 /* Void */) ? getOptionalType(propType) : @@ -46879,7 +47049,7 @@ var ts; // We are instantiating a conditional type that has one or more type parameters in scope. Apply the // mapper to the type parameters to produce the effective list of type arguments, and compute the // instantiation cache key from the type IDs of the type arguments. - var typeArguments = ts.map(root.outerTypeParameters, mapper); + var typeArguments = ts.map(root.outerTypeParameters, function (t) { return getMappedType(t, mapper); }); var id = getTypeListId(typeArguments); var result = root.instantiations.get(id); if (!result) { @@ -46897,15 +47067,15 @@ var ts; // type A | B, we produce (A extends U ? X : Y) | (B extends U ? X : Y). if (root.isDistributive) { var checkType_1 = root.checkType; - var instantiatedType = mapper(checkType_1); + var instantiatedType = getMappedType(checkType_1, mapper); if (checkType_1 !== instantiatedType && instantiatedType.flags & (1048576 /* Union */ | 131072 /* Never */)) { - return mapType(instantiatedType, function (t) { return getConditionalType(root, createReplacementMapper(checkType_1, t, mapper)); }); + return mapType(instantiatedType, function (t) { return getConditionalType(root, prependTypeMapping(checkType_1, t, mapper)); }); } } return getConditionalType(root, mapper); } function instantiateType(type, mapper) { - if (!type || !mapper || mapper === identityMapper) { + if (!type || !mapper) { return type; } if (instantiationDepth === 50 || instantiationCount >= 5000000) { @@ -46923,9 +47093,10 @@ var ts; return result; } function instantiateTypeWorker(type, mapper) { + var _a; var flags = type.flags; if (flags & 262144 /* TypeParameter */) { - return mapper(type); + return getMappedType(type, mapper); } if (flags & 524288 /* Object */) { var objectFlags = type.objectFlags; @@ -46970,8 +47141,11 @@ var ts; if (flags & 16777216 /* Conditional */) { return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper)); } + if (flags & 134217728 /* Awaited */) { + return (_a = getAwaitedType(instantiateType(type.awaitedType, mapper))) !== null && _a !== void 0 ? _a : unknownType; + } if (flags & 33554432 /* Substitution */) { - var maybeVariable = instantiateType(type.typeVariable, mapper); + var maybeVariable = instantiateType(type.baseType, mapper); if (maybeVariable.flags & 8650752 /* TypeVariable */) { return getSubstitutionType(maybeVariable, instantiateType(type.substitute, mapper)); } @@ -47011,35 +47185,35 @@ var ts; // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 244 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type return isContextSensitiveFunctionLikeDeclaration(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return ts.some(node.properties, isContextSensitive); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return ts.some(node.elements, isContextSensitive); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive); - case 273 /* JsxAttribute */: { + case 274 /* JsxAttribute */: { // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. var initializer = node.initializer; return !!initializer && isContextSensitive(initializer); } - case 276 /* JsxExpression */: { + case 277 /* JsxExpression */: { // It is possible to that node.expression is undefined (e.g
) var expression = node.expression; return !!expression && isContextSensitive(expression); @@ -47058,7 +47232,7 @@ var ts; if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 202 /* ArrowFunction */) { + if (node.kind !== 203 /* ArrowFunction */) { // If the first parameter is not an explicit 'this' parameter, then the function has // an implicit 'this' parameter which is subject to contextual typing. var parameter = ts.firstOrUndefined(node.parameters); @@ -47071,7 +47245,7 @@ var ts; } function hasContextSensitiveReturnExpression(node) { // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 223 /* Block */ && isContextSensitive(node.body); + return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 224 /* Block */ && isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && @@ -47124,7 +47298,7 @@ var ts; function isTypeDerivedFrom(source, target) { return source.flags & 1048576 /* Union */ ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) : target.flags & 1048576 /* Union */ ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) : - source.flags & 58982400 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : + source.flags & 193200128 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : target === globalObjectType ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) : target === globalFunctionType ? !!(source.flags & 524288 /* Object */) && isFunctionObjectType(source) : hasBaseType(source, getTargetType(target)); @@ -47174,23 +47348,23 @@ var ts; return true; } switch (node.kind) { - case 276 /* JsxExpression */: - case 200 /* ParenthesizedExpression */: + case 277 /* JsxExpression */: + case 201 /* ParenthesizedExpression */: return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: case 27 /* CommaToken */: return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); } return false; @@ -47381,7 +47555,7 @@ var ts; } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: // child is of the type of the expression return { errorNode: child, innerExpression: child.expression, nameType: nameType }; case 11 /* JsxText */: @@ -47390,9 +47564,9 @@ var ts; } // child is a string return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() }; - case 266 /* JsxElement */: - case 267 /* JsxSelfClosingElement */: - case 270 /* JsxFragment */: + case 267 /* JsxElement */: + case 268 /* JsxSelfClosingElement */: + case 271 /* JsxFragment */: // child is of type JSX.Element return { errorNode: child, innerExpression: child, nameType: nameType }; default: @@ -47543,11 +47717,11 @@ var ts; } _b = prop.kind; switch (_b) { - case 164 /* SetAccessor */: return [3 /*break*/, 2]; - case 163 /* GetAccessor */: return [3 /*break*/, 2]; - case 161 /* MethodDeclaration */: return [3 /*break*/, 2]; - case 282 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; - case 281 /* PropertyAssignment */: return [3 /*break*/, 4]; + case 165 /* SetAccessor */: return [3 /*break*/, 2]; + case 164 /* GetAccessor */: return [3 /*break*/, 2]; + case 162 /* MethodDeclaration */: return [3 /*break*/, 2]; + case 283 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; + case 282 /* PropertyAssignment */: return [3 /*break*/, 4]; } return [3 /*break*/, 6]; case 2: return [4 /*yield*/, { errorNode: prop.name, innerExpression: undefined, nameType: type }]; @@ -47624,8 +47798,8 @@ var ts; return 0 /* False */; } var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 161 /* MethodDeclaration */ && - kind !== 160 /* MethodSignature */ && kind !== 162 /* Constructor */; + var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 162 /* MethodDeclaration */ && + kind !== 161 /* MethodSignature */ && kind !== 163 /* Constructor */; var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -47886,7 +48060,7 @@ var ts; return !!(related & 1 /* Succeeded */); } } - if (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */) { + if (source.flags & 201064448 /* StructuredOrInstantiable */ || target.flags & 201064448 /* StructuredOrInstantiable */) { return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; @@ -47899,7 +48073,7 @@ var ts; var t = isFreshLiteralType(type) ? type.regularType : ts.getObjectFlags(type) & 4 /* Reference */ && type.node ? createTypeReference(type.target, getTypeArguments(type)) : type.flags & 3145728 /* UnionOrIntersection */ ? getReducedType(type) : - type.flags & 33554432 /* Substitution */ ? writing ? type.typeVariable : type.substitute : + type.flags & 33554432 /* Substitution */ ? writing ? type.baseType : type.substitute : type.flags & 25165824 /* Simplifiable */ ? getSimplifiedType(type, writing) : type; if (t === type) @@ -48119,8 +48293,15 @@ var ts; if (incompatibleStack.length) reportIncompatibleStack(); var _a = getTypeNamesForErrorDisplay(source, target), sourceType = _a[0], targetType = _a[1]; - if (target.flags & 262144 /* TypeParameter */ && target.immediateBaseConstraint !== undefined && isTypeAssignableTo(source, target.immediateBaseConstraint)) { - reportError(ts.Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2, sourceType, targetType, typeToString(target.immediateBaseConstraint)); + if (target.flags & 262144 /* TypeParameter */) { + var constraint = getBaseConstraintOfType(target); + var constraintElab = constraint && isTypeAssignableTo(source, constraint); + if (constraintElab) { + reportError(ts.Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2, sourceType, targetType, typeToString(constraint)); + } + else { + reportError(ts.Diagnostics._0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1, targetType, sourceType); + } } if (!message) { if (relation === comparableRelation) { @@ -48256,7 +48437,7 @@ var ts; if (source.flags & 1048576 /* Union */) { result = relation === comparableRelation ? someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState) : - eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */)); + eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState & 4 /* ExcessCheck */); } else { if (target.flags & 1048576 /* Union */) { @@ -48264,9 +48445,9 @@ var ts; } else if (target.flags & 2097152 /* Intersection */) { result = typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2 /* Target */); - if (result && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks)) { + if (result && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) && !(intersectionState & 4 /* ExcessCheck */)) { // Validate against excess props using the original `source` - if (!propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 0 /* None */)) { + if (!propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 4 /* ExcessCheck */)) { return 0 /* False */; } } @@ -48285,9 +48466,11 @@ var ts; // // - For a primitive type or type parameter (such as 'number = A & B') there is no point in // breaking the intersection apart. - result = someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */); + if (!isNonGenericObjectType(target) || !ts.every(source.types, function (t) { return isNonGenericObjectType(t) && !(ts.getObjectFlags(t) & 2097152 /* NonInferrableType */); })) { + result = someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */); + } } - if (!result && (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */)) { + if (!result && (source.flags & 201064448 /* StructuredOrInstantiable */ || target.flags & 201064448 /* StructuredOrInstantiable */)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) { resetErrorInfo(saveErrorInfo); } @@ -48517,12 +48700,12 @@ var ts; } return 0 /* False */; } - function eachTypeRelatedToType(source, target, reportErrors) { + function eachTypeRelatedToType(source, target, reportErrors, intersectionState) { var result = -1 /* True */; var sourceTypes = source.types; for (var _i = 0, sourceTypes_2 = sourceTypes; _i < sourceTypes_2.length; _i++) { var sourceType = sourceTypes_2[_i]; - var related = isRelatedTo(sourceType, target, reportErrors); + var related = isRelatedTo(sourceType, target, reportErrors, /*headMessage*/ undefined, intersectionState); if (!related) { return 0 /* False */; } @@ -48610,10 +48793,10 @@ var ts; // We're in the middle of variance checking - integrate any unmeasurable/unreliable flags from this cached component var saved = entry & 24 /* ReportsMask */; if (saved & 8 /* ReportsUnmeasurable */) { - instantiateType(source, reportUnmeasurableMarkers); + instantiateType(source, makeFunctionTypeMapper(reportUnmeasurableMarkers)); } if (saved & 16 /* ReportsUnreliable */) { - instantiateType(source, reportUnreliableMarkers); + instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers)); } } return entry & 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */; @@ -48652,7 +48835,8 @@ var ts; if (outofbandVarianceMarkerHandler) { originalHandler = outofbandVarianceMarkerHandler; outofbandVarianceMarkerHandler = function (onlyUnreliable) { - propagatingVarianceFlags |= onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */; + propagatingVarianceFlags |= + onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */; return originalHandler(onlyUnreliable); }; } @@ -48779,6 +48963,17 @@ var ts; } } } + else if (target.flags & 134217728 /* Awaited */ && source.flags & 134217728 /* Awaited */) { + var targetType = target.awaitedType; + var sourceType = instantiateType(source.awaitedType, makeFunctionTypeMapper(reportUnreliableMarkers)); + // An `awaited S` is related to an `awaited T` if `S` is related to `T`: + // + // S <: T ⇒ awaited S <: awaited T + // + if (result = isRelatedTo(sourceType, targetType, reportErrors)) { + return result; + } + } else if (isGenericMappedType(target)) { // A source type T is related to a target type { [P in X]: T[P] } var template = getTemplateTypeFromMappedType(target); @@ -48892,6 +49087,21 @@ var ts; } } } + else if (source.flags & 134217728 /* Awaited */) { + // An `awaited S` is related to `T` if `awaited C` is related to `T`, where `C` is the + // constraint of `S`: + // + // S <: C ^ awaited C <: T ⇒ awaited S <: T + // + // For example `awaited Promise` is assignable to `number`. + var constraint = getConstraintOfType(source.awaitedType); + var awaitedConstraint = constraint && getAwaitedType(constraint); + if (awaitedConstraint) { + if (result = isRelatedTo(awaitedConstraint, target, reportErrors)) { + return result; + } + } + } else { // An empty object type is related to any mapped type that includes a '?' modifier. if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target) && isEmptyObjectType(source)) { @@ -49051,7 +49261,7 @@ var ts; if (modifiersRelated) { var result_6; var targetConstraint = getConstraintTypeFromMappedType(target); - var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers); + var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers)); if (result_6 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) { var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); return result_6 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); @@ -49519,7 +49729,7 @@ var ts; * See signatureAssignableTo, compareSignaturesIdentical */ function signatureRelatedTo(source, target, erase, reportErrors, incompatibleReporter) { - return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0, reportErrors, reportError, incompatibleReporter, isRelatedTo, reportUnreliableMarkers); + return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0, reportErrors, reportError, incompatibleReporter, isRelatedTo, makeFunctionTypeMapper(reportUnreliableMarkers)); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -49670,10 +49880,6 @@ var ts; // make sure exactly 1 matches before returning it return match === -1 || discriminable.indexOf(/*searchElement*/ true, match + 1) !== -1 ? defaultValue : target.types[match]; } - function isFromSpreadAssignment(prop, container) { - var _a; - return ((_a = prop.valueDeclaration) === null || _a === void 0 ? void 0 : _a.parent) !== container.valueDeclaration; - } /** * A type is 'weak' if it is an object type with at least one optional property * and no required properties, call/construct signatures or index signatures @@ -49747,13 +49953,11 @@ var ts; variance = 4 /* Independent */; } outofbandVarianceMarkerHandler = oldHandler; - if (unmeasurable || unreliable) { - if (unmeasurable) { - variance |= 8 /* Unmeasurable */; - } - if (unreliable) { - variance |= 16 /* Unreliable */; - } + if (unmeasurable) { + variance |= 8 /* Unmeasurable */; + } + if (unreliable) { + variance |= 16 /* Unreliable */; } variances.push(variance); }; @@ -50526,12 +50730,12 @@ var ts; } var diagnostic; switch (declaration.kind) { - case 209 /* BinaryExpression */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 210 /* BinaryExpression */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 156 /* Parameter */: + case 157 /* Parameter */: var param = declaration; if (ts.isIdentifier(param.name) && (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && @@ -50546,23 +50750,23 @@ var ts; noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; if (!noImplicitAny) { // Don't issue a suggestion for binding elements since the codefix doesn't yet support them. return; } break; - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 244 /* FunctionDeclaration */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 245 /* FunctionDeclaration */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: if (noImplicitAny && !declaration.name) { if (wideningKind === 1 /* GeneratorYield */) { error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); @@ -50576,7 +50780,7 @@ var ts; wideningKind === 1 /* GeneratorYield */ ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 186 /* MappedType */: + case 187 /* MappedType */: if (noImplicitAny) { error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } @@ -50638,8 +50842,8 @@ var ts; signature: signature, flags: flags, compareTypes: compareTypes, - mapper: function (t) { return mapToInferredType(context, t, /*fix*/ true); }, - nonFixingMapper: function (t) { return mapToInferredType(context, t, /*fix*/ false); }, + mapper: makeFunctionTypeMapper(function (t) { return mapToInferredType(context, t, /*fix*/ true); }), + nonFixingMapper: makeFunctionTypeMapper(function (t) { return mapToInferredType(context, t, /*fix*/ false); }), }; return context; } @@ -50704,7 +50908,7 @@ var ts; if (objectFlags & 67108864 /* CouldContainTypeVariablesComputed */) { return !!(objectFlags & 134217728 /* CouldContainTypeVariables */); } - var result = !!(type.flags & 63176704 /* Instantiable */ || + var result = !!(type.flags & 197394432 /* Instantiable */ || objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 131072 /* ObjectRestType */) || @@ -51000,7 +51204,7 @@ var ts; var indexType = getSimplifiedType(target.indexType, /*writing*/ false); // Generally simplifications of instantiable indexes are avoided to keep relationship checking correct, however if our target is an access, we can consider // that key of that access to be "instantiated", since we're looking to find the infernce goal in any way we can. - if (indexType.flags & 63176704 /* Instantiable */) { + if (indexType.flags & 197394432 /* Instantiable */) { var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, /*writing*/ false), indexType, /*writing*/ false); if (simplified_1 && simplified_1 !== target) { invokeOnce(source, simplified_1, inferFromTypes); @@ -51035,6 +51239,9 @@ var ts; inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } + else if (source.flags & 134217728 /* Awaited */ && target.flags & 134217728 /* Awaited */) { + inferFromTypes(source.awaitedType, target.awaitedType); + } else if (target.flags & 16777216 /* Conditional */) { var savePriority = priority; priority |= contravariant ? 16 /* ContravariantConditional */ : 0; @@ -51042,6 +51249,10 @@ var ts; inferToMultipleTypes(source, targetTypes, target.flags); priority = savePriority; } + else if (target.flags & 134217728 /* Awaited */) { + var targetTypes = [target.awaitedType, createPromiseLikeType(target.awaitedType)]; + inferToMultipleTypes(source, targetTypes, target.flags); + } else if (target.flags & 3145728 /* UnionOrIntersection */) { inferToMultipleTypes(source, target.types, target.flags); } @@ -51055,7 +51266,7 @@ var ts; } else { source = getReducedType(source); - if (!(priority & 128 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 63176704 /* Instantiable */))) { + if (!(priority & 128 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 197394432 /* Instantiable */))) { var apparentSource = getApparentType(source); // getApparentType can return _any_ type, since an indexed access or conditional may simplify to any other type. // If that occurs and it doesn't simplify to an object or intersection, we'll need to restart `inferFromTypes` @@ -51337,6 +51548,32 @@ var ts; } // Infer from the members of source and target only if the two types are possibly related if (!typesDefinitelyUnrelated(source, target)) { + if (isArrayType(source) || isTupleType(source)) { + if (isTupleType(target)) { + var sourceLength = isTupleType(source) ? getLengthOfTupleType(source) : 0; + var targetLength = getLengthOfTupleType(target); + var sourceRestType = isTupleType(source) ? getRestTypeOfTupleType(source) : getElementTypeOfArrayType(source); + var targetRestType = getRestTypeOfTupleType(target); + var fixedLength = targetLength < sourceLength || sourceRestType ? targetLength : sourceLength; + for (var i = 0; i < fixedLength; i++) { + inferFromTypes(i < sourceLength ? getTypeArguments(source)[i] : sourceRestType, getTypeArguments(target)[i]); + } + if (targetRestType) { + var types = fixedLength < sourceLength ? getTypeArguments(source).slice(fixedLength, sourceLength) : []; + if (sourceRestType) { + types.push(sourceRestType); + } + if (types.length) { + inferFromTypes(getUnionType(types), targetRestType); + } + } + return; + } + if (isArrayType(target)) { + inferFromIndexTypes(source, target); + return; + } + } inferFromProperties(source, target); inferFromSignatures(source, target, 0 /* Call */); inferFromSignatures(source, target, 1 /* Construct */); @@ -51344,32 +51581,6 @@ var ts; } } function inferFromProperties(source, target) { - if (isArrayType(source) || isTupleType(source)) { - if (isTupleType(target)) { - var sourceLength = isTupleType(source) ? getLengthOfTupleType(source) : 0; - var targetLength = getLengthOfTupleType(target); - var sourceRestType = isTupleType(source) ? getRestTypeOfTupleType(source) : getElementTypeOfArrayType(source); - var targetRestType = getRestTypeOfTupleType(target); - var fixedLength = targetLength < sourceLength || sourceRestType ? targetLength : sourceLength; - for (var i = 0; i < fixedLength; i++) { - inferFromTypes(i < sourceLength ? getTypeArguments(source)[i] : sourceRestType, getTypeArguments(target)[i]); - } - if (targetRestType) { - var types = fixedLength < sourceLength ? getTypeArguments(source).slice(fixedLength, sourceLength) : []; - if (sourceRestType) { - types.push(sourceRestType); - } - if (types.length) { - inferFromTypes(getUnionType(types), targetRestType); - } - } - return; - } - if (isArrayType(target)) { - inferFromIndexTypes(source, target); - return; - } - } var properties = getPropertiesOfObjectType(target); for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { var targetProp = properties_3[_i]; @@ -51387,7 +51598,7 @@ var ts; var len = sourceLen < targetLen ? sourceLen : targetLen; var skipParameters = !!(ts.getObjectFlags(source) & 2097152 /* NonInferrableType */); for (var i = 0; i < len; i++) { - inferFromSignature(getBaseSignature(sourceSignatures[sourceLen - len + i]), getBaseSignature(targetSignatures[targetLen - len + i]), skipParameters); + inferFromSignature(getBaseSignature(sourceSignatures[sourceLen - len + i]), getErasedSignature(targetSignatures[targetLen - len + i]), skipParameters); } } function inferFromSignature(source, target, skipParameters) { @@ -51395,7 +51606,7 @@ var ts; var saveBivariant = bivariant; var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; // Once we descend into a bivariant signature we remain bivariant for all nested inferences - bivariant = bivariant || kind === 161 /* MethodDeclaration */ || kind === 160 /* MethodSignature */ || kind === 162 /* Constructor */; + bivariant = bivariant || kind === 162 /* MethodDeclaration */ || kind === 161 /* MethodSignature */ || kind === 163 /* Constructor */; applyToParameterTypes(source, target, inferFromContravariantTypes); bivariant = saveBivariant; } @@ -51503,7 +51714,7 @@ var ts; if (defaultType) { // Instantiate the default type. Any forward reference to a type // parameter should be instantiated to the empty object type. - inferredType = instantiateType(defaultType, combineTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper)); + inferredType = instantiateType(defaultType, mergeTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper)); } } } @@ -51565,7 +51776,7 @@ var ts; case "AsyncIterator": return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later; default: - if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; } else { @@ -51586,7 +51797,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - return !!ts.findAncestor(node, function (n) { return n.kind === 172 /* TypeQuery */ ? true : n.kind === 75 /* Identifier */ || n.kind === 153 /* QualifiedName */ ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 173 /* TypeQuery */ ? true : n.kind === 75 /* Identifier */ || n.kind === 154 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -51601,11 +51812,11 @@ var ts; return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; case 104 /* ThisKeyword */: return "0"; - case 218 /* NonNullExpression */: - case 200 /* ParenthesizedExpression */: + case 219 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: var propName = getAccessedPropertyName(node); if (propName !== undefined) { var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); @@ -51616,24 +51827,24 @@ var ts; } function isMatchingReference(source, target) { switch (target.kind) { - case 200 /* ParenthesizedExpression */: - case 218 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: + case 219 /* NonNullExpression */: return isMatchingReference(source, target.expression); } switch (source.kind) { case 75 /* Identifier */: return target.kind === 75 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 242 /* VariableDeclaration */ || target.kind === 191 /* BindingElement */) && + (target.kind === 243 /* VariableDeclaration */ || target.kind === 192 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 104 /* ThisKeyword */: return target.kind === 104 /* ThisKeyword */; case 102 /* SuperKeyword */: return target.kind === 102 /* SuperKeyword */; - case 218 /* NonNullExpression */: - case 200 /* ParenthesizedExpression */: + case 219 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: return isMatchingReference(source.expression, target); - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return ts.isAccessExpression(target) && getAccessedPropertyName(source) === getAccessedPropertyName(target) && isMatchingReference(source.expression, target.expression); @@ -51641,7 +51852,7 @@ var ts; return false; } function getAccessedPropertyName(access) { - return access.kind === 194 /* PropertyAccessExpression */ ? access.name.escapedText : + return access.kind === 195 /* PropertyAccessExpression */ ? access.name.escapedText : ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } @@ -51670,7 +51881,7 @@ var ts; if (prop.isDiscriminantProperty === undefined) { prop.isDiscriminantProperty = (prop.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && - !maybeTypeOfKind(getTypeOfSymbol(prop), 63176704 /* Instantiable */); + !maybeTypeOfKind(getTypeOfSymbol(prop), 197394432 /* Instantiable */); } return !!prop.isDiscriminantProperty; } @@ -51703,7 +51914,7 @@ var ts; } } } - if (callExpression.expression.kind === 194 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 195 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -51821,7 +52032,7 @@ var ts; if (flags & 67108864 /* NonPrimitive */) { return strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */; } - if (flags & 63176704 /* Instantiable */) { + if (flags & 197394432 /* Instantiable */) { return getTypeFacts(getBaseConstraintOfType(type) || unknownType); } if (flags & 3145728 /* UnionOrIntersection */) { @@ -51858,15 +52069,15 @@ var ts; return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 192 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 281 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 193 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 282 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 209 /* BinaryExpression */ && parent.parent.left === parent || - parent.parent.kind === 232 /* ForOfStatement */ && parent.parent.initializer === parent; + return parent.parent.kind === 210 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 233 /* ForOfStatement */ && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -51883,21 +52094,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return stringType; - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || errorType; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return undefinedType; - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return errorType; @@ -51905,7 +52116,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 189 /* ObjectBindingPattern */ ? + var type = pattern.kind === 190 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : @@ -51923,30 +52134,30 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 231 /* ForInStatement */) { + if (node.parent.parent.kind === 232 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 232 /* ForOfStatement */) { + if (node.parent.parent.kind === 233 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 242 /* VariableDeclaration */ ? + return node.kind === 243 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function isEmptyArrayAssignment(node) { - return node.kind === 242 /* VariableDeclaration */ && node.initializer && + return node.kind === 243 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 191 /* BindingElement */ && node.parent.kind === 209 /* BinaryExpression */ && + node.kind !== 192 /* BindingElement */ && node.parent.kind === 210 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: return getReferenceCandidate(node.left); @@ -51958,13 +52169,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 200 /* ParenthesizedExpression */ || - parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || - parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? + return parent.kind === 201 /* ParenthesizedExpression */ || + parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || + parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 277 /* CaseClause */) { + if (clause.kind === 278 /* CaseClause */) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -51980,20 +52191,19 @@ var ts; } return links.switchTypes; } - // Get the types from all cases in a switch on `typeof`. An - // `undefined` element denotes an explicit `default` clause. - function getSwitchClauseTypeOfWitnesses(switchStatement) { + function getSwitchClauseTypeOfWitnesses(switchStatement, retainDefault) { var witnesses = []; for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) { var clause = _a[_i]; - if (clause.kind === 277 /* CaseClause */) { + if (clause.kind === 278 /* CaseClause */) { if (ts.isStringLiteralLike(clause.expression)) { witnesses.push(clause.expression.text); continue; } return ts.emptyArray; } - witnesses.push(/*explicitDefaultStatement*/ undefined); + if (retainDefault) + witnesses.push(/*explicitDefaultStatement*/ undefined); } return witnesses; } @@ -52147,12 +52357,12 @@ var ts; var root = getReferenceRoot(node); var parent = root.parent; var isLengthPushOrUnshift = ts.isPropertyAccessExpression(parent) && (parent.name.escapedText === "length" || - parent.parent.kind === 196 /* CallExpression */ + parent.parent.kind === 197 /* CallExpression */ && ts.isIdentifier(parent.name) && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 195 /* ElementAccessExpression */ && + var isElementAssignment = parent.kind === 196 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 209 /* BinaryExpression */ && + parent.parent.kind === 210 /* BinaryExpression */ && parent.parent.operatorToken.kind === 62 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -52160,8 +52370,8 @@ var ts; return isLengthPushOrUnshift || isElementAssignment; } function isDeclarationWithExplicitTypeAnnotation(declaration) { - return !!(declaration && (declaration.kind === 242 /* VariableDeclaration */ || declaration.kind === 156 /* Parameter */ || - declaration.kind === 159 /* PropertyDeclaration */ || declaration.kind === 158 /* PropertySignature */) && + return !!(declaration && (declaration.kind === 243 /* VariableDeclaration */ || declaration.kind === 157 /* Parameter */ || + declaration.kind === 160 /* PropertyDeclaration */ || declaration.kind === 159 /* PropertySignature */) && ts.getEffectiveTypeAnnotationNode(declaration)); } function getExplicitTypeOfSymbol(symbol, diagnostic) { @@ -52191,11 +52401,11 @@ var ts; return getExplicitThisType(node); case 102 /* SuperKeyword */: return checkSuperExpression(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: var type = getTypeOfDottedName(node.expression, diagnostic); var prop = type && getPropertyOfType(type, node.name.escapedText); return prop && getExplicitTypeOfSymbol(prop, diagnostic); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return getTypeOfDottedName(node.expression, diagnostic); } } @@ -52209,7 +52419,7 @@ var ts; // circularities in control flow analysis, we use getTypeOfDottedName when resolving the call // target expression of an assertion. var funcType = void 0; - if (node.parent.kind === 226 /* ExpressionStatement */) { + if (node.parent.kind === 227 /* ExpressionStatement */) { funcType = getTypeOfDottedName(node.expression, /*diagnostic*/ undefined); } else if (node.expression.kind !== 102 /* SuperKeyword */) { @@ -52253,7 +52463,7 @@ var ts; } function isFalseExpression(expr) { var node = ts.skipParentheses(expr); - return node.kind === 91 /* FalseKeyword */ || node.kind === 209 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || + return node.kind === 91 /* FalseKeyword */ || node.kind === 210 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right)); } function isReachableFlowNodeWorker(flow, noCacheCheck) { @@ -52328,7 +52538,7 @@ var ts; if (flowAnalysisDisabled) { return errorType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 133970943 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 268188671 /* Narrowable */)) { return declaredType; } flowInvocationCount++; @@ -52340,7 +52550,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); - if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 218 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 219 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { return declaredType; } return resultType; @@ -52421,8 +52631,8 @@ var ts; // Check if we should continue with the control flow of the containing function. var container = flow.node; if (container && container !== flowContainer && - reference.kind !== 194 /* PropertyAccessExpression */ && - reference.kind !== 195 /* ElementAccessExpression */ && + reference.kind !== 195 /* PropertyAccessExpression */ && + reference.kind !== 196 /* ElementAccessExpression */ && reference.kind !== 104 /* ThisKeyword */) { flow = container.flowNode; continue; @@ -52447,7 +52657,7 @@ var ts; } function getInitialOrAssignedType(flow) { var node = flow.node; - return getConstraintForLocation(node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */ ? + return getConstraintForLocation(node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference); } @@ -52487,14 +52697,14 @@ var ts; // in which case we continue control flow analysis back to the function's declaration if (ts.isVariableDeclaration(node) && (ts.isInJSFile(node) || ts.isVarConst(node))) { var init = ts.getDeclaredExpandoInitializer(node); - if (init && (init.kind === 201 /* FunctionExpression */ || init.kind === 202 /* ArrowFunction */)) { + if (init && (init.kind === 202 /* FunctionExpression */ || init.kind === 203 /* ArrowFunction */)) { return getTypeAtFlowNode(flow.antecedent); } } return declaredType; } // for (const _ in ref) acts as a nonnull on ref - if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 231 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { + if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 232 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))); } // Assignment doesn't affect reference @@ -52505,7 +52715,7 @@ var ts; if (node.kind === 91 /* FalseKeyword */) { return unreachableNeverType; } - if (node.kind === 209 /* BinaryExpression */) { + if (node.kind === 210 /* BinaryExpression */) { if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) { return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); } @@ -52536,7 +52746,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 196 /* CallExpression */ ? + var expr = node.kind === 197 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -52544,7 +52754,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 196 /* CallExpression */) { + if (node.kind === 197 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -52594,7 +52804,7 @@ var ts; if (isMatchingReference(reference, expr)) { type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } - else if (expr.kind === 204 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { + else if (expr.kind === 205 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } else { @@ -52602,7 +52812,7 @@ var ts; if (optionalChainContainsReference(expr, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & (32768 /* Undefined */ | 131072 /* Never */)); }); } - else if (expr.kind === 204 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { + else if (expr.kind === 205 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined"); }); } } @@ -52814,12 +53024,18 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 204 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { + if (left_1.kind === 205 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 204 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { + if (right_1.kind === 205 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } + if (ts.isConstructorAccessExpression(left_1)) { + return narrowTypeByConstructor(type, left_1, operator_1, right_1, assumeTrue); + } + if (ts.isConstructorAccessExpression(right_1)) { + return narrowTypeByConstructor(type, right_1, operator_1, left_1, assumeTrue); + } if (isMatchingReference(reference, left_1)) { return narrowTypeByEquality(type, operator_1, right_1, assumeTrue); } @@ -52951,7 +53167,7 @@ var ts; if (isTypeSubtypeOf(targetType, type)) { return targetType; } - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(targetType, constraint)) { return getIntersectionType([type, targetType]); @@ -53021,7 +53237,7 @@ var ts; if (isTypeSubtypeOf(candidate, type)) { return candidate; } - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(candidate, constraint)) { return getIntersectionType([type, candidate]); @@ -53031,7 +53247,7 @@ var ts; }; } function narrowBySwitchOnTypeOf(type, switchStatement, clauseStart, clauseEnd) { - var switchWitnesses = getSwitchClauseTypeOfWitnesses(switchStatement); + var switchWitnesses = getSwitchClauseTypeOfWitnesses(switchStatement, /*retainDefault*/ true); if (!switchWitnesses.length) { return type; } @@ -53094,6 +53310,50 @@ var ts; } return getTypeWithFacts(mapType(type, narrowTypeForTypeofSwitch(impliedType)), switchFacts); } + function narrowTypeByConstructor(type, constructorAccessExpr, operator, identifier, assumeTrue) { + // Do not narrow when checking inequality. + if (assumeTrue ? (operator !== 34 /* EqualsEqualsToken */ && operator !== 36 /* EqualsEqualsEqualsToken */) : (operator !== 35 /* ExclamationEqualsToken */ && operator !== 37 /* ExclamationEqualsEqualsToken */)) { + return type; + } + // In the case of `x.y`, a `x.constructor === T` type guard resets the narrowed type of `y` to its declared type. + if (!isMatchingReference(reference, constructorAccessExpr.expression)) { + return declaredType; + } + // Get the type of the constructor identifier expression, if it is not a function then do not narrow. + var identifierType = getTypeOfExpression(identifier); + if (!isFunctionType(identifierType) && !isConstructorType(identifierType)) { + return type; + } + // Get the prototype property of the type identifier so we can find out its type. + var prototypeProperty = getPropertyOfType(identifierType, "prototype"); + if (!prototypeProperty) { + return type; + } + // Get the type of the prototype, if it is undefined, or the global `Object` or `Function` types then do not narrow. + var prototypeType = getTypeOfSymbol(prototypeProperty); + var candidate = !isTypeAny(prototypeType) ? prototypeType : undefined; + if (!candidate || candidate === globalObjectType || candidate === globalFunctionType) { + return type; + } + // If the type that is being narrowed is `any` then just return the `candidate` type since every type is a subtype of `any`. + if (isTypeAny(type)) { + return candidate; + } + // Filter out types that are not considered to be "constructed by" the `candidate` type. + return filterType(type, function (t) { return isConstructedBy(t, candidate); }); + function isConstructedBy(source, target) { + // If either the source or target type are a class type then we need to check that they are the same exact type. + // This is because you may have a class `A` that defines some set of properties, and another class `B` + // that defines the same set of properties as class `A`, in that case they are structurally the same + // type, but when you do something like `instanceOfA.constructor === B` it will return false. + if (source.flags & 524288 /* Object */ && ts.getObjectFlags(source) & 1 /* Class */ || + target.flags & 524288 /* Object */ && ts.getObjectFlags(target) & 1 /* Class */) { + return source.symbol === target.symbol; + } + // For all other types just check that the `source` type is a subtype of the `target` type. + return isTypeSubtypeOf(source, target); + } + } function narrowTypeByInstanceof(type, expr, assumeTrue) { var left = getReferenceCandidate(expr.left); if (!isMatchingReference(reference, left)) { @@ -53188,16 +53448,16 @@ var ts; case 75 /* Identifier */: case 104 /* ThisKeyword */: case 102 /* SuperKeyword */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return narrowTypeByCallExpression(type, expr, assumeTrue); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: if (expr.operator === 53 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -53242,9 +53502,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 250 /* ModuleBlock */ || - node.kind === 290 /* SourceFile */ || - node.kind === 159 /* PropertyDeclaration */; + node.kind === 251 /* ModuleBlock */ || + node.kind === 291 /* SourceFile */ || + node.kind === 160 /* PropertyDeclaration */; }); } // Check if a parameter is assigned anywhere within its declaring function. @@ -53266,7 +53526,7 @@ var ts; if (node.kind === 75 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 156 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 157 /* Parameter */) { symbol.isAssigned = true; } } @@ -53282,7 +53542,7 @@ var ts; function removeOptionalityFromDeclaredType(declaredType, declaration) { if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 156 /* Parameter */ && + declaration.kind === 157 /* Parameter */ && declaration.initializer && getFalsyFlags(declaredType) & 32768 /* Undefined */ && !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768 /* Undefined */); @@ -53296,13 +53556,13 @@ var ts; } function isConstraintPosition(node) { var parent = node.parent; - return parent.kind === 194 /* PropertyAccessExpression */ || - parent.kind === 196 /* CallExpression */ && parent.expression === node || - parent.kind === 195 /* ElementAccessExpression */ && parent.expression === node || - parent.kind === 191 /* BindingElement */ && parent.name === node && !!parent.initializer; + return parent.kind === 195 /* PropertyAccessExpression */ || + parent.kind === 197 /* CallExpression */ && parent.expression === node || + parent.kind === 196 /* ElementAccessExpression */ && parent.expression === node || + parent.kind === 192 /* BindingElement */ && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { - return type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); + return type.flags & 193200128 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); } function getConstraintForLocation(type, node) { // When a node is the left hand expression of a property access, element access, or call expression, @@ -53341,7 +53601,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 202 /* ArrowFunction */) { + if (container.kind === 203 /* ArrowFunction */) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasModifier(container, 256 /* Async */)) { @@ -53362,7 +53622,7 @@ var ts; // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration.kind === 245 /* ClassDeclaration */ + if (declaration.kind === 246 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -53374,14 +53634,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 214 /* ClassExpression */) { + else if (declaration.kind === 215 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); - while (container.kind !== 290 /* SourceFile */) { + while (container.kind !== 291 /* SourceFile */) { if (container.parent === declaration) { - if (container.kind === 159 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { + if (container.kind === 160 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 33554432 /* ConstructorReferenceInClass */; } @@ -53430,7 +53690,7 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 156 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 157 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; @@ -53439,8 +53699,8 @@ var ts; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 201 /* FunctionExpression */ || - flowContainer.kind === 202 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 202 /* FunctionExpression */ || + flowContainer.kind === 203 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } @@ -53449,9 +53709,9 @@ var ts; // declaration container are the same). var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || - isInTypeQuery(node) || node.parent.kind === 263 /* ExportSpecifier */) || - node.parent.kind === 218 /* NonNullExpression */ || - declaration.kind === 242 /* VariableDeclaration */ && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 264 /* ExportSpecifier */) || + node.parent.kind === 219 /* NonNullExpression */ || + declaration.kind === 243 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 8388608 /* Ambient */; var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : @@ -53486,7 +53746,7 @@ var ts; if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || ts.isSourceFile(symbol.valueDeclaration) || - symbol.valueDeclaration.parent.kind === 280 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 281 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -53509,7 +53769,7 @@ var ts; // mark iteration statement as containing block-scoped binding captured in some function var capturesBlockScopeBindingInLoopBody = true; if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container) { var part = getPartOfForStatementContainingNode(node.parent, container); if (part) { @@ -53530,7 +53790,7 @@ var ts; // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */; } @@ -53549,7 +53809,7 @@ var ts; function isAssignedInBodyOfForStatement(node, container) { // skip parenthesized nodes var current = node; - while (current.parent.kind === 200 /* ParenthesizedExpression */) { + while (current.parent.kind === 201 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -53557,7 +53817,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 207 /* PrefixUnaryExpression */ || current.parent.kind === 208 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 208 /* PrefixUnaryExpression */ || current.parent.kind === 209 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; } @@ -53570,7 +53830,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 159 /* PropertyDeclaration */ || container.kind === 162 /* Constructor */) { + if (container.kind === 160 /* PropertyDeclaration */ || container.kind === 163 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -53638,37 +53898,37 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var capturedByArrowFunction = false; - if (container.kind === 162 /* Constructor */) { + if (container.kind === 163 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 202 /* ArrowFunction */) { + if (container.kind === 203 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); capturedByArrowFunction = true; } switch (container.kind) { - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 162 /* Constructor */: + case 163 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: if (ts.hasModifier(container, 32 /* Static */) && !(compilerOptions.target === 99 /* ESNext */ && compilerOptions.useDefineForClassFields)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -53708,7 +53968,9 @@ var ts; var classSymbol = checkExpression(className).symbol; if (classSymbol && classSymbol.members && (classSymbol.flags & 16 /* Function */)) { var classType = getDeclaredTypeOfSymbol(classSymbol).thisType; - return getFlowTypeOfReference(node, classType); + if (classType) { + return getFlowTypeOfReference(node, classType); + } } } // Check if it's a constructor definition, can be either a variable decl or function decl @@ -53716,7 +53978,7 @@ var ts; // * /** @constructor */ function [name]() { ... } // * /** @constructor */ var x = function() { ... } else if (isInJS && - (container.kind === 201 /* FunctionExpression */ || container.kind === 244 /* FunctionDeclaration */) && + (container.kind === 202 /* FunctionExpression */ || container.kind === 245 /* FunctionDeclaration */) && ts.getJSDocClassTag(container)) { var classType = getDeclaredTypeOfSymbol(getMergedSymbol(container.symbol)).thisType; return getFlowTypeOfReference(node, classType); @@ -53763,7 +54025,7 @@ var ts; } function getClassNameFromPrototypeMethod(container) { // Check if it's the RHS of a x.prototype.y = function [name]() { .... } - if (container.kind === 201 /* FunctionExpression */ && + if (container.kind === 202 /* FunctionExpression */ && ts.isBinaryExpression(container.parent) && ts.getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = container' @@ -53773,16 +54035,16 @@ var ts; .expression; // x } // x.prototype = { method() { } } - else if (container.kind === 161 /* MethodDeclaration */ && - container.parent.kind === 193 /* ObjectLiteralExpression */ && + else if (container.kind === 162 /* MethodDeclaration */ && + container.parent.kind === 194 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { return container.parent.parent.left.expression; } // x.prototype = { method: function() { } } - else if (container.kind === 201 /* FunctionExpression */ && - container.parent.kind === 281 /* PropertyAssignment */ && - container.parent.parent.kind === 193 /* ObjectLiteralExpression */ && + else if (container.kind === 202 /* FunctionExpression */ && + container.parent.kind === 282 /* PropertyAssignment */ && + container.parent.parent.kind === 194 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { return container.parent.parent.parent.left.expression; @@ -53790,7 +54052,7 @@ var ts; // Object.defineProperty(x, "method", { value: function() { } }); // Object.defineProperty(x, "method", { set: (x: () => void) => void }); // Object.defineProperty(x, "method", { get: () => function() { }) }); - else if (container.kind === 201 /* FunctionExpression */ && + else if (container.kind === 202 /* FunctionExpression */ && ts.isPropertyAssignment(container.parent) && ts.isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && @@ -53815,7 +54077,7 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 300 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 301 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -53829,15 +54091,15 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 156 /* Parameter */ && n.parent === constructorDecl; }); + return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 157 /* Parameter */ && n.parent === constructorDecl; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 196 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 197 /* CallExpression */ && node.parent.expression === node; var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 202 /* ArrowFunction */) { + while (container && container.kind === 203 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -53850,14 +54112,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 154 /* ComputedPropertyName */; }); - if (current && current.kind === 154 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 155 /* ComputedPropertyName */; }); + if (current && current.kind === 155 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 193 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 194 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -53865,7 +54127,7 @@ var ts; } return errorType; } - if (!isCallExpression && container.kind === 162 /* Constructor */) { + if (!isCallExpression && container.kind === 163 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasModifier(container, 32 /* Static */) || isCallExpression) { @@ -53934,7 +54196,7 @@ var ts; // as a call expression cannot be used as the target of a destructuring assignment while a property access can. // // For element access expressions (`super[x]`), we emit a generic helper that forwards the element access in both situations. - if (container.kind === 161 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { + if (container.kind === 162 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -53948,7 +54210,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 193 /* ObjectLiteralExpression */) { + if (container.parent.kind === 194 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return errorType; @@ -53969,7 +54231,7 @@ var ts; if (!baseClassType) { return errorType; } - if (container.kind === 162 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 163 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return errorType; @@ -53984,7 +54246,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 162 /* Constructor */; + return container.kind === 163 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -53992,21 +54254,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 193 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 194 /* ObjectLiteralExpression */) { if (ts.hasModifier(container, 32 /* Static */)) { - return container.kind === 161 /* MethodDeclaration */ || - container.kind === 160 /* MethodSignature */ || - container.kind === 163 /* GetAccessor */ || - container.kind === 164 /* SetAccessor */; + return container.kind === 162 /* MethodDeclaration */ || + container.kind === 161 /* MethodSignature */ || + container.kind === 164 /* GetAccessor */ || + container.kind === 165 /* SetAccessor */; } else { - return container.kind === 161 /* MethodDeclaration */ || - container.kind === 160 /* MethodSignature */ || - container.kind === 163 /* GetAccessor */ || - container.kind === 164 /* SetAccessor */ || - container.kind === 159 /* PropertyDeclaration */ || - container.kind === 158 /* PropertySignature */ || - container.kind === 162 /* Constructor */; + return container.kind === 162 /* MethodDeclaration */ || + container.kind === 161 /* MethodSignature */ || + container.kind === 164 /* GetAccessor */ || + container.kind === 165 /* SetAccessor */ || + container.kind === 160 /* PropertyDeclaration */ || + container.kind === 159 /* PropertySignature */ || + container.kind === 163 /* Constructor */; } } } @@ -54014,10 +54276,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 161 /* MethodDeclaration */ || - func.kind === 163 /* GetAccessor */ || - func.kind === 164 /* SetAccessor */) && func.parent.kind === 193 /* ObjectLiteralExpression */ ? func.parent : - func.kind === 201 /* FunctionExpression */ && func.parent.kind === 281 /* PropertyAssignment */ ? func.parent.parent : + return (func.kind === 162 /* MethodDeclaration */ || + func.kind === 164 /* GetAccessor */ || + func.kind === 165 /* SetAccessor */) && func.parent.kind === 194 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 202 /* FunctionExpression */ && func.parent.kind === 282 /* PropertyAssignment */ ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -54029,7 +54291,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 202 /* ArrowFunction */) { + if (func.kind === 203 /* ArrowFunction */) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -54056,7 +54318,7 @@ var ts; if (thisType) { return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); } - if (literal.parent.kind !== 281 /* PropertyAssignment */) { + if (literal.parent.kind !== 282 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -54070,7 +54332,7 @@ var ts; // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. var parent = ts.walkUpParenthesizedExpressions(func.parent); - if (parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { + if (parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { var target = parent.left; if (ts.isAccessExpression(target)) { var expression = target.expression; @@ -54123,9 +54385,9 @@ var ts; return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 156 /* Parameter */: + case 157 /* Parameter */: return getContextuallyTypedParameterType(declaration); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return getContextualTypeForBindingElement(declaration); // By default, do nothing and return undefined - only parameters and binding elements have context implied by a parent } @@ -54134,7 +54396,7 @@ var ts; var parent = declaration.parent.parent; var name = declaration.propertyName || declaration.name; var parentType = getContextualTypeForVariableLikeDeclaration(parent) || - parent.kind !== 191 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); + parent.kind !== 192 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); if (parentType && !ts.isBindingPattern(name) && !isComputedNonLiteralName(name)) { var nameType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(nameType)) { @@ -54175,6 +54437,9 @@ var ts; if (contextualReturnType) { if (functionFlags & 2 /* Async */) { // Async function var contextualAwaitedType = getAwaitedTypeOfPromise(contextualReturnType); + if (contextualAwaitedType && contextualAwaitedType.flags & 134217728 /* Awaited */) { + contextualAwaitedType = contextualAwaitedType.awaitedType; + } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return contextualReturnType; // Regular function @@ -54186,6 +54451,9 @@ var ts; var contextualType = getContextualType(node); if (contextualType) { var contextualAwaitedType = getAwaitedType(contextualType); + if (contextualAwaitedType && contextualAwaitedType.flags & 134217728 /* Awaited */) { + contextualAwaitedType = contextualAwaitedType.awaitedType; + } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return undefined; @@ -54256,7 +54524,7 @@ var ts; return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 198 /* TaggedTemplateExpression */) { + if (template.parent.kind === 199 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -54492,21 +54760,21 @@ var ts; case 91 /* FalseKeyword */: case 100 /* NullKeyword */: case 75 /* Identifier */: - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: return true; - case 194 /* PropertyAccessExpression */: - case 200 /* ParenthesizedExpression */: + case 195 /* PropertyAccessExpression */: + case 201 /* ParenthesizedExpression */: return isPossiblyDiscriminantValue(node.expression); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return !node.expression || isPossiblyDiscriminantValue(node.expression); } return false; } function discriminateContextualTypeByObjectMembers(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 281 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 282 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } function discriminateContextualTypeByJSXAttributes(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 273 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 274 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. @@ -54531,7 +54799,7 @@ var ts; // If the given contextual type contains instantiable types and if a mapper representing // return type inferences is available, instantiate those types using that mapper. function instantiateContextualType(contextualType, node, contextFlags) { - if (contextualType && maybeTypeOfKind(contextualType, 63176704 /* Instantiable */)) { + if (contextualType && maybeTypeOfKind(contextualType, 197394432 /* Instantiable */)) { var inferenceContext = getInferenceContext(node); // If no inferences have been made, nothing is gained from instantiating as type parameters // would just be replaced with their defaults similar to the apparent type. @@ -54554,7 +54822,7 @@ var ts; // are classified as instantiable (i.e. it doesn't instantiate object types), and (b) it performs // no reductions on instantiated union types. function instantiateInstantiableTypes(type, mapper) { - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { return instantiateType(type, mapper); } if (type.flags & 1048576 /* Union */) { @@ -54592,58 +54860,58 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 191 /* BindingElement */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 192 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 202 /* ArrowFunction */: - case 235 /* ReturnStatement */: + case 203 /* ArrowFunction */: + case 236 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return getContextualTypeForAwaitOperand(parent); - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (parent.expression.kind === 96 /* ImportKeyword */) { return stringType; } /* falls through */ - case 197 /* NewExpression */: + case 198 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: return ts.isConstTypeReference(parent.type) ? undefined : getTypeFromTypeNode(parent.type); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node, contextFlags); - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent, contextFlags); - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: return getApparentTypeOfContextualType(parent.parent, contextFlags); - case 192 /* ArrayLiteralExpression */: { + case 193 /* ArrayLiteralExpression */: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); - case 221 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 211 /* TemplateExpression */); + case 222 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 212 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 200 /* ParenthesizedExpression */: { + case 201 /* ParenthesizedExpression */: { // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast. var tag = ts.isInJSFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent, contextFlags); } - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return getContextualTypeForJsxExpression(parent); - case 273 /* JsxAttribute */: - case 275 /* JsxSpreadAttribute */: + case 274 /* JsxAttribute */: + case 276 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: return getContextualJsxElementAttributesType(parent, contextFlags); } return undefined; @@ -54800,7 +55068,7 @@ var ts; return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 201 /* FunctionExpression */ || node.kind === 202 /* ArrowFunction */; + return node.kind === 202 /* FunctionExpression */ || node.kind === 203 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -54814,7 +55082,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; @@ -54859,8 +55127,8 @@ var ts; return checkIteratedTypeOrElementType(33 /* Spread */, arrayOrIterableType, undefinedType, node.expression); } function hasDefaultValue(node) { - return (node.kind === 191 /* BindingElement */ && !!node.initializer) || - (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); + return (node.kind === 192 /* BindingElement */ && !!node.initializer) || + (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); } function checkArrayLiteral(node, checkMode, forceTuple) { var elements = node.elements; @@ -54873,7 +55141,7 @@ var ts; var inConstContext = isConstContext(node); for (var i = 0; i < elementCount; i++) { var e = elements[i]; - var spread = e.kind === 213 /* SpreadElement */ && e.expression; + var spread = e.kind === 214 /* SpreadElement */ && e.expression; var spreadType = spread && checkExpression(spread, checkMode, forceTuple); if (spreadType && isTupleType(spreadType)) { elementTypes.push.apply(elementTypes, getTypeArguments(spreadType)); @@ -54959,7 +55227,7 @@ var ts; } function isNumericName(name) { switch (name.kind) { - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return isNumericComputedName(name); case 75 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -55045,11 +55313,12 @@ var ts; // Grammar checking checkGrammarObjectLiteralExpression(node, inDestructuringPattern); var propertiesTable; + var allPropertiesTable = ts.createSymbolTable(); var propertiesArray = []; var spread = emptyObjectType; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 189 /* ObjectBindingPattern */ || contextualType.pattern.kind === 193 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 190 /* ObjectBindingPattern */ || contextualType.pattern.kind === 194 /* ObjectLiteralExpression */); var inConstContext = isConstContext(node); var checkFlags = inConstContext ? 8 /* Readonly */ : 0; var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node); @@ -55064,13 +55333,13 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = getSymbolOfNode(memberDecl); - var computedNameType = memberDecl.name && memberDecl.name.kind === 154 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? + var computedNameType = memberDecl.name && memberDecl.name.kind === 155 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? checkComputedPropertyName(memberDecl.name) : undefined; - if (memberDecl.kind === 281 /* PropertyAssignment */ || - memberDecl.kind === 282 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 282 /* PropertyAssignment */ || + memberDecl.kind === 283 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { - var type = memberDecl.kind === 281 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : - memberDecl.kind === 282 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : + var type = memberDecl.kind === 282 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : + memberDecl.kind === 283 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode); if (isInJavascript) { var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -55093,8 +55362,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 281 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 282 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 282 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 283 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -55118,8 +55387,9 @@ var ts; prop.type = type; prop.target = member; member = prop; + allPropertiesTable.set(prop.escapedName, prop); } - else if (memberDecl.kind === 283 /* SpreadAssignment */) { + else if (memberDecl.kind === 284 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } @@ -55135,6 +55405,16 @@ var ts; error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); return errorType; } + for (var _i = 0, _a = getPropertiesOfType(type); _i < _a.length; _i++) { + var right = _a[_i]; + var rightType = getTypeOfSymbol(right); + var left = allPropertiesTable.get(right.escapedName); + if (strictNullChecks && + left && + !maybeTypeOfKind(rightType, 98304 /* Nullable */)) { + error(left.valueDeclaration, ts.Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, ts.unescapeLeadingUnderscores(left.escapedName)); + } + } spread = getSpreadType(spread, type, node.symbol, objectFlags, inConstContext); offset = i + 1; continue; @@ -55145,7 +55425,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 163 /* GetAccessor */ || memberDecl.kind === 164 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 164 /* GetAccessor */ || memberDecl.kind === 165 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) { @@ -55170,9 +55450,9 @@ var ts; // type with those properties for which the binding pattern specifies a default value. // If the object literal is spread into another object literal, skip this step and let the top-level object // literal handle it instead. - if (contextualTypeHasPattern && node.parent.kind !== 283 /* SpreadAssignment */) { - for (var _i = 0, _a = getPropertiesOfType(contextualType); _i < _a.length; _i++) { - var prop = _a[_i]; + if (contextualTypeHasPattern && node.parent.kind !== 284 /* SpreadAssignment */) { + for (var _b = 0, _c = getPropertiesOfType(contextualType); _b < _c.length; _b++) { + var prop = _c[_b]; if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) { if (!(prop.flags & 16777216 /* Optional */)) { error(prop.valueDeclaration || prop.bindingElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); @@ -55212,13 +55492,13 @@ var ts; } } function isValidSpreadType(type) { - if (type.flags & 63176704 /* Instantiable */) { + if (type.flags & 197394432 /* Instantiable */) { var constraint = getBaseConstraintOfType(type); if (constraint !== undefined) { return isValidSpreadType(constraint); } } - return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */) || + return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 193200128 /* InstantiableNonPrimitive */) || getFalsyFlags(type) & 117632 /* DefinitelyFalsy */ && isValidSpreadType(removeDefinitelyFalsyTypes(type)) || type.flags & 3145728 /* UnionOrIntersection */ && ts.every(type.types, isValidSpreadType)); } @@ -55312,7 +55592,7 @@ var ts; } } else { - ts.Debug.assert(attributeDecl.kind === 275 /* JsxSpreadAttribute */); + ts.Debug.assert(attributeDecl.kind === 276 /* JsxSpreadAttribute */); if (attributesTable.size > 0) { spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, /*readonly*/ false); attributesTable = ts.createSymbolTable(); @@ -55335,7 +55615,7 @@ var ts; } } // Handle children attribute - var parent = openingLikeElement.parent.kind === 266 /* JsxElement */ ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 267 /* JsxElement */ ? openingLikeElement.parent : undefined; // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); @@ -55755,7 +56035,7 @@ var ts; */ function checkPropertyAccessibility(node, isSuper, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 153 /* QualifiedName */ ? node.right : node.kind === 188 /* ImportType */ ? node : node.name; + var errorNode = node.kind === 154 /* QualifiedName */ ? node.right : node.kind === 189 /* ImportType */ ? node : node.name; if (ts.getCheckFlags(prop) & 1024 /* ContainsPrivate */) { // Synthetic property with private constituent property error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type)); @@ -55914,7 +56194,7 @@ var ts; return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right); } function isMethodAccessForCall(node) { - while (node.parent.kind === 200 /* ParenthesizedExpression */) { + while (node.parent.kind === 201 /* ParenthesizedExpression */) { node = node.parent; } return ts.isCallOrNewExpression(node.parent) && node.parent.expression === node; @@ -56067,7 +56347,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 162 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { + if (flowContainer.kind === 163 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { assumeUninitialized = true; } } @@ -56099,8 +56379,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName); } - else if (valueDeclaration.kind === 245 /* ClassDeclaration */ && - node.parent.kind !== 169 /* TypeReference */ && + else if (valueDeclaration.kind === 246 /* ClassDeclaration */ && + node.parent.kind !== 170 /* TypeReference */ && !(valueDeclaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName); @@ -56112,22 +56392,22 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return true; - case 281 /* PropertyAssignment */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 283 /* SpreadAssignment */: - case 154 /* ComputedPropertyName */: - case 221 /* TemplateSpan */: - case 276 /* JsxExpression */: - case 273 /* JsxAttribute */: - case 274 /* JsxAttributes */: - case 275 /* JsxSpreadAttribute */: - case 268 /* JsxOpeningElement */: - case 216 /* ExpressionWithTypeArguments */: - case 279 /* HeritageClause */: + case 282 /* PropertyAssignment */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 284 /* SpreadAssignment */: + case 155 /* ComputedPropertyName */: + case 222 /* TemplateSpan */: + case 277 /* JsxExpression */: + case 274 /* JsxAttribute */: + case 275 /* JsxAttributes */: + case 276 /* JsxSpreadAttribute */: + case 269 /* JsxOpeningElement */: + case 217 /* ExpressionWithTypeArguments */: + case 280 /* HeritageClause */: return false; default: return ts.isExpressionNode(node) ? false : "quit"; @@ -56277,7 +56557,19 @@ var ts; return ts.getSpellingSuggestion(name, symbols, getCandidateName); function getCandidateName(candidate) { var candidateName = ts.symbolName(candidate); - return !ts.startsWith(candidateName, "\"") && candidate.flags & meaning ? candidateName : undefined; + if (ts.startsWith(candidateName, "\"")) { + return undefined; + } + if (candidate.flags & meaning) { + return candidateName; + } + if (candidate.flags & 2097152 /* Alias */) { + var alias = tryResolveAlias(candidate); + if (alias && alias.flags & meaning) { + return candidateName; + } + } + return undefined; } } function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isThisAccess) { @@ -56290,7 +56582,7 @@ var ts; if (!hasPrivateModifier && !hasPrivateIdentifier) { return; } - if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */))) { + if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */)) { return; } if (isThisAccess) { @@ -56304,16 +56596,16 @@ var ts; } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return isValidPropertyAccessWithType(node, node.expression.kind === 102 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression))); - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getWidenedType(checkExpression(node.left))); - case 188 /* ImportType */: + case 189 /* ImportType */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getTypeFromTypeNode(node)); } } function isValidPropertyAccessForCompletions(node, type, property) { - return isValidPropertyAccessWithType(node, node.kind === 194 /* PropertyAccessExpression */ && node.expression.kind === 102 /* SuperKeyword */, property.escapedName, type); + return isValidPropertyAccessWithType(node, node.kind === 195 /* PropertyAccessExpression */ && node.expression.kind === 102 /* SuperKeyword */, property.escapedName, type); // Previously we validated the 'this' type of methods but this adversely affected performance. See #31377 for more context. } function isValidPropertyAccessWithType(node, isSuper, propertyName, type) { @@ -56336,7 +56628,7 @@ var ts; */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 243 /* VariableDeclarationList */) { + if (initializer.kind === 244 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -56365,7 +56657,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 231 /* ForInStatement */ && + if (node.kind === 232 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -56449,13 +56741,13 @@ var ts; // This gets us diagnostics for the type arguments and marks them as referenced. ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 198 /* TaggedTemplateExpression */) { + if (node.kind === 199 /* TaggedTemplateExpression */) { checkExpression(node.template); } else if (ts.isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); } - else if (node.kind !== 157 /* Decorator */) { + else if (node.kind !== 158 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -56519,7 +56811,7 @@ var ts; } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 213 /* SpreadElement */ || arg.kind === 220 /* SyntheticExpression */ && arg.isSpread); + return !!arg && (arg.kind === 214 /* SpreadElement */ || arg.kind === 221 /* SyntheticExpression */ && arg.isSpread); } function getSpreadArgumentIndex(args) { return ts.findIndex(args, isSpreadArgument); @@ -56533,9 +56825,9 @@ var ts; var callIsIncomplete = false; // In incomplete call we want to be lenient when we have too few arguments var effectiveParameterCount = getParameterCount(signature); var effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 198 /* TaggedTemplateExpression */) { + if (node.kind === 199 /* TaggedTemplateExpression */) { argCount = args.length; - if (node.template.kind === 211 /* TemplateExpression */) { + if (node.template.kind === 212 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. var lastSpan = ts.last(node.template.templateSpans); // we should always have at least one span. @@ -56550,7 +56842,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 157 /* Decorator */) { + else if (node.kind === 158 /* Decorator */) { argCount = getDecoratorArgumentCount(node, signature); } else if (ts.isJsxOpeningLikeElement(node)) { @@ -56565,7 +56857,7 @@ var ts; else { if (!node.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(node.kind === 197 /* NewExpression */); + ts.Debug.assert(node.kind === 198 /* NewExpression */); return getMinArgumentCount(signature) === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; @@ -56658,7 +56950,7 @@ var ts; // example, given a 'function wrap(cb: (x: T) => U): (x: T) => U' and a call expression // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the // return type of 'wrap'. - if (node.kind !== 157 /* Decorator */) { + if (node.kind !== 158 /* Decorator */) { var contextualType = getContextualType(node); if (contextualType) { // We clone the inference context to avoid disturbing a resolution in progress for an @@ -56701,7 +56993,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 215 /* OmittedExpression */) { + if (arg.kind !== 216 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); inferTypes(context.inferences, argType, paramType); @@ -56715,7 +57007,7 @@ var ts; } function getArrayifiedType(type) { return type.flags & 1048576 /* Union */ ? mapType(type, getArrayifiedType) : - type.flags & (1 /* Any */ | 63176704 /* Instantiable */) || isMutableArrayOrTuple(type) ? type : + type.flags & (1 /* Any */ | 197394432 /* Instantiable */) || isMutableArrayOrTuple(type) ? type : isTupleType(type) ? createTupleType(getTypeArguments(type), type.target.minLength, type.target.hasRestElement, /*readonly*/ false, type.target.associatedNames) : createArrayType(getIndexedAccessType(type, numberType)); } @@ -56725,7 +57017,7 @@ var ts; if (isSpreadArgument(arg)) { // We are inferring from a spread expression in the last argument position, i.e. both the parameter // and the argument are ...x forms. - return arg.kind === 220 /* SyntheticExpression */ ? + return arg.kind === 221 /* SyntheticExpression */ ? createArrayType(arg.type) : getArrayifiedType(checkExpressionWithContextualType(arg.expression, restType, context, 0 /* Normal */)); } @@ -56880,7 +57172,7 @@ var ts; return undefined; } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 197 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 198 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -56910,7 +57202,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 215 /* OmittedExpression */) { + if (arg.kind !== 216 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, /*inferenceContext*/ undefined, checkMode); // If one or more arguments are still excluded (as indicated by CheckMode.SkipContextSensitive), @@ -56951,7 +57243,7 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 196 /* CallExpression */) { + if (node.kind === 197 /* CallExpression */) { var callee = ts.skipOuterExpressions(node.expression); if (ts.isAccessExpression(callee)) { return callee.expression; @@ -56959,7 +57251,7 @@ var ts; } } function createSyntheticExpression(parent, type, isSpread) { - var result = ts.createNode(220 /* SyntheticExpression */, parent.pos, parent.end); + var result = ts.createNode(221 /* SyntheticExpression */, parent.pos, parent.end); result.parent = parent; result.type = type; result.isSpread = isSpread || false; @@ -56969,17 +57261,17 @@ var ts; * Returns the effective arguments for an expression that works like a function invocation. */ function getEffectiveCallArguments(node) { - if (node.kind === 198 /* TaggedTemplateExpression */) { + if (node.kind === 199 /* TaggedTemplateExpression */) { var template = node.template; var args_3 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 211 /* TemplateExpression */) { + if (template.kind === 212 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args_3.push(span.expression); }); } return args_3; } - if (node.kind === 157 /* Decorator */) { + if (node.kind === 158 /* Decorator */) { return getEffectiveDecoratorArguments(node); } if (ts.isJsxOpeningLikeElement(node)) { @@ -57009,30 +57301,30 @@ var ts; var parent = node.parent; var expr = node.expression; switch (parent.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class). return [ createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent))) ]; - case 156 /* Parameter */: + case 157 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts). var func = parent.parent; return [ - createSyntheticExpression(expr, parent.parent.kind === 162 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), + createSyntheticExpression(expr, parent.parent.kind === 163 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), createSyntheticExpression(expr, anyType), createSyntheticExpression(expr, numberType) ]; - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts). If we are emitting decorators // for ES3, we will only pass two arguments. - var hasPropDesc = parent.kind !== 159 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; + var hasPropDesc = parent.kind !== 160 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; return [ createSyntheticExpression(expr, getParentTypeOfClassElement(parent)), createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)), @@ -57046,17 +57338,17 @@ var ts; */ function getDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return 1; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return 2; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // For ES3 or decorators with only two parameters we supply only two arguments return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3; - case 156 /* Parameter */: + case 157 /* Parameter */: return 3; default: return ts.Debug.fail(); @@ -57181,8 +57473,8 @@ var ts; return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { - var isTaggedTemplate = node.kind === 198 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 157 /* Decorator */; + var isTaggedTemplate = node.kind === 199 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 158 /* Decorator */; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var reportErrors = !candidatesOutArray; var typeArguments; @@ -57244,7 +57536,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 196 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 197 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -57760,7 +58052,7 @@ var ts; var declaration = signature.declaration; var modifiers = ts.getSelectedModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */); // (1) Public constructors and (2) constructor functions are always accessible. - if (!modifiers || declaration.kind !== 162 /* Constructor */) { + if (!modifiers || declaration.kind !== 163 /* Constructor */) { return true; } var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -57891,16 +58183,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 156 /* Parameter */: + case 157 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return ts.Debug.fail(); @@ -57991,16 +58283,16 @@ var ts; } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 196 /* CallExpression */: + case 197 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray, checkMode); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray, checkMode); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 157 /* Decorator */: + case 158 /* Decorator */: return resolveDecorator(node, candidatesOutArray, checkMode); - case 268 /* JsxOpeningElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); } throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -58089,7 +58381,7 @@ var ts; return false; } var parent = node.parent; - while (parent && parent.kind === 194 /* PropertyAccessExpression */) { + while (parent && parent.kind === 195 /* PropertyAccessExpression */) { parent = parent.parent; } if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -58114,12 +58406,12 @@ var ts; if (node.expression.kind === 102 /* SuperKeyword */) { return voidType; } - if (node.kind === 197 /* NewExpression */) { + if (node.kind === 198 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 162 /* Constructor */ && - declaration.kind !== 166 /* ConstructSignature */ && - declaration.kind !== 171 /* ConstructorType */ && + declaration.kind !== 163 /* Constructor */ && + declaration.kind !== 167 /* ConstructSignature */ && + declaration.kind !== 172 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any @@ -58139,7 +58431,7 @@ var ts; if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) { return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent)); } - if (node.kind === 196 /* CallExpression */ && node.parent.kind === 226 /* ExpressionStatement */ && + if (node.kind === 197 /* CallExpression */ && node.parent.kind === 227 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { if (!ts.isDottedName(node.expression)) { error(node.expression, ts.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); @@ -58246,9 +58538,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 244 /* FunctionDeclaration */ + ? 245 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 242 /* VariableDeclaration */ + ? 243 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -58276,18 +58568,18 @@ var ts; case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return true; - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return isValidConstAssertionArgument(node.expression); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: var op = node.operator; var arg = node.operand; return op === 40 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) || op === 39 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */; - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: var expr = node.expression; if (ts.isIdentifier(expr)) { var symbol = getSymbolAtLocation(expr); @@ -58337,7 +58629,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return errorType; } - else if (container.kind === 162 /* Constructor */) { + else if (container.kind === 163 /* Constructor */) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -58430,7 +58722,7 @@ var ts; } return length; } - function getMinArgumentCount(signature) { + function getMinArgumentCount(signature, strongArityForUntypedJS) { if (signatureHasRestParameter(signature)) { var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); if (isTupleType(restType)) { @@ -58440,6 +58732,9 @@ var ts; } } } + if (!strongArityForUntypedJS && signature.flags & 16 /* IsUntypedSignatureInJSFile */) { + return 0; + } return signature.minArgumentCount; } function hasEffectiveRestParameter(signature) { @@ -58601,7 +58896,7 @@ var ts; var yieldType; var nextType; var fallbackReturnType = voidType; - if (func.body.kind !== 223 /* Block */) { // Async or normal arrow function + if (func.body.kind !== 224 /* Block */) { // Async or normal arrow function returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */); if (isAsync) { // From within an async function you can return either a non-promise value or a promise. Any @@ -58788,10 +59083,9 @@ var ts; return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node)); } function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 204 /* TypeOfExpression */) { + if (node.expression.kind === 205 /* TypeOfExpression */) { var operandType = getTypeOfExpression(node.expression.expression); - // This cast is safe because the switch is possibly exhaustive and does not contain a default case, so there can be no undefined. - var witnesses = getSwitchClauseTypeOfWitnesses(node); + var witnesses = getSwitchClauseTypeOfWitnesses(node, /*retainDefault*/ false); // notEqualFacts states that the type of the switched value is not equal to every type in the switch. var notEqualFacts_1 = getFactsFromTypeofSwitch(0, 0, witnesses, /*hasDefault*/ true); var type_3 = getBaseConstraintOfType(operandType) || operandType; @@ -58848,11 +59142,11 @@ var ts; } function mayReturnNever(func) { switch (func.kind) { - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return true; - case 161 /* MethodDeclaration */: - return func.parent.kind === 193 /* ObjectLiteralExpression */; + case 162 /* MethodDeclaration */: + return func.parent.kind === 194 /* ObjectLiteralExpression */; default: return false; } @@ -58878,7 +59172,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (func.kind === 160 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 223 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 161 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 224 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */; @@ -58911,7 +59205,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); checkNodeDeferred(node); // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode && checkMode & 4 /* SkipContextSensitive */ && isContextSensitive(node)) { @@ -58935,7 +59229,7 @@ var ts; } // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 201 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 202 /* FunctionExpression */) { checkGrammarForGenerator(node); } contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -58988,7 +59282,7 @@ var ts; type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnType = getReturnTypeFromAnnotation(node); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); @@ -59001,7 +59295,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 223 /* Block */) { + if (node.body.kind === 224 /* Block */) { checkSourceElement(node.body); } else { @@ -59091,7 +59385,7 @@ var ts; expr.expression.kind === 104 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var ctor = ts.getContainingFunction(expr); - if (!(ctor && ctor.kind === 162 /* Constructor */)) { + if (!(ctor && ctor.kind === 163 /* Constructor */)) { return true; } if (symbol.valueDeclaration) { @@ -59116,7 +59410,7 @@ var ts; var symbol_2 = getNodeLinks(node).resolvedSymbol; if (symbol_2.flags & 2097152 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol_2); - return !!declaration && declaration.kind === 256 /* NamespaceImport */; + return !!declaration && declaration.kind === 257 /* NamespaceImport */; } } } @@ -59142,7 +59436,7 @@ var ts; error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); return booleanType; } - if (expr.kind === 194 /* PropertyAccessExpression */ && ts.isPrivateIdentifier(expr.name)) { + if (expr.kind === 195 /* PropertyAccessExpression */ && ts.isPrivateIdentifier(expr.name)) { error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier); } var links = getNodeLinks(expr); @@ -59192,7 +59486,7 @@ var ts; var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos); var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); var func = ts.getContainingFunction(node); - if (func && func.kind !== 162 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { + if (func && func.kind !== 163 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); } @@ -59364,7 +59658,7 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 296 /* NumberLike */ | 12288 /* ESSymbolLike */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { + if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 193200128 /* InstantiableNonPrimitive */)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -59384,7 +59678,7 @@ var ts; if (rightIsThis === void 0) { rightIsThis = false; } var properties = node.properties; var property = properties[propertyIndex]; - if (property.kind === 281 /* PropertyAssignment */ || property.kind === 282 /* ShorthandPropertyAssignment */) { + if (property.kind === 282 /* PropertyAssignment */ || property.kind === 283 /* ShorthandPropertyAssignment */) { var name = property.name; var exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -59397,9 +59691,9 @@ var ts; } var elementType = getIndexedAccessType(objectLiteralType, exprType, name); var type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 282 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); + return checkDestructuringAssignment(property.kind === 283 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); } - else if (property.kind === 283 /* SpreadAssignment */) { + else if (property.kind === 284 /* SpreadAssignment */) { if (propertyIndex < properties.length - 1) { error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } @@ -59442,8 +59736,8 @@ var ts; function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 215 /* OmittedExpression */) { - if (element.kind !== 213 /* SpreadElement */) { + if (element.kind !== 216 /* OmittedExpression */) { + if (element.kind !== 214 /* SpreadElement */) { var indexType = getLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { // We create a synthetic expression so that getIndexedAccessType doesn't get confused @@ -59461,7 +59755,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 209 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { + if (restExpression.kind === 210 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -59477,7 +59771,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { var target; - if (exprOrAssignment.kind === 282 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 283 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -59493,24 +59787,24 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 209 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { + if (target.kind === 210 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 193 /* ObjectLiteralExpression */) { + if (target.kind === 194 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 192 /* ArrayLiteralExpression */) { + if (target.kind === 193 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 283 /* SpreadAssignment */ ? + var error = target.parent.kind === 284 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; - var optionalError = target.parent.kind === 283 /* SpreadAssignment */ ? + var optionalError = target.parent.kind === 284 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; if (checkReferenceExpression(target, error, optionalError)) { @@ -59535,36 +59829,36 @@ var ts; case 75 /* Identifier */: case 10 /* StringLiteral */: case 13 /* RegularExpressionLiteral */: - case 198 /* TaggedTemplateExpression */: - case 211 /* TemplateExpression */: + case 199 /* TaggedTemplateExpression */: + case 212 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: case 100 /* NullKeyword */: - case 146 /* UndefinedKeyword */: - case 201 /* FunctionExpression */: - case 214 /* ClassExpression */: - case 202 /* ArrowFunction */: - case 192 /* ArrayLiteralExpression */: - case 193 /* ObjectLiteralExpression */: - case 204 /* TypeOfExpression */: - case 218 /* NonNullExpression */: - case 267 /* JsxSelfClosingElement */: - case 266 /* JsxElement */: + case 147 /* UndefinedKeyword */: + case 202 /* FunctionExpression */: + case 215 /* ClassExpression */: + case 203 /* ArrowFunction */: + case 193 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 205 /* TypeOfExpression */: + case 219 /* NonNullExpression */: + case 268 /* JsxSelfClosingElement */: + case 267 /* JsxElement */: return true; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -59576,9 +59870,9 @@ var ts; } return false; // Some forms listed here for clarity - case 205 /* VoidExpression */: // Explicit opt-out - case 199 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 217 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 206 /* VoidExpression */: // Explicit opt-out + case 200 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 218 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -59610,7 +59904,7 @@ var ts; } checkGrammarNullishCoalesceWithLogicalExpression(node); var operator = node.operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (node.left.kind === 193 /* ObjectLiteralExpression */ || node.left.kind === 192 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (node.left.kind === 194 /* ObjectLiteralExpression */ || node.left.kind === 193 /* ArrayLiteralExpression */)) { finishInvocation(checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 104 /* ThisKeyword */)); break; } @@ -59677,7 +59971,7 @@ var ts; // expression-wide checks and does not use a work stack to fold nested binary expressions into the same callstack frame function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (left.kind === 193 /* ObjectLiteralExpression */ || left.kind === 192 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (left.kind === 194 /* ObjectLiteralExpression */ || left.kind === 193 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 104 /* ThisKeyword */); } var leftType; @@ -60082,7 +60376,7 @@ var ts; return stringType; } function getContextNode(node) { - if (node.kind === 274 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { + if (node.kind === 275 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes) } return node; @@ -60131,13 +60425,13 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 199 /* TypeAssertionExpression */ || node.kind === 217 /* AsExpression */; + return node.kind === 200 /* TypeAssertionExpression */ || node.kind === 218 /* AsExpression */; } function checkDeclarationInitializer(declaration, contextualType) { var initializer = ts.getEffectiveInitializer(declaration); var type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, 0 /* Normal */) : checkExpressionCached(initializer)); - return ts.isParameter(declaration) && declaration.name.kind === 190 /* ArrayBindingPattern */ && + return ts.isParameter(declaration) && declaration.name.kind === 191 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type; } @@ -60147,7 +60441,7 @@ var ts; var elementTypes = arity ? getTypeArguments(type).slice() : []; for (var i = arity; i < patternElements.length; i++) { var e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === 191 /* BindingElement */ && e.dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === 192 /* BindingElement */ && e.dotDotDotToken)) { elementTypes.push(!ts.isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, /*includePatternInType*/ false, /*reportErrors*/ false) : anyType); if (!ts.isOmittedExpression(e) && !hasDefaultValue(e)) { reportImplicitAny(e, anyType); @@ -60176,7 +60470,7 @@ var ts; var types = contextualType.types; return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); }); } - if (contextualType.flags & 58982400 /* InstantiableNonPrimitive */) { + if (contextualType.flags & 193200128 /* InstantiableNonPrimitive */) { // If the contextual type is a type variable constrained to a primitive type, consider // this a literal context for literals of that primitive type. For example, given a // type parameter 'T extends string', infer string literal types for T. @@ -60213,7 +60507,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); @@ -60224,7 +60518,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -60458,11 +60752,11 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 195 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 75 /* Identifier */ || node.kind === 153 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || - (node.parent.kind === 172 /* TypeQuery */ && node.parent.exprName === node)) || - (node.parent.kind === 263 /* ExportSpecifier */); // We allow reexporting const enums + var ok = (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 196 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 75 /* Identifier */ || node.kind === 154 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 173 /* TypeQuery */ && node.parent.exprName === node)) || + (node.parent.kind === 264 /* ExportSpecifier */); // We allow reexporting const enums if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } @@ -60487,9 +60781,9 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 214 /* ClassExpression */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 215 /* ClassExpression */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -60515,78 +60809,78 @@ var ts; return trueType; case 91 /* FalseKeyword */: return falseType; - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: return checkTemplateExpression(node); case 13 /* RegularExpressionLiteral */: return globalRegExpType; - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode, forceTuple); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return checkQualifiedName(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (node.expression.kind === 96 /* ImportKeyword */) { return checkImportCallExpression(node); } // falls through - case 197 /* NewExpression */: + case 198 /* NewExpression */: return checkCallExpression(node, checkMode); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return checkClassExpression(node); - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: return checkAssertion(node); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: return checkNonNullAssertion(node); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return checkMetaProperty(node); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return checkDeleteExpression(node); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return checkVoidExpression(node); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return checkAwaitExpression(node); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 215 /* OmittedExpression */: + case 216 /* OmittedExpression */: return undefinedWideningType; - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return checkYieldExpression(node); - case 220 /* SyntheticExpression */: + case 221 /* SyntheticExpression */: return node.type; - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 266 /* JsxElement */: + case 267 /* JsxElement */: return checkJsxElement(node, checkMode); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node, checkMode); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return checkJsxFragment(node); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 268 /* JsxOpeningElement */: + case 269 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -60623,7 +60917,7 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { - if (!(func.kind === 162 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 163 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -60634,12 +60928,15 @@ var ts; if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 162 /* Constructor */ || func.kind === 166 /* ConstructSignature */ || func.kind === 171 /* ConstructorType */) { + if (func.kind === 163 /* Constructor */ || func.kind === 167 /* ConstructSignature */ || func.kind === 172 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 202 /* ArrowFunction */) { + if (func.kind === 203 /* ArrowFunction */) { error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } + if (func.kind === 164 /* GetAccessor */ || func.kind === 165 /* SetAccessor */) { + error(node, ts.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); + } } // Only check rest parameter type if it's not a binding pattern. Since binding patterns are // not allowed in a rest parameter, we already have an error from checkGrammarParameterList. @@ -60695,13 +60992,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 202 /* ArrowFunction */: - case 165 /* CallSignature */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 170 /* FunctionType */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 203 /* ArrowFunction */: + case 166 /* CallSignature */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 171 /* FunctionType */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: var parent = node.parent; if (node === parent.type) { return parent; @@ -60719,7 +61016,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 190 /* ArrayBindingPattern */ || name.kind === 189 /* ObjectBindingPattern */) { + else if (name.kind === 191 /* ArrayBindingPattern */ || name.kind === 190 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -60728,13 +61025,13 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 167 /* IndexSignature */) { + if (node.kind === 168 /* IndexSignature */) { checkGrammarIndexSignature(node); } // TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled - else if (node.kind === 170 /* FunctionType */ || node.kind === 244 /* FunctionDeclaration */ || node.kind === 171 /* ConstructorType */ || - node.kind === 165 /* CallSignature */ || node.kind === 162 /* Constructor */ || - node.kind === 166 /* ConstructSignature */) { + else if (node.kind === 171 /* FunctionType */ || node.kind === 245 /* FunctionDeclaration */ || node.kind === 172 /* ConstructorType */ || + node.kind === 166 /* CallSignature */ || node.kind === 163 /* Constructor */ || + node.kind === 167 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -60764,10 +61061,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 165 /* CallSignature */: + case 166 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -60797,7 +61094,7 @@ var ts; checkAsyncFunctionReturnType(node, returnTypeNode); } } - if (node.kind !== 167 /* IndexSignature */ && node.kind !== 300 /* JSDocFunctionType */) { + if (node.kind !== 168 /* IndexSignature */ && node.kind !== 301 /* JSDocFunctionType */) { registerForUnusedIdentifiersCheck(node); } } @@ -60809,7 +61106,7 @@ var ts; var privateIdentifiers = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 162 /* Constructor */) { + if (member.kind === 163 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param, member) && !ts.isBindingPattern(param.name)) { @@ -60829,16 +61126,16 @@ var ts; var memberName = name && ts.getPropertyNameForPropertyNameNode(name); if (memberName) { switch (member.kind) { - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: addName(names, name, memberName, 1 /* GetAccessor */); break; - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: addName(names, name, memberName, 2 /* SetAccessor */); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: addName(names, name, memberName, 3 /* GetOrSetAccessor */); break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: addName(names, name, memberName, 8 /* Method */); break; } @@ -60901,7 +61198,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 158 /* PropertySignature */) { + if (member.kind === 159 /* PropertySignature */) { var memberName = void 0; var name = member.name; switch (name.kind) { @@ -60926,7 +61223,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 246 /* InterfaceDeclaration */) { + if (node.kind === 247 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -60946,7 +61243,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 143 /* StringKeyword */: + case 144 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -60954,7 +61251,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 140 /* NumberKeyword */: + case 141 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -60996,7 +61293,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 161 /* MethodDeclaration */ && node.body) { + if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 162 /* MethodDeclaration */ && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -61024,7 +61321,7 @@ var ts; if (ts.isPrivateIdentifierPropertyDeclaration(n)) { return true; } - return n.kind === 159 /* PropertyDeclaration */ && + return n.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(n, 32 /* Static */) && !!n.initializer; } @@ -61054,7 +61351,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_3 = statements; _i < statements_3.length; _i++) { var statement = statements_3[_i]; - if (statement.kind === 226 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 227 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -61079,7 +61376,7 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 163 /* GetAccessor */) { + if (node.kind === 164 /* GetAccessor */) { if (!(node.flags & 8388608 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 256 /* HasImplicitReturn */)) { if (!(node.flags & 512 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -61089,7 +61386,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (ts.isPrivateIdentifier(node.name)) { @@ -61098,7 +61395,7 @@ var ts; if (!hasNonBindableDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; + var otherKind = node.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getModifierFlags(node); @@ -61116,7 +61413,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 163 /* GetAccessor */) { + if (node.kind === 164 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -61164,7 +61461,7 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 169 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 170 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } ts.forEach(node.typeArguments, checkSourceElement); @@ -61209,7 +61506,7 @@ var ts; var seenOptionalElement = false; for (var i = 0; i < elementTypes.length; i++) { var e = elementTypes[i]; - if (e.kind === 177 /* RestType */) { + if (e.kind === 178 /* RestType */) { if (i !== elementTypes.length - 1) { grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); break; @@ -61218,7 +61515,7 @@ var ts; error(e, ts.Diagnostics.A_rest_element_type_must_be_an_array_type); } } - else if (e.kind === 176 /* OptionalType */) { + else if (e.kind === 177 /* OptionalType */) { seenOptionalElement = true; } else if (seenOptionalElement) { @@ -61239,7 +61536,7 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType, /*stringsOnly*/ false))) { - if (accessNode.kind === 195 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && + if (accessNode.kind === 196 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } @@ -61290,7 +61587,7 @@ var ts; ts.forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 180 /* ConditionalType */ && n.parent.extendsType === n; })) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 181 /* ConditionalType */ && n.parent.extendsType === n; })) { grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); @@ -61307,9 +61604,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 246 /* InterfaceDeclaration */ && - n.parent.kind !== 245 /* ClassDeclaration */ && - n.parent.kind !== 214 /* ClassExpression */ && + if (n.parent.kind !== 247 /* InterfaceDeclaration */ && + n.parent.kind !== 246 /* ClassDeclaration */ && + n.parent.kind !== 215 /* ClassExpression */ && n.flags & 8388608 /* Ambient */) { if (!(flags & 2 /* Ambient */) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) { // It is nested in an ambient context, which means it is automatically exported @@ -61405,7 +61702,7 @@ var ts; // Both are literal property names that are the same. ts.isPropertyNameLiteral(node.name) && ts.isPropertyNameLiteral(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 161 /* MethodDeclaration */ || node.kind === 160 /* MethodSignature */) && + var reportError = (node.kind === 162 /* MethodDeclaration */ || node.kind === 161 /* MethodSignature */) && ts.hasModifier(node, 32 /* Static */) !== ts.hasModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -61445,7 +61742,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 8388608 /* Ambient */; - var inAmbientContextOrInterface = node.parent.kind === 246 /* InterfaceDeclaration */ || node.parent.kind === 173 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 247 /* InterfaceDeclaration */ || node.parent.kind === 174 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -61456,10 +61753,10 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if ((node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */) && !inAmbientContext) { + if ((node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */) && !inAmbientContext) { hasNonAmbientClass = true; } - if (node.kind === 244 /* FunctionDeclaration */ || node.kind === 161 /* MethodDeclaration */ || node.kind === 160 /* MethodSignature */ || node.kind === 162 /* Constructor */) { + if (node.kind === 245 /* FunctionDeclaration */ || node.kind === 162 /* MethodDeclaration */ || node.kind === 161 /* MethodSignature */ || node.kind === 163 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -61590,25 +61887,25 @@ var ts; function getDeclarationSpaces(decl) { var d = decl; switch (d.kind) { - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: // A jsdoc typedef and callback are, by definition, type aliases. // falls through - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: return 2 /* ExportType */; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 284 /* EnumMember */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 285 /* EnumMember */: return 2 /* ExportType */ | 1 /* ExportValue */; - case 290 /* SourceFile */: + case 291 /* SourceFile */: return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: // Export assigned entity name expressions act as aliases and should fall through, otherwise they export values if (!ts.isEntityNameExpression(d.expression)) { return 1 /* ExportValue */; @@ -61616,17 +61913,17 @@ var ts; d = d.expression; // The below options all declare an Alias, which is allowed to merge with other values within the importing module. // falls through - case 253 /* ImportEqualsDeclaration */: - case 256 /* NamespaceImport */: - case 255 /* ImportClause */: + case 254 /* ImportEqualsDeclaration */: + case 257 /* NamespaceImport */: + case 256 /* ImportClause */: var result_8 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_8 |= getDeclarationSpaces(d); }); return result_8; - case 242 /* VariableDeclaration */: - case 191 /* BindingElement */: - case 244 /* FunctionDeclaration */: - case 258 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 + case 243 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 245 /* FunctionDeclaration */: + case 259 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 case 75 /* Identifier */: // https://github.com/microsoft/TypeScript/issues/36098 // Identifiers are used as declarations of assignment declarations whose parents may be // SyntaxKind.CallExpression - `Object.defineProperty(thing, "aField", {value: 42});` @@ -61649,9 +61946,9 @@ var ts; * @param type The type of the promise. * @remarks The "promised type" of a type is the type of the "value" parameter of the "onfulfilled" callback. */ - function getPromisedTypeOfPromise(promise, errorNode) { + function getPromisedTypeOfPromise(type, errorNode) { // - // { // promise + // { // type // then( // thenFunction // onfulfilled: ( // onfulfilledParameterType // value: T // valueParameterType @@ -61659,17 +61956,18 @@ var ts; // ): any; // } // - if (isTypeAny(promise)) { + if (isTypeAny(type)) { return undefined; } - var typeAsPromise = promise; + var typeAsPromise = type; if (typeAsPromise.promisedTypeOfPromise) { return typeAsPromise.promisedTypeOfPromise; } - if (isReferenceToType(promise, getGlobalPromiseType(/*reportErrors*/ false))) { - return typeAsPromise.promisedTypeOfPromise = getTypeArguments(promise)[0]; + if (isReferenceToType(type, getGlobalPromiseType(/*reportErrors*/ false)) || + isReferenceToType(type, getGlobalPromiseLikeType(/*reportErrors*/ false))) { + return typeAsPromise.promisedTypeOfPromise = getAwaitedType(getTypeArguments(type)[0], errorNode); } - var thenFunction = getTypeOfPropertyOfType(promise, "then"); // TODO: GH#18217 + var thenFunction = getTypeOfPropertyOfType(type, "then"); // TODO: GH#18217 if (isTypeAny(thenFunction)) { return undefined; } @@ -61704,28 +62002,127 @@ var ts; var awaitedType = getAwaitedType(type, errorNode, diagnosticMessage, arg0); return awaitedType || errorType; } + /** + * Gets or creates an `awaited T` type for a generic type. + * + * The "awaited type" of a generic type cannot be determined until it is instantiated. As + * a result, an `AwaitedType` for the generic type is created that can be instantiated + * or related later. + */ + function getAwaitedTypeForGenericType(type) { + var typeId = "" + type.id; + var awaitedType = awaitedTypes.get(typeId); + if (!awaitedType) { + awaitedType = createType(134217728 /* Awaited */); + awaitedType.awaitedType = type; + awaitedTypes.set(typeId, awaitedType); + } + return awaitedType; + } + function unwrapAwaitedType(type) { + return type.flags & 1048576 /* Union */ ? + mapType(type, unwrapAwaitedType) : + type.flags & 134217728 /* Awaited */ ? type.awaitedType : type; + } + /** + * Determines whether a type has a callable `then` member. + */ + function isThenableType(type) { + var thenFunction = getTypeOfPropertyOfType(type, "then"); + return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, 2097152 /* NEUndefinedOrNull */), 0 /* Call */).length > 0; + } + /** + * Determines whether a type is a generic type whose base constraint could possibly resolve to a different + * type when awaited. A type is a generic "thenable" type when all of the following conditions are met: + * - The type is a generic object type, + * - AND one of the following conditions are met + * - The type has no base constraint, + * - OR The base constraint of the type is `any`, `unknown`, `object`, or the empty object `{}`, + * - OR The base constraint has a callable `then` member. + */ + function isGenericAwaitableType(type) { + if (isGenericObjectType(type)) { + if (type.flags & 2097152 /* Intersection */) { + return ts.some(type.types, isGenericAwaitableType); + } + var baseConstraint = getBaseConstraintOfType(type); + return !baseConstraint || + !!(baseConstraint.flags & (3 /* AnyOrUnknown */ | 67108864 /* NonPrimitive */)) || + baseConstraint === emptyObjectType || + baseConstraint === emptyGenericType || + isThenableType(baseConstraint); + } + return false; + } + /** + * Gets the "awaited type" of a type. + * + * The "awaited type" of an expression is its "promised type" if the expression is a + * Promise-like type; otherwise, it is the type of the expression. If the "promised + * type" is itself a Promise-like, the "promised type" is recursively unwrapped until a + * non-promise type is found. + * + * This is used to reflect the runtime behavior of the `await` keyword and the `awaited T` + * type. + */ function getAwaitedType(type, errorNode, diagnosticMessage, arg0) { + if (isTypeAny(type)) { + return type; + } + // If the type is already an awaited type, return it. + // + // For example: + // + // awaited T -> awaited T + // + if (type.flags & 134217728 /* Awaited */) { + return type; + } var typeAsAwaitable = type; if (typeAsAwaitable.awaitedTypeOfType) { return typeAsAwaitable.awaitedTypeOfType; } - if (isTypeAny(type)) { - return typeAsAwaitable.awaitedTypeOfType = type; + // For a union, get a union of the awaited types of each constituent. + // + // For example: + // + // awaited (number | string) -> number | string + // awaited (number | Promise) -> number | string + // awaited (T | string) -> awaited T | string + // awaited (T | Promise) -> awaited T | string + // awaited (T | Promise) -> awaited T + // awaited (T | U) -> awaited T | awaited U + // + return typeAsAwaitable.awaitedTypeOfType = + mapType(type, errorNode ? function (constituentType) { return getAwaitedTypeWorker(constituentType, errorNode, diagnosticMessage, arg0); } : getAwaitedTypeWorker); + } + function getAwaitedTypeWorker(type, errorNode, diagnosticMessage, arg0) { + // If the type is already an awaited type, return it. + // + // For example: + // + // awaited T -> awaited T + // + if (type.flags & 134217728 /* Awaited */) { + return type; } - if (type.flags & 1048576 /* Union */) { - var types = void 0; - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var constituentType = _a[_i]; - types = ts.append(types, getAwaitedType(constituentType, errorNode, diagnosticMessage, arg0)); - } - if (!types) { - return undefined; - } - return typeAsAwaitable.awaitedTypeOfType = getUnionType(types); + // We cannot resolve the awaited type for a type variable until it is instantiated. As + // such, we create an `awaited T` type that can either be instantiated or related later. + // + // For example: + // + // T -> awaited T + // + if (isGenericAwaitableType(type)) { + return getAwaitedTypeForGenericType(type); + } + var typeAsAwaitable = type; + if (typeAsAwaitable.awaitedTypeOfType) { + return typeAsAwaitable.awaitedTypeOfType; } var promisedType = getPromisedTypeOfPromise(type); if (promisedType) { - if (type.id === promisedType.id || awaitedTypeStack.indexOf(promisedType.id) >= 0) { + if (type.id === promisedType.id || awaitedTypeStack.lastIndexOf(promisedType.id) >= 0) { // Verify that we don't have a bad actor in the form of a promise whose // promised type is the same as the promise type, or a mutually recursive // promise. If so, we return undefined as we cannot guess the shape. If this @@ -61739,6 +62136,7 @@ var ts; // onfulfilled: (value: BadPromise) => any, // onrejected: (error: any) => any): BadPromise; // } + // // The above interface will pass the PromiseLike check, and return a // promised type of `BadPromise`. Since this is a self reference, we // don't want to keep recursing ad infinitum. @@ -61775,8 +62173,8 @@ var ts; } // The type was not a promise, so it could not be unwrapped any further. // As long as the type does not have a callable "then" property, it is - // safe to return the type; otherwise, an error will be reported in - // the call to getNonThenableType and we will return undefined. + // safe to return the type; otherwise, an error is reported and we return + // undefined. // // An example of a non-promise "thenable" might be: // @@ -61788,8 +62186,7 @@ var ts; // of a runtime problem. If the user wants to return this value from an async // function, they would need to wrap it in some other value. If they want it to // be treated as a promise, they can cast to . - var thenFunction = getTypeOfPropertyOfType(type, "then"); - if (thenFunction && getSignaturesOfType(thenFunction, 0 /* Call */).length > 0) { + if (isThenableType(type)) { if (errorNode) { if (!diagnosticMessage) return ts.Debug.fail(); @@ -61902,24 +62299,24 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 156 /* Parameter */: + case 157 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -61966,14 +62363,14 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 179 /* IntersectionType */: - case 178 /* UnionType */: + case 180 /* IntersectionType */: + case 179 /* UnionType */: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return getEntityNameForDecoratorMetadata(node.type); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return node.typeName; } } @@ -61982,13 +62379,13 @@ var ts; var commonEntityName; for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { var typeNode = types_19[_i]; - while (typeNode.kind === 182 /* ParenthesizedType */) { + while (typeNode.kind === 183 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 137 /* NeverKeyword */) { + if (typeNode.kind === 138 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 146 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 147 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -62034,14 +62431,14 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 156 /* Parameter */) { + if (node.kind === 157 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -62050,23 +62447,23 @@ var ts; } } break; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - var otherKind = node.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + var otherKind = node.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 156 /* Parameter */: + case 157 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -62129,7 +62526,7 @@ var ts; else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && node.typeExpression && node.typeExpression.type && !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 153 /* QualifiedName */ ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 154 /* QualifiedName */ ? node.name.right : node.name)); } } } @@ -62170,7 +62567,7 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return node.name; default: return undefined; @@ -62183,7 +62580,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 155 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -62212,7 +62609,7 @@ var ts; } } } - var body = node.kind === 160 /* MethodSignature */ ? undefined : node.body; + var body = node.kind === 161 /* MethodSignature */ ? undefined : node.body; checkSourceElement(body); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); if (produceDiagnostics && !ts.getEffectiveReturnTypeNode(node)) { @@ -62254,42 +62651,42 @@ var ts; for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) { var node = potentiallyUnusedIdentifiers_1[_i]; switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 290 /* SourceFile */: - case 249 /* ModuleDeclaration */: - case 223 /* Block */: - case 251 /* CaseBlock */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 291 /* SourceFile */: + case 250 /* ModuleDeclaration */: + case 224 /* Block */: + case 252 /* CaseBlock */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 162 /* Constructor */: - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 163 /* Constructor */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 247 /* TypeAliasDeclaration */: - case 246 /* InterfaceDeclaration */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 248 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; - case 181 /* InferType */: + case 182 /* InferType */: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -62309,11 +62706,11 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 161 /* MethodDeclaration */: - case 159 /* PropertyDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - if (member.kind === 164 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + case 162 /* MethodDeclaration */: + case 160 /* PropertyDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + if (member.kind === 165 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { // Already would have reported an error on the getter. break; } @@ -62324,7 +62721,7 @@ var ts; addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); } break; - case 162 /* Constructor */: + case 163 /* Constructor */: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { @@ -62332,8 +62729,8 @@ var ts; } } break; - case 167 /* IndexSignature */: - case 222 /* SemicolonClassElement */: + case 168 /* IndexSignature */: + case 223 /* SemicolonClassElement */: // Can't be private break; default: @@ -62360,7 +62757,7 @@ var ts; continue; var name = ts.idText(typeParameter.name); var parent = typeParameter.parent; - if (parent.kind !== 181 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { + if (parent.kind !== 182 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { if (seenParentsWithEveryUnused.tryAdd(parent)) { var range = ts.isJSDocTemplateTag(parent) // Whole @template tag @@ -62443,7 +62840,7 @@ var ts; var importDecl = importClause.parent; var nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? - (importClause.namedBindings.kind === 256 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) + (importClause.namedBindings.kind === 257 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) : 0); if (nDeclarations === unuseds.length) { addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 @@ -62461,7 +62858,7 @@ var ts; var bindingPattern = _a[0], bindingElements = _a[1]; var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */; if (bindingPattern.elements.length === bindingElements.length) { - if (bindingElements.length === 1 && bindingPattern.parent.kind === 242 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 243 /* VariableDeclarationList */) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 243 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 244 /* VariableDeclarationList */) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { @@ -62482,7 +62879,7 @@ var ts; if (declarationList.declarations.length === declarations.length) { addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? ts.createDiagnosticForNode(ts.first(declarations).name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(declarations).name)) - : ts.createDiagnosticForNode(declarationList.parent.kind === 225 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); + : ts.createDiagnosticForNode(declarationList.parent.kind === 226 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); } else { for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { @@ -62496,22 +62893,22 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return ts.idText(name); - case 190 /* ArrayBindingPattern */: - case 189 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name); default: return ts.Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 255 /* ImportClause */ || node.kind === 258 /* ImportSpecifier */ || node.kind === 256 /* NamespaceImport */; + return node.kind === 256 /* ImportClause */ || node.kind === 259 /* ImportSpecifier */ || node.kind === 257 /* NamespaceImport */; } function importClauseFromImported(decl) { - return decl.kind === 255 /* ImportClause */ ? decl : decl.kind === 256 /* NamespaceImport */ ? decl.parent : decl.parent.parent; + return decl.kind === 256 /* ImportClause */ ? decl : decl.kind === 257 /* NamespaceImport */ ? decl.parent : decl.parent.parent; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 223 /* Block */) { + if (node.kind === 224 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -62541,12 +62938,12 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 159 /* PropertyDeclaration */ || - node.kind === 158 /* PropertySignature */ || - node.kind === 161 /* MethodDeclaration */ || - node.kind === 160 /* MethodSignature */ || - node.kind === 163 /* GetAccessor */ || - node.kind === 164 /* SetAccessor */) { + if (node.kind === 160 /* PropertyDeclaration */ || + node.kind === 159 /* PropertySignature */ || + node.kind === 162 /* MethodDeclaration */ || + node.kind === 161 /* MethodSignature */ || + node.kind === 164 /* GetAccessor */ || + node.kind === 165 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -62555,7 +62952,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 156 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 157 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -62612,7 +63009,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -62627,7 +63024,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { + if (parent.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -62662,7 +63059,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 242 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 243 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -62674,17 +63071,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 243 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 225 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 244 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 226 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 223 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 250 /* ModuleBlock */ || - container.kind === 249 /* ModuleDeclaration */ || - container.kind === 290 /* SourceFile */); + (container.kind === 224 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 251 /* ModuleBlock */ || + container.kind === 250 /* ModuleDeclaration */ || + container.kind === 291 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -62714,18 +63111,18 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 154 /* ComputedPropertyName */) { + if (node.name.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 191 /* BindingElement */) { - if (node.parent.kind === 189 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { + if (node.kind === 192 /* BindingElement */) { + if (node.parent.kind === 190 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 154 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 155 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access @@ -62746,19 +63143,19 @@ var ts; } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 190 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 191 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.getRootDeclaration(node).kind === 156 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 157 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { - var needCheckInitializer = node.initializer && node.parent.parent.kind !== 231 /* ForInStatement */; + var needCheckInitializer = node.initializer && node.parent.parent.kind !== 232 /* ForInStatement */; var needCheckWidenedType = node.name.elements.length === 0; if (needCheckInitializer || needCheckWidenedType) { // Don't validate for-in initializer as it is already an error @@ -62795,7 +63192,7 @@ var ts; ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) && ts.hasEntries(symbol.exports); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 231 /* ForInStatement */) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 232 /* ForInStatement */) { checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, /*headMessage*/ undefined); } } @@ -62821,10 +63218,10 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 159 /* PropertyDeclaration */ && node.kind !== 158 /* PropertySignature */) { + if (node.kind !== 160 /* PropertyDeclaration */ && node.kind !== 159 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { + if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -62836,7 +63233,7 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 159 /* PropertyDeclaration */ || nextDeclaration.kind === 158 /* PropertySignature */ + var message = nextDeclaration.kind === 160 /* PropertyDeclaration */ || nextDeclaration.kind === 159 /* PropertySignature */ ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; var declName = ts.declarationNameToString(nextDeclarationName); @@ -62846,8 +63243,8 @@ var ts; } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 156 /* Parameter */ && right.kind === 242 /* VariableDeclaration */) || - (left.kind === 242 /* VariableDeclaration */ && right.kind === 156 /* Parameter */)) { + if ((left.kind === 157 /* Parameter */ && right.kind === 243 /* VariableDeclaration */) || + (left.kind === 243 /* VariableDeclaration */ && right.kind === 157 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -62887,7 +63284,7 @@ var ts; var type = checkTruthinessExpression(node.expression); checkTestingKnownTruthyCallableType(node.expression, node.thenStatement, type); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 224 /* EmptyStatement */) { + if (node.thenStatement.kind === 225 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -62958,12 +63355,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 243 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 244 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 243 /* VariableDeclarationList */) { + if (node.initializer.kind === 244 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -62997,14 +63394,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 243 /* VariableDeclarationList */) { + if (node.initializer.kind === 244 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier); // There may be a destructuring assignment on the left side - if (varExpr.kind === 192 /* ArrayLiteralExpression */ || varExpr.kind === 193 /* ObjectLiteralExpression */) { + if (varExpr.kind === 193 /* ArrayLiteralExpression */ || varExpr.kind === 194 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -63036,7 +63433,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 243 /* VariableDeclarationList */) { + if (node.initializer.kind === 244 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -63050,7 +63447,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 192 /* ArrayLiteralExpression */ || varExpr.kind === 193 /* ObjectLiteralExpression */) { + if (varExpr.kind === 193 /* ArrayLiteralExpression */ || varExpr.kind === 194 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -63063,7 +63460,7 @@ var ts; } // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { + if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 193200128 /* InstantiableNonPrimitive */)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, typeToString(rightType)); } checkSourceElement(node.statement); @@ -63701,7 +64098,7 @@ var ts; var isGenerator = !!(functionFlags & 1 /* Generator */); var isAsync = !!(functionFlags & 2 /* Async */); return isGenerator ? getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, isAsync) || errorType : - isAsync ? getPromisedTypeOfPromise(returnType) || errorType : + isAsync ? unwrapAwaitedType(getAwaitedType(returnType) || errorType) : returnType; } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { @@ -63723,12 +64120,12 @@ var ts; var functionFlags = ts.getFunctionFlags(func); if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 164 /* SetAccessor */) { + if (func.kind === 165 /* SetAccessor */) { if (node.expression) { error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 162 /* Constructor */) { + else if (func.kind === 163 /* Constructor */) { if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -63736,7 +64133,7 @@ var ts; else if (getReturnTypeFromAnnotation(func)) { var unwrappedReturnType = unwrapReturnType(returnType, functionFlags); var unwrappedExprType = functionFlags & 2 /* Async */ - ? checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) + ? unwrapAwaitedType(checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)) : exprType; if (unwrappedReturnType) { // If the function has a return type, but promisedType is @@ -63746,7 +64143,7 @@ var ts; } } } - else if (func.kind !== 162 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 163 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { // The function has a return type, but the return statement doesn't have an expression. error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } @@ -63775,7 +64172,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 278 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 279 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -63784,7 +64181,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 277 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 278 /* CaseClause */) { // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable // to or from the type of the 'switch' expression. @@ -63816,7 +64213,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 238 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 239 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label)); return true; } @@ -63923,8 +64320,8 @@ var ts; // this allows us to rule out cases when both property and indexer are inherited from the base class var errorNode; if (propDeclaration && name && - (propDeclaration.kind === 209 /* BinaryExpression */ || - name.kind === 154 /* ComputedPropertyName */ || + (propDeclaration.kind === 210 /* BinaryExpression */ || + name.kind === 155 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -64001,7 +64398,7 @@ var ts; function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 169 /* TypeReference */) { + if (node.kind === 170 /* TypeReference */) { var type = getTypeFromTypeReference(node); if (type.flags & 262144 /* TypeParameter */) { for (var i = index; i < typeParameters.length; i++) { @@ -64247,7 +64644,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 245 /* ClassDeclaration */ || d.kind === 246 /* InterfaceDeclaration */; + return d.kind === 246 /* ClassDeclaration */ || d.kind === 247 /* InterfaceDeclaration */; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -64302,7 +64699,7 @@ var ts; continue basePropertyCheck; } } - if (derivedClassDecl.kind === 214 /* ClassExpression */) { + if (derivedClassDecl.kind === 215 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -64324,7 +64721,7 @@ var ts; // property/accessor is overridden with property/accessor if (!compilerOptions.useDefineForClassFields || baseDeclarationFlags & 128 /* Abstract */ && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer) - || base.valueDeclaration && base.valueDeclaration.parent.kind === 246 /* InterfaceDeclaration */ + || base.valueDeclaration && base.valueDeclaration.parent.kind === 247 /* InterfaceDeclaration */ || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) { // when the base property is abstract or from an interface, base/derived flags don't need to match // same when the derived property is from an assignment @@ -64339,7 +64736,7 @@ var ts; error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type)); } else { - var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 159 /* PropertyDeclaration */ && !d.initializer; }); + var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 160 /* PropertyDeclaration */ && !d.initializer; }); if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 128 /* Abstract */) @@ -64436,7 +64833,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 159 /* PropertyDeclaration */ && + return node.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(node, 32 /* Static */ | 128 /* Abstract */) && !node.exclamationToken && !node.initializer; @@ -64460,7 +64857,7 @@ var ts; var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 246 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 247 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -64566,7 +64963,7 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: var value_2 = evaluate(expr.operand); if (typeof value_2 === "number") { switch (expr.operator) { @@ -64576,7 +64973,7 @@ var ts; } } break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -64605,7 +65002,7 @@ var ts; case 8 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return evaluate(expr.expression); case 75 /* Identifier */: var identifier = expr; @@ -64613,14 +65010,14 @@ var ts; return +(identifier.escapedText); } return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText); - case 195 /* ElementAccessExpression */: - case 194 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384 /* Enum */) { var name = void 0; - if (ex.kind === 194 /* PropertyAccessExpression */) { + if (ex.kind === 195 /* PropertyAccessExpression */) { name = ex.name.escapedText; } else { @@ -64650,8 +65047,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 75 /* Identifier */ || - node.kind === 194 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || - node.kind === 195 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && + node.kind === 195 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || + node.kind === 196 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && ts.isStringLiteralLike(node.argumentExpression); } function checkEnumDeclaration(node) { @@ -64687,7 +65084,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 248 /* EnumDeclaration */) { + if (declaration.kind !== 249 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -64715,8 +65112,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { var declaration = declarations_8[_i]; - if ((declaration.kind === 245 /* ClassDeclaration */ || - (declaration.kind === 244 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 246 /* ClassDeclaration */ || + (declaration.kind === 245 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 8388608 /* Ambient */)) { return declaration; } @@ -64779,7 +65176,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 245 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 246 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -64829,23 +65226,23 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 259 /* ExportAssignment */: - case 260 /* ExportDeclaration */: + case 260 /* ExportAssignment */: + case 261 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 253 /* ImportEqualsDeclaration */: - case 254 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 191 /* BindingElement */: - case 242 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 243 /* VariableDeclaration */: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -64856,12 +65253,12 @@ var ts; break; } // falls through - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 244 /* FunctionDeclaration */: - case 246 /* InterfaceDeclaration */: - case 249 /* ModuleDeclaration */: - case 247 /* TypeAliasDeclaration */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 245 /* FunctionDeclaration */: + case 247 /* InterfaceDeclaration */: + case 250 /* ModuleDeclaration */: + case 248 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -64884,12 +65281,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: do { node = node.left; } while (node.kind !== 75 /* Identifier */); return node; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: do { if (ts.isModuleExportsAccessExpression(node.expression) && !ts.isPrivateIdentifier(node.name)) { return node.name; @@ -64909,9 +65306,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 250 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 290 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 260 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 251 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 291 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 261 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -64946,14 +65343,14 @@ var ts; (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 263 /* ExportSpecifier */ ? + var message = node.kind === 264 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } // Don't allow to re-export something with no value side when `--isolatedModules` is set. if (compilerOptions.isolatedModules - && node.kind === 263 /* ExportSpecifier */ + && node.kind === 264 /* ExportSpecifier */ && !node.parent.parent.isTypeOnly && !(target.flags & 111551 /* Value */) && !(node.flags & 8388608 /* Ambient */)) { @@ -64981,7 +65378,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 256 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 257 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -65005,7 +65402,7 @@ var ts; if (ts.hasModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 265 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 266 /* ExternalModuleReference */) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 111551 /* Value */) { @@ -65050,10 +65447,10 @@ var ts; else if (!ts.isNamespaceExport(node.exportClause)) { checkImportBinding(node.exportClause); } - var inAmbientExternalModule = node.parent.kind === 250 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 250 /* ModuleBlock */ && + var inAmbientExternalModule = node.parent.kind === 251 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 251 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 8388608 /* Ambient */; - if (node.parent.kind !== 290 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 291 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -65071,14 +65468,14 @@ var ts; } function checkGrammarExportDeclaration(node) { var _a; - var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 261 /* NamedExports */; + var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 262 /* NamedExports */; if (isTypeOnlyExportStar) { grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type); } return !isTypeOnlyExportStar; } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 290 /* SourceFile */ || node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 249 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 291 /* SourceFile */ || node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 250 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -65134,8 +65531,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 290 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 249 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 291 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 250 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -65249,165 +65646,165 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 249 /* ModuleDeclaration */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 244 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 245 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } - if (kind >= 225 /* FirstStatement */ && kind <= 241 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { + if (kind >= 226 /* FirstStatement */ && kind <= 242 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, ts.Diagnostics.Unreachable_code_detected); } switch (kind) { - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return checkTypeParameter(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return checkParameter(node); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return checkPropertyDeclaration(node); - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: return checkPropertySignature(node); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 165 /* CallSignature */: - case 166 /* ConstructSignature */: - case 167 /* IndexSignature */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 166 /* CallSignature */: + case 167 /* ConstructSignature */: + case 168 /* IndexSignature */: return checkSignatureDeclaration(node); - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: return checkMethodDeclaration(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return checkConstructorDeclaration(node); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return checkAccessorDeclaration(node); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return checkTypeReferenceNode(node); - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return checkTypePredicate(node); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return checkTypeQuery(node); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return checkTypeLiteral(node); - case 174 /* ArrayType */: + case 175 /* ArrayType */: return checkArrayType(node); - case 175 /* TupleType */: + case 176 /* TupleType */: return checkTupleType(node); - case 178 /* UnionType */: - case 179 /* IntersectionType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 182 /* ParenthesizedType */: - case 176 /* OptionalType */: - case 177 /* RestType */: + case 183 /* ParenthesizedType */: + case 177 /* OptionalType */: + case 178 /* RestType */: return checkSourceElement(node.type); - case 183 /* ThisType */: + case 184 /* ThisType */: return checkThisType(node); - case 184 /* TypeOperator */: + case 185 /* TypeOperator */: return checkTypeOperator(node); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return checkConditionalType(node); - case 181 /* InferType */: + case 182 /* InferType */: return checkInferType(node); - case 188 /* ImportType */: + case 189 /* ImportType */: return checkImportType(node); - case 307 /* JSDocAugmentsTag */: + case 308 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 308 /* JSDocImplementsTag */: + case 309 /* JSDocImplementsTag */: return checkJSDocImplementsTag(node); - case 322 /* JSDocTypedefTag */: - case 315 /* JSDocCallbackTag */: - case 316 /* JSDocEnumTag */: + case 323 /* JSDocTypedefTag */: + case 316 /* JSDocCallbackTag */: + case 317 /* JSDocEnumTag */: return checkJSDocTypeAliasTag(node); - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return checkJSDocTemplateTag(node); - case 320 /* JSDocTypeTag */: + case 321 /* JSDocTypeTag */: return checkJSDocTypeTag(node); - case 317 /* JSDocParameterTag */: + case 318 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: checkJSDocFunctionType(node); // falls through - case 298 /* JSDocNonNullableType */: - case 297 /* JSDocNullableType */: - case 295 /* JSDocAllType */: - case 296 /* JSDocUnknownType */: - case 304 /* JSDocTypeLiteral */: + case 299 /* JSDocNonNullableType */: + case 298 /* JSDocNullableType */: + case 296 /* JSDocAllType */: + case 297 /* JSDocUnknownType */: + case 305 /* JSDocTypeLiteral */: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 301 /* JSDocVariadicType */: + case 302 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 294 /* JSDocTypeExpression */: + case 295 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 186 /* MappedType */: + case 187 /* MappedType */: return checkMappedType(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 223 /* Block */: - case 250 /* ModuleBlock */: + case 224 /* Block */: + case 251 /* ModuleBlock */: return checkBlock(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return checkVariableStatement(node); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return checkExpressionStatement(node); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return checkIfStatement(node); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return checkDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return checkWhileStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return checkForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return checkForInStatement(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return checkForOfStatement(node); - case 233 /* ContinueStatement */: - case 234 /* BreakStatement */: + case 234 /* ContinueStatement */: + case 235 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return checkReturnStatement(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return checkWithStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return checkSwitchStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return checkLabeledStatement(node); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return checkThrowStatement(node); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return checkTryStatement(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return checkBindingElement(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return checkClassDeclaration(node); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return checkImportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return checkExportDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return checkExportAssignment(node); - case 224 /* EmptyStatement */: - case 241 /* DebuggerStatement */: + case 225 /* EmptyStatement */: + case 242 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 264 /* MissingDeclaration */: + case 265 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -65502,33 +65899,33 @@ var ts; currentNode = node; instantiationCount = 0; switch (node.kind) { - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 198 /* TaggedTemplateExpression */: - case 157 /* Decorator */: - case 268 /* JsxOpeningElement */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 199 /* TaggedTemplateExpression */: + case 158 /* Decorator */: + case 269 /* JsxOpeningElement */: // These node kinds are deferred checked when overload resolution fails // To save on work, we ensure the arguments are checked just once, in // a deferred way resolveUntypedCall(node); break; - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: checkClassExpressionDeferred(node); break; - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: checkJsxSelfClosingElementDeferred(node); break; - case 266 /* JsxElement */: + case 267 /* JsxElement */: checkJsxElementDeferred(node); break; } @@ -65671,17 +66068,17 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 290 /* SourceFile */: + case 291 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; // falls through - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -65689,8 +66086,8 @@ var ts; // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration. // falls through - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -65699,7 +66096,7 @@ var ts; copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968 /* Type */); } break; - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -65747,16 +66144,16 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 155 /* TypeParameter */: - case 245 /* ClassDeclaration */: - case 246 /* InterfaceDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 248 /* EnumDeclaration */: + case 156 /* TypeParameter */: + case 246 /* ClassDeclaration */: + case 247 /* InterfaceDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: return true; - case 255 /* ImportClause */: + case 256 /* ImportClause */: return node.isTypeOnly; - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; default: return false; @@ -65764,16 +66161,16 @@ var ts; } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 153 /* QualifiedName */) { + while (node.parent.kind === 154 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 169 /* TypeReference */; + return node.parent.kind === 170 /* TypeReference */; } function isHeritageClauseElementIdentifier(node) { - while (node.parent.kind === 194 /* PropertyAccessExpression */) { + while (node.parent.kind === 195 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent.kind === 216 /* ExpressionWithTypeArguments */; + return node.parent.kind === 217 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -65801,13 +66198,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 153 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 154 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 253 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 254 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } - if (nodeOnRightSide.parent.kind === 259 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 260 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } return undefined; @@ -65833,7 +66230,7 @@ var ts; node = parent; parent = parent.parent; } - if (parent && parent.kind === 188 /* ImportType */ && parent.qualifier === node) { + if (parent && parent.kind === 189 /* ImportType */ && parent.qualifier === node) { return parent; } return undefined; @@ -65843,7 +66240,7 @@ var ts; return getSymbolOfNode(name.parent); } if (ts.isInJSFile(name) && - name.parent.kind === 194 /* PropertyAccessExpression */ && + name.parent.kind === 195 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { // Check if this is a special property assignment if (!ts.isPrivateIdentifier(name)) { @@ -65853,7 +66250,7 @@ var ts; } } } - if (name.parent.kind === 259 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { + if (name.parent.kind === 260 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { // Even an entity name expression that doesn't resolve as an entityname may still typecheck as a property access expression var success = resolveEntityName(name, /*all meanings*/ 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*ignoreErrors*/ true); @@ -65863,7 +66260,7 @@ var ts; } else if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name) && isInRightSideOfImportOrExportAssignment(name)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(name, 253 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(name, 254 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(name, /*dontResolveAlias*/ true); } @@ -65881,7 +66278,7 @@ var ts; if (isHeritageClauseElementIdentifier(name)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (name.parent.kind === 216 /* ExpressionWithTypeArguments */) { + if (name.parent.kind === 217 /* ExpressionWithTypeArguments */) { meaning = 788968 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { @@ -65897,10 +66294,10 @@ var ts; return entityNameSymbol; } } - if (name.parent.kind === 317 /* JSDocParameterTag */) { + if (name.parent.kind === 318 /* JSDocParameterTag */) { return ts.getParameterSymbolFromJSDoc(name.parent); } - if (name.parent.kind === 155 /* TypeParameter */ && name.parent.parent.kind === 321 /* JSDocTemplateTag */) { + if (name.parent.kind === 156 /* TypeParameter */ && name.parent.parent.kind === 322 /* JSDocTemplateTag */) { ts.Debug.assert(!ts.isInJSFile(name)); // Otherwise `isDeclarationName` would have been true. var typeParameter = ts.getTypeParameterFromJsDoc(name.parent); return typeParameter && typeParameter.symbol; @@ -65917,12 +66314,12 @@ var ts; } return resolveEntityName(name, 111551 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (name.kind === 194 /* PropertyAccessExpression */ || name.kind === 153 /* QualifiedName */) { + else if (name.kind === 195 /* PropertyAccessExpression */ || name.kind === 154 /* QualifiedName */) { var links = getNodeLinks(name); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (name.kind === 194 /* PropertyAccessExpression */) { + if (name.kind === 195 /* PropertyAccessExpression */) { checkPropertyAccessExpression(name); } else { @@ -65932,17 +66329,17 @@ var ts; } } else if (isTypeReferenceIdentifier(name)) { - var meaning = name.parent.kind === 169 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; + var meaning = name.parent.kind === 170 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - if (name.parent.kind === 168 /* TypePredicate */) { + if (name.parent.kind === 169 /* TypePredicate */) { return resolveEntityName(name, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node, ignoreErrors) { - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } var parent = node.parent; @@ -65965,8 +66362,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); } - else if (parent.kind === 191 /* BindingElement */ && - grandParent.kind === 189 /* ObjectBindingPattern */ && + else if (parent.kind === 192 /* BindingElement */ && + grandParent.kind === 190 /* ObjectBindingPattern */ && node === parent.propertyName) { var typeOfPattern = getTypeOfNode(grandParent); var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); @@ -65978,8 +66375,8 @@ var ts; switch (node.kind) { case 75 /* Identifier */: case 76 /* PrivateIdentifier */: - case 194 /* PropertyAccessExpression */: - case 153 /* QualifiedName */: + case 195 /* PropertyAccessExpression */: + case 154 /* QualifiedName */: return getSymbolOfNameOrPropertyAccessExpression(node); case 104 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -65993,14 +66390,14 @@ var ts; return checkExpression(node).symbol; } // falls through - case 183 /* ThisType */: + case 184 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 102 /* SuperKeyword */: return checkExpression(node).symbol; - case 129 /* ConstructorKeyword */: + case 130 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 162 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 163 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -66011,7 +66408,7 @@ var ts; // 3). Dynamic import call or require in javascript // 4). type A = import("./f/*gotToDefinitionHere*/oo") if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 254 /* ImportDeclaration */ || node.parent.kind === 260 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 255 /* ImportDeclaration */ || node.parent.kind === 261 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || ((ts.isInJSFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteralLike*/ false)) || ts.isImportCall(node.parent)) || (ts.isLiteralTypeNode(node.parent) && ts.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent)) { return resolveExternalModuleName(node, node, ignoreErrors); @@ -66033,7 +66430,7 @@ var ts; case 38 /* EqualsGreaterThanToken */: case 80 /* ClassKeyword */: return getSymbolOfNode(node.parent); - case 188 /* ImportType */: + case 189 /* ImportType */: return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : undefined; case 89 /* ExportKeyword */: return ts.isExportAssignment(node.parent) ? ts.Debug.checkDefined(node.parent.symbol) : undefined; @@ -66042,7 +66439,7 @@ var ts; } } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 282 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 283 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */); } return undefined; @@ -66113,23 +66510,23 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfAssignmentPattern(expr) { - ts.Debug.assert(expr.kind === 193 /* ObjectLiteralExpression */ || expr.kind === 192 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 194 /* ObjectLiteralExpression */ || expr.kind === 193 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 232 /* ForOfStatement */) { + if (expr.parent.kind === 233 /* ForOfStatement */) { var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 209 /* BinaryExpression */) { + if (expr.parent.kind === 210 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 281 /* PropertyAssignment */) { + if (expr.parent.kind === 282 /* PropertyAssignment */) { var node_4 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression); var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_4) || errorType; var propertyIndex = ts.indexOfNode(node_4.properties, expr.parent); @@ -66177,7 +66574,7 @@ var ts; case 8 /* NumericLiteral */: case 10 /* StringLiteral */: return getLiteralType(name.text); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType; default: @@ -66233,7 +66630,7 @@ var ts; if (!ts.isGeneratedIdentifier(nodeIn)) { var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier); if (node) { - var isPropertyName_1 = node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node; + var isPropertyName_1 = node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node; return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } @@ -66289,7 +66686,7 @@ var ts; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 290 /* SourceFile */) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 291 /* SourceFile */) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. @@ -66317,7 +66714,7 @@ var ts; } function isSymbolOfDestructuredElementOfCatchBinding(symbol) { return ts.isBindingElement(symbol.valueDeclaration) - && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 280 /* CatchClause */; + && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 281 /* CatchClause */; } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 /* BlockScoped */ && !ts.isSourceFile(symbol.valueDeclaration)) { @@ -66348,7 +66745,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 524288 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 223 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 224 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -66389,19 +66786,19 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 255 /* ImportClause */: - case 256 /* NamespaceImport */: - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 256 /* ImportClause */: + case 257 /* NamespaceImport */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: var symbol = getSymbolOfNode(node) || unknownSymbol; return isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: var exportClause = node.exportClause; return !!exportClause && (ts.isNamespaceExport(exportClause) || ts.some(exportClause.elements, isValueAliasDeclaration)); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return node.expression && node.expression.kind === 75 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) : true; @@ -66410,7 +66807,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 290 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 291 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -66512,15 +66909,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 284 /* EnumMember */: - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 285 /* EnumMember */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return true; } return false; } function getConstantValue(node) { - if (node.kind === 284 /* EnumMember */) { + if (node.kind === 285 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -66699,9 +67096,11 @@ var ts; return; } var file = host.getSourceFile(resolvedDirective.resolvedFileName); - // Add the transitive closure of path references loaded by this file (as long as they are not) - // part of an existing type reference. - addReferencedFilesToTypeDirective(file, key); + if (file) { + // Add the transitive closure of path references loaded by this file (as long as they are not) + // part of an existing type reference. + addReferencedFilesToTypeDirective(file, key); + } }); } return { @@ -66759,12 +67158,12 @@ var ts; getJsxFactoryEntity: getJsxFactoryEntity, getAllAccessorDeclarations: function (accessor) { accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration); // TODO: GH#18217 - var otherKind = accessor.kind === 164 /* SetAccessor */ ? 163 /* GetAccessor */ : 164 /* SetAccessor */; + var otherKind = accessor.kind === 165 /* SetAccessor */ ? 164 /* GetAccessor */ : 165 /* SetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind); var firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor; var secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor; - var setAccessor = accessor.kind === 164 /* SetAccessor */ ? accessor : otherAccessor; - var getAccessor = accessor.kind === 163 /* GetAccessor */ ? accessor : otherAccessor; + var setAccessor = accessor.kind === 165 /* SetAccessor */ ? accessor : otherAccessor; + var getAccessor = accessor.kind === 164 /* GetAccessor */ ? accessor : otherAccessor; return { firstAccessor: firstAccessor, secondAccessor: secondAccessor, @@ -66780,7 +67179,7 @@ var ts; }, getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) { var n = ts.getParseTreeNode(node); - ts.Debug.assert(n && n.kind === 290 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + ts.Debug.assert(n && n.kind === 291 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); var sym = getSymbolOfNode(node); if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); @@ -66789,7 +67188,7 @@ var ts; } }; function isInHeritageClause(node) { - return node.parent && node.parent.kind === 216 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 279 /* HeritageClause */; + return node.parent && node.parent.kind === 217 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 280 /* HeritageClause */; } // defined here to avoid outer scope pollution function getTypeReferenceDirectivesForEntityName(node) { @@ -66801,7 +67200,7 @@ var ts; // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries var meaning = 788968 /* Type */ | 1920 /* Namespace */; - if ((node.kind === 75 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 194 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { + if ((node.kind === 75 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 195 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -66852,7 +67251,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 290 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 291 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -66880,12 +67279,12 @@ var ts; } } function getExternalModuleFileFromDeclaration(declaration) { - var specifier = declaration.kind === 249 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); + var specifier = declaration.kind === 250 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, /*moduleNotFoundError*/ undefined); // TODO: GH#18217 if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 290 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 291 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -67077,14 +67476,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 161 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 162 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 163 /* GetAccessor */ || node.kind === 164 /* SetAccessor */) { + else if (node.kind === 164 /* GetAccessor */ || node.kind === 165 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -67101,17 +67500,17 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 138 /* ReadonlyKeyword */) { - if (node.kind === 158 /* PropertySignature */ || node.kind === 160 /* MethodSignature */) { + if (modifier.kind !== 139 /* ReadonlyKeyword */) { + if (node.kind === 159 /* PropertySignature */ || node.kind === 161 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 167 /* IndexSignature */) { + if (node.kind === 168 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 81 /* ConstKeyword */: - if (node.kind !== 248 /* EnumDeclaration */) { + if (node.kind !== 249 /* EnumDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(81 /* ConstKeyword */)); } break; @@ -67131,7 +67530,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { + else if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -67157,10 +67556,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { + else if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 156 /* Parameter */) { + else if (node.kind === 157 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -67172,11 +67571,11 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 138 /* ReadonlyKeyword */: + case 139 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 159 /* PropertyDeclaration */ && node.kind !== 158 /* PropertySignature */ && node.kind !== 167 /* IndexSignature */ && node.kind !== 156 /* Parameter */) { + else if (node.kind !== 160 /* PropertyDeclaration */ && node.kind !== 159 /* PropertySignature */ && node.kind !== 168 /* IndexSignature */ && node.kind !== 157 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -67199,19 +67598,19 @@ var ts; else if (ts.isClassLike(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 156 /* Parameter */) { + else if (node.kind === 157 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; case 84 /* DefaultKeyword */: - var container = node.parent.kind === 290 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 249 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 291 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 250 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512 /* Default */; break; - case 130 /* DeclareKeyword */: + case 131 /* DeclareKeyword */: if (flags & 2 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } @@ -67221,10 +67620,10 @@ var ts; else if (ts.isClassLike(node.parent) && !ts.isPropertyDeclaration(node)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 156 /* Parameter */) { + else if (node.kind === 157 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 250 /* ModuleBlock */) { + else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 251 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } else if (ts.isPrivateIdentifierPropertyDeclaration(node)) { @@ -67237,14 +67636,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 245 /* ClassDeclaration */) { - if (node.kind !== 161 /* MethodDeclaration */ && - node.kind !== 159 /* PropertyDeclaration */ && - node.kind !== 163 /* GetAccessor */ && - node.kind !== 164 /* SetAccessor */) { + if (node.kind !== 246 /* ClassDeclaration */) { + if (node.kind !== 162 /* MethodDeclaration */ && + node.kind !== 160 /* PropertyDeclaration */ && + node.kind !== 164 /* GetAccessor */ && + node.kind !== 165 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 245 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { + if (!(node.parent.kind === 246 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -67266,7 +67665,7 @@ var ts; else if (flags & 2 /* Ambient */ || node.parent.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 156 /* Parameter */) { + else if (node.kind === 157 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256 /* Async */; @@ -67274,7 +67673,7 @@ var ts; break; } } - if (node.kind === 162 /* Constructor */) { + if (node.kind === 163 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -67289,13 +67688,13 @@ var ts; } return false; } - else if ((node.kind === 254 /* ImportDeclaration */ || node.kind === 253 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 255 /* ImportDeclaration */ || node.kind === 254 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 156 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 157 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 156 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 157 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -67316,37 +67715,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 162 /* Constructor */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: - case 167 /* IndexSignature */: - case 249 /* ModuleDeclaration */: - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 260 /* ExportDeclaration */: - case 259 /* ExportAssignment */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: - case 156 /* Parameter */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 163 /* Constructor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: + case 168 /* IndexSignature */: + case 250 /* ModuleDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 261 /* ExportDeclaration */: + case 260 /* ExportAssignment */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: + case 157 /* Parameter */: return false; default: - if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { + if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { return false; } switch (node.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 126 /* AsyncKeyword */); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 122 /* AbstractKeyword */); - case 246 /* InterfaceDeclaration */: - case 225 /* VariableStatement */: - case 247 /* TypeAliasDeclaration */: + case 247 /* InterfaceDeclaration */: + case 226 /* VariableStatement */: + case 248 /* TypeAliasDeclaration */: return true; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 81 /* ConstKeyword */); default: ts.Debug.fail(); @@ -67359,10 +67758,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 161 /* MethodDeclaration */: - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: - case 202 /* ArrowFunction */: + case 162 /* MethodDeclaration */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: + case 203 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -67477,7 +67876,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 143 /* StringKeyword */ && parameter.type.kind !== 140 /* NumberKeyword */) { + if (parameter.type.kind !== 144 /* StringKeyword */ && parameter.type.kind !== 141 /* NumberKeyword */) { var type = getTypeFromTypeNode(parameter.type); if (type.flags & 4 /* String */ || type.flags & 8 /* Number */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType)); @@ -67519,7 +67918,7 @@ var ts; if (args) { for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 215 /* OmittedExpression */) { + if (arg.kind === 216 /* OmittedExpression */) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -67596,20 +67995,20 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 154 /* ComputedPropertyName */) { + if (node.kind !== 155 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 209 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { + if (computedPropertyName.expression.kind === 210 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } return false; } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 244 /* FunctionDeclaration */ || - node.kind === 201 /* FunctionExpression */ || - node.kind === 161 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 245 /* FunctionDeclaration */ || + node.kind === 202 /* FunctionExpression */ || + node.kind === 162 /* MethodDeclaration */); if (node.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -67628,7 +68027,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 283 /* SpreadAssignment */) { + if (prop.kind === 284 /* SpreadAssignment */) { if (inDestructuring) { // a rest property cannot be destructured any further var expression = ts.skipParentheses(prop.expression); @@ -67639,11 +68038,11 @@ var ts; continue; } var name = prop.name; - if (name.kind === 154 /* ComputedPropertyName */) { + if (name.kind === 155 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name); } - if (prop.kind === 282 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 283 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); @@ -67656,7 +68055,7 @@ var ts; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { // TODO: GH#19955 var mod = _c[_b]; - if (mod.kind !== 126 /* AsyncKeyword */ || prop.kind !== 161 /* MethodDeclaration */) { + if (mod.kind !== 126 /* AsyncKeyword */ || prop.kind !== 162 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -67671,10 +68070,10 @@ var ts; // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; switch (prop.kind) { - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); // falls through - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8 /* NumericLiteral */) { @@ -67682,13 +68081,13 @@ var ts; } currentKind = 4 /* PropertyAssignment */; break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: currentKind = 8 /* Method */; break; - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: currentKind = 1 /* GetAccessor */; break; - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: currentKind = 2 /* SetAccessor */; break; default: @@ -67727,7 +68126,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 275 /* JsxSpreadAttribute */) { + if (attr.kind === 276 /* JsxSpreadAttribute */) { continue; } var name = attr.name, initializer = attr.initializer; @@ -67737,7 +68136,7 @@ var ts; else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 276 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 277 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -67751,14 +68150,14 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 232 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 233 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 32768 /* AwaitContext */) === 0 /* None */) { // use of 'for-await-of' in non-async function var sourceFile = ts.getSourceFileOfNode(forInOrOfStatement); if (!hasParseDiagnostics(sourceFile)) { var diagnostic = ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); var func = ts.getContainingFunction(forInOrOfStatement); - if (func && func.kind !== 162 /* Constructor */) { + if (func && func.kind !== 163 /* Constructor */) { ts.Debug.assert((ts.getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function."); var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); @@ -67769,7 +68168,7 @@ var ts; return false; } } - if (forInOrOfStatement.initializer.kind === 243 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 244 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -67784,20 +68183,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 232 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 232 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 232 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -67822,11 +68221,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, accessor.kind === 163 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, accessor.kind === 164 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - if (accessor.kind === 164 /* SetAccessor */) { + if (accessor.kind === 165 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -67848,21 +68247,21 @@ var ts; * A set accessor has one parameter or a `this` parameter and one more parameter. */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 163 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 164 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 163 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 164 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 147 /* UniqueKeyword */) { - if (node.type.kind !== 144 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(144 /* SymbolKeyword */)); + if (node.operator === 148 /* UniqueKeyword */) { + if (node.type.kind !== 145 /* SymbolKeyword */) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(145 /* SymbolKeyword */)); } var parent = ts.walkUpParenthesizedTypes(node.parent); switch (parent.kind) { - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: var decl = parent; if (decl.name.kind !== 75 /* Identifier */) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -67874,13 +68273,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: if (!ts.hasModifier(parent, 32 /* Static */) || !ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: if (!ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -67889,9 +68288,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_not_allowed_here); } } - else if (node.operator === 138 /* ReadonlyKeyword */) { - if (node.type.kind !== 174 /* ArrayType */ && node.type.kind !== 175 /* TupleType */) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(144 /* SymbolKeyword */)); + else if (node.operator === 139 /* ReadonlyKeyword */) { + if (node.type.kind !== 175 /* ArrayType */ && node.type.kind !== 176 /* TupleType */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(145 /* SymbolKeyword */)); } } } @@ -67904,8 +68303,8 @@ var ts; if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 161 /* MethodDeclaration */) { - if (node.parent.kind === 193 /* ObjectLiteralExpression */) { + if (node.kind === 162 /* MethodDeclaration */) { + if (node.parent.kind === 194 /* ObjectLiteralExpression */) { // We only disallow modifier on a method declaration if it is a property of object-literal-expression if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 126 /* AsyncKeyword */)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -67933,14 +68332,14 @@ var ts; if (node.flags & 8388608 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.kind === 161 /* MethodDeclaration */ && !node.body) { + else if (node.kind === 162 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 246 /* InterfaceDeclaration */) { + else if (node.parent.kind === 247 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 173 /* TypeLiteral */) { + else if (node.parent.kind === 174 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -67951,11 +68350,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 233 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 234 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -67963,8 +68362,8 @@ var ts; return false; } break; - case 237 /* SwitchStatement */: - if (node.kind === 234 /* BreakStatement */ && !node.label) { + case 238 /* SwitchStatement */: + if (node.kind === 235 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -67979,13 +68378,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 234 /* BreakStatement */ + var message = node.kind === 235 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 234 /* BreakStatement */ + var message = node.kind === 235 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -68009,12 +68408,12 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return ts.isStringOrNumericLiteralLike(expr) || - expr.kind === 207 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 208 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function isBigIntLiteralExpression(expr) { return expr.kind === 9 /* BigIntLiteral */ || - expr.kind === 207 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 208 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */; } function isSimpleLiteralEnumReference(expr) { @@ -68045,7 +68444,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 231 /* ForInStatement */ && node.parent.parent.kind !== 232 /* ForOfStatement */) { + if (node.parent.parent.kind !== 232 /* ForInStatement */ && node.parent.parent.kind !== 233 /* ForOfStatement */) { if (node.flags & 8388608 /* Ambient */) { checkAmbientInitializer(node); } @@ -68058,7 +68457,7 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 225 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { + if (node.exclamationToken && (node.parent.parent.kind !== 226 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation); } var moduleKind = ts.getEmitModuleKind(compilerOptions); @@ -68121,15 +68520,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 227 /* IfStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 236 /* WithStatement */: - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 228 /* IfStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 237 /* WithStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: return false; - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -68213,7 +68612,7 @@ var ts; return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } } - else if (node.parent.kind === 246 /* InterfaceDeclaration */) { + else if (node.parent.kind === 247 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -68221,7 +68620,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 173 /* TypeLiteral */) { + else if (node.parent.kind === 174 /* TypeLiteral */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -68250,13 +68649,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 246 /* InterfaceDeclaration */ || - node.kind === 247 /* TypeAliasDeclaration */ || - node.kind === 254 /* ImportDeclaration */ || - node.kind === 253 /* ImportEqualsDeclaration */ || - node.kind === 260 /* ExportDeclaration */ || - node.kind === 259 /* ExportAssignment */ || - node.kind === 252 /* NamespaceExportDeclaration */ || + if (node.kind === 247 /* InterfaceDeclaration */ || + node.kind === 248 /* TypeAliasDeclaration */ || + node.kind === 255 /* ImportDeclaration */ || + node.kind === 254 /* ImportEqualsDeclaration */ || + node.kind === 261 /* ExportDeclaration */ || + node.kind === 260 /* ExportAssignment */ || + node.kind === 253 /* NamespaceExportDeclaration */ || ts.hasModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -68265,7 +68664,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 225 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 226 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -68288,7 +68687,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 223 /* Block */ || node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { + if (node.parent.kind === 224 /* Block */ || node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { var links_2 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_2.hasReportedStatementInAmbientContext) { @@ -68310,10 +68709,10 @@ var ts; if (languageVersion >= 1 /* ES5 */) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 187 /* LiteralType */)) { + else if (ts.isChildOfNodeWithKind(node, 188 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 284 /* EnumMember */)) { + else if (ts.isChildOfNodeWithKind(node, 285 /* EnumMember */)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -68488,14 +68887,14 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 244 /* FunctionDeclaration */ && declaration.kind !== 161 /* MethodDeclaration */) || + return (declaration.kind !== 245 /* FunctionDeclaration */ && declaration.kind !== 162 /* MethodDeclaration */) || !!declaration.body; } /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */ function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: return ts.isIdentifier(name); default: return ts.isDeclarationName(name); @@ -68503,14 +68902,14 @@ var ts; } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 255 /* ImportClause */: // For default import - case 253 /* ImportEqualsDeclaration */: - case 256 /* NamespaceImport */: - case 258 /* ImportSpecifier */: // For rename import `x as y` + case 256 /* ImportClause */: // For default import + case 254 /* ImportEqualsDeclaration */: + case 257 /* NamespaceImport */: + case 259 /* ImportSpecifier */: // For rename import `x as y` return true; case 75 /* Identifier */: // For regular import, `decl` is an Identifier under the ImportSpecifier. - return decl.parent.kind === 258 /* ImportSpecifier */; + return decl.parent.kind === 259 /* ImportSpecifier */; default: return false; } @@ -68773,7 +69172,7 @@ var ts; result.push(createModifier(89 /* ExportKeyword */)); } if (flags & 2 /* Ambient */) { - result.push(createModifier(130 /* DeclareKeyword */)); + result.push(createModifier(131 /* DeclareKeyword */)); } if (flags & 512 /* Default */) { result.push(createModifier(84 /* DefaultKeyword */)); @@ -68797,7 +69196,7 @@ var ts; result.push(createModifier(120 /* StaticKeyword */)); } if (flags & 64 /* Readonly */) { - result.push(createModifier(138 /* ReadonlyKeyword */)); + result.push(createModifier(139 /* ReadonlyKeyword */)); } if (flags & 256 /* Async */) { result.push(createModifier(126 /* AsyncKeyword */)); @@ -68807,7 +69206,7 @@ var ts; ts.createModifiersFromModifierFlags = createModifiersFromModifierFlags; // Names function createQualifiedName(left, right) { - var node = createSynthesizedNode(153 /* QualifiedName */); + var node = createSynthesizedNode(154 /* QualifiedName */); node.left = left; node.right = asName(right); return node; @@ -68826,7 +69225,7 @@ var ts; : expression; } function createComputedPropertyName(expression) { - var node = createSynthesizedNode(154 /* ComputedPropertyName */); + var node = createSynthesizedNode(155 /* ComputedPropertyName */); node.expression = parenthesizeForComputedName(expression); return node; } @@ -68839,7 +69238,7 @@ var ts; ts.updateComputedPropertyName = updateComputedPropertyName; // Signature elements function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createSynthesizedNode(155 /* TypeParameter */); + var node = createSynthesizedNode(156 /* TypeParameter */); node.name = asName(name); node.constraint = constraint; node.default = defaultType; @@ -68855,7 +69254,7 @@ var ts; } ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createSynthesizedNode(156 /* Parameter */); + var node = createSynthesizedNode(157 /* Parameter */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; @@ -68879,7 +69278,7 @@ var ts; } ts.updateParameter = updateParameter; function createDecorator(expression) { - var node = createSynthesizedNode(157 /* Decorator */); + var node = createSynthesizedNode(158 /* Decorator */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -68892,7 +69291,7 @@ var ts; ts.updateDecorator = updateDecorator; // Type Elements function createPropertySignature(modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(158 /* PropertySignature */); + var node = createSynthesizedNode(159 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -68912,7 +69311,7 @@ var ts; } ts.updatePropertySignature = updatePropertySignature; function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - var node = createSynthesizedNode(159 /* PropertyDeclaration */); + var node = createSynthesizedNode(160 /* PropertyDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -68936,7 +69335,7 @@ var ts; } ts.updateProperty = updateProperty; function createMethodSignature(typeParameters, parameters, type, name, questionToken) { - var node = createSignatureDeclaration(160 /* MethodSignature */, typeParameters, parameters, type); + var node = createSignatureDeclaration(161 /* MethodSignature */, typeParameters, parameters, type); node.name = asName(name); node.questionToken = questionToken; return node; @@ -68953,7 +69352,7 @@ var ts; } ts.updateMethodSignature = updateMethodSignature; function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(161 /* MethodDeclaration */); + var node = createSynthesizedNode(162 /* MethodDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -69013,7 +69412,7 @@ var ts; } ts.updateMethod = updateMethod; function createConstructor(decorators, modifiers, parameters, body) { - var node = createSynthesizedNode(162 /* Constructor */); + var node = createSynthesizedNode(163 /* Constructor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; @@ -69033,7 +69432,7 @@ var ts; } ts.updateConstructor = updateConstructor; function createGetAccessor(decorators, modifiers, name, parameters, type, body) { - var node = createSynthesizedNode(163 /* GetAccessor */); + var node = createSynthesizedNode(164 /* GetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69056,7 +69455,7 @@ var ts; } ts.updateGetAccessor = updateGetAccessor; function createSetAccessor(decorators, modifiers, name, parameters, body) { - var node = createSynthesizedNode(164 /* SetAccessor */); + var node = createSynthesizedNode(165 /* SetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69077,7 +69476,7 @@ var ts; } ts.updateSetAccessor = updateSetAccessor; function createCallSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(165 /* CallSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(166 /* CallSignature */, typeParameters, parameters, type); } ts.createCallSignature = createCallSignature; function updateCallSignature(node, typeParameters, parameters, type) { @@ -69085,7 +69484,7 @@ var ts; } ts.updateCallSignature = updateCallSignature; function createConstructSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(166 /* ConstructSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(167 /* ConstructSignature */, typeParameters, parameters, type); } ts.createConstructSignature = createConstructSignature; function updateConstructSignature(node, typeParameters, parameters, type) { @@ -69093,7 +69492,7 @@ var ts; } ts.updateConstructSignature = updateConstructSignature; function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createSynthesizedNode(167 /* IndexSignature */); + var node = createSynthesizedNode(168 /* IndexSignature */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); @@ -69137,7 +69536,7 @@ var ts; } ts.createTypePredicateNode = createTypePredicateNode; function createTypePredicateNodeWithModifier(assertsModifier, parameterName, type) { - var node = createSynthesizedNode(168 /* TypePredicate */); + var node = createSynthesizedNode(169 /* TypePredicate */); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); node.type = type; @@ -69157,7 +69556,7 @@ var ts; } ts.updateTypePredicateNodeWithModifier = updateTypePredicateNodeWithModifier; function createTypeReferenceNode(typeName, typeArguments) { - var node = createSynthesizedNode(169 /* TypeReference */); + var node = createSynthesizedNode(170 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments); return node; @@ -69171,7 +69570,7 @@ var ts; } ts.updateTypeReferenceNode = updateTypeReferenceNode; function createFunctionTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(170 /* FunctionType */, typeParameters, parameters, type); + return createSignatureDeclaration(171 /* FunctionType */, typeParameters, parameters, type); } ts.createFunctionTypeNode = createFunctionTypeNode; function updateFunctionTypeNode(node, typeParameters, parameters, type) { @@ -69179,7 +69578,7 @@ var ts; } ts.updateFunctionTypeNode = updateFunctionTypeNode; function createConstructorTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(171 /* ConstructorType */, typeParameters, parameters, type); + return createSignatureDeclaration(172 /* ConstructorType */, typeParameters, parameters, type); } ts.createConstructorTypeNode = createConstructorTypeNode; function updateConstructorTypeNode(node, typeParameters, parameters, type) { @@ -69187,7 +69586,7 @@ var ts; } ts.updateConstructorTypeNode = updateConstructorTypeNode; function createTypeQueryNode(exprName) { - var node = createSynthesizedNode(172 /* TypeQuery */); + var node = createSynthesizedNode(173 /* TypeQuery */); node.exprName = exprName; return node; } @@ -69199,7 +69598,7 @@ var ts; } ts.updateTypeQueryNode = updateTypeQueryNode; function createTypeLiteralNode(members) { - var node = createSynthesizedNode(173 /* TypeLiteral */); + var node = createSynthesizedNode(174 /* TypeLiteral */); node.members = createNodeArray(members); return node; } @@ -69211,7 +69610,7 @@ var ts; } ts.updateTypeLiteralNode = updateTypeLiteralNode; function createArrayTypeNode(elementType) { - var node = createSynthesizedNode(174 /* ArrayType */); + var node = createSynthesizedNode(175 /* ArrayType */); node.elementType = ts.parenthesizeArrayTypeMember(elementType); return node; } @@ -69223,7 +69622,7 @@ var ts; } ts.updateArrayTypeNode = updateArrayTypeNode; function createTupleTypeNode(elementTypes) { - var node = createSynthesizedNode(175 /* TupleType */); + var node = createSynthesizedNode(176 /* TupleType */); node.elementTypes = createNodeArray(elementTypes); return node; } @@ -69235,7 +69634,7 @@ var ts; } ts.updateTupleTypeNode = updateTupleTypeNode; function createOptionalTypeNode(type) { - var node = createSynthesizedNode(176 /* OptionalType */); + var node = createSynthesizedNode(177 /* OptionalType */); node.type = ts.parenthesizeArrayTypeMember(type); return node; } @@ -69247,7 +69646,7 @@ var ts; } ts.updateOptionalTypeNode = updateOptionalTypeNode; function createRestTypeNode(type) { - var node = createSynthesizedNode(177 /* RestType */); + var node = createSynthesizedNode(178 /* RestType */); node.type = type; return node; } @@ -69259,7 +69658,7 @@ var ts; } ts.updateRestTypeNode = updateRestTypeNode; function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(178 /* UnionType */, types); + return createUnionOrIntersectionTypeNode(179 /* UnionType */, types); } ts.createUnionTypeNode = createUnionTypeNode; function updateUnionTypeNode(node, types) { @@ -69267,7 +69666,7 @@ var ts; } ts.updateUnionTypeNode = updateUnionTypeNode; function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(179 /* IntersectionType */, types); + return createUnionOrIntersectionTypeNode(180 /* IntersectionType */, types); } ts.createIntersectionTypeNode = createIntersectionTypeNode; function updateIntersectionTypeNode(node, types) { @@ -69286,7 +69685,7 @@ var ts; : node; } function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - var node = createSynthesizedNode(180 /* ConditionalType */); + var node = createSynthesizedNode(181 /* ConditionalType */); node.checkType = ts.parenthesizeConditionalTypeMember(checkType); node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType); node.trueType = trueType; @@ -69304,7 +69703,7 @@ var ts; } ts.updateConditionalTypeNode = updateConditionalTypeNode; function createInferTypeNode(typeParameter) { - var node = createSynthesizedNode(181 /* InferType */); + var node = createSynthesizedNode(182 /* InferType */); node.typeParameter = typeParameter; return node; } @@ -69316,7 +69715,7 @@ var ts; } ts.updateInferTypeNode = updateInferTypeNode; function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) { - var node = createSynthesizedNode(188 /* ImportType */); + var node = createSynthesizedNode(189 /* ImportType */); node.argument = argument; node.qualifier = qualifier; node.typeArguments = ts.parenthesizeTypeParameters(typeArguments); @@ -69334,7 +69733,7 @@ var ts; } ts.updateImportTypeNode = updateImportTypeNode; function createParenthesizedType(type) { - var node = createSynthesizedNode(182 /* ParenthesizedType */); + var node = createSynthesizedNode(183 /* ParenthesizedType */); node.type = type; return node; } @@ -69346,12 +69745,12 @@ var ts; } ts.updateParenthesizedType = updateParenthesizedType; function createThisTypeNode() { - return createSynthesizedNode(183 /* ThisType */); + return createSynthesizedNode(184 /* ThisType */); } ts.createThisTypeNode = createThisTypeNode; function createTypeOperatorNode(operatorOrType, type) { - var node = createSynthesizedNode(184 /* TypeOperator */); - node.operator = typeof operatorOrType === "number" ? operatorOrType : 134 /* KeyOfKeyword */; + var node = createSynthesizedNode(185 /* TypeOperator */); + node.operator = typeof operatorOrType === "number" ? operatorOrType : 135 /* KeyOfKeyword */; node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); return node; } @@ -69361,7 +69760,7 @@ var ts; } ts.updateTypeOperatorNode = updateTypeOperatorNode; function createIndexedAccessTypeNode(objectType, indexType) { - var node = createSynthesizedNode(185 /* IndexedAccessType */); + var node = createSynthesizedNode(186 /* IndexedAccessType */); node.objectType = ts.parenthesizeElementTypeMember(objectType); node.indexType = indexType; return node; @@ -69375,7 +69774,7 @@ var ts; } ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { - var node = createSynthesizedNode(186 /* MappedType */); + var node = createSynthesizedNode(187 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.questionToken = questionToken; @@ -69393,7 +69792,7 @@ var ts; } ts.updateMappedTypeNode = updateMappedTypeNode; function createLiteralTypeNode(literal) { - var node = createSynthesizedNode(187 /* LiteralType */); + var node = createSynthesizedNode(188 /* LiteralType */); node.literal = literal; return node; } @@ -69406,7 +69805,7 @@ var ts; ts.updateLiteralTypeNode = updateLiteralTypeNode; // Binding Patterns function createObjectBindingPattern(elements) { - var node = createSynthesizedNode(189 /* ObjectBindingPattern */); + var node = createSynthesizedNode(190 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -69418,7 +69817,7 @@ var ts; } ts.updateObjectBindingPattern = updateObjectBindingPattern; function createArrayBindingPattern(elements) { - var node = createSynthesizedNode(190 /* ArrayBindingPattern */); + var node = createSynthesizedNode(191 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -69430,7 +69829,7 @@ var ts; } ts.updateArrayBindingPattern = updateArrayBindingPattern; function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createSynthesizedNode(191 /* BindingElement */); + var node = createSynthesizedNode(192 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -69449,7 +69848,7 @@ var ts; ts.updateBindingElement = updateBindingElement; // Expression function createArrayLiteral(elements, multiLine) { - var node = createSynthesizedNode(192 /* ArrayLiteralExpression */); + var node = createSynthesizedNode(193 /* ArrayLiteralExpression */); node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) node.multiLine = true; @@ -69463,7 +69862,7 @@ var ts; } ts.updateArrayLiteral = updateArrayLiteral; function createObjectLiteral(properties, multiLine) { - var node = createSynthesizedNode(193 /* ObjectLiteralExpression */); + var node = createSynthesizedNode(194 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); if (multiLine) node.multiLine = true; @@ -69477,7 +69876,7 @@ var ts; } ts.updateObjectLiteral = updateObjectLiteral; function createPropertyAccess(expression, name) { - var node = createSynthesizedNode(194 /* PropertyAccessExpression */); + var node = createSynthesizedNode(195 /* PropertyAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.name = asName(name); setEmitFlags(node, 131072 /* NoIndentation */); @@ -69499,7 +69898,7 @@ var ts; } ts.updatePropertyAccess = updatePropertyAccess; function createPropertyAccessChain(expression, questionDotToken, name) { - var node = createSynthesizedNode(194 /* PropertyAccessExpression */); + var node = createSynthesizedNode(195 /* PropertyAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -69520,7 +69919,7 @@ var ts; } ts.updatePropertyAccessChain = updatePropertyAccessChain; function createElementAccess(expression, index) { - var node = createSynthesizedNode(195 /* ElementAccessExpression */); + var node = createSynthesizedNode(196 /* ElementAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.argumentExpression = asExpression(index); return node; @@ -69537,7 +69936,7 @@ var ts; } ts.updateElementAccess = updateElementAccess; function createElementAccessChain(expression, questionDotToken, index) { - var node = createSynthesizedNode(195 /* ElementAccessExpression */); + var node = createSynthesizedNode(196 /* ElementAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -69555,7 +69954,7 @@ var ts; } ts.updateElementAccessChain = updateElementAccessChain; function createCall(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(196 /* CallExpression */); + var node = createSynthesizedNode(197 /* CallExpression */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); @@ -69574,7 +69973,7 @@ var ts; } ts.updateCall = updateCall; function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { - var node = createSynthesizedNode(196 /* CallExpression */); + var node = createSynthesizedNode(197 /* CallExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -69594,7 +69993,7 @@ var ts; } ts.updateCallChain = updateCallChain; function createNew(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(197 /* NewExpression */); + var node = createSynthesizedNode(198 /* NewExpression */); node.expression = ts.parenthesizeForNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; @@ -69610,7 +70009,7 @@ var ts; } ts.updateNew = updateNew; function createTaggedTemplate(tag, typeArgumentsOrTemplate, template) { - var node = createSynthesizedNode(198 /* TaggedTemplateExpression */); + var node = createSynthesizedNode(199 /* TaggedTemplateExpression */); node.tag = ts.parenthesizeForAccess(tag); if (template) { node.typeArguments = asNodeArray(typeArgumentsOrTemplate); @@ -69633,7 +70032,7 @@ var ts; } ts.updateTaggedTemplate = updateTaggedTemplate; function createTypeAssertion(type, expression) { - var node = createSynthesizedNode(199 /* TypeAssertionExpression */); + var node = createSynthesizedNode(200 /* TypeAssertionExpression */); node.type = type; node.expression = ts.parenthesizePrefixOperand(expression); return node; @@ -69647,7 +70046,7 @@ var ts; } ts.updateTypeAssertion = updateTypeAssertion; function createParen(expression) { - var node = createSynthesizedNode(200 /* ParenthesizedExpression */); + var node = createSynthesizedNode(201 /* ParenthesizedExpression */); node.expression = expression; return node; } @@ -69659,7 +70058,7 @@ var ts; } ts.updateParen = updateParen; function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(201 /* FunctionExpression */); + var node = createSynthesizedNode(202 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -69683,7 +70082,7 @@ var ts; } ts.updateFunctionExpression = updateFunctionExpression; function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createSynthesizedNode(202 /* ArrowFunction */); + var node = createSynthesizedNode(203 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -69705,7 +70104,7 @@ var ts; } ts.updateArrowFunction = updateArrowFunction; function createDelete(expression) { - var node = createSynthesizedNode(203 /* DeleteExpression */); + var node = createSynthesizedNode(204 /* DeleteExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -69717,7 +70116,7 @@ var ts; } ts.updateDelete = updateDelete; function createTypeOf(expression) { - var node = createSynthesizedNode(204 /* TypeOfExpression */); + var node = createSynthesizedNode(205 /* TypeOfExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -69729,7 +70128,7 @@ var ts; } ts.updateTypeOf = updateTypeOf; function createVoid(expression) { - var node = createSynthesizedNode(205 /* VoidExpression */); + var node = createSynthesizedNode(206 /* VoidExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -69741,7 +70140,7 @@ var ts; } ts.updateVoid = updateVoid; function createAwait(expression) { - var node = createSynthesizedNode(206 /* AwaitExpression */); + var node = createSynthesizedNode(207 /* AwaitExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -69753,7 +70152,7 @@ var ts; } ts.updateAwait = updateAwait; function createPrefix(operator, operand) { - var node = createSynthesizedNode(207 /* PrefixUnaryExpression */); + var node = createSynthesizedNode(208 /* PrefixUnaryExpression */); node.operator = operator; node.operand = ts.parenthesizePrefixOperand(operand); return node; @@ -69766,7 +70165,7 @@ var ts; } ts.updatePrefix = updatePrefix; function createPostfix(operand, operator) { - var node = createSynthesizedNode(208 /* PostfixUnaryExpression */); + var node = createSynthesizedNode(209 /* PostfixUnaryExpression */); node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; @@ -69779,7 +70178,7 @@ var ts; } ts.updatePostfix = updatePostfix; function createBinary(left, operator, right) { - var node = createSynthesizedNode(209 /* BinaryExpression */); + var node = createSynthesizedNode(210 /* BinaryExpression */); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = ts.parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); @@ -69796,7 +70195,7 @@ var ts; } ts.updateBinary = updateBinary; function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - var node = createSynthesizedNode(210 /* ConditionalExpression */); + var node = createSynthesizedNode(211 /* ConditionalExpression */); node.condition = ts.parenthesizeForConditionalHead(condition); node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(57 /* QuestionToken */); node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); @@ -69816,7 +70215,7 @@ var ts; } ts.updateConditional = updateConditional; function createTemplateExpression(head, templateSpans) { - var node = createSynthesizedNode(211 /* TemplateExpression */); + var node = createSynthesizedNode(212 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; @@ -69913,7 +70312,7 @@ var ts; } ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral; function createYield(asteriskTokenOrExpression, expression) { - var node = createSynthesizedNode(212 /* YieldExpression */); + var node = createSynthesizedNode(213 /* YieldExpression */); node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 41 /* AsteriskToken */ ? asteriskTokenOrExpression : undefined; node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 41 /* AsteriskToken */ ? asteriskTokenOrExpression : expression; return node; @@ -69927,7 +70326,7 @@ var ts; } ts.updateYield = updateYield; function createSpread(expression) { - var node = createSynthesizedNode(213 /* SpreadElement */); + var node = createSynthesizedNode(214 /* SpreadElement */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -69939,7 +70338,7 @@ var ts; } ts.updateSpread = updateSpread; function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(214 /* ClassExpression */); + var node = createSynthesizedNode(215 /* ClassExpression */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69960,11 +70359,11 @@ var ts; } ts.updateClassExpression = updateClassExpression; function createOmittedExpression() { - return createSynthesizedNode(215 /* OmittedExpression */); + return createSynthesizedNode(216 /* OmittedExpression */); } ts.createOmittedExpression = createOmittedExpression; function createExpressionWithTypeArguments(typeArguments, expression) { - var node = createSynthesizedNode(216 /* ExpressionWithTypeArguments */); + var node = createSynthesizedNode(217 /* ExpressionWithTypeArguments */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); return node; @@ -69978,7 +70377,7 @@ var ts; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; function createAsExpression(expression, type) { - var node = createSynthesizedNode(217 /* AsExpression */); + var node = createSynthesizedNode(218 /* AsExpression */); node.expression = expression; node.type = type; return node; @@ -69992,7 +70391,7 @@ var ts; } ts.updateAsExpression = updateAsExpression; function createNonNullExpression(expression) { - var node = createSynthesizedNode(218 /* NonNullExpression */); + var node = createSynthesizedNode(219 /* NonNullExpression */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -70004,7 +70403,7 @@ var ts; } ts.updateNonNullExpression = updateNonNullExpression; function createMetaProperty(keywordToken, name) { - var node = createSynthesizedNode(219 /* MetaProperty */); + var node = createSynthesizedNode(220 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; return node; @@ -70018,7 +70417,7 @@ var ts; ts.updateMetaProperty = updateMetaProperty; // Misc function createTemplateSpan(expression, literal) { - var node = createSynthesizedNode(221 /* TemplateSpan */); + var node = createSynthesizedNode(222 /* TemplateSpan */); node.expression = expression; node.literal = literal; return node; @@ -70032,12 +70431,12 @@ var ts; } ts.updateTemplateSpan = updateTemplateSpan; function createSemicolonClassElement() { - return createSynthesizedNode(222 /* SemicolonClassElement */); + return createSynthesizedNode(223 /* SemicolonClassElement */); } ts.createSemicolonClassElement = createSemicolonClassElement; // Element function createBlock(statements, multiLine) { - var block = createSynthesizedNode(223 /* Block */); + var block = createSynthesizedNode(224 /* Block */); block.statements = createNodeArray(statements); if (multiLine) block.multiLine = multiLine; @@ -70051,7 +70450,7 @@ var ts; } ts.updateBlock = updateBlock; function createVariableStatement(modifiers, declarationList) { - var node = createSynthesizedNode(225 /* VariableStatement */); + var node = createSynthesizedNode(226 /* VariableStatement */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; @@ -70066,11 +70465,11 @@ var ts; } ts.updateVariableStatement = updateVariableStatement; function createEmptyStatement() { - return createSynthesizedNode(224 /* EmptyStatement */); + return createSynthesizedNode(225 /* EmptyStatement */); } ts.createEmptyStatement = createEmptyStatement; function createExpressionStatement(expression) { - var node = createSynthesizedNode(226 /* ExpressionStatement */); + var node = createSynthesizedNode(227 /* ExpressionStatement */); node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } @@ -70086,7 +70485,7 @@ var ts; /** @deprecated Use `updateExpressionStatement` instead. */ ts.updateStatement = updateExpressionStatement; function createIf(expression, thenStatement, elseStatement) { - var node = createSynthesizedNode(227 /* IfStatement */); + var node = createSynthesizedNode(228 /* IfStatement */); node.expression = expression; node.thenStatement = asEmbeddedStatement(thenStatement); node.elseStatement = asEmbeddedStatement(elseStatement); @@ -70102,7 +70501,7 @@ var ts; } ts.updateIf = updateIf; function createDo(statement, expression) { - var node = createSynthesizedNode(228 /* DoStatement */); + var node = createSynthesizedNode(229 /* DoStatement */); node.statement = asEmbeddedStatement(statement); node.expression = expression; return node; @@ -70116,7 +70515,7 @@ var ts; } ts.updateDo = updateDo; function createWhile(expression, statement) { - var node = createSynthesizedNode(229 /* WhileStatement */); + var node = createSynthesizedNode(230 /* WhileStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -70130,7 +70529,7 @@ var ts; } ts.updateWhile = updateWhile; function createFor(initializer, condition, incrementor, statement) { - var node = createSynthesizedNode(230 /* ForStatement */); + var node = createSynthesizedNode(231 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -70148,7 +70547,7 @@ var ts; } ts.updateFor = updateFor; function createForIn(initializer, expression, statement) { - var node = createSynthesizedNode(231 /* ForInStatement */); + var node = createSynthesizedNode(232 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = asEmbeddedStatement(statement); @@ -70164,7 +70563,7 @@ var ts; } ts.updateForIn = updateForIn; function createForOf(awaitModifier, initializer, expression, statement) { - var node = createSynthesizedNode(232 /* ForOfStatement */); + var node = createSynthesizedNode(233 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = ts.isCommaSequence(expression) ? createParen(expression) : expression; @@ -70182,7 +70581,7 @@ var ts; } ts.updateForOf = updateForOf; function createContinue(label) { - var node = createSynthesizedNode(233 /* ContinueStatement */); + var node = createSynthesizedNode(234 /* ContinueStatement */); node.label = asName(label); return node; } @@ -70194,7 +70593,7 @@ var ts; } ts.updateContinue = updateContinue; function createBreak(label) { - var node = createSynthesizedNode(234 /* BreakStatement */); + var node = createSynthesizedNode(235 /* BreakStatement */); node.label = asName(label); return node; } @@ -70206,7 +70605,7 @@ var ts; } ts.updateBreak = updateBreak; function createReturn(expression) { - var node = createSynthesizedNode(235 /* ReturnStatement */); + var node = createSynthesizedNode(236 /* ReturnStatement */); node.expression = expression; return node; } @@ -70218,7 +70617,7 @@ var ts; } ts.updateReturn = updateReturn; function createWith(expression, statement) { - var node = createSynthesizedNode(236 /* WithStatement */); + var node = createSynthesizedNode(237 /* WithStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -70232,7 +70631,7 @@ var ts; } ts.updateWith = updateWith; function createSwitch(expression, caseBlock) { - var node = createSynthesizedNode(237 /* SwitchStatement */); + var node = createSynthesizedNode(238 /* SwitchStatement */); node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; @@ -70246,7 +70645,7 @@ var ts; } ts.updateSwitch = updateSwitch; function createLabel(label, statement) { - var node = createSynthesizedNode(238 /* LabeledStatement */); + var node = createSynthesizedNode(239 /* LabeledStatement */); node.label = asName(label); node.statement = asEmbeddedStatement(statement); return node; @@ -70260,7 +70659,7 @@ var ts; } ts.updateLabel = updateLabel; function createThrow(expression) { - var node = createSynthesizedNode(239 /* ThrowStatement */); + var node = createSynthesizedNode(240 /* ThrowStatement */); node.expression = expression; return node; } @@ -70272,7 +70671,7 @@ var ts; } ts.updateThrow = updateThrow; function createTry(tryBlock, catchClause, finallyBlock) { - var node = createSynthesizedNode(240 /* TryStatement */); + var node = createSynthesizedNode(241 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -70288,12 +70687,12 @@ var ts; } ts.updateTry = updateTry; function createDebuggerStatement() { - return createSynthesizedNode(241 /* DebuggerStatement */); + return createSynthesizedNode(242 /* DebuggerStatement */); } ts.createDebuggerStatement = createDebuggerStatement; function createVariableDeclaration(name, type, initializer) { /* Internally, one should probably use createTypeScriptVariableDeclaration instead and handle definite assignment assertions */ - var node = createSynthesizedNode(242 /* VariableDeclaration */); + var node = createSynthesizedNode(243 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -70311,7 +70710,7 @@ var ts; ts.updateVariableDeclaration = updateVariableDeclaration; /* @internal */ function createTypeScriptVariableDeclaration(name, exclaimationToken, type, initializer) { - var node = createSynthesizedNode(242 /* VariableDeclaration */); + var node = createSynthesizedNode(243 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -70331,7 +70730,7 @@ var ts; ts.updateTypeScriptVariableDeclaration = updateTypeScriptVariableDeclaration; function createVariableDeclarationList(declarations, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(243 /* VariableDeclarationList */); + var node = createSynthesizedNode(244 /* VariableDeclarationList */); node.flags |= flags & 3 /* BlockScoped */; node.declarations = createNodeArray(declarations); return node; @@ -70344,7 +70743,7 @@ var ts; } ts.updateVariableDeclarationList = updateVariableDeclarationList; function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(244 /* FunctionDeclaration */); + var node = createSynthesizedNode(245 /* FunctionDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -70370,7 +70769,7 @@ var ts; } ts.updateFunctionDeclaration = updateFunctionDeclaration; function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(245 /* ClassDeclaration */); + var node = createSynthesizedNode(246 /* ClassDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70392,7 +70791,7 @@ var ts; } ts.updateClassDeclaration = updateClassDeclaration; function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(246 /* InterfaceDeclaration */); + var node = createSynthesizedNode(247 /* InterfaceDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70414,7 +70813,7 @@ var ts; } ts.updateInterfaceDeclaration = updateInterfaceDeclaration; function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createSynthesizedNode(247 /* TypeAliasDeclaration */); + var node = createSynthesizedNode(248 /* TypeAliasDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70434,7 +70833,7 @@ var ts; } ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration; function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createSynthesizedNode(248 /* EnumDeclaration */); + var node = createSynthesizedNode(249 /* EnumDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70453,7 +70852,7 @@ var ts; ts.updateEnumDeclaration = updateEnumDeclaration; function createModuleDeclaration(decorators, modifiers, name, body, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(249 /* ModuleDeclaration */); + var node = createSynthesizedNode(250 /* ModuleDeclaration */); node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); @@ -70472,7 +70871,7 @@ var ts; } ts.updateModuleDeclaration = updateModuleDeclaration; function createModuleBlock(statements) { - var node = createSynthesizedNode(250 /* ModuleBlock */); + var node = createSynthesizedNode(251 /* ModuleBlock */); node.statements = createNodeArray(statements); return node; } @@ -70484,7 +70883,7 @@ var ts; } ts.updateModuleBlock = updateModuleBlock; function createCaseBlock(clauses) { - var node = createSynthesizedNode(251 /* CaseBlock */); + var node = createSynthesizedNode(252 /* CaseBlock */); node.clauses = createNodeArray(clauses); return node; } @@ -70496,7 +70895,7 @@ var ts; } ts.updateCaseBlock = updateCaseBlock; function createNamespaceExportDeclaration(name) { - var node = createSynthesizedNode(252 /* NamespaceExportDeclaration */); + var node = createSynthesizedNode(253 /* NamespaceExportDeclaration */); node.name = asName(name); return node; } @@ -70508,7 +70907,7 @@ var ts; } ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration; function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createSynthesizedNode(253 /* ImportEqualsDeclaration */); + var node = createSynthesizedNode(254 /* ImportEqualsDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70526,7 +70925,7 @@ var ts; } ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createSynthesizedNode(254 /* ImportDeclaration */); + var node = createSynthesizedNode(255 /* ImportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -70545,7 +70944,7 @@ var ts; ts.updateImportDeclaration = updateImportDeclaration; function createImportClause(name, namedBindings, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(255 /* ImportClause */); + var node = createSynthesizedNode(256 /* ImportClause */); node.name = name; node.namedBindings = namedBindings; node.isTypeOnly = isTypeOnly; @@ -70561,13 +70960,13 @@ var ts; } ts.updateImportClause = updateImportClause; function createNamespaceImport(name) { - var node = createSynthesizedNode(256 /* NamespaceImport */); + var node = createSynthesizedNode(257 /* NamespaceImport */); node.name = name; return node; } ts.createNamespaceImport = createNamespaceImport; function createNamespaceExport(name) { - var node = createSynthesizedNode(262 /* NamespaceExport */); + var node = createSynthesizedNode(263 /* NamespaceExport */); node.name = name; return node; } @@ -70585,7 +70984,7 @@ var ts; } ts.updateNamespaceExport = updateNamespaceExport; function createNamedImports(elements) { - var node = createSynthesizedNode(257 /* NamedImports */); + var node = createSynthesizedNode(258 /* NamedImports */); node.elements = createNodeArray(elements); return node; } @@ -70597,7 +70996,7 @@ var ts; } ts.updateNamedImports = updateNamedImports; function createImportSpecifier(propertyName, name) { - var node = createSynthesizedNode(258 /* ImportSpecifier */); + var node = createSynthesizedNode(259 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; return node; @@ -70611,7 +71010,7 @@ var ts; } ts.updateImportSpecifier = updateImportSpecifier; function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createSynthesizedNode(259 /* ExportAssignment */); + var node = createSynthesizedNode(260 /* ExportAssignment */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -70629,7 +71028,7 @@ var ts; ts.updateExportAssignment = updateExportAssignment; function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(260 /* ExportDeclaration */); + var node = createSynthesizedNode(261 /* ExportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isTypeOnly = isTypeOnly; @@ -70654,7 +71053,7 @@ var ts; } ts.createEmptyExports = createEmptyExports; function createNamedExports(elements) { - var node = createSynthesizedNode(261 /* NamedExports */); + var node = createSynthesizedNode(262 /* NamedExports */); node.elements = createNodeArray(elements); return node; } @@ -70666,7 +71065,7 @@ var ts; } ts.updateNamedExports = updateNamedExports; function createExportSpecifier(propertyName, name) { - var node = createSynthesizedNode(263 /* ExportSpecifier */); + var node = createSynthesizedNode(264 /* ExportSpecifier */); node.propertyName = asName(propertyName); node.name = asName(name); return node; @@ -70681,7 +71080,7 @@ var ts; ts.updateExportSpecifier = updateExportSpecifier; // Module references function createExternalModuleReference(expression) { - var node = createSynthesizedNode(265 /* ExternalModuleReference */); + var node = createSynthesizedNode(266 /* ExternalModuleReference */); node.expression = expression; return node; } @@ -70695,14 +71094,14 @@ var ts; // JSDoc /* @internal */ function createJSDocTypeExpression(type) { - var node = createSynthesizedNode(294 /* JSDocTypeExpression */); + var node = createSynthesizedNode(295 /* JSDocTypeExpression */); node.type = type; return node; } ts.createJSDocTypeExpression = createJSDocTypeExpression; /* @internal */ function createJSDocTypeTag(typeExpression, comment) { - var tag = createJSDocTag(320 /* JSDocTypeTag */, "type"); + var tag = createJSDocTag(321 /* JSDocTypeTag */, "type"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -70710,7 +71109,7 @@ var ts; ts.createJSDocTypeTag = createJSDocTypeTag; /* @internal */ function createJSDocReturnTag(typeExpression, comment) { - var tag = createJSDocTag(318 /* JSDocReturnTag */, "returns"); + var tag = createJSDocTag(319 /* JSDocReturnTag */, "returns"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -70718,14 +71117,14 @@ var ts; ts.createJSDocReturnTag = createJSDocReturnTag; /** @internal */ function createJSDocThisTag(typeExpression) { - var tag = createJSDocTag(319 /* JSDocThisTag */, "this"); + var tag = createJSDocTag(320 /* JSDocThisTag */, "this"); tag.typeExpression = typeExpression; return tag; } ts.createJSDocThisTag = createJSDocThisTag; /* @internal */ function createJSDocParamTag(name, isBracketed, typeExpression, comment) { - var tag = createJSDocTag(317 /* JSDocParameterTag */, "param"); + var tag = createJSDocTag(318 /* JSDocParameterTag */, "param"); tag.typeExpression = typeExpression; tag.name = name; tag.isBracketed = isBracketed; @@ -70735,7 +71134,7 @@ var ts; ts.createJSDocParamTag = createJSDocParamTag; /* @internal */ function createJSDocComment(comment, tags) { - var node = createSynthesizedNode(303 /* JSDocComment */); + var node = createSynthesizedNode(304 /* JSDocComment */); node.comment = comment; node.tags = tags; return node; @@ -70749,7 +71148,7 @@ var ts; } // JSX function createJsxElement(openingElement, children, closingElement) { - var node = createSynthesizedNode(266 /* JsxElement */); + var node = createSynthesizedNode(267 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -70765,7 +71164,7 @@ var ts; } ts.updateJsxElement = updateJsxElement; function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(267 /* JsxSelfClosingElement */); + var node = createSynthesizedNode(268 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -70781,7 +71180,7 @@ var ts; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; function createJsxOpeningElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(268 /* JsxOpeningElement */); + var node = createSynthesizedNode(269 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -70797,7 +71196,7 @@ var ts; } ts.updateJsxOpeningElement = updateJsxOpeningElement; function createJsxClosingElement(tagName) { - var node = createSynthesizedNode(269 /* JsxClosingElement */); + var node = createSynthesizedNode(270 /* JsxClosingElement */); node.tagName = tagName; return node; } @@ -70809,7 +71208,7 @@ var ts; } ts.updateJsxClosingElement = updateJsxClosingElement; function createJsxFragment(openingFragment, children, closingFragment) { - var node = createSynthesizedNode(270 /* JsxFragment */); + var node = createSynthesizedNode(271 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -70831,11 +71230,11 @@ var ts; } ts.updateJsxText = updateJsxText; function createJsxOpeningFragment() { - return createSynthesizedNode(271 /* JsxOpeningFragment */); + return createSynthesizedNode(272 /* JsxOpeningFragment */); } ts.createJsxOpeningFragment = createJsxOpeningFragment; function createJsxJsxClosingFragment() { - return createSynthesizedNode(272 /* JsxClosingFragment */); + return createSynthesizedNode(273 /* JsxClosingFragment */); } ts.createJsxJsxClosingFragment = createJsxJsxClosingFragment; function updateJsxFragment(node, openingFragment, children, closingFragment) { @@ -70847,7 +71246,7 @@ var ts; } ts.updateJsxFragment = updateJsxFragment; function createJsxAttribute(name, initializer) { - var node = createSynthesizedNode(273 /* JsxAttribute */); + var node = createSynthesizedNode(274 /* JsxAttribute */); node.name = name; node.initializer = initializer; return node; @@ -70861,7 +71260,7 @@ var ts; } ts.updateJsxAttribute = updateJsxAttribute; function createJsxAttributes(properties) { - var node = createSynthesizedNode(274 /* JsxAttributes */); + var node = createSynthesizedNode(275 /* JsxAttributes */); node.properties = createNodeArray(properties); return node; } @@ -70873,7 +71272,7 @@ var ts; } ts.updateJsxAttributes = updateJsxAttributes; function createJsxSpreadAttribute(expression) { - var node = createSynthesizedNode(275 /* JsxSpreadAttribute */); + var node = createSynthesizedNode(276 /* JsxSpreadAttribute */); node.expression = expression; return node; } @@ -70885,7 +71284,7 @@ var ts; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; function createJsxExpression(dotDotDotToken, expression) { - var node = createSynthesizedNode(276 /* JsxExpression */); + var node = createSynthesizedNode(277 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; @@ -70899,7 +71298,7 @@ var ts; ts.updateJsxExpression = updateJsxExpression; // Clauses function createCaseClause(expression, statements) { - var node = createSynthesizedNode(277 /* CaseClause */); + var node = createSynthesizedNode(278 /* CaseClause */); node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; @@ -70913,7 +71312,7 @@ var ts; } ts.updateCaseClause = updateCaseClause; function createDefaultClause(statements) { - var node = createSynthesizedNode(278 /* DefaultClause */); + var node = createSynthesizedNode(279 /* DefaultClause */); node.statements = createNodeArray(statements); return node; } @@ -70925,7 +71324,7 @@ var ts; } ts.updateDefaultClause = updateDefaultClause; function createHeritageClause(token, types) { - var node = createSynthesizedNode(279 /* HeritageClause */); + var node = createSynthesizedNode(280 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); return node; @@ -70938,7 +71337,7 @@ var ts; } ts.updateHeritageClause = updateHeritageClause; function createCatchClause(variableDeclaration, block) { - var node = createSynthesizedNode(280 /* CatchClause */); + var node = createSynthesizedNode(281 /* CatchClause */); node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -70953,7 +71352,7 @@ var ts; ts.updateCatchClause = updateCatchClause; // Property assignments function createPropertyAssignment(name, initializer) { - var node = createSynthesizedNode(281 /* PropertyAssignment */); + var node = createSynthesizedNode(282 /* PropertyAssignment */); node.name = asName(name); node.questionToken = undefined; node.initializer = ts.parenthesizeExpressionForList(initializer); @@ -70968,7 +71367,7 @@ var ts; } ts.updatePropertyAssignment = updatePropertyAssignment; function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createSynthesizedNode(282 /* ShorthandPropertyAssignment */); + var node = createSynthesizedNode(283 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; @@ -70982,7 +71381,7 @@ var ts; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; function createSpreadAssignment(expression) { - var node = createSynthesizedNode(283 /* SpreadAssignment */); + var node = createSynthesizedNode(284 /* SpreadAssignment */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -70995,7 +71394,7 @@ var ts; ts.updateSpreadAssignment = updateSpreadAssignment; // Enum function createEnumMember(name, initializer) { - var node = createSynthesizedNode(284 /* EnumMember */); + var node = createSynthesizedNode(285 /* EnumMember */); node.name = asName(name); node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); return node; @@ -71016,7 +71415,7 @@ var ts; (typeReferences !== undefined && node.typeReferenceDirectives !== typeReferences) || (libReferences !== undefined && node.libReferenceDirectives !== libReferences) || (hasNoDefaultLib !== undefined && node.hasNoDefaultLib !== hasNoDefaultLib)) { - var updated = createSynthesizedNode(290 /* SourceFile */); + var updated = createSynthesizedNode(291 /* SourceFile */); updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; @@ -71100,7 +71499,7 @@ var ts; * @param original The original statement. */ function createNotEmittedStatement(original) { - var node = createSynthesizedNode(325 /* NotEmittedStatement */); + var node = createSynthesizedNode(326 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; @@ -71112,7 +71511,7 @@ var ts; */ /* @internal */ function createEndOfDeclarationMarker(original) { - var node = createSynthesizedNode(329 /* EndOfDeclarationMarker */); + var node = createSynthesizedNode(330 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -71124,7 +71523,7 @@ var ts; */ /* @internal */ function createMergeDeclarationMarker(original) { - var node = createSynthesizedNode(328 /* MergeDeclarationMarker */); + var node = createSynthesizedNode(329 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -71139,7 +71538,7 @@ var ts; * @param location The location for the expression. Defaults to the positions from "original" if provided. */ function createPartiallyEmittedExpression(expression, original) { - var node = createSynthesizedNode(326 /* PartiallyEmittedExpression */); + var node = createSynthesizedNode(327 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; setTextRange(node, original); @@ -71155,7 +71554,7 @@ var ts; ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; function flattenCommaElements(node) { if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { - if (node.kind === 327 /* CommaListExpression */) { + if (node.kind === 328 /* CommaListExpression */) { return node.elements; } if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) { @@ -71165,7 +71564,7 @@ var ts; return node; } function createCommaList(elements) { - var node = createSynthesizedNode(327 /* CommaListExpression */); + var node = createSynthesizedNode(328 /* CommaListExpression */); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); return node; } @@ -71178,7 +71577,7 @@ var ts; ts.updateCommaList = updateCommaList; /* @internal */ function createSyntheticReferenceExpression(expression, thisArg) { - var node = createSynthesizedNode(330 /* SyntheticReferenceExpression */); + var node = createSynthesizedNode(331 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; return node; @@ -71194,7 +71593,7 @@ var ts; ts.updateSyntheticReferenceExpression = updateSyntheticReferenceExpression; function createBundle(sourceFiles, prepends) { if (prepends === void 0) { prepends = ts.emptyArray; } - var node = ts.createNode(291 /* Bundle */); + var node = ts.createNode(292 /* Bundle */); node.prepends = prepends; node.sourceFiles = sourceFiles; return node; @@ -71229,7 +71628,7 @@ var ts; ], function (helper) { return helper.name; })); } function createUnparsedSource() { - var node = ts.createNode(292 /* UnparsedSource */); + var node = ts.createNode(293 /* UnparsedSource */); node.prologues = ts.emptyArray; node.referencedFiles = ts.emptyArray; node.libReferenceDirectives = ts.emptyArray; @@ -71364,10 +71763,10 @@ var ts; } function mapBundleFileSectionKindToSyntaxKind(kind) { switch (kind) { - case "prologue" /* Prologue */: return 285 /* UnparsedPrologue */; - case "prepend" /* Prepend */: return 286 /* UnparsedPrepend */; - case "internal" /* Internal */: return 288 /* UnparsedInternalText */; - case "text" /* Text */: return 287 /* UnparsedText */; + case "prologue" /* Prologue */: return 286 /* UnparsedPrologue */; + case "prepend" /* Prepend */: return 287 /* UnparsedPrepend */; + case "internal" /* Internal */: return 289 /* UnparsedInternalText */; + case "text" /* Text */: return 288 /* UnparsedText */; case "emitHelpers" /* EmitHelpers */: case "no-default-lib" /* NoDefaultLib */: case "reference" /* Reference */: @@ -71385,14 +71784,14 @@ var ts; return node; } function createUnparsedSyntheticReference(section, parent) { - var node = ts.createNode(289 /* UnparsedSyntheticReference */, section.pos, section.end); + var node = ts.createNode(290 /* UnparsedSyntheticReference */, section.pos, section.end); node.parent = parent; node.data = section.data; node.section = section; return node; } function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapTextOrBuildInfoPath, javascriptPath, declarationPath, buildInfoPath, buildInfo, oldFileOfCurrentEmit) { - var node = ts.createNode(293 /* InputFiles */); + var node = ts.createNode(294 /* InputFiles */); if (!ts.isString(javascriptTextOrReadFileText)) { var cache_1 = ts.createMap(); var textGetter_1 = function (path) { @@ -71589,7 +71988,7 @@ var ts; // To avoid holding onto transformation artifacts, we keep track of any // parse tree node we are annotating. This allows us to clean them up after // all transformations have completed. - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node))); @@ -72130,7 +72529,7 @@ var ts; if (!outermostLabeledStatement) { return node; } - var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 238 /* LabeledStatement */ + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 239 /* LabeledStatement */ ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node); if (afterRestoreLabelCallback) { @@ -72149,13 +72548,13 @@ var ts; case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: return false; - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -72182,7 +72581,7 @@ var ts; } else { switch (callee.kind) { - case 194 /* PropertyAccessExpression */: { + case 195 /* PropertyAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a.b()` target is `(_a = a).b` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -72195,7 +72594,7 @@ var ts; } break; } - case 195 /* ElementAccessExpression */: { + case 196 /* ElementAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -72255,14 +72654,14 @@ var ts; ts.Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); } switch (property.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return createExpressionForAccessorDeclaration(node.properties, property, receiver, !!node.multiLine); - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return createExpressionForPropertyAssignment(property, receiver); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return createExpressionForMethodDeclaration(property, receiver); } } @@ -72588,7 +72987,7 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 200 /* ParenthesizedExpression */) { + if (skipped.kind === 201 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -72622,10 +73021,10 @@ var ts; // // If `a ** d` is on the left of operator `**`, we need to parenthesize to preserve // the intended order of operations: `(a ** b) ** c` - var binaryOperatorPrecedence = ts.getOperatorPrecedence(209 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(209 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(210 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(210 /* BinaryExpression */, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 202 /* ArrowFunction */ && binaryOperatorPrecedence > 3) { + if (!isLeftSideOfBinary && operand.kind === 203 /* ArrowFunction */ && binaryOperatorPrecedence > 3) { // We need to parenthesize arrow functions on the right side to avoid it being // parsed as parenthesized expression: `a && (() => {})` return true; @@ -72637,7 +73036,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 212 /* YieldExpression */) { + && operand.kind === 213 /* YieldExpression */) { return false; } return true; @@ -72725,7 +73124,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { + if (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -72738,7 +73137,7 @@ var ts; return 0 /* Unknown */; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(210 /* ConditionalExpression */, 57 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(211 /* ConditionalExpression */, 57 /* QuestionToken */); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) { @@ -72773,8 +73172,8 @@ var ts; var needsParens = isCommaSequence(check); if (!needsParens) { switch (getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) { - case 214 /* ClassExpression */: - case 201 /* FunctionExpression */: + case 215 /* ClassExpression */: + case 202 /* FunctionExpression */: needsParens = true; } } @@ -72790,9 +73189,9 @@ var ts; function parenthesizeForNew(expression) { var leftmostExpr = getLeftmostExpression(expression, /*stopAtCallExpressions*/ true); switch (leftmostExpr.kind) { - case 196 /* CallExpression */: + case 197 /* CallExpression */: return ts.createParen(expression); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return !leftmostExpr.arguments ? ts.createParen(expression) : expression; @@ -72815,7 +73214,7 @@ var ts; // var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 197 /* NewExpression */ || emittedExpression.arguments)) { + && (emittedExpression.kind !== 198 /* NewExpression */ || emittedExpression.arguments)) { return expression; } return ts.setTextRange(ts.createParen(expression), expression); @@ -72853,7 +73252,7 @@ var ts; function parenthesizeExpressionForList(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(209 /* BinaryExpression */, 27 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(210 /* BinaryExpression */, 27 /* CommaToken */); return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(ts.createParen(expression), expression); @@ -72864,29 +73263,29 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 201 /* FunctionExpression */ || kind === 202 /* ArrowFunction */) { + if (kind === 202 /* FunctionExpression */ || kind === 203 /* ArrowFunction */) { var mutableCall = ts.getMutableClone(emittedExpression); mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); return recreateOuterExpressions(expression, mutableCall, 4 /* PartiallyEmittedExpressions */); } } var leftmostExpressionKind = getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind; - if (leftmostExpressionKind === 193 /* ObjectLiteralExpression */ || leftmostExpressionKind === 201 /* FunctionExpression */) { + if (leftmostExpressionKind === 194 /* ObjectLiteralExpression */ || leftmostExpressionKind === 202 /* FunctionExpression */) { return ts.setTextRange(ts.createParen(expression), expression); } return expression; } ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; function parenthesizeConditionalTypeMember(member) { - return member.kind === 180 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; + return member.kind === 181 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; } ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember; function parenthesizeElementTypeMember(member) { switch (member.kind) { - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: return ts.createParenthesizedType(member); } return parenthesizeConditionalTypeMember(member); @@ -72894,9 +73293,9 @@ var ts; ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember; function parenthesizeArrayTypeMember(member) { switch (member.kind) { - case 172 /* TypeQuery */: - case 184 /* TypeOperator */: - case 181 /* InferType */: + case 173 /* TypeQuery */: + case 185 /* TypeOperator */: + case 182 /* InferType */: return ts.createParenthesizedType(member); } return parenthesizeElementTypeMember(member); @@ -72922,28 +73321,28 @@ var ts; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: node = node.operand; continue; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: node = node.left; continue; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: node = node.condition; continue; - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: node = node.tag; continue; - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 217 /* AsExpression */: - case 195 /* ElementAccessExpression */: - case 194 /* PropertyAccessExpression */: - case 218 /* NonNullExpression */: - case 326 /* PartiallyEmittedExpression */: + case 218 /* AsExpression */: + case 196 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 219 /* NonNullExpression */: + case 327 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -72952,15 +73351,15 @@ var ts; } ts.getLeftmostExpression = getLeftmostExpression; function parenthesizeConciseBody(body) { - if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 193 /* ObjectLiteralExpression */)) { + if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 194 /* ObjectLiteralExpression */)) { return ts.setTextRange(ts.createParen(body), body); } return body; } ts.parenthesizeConciseBody = parenthesizeConciseBody; function isCommaSequence(node) { - return node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || - node.kind === 327 /* CommaListExpression */; + return node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || + node.kind === 328 /* CommaListExpression */; } ts.isCommaSequence = isCommaSequence; var OuterExpressionKinds; @@ -72973,13 +73372,13 @@ var ts; function isOuterExpression(node, kinds) { if (kinds === void 0) { kinds = 7 /* All */; } switch (node.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return (kinds & 1 /* Parentheses */) !== 0; - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: - case 218 /* NonNullExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: + case 219 /* NonNullExpression */: return (kinds & 2 /* Assertions */) !== 0; - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: return (kinds & 4 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -73004,7 +73403,7 @@ var ts; } ts.skipOuterExpressions = skipOuterExpressions; function skipAssertions(node) { - while (ts.isAssertionExpression(node) || node.kind === 218 /* NonNullExpression */) { + while (ts.isAssertionExpression(node) || node.kind === 219 /* NonNullExpression */) { node = node.expression; } return node; @@ -73012,11 +73411,11 @@ var ts; ts.skipAssertions = skipAssertions; function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 200 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); - case 199 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 217 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); - case 218 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); - case 326 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); + case 201 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); + case 200 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 218 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); + case 219 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); + case 327 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); } } /** @@ -73034,7 +73433,7 @@ var ts; * the containing expression is created/updated. */ function isIgnorableParen(node) { - return node.kind === 200 /* ParenthesizedExpression */ + return node.kind === 201 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node) && ts.nodeIsSynthesized(ts.getSourceMapRange(node)) && ts.nodeIsSynthesized(ts.getCommentRange(node)) @@ -73152,10 +73551,10 @@ var ts; var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 254 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 255 /* ImportDeclaration */ && node.importClause) { return ts.getGeneratedNameForNode(node); } - if (node.kind === 260 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 261 /* ExportDeclaration */ && node.moduleSpecifier) { return ts.getGeneratedNameForNode(node); } return undefined; @@ -73274,7 +73673,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -73286,11 +73685,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -73322,12 +73721,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 156 /* Parameter */: - case 191 /* BindingElement */: + case 157 /* Parameter */: + case 192 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 213 /* SpreadElement */: - case 283 /* SpreadAssignment */: + case 214 /* SpreadElement */: + case 284 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -73345,7 +73744,7 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 191 /* BindingElement */: + case 192 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -73360,7 +73759,7 @@ var ts; : propertyName; } break; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -73375,7 +73774,7 @@ var ts; : propertyName; } break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` if (bindingElement.name && ts.isPrivateIdentifier(bindingElement.name)) { return ts.Debug.failBadSyntaxKind(bindingElement.name); @@ -73398,13 +73797,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: - case 192 /* ArrayLiteralExpression */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: + case 193 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -73444,11 +73843,11 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 190 /* ArrayBindingPattern */: - case 192 /* ArrayLiteralExpression */: + case 191 /* ArrayBindingPattern */: + case 193 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 189 /* ObjectBindingPattern */: - case 193 /* ObjectLiteralExpression */: + case 190 /* ObjectBindingPattern */: + case 194 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -73607,289 +74006,289 @@ var ts; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 152 /* LastToken */) || kind === 183 /* ThisType */) { + if ((kind > 0 /* FirstToken */ && kind <= 153 /* LastToken */) || kind === 184 /* ThisType */) { return node; } switch (kind) { // Names case 75 /* Identifier */: return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); // Signature elements - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); - case 156 /* Parameter */: + case 157 /* Parameter */: return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 157 /* Decorator */: + case 158 /* Decorator */: return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); // Type elements - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), // QuestionToken and ExclamationToken is uniqued in Property Declaration and the signature of 'updateProperty' is that too visitNode(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 160 /* MethodSignature */: + case 161 /* MethodSignature */: return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 162 /* Constructor */: + case 163 /* Constructor */: return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 165 /* CallSignature */: + case 166 /* CallSignature */: return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); // Types - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return ts.updateTypePredicateNodeWithModifier(node, visitNode(node.assertsModifier, visitor), visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 170 /* FunctionType */: + case 171 /* FunctionType */: return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 171 /* ConstructorType */: + case 172 /* ConstructorType */: return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 174 /* ArrayType */: + case 175 /* ArrayType */: return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); - case 175 /* TupleType */: + case 176 /* TupleType */: return ts.updateTupleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); - case 176 /* OptionalType */: + case 177 /* OptionalType */: return ts.updateOptionalTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 177 /* RestType */: + case 178 /* RestType */: return ts.updateRestTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 178 /* UnionType */: + case 179 /* UnionType */: return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 179 /* IntersectionType */: + case 180 /* IntersectionType */: return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode)); - case 181 /* InferType */: + case 182 /* InferType */: return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); - case 188 /* ImportType */: + case 189 /* ImportType */: return ts.updateImportTypeNode(node, visitNode(node.argument, visitor, ts.isTypeNode), visitNode(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf); - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 184 /* TypeOperator */: + case 185 /* TypeOperator */: return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); - case 186 /* MappedType */: + case 187 /* MappedType */: return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 187 /* LiteralType */: + case 188 /* LiteralType */: return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); // Binding patterns - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); // Expression - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: if (node.flags & 32 /* OptionalChain */) { - return ts.updatePropertyAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, visitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier)); + return ts.updatePropertyAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier)); } return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifierOrPrivateIdentifier)); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: if (node.flags & 32 /* OptionalChain */) { - return ts.updateElementAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, visitor, ts.isToken), visitNode(node.argumentExpression, visitor, ts.isExpression)); + return ts.updateElementAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.argumentExpression, visitor, ts.isExpression)); } return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { - return ts.updateCallChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, visitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + return ts.updateCallChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); } return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 202 /* ArrowFunction */: - return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, visitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); - case 203 /* DeleteExpression */: + case 203 /* ArrowFunction */: + return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, tokenVisitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); + case 204 /* DeleteExpression */: return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 209 /* BinaryExpression */: - return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, visitor, ts.isToken)); - case 210 /* ConditionalExpression */: - return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, visitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 211 /* TemplateExpression */: + case 210 /* BinaryExpression */: + return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, tokenVisitor, ts.isToken)); + case 211 /* ConditionalExpression */: + return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, tokenVisitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); + case 212 /* TemplateExpression */: return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 217 /* AsExpression */: + case 218 /* AsExpression */: return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); // Misc - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 223 /* Block */: + case 224 /* Block */: return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return ts.updateExpressionStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 232 /* ForOfStatement */: - return ts.updateForOf(node, visitNode(node.awaitModifier, visitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 233 /* ContinueStatement */: + case 233 /* ForOfStatement */: + return ts.updateForOf(node, visitNode(node.awaitModifier, tokenVisitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 234 /* ContinueStatement */: return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 234 /* BreakStatement */: + case 235 /* BreakStatement */: return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return ts.updateTypeScriptVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings), node.isTypeOnly); - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: return ts.updateNamespaceExport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 257 /* NamedImports */: + case 258 /* NamedImports */: return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExportBindings), visitNode(node.moduleSpecifier, visitor, ts.isExpression), node.isTypeOnly); - case 261 /* NamedExports */: + case 262 /* NamedExports */: return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); // Module references - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); // JSX - case 266 /* JsxElement */: + case 267 /* JsxElement */: return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 268 /* JsxOpeningElement */: + case 269 /* JsxOpeningElement */: return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 275 /* JsxSpreadAttribute */: + case 276 /* JsxSpreadAttribute */: return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Clauses - case 277 /* CaseClause */: + case 278 /* CaseClause */: return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); // Property assignments - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); // Enum - case 284 /* EnumMember */: + case 285 /* EnumMember */: return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 290 /* SourceFile */: + case 291 /* SourceFile */: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: // No need to visit nodes with no children. @@ -73932,58 +74331,58 @@ var ts; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 152 /* LastToken */)) { + if ((kind > 0 /* FirstToken */ && kind <= 153 /* LastToken */)) { return initial; } // We do not yet support types. - if ((kind >= 168 /* TypePredicate */ && kind <= 187 /* LiteralType */)) { + if ((kind >= 169 /* TypePredicate */ && kind <= 188 /* LiteralType */)) { return initial; } var result = initial; switch (node.kind) { // Leaf nodes - case 222 /* SemicolonClassElement */: - case 224 /* EmptyStatement */: - case 215 /* OmittedExpression */: - case 241 /* DebuggerStatement */: - case 325 /* NotEmittedStatement */: + case 223 /* SemicolonClassElement */: + case 225 /* EmptyStatement */: + case 216 /* OmittedExpression */: + case 242 /* DebuggerStatement */: + case 326 /* NotEmittedStatement */: // No need to visit nodes with no children. break; // Names - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: result = reduceNode(node.expression, cbNode, result); break; // Signature elements - case 156 /* Parameter */: + case 157 /* Parameter */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 157 /* Decorator */: + case 158 /* Decorator */: result = reduceNode(node.expression, cbNode, result); break; // Type member - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.questionToken, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -73992,12 +74391,12 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 162 /* Constructor */: + case 163 /* Constructor */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74005,7 +74404,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74013,50 +74412,50 @@ var ts; result = reduceNode(node.body, cbNode, result); break; // Binding patterns - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: result = reduceNodes(node.elements, cbNodes, result); break; - case 191 /* BindingElement */: + case 192 /* BindingElement */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Expression - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: result = reduceNodes(node.elements, cbNodes, result); break; - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: result = reduceNodes(node.properties, cbNodes, result); break; - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.argumentExpression, cbNode, result); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 197 /* NewExpression */: + case 198 /* NewExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: result = reduceNode(node.tag, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNode(node.template, cbNode, result); break; - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: result = reduceNode(node.type, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -74064,123 +74463,123 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 200 /* ParenthesizedExpression */: - case 203 /* DeleteExpression */: - case 204 /* TypeOfExpression */: - case 205 /* VoidExpression */: - case 206 /* AwaitExpression */: - case 212 /* YieldExpression */: - case 213 /* SpreadElement */: - case 218 /* NonNullExpression */: + case 201 /* ParenthesizedExpression */: + case 204 /* DeleteExpression */: + case 205 /* TypeOfExpression */: + case 206 /* VoidExpression */: + case 207 /* AwaitExpression */: + case 213 /* YieldExpression */: + case 214 /* SpreadElement */: + case 219 /* NonNullExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: result = reduceNode(node.operand, cbNode, result); break; - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; - case 217 /* AsExpression */: + case 218 /* AsExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.type, cbNode, result); break; // Misc - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; // Element - case 223 /* Block */: + case 224 /* Block */: result = reduceNodes(node.statements, cbNodes, result); break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 227 /* IfStatement */: + case 228 /* IfStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 228 /* DoStatement */: + case 229 /* DoStatement */: result = reduceNode(node.statement, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 229 /* WhileStatement */: - case 236 /* WithStatement */: + case 230 /* WhileStatement */: + case 237 /* WithStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 230 /* ForStatement */: + case 231 /* ForStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 235 /* ReturnStatement */: - case 239 /* ThrowStatement */: + case 236 /* ReturnStatement */: + case 240 /* ThrowStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 240 /* TryStatement */: + case 241 /* TryStatement */: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: result = reduceNodes(node.declarations, cbNodes, result); break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74189,7 +74588,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74197,143 +74596,143 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.members, cbNodes, result); break; - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: result = reduceNodes(node.statements, cbNodes, result); break; - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: result = reduceNodes(node.clauses, cbNodes, result); break; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.moduleReference, cbNode, result); break; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 255 /* ImportClause */: + case 256 /* ImportClause */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: result = reduceNode(node.name, cbNode, result); break; - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: result = reduceNode(node.name, cbNode, result); break; - case 257 /* NamedImports */: - case 261 /* NamedExports */: + case 258 /* NamedImports */: + case 262 /* NamedExports */: result = reduceNodes(node.elements, cbNodes, result); break; - case 258 /* ImportSpecifier */: - case 263 /* ExportSpecifier */: + case 259 /* ImportSpecifier */: + case 264 /* ExportSpecifier */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; // Module references - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: result = reduceNode(node.expression, cbNode, result); break; // JSX - case 266 /* JsxElement */: + case 267 /* JsxElement */: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: result = reduceNode(node.openingFragment, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingFragment, cbNode, result); break; - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: result = reduceNode(node.tagName, cbNode, result); result = reduceNodes(node.typeArguments, cbNode, result); result = reduceNode(node.attributes, cbNode, result); break; - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: result = reduceNodes(node.properties, cbNodes, result); break; - case 269 /* JsxClosingElement */: + case 270 /* JsxClosingElement */: result = reduceNode(node.tagName, cbNode, result); break; - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 275 /* JsxSpreadAttribute */: + case 276 /* JsxSpreadAttribute */: result = reduceNode(node.expression, cbNode, result); break; - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: result = reduceNode(node.expression, cbNode, result); break; // Clauses - case 277 /* CaseClause */: + case 278 /* CaseClause */: result = reduceNode(node.expression, cbNode, result); // falls through - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: result = reduceNodes(node.statements, cbNodes, result); break; - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: result = reduceNodes(node.types, cbNodes, result); break; - case 280 /* CatchClause */: + case 281 /* CatchClause */: result = reduceNode(node.variableDeclaration, cbNode, result); result = reduceNode(node.block, cbNode, result); break; // Property assignments - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: result = reduceNode(node.expression, cbNode, result); break; // Enum - case 284 /* EnumMember */: + case 285 /* EnumMember */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Top-level nodes - case 290 /* SourceFile */: + case 291 /* SourceFile */: result = reduceNodes(node.statements, cbNodes, result); break; // Transformation nodes - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: result = reduceNodes(node.elements, cbNodes, result); break; default: @@ -74406,7 +74805,7 @@ var ts; function aggregateTransformFlagsForSubtree(node) { // We do not transform ambient declarations or types, so there is no need to // recursively aggregate transform flags. - if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 216 /* ExpressionWithTypeArguments */)) { + if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 217 /* ExpressionWithTypeArguments */)) { return 0 /* None */; } // Aggregate the transform flags of each child. @@ -75080,7 +75479,7 @@ var ts; function chainBundle(transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 290 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 291 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return ts.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends); @@ -75131,7 +75530,7 @@ var ts; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" @@ -75144,13 +75543,13 @@ var ts; hasImportDefault = true; } break; - case 253 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 265 /* ExternalModuleReference */) { + case 254 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 266 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -75181,13 +75580,13 @@ var ts; } } break; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: if (ts.hasModifier(node, 1 /* Export */)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -75195,7 +75594,7 @@ var ts; } } break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default function() { } @@ -75215,7 +75614,7 @@ var ts; } } break; - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default class { } @@ -75394,7 +75793,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member) { - return member.kind === 159 /* PropertyDeclaration */ + return member.kind === 160 /* PropertyDeclaration */ && member.initializer !== undefined; } ts.isInitializedProperty = isInitializedProperty; @@ -76023,8 +76422,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(194 /* PropertyAccessExpression */); - context.enableSubstitution(195 /* ElementAccessExpression */); + context.enableSubstitution(195 /* PropertyAccessExpression */); + context.enableSubstitution(196 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -76050,14 +76449,14 @@ var ts; var applicableSubstitutions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 291 /* Bundle */) { + if (node.kind === 292 /* Bundle */) { return transformBundle(node); } return transformSourceFile(node); } function transformBundle(node) { return ts.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 293 /* InputFiles */) { + if (prepend.kind === 294 /* InputFiles */) { return ts.createUnparsedSourceFile(prepend, "js"); } return prepend; @@ -76108,16 +76507,16 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 290 /* SourceFile */: - case 251 /* CaseBlock */: - case 250 /* ModuleBlock */: - case 223 /* Block */: + case 291 /* SourceFile */: + case 252 /* CaseBlock */: + case 251 /* ModuleBlock */: + case 224 /* Block */: currentLexicalScope = node; currentNameScope = undefined; currentScopeFirstDeclarationsOfName = undefined; break; - case 245 /* ClassDeclaration */: - case 244 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 245 /* FunctionDeclaration */: if (ts.hasModifier(node, 2 /* Ambient */)) { break; } @@ -76129,7 +76528,7 @@ var ts; // These nodes should always have names unless they are default-exports; // however, class declaration parsing allows for undefined names, so syntactically invalid // programs may also have an undefined name. - ts.Debug.assert(node.kind === 245 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); + ts.Debug.assert(node.kind === 246 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); } if (ts.isClassDeclaration(node)) { // XXX: should probably also cover interfaces and type aliases that can have type variables? @@ -76172,10 +76571,10 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 259 /* ExportAssignment */: - case 260 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 260 /* ExportAssignment */: + case 261 /* ExportDeclaration */: return visitEllidableStatement(node); default: return visitorWorker(node); @@ -76196,13 +76595,13 @@ var ts; return node; } switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return visitImportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitExportAssignment(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -76222,11 +76621,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 260 /* ExportDeclaration */ || - node.kind === 254 /* ImportDeclaration */ || - node.kind === 255 /* ImportClause */ || - (node.kind === 253 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 265 /* ExternalModuleReference */)) { + if (node.kind === 261 /* ExportDeclaration */ || + node.kind === 255 /* ImportDeclaration */ || + node.kind === 256 /* ImportClause */ || + (node.kind === 254 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 266 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -76250,19 +76649,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: return visitConstructor(node); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // Property declarations are not TypeScript syntax, but they must be visited // for the decorator transformation. return visitPropertyDeclaration(node); - case 167 /* IndexSignature */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 161 /* MethodDeclaration */: + case 168 /* IndexSignature */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 162 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 222 /* SemicolonClassElement */: + case 223 /* SemicolonClassElement */: return node; default: return ts.Debug.failBadSyntaxKind(node); @@ -76298,62 +76697,62 @@ var ts; case 118 /* ProtectedKeyword */: case 122 /* AbstractKeyword */: case 81 /* ConstKeyword */: - case 130 /* DeclareKeyword */: - case 138 /* ReadonlyKeyword */: + case 131 /* DeclareKeyword */: + case 139 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided // falls through - case 174 /* ArrayType */: - case 175 /* TupleType */: - case 176 /* OptionalType */: - case 177 /* RestType */: - case 173 /* TypeLiteral */: - case 168 /* TypePredicate */: - case 155 /* TypeParameter */: + case 175 /* ArrayType */: + case 176 /* TupleType */: + case 177 /* OptionalType */: + case 178 /* RestType */: + case 174 /* TypeLiteral */: + case 169 /* TypePredicate */: + case 156 /* TypeParameter */: case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 128 /* BooleanKeyword */: - case 143 /* StringKeyword */: - case 140 /* NumberKeyword */: - case 137 /* NeverKeyword */: + case 149 /* UnknownKeyword */: + case 129 /* BooleanKeyword */: + case 144 /* StringKeyword */: + case 141 /* NumberKeyword */: + case 138 /* NeverKeyword */: case 110 /* VoidKeyword */: - case 144 /* SymbolKeyword */: - case 171 /* ConstructorType */: - case 170 /* FunctionType */: - case 172 /* TypeQuery */: - case 169 /* TypeReference */: - case 178 /* UnionType */: - case 179 /* IntersectionType */: - case 180 /* ConditionalType */: - case 182 /* ParenthesizedType */: - case 183 /* ThisType */: - case 184 /* TypeOperator */: - case 185 /* IndexedAccessType */: - case 186 /* MappedType */: - case 187 /* LiteralType */: + case 145 /* SymbolKeyword */: + case 172 /* ConstructorType */: + case 171 /* FunctionType */: + case 173 /* TypeQuery */: + case 170 /* TypeReference */: + case 179 /* UnionType */: + case 180 /* IntersectionType */: + case 181 /* ConditionalType */: + case 183 /* ParenthesizedType */: + case 184 /* ThisType */: + case 185 /* TypeOperator */: + case 186 /* IndexedAccessType */: + case 187 /* MappedType */: + case 188 /* LiteralType */: // TypeScript type nodes are elided. // falls through - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: // TypeScript index signatures are elided. // falls through - case 157 /* Decorator */: + case 158 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. // falls through - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. return undefined; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects return visitPropertyDeclaration(node); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: // TypeScript namespace export declarations are elided. return undefined; - case 162 /* Constructor */: + case 163 /* Constructor */: return visitConstructor(node); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return ts.createNotEmittedStatement(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: // This may be a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -76363,7 +76762,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: // This may be a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -76373,35 +76772,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: // This may be a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 156 /* Parameter */: + case 157 /* Parameter */: // This may be a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -76411,35 +76810,35 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 199 /* TypeAssertionExpression */: - case 217 /* AsExpression */: + case 200 /* TypeAssertionExpression */: + case 218 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return visitCallExpression(node); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return visitNewExpression(node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); default: @@ -76852,12 +77251,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -77010,7 +77409,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 159 /* PropertyDeclaration */ + ? member.kind === 160 /* PropertyDeclaration */ // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it // should not invoke `Object.getOwnPropertyDescriptor`. ? ts.createVoidZero() @@ -77133,10 +77532,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */ - || kind === 159 /* PropertyDeclaration */; + return kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */ + || kind === 160 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -77146,7 +77545,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 161 /* MethodDeclaration */; + return node.kind === 162 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -77157,12 +77556,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return true; } return false; @@ -77179,15 +77578,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 159 /* PropertyDeclaration */: - case 156 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 157 /* Parameter */: return serializeTypeNode(node.type); - case 164 /* SetAccessor */: - case 163 /* GetAccessor */: + case 165 /* SetAccessor */: + case 164 /* GetAccessor */: return serializeTypeNode(getAccessorTypeNode(node)); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 161 /* MethodDeclaration */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 162 /* MethodDeclaration */: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); @@ -77224,7 +77623,7 @@ var ts; return ts.createArrayLiteral(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 163 /* GetAccessor */) { + if (container && node.kind === 164 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -77270,30 +77669,30 @@ var ts; } switch (node.kind) { case 110 /* VoidKeyword */: - case 146 /* UndefinedKeyword */: + case 147 /* UndefinedKeyword */: case 100 /* NullKeyword */: - case 137 /* NeverKeyword */: + case 138 /* NeverKeyword */: return ts.createVoidZero(); - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 170 /* FunctionType */: - case 171 /* ConstructorType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: return ts.createIdentifier("Function"); - case 174 /* ArrayType */: - case 175 /* TupleType */: + case 175 /* ArrayType */: + case 176 /* TupleType */: return ts.createIdentifier("Array"); - case 168 /* TypePredicate */: - case 128 /* BooleanKeyword */: + case 169 /* TypePredicate */: + case 129 /* BooleanKeyword */: return ts.createIdentifier("Boolean"); - case 143 /* StringKeyword */: + case 144 /* StringKeyword */: return ts.createIdentifier("String"); - case 141 /* ObjectKeyword */: + case 142 /* ObjectKeyword */: return ts.createIdentifier("Object"); - case 187 /* LiteralType */: + case 188 /* LiteralType */: switch (node.literal.kind) { case 10 /* StringLiteral */: return ts.createIdentifier("String"); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: case 8 /* NumericLiteral */: return ts.createIdentifier("Number"); case 9 /* BigIntLiteral */: @@ -77304,34 +77703,34 @@ var ts; default: return ts.Debug.failBadSyntaxKind(node.literal); } - case 140 /* NumberKeyword */: + case 141 /* NumberKeyword */: return ts.createIdentifier("Number"); - case 151 /* BigIntKeyword */: + case 152 /* BigIntKeyword */: return getGlobalBigIntNameWithFallback(); - case 144 /* SymbolKeyword */: + case 145 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return serializeTypeReferenceNode(node); - case 179 /* IntersectionType */: - case 178 /* UnionType */: + case 180 /* IntersectionType */: + case 179 /* UnionType */: return serializeTypeList(node.types); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return serializeTypeList([node.trueType, node.falseType]); - case 184 /* TypeOperator */: - if (node.operator === 138 /* ReadonlyKeyword */) { + case 185 /* TypeOperator */: + if (node.operator === 139 /* ReadonlyKeyword */) { return serializeTypeNode(node.type); } break; - case 172 /* TypeQuery */: - case 185 /* IndexedAccessType */: - case 186 /* MappedType */: - case 173 /* TypeLiteral */: + case 173 /* TypeQuery */: + case 186 /* IndexedAccessType */: + case 187 /* MappedType */: + case 174 /* TypeLiteral */: case 125 /* AnyKeyword */: - case 148 /* UnknownKeyword */: - case 183 /* ThisType */: - case 188 /* ImportType */: + case 149 /* UnknownKeyword */: + case 184 /* ThisType */: + case 189 /* ImportType */: break; default: return ts.Debug.failBadSyntaxKind(node); @@ -77344,13 +77743,13 @@ var ts; var serializedUnion; for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { var typeNode = types_20[_i]; - while (typeNode.kind === 182 /* ParenthesizedType */) { + while (typeNode.kind === 183 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 137 /* NeverKeyword */) { + if (typeNode.kind === 138 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 146 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 147 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var serializedIndividual = serializeTypeNode(typeNode); @@ -77459,7 +77858,7 @@ var ts; name.original = undefined; name.parent = ts.getParseTreeNode(currentLexicalScope); // ensure the parent is set to a parse tree node. return name; - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return serializeQualifiedNameAsExpression(node); } } @@ -78019,12 +78418,12 @@ var ts; // enums in any other scope are emitted as a `let` declaration. var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)) - ], currentLexicalScope.kind === 290 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); + ], currentLexicalScope.kind === 291 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 248 /* EnumDeclaration */) { + if (node.kind === 249 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -78149,7 +78548,7 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 250 /* ModuleBlock */) { + if (body.kind === 251 /* ModuleBlock */) { saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; @@ -78195,13 +78594,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (body.kind !== 250 /* ModuleBlock */) { + if (body.kind !== 251 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 249 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 250 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -78251,7 +78650,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 256 /* NamespaceImport */) { + if (node.kind === 257 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -78499,16 +78898,16 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(75 /* Identifier */); - context.enableSubstitution(282 /* ShorthandPropertyAssignment */); + context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(249 /* ModuleDeclaration */); + context.enableEmitNotification(250 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 249 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 250 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 248 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 249 /* EnumDeclaration */; } /** * Hook for node emit. @@ -78569,9 +78968,9 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -78609,9 +79008,9 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 290 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 249 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 248 /* EnumDeclaration */); + if (container && container.kind !== 291 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 250 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 249 /* EnumDeclaration */); if (substitute) { return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), /*location*/ node); @@ -78762,40 +79161,40 @@ var ts; if (!(node.transformFlags & 4194304 /* ContainsClassFields */)) return node; switch (node.kind) { - case 214 /* ClassExpression */: - case 245 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 246 /* ClassDeclaration */: return visitClassLike(node); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return visitPropertyAccessExpression(node); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return visitPrefixUnaryExpression(node); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return visitPostfixUnaryExpression(node, /*valueIsDiscarded*/ false); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return visitCallExpression(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node); case 76 /* PrivateIdentifier */: return visitPrivateIdentifier(node); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return visitExpressionStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); } return ts.visitEachChild(node, visitor, context); } function visitorDestructuringTarget(node) { switch (node.kind) { - case 193 /* ObjectLiteralExpression */: - case 192 /* ArrayLiteralExpression */: + case 194 /* ObjectLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return visitAssignmentPattern(node); default: return visitor(node); @@ -78818,20 +79217,20 @@ var ts; */ function classElementVisitor(node) { switch (node.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: // Constructors for classes using class fields are transformed in // `visitClassDeclaration` or `visitClassExpression`. return undefined; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 161 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 162 /* MethodDeclaration */: // Visit the name of the member (if it's a computed property name). return ts.visitEachChild(node, classElementVisitor, context); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 222 /* SemicolonClassElement */: + case 223 /* SemicolonClassElement */: return node; default: return visitor(node); @@ -79597,31 +79996,31 @@ var ts; case 126 /* AsyncKeyword */: // ES2017 async modifier should be elided for targets < ES2017 return undefined; - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return visitAwaitExpression(node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 102 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 162 /* Constructor */: - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 163 /* Constructor */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -79630,27 +80029,27 @@ var ts; function asyncBodyVisitor(node) { if (ts.isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatementInAsyncBody(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatementInAsyncBody(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatementInAsyncBody(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatementInAsyncBody(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClauseInAsyncBody(node); - case 223 /* Block */: - case 237 /* SwitchStatement */: - case 251 /* CaseBlock */: - case 277 /* CaseClause */: - case 278 /* DefaultClause */: - case 240 /* TryStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: - case 227 /* IfStatement */: - case 236 /* WithStatement */: - case 238 /* LabeledStatement */: + case 224 /* Block */: + case 238 /* SwitchStatement */: + case 252 /* CaseBlock */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: + case 241 /* TryStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: + case 228 /* IfStatement */: + case 237 /* WithStatement */: + case 239 /* LabeledStatement */: return ts.visitEachChild(node, asyncBodyVisitor, context); default: return ts.Debug.assertNever(node, "Unhandled node."); @@ -79855,7 +80254,7 @@ var ts; var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 202 /* ArrowFunction */; + var isArrowFunction = node.kind === 203 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current @@ -79946,17 +80345,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(196 /* CallExpression */); - context.enableSubstitution(194 /* PropertyAccessExpression */); - context.enableSubstitution(195 /* ElementAccessExpression */); + context.enableSubstitution(197 /* CallExpression */); + context.enableSubstitution(195 /* PropertyAccessExpression */); + context.enableSubstitution(196 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(245 /* ClassDeclaration */); - context.enableEmitNotification(161 /* MethodDeclaration */); - context.enableEmitNotification(163 /* GetAccessor */); - context.enableEmitNotification(164 /* SetAccessor */); - context.enableEmitNotification(162 /* Constructor */); + context.enableEmitNotification(246 /* ClassDeclaration */); + context.enableEmitNotification(162 /* MethodDeclaration */); + context.enableEmitNotification(164 /* GetAccessor */); + context.enableEmitNotification(165 /* SetAccessor */); + context.enableEmitNotification(163 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(225 /* VariableStatement */); + context.enableEmitNotification(226 /* VariableStatement */); } } /** @@ -80004,11 +80403,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -80040,11 +80439,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 245 /* ClassDeclaration */ - || kind === 162 /* Constructor */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */; + return kind === 246 /* ClassDeclaration */ + || kind === 163 /* Constructor */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -80212,64 +80611,64 @@ var ts; return node; } switch (node.kind) { - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return visitAwaitExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return visitYieldExpression(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitReturnStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitLabeledStatement(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node, noDestructuringValue); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClause(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return visitVoidExpression(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return doWithLexicalThis(visitConstructorDeclaration, node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return doWithLexicalThis(visitMethodDeclaration, node); - case 163 /* GetAccessor */: + case 164 /* GetAccessor */: return doWithLexicalThis(visitGetAccessorDeclaration, node); - case 164 /* SetAccessor */: + case 165 /* SetAccessor */: return doWithLexicalThis(visitSetAccessorDeclaration, node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return doWithLexicalThis(visitFunctionDeclaration, node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return doWithLexicalThis(visitFunctionExpression, node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return visitArrowFunction(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return visitParameter(node); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return visitExpressionStatement(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, noDestructuringValue); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 102 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: return doWithLexicalThis(visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -80303,7 +80702,7 @@ var ts; function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2 /* Async */) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 232 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 233 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node); @@ -80315,7 +80714,7 @@ var ts; var objects = []; for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { var e = elements_4[_i]; - if (e.kind === 283 /* SpreadAssignment */) { + if (e.kind === 284 /* SpreadAssignment */) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -80324,7 +80723,7 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - chunkObject = ts.append(chunkObject, e.kind === 281 /* PropertyAssignment */ + chunkObject = ts.append(chunkObject, e.kind === 282 /* PropertyAssignment */ ? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } @@ -80358,7 +80757,7 @@ var ts; // If we translate the above to `__assign({}, k, l)`, the `l` will evaluate before `k` is spread and we // end up with `{ a: 1, b: 2, c: 3 }` var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 193 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 194 /* ObjectLiteralExpression */) { objects.unshift(ts.createObjectLiteral()); } var expression = objects[0]; @@ -80736,17 +81135,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(196 /* CallExpression */); - context.enableSubstitution(194 /* PropertyAccessExpression */); - context.enableSubstitution(195 /* ElementAccessExpression */); + context.enableSubstitution(197 /* CallExpression */); + context.enableSubstitution(195 /* PropertyAccessExpression */); + context.enableSubstitution(196 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(245 /* ClassDeclaration */); - context.enableEmitNotification(161 /* MethodDeclaration */); - context.enableEmitNotification(163 /* GetAccessor */); - context.enableEmitNotification(164 /* SetAccessor */); - context.enableEmitNotification(162 /* Constructor */); + context.enableEmitNotification(246 /* ClassDeclaration */); + context.enableEmitNotification(162 /* MethodDeclaration */); + context.enableEmitNotification(164 /* GetAccessor */); + context.enableEmitNotification(165 /* SetAccessor */); + context.enableEmitNotification(163 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(225 /* VariableStatement */); + context.enableEmitNotification(226 /* VariableStatement */); } } /** @@ -80794,11 +81193,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -80830,11 +81229,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 245 /* ClassDeclaration */ - || kind === 162 /* Constructor */ - || kind === 161 /* MethodDeclaration */ - || kind === 163 /* GetAccessor */ - || kind === 164 /* SetAccessor */; + return kind === 246 /* ClassDeclaration */ + || kind === 163 /* Constructor */ + || kind === 162 /* MethodDeclaration */ + || kind === 164 /* GetAccessor */ + || kind === 165 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -80932,7 +81331,7 @@ var ts; return node; } switch (node.kind) { - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -80964,21 +81363,21 @@ var ts; return node; } switch (node.kind) { - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: - case 196 /* CallExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: + case 197 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { var updated = visitOptionalExpression(node, /*captureThisArg*/ false, /*isDelete*/ false); ts.Debug.assertNotNode(updated, ts.isSyntheticReference); return updated; } return ts.visitEachChild(node, visitor, context); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: if (node.operatorToken.kind === 60 /* QuestionQuestionToken */) { return transformNullishCoalescingExpression(node); } return ts.visitEachChild(node, visitor, context); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return visitDeleteExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -81018,7 +81417,7 @@ var ts; thisArg = expression; } } - expression = node.kind === 194 /* PropertyAccessExpression */ + expression = node.kind === 195 /* PropertyAccessExpression */ ? ts.updatePropertyAccess(node, expression, ts.visitNode(node.name, visitor, ts.isIdentifier)) : ts.updateElementAccess(node, expression, ts.visitNode(node.argumentExpression, visitor, ts.isExpression)); return thisArg ? ts.createSyntheticReferenceExpression(expression, thisArg) : expression; @@ -81032,10 +81431,10 @@ var ts; } function visitNonOptionalExpression(node, captureThisArg, isDelete) { switch (node.kind) { - case 200 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 196 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); + case 201 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); + case 197 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); default: return ts.visitNode(node, visitor, ts.isExpression); } } @@ -81054,8 +81453,8 @@ var ts; for (var i = 0; i < chain.length; i++) { var segment = chain[i]; switch (segment.kind) { - case 194 /* PropertyAccessExpression */: - case 195 /* ElementAccessExpression */: + case 195 /* PropertyAccessExpression */: + case 196 /* ElementAccessExpression */: if (i === chain.length - 1 && captureThisArg) { if (shouldCaptureInTempVariable(rightExpression)) { thisArg = ts.createTempVariable(hoistVariableDeclaration); @@ -81065,11 +81464,11 @@ var ts; thisArg = rightExpression; } } - rightExpression = segment.kind === 194 /* PropertyAccessExpression */ + rightExpression = segment.kind === 195 /* PropertyAccessExpression */ ? ts.createPropertyAccess(rightExpression, ts.visitNode(segment.name, visitor, ts.isIdentifier)) : ts.createElementAccess(rightExpression, ts.visitNode(segment.argumentExpression, visitor, ts.isExpression)); break; - case 196 /* CallExpression */: + case 197 /* CallExpression */: if (i === 0 && leftThisArg) { rightExpression = ts.createFunctionCall(rightExpression, leftThisArg.kind === 102 /* SuperKeyword */ ? ts.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression)); } @@ -81167,13 +81566,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 266 /* JsxElement */: + case 267 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ false); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -81183,13 +81582,13 @@ var ts; switch (node.kind) { case 11 /* JsxText */: return visitJsxText(node); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return visitJsxExpression(node); - case 266 /* JsxElement */: + case 267 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ true); default: return ts.Debug.failBadSyntaxKind(node); @@ -81264,7 +81663,7 @@ var ts; literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile); return ts.setTextRange(literal, node); } - else if (node.kind === 276 /* JsxExpression */) { + else if (node.kind === 277 /* JsxExpression */) { if (node.expression === undefined) { return ts.createTrue(); } @@ -81358,7 +81757,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 266 /* JsxElement */) { + if (node.kind === 267 /* JsxElement */) { return getTagName(node.openingElement); } else { @@ -81664,7 +82063,7 @@ var ts; return node; } switch (node.kind) { - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -81877,13 +82276,13 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 - && node.kind === 235 /* ReturnStatement */ + && node.kind === 236 /* ReturnStatement */ && !node.expression; } function shouldVisitNode(node) { return (node.transformFlags & 256 /* ContainsES2015 */) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 223 /* Block */))) + || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 224 /* Block */))) || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatement(node)) || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0; } @@ -81905,63 +82304,63 @@ var ts; switch (node.kind) { case 120 /* StaticKeyword */: return undefined; // elide static keyword - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return visitClassDeclaration(node); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return visitClassExpression(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return visitParameter(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return visitArrowFunction(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return visitFunctionExpression(node); - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return visitVariableDeclaration(node); case 75 /* Identifier */: return visitIdentifier(node); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return visitSwitchStatement(node); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return visitCaseBlock(node); - case 223 /* Block */: + case 224 /* Block */: return visitBlock(node, /*isFunctionBody*/ false); - case 234 /* BreakStatement */: - case 233 /* ContinueStatement */: + case 235 /* BreakStatement */: + case 234 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitLabeledStatement(node); - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node, /*outermostLabeledStatement*/ undefined); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return visitExpressionStatement(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClause(node); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return visitCallExpression(node); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return visitNewExpression(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 14 /* NoSubstitutionTemplateLiteral */: case 15 /* TemplateHead */: @@ -81972,28 +82371,28 @@ var ts; return visitStringLiteral(node); case 8 /* NumericLiteral */: return visitNumericLiteral(node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: return visitTemplateExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return visitYieldExpression(node); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return visitSpreadElement(node); case 102 /* SuperKeyword */: return visitSuperKeyword(/*isExpressionOfCall*/ false); case 104 /* ThisKeyword */: return visitThisKeyword(node); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return visitMetaProperty(node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return visitAccessorDeclaration(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitReturnStatement(node); default: return ts.visitEachChild(node, visitor, context); @@ -82084,14 +82483,14 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 234 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 235 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; var label = node.label; if (!label) { - if (node.kind === 234 /* BreakStatement */) { + if (node.kind === 235 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -82102,7 +82501,7 @@ var ts; } } else { - if (node.kind === 234 /* BreakStatement */) { + if (node.kind === 235 /* BreakStatement */) { labelMarker = "break-" + label.escapedText; setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker); } @@ -82498,11 +82897,11 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 235 /* ReturnStatement */) { + if (statement.kind === 236 /* ReturnStatement */) { return true; } // An if-statement with two covered branches is covered. - else if (statement.kind === 227 /* IfStatement */) { + else if (statement.kind === 228 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && @@ -82510,7 +82909,7 @@ var ts; } } // A block is covered if it has a last statement which is covered. - else if (statement.kind === 223 /* Block */) { + else if (statement.kind === 224 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -82708,7 +83107,7 @@ var ts; * @param node A node. */ function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 202 /* ArrowFunction */) { + if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 203 /* ArrowFunction */) { insertCaptureThisForNode(statements, node, ts.createThis()); return true; } @@ -82729,22 +83128,22 @@ var ts; if (hierarchyFacts & 16384 /* NewTarget */) { var newTarget = void 0; switch (node.kind) { - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return statements; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: // Methods and accessors cannot be constructors, so 'new.target' will // always return 'undefined'. newTarget = ts.createVoidZero(); break; - case 162 /* Constructor */: + case 163 /* Constructor */: // Class constructors can only be called with `new`, so `this.constructor` // should be relatively safe to use. newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"); break; - case 244 /* FunctionDeclaration */: - case 201 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 202 /* FunctionExpression */: // Functions can be called or constructed, and may have a `this` due to // being a member or when calling an imported function via `other_1.f()`. newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), 98 /* InstanceOfKeyword */, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"), ts.createVoidZero()); @@ -82776,20 +83175,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 222 /* SemicolonClassElement */: + case 223 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 162 /* Constructor */: + case 163 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -82991,7 +83390,7 @@ var ts; : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 244 /* FunctionDeclaration */ || node.kind === 201 /* FunctionExpression */)) { + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 245 /* FunctionDeclaration */ || node.kind === 202 /* FunctionExpression */)) { name = ts.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */); @@ -83035,7 +83434,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 202 /* ArrowFunction */); + ts.Debug.assert(node.kind === 203 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -83103,9 +83502,9 @@ var ts; function visitExpressionStatement(node) { // If we are here it is most likely because our expression is a destructuring assignment. switch (node.expression.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return ts.updateExpressionStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return ts.updateExpressionStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } return ts.visitEachChild(node, visitor, context); @@ -83124,9 +83523,9 @@ var ts; // expression. If we are in a state where we do not need the destructuring value, // we pass that information along to the children that care about it. switch (node.expression.kind) { - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return ts.updateParen(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return ts.updateParen(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } } @@ -83340,14 +83739,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -83535,7 +83934,7 @@ var ts; && i < numInitialPropertiesWithoutYield) { numInitialPropertiesWithoutYield = i; } - if (property.name.kind === 154 /* ComputedPropertyName */) { + if (property.name.kind === 155 /* ComputedPropertyName */) { numInitialProperties = i; break; } @@ -83656,11 +84055,11 @@ var ts; } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 230 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 231 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); - case 232 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); - case 228 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); - case 229 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); + case 231 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); + case 232 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); + case 233 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); + case 229 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); + case 230 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); default: return ts.Debug.failBadSyntaxKind(node, "IterationStatement expected"); } } @@ -83685,11 +84084,11 @@ var ts; function createConvertedLoopState(node) { var loopInitializer; switch (node.kind) { - case 230 /* ForStatement */: - case 231 /* ForInStatement */: - case 232 /* ForOfStatement */: + case 231 /* ForStatement */: + case 232 /* ForInStatement */: + case 233 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 243 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 244 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -84088,20 +84487,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -84208,7 +84607,7 @@ var ts; var updated; var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 163 /* GetAccessor */) { + if (node.kind === 164 /* GetAccessor */) { updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -84700,13 +85099,13 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(104 /* ThisKeyword */); - context.enableEmitNotification(162 /* Constructor */); - context.enableEmitNotification(161 /* MethodDeclaration */); - context.enableEmitNotification(163 /* GetAccessor */); - context.enableEmitNotification(164 /* SetAccessor */); - context.enableEmitNotification(202 /* ArrowFunction */); - context.enableEmitNotification(201 /* FunctionExpression */); - context.enableEmitNotification(244 /* FunctionDeclaration */); + context.enableEmitNotification(163 /* Constructor */); + context.enableEmitNotification(162 /* MethodDeclaration */); + context.enableEmitNotification(164 /* GetAccessor */); + context.enableEmitNotification(165 /* SetAccessor */); + context.enableEmitNotification(203 /* ArrowFunction */); + context.enableEmitNotification(202 /* FunctionExpression */); + context.enableEmitNotification(245 /* FunctionDeclaration */); } } /** @@ -84747,10 +85146,10 @@ var ts; */ function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 191 /* BindingElement */: - case 245 /* ClassDeclaration */: - case 248 /* EnumDeclaration */: - case 242 /* VariableDeclaration */: + case 192 /* BindingElement */: + case 246 /* ClassDeclaration */: + case 249 /* EnumDeclaration */: + case 243 /* VariableDeclaration */: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } @@ -84832,11 +85231,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 226 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 227 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 196 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 197 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -84844,7 +85243,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 213 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 214 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -84884,15 +85283,15 @@ var ts; if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(268 /* JsxOpeningElement */); - context.enableEmitNotification(269 /* JsxClosingElement */); - context.enableEmitNotification(267 /* JsxSelfClosingElement */); + context.enableEmitNotification(269 /* JsxOpeningElement */); + context.enableEmitNotification(270 /* JsxClosingElement */); + context.enableEmitNotification(268 /* JsxSelfClosingElement */); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(194 /* PropertyAccessExpression */); - context.enableSubstitution(281 /* PropertyAssignment */); + context.enableSubstitution(195 /* PropertyAccessExpression */); + context.enableSubstitution(282 /* PropertyAssignment */); return ts.chainBundle(transformSourceFile); /** * Transforms an ES5 source file to ES3. @@ -84911,9 +85310,9 @@ var ts; */ function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 268 /* JsxOpeningElement */: - case 269 /* JsxClosingElement */: - case 267 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 270 /* JsxClosingElement */: + case 268 /* JsxSelfClosingElement */: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -85248,13 +85647,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 228 /* DoStatement */: + case 229 /* DoStatement */: return visitDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return visitWhileStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return visitSwitchStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -85267,24 +85666,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return visitFunctionExpression(node); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return visitAccessorDeclaration(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatement(node); - case 234 /* BreakStatement */: + case 235 /* BreakStatement */: return visitBreakStatement(node); - case 233 /* ContinueStatement */: + case 234 /* ContinueStatement */: return visitContinueStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 262144 /* ContainsYield */) { @@ -85305,21 +85704,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return visitBinaryExpression(node); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return visitConditionalExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return visitYieldExpression(node); - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return visitCallExpression(node); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -85332,9 +85731,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return visitFunctionExpression(node); default: return ts.Debug.failBadSyntaxKind(node); @@ -85542,7 +85941,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -85554,7 +85953,7 @@ var ts; // _a.b = %sent%; target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -85930,35 +86329,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 223 /* Block */: + case 224 /* Block */: return transformAndEmitBlock(node); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return transformAndEmitIfStatement(node); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return transformAndEmitDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return transformAndEmitForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 233 /* ContinueStatement */: + case 234 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 234 /* BreakStatement */: + case 235 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return transformAndEmitWithStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -86388,7 +86787,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 278 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 279 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -86401,7 +86800,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 277 /* CaseClause */) { + if (clause.kind === 278 /* CaseClause */) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -87630,11 +88029,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(209 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(207 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(208 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(290 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(210 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(208 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(209 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(291 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var currentSourceFile; // The current file. @@ -87958,23 +88357,23 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return visitImportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return visitExportDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitExportAssignment(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return visitClassDeclaration(node); - case 328 /* MergeDeclarationMarker */: + case 329 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 329 /* EndOfDeclarationMarker */: + case 330 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, moduleExpressionElementVisitor, context); @@ -88001,24 +88400,24 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var elem = _a[_i]; switch (elem.kind) { - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return false; default: ts.Debug.assertNever(elem, "Unhandled object member kind"); } @@ -88518,7 +88917,7 @@ var ts; // // To balance the declaration, add the exports of the elided variable // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -88573,10 +88972,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 257 /* NamedImports */: + case 258 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding, /* liveBinding */ true); @@ -88789,7 +89188,7 @@ var ts; * @param emit A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -88853,10 +89252,10 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return substituteBinaryExpression(node); - case 208 /* PostfixUnaryExpression */: - case 207 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -88877,7 +89276,7 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 290 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 291 /* SourceFile */) { return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), /*location*/ node); } @@ -88952,7 +89351,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 208 /* PostfixUnaryExpression */ + var expression = node.kind === 209 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 45 /* PlusPlusToken */ ? 63 /* PlusEqualsToken */ : 64 /* MinusEqualsToken */), ts.createLiteral(1)), /*location*/ node) : node; @@ -89051,12 +89450,12 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols - context.enableSubstitution(209 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(207 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(208 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(219 /* MetaProperty */); // Substitutes 'import.meta' - context.enableEmitNotification(290 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols + context.enableSubstitution(210 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(208 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(209 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(220 /* MetaProperty */); // Substitutes 'import.meta' + context.enableEmitNotification(291 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var exportFunctionsMap = []; // The export function associated with a source file. @@ -89280,7 +89679,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 260 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 261 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -89305,7 +89704,7 @@ var ts; } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 260 /* ExportDeclaration */) { + if (externalImport.kind !== 261 /* ExportDeclaration */) { continue; } if (!externalImport.exportClause) { @@ -89388,19 +89787,19 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); // TODO: GH#18217 switch (entry.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // falls through - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(ts.createExpressionStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { if (ts.isNamedExports(entry.exportClause)) { @@ -89459,13 +89858,13 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return visitImportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return visitExportDeclaration(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -89645,7 +90044,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 290 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 291 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -89709,7 +90108,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -89771,10 +90170,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 257 /* NamedImports */: + case 258 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -89954,43 +90353,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return visitVariableStatement(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return visitClassDeclaration(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return visitForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return visitForInStatement(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return visitForOfStatement(node); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return visitDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return visitWhileStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return visitLabeledStatement(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return visitWithStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return visitSwitchStatement(node); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return visitCaseBlock(node); - case 277 /* CaseClause */: + case 278 /* CaseClause */: return visitCaseClause(node); - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: return visitDefaultClause(node); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return visitTryStatement(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return visitCatchClause(node); - case 223 /* Block */: + case 224 /* Block */: return visitBlock(node); - case 328 /* MergeDeclarationMarker */: + case 329 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 329 /* EndOfDeclarationMarker */: + case 330 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -90237,7 +90636,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 290 /* SourceFile */; + return container !== undefined && container.kind === 291 /* SourceFile */; } else { return false; @@ -90270,7 +90669,7 @@ var ts; * @param emitCallback A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 290 /* SourceFile */) { + if (node.kind === 291 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -90320,7 +90719,7 @@ var ts; */ function substituteUnspecified(node) { switch (node.kind) { - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return substituteShorthandPropertyAssignment(node); } return node; @@ -90356,12 +90755,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return substituteBinaryExpression(node); - case 207 /* PrefixUnaryExpression */: - case 208 /* PostfixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return substituteMetaProperty(node); } return node; @@ -90454,14 +90853,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 208 /* PostfixUnaryExpression */ + var expression = node.kind === 209 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) { var exportName = exportedNames_5[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 208 /* PostfixUnaryExpression */) { + if (node.kind === 209 /* PostfixUnaryExpression */) { expression = node.operator === 45 /* PlusPlusToken */ ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -90489,7 +90888,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 290 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 291 /* SourceFile */) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -90528,7 +90927,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(290 /* SourceFile */); + context.enableEmitNotification(291 /* SourceFile */); context.enableSubstitution(75 /* Identifier */); var helperNameSubstitutions; return ts.chainBundle(transformSourceFile); @@ -90553,12 +90952,12 @@ var ts; } function visitor(node) { switch (node.kind) { - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: // Elide `import=` as it is not legal with --module ES6 return undefined; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return visitExportAssignment(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: var exportDecl = node; return visitExportDeclaration(exportDecl); } @@ -90689,7 +91088,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.kind === 246 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90718,7 +91117,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.kind === 246 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90765,7 +91164,7 @@ var ts; return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]); } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { + if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90774,8 +91173,8 @@ var ts; } // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit // The only exception here is if the constructor was marked as private. we are not emitting the constructor parameters at all. - else if (node.kind === 159 /* PropertyDeclaration */ || node.kind === 194 /* PropertyAccessExpression */ || node.kind === 158 /* PropertySignature */ || - (node.kind === 156 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { + else if (node.kind === 160 /* PropertyDeclaration */ || node.kind === 195 /* PropertyAccessExpression */ || node.kind === 159 /* PropertySignature */ || + (node.kind === 157 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -90784,7 +91183,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 245 /* ClassDeclaration */ || node.kind === 156 /* Parameter */) { + else if (node.parent.kind === 246 /* ClassDeclaration */ || node.kind === 157 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90809,7 +91208,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (node.kind === 164 /* SetAccessor */) { + if (node.kind === 165 /* SetAccessor */) { // Getters can infer the return type from the returned expression, but setters cannot, so the // "_from_external_module_1_but_cannot_be_named" case cannot occur. if (ts.hasModifier(node, 32 /* Static */)) { @@ -90848,26 +91247,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 165 /* CallSignature */: + case 166 /* CallSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.hasModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -90875,7 +91274,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.kind === 246 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -90889,7 +91288,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -90914,30 +91313,30 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 162 /* Constructor */: + case 163 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 166 /* ConstructSignature */: - case 171 /* ConstructorType */: + case 167 /* ConstructSignature */: + case 172 /* ConstructorType */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 165 /* CallSignature */: + case 166 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -90945,7 +91344,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 246 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90958,15 +91357,15 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 244 /* FunctionDeclaration */: - case 170 /* FunctionType */: + case 245 /* FunctionDeclaration */: + case 171 /* FunctionType */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - case 164 /* SetAccessor */: - case 163 /* GetAccessor */: + case 165 /* SetAccessor */: + case 164 /* GetAccessor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -90980,39 +91379,39 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 186 /* MappedType */: + case 187 /* MappedType */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 171 /* ConstructorType */: - case 166 /* ConstructSignature */: + case 172 /* ConstructorType */: + case 167 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 165 /* CallSignature */: + case 166 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 161 /* MethodDeclaration */: - case 160 /* MethodSignature */: + case 162 /* MethodDeclaration */: + case 161 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 245 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 246 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 170 /* FunctionType */: - case 244 /* FunctionDeclaration */: + case 171 /* FunctionType */: + case 245 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -91027,7 +91426,7 @@ var ts; function getHeritageClauseVisibilityError() { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 245 /* ClassDeclaration */) { + if (node.parent.parent.kind === 246 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible diagnosticMessage = ts.isHeritageClause(node.parent) && node.parent.token === 113 /* ImplementsKeyword */ ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : @@ -91078,7 +91477,7 @@ var ts; } function isInternalDeclaration(node, currentSourceFile) { var parseTreeNode = ts.getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 156 /* Parameter */) { + if (parseTreeNode && parseTreeNode.kind === 157 /* Parameter */) { var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : undefined; var text = currentSourceFile.text; @@ -91237,10 +91636,10 @@ var ts; return result; } function transformRoot(node) { - if (node.kind === 290 /* SourceFile */ && node.isDeclarationFile) { + if (node.kind === 291 /* SourceFile */ && node.isDeclarationFile) { return node; } - if (node.kind === 291 /* Bundle */) { + if (node.kind === 292 /* Bundle */) { isBundledEmit = true; refs = ts.createMap(); libs = ts.createMap(); @@ -91263,14 +91662,14 @@ var ts; resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules) needsDeclare = false; var statements = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile, /*bundled*/ true)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); - var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(130 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); + var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(131 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); return newFile; } needsDeclare = true; var updated = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); return ts.updateSourceFileNode(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); }), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 293 /* InputFiles */) { + if (prepend.kind === 294 /* InputFiles */) { var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal); hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib; collectReferences(sourceFile, refs); @@ -91411,7 +91810,7 @@ var ts; return name; } else { - if (name.kind === 190 /* ArrayBindingPattern */) { + if (name.kind === 191 /* ArrayBindingPattern */) { return ts.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement)); } else { @@ -91419,7 +91818,7 @@ var ts; } } function visitBindingElement(elem) { - if (elem.kind === 215 /* OmittedExpression */) { + if (elem.kind === 216 /* OmittedExpression */) { return elem; } return ts.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined); @@ -91457,7 +91856,7 @@ var ts; // Literal const declarations will have an initializer ensured rather than a type return; } - var shouldUseResolverType = node.kind === 156 /* Parameter */ && + var shouldUseResolverType = node.kind === 157 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { @@ -91466,7 +91865,7 @@ var ts; if (!ts.getParseTreeNode(node)) { return type ? ts.visitNode(type, visitDeclarationSubtree) : ts.createKeywordTypeNode(125 /* AnyKeyword */); } - if (node.kind === 164 /* SetAccessor */) { + if (node.kind === 165 /* SetAccessor */) { // Set accessors with no associated type node (from it's param or get accessor return) are `any` since they are never contextually typed right now // (The inferred type here will be void, but the old declaration emitter printed `any`, so this replicates that) return ts.createKeywordTypeNode(125 /* AnyKeyword */); @@ -91477,12 +91876,12 @@ var ts; oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node); } - if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { + if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); } - if (node.kind === 156 /* Parameter */ - || node.kind === 159 /* PropertyDeclaration */ - || node.kind === 158 /* PropertySignature */) { + if (node.kind === 157 /* Parameter */ + || node.kind === 160 /* PropertyDeclaration */ + || node.kind === 159 /* PropertySignature */) { if (!node.initializer) return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType)); return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); @@ -91499,20 +91898,20 @@ var ts; function isDeclarationAndNotVisible(node) { node = ts.getParseTreeNode(node); switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 249 /* ModuleDeclaration */: - case 246 /* InterfaceDeclaration */: - case 245 /* ClassDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 248 /* EnumDeclaration */: + case 245 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 247 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: return !resolver.isDeclarationVisible(node); // The following should be doing their own visibility checks based on filtering their members - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return !getBindingNameVisible(node); - case 253 /* ImportEqualsDeclaration */: - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: - case 259 /* ExportAssignment */: + case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 260 /* ExportAssignment */: return false; } return false; @@ -91593,7 +91992,7 @@ var ts; function rewriteModuleSpecifier(parent, input) { if (!input) return undefined; // TODO: GH#18217 - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 249 /* ModuleDeclaration */ && parent.kind !== 188 /* ImportType */); + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 250 /* ModuleDeclaration */ && parent.kind !== 189 /* ImportType */); if (ts.isStringLiteralLike(input)) { if (isBundledEmit) { var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent); @@ -91613,7 +92012,7 @@ var ts; function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 265 /* ExternalModuleReference */) { + if (decl.moduleReference.kind === 266 /* ExternalModuleReference */) { // Rewrite external module names if necessary var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl); return ts.updateImportEqualsDeclaration(decl, @@ -91640,7 +92039,7 @@ var ts; return visibleDefaultBinding && ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, /*namedBindings*/ undefined, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)); } - if (decl.importClause.namedBindings.kind === 256 /* NamespaceImport */) { + if (decl.importClause.namedBindings.kind === 257 /* NamespaceImport */) { // Namespace import (optionally with visible default) var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : /*namedBindings*/ undefined; return visibleDefaultBinding || namedBindings ? ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, namedBindings, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined; @@ -91729,7 +92128,7 @@ var ts; // We'd see a TDZ violation at runtime var canProduceDiagnostic = ts.canProduceDiagnostics(input); var oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 173 /* TypeLiteral */ || input.kind === 186 /* MappedType */) && input.parent.kind !== 247 /* TypeAliasDeclaration */); + var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 174 /* TypeLiteral */ || input.kind === 187 /* MappedType */) && input.parent.kind !== 248 /* TypeAliasDeclaration */); // Emit methods which are private as properties with no type information if (ts.isMethodDeclaration(input) || ts.isMethodSignature(input)) { if (ts.hasModifier(input, 8 /* Private */)) { @@ -91750,38 +92149,38 @@ var ts; } if (isProcessedComponent(input)) { switch (input.kind) { - case 216 /* ExpressionWithTypeArguments */: { + case 217 /* ExpressionWithTypeArguments */: { if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateExpressionWithTypeArguments(node, ts.parenthesizeTypeParameters(node.typeArguments), node.expression)); } - case 169 /* TypeReference */: { + case 170 /* TypeReference */: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateTypeReferenceNode(node, node.typeName, ts.parenthesizeTypeParameters(node.typeArguments))); } - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: return cleanup(ts.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); - case 162 /* Constructor */: { + case 163 /* Constructor */: { // A constructor declaration may not have a type annotation - var ctor = ts.createSignatureDeclaration(162 /* Constructor */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0 /* None */), + var ctor = ts.createSignatureDeclaration(163 /* Constructor */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0 /* None */), /*type*/ undefined); ctor.modifiers = ts.createNodeArray(ensureModifiers(input)); return cleanup(ctor); } - case 161 /* MethodDeclaration */: { + case 162 /* MethodDeclaration */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } - var sig = ts.createSignatureDeclaration(160 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); + var sig = ts.createSignatureDeclaration(161 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); sig.name = input.name; sig.modifiers = ts.createNodeArray(ensureModifiers(input)); sig.questionToken = input.questionToken; return cleanup(sig); } - case 163 /* GetAccessor */: { + case 164 /* GetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -91790,7 +92189,7 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8 /* Private */)), ensureType(input, accessorType), /*body*/ undefined)); } - case 164 /* SetAccessor */: { + case 165 /* SetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -91798,31 +92197,31 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8 /* Private */)), /*body*/ undefined)); } - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updateProperty(input, /*decorators*/ undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 160 /* MethodSignature */: { + case 161 /* MethodSignature */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updateMethodSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), input.name, input.questionToken)); } - case 165 /* CallSignature */: { + case 166 /* CallSignature */: { return cleanup(ts.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 167 /* IndexSignature */: { + case 168 /* IndexSignature */: { return cleanup(ts.updateIndexSignature(input, /*decorators*/ undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || ts.createKeywordTypeNode(125 /* AnyKeyword */))); } - case 242 /* VariableDeclaration */: { + case 243 /* VariableDeclaration */: { if (ts.isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -91830,13 +92229,13 @@ var ts; suppressNewDiagnosticContexts = true; // Variable declaration types also suppress new diagnostic contexts, provided the contexts wouldn't be made for binding pattern types return cleanup(ts.updateTypeScriptVariableDeclaration(input, input.name, /*exclaimationToken*/ undefined, ensureType(input, input.type), ensureNoInitializer(input))); } - case 155 /* TypeParameter */: { + case 156 /* TypeParameter */: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(ts.updateTypeParameterDeclaration(input, input.name, /*constraint*/ undefined, /*defaultType*/ undefined)); } return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context)); } - case 180 /* ConditionalType */: { + case 181 /* ConditionalType */: { // We have to process conditional types in a special way because for visibility purposes we need to push a new enclosingDeclaration // just for the `infer` types in the true branch. It's an implicit declaration scope that only applies to _part_ of the type. var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree); @@ -91848,13 +92247,13 @@ var ts; var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree); return cleanup(ts.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 170 /* FunctionType */: { + case 171 /* FunctionType */: { return cleanup(ts.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 171 /* ConstructorType */: { + case 172 /* ConstructorType */: { return cleanup(ts.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 188 /* ImportType */: { + case 189 /* ImportType */: { if (!ts.isLiteralImportTypeNode(input)) return cleanup(input); return cleanup(ts.updateImportTypeNode(input, ts.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf)); @@ -91883,7 +92282,7 @@ var ts; } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 161 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); + return node.parent.kind === 162 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -91893,7 +92292,7 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 260 /* ExportDeclaration */: { + case 261 /* ExportDeclaration */: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -91903,7 +92302,7 @@ var ts; return ts.updateExportDeclaration(input, /*decorators*/ undefined, input.modifiers, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier), input.isTypeOnly); } - case 259 /* ExportAssignment */: { + case 260 /* ExportAssignment */: { // Always visible if the parent node isn't dropped for being not visible if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; @@ -91919,7 +92318,7 @@ var ts; errorNode: input }); }; var varDecl = ts.createVariableDeclaration(newId, resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); return [statement, ts.updateExportAssignment(input, input.decorators, input.modifiers, newId)]; } } @@ -91944,10 +92343,10 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 253 /* ImportEqualsDeclaration */: { + case 254 /* ImportEqualsDeclaration */: { return transformImportEqualsDeclaration(input); } - case 254 /* ImportDeclaration */: { + case 255 /* ImportDeclaration */: { return transformImportDeclaration(input); } } @@ -91968,14 +92367,14 @@ var ts; } var previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 247 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all + case 248 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all return cleanup(ts.updateTypeAliasDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode))); - case 246 /* InterfaceDeclaration */: { + case 247 /* InterfaceDeclaration */: { return cleanup(ts.updateInterfaceDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree))); } - case 244 /* FunctionDeclaration */: { + case 245 /* FunctionDeclaration */: { // Generators lose their generator-ness, excepting their return type var clean = cleanup(ts.updateFunctionDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), @@ -92023,10 +92422,10 @@ var ts; return clean; } } - case 249 /* ModuleDeclaration */: { + case 250 /* ModuleDeclaration */: { needsDeclare = false; var inner = input.body; - if (inner && inner.kind === 250 /* ModuleBlock */) { + if (inner && inner.kind === 251 /* ModuleBlock */) { var oldNeedsScopeFix = needsScopeFixMarker; var oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; @@ -92069,7 +92468,7 @@ var ts; /*decorators*/ undefined, mods, input.name, body)); } } - case 245 /* ClassDeclaration */: { + case 246 /* ClassDeclaration */: { var modifiers = ts.createNodeArray(ensureModifiers(input)); var typeParameters = ensureTypeParams(input, input.typeParameters); var ctor = ts.getFirstConstructorWithBody(input); @@ -92130,7 +92529,7 @@ var ts; typeName: input.name }); }; var varDecl = ts.createVariableDeclaration(newId_1, resolver.createTypeOfExpression(extendsClause_1.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); var heritageClauses = ts.createNodeArray(ts.map(input.heritageClauses, function (clause) { if (clause.token === 90 /* ExtendsKeyword */) { var oldDiag_2 = getSymbolAccessibilityDiagnostic; @@ -92150,10 +92549,10 @@ var ts; /*decorators*/ undefined, modifiers, input.name, typeParameters, heritageClauses, members)); } } - case 225 /* VariableStatement */: { + case 226 /* VariableStatement */: { return cleanup(transformVariableStatement(input)); } - case 248 /* EnumDeclaration */: { + case 249 /* EnumDeclaration */: { return cleanup(ts.updateEnumDeclaration(input, /*decorators*/ undefined, ts.createNodeArray(ensureModifiers(input)), input.name, ts.createNodeArray(ts.mapDefined(input.members, function (m) { if (shouldStripInternal(m)) return; @@ -92172,7 +92571,7 @@ var ts; if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 249 /* ModuleDeclaration */) { + if (input.kind === 250 /* ModuleDeclaration */) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -92193,7 +92592,7 @@ var ts; return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); })); } function recreateBindingElement(e) { - if (e.kind === 215 /* OmittedExpression */) { + if (e.kind === 216 /* OmittedExpression */) { return; } if (e.name) { @@ -92243,7 +92642,7 @@ var ts; function ensureModifierFlags(node) { var mask = 3071 /* All */ ^ (4 /* Public */ | 256 /* Async */); // No async modifiers in declaration files var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */; - var parentIsFile = node.parent.kind === 290 /* SourceFile */; + var parentIsFile = node.parent.kind === 291 /* SourceFile */; if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) { mask ^= 2 /* Ambient */; additions = 0 /* None */; @@ -92272,7 +92671,7 @@ var ts; } ts.transformDeclarations = transformDeclarations; function isAlwaysType(node) { - if (node.kind === 246 /* InterfaceDeclaration */) { + if (node.kind === 247 /* InterfaceDeclaration */) { return true; } return false; @@ -92297,7 +92696,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 163 /* GetAccessor */ + return accessor.kind === 164 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -92306,52 +92705,52 @@ var ts; } function canHaveLiteralInitializer(node) { switch (node.kind) { - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: return !ts.hasModifier(node, 8 /* Private */); - case 156 /* Parameter */: - case 242 /* VariableDeclaration */: + case 157 /* Parameter */: + case 243 /* VariableDeclaration */: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 244 /* FunctionDeclaration */: - case 249 /* ModuleDeclaration */: - case 253 /* ImportEqualsDeclaration */: - case 246 /* InterfaceDeclaration */: - case 245 /* ClassDeclaration */: - case 247 /* TypeAliasDeclaration */: - case 248 /* EnumDeclaration */: - case 225 /* VariableStatement */: - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: - case 259 /* ExportAssignment */: + case 245 /* FunctionDeclaration */: + case 250 /* ModuleDeclaration */: + case 254 /* ImportEqualsDeclaration */: + case 247 /* InterfaceDeclaration */: + case 246 /* ClassDeclaration */: + case 248 /* TypeAliasDeclaration */: + case 249 /* EnumDeclaration */: + case 226 /* VariableStatement */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: + case 260 /* ExportAssignment */: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 166 /* ConstructSignature */: - case 162 /* Constructor */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 159 /* PropertyDeclaration */: - case 158 /* PropertySignature */: - case 160 /* MethodSignature */: - case 165 /* CallSignature */: - case 167 /* IndexSignature */: - case 242 /* VariableDeclaration */: - case 155 /* TypeParameter */: - case 216 /* ExpressionWithTypeArguments */: - case 169 /* TypeReference */: - case 180 /* ConditionalType */: - case 170 /* FunctionType */: - case 171 /* ConstructorType */: - case 188 /* ImportType */: + case 167 /* ConstructSignature */: + case 163 /* Constructor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 160 /* PropertyDeclaration */: + case 159 /* PropertySignature */: + case 161 /* MethodSignature */: + case 166 /* CallSignature */: + case 168 /* IndexSignature */: + case 243 /* VariableDeclaration */: + case 156 /* TypeParameter */: + case 217 /* ExpressionWithTypeArguments */: + case 170 /* TypeReference */: + case 181 /* ConditionalType */: + case 171 /* FunctionType */: + case 172 /* ConstructorType */: + case 189 /* ImportType */: return true; } return false; @@ -92484,7 +92883,7 @@ var ts; * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(331 /* Count */); + var enabledSyntaxKindFeatures = new Array(332 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -92848,7 +93247,7 @@ var ts; /*@internal*/ function getOutputPathsFor(sourceFile, host, forceDtsPaths) { var options = host.getCompilerOptions(); - if (sourceFile.kind === 291 /* Bundle */) { + if (sourceFile.kind === 292 /* Bundle */) { return getOutputPathsForBundle(options, forceDtsPaths); } else { @@ -93178,7 +93577,7 @@ var ts; mapRoot: compilerOptions.mapRoot, extendedDiagnostics: compilerOptions.extendedDiagnostics, }); - if (forceDtsEmit && declarationTransform.transformed[0].kind === 290 /* SourceFile */) { + if (forceDtsEmit && declarationTransform.transformed[0].kind === 291 /* SourceFile */) { var sourceFile = declarationTransform.transformed[0]; exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit; } @@ -93201,8 +93600,8 @@ var ts; ts.forEachChild(node, collectLinkedAliases); } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) { - var bundle = sourceFileOrBundle.kind === 291 /* Bundle */ ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 290 /* SourceFile */ ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 292 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 291 /* SourceFile */ ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; var sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -93243,7 +93642,7 @@ var ts; } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { return (mapOptions.sourceMap || mapOptions.inlineSourceMap) - && (sourceFileOrBundle.kind !== 290 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); + && (sourceFileOrBundle.kind !== 291 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); } function getSourceRoot(mapOptions) { // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the @@ -93354,7 +93753,7 @@ var ts; }; function createSourceFilesFromBundleBuildInfo(bundle, buildInfoDirectory, host) { var sourceFiles = bundle.sourceFiles.map(function (fileName) { - var sourceFile = ts.createNode(290 /* SourceFile */, 0, 0); + var sourceFile = ts.createNode(291 /* SourceFile */, 0, 0); sourceFile.fileName = ts.getRelativePathFromDirectory(host.getCurrentDirectory(), ts.getNormalizedAbsolutePath(fileName, buildInfoDirectory), !host.useCaseSensitiveFileNames()); sourceFile.text = ""; sourceFile.statements = ts.createNodeArray(); @@ -93366,7 +93765,7 @@ var ts; sourceFile.text = prologueInfo.text; sourceFile.end = prologueInfo.text.length; sourceFile.statements = ts.createNodeArray(prologueInfo.directives.map(function (directive) { - var statement = ts.createNode(226 /* ExpressionStatement */, directive.pos, directive.end); + var statement = ts.createNode(227 /* ExpressionStatement */, directive.pos, directive.end); statement.expression = ts.createNode(10 /* StringLiteral */, directive.expression.pos, directive.expression.end); statement.expression.text = directive.expression.text; return statement; @@ -93543,9 +93942,9 @@ var ts; break; } switch (node.kind) { - case 290 /* SourceFile */: return printFile(node); - case 291 /* Bundle */: return printBundle(node); - case 292 /* UnparsedSource */: return printUnparsedSource(node); + case 291 /* SourceFile */: return printFile(node); + case 292 /* Bundle */: return printBundle(node); + case 293 /* UnparsedSource */: return printUnparsedSource(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); @@ -93796,12 +94195,12 @@ var ts; } // falls through case 2 /* Comments */: - if (!commentsDisabled && node.kind !== 290 /* SourceFile */) { + if (!commentsDisabled && node.kind !== 291 /* SourceFile */) { return pipelineEmitWithComments; } // falls through case 3 /* SourceMaps */: - if (!sourceMapsDisabled && node.kind !== 290 /* SourceFile */ && !ts.isInJsonFile(node)) { + if (!sourceMapsDisabled && node.kind !== 291 /* SourceFile */ && !ts.isInJsonFile(node)) { return pipelineEmitWithSourceMap; } // falls through @@ -93843,15 +94242,15 @@ var ts; case 16 /* TemplateMiddle */: case 17 /* TemplateTail */: return emitLiteral(node, /*jsxAttributeEscape*/ false); - case 292 /* UnparsedSource */: - case 286 /* UnparsedPrepend */: + case 293 /* UnparsedSource */: + case 287 /* UnparsedPrepend */: return emitUnparsedSourceOrPrepend(node); - case 285 /* UnparsedPrologue */: + case 286 /* UnparsedPrologue */: return writeUnparsedNode(node); - case 287 /* UnparsedText */: - case 288 /* UnparsedInternalText */: + case 288 /* UnparsedText */: + case 289 /* UnparsedInternalText */: return emitUnparsedTextLike(node); - case 289 /* UnparsedSyntheticReference */: + case 290 /* UnparsedSyntheticReference */: return emitUnparsedSyntheticReference(node); // Identifiers case 75 /* Identifier */: @@ -93861,260 +94260,260 @@ var ts; return emitPrivateIdentifier(node); // Parse tree nodes // Names - case 153 /* QualifiedName */: + case 154 /* QualifiedName */: return emitQualifiedName(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 155 /* TypeParameter */: + case 156 /* TypeParameter */: return emitTypeParameter(node); - case 156 /* Parameter */: + case 157 /* Parameter */: return emitParameter(node); - case 157 /* Decorator */: + case 158 /* Decorator */: return emitDecorator(node); // Type members - case 158 /* PropertySignature */: + case 159 /* PropertySignature */: return emitPropertySignature(node); - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 160 /* MethodSignature */: + case 161 /* MethodSignature */: return emitMethodSignature(node); - case 161 /* MethodDeclaration */: + case 162 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 162 /* Constructor */: + case 163 /* Constructor */: return emitConstructor(node); - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return emitAccessorDeclaration(node); - case 165 /* CallSignature */: + case 166 /* CallSignature */: return emitCallSignature(node); - case 166 /* ConstructSignature */: + case 167 /* ConstructSignature */: return emitConstructSignature(node); - case 167 /* IndexSignature */: + case 168 /* IndexSignature */: return emitIndexSignature(node); // Types - case 168 /* TypePredicate */: + case 169 /* TypePredicate */: return emitTypePredicate(node); - case 169 /* TypeReference */: + case 170 /* TypeReference */: return emitTypeReference(node); - case 170 /* FunctionType */: + case 171 /* FunctionType */: return emitFunctionType(node); - case 300 /* JSDocFunctionType */: + case 301 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 171 /* ConstructorType */: + case 172 /* ConstructorType */: return emitConstructorType(node); - case 172 /* TypeQuery */: + case 173 /* TypeQuery */: return emitTypeQuery(node); - case 173 /* TypeLiteral */: + case 174 /* TypeLiteral */: return emitTypeLiteral(node); - case 174 /* ArrayType */: + case 175 /* ArrayType */: return emitArrayType(node); - case 175 /* TupleType */: + case 176 /* TupleType */: return emitTupleType(node); - case 176 /* OptionalType */: + case 177 /* OptionalType */: return emitOptionalType(node); - case 178 /* UnionType */: + case 179 /* UnionType */: return emitUnionType(node); - case 179 /* IntersectionType */: + case 180 /* IntersectionType */: return emitIntersectionType(node); - case 180 /* ConditionalType */: + case 181 /* ConditionalType */: return emitConditionalType(node); - case 181 /* InferType */: + case 182 /* InferType */: return emitInferType(node); - case 182 /* ParenthesizedType */: + case 183 /* ParenthesizedType */: return emitParenthesizedType(node); - case 216 /* ExpressionWithTypeArguments */: + case 217 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 183 /* ThisType */: + case 184 /* ThisType */: return emitThisType(); - case 184 /* TypeOperator */: + case 185 /* TypeOperator */: return emitTypeOperator(node); - case 185 /* IndexedAccessType */: + case 186 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 186 /* MappedType */: + case 187 /* MappedType */: return emitMappedType(node); - case 187 /* LiteralType */: + case 188 /* LiteralType */: return emitLiteralType(node); - case 188 /* ImportType */: + case 189 /* ImportType */: return emitImportTypeNode(node); - case 295 /* JSDocAllType */: + case 296 /* JSDocAllType */: writePunctuation("*"); return; - case 296 /* JSDocUnknownType */: + case 297 /* JSDocUnknownType */: writePunctuation("?"); return; - case 297 /* JSDocNullableType */: + case 298 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 298 /* JSDocNonNullableType */: + case 299 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 299 /* JSDocOptionalType */: + case 300 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 177 /* RestType */: - case 301 /* JSDocVariadicType */: + case 178 /* RestType */: + case 302 /* JSDocVariadicType */: return emitRestOrJSDocVariadicType(node); // Binding patterns - case 189 /* ObjectBindingPattern */: + case 190 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 190 /* ArrayBindingPattern */: + case 191 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 191 /* BindingElement */: + case 192 /* BindingElement */: return emitBindingElement(node); // Misc - case 221 /* TemplateSpan */: + case 222 /* TemplateSpan */: return emitTemplateSpan(node); - case 222 /* SemicolonClassElement */: + case 223 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 223 /* Block */: + case 224 /* Block */: return emitBlock(node); - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: return emitVariableStatement(node); - case 224 /* EmptyStatement */: + case 225 /* EmptyStatement */: return emitEmptyStatement(/*isEmbeddedStatement*/ false); - case 226 /* ExpressionStatement */: + case 227 /* ExpressionStatement */: return emitExpressionStatement(node); - case 227 /* IfStatement */: + case 228 /* IfStatement */: return emitIfStatement(node); - case 228 /* DoStatement */: + case 229 /* DoStatement */: return emitDoStatement(node); - case 229 /* WhileStatement */: + case 230 /* WhileStatement */: return emitWhileStatement(node); - case 230 /* ForStatement */: + case 231 /* ForStatement */: return emitForStatement(node); - case 231 /* ForInStatement */: + case 232 /* ForInStatement */: return emitForInStatement(node); - case 232 /* ForOfStatement */: + case 233 /* ForOfStatement */: return emitForOfStatement(node); - case 233 /* ContinueStatement */: + case 234 /* ContinueStatement */: return emitContinueStatement(node); - case 234 /* BreakStatement */: + case 235 /* BreakStatement */: return emitBreakStatement(node); - case 235 /* ReturnStatement */: + case 236 /* ReturnStatement */: return emitReturnStatement(node); - case 236 /* WithStatement */: + case 237 /* WithStatement */: return emitWithStatement(node); - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: return emitSwitchStatement(node); - case 238 /* LabeledStatement */: + case 239 /* LabeledStatement */: return emitLabeledStatement(node); - case 239 /* ThrowStatement */: + case 240 /* ThrowStatement */: return emitThrowStatement(node); - case 240 /* TryStatement */: + case 241 /* TryStatement */: return emitTryStatement(node); - case 241 /* DebuggerStatement */: + case 242 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 242 /* VariableDeclaration */: + case 243 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 245 /* ClassDeclaration */: + case 246 /* ClassDeclaration */: return emitClassDeclaration(node); - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 249 /* ModuleDeclaration */: + case 250 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 250 /* ModuleBlock */: + case 251 /* ModuleBlock */: return emitModuleBlock(node); - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: return emitCaseBlock(node); - case 252 /* NamespaceExportDeclaration */: + case 253 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: return emitImportDeclaration(node); - case 255 /* ImportClause */: + case 256 /* ImportClause */: return emitImportClause(node); - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: return emitNamespaceImport(node); - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: return emitNamespaceExport(node); - case 257 /* NamedImports */: + case 258 /* NamedImports */: return emitNamedImports(node); - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: return emitImportSpecifier(node); - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: return emitExportAssignment(node); - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: return emitExportDeclaration(node); - case 261 /* NamedExports */: + case 262 /* NamedExports */: return emitNamedExports(node); - case 263 /* ExportSpecifier */: + case 264 /* ExportSpecifier */: return emitExportSpecifier(node); - case 264 /* MissingDeclaration */: + case 265 /* MissingDeclaration */: return; // Module references - case 265 /* ExternalModuleReference */: + case 266 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 11 /* JsxText */: return emitJsxText(node); - case 268 /* JsxOpeningElement */: - case 271 /* JsxOpeningFragment */: + case 269 /* JsxOpeningElement */: + case 272 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 269 /* JsxClosingElement */: - case 272 /* JsxClosingFragment */: + case 270 /* JsxClosingElement */: + case 273 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 273 /* JsxAttribute */: + case 274 /* JsxAttribute */: return emitJsxAttribute(node); - case 274 /* JsxAttributes */: + case 275 /* JsxAttributes */: return emitJsxAttributes(node); - case 275 /* JsxSpreadAttribute */: + case 276 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 276 /* JsxExpression */: + case 277 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 277 /* CaseClause */: + case 278 /* CaseClause */: return emitCaseClause(node); - case 278 /* DefaultClause */: + case 279 /* DefaultClause */: return emitDefaultClause(node); - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: return emitHeritageClause(node); - case 280 /* CatchClause */: + case 281 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 281 /* PropertyAssignment */: + case 282 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 282 /* ShorthandPropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 283 /* SpreadAssignment */: + case 284 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 284 /* EnumMember */: + case 285 /* EnumMember */: return emitEnumMember(node); // JSDoc nodes (only used in codefixes currently) - case 317 /* JSDocParameterTag */: - case 323 /* JSDocPropertyTag */: + case 318 /* JSDocParameterTag */: + case 324 /* JSDocPropertyTag */: return emitJSDocPropertyLikeTag(node); - case 318 /* JSDocReturnTag */: - case 320 /* JSDocTypeTag */: - case 319 /* JSDocThisTag */: - case 316 /* JSDocEnumTag */: + case 319 /* JSDocReturnTag */: + case 321 /* JSDocTypeTag */: + case 320 /* JSDocThisTag */: + case 317 /* JSDocEnumTag */: return emitJSDocSimpleTypedTag(node); - case 308 /* JSDocImplementsTag */: - case 307 /* JSDocAugmentsTag */: + case 309 /* JSDocImplementsTag */: + case 308 /* JSDocAugmentsTag */: return emitJSDocHeritageTag(node); - case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); - case 322 /* JSDocTypedefTag */: + case 323 /* JSDocTypedefTag */: return emitJSDocTypedefTag(node); - case 315 /* JSDocCallbackTag */: + case 316 /* JSDocCallbackTag */: return emitJSDocCallbackTag(node); - case 305 /* JSDocSignature */: + case 306 /* JSDocSignature */: return emitJSDocSignature(node); - case 304 /* JSDocTypeLiteral */: + case 305 /* JSDocTypeLiteral */: return emitJSDocTypeLiteral(node); - case 310 /* JSDocClassTag */: - case 306 /* JSDocTag */: + case 311 /* JSDocClassTag */: + case 307 /* JSDocTag */: return emitJSDocSimpleTag(node); - case 303 /* JSDocComment */: + case 304 /* JSDocComment */: return emitJSDoc(node); // Transformation nodes (ignored) } @@ -94151,71 +94550,71 @@ var ts; writeTokenNode(node, writeKeyword); return; // Expressions - case 192 /* ArrayLiteralExpression */: + case 193 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 193 /* ObjectLiteralExpression */: + case 194 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 194 /* PropertyAccessExpression */: + case 195 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 195 /* ElementAccessExpression */: + case 196 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 196 /* CallExpression */: + case 197 /* CallExpression */: return emitCallExpression(node); - case 197 /* NewExpression */: + case 198 /* NewExpression */: return emitNewExpression(node); - case 198 /* TaggedTemplateExpression */: + case 199 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 200 /* ParenthesizedExpression */: + case 201 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 201 /* FunctionExpression */: + case 202 /* FunctionExpression */: return emitFunctionExpression(node); - case 202 /* ArrowFunction */: + case 203 /* ArrowFunction */: return emitArrowFunction(node); - case 203 /* DeleteExpression */: + case 204 /* DeleteExpression */: return emitDeleteExpression(node); - case 204 /* TypeOfExpression */: + case 205 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 205 /* VoidExpression */: + case 206 /* VoidExpression */: return emitVoidExpression(node); - case 206 /* AwaitExpression */: + case 207 /* AwaitExpression */: return emitAwaitExpression(node); - case 207 /* PrefixUnaryExpression */: + case 208 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 208 /* PostfixUnaryExpression */: + case 209 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 209 /* BinaryExpression */: + case 210 /* BinaryExpression */: return emitBinaryExpression(node); - case 210 /* ConditionalExpression */: + case 211 /* ConditionalExpression */: return emitConditionalExpression(node); - case 211 /* TemplateExpression */: + case 212 /* TemplateExpression */: return emitTemplateExpression(node); - case 212 /* YieldExpression */: + case 213 /* YieldExpression */: return emitYieldExpression(node); - case 213 /* SpreadElement */: + case 214 /* SpreadElement */: return emitSpreadExpression(node); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return emitClassExpression(node); - case 215 /* OmittedExpression */: + case 216 /* OmittedExpression */: return; - case 217 /* AsExpression */: + case 218 /* AsExpression */: return emitAsExpression(node); - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: return emitNonNullExpression(node); - case 219 /* MetaProperty */: + case 220 /* MetaProperty */: return emitMetaProperty(node); // JSX - case 266 /* JsxElement */: + case 267 /* JsxElement */: return emitJsxElement(node); - case 267 /* JsxSelfClosingElement */: + case 268 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 270 /* JsxFragment */: + case 271 /* JsxFragment */: return emitJsxFragment(node); // Transformation nodes - case 326 /* PartiallyEmittedExpression */: + case 327 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 327 /* CommaListExpression */: + case 328 /* CommaListExpression */: return emitCommaList(node); } } @@ -94257,7 +94656,7 @@ var ts; } function emitHelpers(node) { var helpersEmitted = false; - var bundle = node.kind === 291 /* Bundle */ ? node : undefined; + var bundle = node.kind === 292 /* Bundle */ ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -94357,7 +94756,7 @@ var ts; var pos = getTextPosWithWriteLine(); writeUnparsedNode(unparsed); if (bundleFileInfo) { - updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 287 /* UnparsedText */ ? + updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 288 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */); } @@ -94430,7 +94829,7 @@ var ts; emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 300 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 301 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { @@ -94492,7 +94891,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - writeKeyword(node.kind === 163 /* GetAccessor */ ? "get" : "set"); + writeKeyword(node.kind === 164 /* GetAccessor */ ? "get" : "set"); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -94675,7 +95074,7 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - if (node.readonlyToken.kind !== 138 /* ReadonlyKeyword */) { + if (node.readonlyToken.kind !== 139 /* ReadonlyKeyword */) { writeKeyword("readonly"); } writeSpace(); @@ -94766,7 +95165,7 @@ var ts; } function emitPropertyAccessExpression(node) { var expression = ts.cast(emitExpression(node.expression), ts.isExpression); - var token = ts.getDotOrQuestionDotToken(node); + var token = node.questionDotToken || ts.createNode(24 /* DotToken */, node.expression.end, node.name.pos); var indentBeforeDot = needsIndentation(node, node.expression, token); var indentAfterDot = needsIndentation(node, token, node.name); increaseIndentIf(indentBeforeDot, /*writeSpaceIfNotIndenting*/ false); @@ -94777,7 +95176,12 @@ var ts; if (shouldEmitDotDot) { writePunctuation("."); } - emitTokenWithComment(token.kind, node.expression.end, writePunctuation, node); + if (node.questionDotToken) { + emit(token); + } + else { + emitTokenWithComment(token.kind, node.expression.end, writePunctuation, node); + } increaseIndentIf(indentAfterDot, /*writeSpaceIfNotIndenting*/ false); emit(node.name); decreaseIndentIf(indentBeforeDot, indentAfterDot); @@ -94895,7 +95299,7 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 207 /* PrefixUnaryExpression */ + return operand.kind === 208 /* PrefixUnaryExpression */ && ((node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */)) || (node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */))); } @@ -95083,7 +95487,7 @@ var ts; if (node.elseStatement) { writeLineOrSpace(node); emitTokenWithComment(87 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 227 /* IfStatement */) { + if (node.elseStatement.kind === 228 /* IfStatement */) { writeSpace(); emit(node.elseStatement); } @@ -95146,7 +95550,7 @@ var ts; emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - emitTokenWithComment(152 /* OfKeyword */, node.initializer.end, writeKeyword, node); + emitTokenWithComment(153 /* OfKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); @@ -95154,7 +95558,7 @@ var ts; } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 243 /* VariableDeclarationList */) { + if (node.kind === 244 /* VariableDeclarationList */) { emit(node); } else { @@ -95450,7 +95854,7 @@ var ts; var body = node.body; if (!body) return writeTrailingSemicolon(); - while (body.kind === 249 /* ModuleDeclaration */) { + while (body.kind === 250 /* ModuleDeclaration */) { writePunctuation("."); emit(body.name); body = body.body; @@ -95495,7 +95899,7 @@ var ts; if (node.importClause) { emit(node.importClause); writeSpace(); - emitTokenWithComment(149 /* FromKeyword */, node.importClause.end, writeKeyword, node); + emitTokenWithComment(150 /* FromKeyword */, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -95503,7 +95907,7 @@ var ts; } function emitImportClause(node) { if (node.isTypeOnly) { - emitTokenWithComment(145 /* TypeKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(146 /* TypeKeyword */, node.pos, writeKeyword, node); writeSpace(); } emit(node.name); @@ -95543,7 +95947,7 @@ var ts; var nextPos = emitTokenWithComment(89 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { - nextPos = emitTokenWithComment(145 /* TypeKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(146 /* TypeKeyword */, nextPos, writeKeyword, node); writeSpace(); } if (node.exportClause) { @@ -95555,7 +95959,7 @@ var ts; if (node.moduleSpecifier) { writeSpace(); var fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(149 /* FromKeyword */, fromPos, writeKeyword, node); + emitTokenWithComment(150 /* FromKeyword */, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } @@ -95566,7 +95970,7 @@ var ts; writeSpace(); nextPos = emitTokenWithComment(123 /* AsKeyword */, nextPos, writeKeyword, node); writeSpace(); - nextPos = emitTokenWithComment(136 /* NamespaceKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(137 /* NamespaceKeyword */, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeTrailingSemicolon(); @@ -95786,7 +96190,7 @@ var ts; } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 320 /* JSDocTypeTag */ && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 321 /* JSDocTypeTag */ && !node.comment) { writeSpace(); emit(node.tags[0]); } @@ -95820,7 +96224,7 @@ var ts; function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 294 /* JSDocTypeExpression */) { + if (tag.typeExpression.kind === 295 /* JSDocTypeExpression */) { emitJSDocTypeExpression(tag.typeExpression); } else { @@ -95839,7 +96243,7 @@ var ts; emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 304 /* JSDocTypeLiteral */) { + if (tag.typeExpression && tag.typeExpression.kind === 305 /* JSDocTypeLiteral */) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -96619,7 +97023,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 200 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 201 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -96684,84 +97088,84 @@ var ts; if (!node) return; switch (node.kind) { - case 223 /* Block */: + case 224 /* Block */: ts.forEach(node.statements, generateNames); break; - case 238 /* LabeledStatement */: - case 236 /* WithStatement */: - case 228 /* DoStatement */: - case 229 /* WhileStatement */: + case 239 /* LabeledStatement */: + case 237 /* WithStatement */: + case 229 /* DoStatement */: + case 230 /* WhileStatement */: generateNames(node.statement); break; - case 227 /* IfStatement */: + case 228 /* IfStatement */: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 230 /* ForStatement */: - case 232 /* ForOfStatement */: - case 231 /* ForInStatement */: + case 231 /* ForStatement */: + case 233 /* ForOfStatement */: + case 232 /* ForInStatement */: generateNames(node.initializer); generateNames(node.statement); break; - case 237 /* SwitchStatement */: + case 238 /* SwitchStatement */: generateNames(node.caseBlock); break; - case 251 /* CaseBlock */: + case 252 /* CaseBlock */: ts.forEach(node.clauses, generateNames); break; - case 277 /* CaseClause */: - case 278 /* DefaultClause */: + case 278 /* CaseClause */: + case 279 /* DefaultClause */: ts.forEach(node.statements, generateNames); break; - case 240 /* TryStatement */: + case 241 /* TryStatement */: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 280 /* CatchClause */: + case 281 /* CatchClause */: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: generateNames(node.declarationList); break; - case 243 /* VariableDeclarationList */: + case 244 /* VariableDeclarationList */: ts.forEach(node.declarations, generateNames); break; - case 242 /* VariableDeclaration */: - case 156 /* Parameter */: - case 191 /* BindingElement */: - case 245 /* ClassDeclaration */: + case 243 /* VariableDeclaration */: + case 157 /* Parameter */: + case 192 /* BindingElement */: + case 246 /* ClassDeclaration */: generateNameIfNeeded(node.name); break; - case 244 /* FunctionDeclaration */: + case 245 /* FunctionDeclaration */: generateNameIfNeeded(node.name); if (ts.getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) { ts.forEach(node.parameters, generateNames); generateNames(node.body); } break; - case 189 /* ObjectBindingPattern */: - case 190 /* ArrayBindingPattern */: + case 190 /* ObjectBindingPattern */: + case 191 /* ArrayBindingPattern */: ts.forEach(node.elements, generateNames); break; - case 254 /* ImportDeclaration */: + case 255 /* ImportDeclaration */: generateNames(node.importClause); break; - case 255 /* ImportClause */: + case 256 /* ImportClause */: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; - case 256 /* NamespaceImport */: + case 257 /* NamespaceImport */: generateNameIfNeeded(node.name); break; - case 262 /* NamespaceExport */: + case 263 /* NamespaceExport */: generateNameIfNeeded(node.name); break; - case 257 /* NamedImports */: + case 258 /* NamedImports */: ts.forEach(node.elements, generateNames); break; - case 258 /* ImportSpecifier */: + case 259 /* ImportSpecifier */: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -96770,12 +97174,12 @@ var ts; if (!node) return; switch (node.kind) { - case 281 /* PropertyAssignment */: - case 282 /* ShorthandPropertyAssignment */: - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 282 /* PropertyAssignment */: + case 283 /* ShorthandPropertyAssignment */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: generateNameIfNeeded(node.name); break; } @@ -96957,23 +97361,23 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16 /* Optimistic */), !!(flags & 8 /* ReservedInNestedScopes */)); - case 249 /* ModuleDeclaration */: - case 248 /* EnumDeclaration */: + case 250 /* ModuleDeclaration */: + case 249 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 254 /* ImportDeclaration */: - case 260 /* ExportDeclaration */: + case 255 /* ImportDeclaration */: + case 261 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 244 /* FunctionDeclaration */: - case 245 /* ClassDeclaration */: - case 259 /* ExportAssignment */: + case 245 /* FunctionDeclaration */: + case 246 /* ClassDeclaration */: + case 260 /* ExportAssignment */: return generateNameForExportDefault(); - case 214 /* ClassExpression */: + case 215 /* ClassExpression */: return generateNameForClassExpression(); - case 161 /* MethodDeclaration */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: + case 162 /* MethodDeclaration */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: return generateNameForMethodOrAccessor(node); - case 154 /* ComputedPropertyName */: + case 155 /* ComputedPropertyName */: return makeTempVariableName(0 /* Auto */, /*reserveInNestedScopes*/ true); default: return makeTempVariableName(0 /* Auto */); @@ -97021,7 +97425,7 @@ var ts; hasWrittenComment = false; var emitFlags = ts.getEmitFlags(node); var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var isEmittedNode = node.kind !== 325 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 326 /* NotEmittedStatement */; // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is "preserve" we will not do any transformation. // It is expensive to walk entire tree just to set one kind of node to have no comments. var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 11 /* JsxText */; @@ -97045,7 +97449,7 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 243 /* VariableDeclarationList */) { + if (node.kind === 244 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -97304,7 +97708,7 @@ var ts; else { var _a = ts.getSourceMapRange(node), pos = _a.pos, end = _a.end, _b = _a.source, source = _b === void 0 ? sourceMapSource : _b; var emitFlags = ts.getEmitFlags(node); - if (node.kind !== 325 /* NotEmittedStatement */ + if (node.kind !== 326 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitSourcePos(source, skipSourceTrivia(source, pos)); @@ -97317,7 +97721,7 @@ var ts; else { pipelinePhase(hint, node); } - if (node.kind !== 325 /* NotEmittedStatement */ + if (node.kind !== 326 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitSourcePos(source, end); @@ -97777,7 +98181,6 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var ignoreDiagnosticCommentRegEx = /(^\s*$)|(^\s*\/\/\/?\s*(@ts-ignore)?)/; function findConfigFile(searchPath, fileExists, configName) { if (configName === void 0) { configName = "tsconfig.json"; } return ts.forEachAncestorDirectory(searchPath, function (ancestor) { @@ -98347,6 +98750,7 @@ var ts; }; } function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) { + var _a; var createProgramOptions = ts.isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions; // TODO: GH#18217 var rootNames = createProgramOptions.rootNames, options = createProgramOptions.options, configFileParsingDiagnostics = createProgramOptions.configFileParsingDiagnostics, projectReferences = createProgramOptions.projectReferences; var oldProgram = createProgramOptions.oldProgram; @@ -98443,7 +98847,16 @@ var ts; var projectReferenceRedirects; var mapFromFileToProjectReferenceRedirects; var mapFromToProjectReferenceRedirectSource; - var useSourceOfProjectReferenceRedirect = !!host.useSourceOfProjectReferenceRedirect && host.useSourceOfProjectReferenceRedirect(); + var useSourceOfProjectReferenceRedirect = !!((_a = host.useSourceOfProjectReferenceRedirect) === null || _a === void 0 ? void 0 : _a.call(host)) && + !options.disableSourceOfProjectReferenceRedirect; + var onProgramCreateComplete = updateHostForUseSourceOfProjectReferenceRedirect({ + compilerHost: host, + useSourceOfProjectReferenceRedirect: useSourceOfProjectReferenceRedirect, + toPath: toPath, + getResolvedProjectReferences: getResolvedProjectReferences, + getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, + forEachResolvedProjectReference: forEachResolvedProjectReference + }); var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); // We set `structuralIsReused` to `undefined` because `tryReuseStructureFromOldProgram` calls `tryReuseStructureFromOldProgram` which checks // `structuralIsReused`, which would be a TDZ violation if it was not set in advance to `undefined`. @@ -98456,12 +98869,6 @@ var ts; if (!resolvedProjectReferences) { resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); } - if (host.setResolvedProjectReferenceCallbacks) { - host.setResolvedProjectReferenceCallbacks({ - getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, - forEachResolvedProjectReference: forEachResolvedProjectReference - }); - } if (rootNames.length) { for (var _i = 0, resolvedProjectReferences_1 = resolvedProjectReferences; _i < resolvedProjectReferences_1.length; _i++) { var parsedRef = resolvedProjectReferences_1[_i]; @@ -98470,8 +98877,8 @@ var ts; var out = parsedRef.commandLine.options.outFile || parsedRef.commandLine.options.out; if (useSourceOfProjectReferenceRedirect) { if (out || ts.getEmitModuleKind(parsedRef.commandLine.options) === ts.ModuleKind.None) { - for (var _a = 0, _b = parsedRef.commandLine.fileNames; _a < _b.length; _a++) { - var fileName = _b[_a]; + for (var _b = 0, _c = parsedRef.commandLine.fileNames; _b < _c.length; _b++) { + var fileName = _c[_b]; processSourceFile(fileName, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined); } } @@ -98481,8 +98888,8 @@ var ts; processSourceFile(ts.changeExtension(out, ".d.ts"), /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined); } else if (ts.getEmitModuleKind(parsedRef.commandLine.options) === ts.ModuleKind.None) { - for (var _c = 0, _d = parsedRef.commandLine.fileNames; _c < _d.length; _c++) { - var fileName = _d[_c]; + for (var _d = 0, _e = parsedRef.commandLine.fileNames; _d < _e.length; _d++) { + var fileName = _e[_d]; if (!ts.fileExtensionIs(fileName, ".d.ts" /* Dts */) && !ts.fileExtensionIs(fileName, ".json" /* Json */)) { processSourceFile(ts.getOutputDeclarationFileName(fileName, parsedRef.commandLine, !host.useCaseSensitiveFileNames()), /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined); } @@ -98534,8 +98941,8 @@ var ts; // not part of the new program. if (oldProgram && host.onReleaseOldSourceFile) { var oldSourceFiles = oldProgram.getSourceFiles(); - for (var _e = 0, oldSourceFiles_1 = oldSourceFiles; _e < oldSourceFiles_1.length; _e++) { - var oldSourceFile = oldSourceFiles_1[_e]; + for (var _f = 0, oldSourceFiles_1 = oldSourceFiles; _f < oldSourceFiles_1.length; _f++) { + var oldSourceFile = oldSourceFiles_1[_f]; var newFile = getSourceFileByPath(oldSourceFile.resolvedPath); if (shouldCreateNewSourceFile || !newFile || // old file wasnt redirect but new file is @@ -98600,8 +99007,10 @@ var ts; forEachResolvedProjectReference: forEachResolvedProjectReference, isSourceOfProjectReferenceRedirect: isSourceOfProjectReferenceRedirect, emitBuildInfo: emitBuildInfo, - getProbableSymlinks: getProbableSymlinks + getProbableSymlinks: getProbableSymlinks, + useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); }, }; + onProgramCreateComplete(); verifyCompilerOptions(); ts.performance.mark("afterProgram"); ts.performance.measure("Program", "beforeProgram", "afterProgram"); @@ -98847,12 +99256,6 @@ var ts; } if (projectReferences) { resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); - if (host.setResolvedProjectReferenceCallbacks) { - host.setResolvedProjectReferenceCallbacks({ - getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, - forEachResolvedProjectReference: forEachResolvedProjectReference - }); - } } // check if program source files has changed in the way that can affect structure of the program var newSourceFiles = []; @@ -99176,19 +99579,19 @@ var ts; } var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName); var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName); - var diagnostics; - for (var _i = 0, _a = [fileProcessingDiagnosticsInFile, programDiagnosticsInFile]; _i < _a.length; _i++) { - var diags = _a[_i]; - if (diags) { - for (var _b = 0, diags_4 = diags; _b < diags_4.length; _b++) { - var diag = diags_4[_b]; - if (shouldReportDiagnostic(diag)) { - diagnostics = ts.append(diagnostics, diag); - } - } - } + return getMergedProgramDiagnostics(sourceFile, fileProcessingDiagnosticsInFile, programDiagnosticsInFile); + } + function getMergedProgramDiagnostics(sourceFile) { + var allDiagnostics = []; + for (var _i = 1; _i < arguments.length; _i++) { + allDiagnostics[_i - 1] = arguments[_i]; } - return diagnostics || ts.emptyArray; + var _a; + var flatDiagnostics = ts.flatten(allDiagnostics); + if (!((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { + return flatDiagnostics; + } + return getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics).diagnostics; } function getDeclarationDiagnostics(sourceFile, cancellationToken) { var options = program.getCompilerOptions(); @@ -99252,49 +99655,66 @@ var ts; sourceFile.scriptKind === 5 /* External */ || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */); var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray; var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray; - var diagnostics; - for (var _i = 0, _a = [bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined]; _i < _a.length; _i++) { - var diags = _a[_i]; - if (diags) { - for (var _b = 0, diags_5 = diags; _b < diags_5.length; _b++) { - var diag = diags_5[_b]; - if (shouldReportDiagnostic(diag)) { - diagnostics = ts.append(diagnostics, diag); - } - } - } - } - return diagnostics || ts.emptyArray; + return getMergedBindAndCheckDiagnostics(sourceFile, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined); }); } + function getMergedBindAndCheckDiagnostics(sourceFile) { + var allDiagnostics = []; + for (var _i = 1; _i < arguments.length; _i++) { + allDiagnostics[_i - 1] = arguments[_i]; + } + var _a; + var flatDiagnostics = ts.flatten(allDiagnostics); + if (!((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { + return flatDiagnostics; + } + var _b = getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics), diagnostics = _b.diagnostics, directives = _b.directives; + for (var _c = 0, _d = directives.getUnusedExpectations(); _c < _d.length; _c++) { + var errorExpectation = _d[_c]; + diagnostics.push(ts.createDiagnosticForRange(sourceFile, errorExpectation.range, ts.Diagnostics.Unused_ts_expect_error_directive)); + } + return diagnostics; + } + /** + * Creates a map of comment directives along with the diagnostics immediately preceded by one of them. + * Comments that match to any of those diagnostics are marked as used. + */ + function getDiagnosticsWithPrecedingDirectives(sourceFile, commentDirectives, flatDiagnostics) { + // Diagnostics are only reported if there is no comment directive preceding them + // This will modify the directives map by marking "used" ones with a corresponding diagnostic + var directives = ts.createCommentDirectivesMap(sourceFile, commentDirectives); + var diagnostics = flatDiagnostics.filter(function (diagnostic) { return markPrecedingCommentDirectiveLine(diagnostic, directives) === -1; }); + return { diagnostics: diagnostics, directives: directives }; + } function getSuggestionDiagnostics(sourceFile, cancellationToken) { return runWithCancellationToken(function () { return getDiagnosticsProducingTypeChecker().getSuggestionDiagnostics(sourceFile, cancellationToken); }); } /** - * Skip errors if previous line start with '// @ts-ignore' comment, not counting non-empty non-comment lines + * @returns The line index marked as preceding the diagnostic, or -1 if none was. */ - function shouldReportDiagnostic(diagnostic) { + function markPrecedingCommentDirectiveLine(diagnostic, directives) { var file = diagnostic.file, start = diagnostic.start; - if (file) { - var lineStarts = ts.getLineStarts(file); - var line = ts.computeLineAndCharacterOfPosition(lineStarts, start).line; // TODO: GH#18217 - while (line > 0) { - var previousLineText = file.text.slice(lineStarts[line - 1], lineStarts[line]); - var result = ignoreDiagnosticCommentRegEx.exec(previousLineText); - if (!result) { - // non-empty line - return true; - } - if (result[3]) { - // @ts-ignore - return false; - } - line--; + if (!file) { + return -1; + } + // Start out with the line just before the text + var lineStarts = ts.getLineStarts(file); + var line = ts.computeLineAndCharacterOfPosition(lineStarts, start).line - 1; // TODO: GH#18217 + while (line >= 0) { + // As soon as that line is known to have a comment directive, use that + if (directives.markUsed(line)) { + return line; + } + // Stop searching if the line is not empty and not a comment + var lineText = file.text.slice(lineStarts[line - 1], lineStarts[line]).trim(); + if (lineText !== "" && !/^(\s*)\/\/(.*)$/.test(lineText)) { + return -1; } + line--; } - return true; + return -1; } function getJSSyntacticDiagnosticsForFile(sourceFile) { return runWithCancellationToken(function () { @@ -99306,22 +99726,22 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 156 /* Parameter */: - case 159 /* PropertyDeclaration */: - case 161 /* MethodDeclaration */: + case 157 /* Parameter */: + case 160 /* PropertyDeclaration */: + case 162 /* MethodDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); return "skip"; } // falls through - case 160 /* MethodSignature */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: - case 242 /* VariableDeclaration */: + case 161 /* MethodSignature */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: + case 243 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); @@ -99329,58 +99749,58 @@ var ts; } } switch (node.kind) { - case 255 /* ImportClause */: + case 256 /* ImportClause */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node.parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); return "skip"; } break; - case 260 /* ExportDeclaration */: + case 261 /* ExportDeclaration */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); return "skip"; } break; - case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_TypeScript_files)); return "skip"; - case 259 /* ExportAssignment */: + case 260 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 279 /* HeritageClause */: + case 280 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 113 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 246 /* InterfaceDeclaration */: + case 247 /* InterfaceDeclaration */: var interfaceKeyword = ts.tokenToString(114 /* InterfaceKeyword */); ts.Debug.assertIsDefined(interfaceKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); return "skip"; - case 249 /* ModuleDeclaration */: - var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(136 /* NamespaceKeyword */) : ts.tokenToString(135 /* ModuleKeyword */); + case 250 /* ModuleDeclaration */: + var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(137 /* NamespaceKeyword */) : ts.tokenToString(136 /* ModuleKeyword */); ts.Debug.assertIsDefined(moduleKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); return "skip"; - case 247 /* TypeAliasDeclaration */: + case 248 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); return "skip"; - case 248 /* EnumDeclaration */: + case 249 /* EnumDeclaration */: var enumKeyword = ts.Debug.checkDefined(ts.tokenToString(88 /* EnumKeyword */)); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); return "skip"; - case 218 /* NonNullExpression */: + case 219 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 217 /* AsExpression */: + case 218 /* AsExpression */: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 199 /* TypeAssertionExpression */: + case 200 /* TypeAssertionExpression */: ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } } @@ -99389,29 +99809,29 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); } switch (parent.kind) { - case 245 /* ClassDeclaration */: - case 214 /* ClassExpression */: - case 161 /* MethodDeclaration */: - case 162 /* Constructor */: - case 163 /* GetAccessor */: - case 164 /* SetAccessor */: - case 201 /* FunctionExpression */: - case 244 /* FunctionDeclaration */: - case 202 /* ArrowFunction */: + case 246 /* ClassDeclaration */: + case 215 /* ClassExpression */: + case 162 /* MethodDeclaration */: + case 163 /* Constructor */: + case 164 /* GetAccessor */: + case 165 /* SetAccessor */: + case 202 /* FunctionExpression */: + case 245 /* FunctionDeclaration */: + case 203 /* ArrowFunction */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } // falls through - case 225 /* VariableStatement */: + case 226 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - checkModifiers(parent.modifiers, parent.kind === 225 /* VariableStatement */); + checkModifiers(parent.modifiers, parent.kind === 226 /* VariableStatement */); return "skip"; } break; - case 159 /* PropertyDeclaration */: + case 160 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -99423,19 +99843,19 @@ var ts; return "skip"; } break; - case 156 /* Parameter */: + case 157 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 196 /* CallExpression */: - case 197 /* NewExpression */: - case 216 /* ExpressionWithTypeArguments */: - case 267 /* JsxSelfClosingElement */: - case 268 /* JsxOpeningElement */: - case 198 /* TaggedTemplateExpression */: + case 197 /* CallExpression */: + case 198 /* NewExpression */: + case 217 /* ExpressionWithTypeArguments */: + case 268 /* JsxSelfClosingElement */: + case 269 /* JsxOpeningElement */: + case 199 /* TaggedTemplateExpression */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); @@ -99457,8 +99877,8 @@ var ts; case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - case 138 /* ReadonlyKeyword */: - case 130 /* DeclareKeyword */: + case 139 /* ReadonlyKeyword */: + case 131 /* DeclareKeyword */: case 122 /* AbstractKeyword */: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind))); break; @@ -100700,6 +101120,155 @@ var ts; } } ts.createProgram = createProgram; + function updateHostForUseSourceOfProjectReferenceRedirect(host) { + var mapOfDeclarationDirectories; + var symlinkedDirectories; + var symlinkedFiles; + var originalFileExists = host.compilerHost.fileExists; + var originalDirectoryExists = host.compilerHost.directoryExists; + var originalGetDirectories = host.compilerHost.getDirectories; + var originalRealpath = host.compilerHost.realpath; + if (!host.useSourceOfProjectReferenceRedirect) + return ts.noop; + // This implementation of fileExists checks if the file being requested is + // .d.ts file for the referenced Project. + // If it is it returns true irrespective of whether that file exists on host + host.compilerHost.fileExists = function (file) { + if (originalFileExists.call(host.compilerHost, file)) + return true; + if (!host.getResolvedProjectReferences()) + return false; + if (!ts.isDeclarationFileName(file)) + return false; + // Project references go to source file instead of .d.ts file + return fileOrDirectoryExistsUsingSource(file, /*isFile*/ true); + }; + if (originalDirectoryExists) { + // This implementation of directoryExists checks if the directory being requested is + // directory of .d.ts file for the referenced Project. + // If it is it returns true irrespective of whether that directory exists on host + host.compilerHost.directoryExists = function (path) { + if (originalDirectoryExists.call(host.compilerHost, path)) { + handleDirectoryCouldBeSymlink(path); + return true; + } + if (!host.getResolvedProjectReferences()) + return false; + if (!mapOfDeclarationDirectories) { + mapOfDeclarationDirectories = ts.createMap(); + host.forEachResolvedProjectReference(function (ref) { + if (!ref) + return; + var out = ref.commandLine.options.outFile || ref.commandLine.options.out; + if (out) { + mapOfDeclarationDirectories.set(ts.getDirectoryPath(host.toPath(out)), true); + } + else { + // Set declaration's in different locations only, if they are next to source the directory present doesnt change + var declarationDir = ref.commandLine.options.declarationDir || ref.commandLine.options.outDir; + if (declarationDir) { + mapOfDeclarationDirectories.set(host.toPath(declarationDir), true); + } + } + }); + } + return fileOrDirectoryExistsUsingSource(path, /*isFile*/ false); + }; + } + if (originalGetDirectories) { + // Call getDirectories only if directory actually present on the host + // This is needed to ensure that we arent getting directories that we fake about presence for + host.compilerHost.getDirectories = function (path) { + return !host.getResolvedProjectReferences() || (originalDirectoryExists && originalDirectoryExists.call(host.compilerHost, path)) ? + originalGetDirectories.call(host.compilerHost, path) : + []; + }; + } + // This is something we keep for life time of the host + if (originalRealpath) { + host.compilerHost.realpath = function (s) { + return (symlinkedFiles === null || symlinkedFiles === void 0 ? void 0 : symlinkedFiles.get(host.toPath(s))) || + originalRealpath.call(host.compilerHost, s); + }; + } + return onProgramCreateComplete; + function onProgramCreateComplete() { + host.compilerHost.fileExists = originalFileExists; + host.compilerHost.directoryExists = originalDirectoryExists; + host.compilerHost.getDirectories = originalGetDirectories; + // DO not revert realpath as it could be used later + } + function fileExistsIfProjectReferenceDts(file) { + var source = host.getSourceOfProjectReferenceRedirect(file); + return source !== undefined ? + ts.isString(source) ? originalFileExists.call(host.compilerHost, source) : true : + undefined; + } + function directoryExistsIfProjectReferenceDeclDir(dir) { + var dirPath = host.toPath(dir); + var dirPathWithTrailingDirectorySeparator = "" + dirPath + ts.directorySeparator; + return ts.forEachKey(mapOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath || + // Any parent directory of declaration dir + ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) || + // Any directory inside declaration dir + ts.startsWith(dirPath, declDirPath + "/"); }); + } + function handleDirectoryCouldBeSymlink(directory) { + if (!host.getResolvedProjectReferences()) + return; + // Because we already watch node_modules, handle symlinks in there + if (!originalRealpath || !ts.stringContains(directory, ts.nodeModulesPathPart)) + return; + if (!symlinkedDirectories) + symlinkedDirectories = ts.createMap(); + var directoryPath = ts.ensureTrailingDirectorySeparator(host.toPath(directory)); + if (symlinkedDirectories.has(directoryPath)) + return; + var real = ts.normalizePath(originalRealpath.call(host.compilerHost, directory)); + var realPath; + if (real === directory || + (realPath = ts.ensureTrailingDirectorySeparator(host.toPath(real))) === directoryPath) { + // not symlinked + symlinkedDirectories.set(directoryPath, false); + return; + } + symlinkedDirectories.set(directoryPath, { + real: ts.ensureTrailingDirectorySeparator(real), + realPath: realPath + }); + } + function fileOrDirectoryExistsUsingSource(fileOrDirectory, isFile) { + var fileOrDirectoryExistsUsingSource = isFile ? + function (file) { return fileExistsIfProjectReferenceDts(file); } : + function (dir) { return directoryExistsIfProjectReferenceDeclDir(dir); }; + // Check current directory or file + var result = fileOrDirectoryExistsUsingSource(fileOrDirectory); + if (result !== undefined) + return result; + if (!symlinkedDirectories) + return false; + var fileOrDirectoryPath = host.toPath(fileOrDirectory); + if (!ts.stringContains(fileOrDirectoryPath, ts.nodeModulesPathPart)) + return false; + if (isFile && symlinkedFiles && symlinkedFiles.has(fileOrDirectoryPath)) + return true; + // If it contains node_modules check if its one of the symlinked path we know of + return ts.firstDefinedIterator(symlinkedDirectories.entries(), function (_a) { + var directoryPath = _a[0], symlinkedDirectory = _a[1]; + if (!symlinkedDirectory || !ts.startsWith(fileOrDirectoryPath, directoryPath)) + return undefined; + var result = fileOrDirectoryExistsUsingSource(fileOrDirectoryPath.replace(directoryPath, symlinkedDirectory.realPath)); + if (isFile && result) { + if (!symlinkedFiles) + symlinkedFiles = ts.createMap(); + // Store the real path for the file' + var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory()); + symlinkedFiles.set(fileOrDirectoryPath, "" + symlinkedDirectory.real + absolutePath.replace(new RegExp(directoryPath, "i"), "")); + } + return result; + }) || false; + } + } /*@internal*/ function handleNoEmitOptions(program, sourceFile, cancellationToken) { var options = program.getCompilerOptions(); @@ -101320,6 +101889,7 @@ var ts; state.affectedFilesPendingEmit = oldState.affectedFilesPendingEmit.slice(); state.affectedFilesPendingEmitKind = ts.cloneMapOrUndefined(oldState.affectedFilesPendingEmitKind); state.affectedFilesPendingEmitIndex = oldState.affectedFilesPendingEmitIndex; + state.seenAffectedFiles = ts.createMap(); } } // Update changed files and copy semantic diagnostics if we can @@ -101365,8 +101935,8 @@ var ts; if (oldCompilerOptions && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) { // Add all files to affectedFilesPendingEmit since emit changed newProgram.getSourceFiles().forEach(function (f) { return addToAffectedFilesPendingEmit(state, f.resolvedPath, 1 /* Full */); }); - ts.Debug.assert(state.seenAffectedFiles === undefined); - state.seenAffectedFiles = ts.createMap(); + ts.Debug.assert(!state.seenAffectedFiles || !state.seenAffectedFiles.size); + state.seenAffectedFiles = state.seenAffectedFiles || ts.createMap(); } state.emittedBuildInfo = !state.changedFilesSet.size && !state.affectedFilesPendingEmit; return state; @@ -102246,13 +102816,13 @@ var ts; return true; } ts.canWatchDirectory = canWatchDirectory; - ts.maxNumberOfFilesToIterateForInvalidation = 256; function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) { var filesWithChangedSetOfUnresolvedImports; var filesWithInvalidatedResolutions; var filesWithInvalidatedNonRelativeUnresolvedImports; - var allFilesHaveInvalidatedResolution = false; var nonRelativeExternalModuleResolutions = ts.createMultiMap(); + var resolutionsWithFailedLookups = []; + var resolvedFileToResolution = ts.createMultiMap(); var getCurrentDirectory = ts.memoize(function () { return resolutionHost.getCurrentDirectory(); }); // TODO: GH#18217 var cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost(); // The resolvedModuleNames and resolvedTypeReferenceDirectives are the cache of resolutions per file. @@ -102316,7 +102886,8 @@ var ts; closeTypeRootsWatch(); resolvedModuleNames.clear(); resolvedTypeReferenceDirectives.clear(); - allFilesHaveInvalidatedResolution = false; + resolvedFileToResolution.clear(); + resolutionsWithFailedLookups.length = 0; // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update // (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution) clearPerDirectoryResolutions(); @@ -102338,7 +102909,7 @@ var ts; return !!value && !!value.length; } function createHasInvalidatedResolution(forceAllFilesAsInvalidated) { - if (allFilesHaveInvalidatedResolution || forceAllFilesAsInvalidated) { + if (forceAllFilesAsInvalidated) { // Any file asked would have invalidated resolution filesWithInvalidatedResolutions = undefined; return ts.returnTrue; @@ -102356,7 +102927,6 @@ var ts; nonRelativeExternalModuleResolutions.clear(); } function finishCachingPerDirectoryResolution() { - allFilesHaveInvalidatedResolution = false; filesWithInvalidatedNonRelativeUnresolvedImports = undefined; clearPerDirectoryResolutions(); directoryWatchesOfFailedLookups.forEach(function (watcher, path) { @@ -102367,6 +102937,7 @@ var ts; }); } function resolveModuleName(moduleName, containingFile, compilerOptions, host, redirectedReference) { + var _a; var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference); // return result immediately only if global cache support is not enabled or if it is .ts, .tsx or .d.ts if (!resolutionHost.getGlobalCache) { @@ -102377,15 +102948,20 @@ var ts; if (globalCache !== undefined && !ts.isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && ts.extensionIsTS(primaryResult.resolvedModule.extension))) { // create different collection of failed lookup locations for second pass // if it will fail and we've already found something during the first pass - we don't want to pollute its results - var _a = ts.loadModuleFromGlobalCache(ts.Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName), resolutionHost.projectName, compilerOptions, host, globalCache), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations; + var _b = ts.loadModuleFromGlobalCache(ts.Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName), resolutionHost.projectName, compilerOptions, host, globalCache), resolvedModule = _b.resolvedModule, failedLookupLocations = _b.failedLookupLocations; if (resolvedModule) { - return { resolvedModule: resolvedModule, failedLookupLocations: ts.addRange(primaryResult.failedLookupLocations, failedLookupLocations) }; + // Modify existing resolution so its saved in the directory cache as well + primaryResult.resolvedModule = resolvedModule; + (_a = primaryResult.failedLookupLocations).push.apply(_a, failedLookupLocations); + return primaryResult; } } // Default return the result from the first pass return primaryResult; } - function resolveNamesWithLocalCache(names, containingFile, redirectedReference, cache, perDirectoryCacheWithRedirects, loader, getResolutionWithResolvedFileName, shouldRetryResolution, reusedNames, logChanges) { + function resolveNamesWithLocalCache(_a) { + var names = _a.names, containingFile = _a.containingFile, redirectedReference = _a.redirectedReference, cache = _a.cache, perDirectoryCacheWithRedirects = _a.perDirectoryCacheWithRedirects, loader = _a.loader, getResolutionWithResolvedFileName = _a.getResolutionWithResolvedFileName, shouldRetryResolution = _a.shouldRetryResolution, reusedNames = _a.reusedNames, logChanges = _a.logChanges; + var _b; var path = resolutionHost.toPath(containingFile); var resolutionsInFile = cache.get(path) || cache.set(path, ts.createMap()).get(path); var dirPath = ts.getDirectoryPath(path); @@ -102410,7 +102986,7 @@ var ts; var resolution = resolutionsInFile.get(name); // Resolution is valid if it is present and not invalidated if (!seenNamesInFile.has(name) && - allFilesHaveInvalidatedResolution || unmatchedRedirects || !resolution || resolution.isInvalidated || + unmatchedRedirects || !resolution || resolution.isInvalidated || // If the name is unresolved import that was invalidated, recalculate (hasInvalidatedNonRelativeUnresolvedImport && !ts.isExternalModuleNameRelative(name) && shouldRetryResolution(resolution))) { var existingResolution = resolution; @@ -102419,13 +102995,13 @@ var ts; resolution = resolutionInDirectory; } else { - resolution = loader(name, containingFile, compilerOptions, resolutionHost, redirectedReference); + resolution = loader(name, containingFile, compilerOptions, ((_b = resolutionHost.getCompilerHost) === null || _b === void 0 ? void 0 : _b.call(resolutionHost)) || resolutionHost, redirectedReference); perDirectoryResolution.set(name, resolution); } resolutionsInFile.set(name, resolution); - watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution); + watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName); if (existingResolution) { - stopWatchFailedLookupLocationOfResolution(existingResolution); + stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName); } if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) { filesWithChangedSetOfUnresolvedImports.push(path); @@ -102440,7 +103016,7 @@ var ts; // Stop watching and remove the unused name resolutionsInFile.forEach(function (resolution, name) { if (!seenNamesInFile.has(name) && !ts.contains(reusedNames, name)) { - stopWatchFailedLookupLocationOfResolution(resolution); + stopWatchFailedLookupLocationOfResolution(resolution, path, getResolutionWithResolvedFileName); resolutionsInFile.delete(name); } }); @@ -102464,21 +103040,35 @@ var ts; } } function resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference) { - return resolveNamesWithLocalCache(typeDirectiveNames, containingFile, redirectedReference, resolvedTypeReferenceDirectives, perDirectoryResolvedTypeReferenceDirectives, ts.resolveTypeReferenceDirective, getResolvedTypeReferenceDirective, - /*shouldRetryResolution*/ function (resolution) { return resolution.resolvedTypeReferenceDirective === undefined; }, - /*reusedNames*/ undefined, /*logChanges*/ false); + return resolveNamesWithLocalCache({ + names: typeDirectiveNames, + containingFile: containingFile, + redirectedReference: redirectedReference, + cache: resolvedTypeReferenceDirectives, + perDirectoryCacheWithRedirects: perDirectoryResolvedTypeReferenceDirectives, + loader: ts.resolveTypeReferenceDirective, + getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective, + shouldRetryResolution: function (resolution) { return resolution.resolvedTypeReferenceDirective === undefined; }, + }); } function resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference) { - return resolveNamesWithLocalCache(moduleNames, containingFile, redirectedReference, resolvedModuleNames, perDirectoryResolvedModuleNames, resolveModuleName, getResolvedModule, - /*shouldRetryResolution*/ function (resolution) { return !resolution.resolvedModule || !ts.resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension); }, reusedNames, logChangesWhenResolvingModule); + return resolveNamesWithLocalCache({ + names: moduleNames, + containingFile: containingFile, + redirectedReference: redirectedReference, + cache: resolvedModuleNames, + perDirectoryCacheWithRedirects: perDirectoryResolvedModuleNames, + loader: resolveModuleName, + getResolutionWithResolvedFileName: getResolvedModule, + shouldRetryResolution: function (resolution) { return !resolution.resolvedModule || !ts.resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension); }, + reusedNames: reusedNames, + logChanges: logChangesWhenResolvingModule + }); } function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName, containingFile) { var cache = resolvedModuleNames.get(resolutionHost.toPath(containingFile)); return cache && cache.get(moduleName); } - function isNodeModulesDirectory(dirPath) { - return ts.endsWith(dirPath, "/node_modules"); - } function isNodeModulesAtTypesDirectory(dirPath) { return ts.endsWith(dirPath, "/node_modules/@types"); } @@ -102514,7 +103104,7 @@ var ts; dirPath = ts.getDirectoryPath(dirPath); } // If the directory is node_modules use it to watch, always watch it recursively - if (isNodeModulesDirectory(dirPath)) { + if (ts.isNodeModulesDirectory(dirPath)) { return canWatchDirectory(ts.getDirectoryPath(dirPath)) ? { dir: dir, dirPath: dirPath } : undefined; } var nonRecursive = true; @@ -102538,26 +103128,33 @@ var ts; function isPathWithDefaultFailedLookupExtension(path) { return ts.fileExtensionIsOneOf(path, failedLookupDefaultExtensions); } - function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution) { - // No need to set the resolution refCount - if (resolution.failedLookupLocations && resolution.failedLookupLocations.length) { - if (resolution.refCount) { - resolution.refCount++; + function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName) { + if (resolution.refCount) { + resolution.refCount++; + ts.Debug.assertDefined(resolution.files); + } + else { + resolution.refCount = 1; + ts.Debug.assert(resolution.files === undefined); + if (ts.isExternalModuleNameRelative(name)) { + watchFailedLookupLocationOfResolution(resolution); } else { - resolution.refCount = 1; - if (ts.isExternalModuleNameRelative(name)) { - watchFailedLookupLocationOfResolution(resolution); - } - else { - nonRelativeExternalModuleResolutions.add(name, resolution); - } + nonRelativeExternalModuleResolutions.add(name, resolution); + } + var resolved = getResolutionWithResolvedFileName(resolution); + if (resolved && resolved.resolvedFileName) { + resolvedFileToResolution.add(resolutionHost.toPath(resolved.resolvedFileName), resolution); } } + (resolution.files || (resolution.files = [])).push(filePath); } function watchFailedLookupLocationOfResolution(resolution) { ts.Debug.assert(!!resolution.refCount); var failedLookupLocations = resolution.failedLookupLocations; + if (!failedLookupLocations.length) + return; + resolutionsWithFailedLookups.push(resolution); var setAtRoot = false; for (var _i = 0, failedLookupLocations_1 = failedLookupLocations; _i < failedLookupLocations_1.length; _i++) { var failedLookupLocation = failedLookupLocations_1[_i]; @@ -102585,14 +103182,11 @@ var ts; setDirectoryWatcher(rootDir, rootPath, /*nonRecursive*/ true); // TODO: GH#18217 } } - function setRefCountToUndefined(resolution) { - resolution.refCount = undefined; - } function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name) { var program = resolutionHost.getCurrentProgram(); - var updateResolution = program && program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name) ? - setRefCountToUndefined : watchFailedLookupLocationOfResolution; - resolutions.forEach(updateResolution); + if (!program || !program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name)) { + resolutions.forEach(watchFailedLookupLocationOfResolution); + } } function setDirectoryWatcher(dir, dirPath, nonRecursive) { var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); @@ -102604,14 +103198,20 @@ var ts; directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath, nonRecursive), refCount: 1, nonRecursive: nonRecursive }); } } - function stopWatchFailedLookupLocationOfResolution(resolution) { - if (!resolution.refCount) { - return; - } + function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName) { + ts.unorderedRemoveItem(ts.Debug.assertDefined(resolution.files), filePath); resolution.refCount--; if (resolution.refCount) { return; } + var resolved = getResolutionWithResolvedFileName(resolution); + if (resolved && resolved.resolvedFileName) { + resolvedFileToResolution.remove(resolutionHost.toPath(resolved.resolvedFileName), resolution); + } + if (!ts.unorderedRemoveItem(resolutionsWithFailedLookups, resolution)) { + // If not watching failed lookups, it wont be there in resolutionsWithFailedLookups + return; + } var failedLookupLocations = resolution.failedLookupLocations; var removeAtRoot = false; for (var _i = 0, failedLookupLocations_2 = failedLookupLocations; _i < failedLookupLocations_2.length; _i++) { @@ -102654,16 +103254,16 @@ var ts; // Since the file existence changed, update the sourceFiles cache cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); } - if (!allFilesHaveInvalidatedResolution && invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath)) { + if (invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath)) { resolutionHost.onInvalidatedResolution(); } }, nonRecursive ? 0 /* None */ : 1 /* Recursive */); } - function removeResolutionsOfFileFromCache(cache, filePath) { + function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName) { // Deleted file, stop watching failed lookups for all the resolutions in the file var resolutions = cache.get(filePath); if (resolutions) { - resolutions.forEach(stopWatchFailedLookupLocationOfResolution); + resolutions.forEach(function (resolution) { return stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName); }); cache.delete(filePath); } } @@ -102684,57 +103284,26 @@ var ts; resolvedProjectReference.commandLine.fileNames.forEach(function (f) { return removeResolutionsOfFile(resolutionHost.toPath(f)); }); } function removeResolutionsOfFile(filePath) { - removeResolutionsOfFileFromCache(resolvedModuleNames, filePath); - removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath); - } - function invalidateResolutionCache(cache, isInvalidatedResolution, getResolutionWithResolvedFileName) { - var seen = ts.createMap(); - cache.forEach(function (resolutions, containingFilePath) { - var dirPath = ts.getDirectoryPath(containingFilePath); - var seenInDir = seen.get(dirPath); - if (!seenInDir) { - seenInDir = ts.createMap(); - seen.set(dirPath, seenInDir); - } - resolutions.forEach(function (resolution, name) { - if (seenInDir.has(name)) { - return; - } - seenInDir.set(name, true); - if (!resolution.isInvalidated && isInvalidatedResolution(resolution, getResolutionWithResolvedFileName)) { - // Mark the file as needing re-evaluation of module resolution instead of using it blindly. - resolution.isInvalidated = true; - (filesWithInvalidatedResolutions || (filesWithInvalidatedResolutions = ts.createMap())).set(containingFilePath, true); - // When its a file with inferred types resolution, invalidate type reference directive resolution - if (ts.endsWith(containingFilePath, ts.inferredTypesContainingFile)) { - resolutionHost.onChangedAutomaticTypeDirectiveNames(); - } - } - }); - }); - } - function hasReachedResolutionIterationLimit() { - var maxSize = resolutionHost.maxNumberOfFilesToIterateForInvalidation || ts.maxNumberOfFilesToIterateForInvalidation; - return resolvedModuleNames.size > maxSize || resolvedTypeReferenceDirectives.size > maxSize; - } - function invalidateResolutions(isInvalidatedResolution) { - // If more than maxNumberOfFilesToIterateForInvalidation present, - // just invalidated all files and recalculate the resolutions for files instead - if (hasReachedResolutionIterationLimit()) { - allFilesHaveInvalidatedResolution = true; - return; + removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule); + removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective); + } + function invalidateResolution(resolution) { + resolution.isInvalidated = true; + var changedInAutoTypeReferenced = false; + for (var _i = 0, _a = ts.Debug.assertDefined(resolution.files); _i < _a.length; _i++) { + var containingFilePath = _a[_i]; + (filesWithInvalidatedResolutions || (filesWithInvalidatedResolutions = ts.createMap())).set(containingFilePath, true); + // When its a file with inferred types resolution, invalidate type reference directive resolution + changedInAutoTypeReferenced = changedInAutoTypeReferenced || containingFilePath.endsWith(ts.inferredTypesContainingFile); + } + if (changedInAutoTypeReferenced) { + resolutionHost.onChangedAutomaticTypeDirectiveNames(); } - invalidateResolutionCache(resolvedModuleNames, isInvalidatedResolution, getResolvedModule); - invalidateResolutionCache(resolvedTypeReferenceDirectives, isInvalidatedResolution, getResolvedTypeReferenceDirective); } function invalidateResolutionOfFile(filePath) { removeResolutionsOfFile(filePath); - invalidateResolutions( // Resolution is invalidated if the resulting file name is same as the deleted file path - function (resolution, getResolutionWithResolvedFileName) { - var result = getResolutionWithResolvedFileName(resolution); - return !!result && resolutionHost.toPath(result.resolvedFileName) === filePath; // TODO: GH#18217 - }); + ts.forEach(resolvedFileToResolution.get(filePath), invalidateResolution); } function setFilesWithInvalidatedNonRelativeUnresolvedImports(filesMap) { ts.Debug.assert(filesWithInvalidatedNonRelativeUnresolvedImports === filesMap || filesWithInvalidatedNonRelativeUnresolvedImports === undefined); @@ -102760,8 +103329,8 @@ var ts; // Some file or directory in the watching directory is created // Return early if it does not have any of the watching extension or not the custom failed lookup path var dirOfFileOrDirectory = ts.getDirectoryPath(fileOrDirectoryPath); - if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || isNodeModulesDirectory(fileOrDirectoryPath) || - isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || isNodeModulesDirectory(dirOfFileOrDirectory)) { + if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || ts.isNodeModulesDirectory(fileOrDirectoryPath) || + isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || ts.isNodeModulesDirectory(dirOfFileOrDirectory)) { // Invalidate any resolution from this directory isChangedFailedLookupLocation = function (location) { var locationPath = resolutionHost.toPath(location); @@ -102780,20 +103349,21 @@ var ts; isChangedFailedLookupLocation = function (location) { return resolutionHost.toPath(location) === fileOrDirectoryPath; }; } } - var hasChangedFailedLookupLocation = function (resolution) { return ts.some(resolution.failedLookupLocations, isChangedFailedLookupLocation); }; - var invalidatedFilesCount = filesWithInvalidatedResolutions && filesWithInvalidatedResolutions.size; - invalidateResolutions( + var invalidated = false; // Resolution is invalidated if the resulting file name is same as the deleted file path - hasChangedFailedLookupLocation); - return allFilesHaveInvalidatedResolution || filesWithInvalidatedResolutions && filesWithInvalidatedResolutions.size !== invalidatedFilesCount; + for (var _i = 0, resolutionsWithFailedLookups_1 = resolutionsWithFailedLookups; _i < resolutionsWithFailedLookups_1.length; _i++) { + var resolution = resolutionsWithFailedLookups_1[_i]; + if (resolution.failedLookupLocations.some(isChangedFailedLookupLocation)) { + invalidateResolution(resolution); + invalidated = true; + } + } + return invalidated; } function closeTypeRootsWatch() { ts.clearMap(typeRootsWatches, ts.closeFileWatcher); } function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath) { - if (allFilesHaveInvalidatedResolution) { - return undefined; - } if (isInDirectoryPath(rootPath, typeRootPath)) { return rootPath; } @@ -102992,38 +103562,52 @@ var ts; function comparePathsByNumberOfDirectorySeparators(a, b) { return ts.compareValues(numberOfDirectorySeparators(a), numberOfDirectorySeparators(b)); } - /** - * Looks for existing imports that use symlinks to this module. - * Symlinks will be returned first so they are preferred over the real path. - */ - function getAllModulePaths(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap) { + function forEachFileNameOfModule(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap, preferSymlinks, cb) { var redirects = redirectTargetsMap.get(importedFileName); var importedFileNames = redirects ? __spreadArrays(redirects, [importedFileName]) : [importedFileName]; var cwd = host.getCurrentDirectory ? host.getCurrentDirectory() : ""; var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); }); + if (!preferSymlinks) { + var result_10 = ts.forEach(targets, cb); + if (result_10) + return result_10; + } var links = host.getProbableSymlinks ? host.getProbableSymlinks(files) : ts.discoverProbableSymlinks(files, getCanonicalFileName, cwd); - var result = []; var compareStrings = (!host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames()) ? ts.compareStringsCaseSensitive : ts.compareStringsCaseInsensitive; - links.forEach(function (resolved, path) { + var result = ts.forEachEntry(links, function (resolved, path) { if (ts.startsWithDirectory(importingFileName, resolved, getCanonicalFileName)) { - return; // Don't want to a package to globally import from itself + return undefined; // Don't want to a package to globally import from itself } var target = ts.find(targets, function (t) { return compareStrings(t.slice(0, resolved.length + 1), resolved + "/") === 0 /* EqualTo */; }); if (target === undefined) - return; + return undefined; var relative = ts.getRelativePathFromDirectory(resolved, target, getCanonicalFileName); var option = ts.resolvePath(path, relative); if (!host.fileExists || host.fileExists(option)) { - result.push(option); + var result_11 = cb(option); + if (result_11) + return result_11; } }); - result.push.apply(result, targets); - if (result.length < 2) - return result; + return result || + (preferSymlinks ? ts.forEach(targets, cb) : undefined); + } + moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule; + /** + * Looks for existing imports that use symlinks to this module. + * Symlinks will be returned first so they are preferred over the real path. + */ + function getAllModulePaths(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap) { + var cwd = host.getCurrentDirectory ? host.getCurrentDirectory() : ""; + var allFileNames = ts.createMap(); + forEachFileNameOfModule(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap, + /*preferSymlinks*/ true, function (path) { + // dont return value, so we collect everything + allFileNames.set(path, getCanonicalFileName(path)); + }); // Sort by paths closest to importing file Name directory - var allFileNames = ts.arrayToMap(result, ts.identity, getCanonicalFileName); var sortedPaths = []; var _loop_18 = function (directory) { var directoryStart = ts.ensureTrailingDirectorySeparator(directory); @@ -103558,10 +104142,6 @@ var ts; */ function createProgramHost(system, createProgram) { var getDefaultLibLocation = ts.memoize(function () { return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath())); }); - var host = system; - // TODO: `host` is unused! - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - host; return { useCaseSensitiveFileNames: function () { return system.useCaseSensitiveFileNames; }, getNewLine: function () { return system.newLine; }, @@ -103578,7 +104158,6 @@ var ts; trace: function (s) { return system.write(s + system.newLine); }, createDirectory: function (path) { return system.createDirectory(path); }, writeFile: function (path, data, writeByteOrderMark) { return system.writeFile(path, data, writeByteOrderMark); }, - onCachedDirectoryStructureHostCreate: function (cacheHost) { return host = cacheHost || system; }, createHash: ts.maybeBind(system, system.createHash), createProgram: createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram }; @@ -103706,9 +104285,6 @@ var ts; var canConfigFileJsonReportNoInputFiles = false; var hasChangedConfigFileParsingErrors = false; var cachedDirectoryStructureHost = configFileName === undefined ? undefined : ts.createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames); - if (cachedDirectoryStructureHost && host.onCachedDirectoryStructureHostCreate) { - host.onCachedDirectoryStructureHostCreate(cachedDirectoryStructureHost); - } var directoryStructureHost = cachedDirectoryStructureHost || host; var parseConfigFileHost = ts.parseConfigHostFromCompilerHostLike(host, directoryStructureHost); // From tsc we want to get already parsed result and hence check for rootFileNames @@ -103749,6 +104325,7 @@ var ts; // Members for ResolutionCacheHost compilerHost.toPath = toPath; compilerHost.getCompilationSettings = function () { return compilerOptions; }; + compilerHost.useSourceOfProjectReferenceRedirect = ts.maybeBind(host, host.useSourceOfProjectReferenceRedirect); compilerHost.watchDirectoryOfFailedLookupLocation = function (dir, cb, flags) { return watchDirectory(host, dir, cb, flags, watchOptions, ts.WatchType.FailedLookupLocations); }; compilerHost.watchTypeRootsDirectory = function (dir, cb, flags) { return watchDirectory(host, dir, cb, flags, watchOptions, ts.WatchType.TypeRoots); }; compilerHost.getCachedDirectoryStructureHost = function () { return cachedDirectoryStructureHost; }; @@ -103758,7 +104335,6 @@ var ts; scheduleProgramUpdate(); }; compilerHost.fileIsOpen = ts.returnFalse; - compilerHost.maxNumberOfFilesToIterateForInvalidation = host.maxNumberOfFilesToIterateForInvalidation; compilerHost.getCurrentProgram = getCurrentProgram; compilerHost.writeLog = writeLog; // Cache for the module resolution @@ -103791,8 +104367,8 @@ var ts; // Update the wild card directory watch watchConfigFileWildCardDirectories(); return configFileName ? - { getCurrentProgram: getCurrentBuilderProgram, getProgram: synchronizeProgram, close: close } : - { getCurrentProgram: getCurrentBuilderProgram, getProgram: synchronizeProgram, updateRootFileNames: updateRootFileNames, close: close }; + { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close: close } : + { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames: updateRootFileNames, close: close }; function close() { resolutionCache.clear(); ts.clearMap(sourceFilesCache, function (value) { @@ -103840,7 +104416,7 @@ var ts; else { createNewProgram(hasInvalidatedResolution); } - if (host.afterProgramCreate) { + if (host.afterProgramCreate && program !== builderProgram) { host.afterProgramCreate(builderProgram); } return builderProgram; @@ -103856,6 +104432,7 @@ var ts; resolutionCache.startCachingPerDirectoryResolution(); compilerHost.hasInvalidatedResolution = hasInvalidatedResolution; compilerHost.hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames; + hasChangedAutomaticTypeDirectiveNames = false; builderProgram = createProgram(rootFileNames, compilerOptions, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences); resolutionCache.finishCachingPerDirectoryResolution(); // Update watches @@ -103900,7 +104477,7 @@ var ts; // If file is missing on host from cache, we can definitely say file doesnt exist // otherwise we need to ensure from the disk if (isFileMissingOnHost(sourceFilesCache.get(path))) { - return true; + return false; } return directoryStructureHost.fileExists(fileName); } @@ -103997,16 +104574,19 @@ var ts; host.clearTimeout(timerToUpdateProgram); } writeLog("Scheduling update"); - timerToUpdateProgram = host.setTimeout(updateProgram, 250); + timerToUpdateProgram = host.setTimeout(updateProgramWithWatchStatus, 250); } function scheduleProgramReload() { ts.Debug.assert(!!configFileName); reloadLevel = ts.ConfigFileProgramReloadLevel.Full; scheduleProgramUpdate(); } - function updateProgram() { + function updateProgramWithWatchStatus() { timerToUpdateProgram = undefined; reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation); + updateProgram(); + } + function updateProgram() { switch (reloadLevel) { case ts.ConfigFileProgramReloadLevel.Partial: ts.perfLogger.logStartUpdateProgram("PartialConfigReload"); @@ -104022,6 +104602,7 @@ var ts; break; } ts.perfLogger.logStopUpdateProgram("Done"); + return getCurrentBuilderProgram(); } function reloadFileNamesFromConfigFile() { writeLog("Reloading new file names and options"); diff --git a/lib/zh-cn/diagnosticMessages.generated.json b/lib/zh-cn/diagnosticMessages.generated.json index 9cdfcd08e2a7a..fa5cf5b7f3603 100644 --- a/lib/zh-cn/diagnosticMessages.generated.json +++ b/lib/zh-cn/diagnosticMessages.generated.json @@ -758,7 +758,7 @@ "Only_amd_and_system_modules_are_supported_alongside_0_6082": "--{0} 旁仅支持 \"amd\" 和 \"system\" 模块。", "Only_emit_d_ts_declaration_files_6014": "仅发出 \".d.ts\" 声明文件。 ", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "类 \"extends\" 子句当前仅支持具有可选类型参数的标识符/限定名称。", - "Only_named_exports_may_use_export_type_1383": "Only named exports may use 'export type'.", + "Only_named_exports_may_use_export_type_1383": "只有已命名的导出可使用“导出类型”。", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "通过 \"super\" 关键字只能访问基类的公共方法和受保护方法。", "Operator_0_cannot_be_applied_to_type_1_2736": "运算符 \"{0}\" 不能应用于类型 \"{1}\"。", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "运算符“{0}”不能应用于类型“{1}”和“{2}”。", @@ -1182,7 +1182,7 @@ "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320": "\"await\" 操作数的类型必须是有效承诺,或不得包含可调用的 \"then\" 成员。", "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418": "计算属性类型的值为 \"{0}\",该值不能赋给 \"{1}\" 类型。", "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "\"yield*\" 操作数的迭代元素的类型必须是有效承诺,或不得包含可调用的 \"then\" 成员。", - "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": "Type of property '{0}' circularly references itself in mapped type '{1}'.", + "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": "属性“{0}”的类型在已映射的类型“{1}”中循环引用其自身。", "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "异步生成器中 \"yield\" 操作数的类型必须是有效承诺,或不得包含可调用的 \"then\" 成员。", "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038": "此导入产生的类型。无法调用或构造命名空间样式的导入,这类导入将在运行时导致失败。请考虑改为使用默认导入或这里需要的导入。", "Type_parameter_0_has_a_circular_constraint_2313": "类型参数“{0}”具有循环约束。", @@ -1240,6 +1240,7 @@ "Unterminated_template_literal_1160": "未终止的模板文本。", "Untyped_function_calls_may_not_accept_type_arguments_2347": "非类型化函数调用不能接受类型参数。", "Unused_label_7028": "未使用的标签。", + "Unused_ts_expect_error_directive_2578": "未使用的 \"@ts-expect-error\" 指令。", "Updating_output_of_project_0_6373": "正在更新项目 \"{0}\" 的输出…", "Updating_output_timestamps_of_project_0_6359": "正在更新项目“{0}”的输出时间戳...", "Updating_unchanged_output_timestamps_of_project_0_6371": "正在更新项目 \"{0}\" 未更改的输出时间戳…", @@ -1343,6 +1344,7 @@ "file_6025": "文件", "get_and_set_accessor_must_have_the_same_this_type_2682": "\"get\" 和 \"set\" 访问器必须拥有相同的 \"this\" 类型。", "get_and_set_accessor_must_have_the_same_type_2380": "\"get\" 和 \"set\" 访问器必须属于同一类型。", + "get_and_set_accessors_cannot_declare_this_parameters_2784": "\"get\" 和 \"set\" 访问器无法声明 \"this\" 参数。", "implements_clause_already_seen_1175": "已看到 \"implements\" 子句。", "implements_clauses_can_only_be_used_in_TypeScript_files_8005": "\"implements\" 子句只能在 TypeScript 文件中使用。", "import_can_only_be_used_in_TypeScript_files_8002": "\"import ... =\" 只能在 TypeScript 文件中使用。", diff --git a/lib/zh-tw/diagnosticMessages.generated.json b/lib/zh-tw/diagnosticMessages.generated.json index c04972e3a7bb9..171c3bda790dd 100644 --- a/lib/zh-tw/diagnosticMessages.generated.json +++ b/lib/zh-tw/diagnosticMessages.generated.json @@ -758,10 +758,12 @@ "Only_amd_and_system_modules_are_supported_alongside_0_6082": "只有 'amd' 與 'system' 模組連同受支援 --{0}。", "Only_emit_d_ts_declaration_files_6014": "只發出 '.d.ts' 宣告檔案。", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "類別 'extends' 子句中,目前只支援具有選擇性型別引數的識別碼/限定名稱。", + "Only_named_exports_may_use_export_type_1383": "只有具名的匯出可以使用「匯出類型」。", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "只有基底類別之公開且受保護的方法,才可透過 'super' 關鍵字存取。", "Operator_0_cannot_be_applied_to_type_1_2736": "無法將運算子 '{0}' 套用至類型 '{1}'。", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "無法將運算子 '{0}' 套用至類型 '{1}' 和 '{2}'。", - "Option_0_can_only_be_specified_in_tsconfig_json_file_6064": "只能在 'tsconfig.json' 檔案中指定選項 '{0}'。", + "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "只能在 'tsconfig.json' 檔案中指定 '{0}' 選項,或在命令列上將其設定為 'false' 或 'null'。", + "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "只能在 'tsconfig.json' 檔案中指定 '{0}' 選項,或在命令列上將其設定為 'null'。", "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "只有在已提供選項 '--inlineSourceMap' 或選項 '--sourceMap' 時,才可使用選項 '{0}'。", "Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "當選項 'target' 為 'ES3' 時,無法指定選項 '{0}'。", "Option_0_cannot_be_specified_with_option_1_5053": "不得同時指定選項 '{0}' 與選項 '{1}'。", @@ -1035,7 +1037,7 @@ "Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object_2470": "'Symbol' 參考不是參考全域 Symbol 建構函式物件。", "Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6228": "呼叫回呼,並更新不支援原生遞迴監看之平台上的目錄監控程式狀態。", "Syntax_Colon_0_6023": "語法: {0}", - "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'.", + "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": "標籤 '{0}' 至少需要 '{1}' 個引數,但 JSX factory '{2}' 最多只提供 '{3}' 個。", "Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358": "選擇性鏈結中不允許已標記的範本運算式。", "The_0_modifier_can_only_be_used_in_TypeScript_files_8009": "'{0}' 修飾元只可用於 TypeScript 檔案中。", "The_0_operator_cannot_be_applied_to_type_symbol_2469": "無法將 '{0}' 運算子套用至類型 'symbol'。", @@ -1180,6 +1182,7 @@ "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320": "'await' 運算元類型必須是有效的 Promise,或不得包含可呼叫的 'then' 成員。", "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418": "已計算屬性值的類型為 '{0}',其無法指派給類型 '{1}'。", "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "'yield*' 運算元的反覆項目類型必須是有效的 Promise,或不得包含可呼叫的 'then' 成員。", + "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": "屬性 '{0}' 的類型在對應的類型 '{1}' 中會循環參考自己。", "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "非同步產生器中的 'yield' 運算元類型必須是有效的 Promise,或不得包含可呼叫的 'then' 成員。", "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038": "類型源自此匯入。無法呼叫或建構命名空間樣式的匯入,而且可能會在執行階段導致失敗。請考慮改用預設匯入或此處要求的匯入。", "Type_parameter_0_has_a_circular_constraint_2313": "類型參數 '{0}' 具有循環條件約束。", @@ -1237,6 +1240,7 @@ "Unterminated_template_literal_1160": "未結束的樣板常值。", "Untyped_function_calls_may_not_accept_type_arguments_2347": "不具類型的函式呼叫無法接受類型引數。", "Unused_label_7028": "未使用的標籤。", + "Unused_ts_expect_error_directive_2578": "未使用的 '@ts-expect-error' 指示詞。", "Updating_output_of_project_0_6373": "正在更新專案 '{0}' 的輸出...", "Updating_output_timestamps_of_project_0_6359": "正在更新專案 '{0}' 的輸出時間戳記...", "Updating_unchanged_output_timestamps_of_project_0_6371": "正在更新專案 '{0}' 的未更變輸出時間戳記...", @@ -1340,6 +1344,7 @@ "file_6025": "檔案", "get_and_set_accessor_must_have_the_same_this_type_2682": "'get' 和 'set' 存取子必須有相同的 'this' 類型。", "get_and_set_accessor_must_have_the_same_type_2380": "get' 和 'set' 存取子的類型必須相同。", + "get_and_set_accessors_cannot_declare_this_parameters_2784": "'get' 和 'set' 存取子不可宣告 'this' 參數。", "implements_clause_already_seen_1175": "已經有 'implements' 子句。", "implements_clauses_can_only_be_used_in_TypeScript_files_8005": "'implements' 子句只可用於 TypeScript 檔案中。", "import_can_only_be_used_in_TypeScript_files_8002": "'import ... =' 只可用於 TypeScript 檔案中。", diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 773be68dada4f..2f7325a6867c0 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -686,6 +686,7 @@ namespace ts { const literalTypes = createMap(); const indexedAccessTypes = createMap(); const substitutionTypes = createMap(); + const awaitedTypes = createMap(); const evolvingArrayTypes: EvolvingArrayType[] = []; const undefinedProperties = createMap() as UnderscoreEscapedMap; @@ -4267,6 +4268,11 @@ namespace ts { context.approximateLength += 2; return createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); } + if (type.flags & TypeFlags.Awaited) { + const awaitedTypeNode = typeToTypeNodeHelper((type).awaitedType, context); + context.approximateLength += 9; + return createTypeOperatorNode(SyntaxKind.AwaitedKeyword, awaitedTypeNode); + } if (type.flags & TypeFlags.Conditional) { const checkTypeNode = typeToTypeNodeHelper((type).checkType, context); const saveInferTypeParameters = context.inferTypeParameters; @@ -10115,6 +10121,10 @@ namespace ts { constraintDepth--; return result; } + if (t.flags & TypeFlags.Awaited) { + const basePromiseType = getBaseConstraint((t).awaitedType); + return basePromiseType ? getAwaitedType(basePromiseType) : undefined; + } if (t.flags & TypeFlags.Substitution) { return getBaseConstraint((t).substitute); } @@ -12445,6 +12455,9 @@ namespace ts { case SyntaxKind.ReadonlyKeyword: links.resolvedType = getTypeFromTypeNode(node.type); break; + case SyntaxKind.AwaitedKeyword: + links.resolvedType = getAwaitedType(getTypeFromTypeNode(node.type)) ?? unknownType; + break; default: throw Debug.assertNever(node.operator); } @@ -14004,6 +14017,9 @@ namespace ts { if (flags & TypeFlags.Conditional) { return getConditionalTypeInstantiation(type, combineTypeMappers((type).mapper, mapper)); } + if (flags & TypeFlags.Awaited) { + return getAwaitedType(instantiateType((type).awaitedType, mapper)) ?? unknownType; + } if (flags & TypeFlags.Substitution) { const maybeVariable = instantiateType((type).baseType, mapper); if (maybeVariable.flags & TypeFlags.TypeVariable) { @@ -15811,7 +15827,8 @@ namespace ts { if (outofbandVarianceMarkerHandler) { originalHandler = outofbandVarianceMarkerHandler; outofbandVarianceMarkerHandler = onlyUnreliable => { - propagatingVarianceFlags |= onlyUnreliable ? RelationComparisonResult.ReportsUnreliable : RelationComparisonResult.ReportsUnmeasurable; + propagatingVarianceFlags |= + onlyUnreliable ? RelationComparisonResult.ReportsUnreliable : RelationComparisonResult.ReportsUnmeasurable; return originalHandler!(onlyUnreliable); }; } @@ -15942,6 +15959,17 @@ namespace ts { } } } + else if (target.flags & TypeFlags.Awaited && source.flags & TypeFlags.Awaited) { + const targetType = (target).awaitedType; + const sourceType = instantiateType((source).awaitedType, makeFunctionTypeMapper(reportUnreliableMarkers)); + // An `awaited S` is related to an `awaited T` if `S` is related to `T`: + // + // S <: T ⇒ awaited S <: awaited T + // + if (result = isRelatedTo(sourceType, targetType, reportErrors)) { + return result; + } + } else if (isGenericMappedType(target)) { // A source type T is related to a target type { [P in X]: T[P] } const template = getTemplateTypeFromMappedType(target); @@ -16056,6 +16084,21 @@ namespace ts { } } } + else if (source.flags & TypeFlags.Awaited) { + // An `awaited S` is related to `T` if `awaited C` is related to `T`, where `C` is the + // constraint of `S`: + // + // S <: C ^ awaited C <: T ⇒ awaited S <: T + // + // For example `awaited Promise` is assignable to `number`. + const constraint = getConstraintOfType((source).awaitedType); + const awaitedConstraint = constraint && getAwaitedType(constraint); + if (awaitedConstraint) { + if (result = isRelatedTo(awaitedConstraint, target, reportErrors)) { + return result; + } + } + } else { // An empty object type is related to any mapped type that includes a '?' modifier. if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target) && isEmptyObjectType(source)) { @@ -16936,13 +16979,11 @@ namespace ts { variance = VarianceFlags.Independent; } outofbandVarianceMarkerHandler = oldHandler; - if (unmeasurable || unreliable) { - if (unmeasurable) { - variance |= VarianceFlags.Unmeasurable; - } - if (unreliable) { - variance |= VarianceFlags.Unreliable; - } + if (unmeasurable) { + variance |= VarianceFlags.Unmeasurable; + } + if (unreliable) { + variance |= VarianceFlags.Unreliable; } variances.push(variance); } @@ -18297,6 +18338,9 @@ namespace ts { inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } + else if (source.flags & TypeFlags.Awaited && target.flags & TypeFlags.Awaited) { + inferFromTypes((source).awaitedType, (target).awaitedType); + } else if (target.flags & TypeFlags.Conditional) { const savePriority = priority; priority |= contravariant ? InferencePriority.ContravariantConditional : 0; @@ -18304,6 +18348,10 @@ namespace ts { inferToMultipleTypes(source, targetTypes, target.flags); priority = savePriority; } + else if (target.flags & TypeFlags.Awaited) { + inferFromTypes(source, (target).awaitedType); + inferFromTypes(source, createPromiseLikeType((target).awaitedType)); + } else if (target.flags & TypeFlags.UnionOrIntersection) { inferToMultipleTypes(source, (target).types, target.flags); } @@ -18432,10 +18480,32 @@ namespace ts { return typeVariable; } + function isPromiseForType(promiseType: Type, promisedType: Type) { + return isThenableType(promiseType) && unwrapAwaitedType(getPromisedTypeOfPromise(promiseType) ?? errorType) === promisedType; + } + function inferToMultipleTypes(source: Type, targets: Type[], targetFlags: TypeFlags) { let typeVariableCount = 0; if (targetFlags & TypeFlags.Union) { let nakedTypeVariable: Type | undefined; + for (const t of targets) { + if (getInferenceInfoForType(t)) { + nakedTypeVariable = t; + typeVariableCount++; + } + } + // To better support backwards compatibility with the new `awaited` type, we detect a target + // union of exactly `T | PromiseLike` (for any compatible `PromiseLike`). When encountered, + // we infer from source to the type parameter `T`, where each type of source is mapped to extract + // the promised type of any promise (e.g., `string | Promise` becomes `string | number`). + if (typeVariableCount === 1 && targets.length === 2) { + for (const t of targets) { + if (!getInferenceInfoForType(t) && isPromiseForType(t, nakedTypeVariable!)) { + inferFromTypes(mapType(source, s => getPromisedTypeOfPromise(s) ?? s), nakedTypeVariable!); + return; + } + } + } const sources = source.flags & TypeFlags.Union ? (source).types : [source]; const matched = new Array(sources.length); let inferenceCircularity = false; @@ -18444,11 +18514,7 @@ namespace ts { // equal priority (i.e. of equal quality) to what we would infer for a naked type // parameter. for (const t of targets) { - if (getInferenceInfoForType(t)) { - nakedTypeVariable = t; - typeVariableCount++; - } - else { + if (!getInferenceInfoForType(t)) { for (let i = 0; i < sources.length; i++) { const saveInferencePriority = inferencePriority; inferencePriority = InferencePriority.MaxValue; @@ -21739,7 +21805,10 @@ namespace ts { const contextualReturnType = getContextualReturnType(func); if (contextualReturnType) { if (functionFlags & FunctionFlags.Async) { // Async function - const contextualAwaitedType = getAwaitedTypeOfPromise(contextualReturnType); + let contextualAwaitedType = getAwaitedTypeOfPromise(contextualReturnType); + if (contextualAwaitedType && contextualAwaitedType.flags & TypeFlags.Awaited) { + contextualAwaitedType = (contextualAwaitedType).awaitedType; + } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return contextualReturnType; // Regular function @@ -21751,7 +21820,10 @@ namespace ts { function getContextualTypeForAwaitOperand(node: AwaitExpression): Type | undefined { const contextualType = getContextualType(node); if (contextualType) { - const contextualAwaitedType = getAwaitedType(contextualType); + let contextualAwaitedType = getAwaitedType(contextualType); + if (contextualAwaitedType && contextualAwaitedType.flags & TypeFlags.Awaited) { + contextualAwaitedType = (contextualAwaitedType).awaitedType; + } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return undefined; @@ -26654,7 +26726,7 @@ namespace ts { const globalPromiseType = getGlobalPromiseType(/*reportErrors*/ true); if (globalPromiseType !== emptyGenericType) { // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type - promisedType = getAwaitedType(promisedType) || unknownType; + promisedType = unwrapAwaitedType(getAwaitedType(promisedType) || unknownType); return createTypeReference(globalPromiseType, [promisedType]); } @@ -26666,7 +26738,7 @@ namespace ts { const globalPromiseLikeType = getGlobalPromiseLikeType(/*reportErrors*/ true); if (globalPromiseLikeType !== emptyGenericType) { // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type - promisedType = getAwaitedType(promisedType) || unknownType; + promisedType = unwrapAwaitedType(getAwaitedType(promisedType) || unknownType); return createTypeReference(globalPromiseLikeType, [promisedType]); } @@ -30057,9 +30129,9 @@ namespace ts { * @param type The type of the promise. * @remarks The "promised type" of a type is the type of the "value" parameter of the "onfulfilled" callback. */ - function getPromisedTypeOfPromise(promise: Type, errorNode?: Node): Type | undefined { + function getPromisedTypeOfPromise(type: Type, errorNode?: Node): Type | undefined { // - // { // promise + // { // type // then( // thenFunction // onfulfilled: ( // onfulfilledParameterType // value: T // valueParameterType @@ -30068,20 +30140,21 @@ namespace ts { // } // - if (isTypeAny(promise)) { + if (isTypeAny(type)) { return undefined; } - const typeAsPromise = promise; + const typeAsPromise = type; if (typeAsPromise.promisedTypeOfPromise) { return typeAsPromise.promisedTypeOfPromise; } - if (isReferenceToType(promise, getGlobalPromiseType(/*reportErrors*/ false))) { - return typeAsPromise.promisedTypeOfPromise = getTypeArguments(promise)[0]; + if (isReferenceToType(type, getGlobalPromiseType(/*reportErrors*/ false)) || + isReferenceToType(type, getGlobalPromiseLikeType(/*reportErrors*/ false))) { + return typeAsPromise.promisedTypeOfPromise = getAwaitedType(getTypeArguments(type)[0], errorNode); } - const thenFunction = getTypeOfPropertyOfType(promise, "then" as __String)!; // TODO: GH#18217 + const thenFunction = getTypeOfPropertyOfType(type, "then" as __String)!; // TODO: GH#18217 if (isTypeAny(thenFunction)) { return undefined; } @@ -30122,32 +30195,141 @@ namespace ts { return awaitedType || errorType; } + /** + * Gets or creates an `awaited T` type for a generic type. + * + * The "awaited type" of a generic type cannot be determined until it is instantiated. As + * a result, an `AwaitedType` for the generic type is created that can be instantiated + * or related later. + */ + function getAwaitedTypeForGenericType(type: InstantiableType) { + const typeId = "" + type.id; + let awaitedType = awaitedTypes.get(typeId); + if (!awaitedType) { + awaitedType = createType(TypeFlags.Awaited); + awaitedType.awaitedType = type; + awaitedTypes.set(typeId, awaitedType); + } + return awaitedType; + } + + function unwrapAwaitedType(type: Type): Type { + return type.flags & TypeFlags.Union ? + mapType(type, unwrapAwaitedType) : + type.flags & TypeFlags.Awaited ? (type).awaitedType : type; + } + + /** + * Determines whether a type has a callable `then` member. + */ + function isThenableType(type: Type): boolean { + const thenFunction = getTypeOfPropertyOfType(type, "then" as __String); + return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, TypeFacts.NEUndefinedOrNull), SignatureKind.Call).length > 0; + } + + /** + * Determines whether a type is a generic type whose base constraint could possibly resolve to a different + * type when awaited. A type is a generic "thenable" type when all of the following conditions are met: + * - The type is a generic object type, + * - AND one of the following conditions are met + * - The type has no base constraint, + * - OR The base constraint of the type is `any`, `unknown`, `object`, or the empty object `{}`, + * - OR The base constraint has a callable `then` member. + * This behavior is not entirely sound, as a `T extends { x: any }` could be instantiated with a + * subtype that has a callable `then`, however this is unlikely in practice and this slightly more unsound + * behavior is much more developer friendly. + */ + function isGenericAwaitableType(type: Type): boolean { + if (isGenericObjectType(type)) { + if (type.flags & TypeFlags.Intersection) { + return some((type as IntersectionType).types, isGenericAwaitableType); + } + const baseConstraint = getBaseConstraintOfType(type); + return !baseConstraint || + !!(baseConstraint.flags & (TypeFlags.AnyOrUnknown | TypeFlags.NonPrimitive)) || + baseConstraint === emptyObjectType || + baseConstraint === emptyGenericType || + isThenableType(baseConstraint); + } + return false; + } + + /** + * Gets the "awaited type" of a type. + * + * The "awaited type" of an expression is its "promised type" if the expression is a + * Promise-like type; otherwise, it is the type of the expression. If the "promised + * type" is itself a Promise-like, the "promised type" is recursively unwrapped until a + * non-promise type is found. + * + * This is used to reflect the runtime behavior of the `await` keyword and the `awaited T` + * type. + */ function getAwaitedType(type: Type, errorNode?: Node, diagnosticMessage?: DiagnosticMessage, arg0?: string | number): Type | undefined { + if (isTypeAny(type)) { + return type; + } + + // If the type is already an awaited type, return it. + // + // For example: + // + // awaited T -> awaited T + // + if (type.flags & TypeFlags.Awaited) { + return type; + } + const typeAsAwaitable = type; if (typeAsAwaitable.awaitedTypeOfType) { return typeAsAwaitable.awaitedTypeOfType; } - if (isTypeAny(type)) { - return typeAsAwaitable.awaitedTypeOfType = type; - } + // For a union, get a union of the awaited types of each constituent. + // + // For example: + // + // awaited (number | string) -> number | string + // awaited (number | Promise) -> number | string + // awaited (T | string) -> awaited T | string + // awaited (T | Promise) -> awaited T | string + // awaited (T | Promise) -> awaited T + // awaited (T | U) -> awaited T | awaited U + // + return typeAsAwaitable.awaitedTypeOfType = + mapType(type, errorNode ? constituentType => getAwaitedTypeWorker(constituentType, errorNode, diagnosticMessage, arg0) : getAwaitedTypeWorker); + } - if (type.flags & TypeFlags.Union) { - let types: Type[] | undefined; - for (const constituentType of (type).types) { - types = append(types, getAwaitedType(constituentType, errorNode, diagnosticMessage, arg0)); - } + function getAwaitedTypeWorker(type: Type, errorNode?: Node, diagnosticMessage?: DiagnosticMessage, arg0?: string | number): Type | undefined { + // If the type is already an awaited type, return it. + // + // For example: + // + // awaited T -> awaited T + // + if (type.flags & TypeFlags.Awaited) { + return type; + } - if (!types) { - return undefined; - } + // We cannot resolve the awaited type for a type variable until it is instantiated. As + // such, we create an `awaited T` type that can either be instantiated or related later. + // + // For example: + // + // T -> awaited T + // + if (isGenericAwaitableType(type)) { + return getAwaitedTypeForGenericType(type); + } - return typeAsAwaitable.awaitedTypeOfType = getUnionType(types); + const typeAsAwaitable = type; + if (typeAsAwaitable.awaitedTypeOfType) { + return typeAsAwaitable.awaitedTypeOfType; } const promisedType = getPromisedTypeOfPromise(type); if (promisedType) { - if (type.id === promisedType.id || awaitedTypeStack.indexOf(promisedType.id) >= 0) { + if (type.id === promisedType.id || awaitedTypeStack.lastIndexOf(promisedType.id) >= 0) { // Verify that we don't have a bad actor in the form of a promise whose // promised type is the same as the promise type, or a mutually recursive // promise. If so, we return undefined as we cannot guess the shape. If this @@ -30161,6 +30343,7 @@ namespace ts { // onfulfilled: (value: BadPromise) => any, // onrejected: (error: any) => any): BadPromise; // } + // // The above interface will pass the PromiseLike check, and return a // promised type of `BadPromise`. Since this is a self reference, we // don't want to keep recursing ad infinitum. @@ -30201,8 +30384,8 @@ namespace ts { // The type was not a promise, so it could not be unwrapped any further. // As long as the type does not have a callable "then" property, it is - // safe to return the type; otherwise, an error will be reported in - // the call to getNonThenableType and we will return undefined. + // safe to return the type; otherwise, an error is reported and we return + // undefined. // // An example of a non-promise "thenable" might be: // @@ -30214,8 +30397,7 @@ namespace ts { // of a runtime problem. If the user wants to return this value from an async // function, they would need to wrap it in some other value. If they want it to // be treated as a promise, they can cast to . - const thenFunction = getTypeOfPropertyOfType(type, "then" as __String); - if (thenFunction && getSignaturesOfType(thenFunction, SignatureKind.Call).length > 0) { + if (isThenableType(type)) { if (errorNode) { if (!diagnosticMessage) return Debug.fail(); error(errorNode, diagnosticMessage, arg0); @@ -32375,7 +32557,7 @@ namespace ts { const isGenerator = !!(functionFlags & FunctionFlags.Generator); const isAsync = !!(functionFlags & FunctionFlags.Async); return isGenerator ? getIterationTypeOfGeneratorFunctionReturnType(IterationTypeKind.Return, returnType, isAsync) || errorType : - isAsync ? getPromisedTypeOfPromise(returnType) || errorType : + isAsync ? unwrapAwaitedType(getAwaitedType(returnType) || errorType) : returnType; } @@ -32414,7 +32596,7 @@ namespace ts { else if (getReturnTypeFromAnnotation(func)) { const unwrappedReturnType = unwrapReturnType(returnType, functionFlags); const unwrappedExprType = functionFlags & FunctionFlags.Async - ? checkAwaitedType(exprType, node, Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) + ? unwrapAwaitedType(checkAwaitedType(exprType, node, Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)) : exprType; if (unwrappedReturnType) { // If the function has a return type, but promisedType is diff --git a/src/compiler/debug.ts b/src/compiler/debug.ts index 660f136133510..880472f5456f1 100644 --- a/src/compiler/debug.ts +++ b/src/compiler/debug.ts @@ -64,7 +64,7 @@ namespace ts { stackCrawlMark || failBadSyntaxKind); } - export function assert(expression: boolean, message?: string, verboseDebugInfo?: string | (() => string), stackCrawlMark?: AnyFunction): asserts expression { + export function assert(expression: unknown, message?: string, verboseDebugInfo?: string | (() => string), stackCrawlMark?: AnyFunction): asserts expression { if (!expression) { message = message ? `False expression: ${message}` : "False expression."; if (verboseDebugInfo) { diff --git a/src/compiler/factoryPublic.ts b/src/compiler/factoryPublic.ts index 8ffc3ee83918e..1a0a9b3df970b 100644 --- a/src/compiler/factoryPublic.ts +++ b/src/compiler/factoryPublic.ts @@ -939,8 +939,8 @@ namespace ts { } export function createTypeOperatorNode(type: TypeNode): TypeOperatorNode; - export function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode; - export function createTypeOperatorNode(operatorOrType: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | TypeNode, type?: TypeNode) { + export function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.AwaitedKeyword, type: TypeNode): TypeOperatorNode; + export function createTypeOperatorNode(operatorOrType: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.AwaitedKeyword | TypeNode, type?: TypeNode) { const node = createSynthesizedNode(SyntaxKind.TypeOperator) as TypeOperatorNode; node.operator = typeof operatorOrType === "number" ? operatorOrType : SyntaxKind.KeyOfKeyword; node.type = parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type! : operatorOrType); diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 06d0f22a2add2..8cbec67d2ee6c 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3297,7 +3297,7 @@ namespace ts { return finishNode(postfix); } - function parseTypeOperator(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword) { + function parseTypeOperator(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.AwaitedKeyword) { const node = createNode(SyntaxKind.TypeOperator); parseExpected(operator); node.operator = operator; @@ -3320,6 +3320,7 @@ namespace ts { case SyntaxKind.KeyOfKeyword: case SyntaxKind.UniqueKeyword: case SyntaxKind.ReadonlyKeyword: + case SyntaxKind.AwaitedKeyword: return parseTypeOperator(operator); case SyntaxKind.InferKeyword: return parseInferType(); diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index ab08af376d1bb..7ff1287aebd9a 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -146,6 +146,7 @@ namespace ts { yield: SyntaxKind.YieldKeyword, async: SyntaxKind.AsyncKeyword, await: SyntaxKind.AwaitKeyword, + awaited: SyntaxKind.AwaitedKeyword, of: SyntaxKind.OfKeyword, }; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index cf083fac5e897..26b4b77c6cce6 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -107,6 +107,7 @@ namespace ts { | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword + | SyntaxKind.AwaitedKeyword | SyntaxKind.OfKeyword; export type JsxTokenSyntaxKind = @@ -261,6 +262,7 @@ namespace ts { AnyKeyword, AsyncKeyword, AwaitKeyword, + AwaitedKeyword, BooleanKeyword, ConstructorKeyword, DeclareKeyword, @@ -1318,7 +1320,7 @@ namespace ts { export interface TypeOperatorNode extends TypeNode { kind: SyntaxKind.TypeOperator; - operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword; + operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.AwaitedKeyword; type: TypeNode; } @@ -4341,6 +4343,7 @@ namespace ts { Conditional = 1 << 24, // T extends U ? X : Y Substitution = 1 << 25, // Type parameter substitution NonPrimitive = 1 << 26, // intrinsic object type + Awaited = 1 << 27, // awaited T /* @internal */ AnyOrUnknown = Any | Unknown, @@ -4370,7 +4373,7 @@ namespace ts { UnionOrIntersection = Union | Intersection, StructuredType = Object | Union | Intersection, TypeVariable = TypeParameter | IndexedAccess, - InstantiableNonPrimitive = TypeVariable | Conditional | Substitution, + InstantiableNonPrimitive = TypeVariable | Conditional | Substitution | Awaited, InstantiablePrimitive = Index, Instantiable = InstantiableNonPrimitive | InstantiablePrimitive, StructuredOrInstantiable = StructuredType | Instantiable, @@ -4815,6 +4818,11 @@ namespace ts { substitute: Type; // Type to substitute for type parameter } + // awaited T (TypeFlags.Awaited) + export interface AwaitedType extends InstantiableType { + awaitedType: Type; + } + /* @internal */ export const enum JsxReferenceKind { Component, diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 2acaa3200fb89..32eaac57aa2e3 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -5445,7 +5445,15 @@ namespace ts { return !!(options.incremental || options.composite); } - export type StrictOptionName = "noImplicitAny" | "noImplicitThis" | "strictNullChecks" | "strictFunctionTypes" | "strictBindCallApply" | "strictPropertyInitialization" | "alwaysStrict"; + export type StrictOptionName = + | "noImplicitAny" + | "noImplicitThis" + | "strictNullChecks" + | "strictFunctionTypes" + | "strictBindCallApply" + | "strictPropertyInitialization" + | "alwaysStrict" + ; export function getStrictOptionValue(compilerOptions: CompilerOptions, flag: StrictOptionName): boolean { return compilerOptions[flag] === undefined ? !!compilerOptions.strict : !!compilerOptions[flag]; diff --git a/src/lib/es2015.iterable.d.ts b/src/lib/es2015.iterable.d.ts index 937f99d3409a4..b3bf6ff1edc43 100644 --- a/src/lib/es2015.iterable.d.ts +++ b/src/lib/es2015.iterable.d.ts @@ -200,18 +200,18 @@ interface PromiseConstructor { /** * Creates a Promise that is resolved with an array of results when all of the provided Promises * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. + * @param values An iterable of Promises. * @returns A new Promise. */ - all(values: Iterable>): Promise; + all(values: Iterable>): Promise<(awaited T)[]>; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved * or rejected. - * @param values An array of Promises. + * @param values An iterable of Promises. * @returns A new Promise. */ - race(values: Iterable>): Promise; + race(values: Iterable>): Promise; } declare namespace Reflect { diff --git a/src/lib/es2015.promise.d.ts b/src/lib/es2015.promise.d.ts index 45b0fa5dc59d9..e149e72b710db 100644 --- a/src/lib/es2015.promise.d.ts +++ b/src/lib/es2015.promise.d.ts @@ -10,7 +10,7 @@ interface PromiseConstructor { * a resolve callback used to resolve the promise with a value or the result of another promise, * and a reject callback used to reject the promise with a provided reason or error. */ - new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; + new (executor: (resolve: (value?: T | PromiseLike | awaited T) => void, reject: (reason?: any) => void) => void): Promise; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -18,7 +18,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9, awaited T10]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -26,63 +26,63 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; - + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9]>; + /** * Creates a Promise that is resolved with an array of results when all of the provided Promises * resolve, or rejected when any Promise is rejected. * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; - + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8]>; + /** * Creates a Promise that is resolved with an array of results when all of the provided Promises * resolve, or rejected when any Promise is rejected. * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; - + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7]>; + /** * Creates a Promise that is resolved with an array of results when all of the provided Promises * resolve, or rejected when any Promise is rejected. * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; - + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6]>; + /** * Creates a Promise that is resolved with an array of results when all of the provided Promises * resolve, or rejected when any Promise is rejected. * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; - + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5]>; + /** * Creates a Promise that is resolved with an array of results when all of the provided Promises * resolve, or rejected when any Promise is rejected. * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; - + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4]>; + /** * Creates a Promise that is resolved with an array of results when all of the provided Promises * resolve, or rejected when any Promise is rejected. * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; - + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3]>; + /** * Creates a Promise that is resolved with an array of results when all of the provided Promises * resolve, or rejected when any Promise is rejected. * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[awaited T1, awaited T2]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -90,37 +90,43 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly (T | PromiseLike)[]): Promise; + all(values: T): Promise<{ -readonly [P in keyof T]: awaited T[P] }>; /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. * @param values An array of Promises. * @returns A new Promise. */ - race(values: readonly T[]): Promise ? U : T>; + all(values: readonly (T | PromiseLike)[]): Promise<(awaited T)[]>; + + // see: lib.es2015.iterable.d.ts + // all(values: Iterable>): Promise<(awaited T)[]>; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved * or rejected. - * @param values An iterable of Promises. + * @param values An array of Promises. * @returns A new Promise. */ - race(values: Iterable): Promise ? U : T>; + race(values: readonly (T | PromiseLike)[]): Promise; + + // see: lib.es2015.iterable.d.ts + // race(values: Iterable>): Promise; /** * Creates a new rejected promise for the provided reason. * @param reason The reason the promise was rejected. * @returns A new rejected Promise. */ - reject(reason?: any): Promise; + reject(reason?: any): Promise; /** * Creates a new resolved promise for the provided value. * @param value A promise. * @returns A promise whose internal state matches the provided promise. */ - resolve(value: T | PromiseLike): Promise; + resolve(value: T | PromiseLike): Promise; /** * Creates a new resolved promise . diff --git a/src/lib/es2018.promise.d.ts b/src/lib/es2018.promise.d.ts index 28f903870b67c..84b99d895026b 100644 --- a/src/lib/es2018.promise.d.ts +++ b/src/lib/es2018.promise.d.ts @@ -8,5 +8,5 @@ interface Promise { * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). * @returns A Promise for the completion of the callback. */ - finally(onfinally?: (() => void) | undefined | null): Promise + finally(onfinally?: (() => void | PromiseLike) | undefined | null): Promise } diff --git a/src/lib/es2020.promise.d.ts b/src/lib/es2020.promise.d.ts index a996a99603e5d..4d9e20f451ff9 100644 --- a/src/lib/es2020.promise.d.ts +++ b/src/lib/es2020.promise.d.ts @@ -17,8 +17,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - allSettled(values: T): - Promise<{ -readonly [P in keyof T]: PromiseSettledResult ? U : T[P]> }>; + allSettled(values: T): Promise<{ -readonly [P in keyof T]: PromiseSettledResult }>; /** * Creates a Promise that is resolved with an array of results when all @@ -26,5 +25,5 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - allSettled(values: Iterable): Promise ? U : T>[]>; + allSettled(values: Iterable>): Promise[]>; } diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 9b981d69fc04e..7cf2c00248c8b 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -1378,7 +1378,7 @@ declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; -declare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike; +declare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike | awaited T) => void, reject: (reason?: any) => void) => void) => PromiseLike; interface PromiseLike { /** @@ -1387,7 +1387,7 @@ interface PromiseLike { * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of which ever callback is executed. */ - then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): PromiseLike; + then(onfulfilled?: ((value: awaited T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): PromiseLike; } /** @@ -1400,14 +1400,14 @@ interface Promise { * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of which ever callback is executed. */ - then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; + then(onfulfilled?: ((value: awaited T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; /** * Attaches a callback for only the rejection of the Promise. * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of the callback. */ - catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; } interface ArrayLike { diff --git a/src/lib/esnext.promise.d.ts b/src/lib/esnext.promise.d.ts index d18a16581426b..6283558e7dd38 100644 --- a/src/lib/esnext.promise.d.ts +++ b/src/lib/esnext.promise.d.ts @@ -19,5 +19,5 @@ interface PromiseConstructor { * @param values An array or iterable of Promises. * @returns A new Promise. */ - any(values: (T | PromiseLike)[] | Iterable>): Promise + any(values: (T | PromiseLike)[] | Iterable>): Promise } diff --git a/src/services/codefixes/inferFromUsage.ts b/src/services/codefixes/inferFromUsage.ts index 0af71bbbb9ca0..d0a47be96b7ab 100644 --- a/src/services/codefixes/inferFromUsage.ts +++ b/src/services/codefixes/inferFromUsage.ts @@ -1043,6 +1043,9 @@ namespace ts.codefix { else if (genericType.flags & TypeFlags.UnionOrIntersection) { return flatMap((genericType as UnionOrIntersectionType).types, t => inferTypeParameters(t, usageType, typeParameter)); } + else if (genericType.flags & TypeFlags.Awaited) { + return inferTypeParameters((genericType).awaitedType, usageType, typeParameter); + } else if (getObjectFlags(genericType) & ObjectFlags.Reference && getObjectFlags(usageType) & ObjectFlags.Reference) { // this is wrong because we need a reference to the targetType to, so we can check that it's also a reference const genericArgs = checker.getTypeArguments(genericType as TypeReference); @@ -1059,6 +1062,7 @@ namespace ts.codefix { } const genericSigs = checker.getSignaturesOfType(genericType, SignatureKind.Call); const usageSigs = checker.getSignaturesOfType(usageType, SignatureKind.Call); + // allow for multiple overloads of `then`. if (genericSigs.length === 1 && usageSigs.length === 1) { return inferFromSignatures(genericSigs[0], usageSigs[0], typeParameter); } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 5c0326d63ca24..d805a557ad6d9 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -71,7 +71,7 @@ declare namespace ts { end: number; } export type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind; - export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.OfKeyword; + export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.AwaitedKeyword | SyntaxKind.OfKeyword; export type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; export enum SyntaxKind { Unknown = 0, @@ -203,210 +203,211 @@ declare namespace ts { AnyKeyword = 125, AsyncKeyword = 126, AwaitKeyword = 127, - BooleanKeyword = 128, - ConstructorKeyword = 129, - DeclareKeyword = 130, - GetKeyword = 131, - InferKeyword = 132, - IsKeyword = 133, - KeyOfKeyword = 134, - ModuleKeyword = 135, - NamespaceKeyword = 136, - NeverKeyword = 137, - ReadonlyKeyword = 138, - RequireKeyword = 139, - NumberKeyword = 140, - ObjectKeyword = 141, - SetKeyword = 142, - StringKeyword = 143, - SymbolKeyword = 144, - TypeKeyword = 145, - UndefinedKeyword = 146, - UniqueKeyword = 147, - UnknownKeyword = 148, - FromKeyword = 149, - GlobalKeyword = 150, - BigIntKeyword = 151, - OfKeyword = 152, - QualifiedName = 153, - ComputedPropertyName = 154, - TypeParameter = 155, - Parameter = 156, - Decorator = 157, - PropertySignature = 158, - PropertyDeclaration = 159, - MethodSignature = 160, - MethodDeclaration = 161, - Constructor = 162, - GetAccessor = 163, - SetAccessor = 164, - CallSignature = 165, - ConstructSignature = 166, - IndexSignature = 167, - TypePredicate = 168, - TypeReference = 169, - FunctionType = 170, - ConstructorType = 171, - TypeQuery = 172, - TypeLiteral = 173, - ArrayType = 174, - TupleType = 175, - OptionalType = 176, - RestType = 177, - UnionType = 178, - IntersectionType = 179, - ConditionalType = 180, - InferType = 181, - ParenthesizedType = 182, - ThisType = 183, - TypeOperator = 184, - IndexedAccessType = 185, - MappedType = 186, - LiteralType = 187, - ImportType = 188, - ObjectBindingPattern = 189, - ArrayBindingPattern = 190, - BindingElement = 191, - ArrayLiteralExpression = 192, - ObjectLiteralExpression = 193, - PropertyAccessExpression = 194, - ElementAccessExpression = 195, - CallExpression = 196, - NewExpression = 197, - TaggedTemplateExpression = 198, - TypeAssertionExpression = 199, - ParenthesizedExpression = 200, - FunctionExpression = 201, - ArrowFunction = 202, - DeleteExpression = 203, - TypeOfExpression = 204, - VoidExpression = 205, - AwaitExpression = 206, - PrefixUnaryExpression = 207, - PostfixUnaryExpression = 208, - BinaryExpression = 209, - ConditionalExpression = 210, - TemplateExpression = 211, - YieldExpression = 212, - SpreadElement = 213, - ClassExpression = 214, - OmittedExpression = 215, - ExpressionWithTypeArguments = 216, - AsExpression = 217, - NonNullExpression = 218, - MetaProperty = 219, - SyntheticExpression = 220, - TemplateSpan = 221, - SemicolonClassElement = 222, - Block = 223, - EmptyStatement = 224, - VariableStatement = 225, - ExpressionStatement = 226, - IfStatement = 227, - DoStatement = 228, - WhileStatement = 229, - ForStatement = 230, - ForInStatement = 231, - ForOfStatement = 232, - ContinueStatement = 233, - BreakStatement = 234, - ReturnStatement = 235, - WithStatement = 236, - SwitchStatement = 237, - LabeledStatement = 238, - ThrowStatement = 239, - TryStatement = 240, - DebuggerStatement = 241, - VariableDeclaration = 242, - VariableDeclarationList = 243, - FunctionDeclaration = 244, - ClassDeclaration = 245, - InterfaceDeclaration = 246, - TypeAliasDeclaration = 247, - EnumDeclaration = 248, - ModuleDeclaration = 249, - ModuleBlock = 250, - CaseBlock = 251, - NamespaceExportDeclaration = 252, - ImportEqualsDeclaration = 253, - ImportDeclaration = 254, - ImportClause = 255, - NamespaceImport = 256, - NamedImports = 257, - ImportSpecifier = 258, - ExportAssignment = 259, - ExportDeclaration = 260, - NamedExports = 261, - NamespaceExport = 262, - ExportSpecifier = 263, - MissingDeclaration = 264, - ExternalModuleReference = 265, - JsxElement = 266, - JsxSelfClosingElement = 267, - JsxOpeningElement = 268, - JsxClosingElement = 269, - JsxFragment = 270, - JsxOpeningFragment = 271, - JsxClosingFragment = 272, - JsxAttribute = 273, - JsxAttributes = 274, - JsxSpreadAttribute = 275, - JsxExpression = 276, - CaseClause = 277, - DefaultClause = 278, - HeritageClause = 279, - CatchClause = 280, - PropertyAssignment = 281, - ShorthandPropertyAssignment = 282, - SpreadAssignment = 283, - EnumMember = 284, - UnparsedPrologue = 285, - UnparsedPrepend = 286, - UnparsedText = 287, - UnparsedInternalText = 288, - UnparsedSyntheticReference = 289, - SourceFile = 290, - Bundle = 291, - UnparsedSource = 292, - InputFiles = 293, - JSDocTypeExpression = 294, - JSDocAllType = 295, - JSDocUnknownType = 296, - JSDocNullableType = 297, - JSDocNonNullableType = 298, - JSDocOptionalType = 299, - JSDocFunctionType = 300, - JSDocVariadicType = 301, - JSDocNamepathType = 302, - JSDocComment = 303, - JSDocTypeLiteral = 304, - JSDocSignature = 305, - JSDocTag = 306, - JSDocAugmentsTag = 307, - JSDocImplementsTag = 308, - JSDocAuthorTag = 309, - JSDocClassTag = 310, - JSDocPublicTag = 311, - JSDocPrivateTag = 312, - JSDocProtectedTag = 313, - JSDocReadonlyTag = 314, - JSDocCallbackTag = 315, - JSDocEnumTag = 316, - JSDocParameterTag = 317, - JSDocReturnTag = 318, - JSDocThisTag = 319, - JSDocTypeTag = 320, - JSDocTemplateTag = 321, - JSDocTypedefTag = 322, - JSDocPropertyTag = 323, - SyntaxList = 324, - NotEmittedStatement = 325, - PartiallyEmittedExpression = 326, - CommaListExpression = 327, - MergeDeclarationMarker = 328, - EndOfDeclarationMarker = 329, - SyntheticReferenceExpression = 330, - Count = 331, + AwaitedKeyword = 128, + BooleanKeyword = 129, + ConstructorKeyword = 130, + DeclareKeyword = 131, + GetKeyword = 132, + InferKeyword = 133, + IsKeyword = 134, + KeyOfKeyword = 135, + ModuleKeyword = 136, + NamespaceKeyword = 137, + NeverKeyword = 138, + ReadonlyKeyword = 139, + RequireKeyword = 140, + NumberKeyword = 141, + ObjectKeyword = 142, + SetKeyword = 143, + StringKeyword = 144, + SymbolKeyword = 145, + TypeKeyword = 146, + UndefinedKeyword = 147, + UniqueKeyword = 148, + UnknownKeyword = 149, + FromKeyword = 150, + GlobalKeyword = 151, + BigIntKeyword = 152, + OfKeyword = 153, + QualifiedName = 154, + ComputedPropertyName = 155, + TypeParameter = 156, + Parameter = 157, + Decorator = 158, + PropertySignature = 159, + PropertyDeclaration = 160, + MethodSignature = 161, + MethodDeclaration = 162, + Constructor = 163, + GetAccessor = 164, + SetAccessor = 165, + CallSignature = 166, + ConstructSignature = 167, + IndexSignature = 168, + TypePredicate = 169, + TypeReference = 170, + FunctionType = 171, + ConstructorType = 172, + TypeQuery = 173, + TypeLiteral = 174, + ArrayType = 175, + TupleType = 176, + OptionalType = 177, + RestType = 178, + UnionType = 179, + IntersectionType = 180, + ConditionalType = 181, + InferType = 182, + ParenthesizedType = 183, + ThisType = 184, + TypeOperator = 185, + IndexedAccessType = 186, + MappedType = 187, + LiteralType = 188, + ImportType = 189, + ObjectBindingPattern = 190, + ArrayBindingPattern = 191, + BindingElement = 192, + ArrayLiteralExpression = 193, + ObjectLiteralExpression = 194, + PropertyAccessExpression = 195, + ElementAccessExpression = 196, + CallExpression = 197, + NewExpression = 198, + TaggedTemplateExpression = 199, + TypeAssertionExpression = 200, + ParenthesizedExpression = 201, + FunctionExpression = 202, + ArrowFunction = 203, + DeleteExpression = 204, + TypeOfExpression = 205, + VoidExpression = 206, + AwaitExpression = 207, + PrefixUnaryExpression = 208, + PostfixUnaryExpression = 209, + BinaryExpression = 210, + ConditionalExpression = 211, + TemplateExpression = 212, + YieldExpression = 213, + SpreadElement = 214, + ClassExpression = 215, + OmittedExpression = 216, + ExpressionWithTypeArguments = 217, + AsExpression = 218, + NonNullExpression = 219, + MetaProperty = 220, + SyntheticExpression = 221, + TemplateSpan = 222, + SemicolonClassElement = 223, + Block = 224, + EmptyStatement = 225, + VariableStatement = 226, + ExpressionStatement = 227, + IfStatement = 228, + DoStatement = 229, + WhileStatement = 230, + ForStatement = 231, + ForInStatement = 232, + ForOfStatement = 233, + ContinueStatement = 234, + BreakStatement = 235, + ReturnStatement = 236, + WithStatement = 237, + SwitchStatement = 238, + LabeledStatement = 239, + ThrowStatement = 240, + TryStatement = 241, + DebuggerStatement = 242, + VariableDeclaration = 243, + VariableDeclarationList = 244, + FunctionDeclaration = 245, + ClassDeclaration = 246, + InterfaceDeclaration = 247, + TypeAliasDeclaration = 248, + EnumDeclaration = 249, + ModuleDeclaration = 250, + ModuleBlock = 251, + CaseBlock = 252, + NamespaceExportDeclaration = 253, + ImportEqualsDeclaration = 254, + ImportDeclaration = 255, + ImportClause = 256, + NamespaceImport = 257, + NamedImports = 258, + ImportSpecifier = 259, + ExportAssignment = 260, + ExportDeclaration = 261, + NamedExports = 262, + NamespaceExport = 263, + ExportSpecifier = 264, + MissingDeclaration = 265, + ExternalModuleReference = 266, + JsxElement = 267, + JsxSelfClosingElement = 268, + JsxOpeningElement = 269, + JsxClosingElement = 270, + JsxFragment = 271, + JsxOpeningFragment = 272, + JsxClosingFragment = 273, + JsxAttribute = 274, + JsxAttributes = 275, + JsxSpreadAttribute = 276, + JsxExpression = 277, + CaseClause = 278, + DefaultClause = 279, + HeritageClause = 280, + CatchClause = 281, + PropertyAssignment = 282, + ShorthandPropertyAssignment = 283, + SpreadAssignment = 284, + EnumMember = 285, + UnparsedPrologue = 286, + UnparsedPrepend = 287, + UnparsedText = 288, + UnparsedInternalText = 289, + UnparsedSyntheticReference = 290, + SourceFile = 291, + Bundle = 292, + UnparsedSource = 293, + InputFiles = 294, + JSDocTypeExpression = 295, + JSDocAllType = 296, + JSDocUnknownType = 297, + JSDocNullableType = 298, + JSDocNonNullableType = 299, + JSDocOptionalType = 300, + JSDocFunctionType = 301, + JSDocVariadicType = 302, + JSDocNamepathType = 303, + JSDocComment = 304, + JSDocTypeLiteral = 305, + JSDocSignature = 306, + JSDocTag = 307, + JSDocAugmentsTag = 308, + JSDocImplementsTag = 309, + JSDocAuthorTag = 310, + JSDocClassTag = 311, + JSDocPublicTag = 312, + JSDocPrivateTag = 313, + JSDocProtectedTag = 314, + JSDocReadonlyTag = 315, + JSDocCallbackTag = 316, + JSDocEnumTag = 317, + JSDocParameterTag = 318, + JSDocReturnTag = 319, + JSDocThisTag = 320, + JSDocTypeTag = 321, + JSDocTemplateTag = 322, + JSDocTypedefTag = 323, + JSDocPropertyTag = 324, + SyntaxList = 325, + NotEmittedStatement = 326, + PartiallyEmittedExpression = 327, + CommaListExpression = 328, + MergeDeclarationMarker = 329, + EndOfDeclarationMarker = 330, + SyntheticReferenceExpression = 331, + Count = 332, FirstAssignment = 62, LastAssignment = 74, FirstCompoundAssignment = 63, @@ -414,15 +415,15 @@ declare namespace ts { FirstReservedWord = 77, LastReservedWord = 112, FirstKeyword = 77, - LastKeyword = 152, + LastKeyword = 153, FirstFutureReservedWord = 113, LastFutureReservedWord = 121, - FirstTypeNode = 168, - LastTypeNode = 188, + FirstTypeNode = 169, + LastTypeNode = 189, FirstPunctuation = 18, LastPunctuation = 74, FirstToken = 0, - LastToken = 152, + LastToken = 153, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -431,13 +432,13 @@ declare namespace ts { LastTemplateToken = 17, FirstBinaryOperator = 29, LastBinaryOperator = 74, - FirstStatement = 225, - LastStatement = 241, - FirstNode = 153, - FirstJSDocNode = 294, - LastJSDocNode = 323, - FirstJSDocTagNode = 306, - LastJSDocTagNode = 323, + FirstStatement = 226, + LastStatement = 242, + FirstNode = 154, + FirstJSDocNode = 295, + LastJSDocNode = 324, + FirstJSDocTagNode = 307, + LastJSDocTagNode = 324, } export enum NodeFlags { None = 0, @@ -844,7 +845,7 @@ declare namespace ts { } export interface TypeOperatorNode extends TypeNode { kind: SyntaxKind.TypeOperator; - operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword; + operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.AwaitedKeyword; type: TypeNode; } export interface IndexedAccessTypeNode extends TypeNode { @@ -2360,6 +2361,7 @@ declare namespace ts { Conditional = 16777216, Substitution = 33554432, NonPrimitive = 67108864, + Awaited = 134217728, Literal = 2944, Unit = 109440, StringOrNumberLiteral = 384, @@ -2374,11 +2376,11 @@ declare namespace ts { UnionOrIntersection = 3145728, StructuredType = 3670016, TypeVariable = 8650752, - InstantiableNonPrimitive = 58982400, + InstantiableNonPrimitive = 193200128, InstantiablePrimitive = 4194304, - Instantiable = 63176704, - StructuredOrInstantiable = 66846720, - Narrowable = 133970943, + Instantiable = 197394432, + StructuredOrInstantiable = 201064448, + Narrowable = 268188671, NotUnionOrUnit = 67637251, } export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; @@ -2526,6 +2528,9 @@ declare namespace ts { baseType: Type; substitute: Type; } + export interface AwaitedType extends InstantiableType { + awaitedType: Type; + } export enum SignatureKind { Call = 0, Construct = 1 @@ -4066,7 +4071,7 @@ declare namespace ts { function updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode; function createThisTypeNode(): ThisTypeNode; function createTypeOperatorNode(type: TypeNode): TypeOperatorNode; - function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode; + function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.AwaitedKeyword, type: TypeNode): TypeOperatorNode; function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; function updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 5bd7da4518176..d5b00fa19de55 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -71,7 +71,7 @@ declare namespace ts { end: number; } export type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind; - export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.OfKeyword; + export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.AwaitedKeyword | SyntaxKind.OfKeyword; export type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; export enum SyntaxKind { Unknown = 0, @@ -203,210 +203,211 @@ declare namespace ts { AnyKeyword = 125, AsyncKeyword = 126, AwaitKeyword = 127, - BooleanKeyword = 128, - ConstructorKeyword = 129, - DeclareKeyword = 130, - GetKeyword = 131, - InferKeyword = 132, - IsKeyword = 133, - KeyOfKeyword = 134, - ModuleKeyword = 135, - NamespaceKeyword = 136, - NeverKeyword = 137, - ReadonlyKeyword = 138, - RequireKeyword = 139, - NumberKeyword = 140, - ObjectKeyword = 141, - SetKeyword = 142, - StringKeyword = 143, - SymbolKeyword = 144, - TypeKeyword = 145, - UndefinedKeyword = 146, - UniqueKeyword = 147, - UnknownKeyword = 148, - FromKeyword = 149, - GlobalKeyword = 150, - BigIntKeyword = 151, - OfKeyword = 152, - QualifiedName = 153, - ComputedPropertyName = 154, - TypeParameter = 155, - Parameter = 156, - Decorator = 157, - PropertySignature = 158, - PropertyDeclaration = 159, - MethodSignature = 160, - MethodDeclaration = 161, - Constructor = 162, - GetAccessor = 163, - SetAccessor = 164, - CallSignature = 165, - ConstructSignature = 166, - IndexSignature = 167, - TypePredicate = 168, - TypeReference = 169, - FunctionType = 170, - ConstructorType = 171, - TypeQuery = 172, - TypeLiteral = 173, - ArrayType = 174, - TupleType = 175, - OptionalType = 176, - RestType = 177, - UnionType = 178, - IntersectionType = 179, - ConditionalType = 180, - InferType = 181, - ParenthesizedType = 182, - ThisType = 183, - TypeOperator = 184, - IndexedAccessType = 185, - MappedType = 186, - LiteralType = 187, - ImportType = 188, - ObjectBindingPattern = 189, - ArrayBindingPattern = 190, - BindingElement = 191, - ArrayLiteralExpression = 192, - ObjectLiteralExpression = 193, - PropertyAccessExpression = 194, - ElementAccessExpression = 195, - CallExpression = 196, - NewExpression = 197, - TaggedTemplateExpression = 198, - TypeAssertionExpression = 199, - ParenthesizedExpression = 200, - FunctionExpression = 201, - ArrowFunction = 202, - DeleteExpression = 203, - TypeOfExpression = 204, - VoidExpression = 205, - AwaitExpression = 206, - PrefixUnaryExpression = 207, - PostfixUnaryExpression = 208, - BinaryExpression = 209, - ConditionalExpression = 210, - TemplateExpression = 211, - YieldExpression = 212, - SpreadElement = 213, - ClassExpression = 214, - OmittedExpression = 215, - ExpressionWithTypeArguments = 216, - AsExpression = 217, - NonNullExpression = 218, - MetaProperty = 219, - SyntheticExpression = 220, - TemplateSpan = 221, - SemicolonClassElement = 222, - Block = 223, - EmptyStatement = 224, - VariableStatement = 225, - ExpressionStatement = 226, - IfStatement = 227, - DoStatement = 228, - WhileStatement = 229, - ForStatement = 230, - ForInStatement = 231, - ForOfStatement = 232, - ContinueStatement = 233, - BreakStatement = 234, - ReturnStatement = 235, - WithStatement = 236, - SwitchStatement = 237, - LabeledStatement = 238, - ThrowStatement = 239, - TryStatement = 240, - DebuggerStatement = 241, - VariableDeclaration = 242, - VariableDeclarationList = 243, - FunctionDeclaration = 244, - ClassDeclaration = 245, - InterfaceDeclaration = 246, - TypeAliasDeclaration = 247, - EnumDeclaration = 248, - ModuleDeclaration = 249, - ModuleBlock = 250, - CaseBlock = 251, - NamespaceExportDeclaration = 252, - ImportEqualsDeclaration = 253, - ImportDeclaration = 254, - ImportClause = 255, - NamespaceImport = 256, - NamedImports = 257, - ImportSpecifier = 258, - ExportAssignment = 259, - ExportDeclaration = 260, - NamedExports = 261, - NamespaceExport = 262, - ExportSpecifier = 263, - MissingDeclaration = 264, - ExternalModuleReference = 265, - JsxElement = 266, - JsxSelfClosingElement = 267, - JsxOpeningElement = 268, - JsxClosingElement = 269, - JsxFragment = 270, - JsxOpeningFragment = 271, - JsxClosingFragment = 272, - JsxAttribute = 273, - JsxAttributes = 274, - JsxSpreadAttribute = 275, - JsxExpression = 276, - CaseClause = 277, - DefaultClause = 278, - HeritageClause = 279, - CatchClause = 280, - PropertyAssignment = 281, - ShorthandPropertyAssignment = 282, - SpreadAssignment = 283, - EnumMember = 284, - UnparsedPrologue = 285, - UnparsedPrepend = 286, - UnparsedText = 287, - UnparsedInternalText = 288, - UnparsedSyntheticReference = 289, - SourceFile = 290, - Bundle = 291, - UnparsedSource = 292, - InputFiles = 293, - JSDocTypeExpression = 294, - JSDocAllType = 295, - JSDocUnknownType = 296, - JSDocNullableType = 297, - JSDocNonNullableType = 298, - JSDocOptionalType = 299, - JSDocFunctionType = 300, - JSDocVariadicType = 301, - JSDocNamepathType = 302, - JSDocComment = 303, - JSDocTypeLiteral = 304, - JSDocSignature = 305, - JSDocTag = 306, - JSDocAugmentsTag = 307, - JSDocImplementsTag = 308, - JSDocAuthorTag = 309, - JSDocClassTag = 310, - JSDocPublicTag = 311, - JSDocPrivateTag = 312, - JSDocProtectedTag = 313, - JSDocReadonlyTag = 314, - JSDocCallbackTag = 315, - JSDocEnumTag = 316, - JSDocParameterTag = 317, - JSDocReturnTag = 318, - JSDocThisTag = 319, - JSDocTypeTag = 320, - JSDocTemplateTag = 321, - JSDocTypedefTag = 322, - JSDocPropertyTag = 323, - SyntaxList = 324, - NotEmittedStatement = 325, - PartiallyEmittedExpression = 326, - CommaListExpression = 327, - MergeDeclarationMarker = 328, - EndOfDeclarationMarker = 329, - SyntheticReferenceExpression = 330, - Count = 331, + AwaitedKeyword = 128, + BooleanKeyword = 129, + ConstructorKeyword = 130, + DeclareKeyword = 131, + GetKeyword = 132, + InferKeyword = 133, + IsKeyword = 134, + KeyOfKeyword = 135, + ModuleKeyword = 136, + NamespaceKeyword = 137, + NeverKeyword = 138, + ReadonlyKeyword = 139, + RequireKeyword = 140, + NumberKeyword = 141, + ObjectKeyword = 142, + SetKeyword = 143, + StringKeyword = 144, + SymbolKeyword = 145, + TypeKeyword = 146, + UndefinedKeyword = 147, + UniqueKeyword = 148, + UnknownKeyword = 149, + FromKeyword = 150, + GlobalKeyword = 151, + BigIntKeyword = 152, + OfKeyword = 153, + QualifiedName = 154, + ComputedPropertyName = 155, + TypeParameter = 156, + Parameter = 157, + Decorator = 158, + PropertySignature = 159, + PropertyDeclaration = 160, + MethodSignature = 161, + MethodDeclaration = 162, + Constructor = 163, + GetAccessor = 164, + SetAccessor = 165, + CallSignature = 166, + ConstructSignature = 167, + IndexSignature = 168, + TypePredicate = 169, + TypeReference = 170, + FunctionType = 171, + ConstructorType = 172, + TypeQuery = 173, + TypeLiteral = 174, + ArrayType = 175, + TupleType = 176, + OptionalType = 177, + RestType = 178, + UnionType = 179, + IntersectionType = 180, + ConditionalType = 181, + InferType = 182, + ParenthesizedType = 183, + ThisType = 184, + TypeOperator = 185, + IndexedAccessType = 186, + MappedType = 187, + LiteralType = 188, + ImportType = 189, + ObjectBindingPattern = 190, + ArrayBindingPattern = 191, + BindingElement = 192, + ArrayLiteralExpression = 193, + ObjectLiteralExpression = 194, + PropertyAccessExpression = 195, + ElementAccessExpression = 196, + CallExpression = 197, + NewExpression = 198, + TaggedTemplateExpression = 199, + TypeAssertionExpression = 200, + ParenthesizedExpression = 201, + FunctionExpression = 202, + ArrowFunction = 203, + DeleteExpression = 204, + TypeOfExpression = 205, + VoidExpression = 206, + AwaitExpression = 207, + PrefixUnaryExpression = 208, + PostfixUnaryExpression = 209, + BinaryExpression = 210, + ConditionalExpression = 211, + TemplateExpression = 212, + YieldExpression = 213, + SpreadElement = 214, + ClassExpression = 215, + OmittedExpression = 216, + ExpressionWithTypeArguments = 217, + AsExpression = 218, + NonNullExpression = 219, + MetaProperty = 220, + SyntheticExpression = 221, + TemplateSpan = 222, + SemicolonClassElement = 223, + Block = 224, + EmptyStatement = 225, + VariableStatement = 226, + ExpressionStatement = 227, + IfStatement = 228, + DoStatement = 229, + WhileStatement = 230, + ForStatement = 231, + ForInStatement = 232, + ForOfStatement = 233, + ContinueStatement = 234, + BreakStatement = 235, + ReturnStatement = 236, + WithStatement = 237, + SwitchStatement = 238, + LabeledStatement = 239, + ThrowStatement = 240, + TryStatement = 241, + DebuggerStatement = 242, + VariableDeclaration = 243, + VariableDeclarationList = 244, + FunctionDeclaration = 245, + ClassDeclaration = 246, + InterfaceDeclaration = 247, + TypeAliasDeclaration = 248, + EnumDeclaration = 249, + ModuleDeclaration = 250, + ModuleBlock = 251, + CaseBlock = 252, + NamespaceExportDeclaration = 253, + ImportEqualsDeclaration = 254, + ImportDeclaration = 255, + ImportClause = 256, + NamespaceImport = 257, + NamedImports = 258, + ImportSpecifier = 259, + ExportAssignment = 260, + ExportDeclaration = 261, + NamedExports = 262, + NamespaceExport = 263, + ExportSpecifier = 264, + MissingDeclaration = 265, + ExternalModuleReference = 266, + JsxElement = 267, + JsxSelfClosingElement = 268, + JsxOpeningElement = 269, + JsxClosingElement = 270, + JsxFragment = 271, + JsxOpeningFragment = 272, + JsxClosingFragment = 273, + JsxAttribute = 274, + JsxAttributes = 275, + JsxSpreadAttribute = 276, + JsxExpression = 277, + CaseClause = 278, + DefaultClause = 279, + HeritageClause = 280, + CatchClause = 281, + PropertyAssignment = 282, + ShorthandPropertyAssignment = 283, + SpreadAssignment = 284, + EnumMember = 285, + UnparsedPrologue = 286, + UnparsedPrepend = 287, + UnparsedText = 288, + UnparsedInternalText = 289, + UnparsedSyntheticReference = 290, + SourceFile = 291, + Bundle = 292, + UnparsedSource = 293, + InputFiles = 294, + JSDocTypeExpression = 295, + JSDocAllType = 296, + JSDocUnknownType = 297, + JSDocNullableType = 298, + JSDocNonNullableType = 299, + JSDocOptionalType = 300, + JSDocFunctionType = 301, + JSDocVariadicType = 302, + JSDocNamepathType = 303, + JSDocComment = 304, + JSDocTypeLiteral = 305, + JSDocSignature = 306, + JSDocTag = 307, + JSDocAugmentsTag = 308, + JSDocImplementsTag = 309, + JSDocAuthorTag = 310, + JSDocClassTag = 311, + JSDocPublicTag = 312, + JSDocPrivateTag = 313, + JSDocProtectedTag = 314, + JSDocReadonlyTag = 315, + JSDocCallbackTag = 316, + JSDocEnumTag = 317, + JSDocParameterTag = 318, + JSDocReturnTag = 319, + JSDocThisTag = 320, + JSDocTypeTag = 321, + JSDocTemplateTag = 322, + JSDocTypedefTag = 323, + JSDocPropertyTag = 324, + SyntaxList = 325, + NotEmittedStatement = 326, + PartiallyEmittedExpression = 327, + CommaListExpression = 328, + MergeDeclarationMarker = 329, + EndOfDeclarationMarker = 330, + SyntheticReferenceExpression = 331, + Count = 332, FirstAssignment = 62, LastAssignment = 74, FirstCompoundAssignment = 63, @@ -414,15 +415,15 @@ declare namespace ts { FirstReservedWord = 77, LastReservedWord = 112, FirstKeyword = 77, - LastKeyword = 152, + LastKeyword = 153, FirstFutureReservedWord = 113, LastFutureReservedWord = 121, - FirstTypeNode = 168, - LastTypeNode = 188, + FirstTypeNode = 169, + LastTypeNode = 189, FirstPunctuation = 18, LastPunctuation = 74, FirstToken = 0, - LastToken = 152, + LastToken = 153, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -431,13 +432,13 @@ declare namespace ts { LastTemplateToken = 17, FirstBinaryOperator = 29, LastBinaryOperator = 74, - FirstStatement = 225, - LastStatement = 241, - FirstNode = 153, - FirstJSDocNode = 294, - LastJSDocNode = 323, - FirstJSDocTagNode = 306, - LastJSDocTagNode = 323, + FirstStatement = 226, + LastStatement = 242, + FirstNode = 154, + FirstJSDocNode = 295, + LastJSDocNode = 324, + FirstJSDocTagNode = 307, + LastJSDocTagNode = 324, } export enum NodeFlags { None = 0, @@ -844,7 +845,7 @@ declare namespace ts { } export interface TypeOperatorNode extends TypeNode { kind: SyntaxKind.TypeOperator; - operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword; + operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.AwaitedKeyword; type: TypeNode; } export interface IndexedAccessTypeNode extends TypeNode { @@ -2360,6 +2361,7 @@ declare namespace ts { Conditional = 16777216, Substitution = 33554432, NonPrimitive = 67108864, + Awaited = 134217728, Literal = 2944, Unit = 109440, StringOrNumberLiteral = 384, @@ -2374,11 +2376,11 @@ declare namespace ts { UnionOrIntersection = 3145728, StructuredType = 3670016, TypeVariable = 8650752, - InstantiableNonPrimitive = 58982400, + InstantiableNonPrimitive = 193200128, InstantiablePrimitive = 4194304, - Instantiable = 63176704, - StructuredOrInstantiable = 66846720, - Narrowable = 133970943, + Instantiable = 197394432, + StructuredOrInstantiable = 201064448, + Narrowable = 268188671, NotUnionOrUnit = 67637251, } export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; @@ -2526,6 +2528,9 @@ declare namespace ts { baseType: Type; substitute: Type; } + export interface AwaitedType extends InstantiableType { + awaitedType: Type; + } export enum SignatureKind { Call = 0, Construct = 1 @@ -4066,7 +4071,7 @@ declare namespace ts { function updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode; function createThisTypeNode(): ThisTypeNode; function createTypeOperatorNode(type: TypeNode): TypeOperatorNode; - function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode; + function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.AwaitedKeyword, type: TypeNode): TypeOperatorNode; function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; function updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; diff --git a/tests/baselines/reference/asyncArrowFunction11_es5.types b/tests/baselines/reference/asyncArrowFunction11_es5.types index 7fd9d53af7228..7404ab2ce31b1 100644 --- a/tests/baselines/reference/asyncArrowFunction11_es5.types +++ b/tests/baselines/reference/asyncArrowFunction11_es5.types @@ -11,9 +11,9 @@ class A { await Promise.resolve(); >await Promise.resolve() : void >Promise.resolve() : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } const obj = { ["a"]: () => this }; // computed property name after `await` triggers case >obj : { a: () => this; } diff --git a/tests/baselines/reference/asyncArrowFunction5_es2017.errors.txt b/tests/baselines/reference/asyncArrowFunction5_es2017.errors.txt index 26601467324e6..13f43a5a168ae 100644 --- a/tests/baselines/reference/asyncArrowFunction5_es2017.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction5_es2017.errors.txt @@ -16,7 +16,7 @@ tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es20 !!! error TS1005: ',' expected. ~~~~~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'. -!!! related TS6203 /.ts/lib.es2015.promise.d.ts:152:13: 'Promise' was also declared here. +!!! related TS6203 /.ts/lib.es2015.promise.d.ts:158:13: 'Promise' was also declared here. ~ !!! error TS1005: ',' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction5_es5.errors.txt b/tests/baselines/reference/asyncArrowFunction5_es5.errors.txt index cf82d765a566a..8a6221ed8259d 100644 --- a/tests/baselines/reference/asyncArrowFunction5_es5.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction5_es5.errors.txt @@ -16,7 +16,7 @@ tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts( !!! error TS1005: ',' expected. ~~~~~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'. -!!! related TS6203 /.ts/lib.es2015.promise.d.ts:152:13: 'Promise' was also declared here. +!!! related TS6203 /.ts/lib.es2015.promise.d.ts:158:13: 'Promise' was also declared here. ~ !!! error TS1005: ',' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction5_es6.errors.txt b/tests/baselines/reference/asyncArrowFunction5_es6.errors.txt index 909efc3c97eec..02e755294bf90 100644 --- a/tests/baselines/reference/asyncArrowFunction5_es6.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction5_es6.errors.txt @@ -16,7 +16,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts( !!! error TS1005: ',' expected. ~~~~~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'. -!!! related TS6203 /.ts/lib.es2015.promise.d.ts:152:13: 'Promise' was also declared here. +!!! related TS6203 /.ts/lib.es2015.promise.d.ts:158:13: 'Promise' was also declared here. ~ !!! error TS1005: ',' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction9_es2017.errors.txt b/tests/baselines/reference/asyncArrowFunction9_es2017.errors.txt index 0be88de28681a..2bc2c3c50324b 100644 --- a/tests/baselines/reference/asyncArrowFunction9_es2017.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction9_es2017.errors.txt @@ -16,7 +16,7 @@ tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es20 !!! error TS1005: ',' expected. ~~~~~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'. -!!! related TS6203 /.ts/lib.es2015.promise.d.ts:152:13: 'Promise' was also declared here. +!!! related TS6203 /.ts/lib.es2015.promise.d.ts:158:13: 'Promise' was also declared here. ~ !!! error TS1005: ',' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction9_es5.errors.txt b/tests/baselines/reference/asyncArrowFunction9_es5.errors.txt index 085b3b50884b7..4d2c3ebf49589 100644 --- a/tests/baselines/reference/asyncArrowFunction9_es5.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction9_es5.errors.txt @@ -16,7 +16,7 @@ tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts( !!! error TS1005: ',' expected. ~~~~~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'. -!!! related TS6203 /.ts/lib.es2015.promise.d.ts:152:13: 'Promise' was also declared here. +!!! related TS6203 /.ts/lib.es2015.promise.d.ts:158:13: 'Promise' was also declared here. ~ !!! error TS1005: ',' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction9_es6.errors.txt b/tests/baselines/reference/asyncArrowFunction9_es6.errors.txt index 6949aad5cea0c..f846db9523070 100644 --- a/tests/baselines/reference/asyncArrowFunction9_es6.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction9_es6.errors.txt @@ -16,7 +16,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts( !!! error TS1005: ',' expected. ~~~~~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'. -!!! related TS6203 /.ts/lib.es2015.promise.d.ts:152:13: 'Promise' was also declared here. +!!! related TS6203 /.ts/lib.es2015.promise.d.ts:158:13: 'Promise' was also declared here. ~ !!! error TS1005: ',' expected. ~~ diff --git a/tests/baselines/reference/asyncFunctionDeclaration15_es5.errors.txt b/tests/baselines/reference/asyncFunctionDeclaration15_es5.errors.txt index 7e3595ec6f4e0..efb23e304fc50 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration15_es5.errors.txt +++ b/tests/baselines/reference/asyncFunctionDeclaration15_es5.errors.txt @@ -7,7 +7,7 @@ tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration1 tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(10,23): error TS1055: Type 'typeof Thenable' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value. Construct signature return types 'Thenable' and 'PromiseLike' are incompatible. The types returned by 'then(...)' are incompatible between these types. - Type 'void' is not assignable to type 'PromiseLike'. + Type 'void' is not assignable to type 'PromiseLike'. tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(17,16): error TS1058: The return type of an async function must either be a valid promise or must not contain a callable 'then' member. tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(23,25): error TS1320: Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member. @@ -39,7 +39,7 @@ tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration1 !!! error TS1055: Type 'typeof Thenable' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value. !!! error TS1055: Construct signature return types 'Thenable' and 'PromiseLike' are incompatible. !!! error TS1055: The types returned by 'then(...)' are incompatible between these types. -!!! error TS1055: Type 'void' is not assignable to type 'PromiseLike'. +!!! error TS1055: Type 'void' is not assignable to type 'PromiseLike'. async function fn7() { return; } // valid: Promise async function fn8() { return 1; } // valid: Promise async function fn9() { return null; } // valid: Promise diff --git a/tests/baselines/reference/asyncFunctionReturnType.types b/tests/baselines/reference/asyncFunctionReturnType.types index d2cb63e0a35f3..8ee13111a38da 100644 --- a/tests/baselines/reference/asyncFunctionReturnType.types +++ b/tests/baselines/reference/asyncFunctionReturnType.types @@ -44,9 +44,9 @@ async function fIndexedTypeForPromiseOfStringProp(obj: Obj): PromisePromise.resolve(obj.stringProp) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >obj.stringProp : string >obj : Obj >stringProp : string @@ -58,9 +58,9 @@ async function fIndexedTypeForExplicitPromiseOfStringProp(obj: Obj): Promise(obj.stringProp); >Promise.resolve(obj.stringProp) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >obj.stringProp : string >obj : Obj >stringProp : string @@ -82,9 +82,9 @@ async function fIndexedTypeForPromiseOfAnyProp(obj: Obj): PromisePromise.resolve(obj.anyProp) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >obj.anyProp : any >obj : Obj >anyProp : any @@ -96,9 +96,9 @@ async function fIndexedTypeForExplicitPromiseOfAnyProp(obj: Obj): Promise(obj.anyProp); >Promise.resolve(obj.anyProp) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >obj.anyProp : any >obj : Obj >anyProp : any @@ -120,9 +120,9 @@ async function fGenericIndexedTypeForPromiseOfStringProp(obj: return Promise.resolve(obj.stringProp); >Promise.resolve(obj.stringProp) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >obj.stringProp : string >obj : TObj >stringProp : string @@ -134,9 +134,9 @@ async function fGenericIndexedTypeForExplicitPromiseOfStringProp(obj.stringProp); >Promise.resolve(obj.stringProp) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >obj.stringProp : string >obj : TObj >stringProp : string @@ -158,9 +158,9 @@ async function fGenericIndexedTypeForPromiseOfAnyProp(obj: TOb return Promise.resolve(obj.anyProp); >Promise.resolve(obj.anyProp) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >obj.anyProp : any >obj : TObj >anyProp : any @@ -171,10 +171,10 @@ async function fGenericIndexedTypeForExplicitPromiseOfAnyProp( >obj : TObj return Promise.resolve(obj.anyProp); ->Promise.resolve(obj.anyProp) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve(obj.anyProp) : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >obj.anyProp : any >obj : TObj >anyProp : any @@ -197,10 +197,10 @@ async function fGenericIndexedTypeForPromiseOfKPropkey : K return Promise.resolve(obj[key]); ->Promise.resolve(obj[key]) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve(obj[key]) : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >obj[key] : TObj[K] >obj : TObj >key : K @@ -212,10 +212,10 @@ async function fGenericIndexedTypeForExplicitPromiseOfKPropkey : K return Promise.resolve(obj[key]); ->Promise.resolve(obj[key]) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve(obj[key]) : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >obj[key] : TObj[K] >obj : TObj >key : K diff --git a/tests/baselines/reference/awaited.js b/tests/baselines/reference/awaited.js new file mode 100644 index 0000000000000..838d3e3b9e00d --- /dev/null +++ b/tests/baselines/reference/awaited.js @@ -0,0 +1,209 @@ +//// [awaited.ts] +// simple +declare const p0: Promise; +p0.then(x => x); + +declare const p1: Promise>; +p1.then(x => x); + +declare const p2: Promise>; +p2.then(x => x); + +// generics +declare const f: boolean; +declare function makePromise(x: T): Promise; +makePromise(1).then(x => x); +makePromise("a").then(x => x); +makePromise({ a: 1 }).then(x => x); +makePromise(f ? 1 : "a").then(x => x); + +function f0(u: U) { + return makePromise(u).then(x => x); +} +f0(1).then(x => x); +f0("a").then(x => x); +f0(f ? 1 : "a").then(x => x); +f0(makePromise(1)).then(x => x); + +function f1(u: U, v: V) { + return makePromise(u).then(x => { + if (f) return x; + return makePromise(v).then(x => x); + }); +} +f1(1, "a").then(x => x); +f1(makePromise(1), makePromise("a")).then(x => x); + +function f2(u: U) { + return makePromise(u).then(x => { + if (f) return x; + return Promise.reject("b"); + }); +} +f2(1).then(x => x); +f2(makePromise(1)).then(x => x); + +function f3(u: U, v: V) { + return makePromise(u).catch(x => v); +} +f3(1, "a").then(x => x); +f3(makePromise(1), makePromise("a")).then(x => x); + +function f4(u: U, v: V) { + return makePromise(u).catch(x => { + if (f) return v; + return Promise.reject("b"); + }); +} +f4(1, "a").then(x => x); +f4(makePromise(1), makePromise("a")).then(x => x); + +async function f5(u: Promise) { + return await u; +} +f5(makePromise(1)).then(x => x); +f5(makePromise(makePromise(1))).then(x => x); + +async function f6(u: Promise>) { + return await u; +} + +// assignability +let v0: number; +let v1: awaited number; +let v2: awaited Promise; +v0 = v1; +v0 = v2; +v1 = v0; +v1 = v2; +v2 = v0; +v2 = v1; + +function f7() { + let v0: awaited U; + let v1: awaited Promise; + v0 = v1; + v1 = v0; +} + +async function f8() { + let pu: Promise; + let v0: awaited U; + let v1: awaited Promise; + v0 = await pu; + v1 = await pu; +} + +//// [awaited.js] +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +p0.then(x => x); +p1.then(x => x); +p2.then(x => x); +makePromise(1).then(x => x); +makePromise("a").then(x => x); +makePromise({ a: 1 }).then(x => x); +makePromise(f ? 1 : "a").then(x => x); +function f0(u) { + return makePromise(u).then(x => x); +} +f0(1).then(x => x); +f0("a").then(x => x); +f0(f ? 1 : "a").then(x => x); +f0(makePromise(1)).then(x => x); +function f1(u, v) { + return makePromise(u).then(x => { + if (f) + return x; + return makePromise(v).then(x => x); + }); +} +f1(1, "a").then(x => x); +f1(makePromise(1), makePromise("a")).then(x => x); +function f2(u) { + return makePromise(u).then(x => { + if (f) + return x; + return Promise.reject("b"); + }); +} +f2(1).then(x => x); +f2(makePromise(1)).then(x => x); +function f3(u, v) { + return makePromise(u).catch(x => v); +} +f3(1, "a").then(x => x); +f3(makePromise(1), makePromise("a")).then(x => x); +function f4(u, v) { + return makePromise(u).catch(x => { + if (f) + return v; + return Promise.reject("b"); + }); +} +f4(1, "a").then(x => x); +f4(makePromise(1), makePromise("a")).then(x => x); +function f5(u) { + return __awaiter(this, void 0, void 0, function* () { + return yield u; + }); +} +f5(makePromise(1)).then(x => x); +f5(makePromise(makePromise(1))).then(x => x); +function f6(u) { + return __awaiter(this, void 0, void 0, function* () { + return yield u; + }); +} +// assignability +let v0; +let v1; +let v2; +v0 = v1; +v0 = v2; +v1 = v0; +v1 = v2; +v2 = v0; +v2 = v1; +function f7() { + let v0; + let v1; + v0 = v1; + v1 = v0; +} +function f8() { + return __awaiter(this, void 0, void 0, function* () { + let pu; + let v0; + let v1; + v0 = yield pu; + v1 = yield pu; + }); +} + + +//// [awaited.d.ts] +declare const p0: Promise; +declare const p1: Promise>; +declare const p2: Promise>; +declare const f: boolean; +declare function makePromise(x: T): Promise; +declare function f0(u: U): Promise; +declare function f1(u: U, v: V): Promise; +declare function f2(u: U): Promise; +declare function f3(u: U, v: V): Promise; +declare function f4(u: U, v: V): Promise; +declare function f5(u: Promise): Promise; +declare function f6(u: Promise>): Promise; +declare let v0: number; +declare let v1: awaited number; +declare let v2: awaited Promise; +declare function f7(): void; +declare function f8(): Promise; diff --git a/tests/baselines/reference/awaited.symbols b/tests/baselines/reference/awaited.symbols new file mode 100644 index 0000000000000..d8af632541f4f --- /dev/null +++ b/tests/baselines/reference/awaited.symbols @@ -0,0 +1,406 @@ +=== tests/cases/conformance/types/awaited/awaited.ts === +// simple +declare const p0: Promise; +>p0 : Symbol(p0, Decl(awaited.ts, 1, 13)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +p0.then(x => x); +>p0.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p0 : Symbol(p0, Decl(awaited.ts, 1, 13)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 2, 8)) +>x : Symbol(x, Decl(awaited.ts, 2, 8)) + +declare const p1: Promise>; +>p1 : Symbol(p1, Decl(awaited.ts, 4, 13)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +p1.then(x => x); +>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p1 : Symbol(p1, Decl(awaited.ts, 4, 13)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 5, 8)) +>x : Symbol(x, Decl(awaited.ts, 5, 8)) + +declare const p2: Promise>; +>p2 : Symbol(p2, Decl(awaited.ts, 7, 13)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +p2.then(x => x); +>p2.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p2 : Symbol(p2, Decl(awaited.ts, 7, 13)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 8, 8)) +>x : Symbol(x, Decl(awaited.ts, 8, 8)) + +// generics +declare const f: boolean; +>f : Symbol(f, Decl(awaited.ts, 11, 13)) + +declare function makePromise(x: T): Promise; +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>T : Symbol(T, Decl(awaited.ts, 12, 29)) +>x : Symbol(x, Decl(awaited.ts, 12, 32)) +>T : Symbol(T, Decl(awaited.ts, 12, 29)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>T : Symbol(T, Decl(awaited.ts, 12, 29)) + +makePromise(1).then(x => x); +>makePromise(1).then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 13, 20)) +>x : Symbol(x, Decl(awaited.ts, 13, 20)) + +makePromise("a").then(x => x); +>makePromise("a").then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 14, 22)) +>x : Symbol(x, Decl(awaited.ts, 14, 22)) + +makePromise({ a: 1 }).then(x => x); +>makePromise({ a: 1 }).then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>a : Symbol(a, Decl(awaited.ts, 15, 13)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 15, 27)) +>x : Symbol(x, Decl(awaited.ts, 15, 27)) + +makePromise(f ? 1 : "a").then(x => x); +>makePromise(f ? 1 : "a").then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>f : Symbol(f, Decl(awaited.ts, 11, 13)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 16, 30)) +>x : Symbol(x, Decl(awaited.ts, 16, 30)) + +function f0(u: U) { +>f0 : Symbol(f0, Decl(awaited.ts, 16, 38)) +>U : Symbol(U, Decl(awaited.ts, 18, 12)) +>u : Symbol(u, Decl(awaited.ts, 18, 15)) +>U : Symbol(U, Decl(awaited.ts, 18, 12)) + + return makePromise(u).then(x => x); +>makePromise(u).then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>u : Symbol(u, Decl(awaited.ts, 18, 15)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 19, 31)) +>x : Symbol(x, Decl(awaited.ts, 19, 31)) +} +f0(1).then(x => x); +>f0(1).then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>f0 : Symbol(f0, Decl(awaited.ts, 16, 38)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 21, 11)) +>x : Symbol(x, Decl(awaited.ts, 21, 11)) + +f0("a").then(x => x); +>f0("a").then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>f0 : Symbol(f0, Decl(awaited.ts, 16, 38)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 22, 13)) +>x : Symbol(x, Decl(awaited.ts, 22, 13)) + +f0(f ? 1 : "a").then(x => x); +>f0(f ? 1 : "a").then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>f0 : Symbol(f0, Decl(awaited.ts, 16, 38)) +>f : Symbol(f, Decl(awaited.ts, 11, 13)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 23, 21)) +>x : Symbol(x, Decl(awaited.ts, 23, 21)) + +f0(makePromise(1)).then(x => x); +>f0(makePromise(1)).then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>f0 : Symbol(f0, Decl(awaited.ts, 16, 38)) +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 24, 24)) +>x : Symbol(x, Decl(awaited.ts, 24, 24)) + +function f1(u: U, v: V) { +>f1 : Symbol(f1, Decl(awaited.ts, 24, 32)) +>U : Symbol(U, Decl(awaited.ts, 26, 12)) +>V : Symbol(V, Decl(awaited.ts, 26, 14)) +>u : Symbol(u, Decl(awaited.ts, 26, 18)) +>U : Symbol(U, Decl(awaited.ts, 26, 12)) +>v : Symbol(v, Decl(awaited.ts, 26, 23)) +>V : Symbol(V, Decl(awaited.ts, 26, 14)) + + return makePromise(u).then(x => { +>makePromise(u).then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>u : Symbol(u, Decl(awaited.ts, 26, 18)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 27, 31)) + + if (f) return x; +>f : Symbol(f, Decl(awaited.ts, 11, 13)) +>x : Symbol(x, Decl(awaited.ts, 27, 31)) + + return makePromise(v).then(x => x); +>makePromise(v).then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>v : Symbol(v, Decl(awaited.ts, 26, 23)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 29, 35)) +>x : Symbol(x, Decl(awaited.ts, 29, 35)) + + }); +} +f1(1, "a").then(x => x); +>f1(1, "a").then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>f1 : Symbol(f1, Decl(awaited.ts, 24, 32)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 32, 16)) +>x : Symbol(x, Decl(awaited.ts, 32, 16)) + +f1(makePromise(1), makePromise("a")).then(x => x); +>f1(makePromise(1), makePromise("a")).then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>f1 : Symbol(f1, Decl(awaited.ts, 24, 32)) +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 33, 42)) +>x : Symbol(x, Decl(awaited.ts, 33, 42)) + +function f2(u: U) { +>f2 : Symbol(f2, Decl(awaited.ts, 33, 50)) +>U : Symbol(U, Decl(awaited.ts, 35, 12)) +>u : Symbol(u, Decl(awaited.ts, 35, 15)) +>U : Symbol(U, Decl(awaited.ts, 35, 12)) + + return makePromise(u).then(x => { +>makePromise(u).then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>u : Symbol(u, Decl(awaited.ts, 35, 15)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 36, 31)) + + if (f) return x; +>f : Symbol(f, Decl(awaited.ts, 11, 13)) +>x : Symbol(x, Decl(awaited.ts, 36, 31)) + + return Promise.reject("b"); +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --)) + + }); +} +f2(1).then(x => x); +>f2(1).then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>f2 : Symbol(f2, Decl(awaited.ts, 33, 50)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 41, 11)) +>x : Symbol(x, Decl(awaited.ts, 41, 11)) + +f2(makePromise(1)).then(x => x); +>f2(makePromise(1)).then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>f2 : Symbol(f2, Decl(awaited.ts, 33, 50)) +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 42, 24)) +>x : Symbol(x, Decl(awaited.ts, 42, 24)) + +function f3(u: U, v: V) { +>f3 : Symbol(f3, Decl(awaited.ts, 42, 32)) +>U : Symbol(U, Decl(awaited.ts, 44, 12)) +>V : Symbol(V, Decl(awaited.ts, 44, 14)) +>u : Symbol(u, Decl(awaited.ts, 44, 18)) +>U : Symbol(U, Decl(awaited.ts, 44, 12)) +>v : Symbol(v, Decl(awaited.ts, 44, 23)) +>V : Symbol(V, Decl(awaited.ts, 44, 14)) + + return makePromise(u).catch(x => v); +>makePromise(u).catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>u : Symbol(u, Decl(awaited.ts, 44, 18)) +>catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 45, 32)) +>v : Symbol(v, Decl(awaited.ts, 44, 23)) +} +f3(1, "a").then(x => x); +>f3(1, "a").then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>f3 : Symbol(f3, Decl(awaited.ts, 42, 32)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 47, 16)) +>x : Symbol(x, Decl(awaited.ts, 47, 16)) + +f3(makePromise(1), makePromise("a")).then(x => x); +>f3(makePromise(1), makePromise("a")).then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>f3 : Symbol(f3, Decl(awaited.ts, 42, 32)) +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 48, 42)) +>x : Symbol(x, Decl(awaited.ts, 48, 42)) + +function f4(u: U, v: V) { +>f4 : Symbol(f4, Decl(awaited.ts, 48, 50)) +>U : Symbol(U, Decl(awaited.ts, 50, 12)) +>V : Symbol(V, Decl(awaited.ts, 50, 14)) +>u : Symbol(u, Decl(awaited.ts, 50, 18)) +>U : Symbol(U, Decl(awaited.ts, 50, 12)) +>v : Symbol(v, Decl(awaited.ts, 50, 23)) +>V : Symbol(V, Decl(awaited.ts, 50, 14)) + + return makePromise(u).catch(x => { +>makePromise(u).catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>u : Symbol(u, Decl(awaited.ts, 50, 18)) +>catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 51, 32)) + + if (f) return v; +>f : Symbol(f, Decl(awaited.ts, 11, 13)) +>v : Symbol(v, Decl(awaited.ts, 50, 23)) + + return Promise.reject("b"); +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --)) + + }); +} +f4(1, "a").then(x => x); +>f4(1, "a").then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>f4 : Symbol(f4, Decl(awaited.ts, 48, 50)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 56, 16)) +>x : Symbol(x, Decl(awaited.ts, 56, 16)) + +f4(makePromise(1), makePromise("a")).then(x => x); +>f4(makePromise(1), makePromise("a")).then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>f4 : Symbol(f4, Decl(awaited.ts, 48, 50)) +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 57, 42)) +>x : Symbol(x, Decl(awaited.ts, 57, 42)) + +async function f5(u: Promise) { +>f5 : Symbol(f5, Decl(awaited.ts, 57, 50)) +>U : Symbol(U, Decl(awaited.ts, 59, 18)) +>u : Symbol(u, Decl(awaited.ts, 59, 21)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>U : Symbol(U, Decl(awaited.ts, 59, 18)) + + return await u; +>u : Symbol(u, Decl(awaited.ts, 59, 21)) +} +f5(makePromise(1)).then(x => x); +>f5(makePromise(1)).then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>f5 : Symbol(f5, Decl(awaited.ts, 57, 50)) +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 62, 24)) +>x : Symbol(x, Decl(awaited.ts, 62, 24)) + +f5(makePromise(makePromise(1))).then(x => x); +>f5(makePromise(makePromise(1))).then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>f5 : Symbol(f5, Decl(awaited.ts, 57, 50)) +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>makePromise : Symbol(makePromise, Decl(awaited.ts, 11, 25)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(awaited.ts, 63, 37)) +>x : Symbol(x, Decl(awaited.ts, 63, 37)) + +async function f6(u: Promise>) { +>f6 : Symbol(f6, Decl(awaited.ts, 63, 45)) +>U : Symbol(U, Decl(awaited.ts, 65, 18)) +>u : Symbol(u, Decl(awaited.ts, 65, 21)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>U : Symbol(U, Decl(awaited.ts, 65, 18)) + + return await u; +>u : Symbol(u, Decl(awaited.ts, 65, 21)) +} + +// assignability +let v0: number; +>v0 : Symbol(v0, Decl(awaited.ts, 70, 3)) + +let v1: awaited number; +>v1 : Symbol(v1, Decl(awaited.ts, 71, 3)) + +let v2: awaited Promise; +>v2 : Symbol(v2, Decl(awaited.ts, 72, 3)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +v0 = v1; +>v0 : Symbol(v0, Decl(awaited.ts, 70, 3)) +>v1 : Symbol(v1, Decl(awaited.ts, 71, 3)) + +v0 = v2; +>v0 : Symbol(v0, Decl(awaited.ts, 70, 3)) +>v2 : Symbol(v2, Decl(awaited.ts, 72, 3)) + +v1 = v0; +>v1 : Symbol(v1, Decl(awaited.ts, 71, 3)) +>v0 : Symbol(v0, Decl(awaited.ts, 70, 3)) + +v1 = v2; +>v1 : Symbol(v1, Decl(awaited.ts, 71, 3)) +>v2 : Symbol(v2, Decl(awaited.ts, 72, 3)) + +v2 = v0; +>v2 : Symbol(v2, Decl(awaited.ts, 72, 3)) +>v0 : Symbol(v0, Decl(awaited.ts, 70, 3)) + +v2 = v1; +>v2 : Symbol(v2, Decl(awaited.ts, 72, 3)) +>v1 : Symbol(v1, Decl(awaited.ts, 71, 3)) + +function f7() { +>f7 : Symbol(f7, Decl(awaited.ts, 78, 8)) +>U : Symbol(U, Decl(awaited.ts, 80, 12)) + + let v0: awaited U; +>v0 : Symbol(v0, Decl(awaited.ts, 81, 7)) +>U : Symbol(U, Decl(awaited.ts, 80, 12)) + + let v1: awaited Promise; +>v1 : Symbol(v1, Decl(awaited.ts, 82, 7)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>U : Symbol(U, Decl(awaited.ts, 80, 12)) + + v0 = v1; +>v0 : Symbol(v0, Decl(awaited.ts, 81, 7)) +>v1 : Symbol(v1, Decl(awaited.ts, 82, 7)) + + v1 = v0; +>v1 : Symbol(v1, Decl(awaited.ts, 82, 7)) +>v0 : Symbol(v0, Decl(awaited.ts, 81, 7)) +} + +async function f8() { +>f8 : Symbol(f8, Decl(awaited.ts, 85, 1)) +>U : Symbol(U, Decl(awaited.ts, 87, 18)) + + let pu: Promise; +>pu : Symbol(pu, Decl(awaited.ts, 88, 7)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>U : Symbol(U, Decl(awaited.ts, 87, 18)) + + let v0: awaited U; +>v0 : Symbol(v0, Decl(awaited.ts, 89, 7)) +>U : Symbol(U, Decl(awaited.ts, 87, 18)) + + let v1: awaited Promise; +>v1 : Symbol(v1, Decl(awaited.ts, 90, 7)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>U : Symbol(U, Decl(awaited.ts, 87, 18)) + + v0 = await pu; +>v0 : Symbol(v0, Decl(awaited.ts, 89, 7)) +>pu : Symbol(pu, Decl(awaited.ts, 88, 7)) + + v1 = await pu; +>v1 : Symbol(v1, Decl(awaited.ts, 90, 7)) +>pu : Symbol(pu, Decl(awaited.ts, 88, 7)) +} diff --git a/tests/baselines/reference/awaited.types b/tests/baselines/reference/awaited.types new file mode 100644 index 0000000000000..790e209a80a0f --- /dev/null +++ b/tests/baselines/reference/awaited.types @@ -0,0 +1,499 @@ +=== tests/cases/conformance/types/awaited/awaited.ts === +// simple +declare const p0: Promise; +>p0 : Promise + +p0.then(x => x); +>p0.then(x => x) : Promise +>p0.then : (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p0 : Promise +>then : (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: number) => number +>x : number +>x : number + +declare const p1: Promise>; +>p1 : Promise> + +p1.then(x => x); +>p1.then(x => x) : Promise +>p1.then : , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p1 : Promise> +>then : , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: number) => number +>x : number +>x : number + +declare const p2: Promise>; +>p2 : Promise> + +p2.then(x => x); +>p2.then(x => x) : Promise +>p2.then : , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p2 : Promise> +>then : , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: number) => number +>x : number +>x : number + +// generics +declare const f: boolean; +>f : boolean + +declare function makePromise(x: T): Promise; +>makePromise : (x: T) => Promise +>x : T + +makePromise(1).then(x => x); +>makePromise(1).then(x => x) : Promise +>makePromise(1).then : (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>makePromise(1) : Promise +>makePromise : (x: T) => Promise +>1 : 1 +>then : (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: number) => number +>x : number +>x : number + +makePromise("a").then(x => x); +>makePromise("a").then(x => x) : Promise +>makePromise("a").then : (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>makePromise("a") : Promise +>makePromise : (x: T) => Promise +>"a" : "a" +>then : (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: string) => string +>x : string +>x : string + +makePromise({ a: 1 }).then(x => x); +>makePromise({ a: 1 }).then(x => x) : Promise<{ a: number; }> +>makePromise({ a: 1 }).then : (onfulfilled?: (value: { a: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>makePromise({ a: 1 }) : Promise<{ a: number; }> +>makePromise : (x: T) => Promise +>{ a: 1 } : { a: number; } +>a : number +>1 : 1 +>then : (onfulfilled?: (value: { a: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: { a: number; }) => { a: number; } +>x : { a: number; } +>x : { a: number; } + +makePromise(f ? 1 : "a").then(x => x); +>makePromise(f ? 1 : "a").then(x => x) : Promise +>makePromise(f ? 1 : "a").then : (onfulfilled?: (value: string | number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>makePromise(f ? 1 : "a") : Promise +>makePromise : (x: T) => Promise +>f ? 1 : "a" : 1 | "a" +>f : boolean +>1 : 1 +>"a" : "a" +>then : (onfulfilled?: (value: string | number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: string | number) => string | number +>x : string | number +>x : string | number + +function f0(u: U) { +>f0 : (u: U) => Promise +>u : U + + return makePromise(u).then(x => x); +>makePromise(u).then(x => x) : Promise +>makePromise(u).then : (onfulfilled?: (value: awaited U) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>makePromise(u) : Promise +>makePromise : (x: T) => Promise +>u : U +>then : (onfulfilled?: (value: awaited U) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: awaited U) => awaited U +>x : awaited U +>x : awaited U +} +f0(1).then(x => x); +>f0(1).then(x => x) : Promise +>f0(1).then : (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>f0(1) : Promise +>f0 : (u: U) => Promise +>1 : 1 +>then : (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: number) => number +>x : number +>x : number + +f0("a").then(x => x); +>f0("a").then(x => x) : Promise +>f0("a").then : (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>f0("a") : Promise +>f0 : (u: U) => Promise +>"a" : "a" +>then : (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: string) => string +>x : string +>x : string + +f0(f ? 1 : "a").then(x => x); +>f0(f ? 1 : "a").then(x => x) : Promise +>f0(f ? 1 : "a").then : (onfulfilled?: (value: string | number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>f0(f ? 1 : "a") : Promise +>f0 : (u: U) => Promise +>f ? 1 : "a" : 1 | "a" +>f : boolean +>1 : 1 +>"a" : "a" +>then : (onfulfilled?: (value: string | number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: string | number) => string | number +>x : string | number +>x : string | number + +f0(makePromise(1)).then(x => x); +>f0(makePromise(1)).then(x => x) : Promise +>f0(makePromise(1)).then : (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>f0(makePromise(1)) : Promise +>f0 : (u: U) => Promise +>makePromise(1) : Promise +>makePromise : (x: T) => Promise +>1 : 1 +>then : (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: number) => number +>x : number +>x : number + +function f1(u: U, v: V) { +>f1 : (u: U, v: V) => Promise +>u : U +>v : V + + return makePromise(u).then(x => { +>makePromise(u).then(x => { if (f) return x; return makePromise(v).then(x => x); }) : Promise +>makePromise(u).then : (onfulfilled?: (value: awaited U) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>makePromise(u) : Promise +>makePromise : (x: T) => Promise +>u : U +>then : (onfulfilled?: (value: awaited U) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => { if (f) return x; return makePromise(v).then(x => x); } : (x: awaited U) => awaited U | Promise +>x : awaited U + + if (f) return x; +>f : boolean +>x : awaited U + + return makePromise(v).then(x => x); +>makePromise(v).then(x => x) : Promise +>makePromise(v).then : (onfulfilled?: (value: awaited V) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>makePromise(v) : Promise +>makePromise : (x: T) => Promise +>v : V +>then : (onfulfilled?: (value: awaited V) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: awaited V) => awaited V +>x : awaited V +>x : awaited V + + }); +} +f1(1, "a").then(x => x); +>f1(1, "a").then(x => x) : Promise +>f1(1, "a").then : (onfulfilled?: (value: string | number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>f1(1, "a") : Promise +>f1 : (u: U, v: V) => Promise +>1 : 1 +>"a" : "a" +>then : (onfulfilled?: (value: string | number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: string | number) => string | number +>x : string | number +>x : string | number + +f1(makePromise(1), makePromise("a")).then(x => x); +>f1(makePromise(1), makePromise("a")).then(x => x) : Promise +>f1(makePromise(1), makePromise("a")).then : (onfulfilled?: (value: string | number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>f1(makePromise(1), makePromise("a")) : Promise +>f1 : (u: U, v: V) => Promise +>makePromise(1) : Promise +>makePromise : (x: T) => Promise +>1 : 1 +>makePromise("a") : Promise +>makePromise : (x: T) => Promise +>"a" : "a" +>then : (onfulfilled?: (value: string | number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: string | number) => string | number +>x : string | number +>x : string | number + +function f2(u: U) { +>f2 : (u: U) => Promise +>u : U + + return makePromise(u).then(x => { +>makePromise(u).then(x => { if (f) return x; return Promise.reject("b"); }) : Promise +>makePromise(u).then : (onfulfilled?: (value: awaited U) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>makePromise(u) : Promise +>makePromise : (x: T) => Promise +>u : U +>then : (onfulfilled?: (value: awaited U) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => { if (f) return x; return Promise.reject("b"); } : (x: awaited U) => awaited U | Promise +>x : awaited U + + if (f) return x; +>f : boolean +>x : awaited U + + return Promise.reject("b"); +>Promise.reject("b") : Promise +>Promise.reject : (reason?: any) => Promise +>Promise : PromiseConstructor +>reject : (reason?: any) => Promise +>"b" : "b" + + }); +} +f2(1).then(x => x); +>f2(1).then(x => x) : Promise +>f2(1).then : (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>f2(1) : Promise +>f2 : (u: U) => Promise +>1 : 1 +>then : (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: number) => number +>x : number +>x : number + +f2(makePromise(1)).then(x => x); +>f2(makePromise(1)).then(x => x) : Promise +>f2(makePromise(1)).then : (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>f2(makePromise(1)) : Promise +>f2 : (u: U) => Promise +>makePromise(1) : Promise +>makePromise : (x: T) => Promise +>1 : 1 +>then : (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: number) => number +>x : number +>x : number + +function f3(u: U, v: V) { +>f3 : (u: U, v: V) => Promise +>u : U +>v : V + + return makePromise(u).catch(x => v); +>makePromise(u).catch(x => v) : Promise +>makePromise(u).catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>makePromise(u) : Promise +>makePromise : (x: T) => Promise +>u : U +>catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>x => v : (x: any) => V +>x : any +>v : V +} +f3(1, "a").then(x => x); +>f3(1, "a").then(x => x) : Promise +>f3(1, "a").then : (onfulfilled?: (value: string | number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>f3(1, "a") : Promise +>f3 : (u: U, v: V) => Promise +>1 : 1 +>"a" : "a" +>then : (onfulfilled?: (value: string | number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: string | number) => string | number +>x : string | number +>x : string | number + +f3(makePromise(1), makePromise("a")).then(x => x); +>f3(makePromise(1), makePromise("a")).then(x => x) : Promise +>f3(makePromise(1), makePromise("a")).then : (onfulfilled?: (value: string | number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>f3(makePromise(1), makePromise("a")) : Promise +>f3 : (u: U, v: V) => Promise +>makePromise(1) : Promise +>makePromise : (x: T) => Promise +>1 : 1 +>makePromise("a") : Promise +>makePromise : (x: T) => Promise +>"a" : "a" +>then : (onfulfilled?: (value: string | number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: string | number) => string | number +>x : string | number +>x : string | number + +function f4(u: U, v: V) { +>f4 : (u: U, v: V) => Promise +>u : U +>v : V + + return makePromise(u).catch(x => { +>makePromise(u).catch(x => { if (f) return v; return Promise.reject("b"); }) : Promise +>makePromise(u).catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>makePromise(u) : Promise +>makePromise : (x: T) => Promise +>u : U +>catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>x => { if (f) return v; return Promise.reject("b"); } : (x: any) => Promise | V +>x : any + + if (f) return v; +>f : boolean +>v : V + + return Promise.reject("b"); +>Promise.reject("b") : Promise +>Promise.reject : (reason?: any) => Promise +>Promise : PromiseConstructor +>reject : (reason?: any) => Promise +>"b" : "b" + + }); +} +f4(1, "a").then(x => x); +>f4(1, "a").then(x => x) : Promise +>f4(1, "a").then : (onfulfilled?: (value: string | number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>f4(1, "a") : Promise +>f4 : (u: U, v: V) => Promise +>1 : 1 +>"a" : "a" +>then : (onfulfilled?: (value: string | number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: string | number) => string | number +>x : string | number +>x : string | number + +f4(makePromise(1), makePromise("a")).then(x => x); +>f4(makePromise(1), makePromise("a")).then(x => x) : Promise +>f4(makePromise(1), makePromise("a")).then : (onfulfilled?: (value: string | number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>f4(makePromise(1), makePromise("a")) : Promise +>f4 : (u: U, v: V) => Promise +>makePromise(1) : Promise +>makePromise : (x: T) => Promise +>1 : 1 +>makePromise("a") : Promise +>makePromise : (x: T) => Promise +>"a" : "a" +>then : (onfulfilled?: (value: string | number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: string | number) => string | number +>x : string | number +>x : string | number + +async function f5(u: Promise) { +>f5 : (u: Promise) => Promise +>u : Promise + + return await u; +>await u : awaited U +>u : Promise +} +f5(makePromise(1)).then(x => x); +>f5(makePromise(1)).then(x => x) : Promise +>f5(makePromise(1)).then : (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>f5(makePromise(1)) : Promise +>f5 : (u: Promise) => Promise +>makePromise(1) : Promise +>makePromise : (x: T) => Promise +>1 : 1 +>then : (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: number) => number +>x : number +>x : number + +f5(makePromise(makePromise(1))).then(x => x); +>f5(makePromise(makePromise(1))).then(x => x) : Promise +>f5(makePromise(makePromise(1))).then : , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>f5(makePromise(makePromise(1))) : Promise> +>f5 : (u: Promise) => Promise +>makePromise(makePromise(1)) : Promise> +>makePromise : (x: T) => Promise +>makePromise(1) : Promise +>makePromise : (x: T) => Promise +>1 : 1 +>then : , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: number) => number +>x : number +>x : number + +async function f6(u: Promise>) { +>f6 : (u: Promise>) => Promise +>u : Promise> + + return await u; +>await u : awaited U +>u : Promise> +} + +// assignability +let v0: number; +>v0 : number + +let v1: awaited number; +>v1 : number + +let v2: awaited Promise; +>v2 : number + +v0 = v1; +>v0 = v1 : number +>v0 : number +>v1 : number + +v0 = v2; +>v0 = v2 : number +>v0 : number +>v2 : number + +v1 = v0; +>v1 = v0 : number +>v1 : number +>v0 : number + +v1 = v2; +>v1 = v2 : number +>v1 : number +>v2 : number + +v2 = v0; +>v2 = v0 : number +>v2 : number +>v0 : number + +v2 = v1; +>v2 = v1 : number +>v2 : number +>v1 : number + +function f7() { +>f7 : () => void + + let v0: awaited U; +>v0 : awaited U + + let v1: awaited Promise; +>v1 : awaited U + + v0 = v1; +>v0 = v1 : awaited U +>v0 : awaited U +>v1 : awaited U + + v1 = v0; +>v1 = v0 : awaited U +>v1 : awaited U +>v0 : awaited U +} + +async function f8() { +>f8 : () => Promise + + let pu: Promise; +>pu : Promise + + let v0: awaited U; +>v0 : awaited U + + let v1: awaited Promise; +>v1 : awaited U + + v0 = await pu; +>v0 = await pu : awaited U +>v0 : awaited U +>await pu : awaited U +>pu : Promise + + v1 = await pu; +>v1 = await pu : awaited U +>v1 : awaited U +>await pu : awaited U +>pu : Promise +} diff --git a/tests/baselines/reference/awaitedInference.js b/tests/baselines/reference/awaitedInference.js new file mode 100644 index 0000000000000..8c2fe01afb252 --- /dev/null +++ b/tests/baselines/reference/awaitedInference.js @@ -0,0 +1,64 @@ +//// [awaitedInference.ts] +declare function foo(f: () => PromiseLike, x: T): void; +declare const nullOrNumber: number | null; +foo(async () => nullOrNumber, null); + +type UnwrapAwaited = T extends awaited infer Inner ? Inner : T; +type Result1 = UnwrapAwaited>; // number +type Result2 = UnwrapAwaited | number>; // number +function f() { + type Result1 = UnwrapAwaited; // UnwrapAwaited + type Result2 = UnwrapAwaited; // UnwrapAwaited + return null as any as [Result1, Result2]; +} +const x = f(); // number +const y = f>(); // number ? +const z = f | number>(); // number ? + +//// [awaitedInference.js] +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var _this = this; +foo(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2 /*return*/, nullOrNumber]; +}); }); }, null); +function f() { + return null; +} +var x = f(); // number +var y = f(); // number ? +var z = f(); // number ? diff --git a/tests/baselines/reference/awaitedInference.symbols b/tests/baselines/reference/awaitedInference.symbols new file mode 100644 index 0000000000000..82afccc34742f --- /dev/null +++ b/tests/baselines/reference/awaitedInference.symbols @@ -0,0 +1,67 @@ +=== tests/cases/conformance/types/awaited/awaitedInference.ts === +declare function foo(f: () => PromiseLike, x: T): void; +>foo : Symbol(foo, Decl(awaitedInference.ts, 0, 0)) +>T : Symbol(T, Decl(awaitedInference.ts, 0, 21)) +>f : Symbol(f, Decl(awaitedInference.ts, 0, 24)) +>PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(awaitedInference.ts, 0, 21)) +>x : Symbol(x, Decl(awaitedInference.ts, 0, 48)) +>T : Symbol(T, Decl(awaitedInference.ts, 0, 21)) + +declare const nullOrNumber: number | null; +>nullOrNumber : Symbol(nullOrNumber, Decl(awaitedInference.ts, 1, 13)) + +foo(async () => nullOrNumber, null); +>foo : Symbol(foo, Decl(awaitedInference.ts, 0, 0)) +>nullOrNumber : Symbol(nullOrNumber, Decl(awaitedInference.ts, 1, 13)) + +type UnwrapAwaited = T extends awaited infer Inner ? Inner : T; +>UnwrapAwaited : Symbol(UnwrapAwaited, Decl(awaitedInference.ts, 2, 36)) +>T : Symbol(T, Decl(awaitedInference.ts, 4, 19)) +>T : Symbol(T, Decl(awaitedInference.ts, 4, 19)) +>Inner : Symbol(Inner, Decl(awaitedInference.ts, 4, 47)) +>Inner : Symbol(Inner, Decl(awaitedInference.ts, 4, 47)) +>T : Symbol(T, Decl(awaitedInference.ts, 4, 19)) + +type Result1 = UnwrapAwaited>; // number +>Result1 : Symbol(Result1, Decl(awaitedInference.ts, 4, 66)) +>UnwrapAwaited : Symbol(UnwrapAwaited, Decl(awaitedInference.ts, 2, 36)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --)) + +type Result2 = UnwrapAwaited | number>; // number +>Result2 : Symbol(Result2, Decl(awaitedInference.ts, 5, 54)) +>UnwrapAwaited : Symbol(UnwrapAwaited, Decl(awaitedInference.ts, 2, 36)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --)) + +function f() { +>f : Symbol(f, Decl(awaitedInference.ts, 6, 63)) +>T : Symbol(T, Decl(awaitedInference.ts, 7, 11)) + + type Result1 = UnwrapAwaited; // UnwrapAwaited +>Result1 : Symbol(Result1, Decl(awaitedInference.ts, 7, 17)) +>UnwrapAwaited : Symbol(UnwrapAwaited, Decl(awaitedInference.ts, 2, 36)) +>T : Symbol(T, Decl(awaitedInference.ts, 7, 11)) + + type Result2 = UnwrapAwaited; // UnwrapAwaited +>Result2 : Symbol(Result2, Decl(awaitedInference.ts, 8, 36)) +>UnwrapAwaited : Symbol(UnwrapAwaited, Decl(awaitedInference.ts, 2, 36)) +>T : Symbol(T, Decl(awaitedInference.ts, 7, 11)) + + return null as any as [Result1, Result2]; +>Result1 : Symbol(Result1, Decl(awaitedInference.ts, 7, 17)) +>Result2 : Symbol(Result2, Decl(awaitedInference.ts, 8, 36)) +} +const x = f(); // number +>x : Symbol(x, Decl(awaitedInference.ts, 12, 5)) +>f : Symbol(f, Decl(awaitedInference.ts, 6, 63)) + +const y = f>(); // number ? +>y : Symbol(y, Decl(awaitedInference.ts, 13, 5)) +>f : Symbol(f, Decl(awaitedInference.ts, 6, 63)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --)) + +const z = f | number>(); // number ? +>z : Symbol(z, Decl(awaitedInference.ts, 14, 5)) +>f : Symbol(f, Decl(awaitedInference.ts, 6, 63)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --)) + diff --git a/tests/baselines/reference/awaitedInference.types b/tests/baselines/reference/awaitedInference.types new file mode 100644 index 0000000000000..91e7c43134e94 --- /dev/null +++ b/tests/baselines/reference/awaitedInference.types @@ -0,0 +1,55 @@ +=== tests/cases/conformance/types/awaited/awaitedInference.ts === +declare function foo(f: () => PromiseLike, x: T): void; +>foo : (f: () => PromiseLike, x: T) => void +>f : () => PromiseLike +>x : T + +declare const nullOrNumber: number | null; +>nullOrNumber : number +>null : null + +foo(async () => nullOrNumber, null); +>foo(async () => nullOrNumber, null) : void +>foo : (f: () => PromiseLike, x: T) => void +>async () => nullOrNumber : () => Promise +>nullOrNumber : number +>null : null + +type UnwrapAwaited = T extends awaited infer Inner ? Inner : T; +>UnwrapAwaited : UnwrapAwaited + +type Result1 = UnwrapAwaited>; // number +>Result1 : number + +type Result2 = UnwrapAwaited | number>; // number +>Result2 : number + +function f() { +>f : () => [UnwrapAwaited, UnwrapAwaited] + + type Result1 = UnwrapAwaited; // UnwrapAwaited +>Result1 : UnwrapAwaited + + type Result2 = UnwrapAwaited; // UnwrapAwaited +>Result2 : UnwrapAwaited + + return null as any as [Result1, Result2]; +>null as any as [Result1, Result2] : [UnwrapAwaited, UnwrapAwaited] +>null as any : any +>null : null +} +const x = f(); // number +>x : [number, number] +>f() : [number, number] +>f : () => [UnwrapAwaited, UnwrapAwaited] + +const y = f>(); // number ? +>y : [Promise, number] +>f>() : [Promise, number] +>f : () => [UnwrapAwaited, UnwrapAwaited] + +const z = f | number>(); // number ? +>z : [number | Promise, number] +>f | number>() : [number | Promise, number] +>f : () => [UnwrapAwaited, UnwrapAwaited] + diff --git a/tests/baselines/reference/awaitedVariance.errors.txt b/tests/baselines/reference/awaitedVariance.errors.txt new file mode 100644 index 0000000000000..694ca4c62f96a --- /dev/null +++ b/tests/baselines/reference/awaitedVariance.errors.txt @@ -0,0 +1,140 @@ +tests/cases/conformance/types/awaited/awaitedVariance.ts(74,1): error TS2322: Type 'C>' is not assignable to type 'C'. + Types of property 'x' are incompatible. + Type 'number' is not assignable to type '{ _tag: string; } & number'. + Type 'number' is not assignable to type '{ _tag: string; }'. +tests/cases/conformance/types/awaited/awaitedVariance.ts(84,1): error TS2322: Type 'D>' is not assignable to type 'D'. + Types of property 'a' are incompatible. + Type 'C>' is not assignable to type 'C'. + + +==== tests/cases/conformance/types/awaited/awaitedVariance.ts (2 errors) ==== + declare let p0: Promise; + declare let p1: Promise>; + declare let p2: Promise; + p0 = p1; + p0 = p2; + p1 = p0; + p1 = p2; + p2 = p0; + p2 = p1; + + function fn1(p0: Promise, p1: Promise>, p2: Promise) { + p0 = p1; + p0 = p2; + p1 = p0; + p1 = p2; + p2 = p0; + p2 = p1; + } + + declare let pl0: PromiseLike; + declare let pl1: PromiseLike>; + declare let pl2: PromiseLike; + pl0 = pl1; + pl0 = pl2; + pl1 = pl0; + pl1 = pl2; + pl2 = pl0; + pl2 = pl1; + + function fn2(pl0: PromiseLike, pl1: PromiseLike>, pl2: PromiseLike) { + pl0 = pl1; + pl0 = pl2; + pl1 = pl0; + pl1 = pl2; + pl2 = pl0; + pl2 = pl1; + } + + pl0 = p0; + pl0 = p1; + pl0 = p2; + pl1 = p0; + pl1 = p1; + pl1 = p2; + pl2 = p0; + pl2 = p1; + pl2 = p2; + + interface A { + x: awaited T; + } + + declare let a1: A; + declare let a2: A>; + a1 = a2; + a2 = a1; + + interface B { + a: A; + } + + declare let b1: B; + declare let b2: B>; + b1 = b2; + b2 = b1; + + interface C { + x: awaited ({_tag: string} & T); + } + + declare let c1: C; + declare let c2: C>; + // Not assignable since `awaited ({_tag: string} & Promise)` is `number`, which isn't assignable to `({_tag: string} & number)`. + c1 = c2; + ~~ +!!! error TS2322: Type 'C>' is not assignable to type 'C'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type '{ _tag: string; } & number'. +!!! error TS2322: Type 'number' is not assignable to type '{ _tag: string; }'. + c2 = c1; + + interface D { + a: C; + } + + declare let d1: D; + declare let d2: D>; + // Not assignable since `awaited ({_tag: string} & Promise)` is `number`, which isn't assignable to `({_tag: string} & number)`. + d1 = d2; + ~~ +!!! error TS2322: Type 'D>' is not assignable to type 'D'. +!!! error TS2322: Types of property 'a' are incompatible. +!!! error TS2322: Type 'C>' is not assignable to type 'C'. + d2 = d1; + + interface E { + x: awaited (T | {otherOption: string}); + } + + declare let e1: E; + declare let e2: E>; + e1 = e2; + e2 = e1; + + interface F { + a: E; + } + + declare let f1: F; + declare let f2: F>; + f1 = f2; + f2 = f1; + + interface G { + x: awaited T[K]; + } + + declare let g1: G<{x: number}, "x">; + declare let g2: G<{x: Promise}, "x">; + g1 = g2; + g2 = g1; + + interface H { + a: G; + } + + declare let h1: H<{x: number}, "x">; + declare let h2: H<{x: Promise}, "x">; + h1 = h2; + h2 = h1; \ No newline at end of file diff --git a/tests/baselines/reference/awaitedVariance.js b/tests/baselines/reference/awaitedVariance.js new file mode 100644 index 0000000000000..1edaf909e67b2 --- /dev/null +++ b/tests/baselines/reference/awaitedVariance.js @@ -0,0 +1,179 @@ +//// [awaitedVariance.ts] +declare let p0: Promise; +declare let p1: Promise>; +declare let p2: Promise; +p0 = p1; +p0 = p2; +p1 = p0; +p1 = p2; +p2 = p0; +p2 = p1; + +function fn1(p0: Promise, p1: Promise>, p2: Promise) { + p0 = p1; + p0 = p2; + p1 = p0; + p1 = p2; + p2 = p0; + p2 = p1; +} + +declare let pl0: PromiseLike; +declare let pl1: PromiseLike>; +declare let pl2: PromiseLike; +pl0 = pl1; +pl0 = pl2; +pl1 = pl0; +pl1 = pl2; +pl2 = pl0; +pl2 = pl1; + +function fn2(pl0: PromiseLike, pl1: PromiseLike>, pl2: PromiseLike) { + pl0 = pl1; + pl0 = pl2; + pl1 = pl0; + pl1 = pl2; + pl2 = pl0; + pl2 = pl1; +} + +pl0 = p0; +pl0 = p1; +pl0 = p2; +pl1 = p0; +pl1 = p1; +pl1 = p2; +pl2 = p0; +pl2 = p1; +pl2 = p2; + +interface A { + x: awaited T; +} + +declare let a1: A; +declare let a2: A>; +a1 = a2; +a2 = a1; + +interface B { + a: A; +} + +declare let b1: B; +declare let b2: B>; +b1 = b2; +b2 = b1; + +interface C { + x: awaited ({_tag: string} & T); +} + +declare let c1: C; +declare let c2: C>; +// Not assignable since `awaited ({_tag: string} & Promise)` is `number`, which isn't assignable to `({_tag: string} & number)`. +c1 = c2; +c2 = c1; + +interface D { + a: C; +} + +declare let d1: D; +declare let d2: D>; +// Not assignable since `awaited ({_tag: string} & Promise)` is `number`, which isn't assignable to `({_tag: string} & number)`. +d1 = d2; +d2 = d1; + +interface E { + x: awaited (T | {otherOption: string}); +} + +declare let e1: E; +declare let e2: E>; +e1 = e2; +e2 = e1; + +interface F { + a: E; +} + +declare let f1: F; +declare let f2: F>; +f1 = f2; +f2 = f1; + +interface G { + x: awaited T[K]; +} + +declare let g1: G<{x: number}, "x">; +declare let g2: G<{x: Promise}, "x">; +g1 = g2; +g2 = g1; + +interface H { + a: G; +} + +declare let h1: H<{x: number}, "x">; +declare let h2: H<{x: Promise}, "x">; +h1 = h2; +h2 = h1; + +//// [awaitedVariance.js] +p0 = p1; +p0 = p2; +p1 = p0; +p1 = p2; +p2 = p0; +p2 = p1; +function fn1(p0, p1, p2) { + p0 = p1; + p0 = p2; + p1 = p0; + p1 = p2; + p2 = p0; + p2 = p1; +} +pl0 = pl1; +pl0 = pl2; +pl1 = pl0; +pl1 = pl2; +pl2 = pl0; +pl2 = pl1; +function fn2(pl0, pl1, pl2) { + pl0 = pl1; + pl0 = pl2; + pl1 = pl0; + pl1 = pl2; + pl2 = pl0; + pl2 = pl1; +} +pl0 = p0; +pl0 = p1; +pl0 = p2; +pl1 = p0; +pl1 = p1; +pl1 = p2; +pl2 = p0; +pl2 = p1; +pl2 = p2; +a1 = a2; +a2 = a1; +b1 = b2; +b2 = b1; +// Not assignable since `awaited ({_tag: string} & Promise)` is `number`, which isn't assignable to `({_tag: string} & number)`. +c1 = c2; +c2 = c1; +// Not assignable since `awaited ({_tag: string} & Promise)` is `number`, which isn't assignable to `({_tag: string} & number)`. +d1 = d2; +d2 = d1; +e1 = e2; +e2 = e1; +f1 = f2; +f2 = f1; +g1 = g2; +g2 = g1; +h1 = h2; +h2 = h1; diff --git a/tests/baselines/reference/awaitedVariance.symbols b/tests/baselines/reference/awaitedVariance.symbols new file mode 100644 index 0000000000000..521dc557ad0e3 --- /dev/null +++ b/tests/baselines/reference/awaitedVariance.symbols @@ -0,0 +1,415 @@ +=== tests/cases/conformance/types/awaited/awaitedVariance.ts === +declare let p0: Promise; +>p0 : Symbol(p0, Decl(awaitedVariance.ts, 0, 11)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +declare let p1: Promise>; +>p1 : Symbol(p1, Decl(awaitedVariance.ts, 1, 11)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +declare let p2: Promise; +>p2 : Symbol(p2, Decl(awaitedVariance.ts, 2, 11)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +p0 = p1; +>p0 : Symbol(p0, Decl(awaitedVariance.ts, 0, 11)) +>p1 : Symbol(p1, Decl(awaitedVariance.ts, 1, 11)) + +p0 = p2; +>p0 : Symbol(p0, Decl(awaitedVariance.ts, 0, 11)) +>p2 : Symbol(p2, Decl(awaitedVariance.ts, 2, 11)) + +p1 = p0; +>p1 : Symbol(p1, Decl(awaitedVariance.ts, 1, 11)) +>p0 : Symbol(p0, Decl(awaitedVariance.ts, 0, 11)) + +p1 = p2; +>p1 : Symbol(p1, Decl(awaitedVariance.ts, 1, 11)) +>p2 : Symbol(p2, Decl(awaitedVariance.ts, 2, 11)) + +p2 = p0; +>p2 : Symbol(p2, Decl(awaitedVariance.ts, 2, 11)) +>p0 : Symbol(p0, Decl(awaitedVariance.ts, 0, 11)) + +p2 = p1; +>p2 : Symbol(p2, Decl(awaitedVariance.ts, 2, 11)) +>p1 : Symbol(p1, Decl(awaitedVariance.ts, 1, 11)) + +function fn1(p0: Promise, p1: Promise>, p2: Promise) { +>fn1 : Symbol(fn1, Decl(awaitedVariance.ts, 8, 8)) +>T : Symbol(T, Decl(awaitedVariance.ts, 10, 13)) +>p0 : Symbol(p0, Decl(awaitedVariance.ts, 10, 16)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>T : Symbol(T, Decl(awaitedVariance.ts, 10, 13)) +>p1 : Symbol(p1, Decl(awaitedVariance.ts, 10, 31)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>T : Symbol(T, Decl(awaitedVariance.ts, 10, 13)) +>p2 : Symbol(p2, Decl(awaitedVariance.ts, 10, 56)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>T : Symbol(T, Decl(awaitedVariance.ts, 10, 13)) + + p0 = p1; +>p0 : Symbol(p0, Decl(awaitedVariance.ts, 10, 16)) +>p1 : Symbol(p1, Decl(awaitedVariance.ts, 10, 31)) + + p0 = p2; +>p0 : Symbol(p0, Decl(awaitedVariance.ts, 10, 16)) +>p2 : Symbol(p2, Decl(awaitedVariance.ts, 10, 56)) + + p1 = p0; +>p1 : Symbol(p1, Decl(awaitedVariance.ts, 10, 31)) +>p0 : Symbol(p0, Decl(awaitedVariance.ts, 10, 16)) + + p1 = p2; +>p1 : Symbol(p1, Decl(awaitedVariance.ts, 10, 31)) +>p2 : Symbol(p2, Decl(awaitedVariance.ts, 10, 56)) + + p2 = p0; +>p2 : Symbol(p2, Decl(awaitedVariance.ts, 10, 56)) +>p0 : Symbol(p0, Decl(awaitedVariance.ts, 10, 16)) + + p2 = p1; +>p2 : Symbol(p2, Decl(awaitedVariance.ts, 10, 56)) +>p1 : Symbol(p1, Decl(awaitedVariance.ts, 10, 31)) +} + +declare let pl0: PromiseLike; +>pl0 : Symbol(pl0, Decl(awaitedVariance.ts, 19, 11)) +>PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --)) + +declare let pl1: PromiseLike>; +>pl1 : Symbol(pl1, Decl(awaitedVariance.ts, 20, 11)) +>PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --)) +>PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --)) + +declare let pl2: PromiseLike; +>pl2 : Symbol(pl2, Decl(awaitedVariance.ts, 21, 11)) +>PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --)) + +pl0 = pl1; +>pl0 : Symbol(pl0, Decl(awaitedVariance.ts, 19, 11)) +>pl1 : Symbol(pl1, Decl(awaitedVariance.ts, 20, 11)) + +pl0 = pl2; +>pl0 : Symbol(pl0, Decl(awaitedVariance.ts, 19, 11)) +>pl2 : Symbol(pl2, Decl(awaitedVariance.ts, 21, 11)) + +pl1 = pl0; +>pl1 : Symbol(pl1, Decl(awaitedVariance.ts, 20, 11)) +>pl0 : Symbol(pl0, Decl(awaitedVariance.ts, 19, 11)) + +pl1 = pl2; +>pl1 : Symbol(pl1, Decl(awaitedVariance.ts, 20, 11)) +>pl2 : Symbol(pl2, Decl(awaitedVariance.ts, 21, 11)) + +pl2 = pl0; +>pl2 : Symbol(pl2, Decl(awaitedVariance.ts, 21, 11)) +>pl0 : Symbol(pl0, Decl(awaitedVariance.ts, 19, 11)) + +pl2 = pl1; +>pl2 : Symbol(pl2, Decl(awaitedVariance.ts, 21, 11)) +>pl1 : Symbol(pl1, Decl(awaitedVariance.ts, 20, 11)) + +function fn2(pl0: PromiseLike, pl1: PromiseLike>, pl2: PromiseLike) { +>fn2 : Symbol(fn2, Decl(awaitedVariance.ts, 27, 10)) +>T : Symbol(T, Decl(awaitedVariance.ts, 29, 13)) +>pl0 : Symbol(pl0, Decl(awaitedVariance.ts, 29, 16)) +>PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(awaitedVariance.ts, 29, 13)) +>pl1 : Symbol(pl1, Decl(awaitedVariance.ts, 29, 36)) +>PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --)) +>PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(awaitedVariance.ts, 29, 13)) +>pl2 : Symbol(pl2, Decl(awaitedVariance.ts, 29, 70)) +>PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(awaitedVariance.ts, 29, 13)) + + pl0 = pl1; +>pl0 : Symbol(pl0, Decl(awaitedVariance.ts, 29, 16)) +>pl1 : Symbol(pl1, Decl(awaitedVariance.ts, 29, 36)) + + pl0 = pl2; +>pl0 : Symbol(pl0, Decl(awaitedVariance.ts, 29, 16)) +>pl2 : Symbol(pl2, Decl(awaitedVariance.ts, 29, 70)) + + pl1 = pl0; +>pl1 : Symbol(pl1, Decl(awaitedVariance.ts, 29, 36)) +>pl0 : Symbol(pl0, Decl(awaitedVariance.ts, 29, 16)) + + pl1 = pl2; +>pl1 : Symbol(pl1, Decl(awaitedVariance.ts, 29, 36)) +>pl2 : Symbol(pl2, Decl(awaitedVariance.ts, 29, 70)) + + pl2 = pl0; +>pl2 : Symbol(pl2, Decl(awaitedVariance.ts, 29, 70)) +>pl0 : Symbol(pl0, Decl(awaitedVariance.ts, 29, 16)) + + pl2 = pl1; +>pl2 : Symbol(pl2, Decl(awaitedVariance.ts, 29, 70)) +>pl1 : Symbol(pl1, Decl(awaitedVariance.ts, 29, 36)) +} + +pl0 = p0; +>pl0 : Symbol(pl0, Decl(awaitedVariance.ts, 19, 11)) +>p0 : Symbol(p0, Decl(awaitedVariance.ts, 0, 11)) + +pl0 = p1; +>pl0 : Symbol(pl0, Decl(awaitedVariance.ts, 19, 11)) +>p1 : Symbol(p1, Decl(awaitedVariance.ts, 1, 11)) + +pl0 = p2; +>pl0 : Symbol(pl0, Decl(awaitedVariance.ts, 19, 11)) +>p2 : Symbol(p2, Decl(awaitedVariance.ts, 2, 11)) + +pl1 = p0; +>pl1 : Symbol(pl1, Decl(awaitedVariance.ts, 20, 11)) +>p0 : Symbol(p0, Decl(awaitedVariance.ts, 0, 11)) + +pl1 = p1; +>pl1 : Symbol(pl1, Decl(awaitedVariance.ts, 20, 11)) +>p1 : Symbol(p1, Decl(awaitedVariance.ts, 1, 11)) + +pl1 = p2; +>pl1 : Symbol(pl1, Decl(awaitedVariance.ts, 20, 11)) +>p2 : Symbol(p2, Decl(awaitedVariance.ts, 2, 11)) + +pl2 = p0; +>pl2 : Symbol(pl2, Decl(awaitedVariance.ts, 21, 11)) +>p0 : Symbol(p0, Decl(awaitedVariance.ts, 0, 11)) + +pl2 = p1; +>pl2 : Symbol(pl2, Decl(awaitedVariance.ts, 21, 11)) +>p1 : Symbol(p1, Decl(awaitedVariance.ts, 1, 11)) + +pl2 = p2; +>pl2 : Symbol(pl2, Decl(awaitedVariance.ts, 21, 11)) +>p2 : Symbol(p2, Decl(awaitedVariance.ts, 2, 11)) + +interface A { +>A : Symbol(A, Decl(awaitedVariance.ts, 46, 9)) +>T : Symbol(T, Decl(awaitedVariance.ts, 48, 12)) + + x: awaited T; +>x : Symbol(A.x, Decl(awaitedVariance.ts, 48, 16)) +>T : Symbol(T, Decl(awaitedVariance.ts, 48, 12)) +} + +declare let a1: A; +>a1 : Symbol(a1, Decl(awaitedVariance.ts, 52, 11)) +>A : Symbol(A, Decl(awaitedVariance.ts, 46, 9)) + +declare let a2: A>; +>a2 : Symbol(a2, Decl(awaitedVariance.ts, 53, 11)) +>A : Symbol(A, Decl(awaitedVariance.ts, 46, 9)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +a1 = a2; +>a1 : Symbol(a1, Decl(awaitedVariance.ts, 52, 11)) +>a2 : Symbol(a2, Decl(awaitedVariance.ts, 53, 11)) + +a2 = a1; +>a2 : Symbol(a2, Decl(awaitedVariance.ts, 53, 11)) +>a1 : Symbol(a1, Decl(awaitedVariance.ts, 52, 11)) + +interface B { +>B : Symbol(B, Decl(awaitedVariance.ts, 55, 8)) +>T : Symbol(T, Decl(awaitedVariance.ts, 57, 12)) + + a: A; +>a : Symbol(B.a, Decl(awaitedVariance.ts, 57, 16)) +>A : Symbol(A, Decl(awaitedVariance.ts, 46, 9)) +>T : Symbol(T, Decl(awaitedVariance.ts, 57, 12)) +} + +declare let b1: B; +>b1 : Symbol(b1, Decl(awaitedVariance.ts, 61, 11)) +>B : Symbol(B, Decl(awaitedVariance.ts, 55, 8)) + +declare let b2: B>; +>b2 : Symbol(b2, Decl(awaitedVariance.ts, 62, 11)) +>B : Symbol(B, Decl(awaitedVariance.ts, 55, 8)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +b1 = b2; +>b1 : Symbol(b1, Decl(awaitedVariance.ts, 61, 11)) +>b2 : Symbol(b2, Decl(awaitedVariance.ts, 62, 11)) + +b2 = b1; +>b2 : Symbol(b2, Decl(awaitedVariance.ts, 62, 11)) +>b1 : Symbol(b1, Decl(awaitedVariance.ts, 61, 11)) + +interface C { +>C : Symbol(C, Decl(awaitedVariance.ts, 64, 8)) +>T : Symbol(T, Decl(awaitedVariance.ts, 66, 12)) + + x: awaited ({_tag: string} & T); +>x : Symbol(C.x, Decl(awaitedVariance.ts, 66, 16)) +>_tag : Symbol(_tag, Decl(awaitedVariance.ts, 67, 17)) +>T : Symbol(T, Decl(awaitedVariance.ts, 66, 12)) +} + +declare let c1: C; +>c1 : Symbol(c1, Decl(awaitedVariance.ts, 70, 11)) +>C : Symbol(C, Decl(awaitedVariance.ts, 64, 8)) + +declare let c2: C>; +>c2 : Symbol(c2, Decl(awaitedVariance.ts, 71, 11)) +>C : Symbol(C, Decl(awaitedVariance.ts, 64, 8)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +// Not assignable since `awaited ({_tag: string} & Promise)` is `number`, which isn't assignable to `({_tag: string} & number)`. +c1 = c2; +>c1 : Symbol(c1, Decl(awaitedVariance.ts, 70, 11)) +>c2 : Symbol(c2, Decl(awaitedVariance.ts, 71, 11)) + +c2 = c1; +>c2 : Symbol(c2, Decl(awaitedVariance.ts, 71, 11)) +>c1 : Symbol(c1, Decl(awaitedVariance.ts, 70, 11)) + +interface D { +>D : Symbol(D, Decl(awaitedVariance.ts, 74, 8)) +>T : Symbol(T, Decl(awaitedVariance.ts, 76, 12)) + + a: C; +>a : Symbol(D.a, Decl(awaitedVariance.ts, 76, 16)) +>C : Symbol(C, Decl(awaitedVariance.ts, 64, 8)) +>T : Symbol(T, Decl(awaitedVariance.ts, 76, 12)) +} + +declare let d1: D; +>d1 : Symbol(d1, Decl(awaitedVariance.ts, 80, 11)) +>D : Symbol(D, Decl(awaitedVariance.ts, 74, 8)) + +declare let d2: D>; +>d2 : Symbol(d2, Decl(awaitedVariance.ts, 81, 11)) +>D : Symbol(D, Decl(awaitedVariance.ts, 74, 8)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +// Not assignable since `awaited ({_tag: string} & Promise)` is `number`, which isn't assignable to `({_tag: string} & number)`. +d1 = d2; +>d1 : Symbol(d1, Decl(awaitedVariance.ts, 80, 11)) +>d2 : Symbol(d2, Decl(awaitedVariance.ts, 81, 11)) + +d2 = d1; +>d2 : Symbol(d2, Decl(awaitedVariance.ts, 81, 11)) +>d1 : Symbol(d1, Decl(awaitedVariance.ts, 80, 11)) + +interface E { +>E : Symbol(E, Decl(awaitedVariance.ts, 84, 8)) +>T : Symbol(T, Decl(awaitedVariance.ts, 86, 12)) + + x: awaited (T | {otherOption: string}); +>x : Symbol(E.x, Decl(awaitedVariance.ts, 86, 16)) +>T : Symbol(T, Decl(awaitedVariance.ts, 86, 12)) +>otherOption : Symbol(otherOption, Decl(awaitedVariance.ts, 87, 21)) +} + +declare let e1: E; +>e1 : Symbol(e1, Decl(awaitedVariance.ts, 90, 11)) +>E : Symbol(E, Decl(awaitedVariance.ts, 84, 8)) + +declare let e2: E>; +>e2 : Symbol(e2, Decl(awaitedVariance.ts, 91, 11)) +>E : Symbol(E, Decl(awaitedVariance.ts, 84, 8)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +e1 = e2; +>e1 : Symbol(e1, Decl(awaitedVariance.ts, 90, 11)) +>e2 : Symbol(e2, Decl(awaitedVariance.ts, 91, 11)) + +e2 = e1; +>e2 : Symbol(e2, Decl(awaitedVariance.ts, 91, 11)) +>e1 : Symbol(e1, Decl(awaitedVariance.ts, 90, 11)) + +interface F { +>F : Symbol(F, Decl(awaitedVariance.ts, 93, 8)) +>T : Symbol(T, Decl(awaitedVariance.ts, 95, 12)) + + a: E; +>a : Symbol(F.a, Decl(awaitedVariance.ts, 95, 16)) +>E : Symbol(E, Decl(awaitedVariance.ts, 84, 8)) +>T : Symbol(T, Decl(awaitedVariance.ts, 95, 12)) +} + +declare let f1: F; +>f1 : Symbol(f1, Decl(awaitedVariance.ts, 99, 11)) +>F : Symbol(F, Decl(awaitedVariance.ts, 93, 8)) + +declare let f2: F>; +>f2 : Symbol(f2, Decl(awaitedVariance.ts, 100, 11)) +>F : Symbol(F, Decl(awaitedVariance.ts, 93, 8)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +f1 = f2; +>f1 : Symbol(f1, Decl(awaitedVariance.ts, 99, 11)) +>f2 : Symbol(f2, Decl(awaitedVariance.ts, 100, 11)) + +f2 = f1; +>f2 : Symbol(f2, Decl(awaitedVariance.ts, 100, 11)) +>f1 : Symbol(f1, Decl(awaitedVariance.ts, 99, 11)) + +interface G { +>G : Symbol(G, Decl(awaitedVariance.ts, 102, 8)) +>T : Symbol(T, Decl(awaitedVariance.ts, 104, 12)) +>K : Symbol(K, Decl(awaitedVariance.ts, 104, 14)) +>T : Symbol(T, Decl(awaitedVariance.ts, 104, 12)) + + x: awaited T[K]; +>x : Symbol(G.x, Decl(awaitedVariance.ts, 104, 35)) +>T : Symbol(T, Decl(awaitedVariance.ts, 104, 12)) +>K : Symbol(K, Decl(awaitedVariance.ts, 104, 14)) +} + +declare let g1: G<{x: number}, "x">; +>g1 : Symbol(g1, Decl(awaitedVariance.ts, 108, 11)) +>G : Symbol(G, Decl(awaitedVariance.ts, 102, 8)) +>x : Symbol(x, Decl(awaitedVariance.ts, 108, 19)) + +declare let g2: G<{x: Promise}, "x">; +>g2 : Symbol(g2, Decl(awaitedVariance.ts, 109, 11)) +>G : Symbol(G, Decl(awaitedVariance.ts, 102, 8)) +>x : Symbol(x, Decl(awaitedVariance.ts, 109, 19)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +g1 = g2; +>g1 : Symbol(g1, Decl(awaitedVariance.ts, 108, 11)) +>g2 : Symbol(g2, Decl(awaitedVariance.ts, 109, 11)) + +g2 = g1; +>g2 : Symbol(g2, Decl(awaitedVariance.ts, 109, 11)) +>g1 : Symbol(g1, Decl(awaitedVariance.ts, 108, 11)) + +interface H { +>H : Symbol(H, Decl(awaitedVariance.ts, 111, 8)) +>T : Symbol(T, Decl(awaitedVariance.ts, 113, 12)) +>K : Symbol(K, Decl(awaitedVariance.ts, 113, 14)) +>T : Symbol(T, Decl(awaitedVariance.ts, 113, 12)) + + a: G; +>a : Symbol(H.a, Decl(awaitedVariance.ts, 113, 35)) +>G : Symbol(G, Decl(awaitedVariance.ts, 102, 8)) +>T : Symbol(T, Decl(awaitedVariance.ts, 113, 12)) +>K : Symbol(K, Decl(awaitedVariance.ts, 113, 14)) +} + +declare let h1: H<{x: number}, "x">; +>h1 : Symbol(h1, Decl(awaitedVariance.ts, 117, 11)) +>H : Symbol(H, Decl(awaitedVariance.ts, 111, 8)) +>x : Symbol(x, Decl(awaitedVariance.ts, 117, 19)) + +declare let h2: H<{x: Promise}, "x">; +>h2 : Symbol(h2, Decl(awaitedVariance.ts, 118, 11)) +>H : Symbol(H, Decl(awaitedVariance.ts, 111, 8)) +>x : Symbol(x, Decl(awaitedVariance.ts, 118, 19)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +h1 = h2; +>h1 : Symbol(h1, Decl(awaitedVariance.ts, 117, 11)) +>h2 : Symbol(h2, Decl(awaitedVariance.ts, 118, 11)) + +h2 = h1; +>h2 : Symbol(h2, Decl(awaitedVariance.ts, 118, 11)) +>h1 : Symbol(h1, Decl(awaitedVariance.ts, 117, 11)) + diff --git a/tests/baselines/reference/awaitedVariance.types b/tests/baselines/reference/awaitedVariance.types new file mode 100644 index 0000000000000..a063fb380caa0 --- /dev/null +++ b/tests/baselines/reference/awaitedVariance.types @@ -0,0 +1,374 @@ +=== tests/cases/conformance/types/awaited/awaitedVariance.ts === +declare let p0: Promise; +>p0 : Promise + +declare let p1: Promise>; +>p1 : Promise> + +declare let p2: Promise; +>p2 : Promise + +p0 = p1; +>p0 = p1 : Promise> +>p0 : Promise +>p1 : Promise> + +p0 = p2; +>p0 = p2 : Promise +>p0 : Promise +>p2 : Promise + +p1 = p0; +>p1 = p0 : Promise +>p1 : Promise> +>p0 : Promise + +p1 = p2; +>p1 = p2 : Promise +>p1 : Promise> +>p2 : Promise + +p2 = p0; +>p2 = p0 : Promise +>p2 : Promise +>p0 : Promise + +p2 = p1; +>p2 = p1 : Promise> +>p2 : Promise +>p1 : Promise> + +function fn1(p0: Promise, p1: Promise>, p2: Promise) { +>fn1 : (p0: Promise, p1: Promise>, p2: Promise) => void +>p0 : Promise +>p1 : Promise> +>p2 : Promise + + p0 = p1; +>p0 = p1 : Promise> +>p0 : Promise +>p1 : Promise> + + p0 = p2; +>p0 = p2 : Promise +>p0 : Promise +>p2 : Promise + + p1 = p0; +>p1 = p0 : Promise +>p1 : Promise> +>p0 : Promise + + p1 = p2; +>p1 = p2 : Promise +>p1 : Promise> +>p2 : Promise + + p2 = p0; +>p2 = p0 : Promise +>p2 : Promise +>p0 : Promise + + p2 = p1; +>p2 = p1 : Promise> +>p2 : Promise +>p1 : Promise> +} + +declare let pl0: PromiseLike; +>pl0 : PromiseLike + +declare let pl1: PromiseLike>; +>pl1 : PromiseLike> + +declare let pl2: PromiseLike; +>pl2 : PromiseLike + +pl0 = pl1; +>pl0 = pl1 : PromiseLike> +>pl0 : PromiseLike +>pl1 : PromiseLike> + +pl0 = pl2; +>pl0 = pl2 : PromiseLike +>pl0 : PromiseLike +>pl2 : PromiseLike + +pl1 = pl0; +>pl1 = pl0 : PromiseLike +>pl1 : PromiseLike> +>pl0 : PromiseLike + +pl1 = pl2; +>pl1 = pl2 : PromiseLike +>pl1 : PromiseLike> +>pl2 : PromiseLike + +pl2 = pl0; +>pl2 = pl0 : PromiseLike +>pl2 : PromiseLike +>pl0 : PromiseLike + +pl2 = pl1; +>pl2 = pl1 : PromiseLike> +>pl2 : PromiseLike +>pl1 : PromiseLike> + +function fn2(pl0: PromiseLike, pl1: PromiseLike>, pl2: PromiseLike) { +>fn2 : (pl0: PromiseLike, pl1: PromiseLike>, pl2: PromiseLike) => void +>pl0 : PromiseLike +>pl1 : PromiseLike> +>pl2 : PromiseLike + + pl0 = pl1; +>pl0 = pl1 : PromiseLike> +>pl0 : PromiseLike +>pl1 : PromiseLike> + + pl0 = pl2; +>pl0 = pl2 : PromiseLike +>pl0 : PromiseLike +>pl2 : PromiseLike + + pl1 = pl0; +>pl1 = pl0 : PromiseLike +>pl1 : PromiseLike> +>pl0 : PromiseLike + + pl1 = pl2; +>pl1 = pl2 : PromiseLike +>pl1 : PromiseLike> +>pl2 : PromiseLike + + pl2 = pl0; +>pl2 = pl0 : PromiseLike +>pl2 : PromiseLike +>pl0 : PromiseLike + + pl2 = pl1; +>pl2 = pl1 : PromiseLike> +>pl2 : PromiseLike +>pl1 : PromiseLike> +} + +pl0 = p0; +>pl0 = p0 : Promise +>pl0 : PromiseLike +>p0 : Promise + +pl0 = p1; +>pl0 = p1 : Promise> +>pl0 : PromiseLike +>p1 : Promise> + +pl0 = p2; +>pl0 = p2 : Promise +>pl0 : PromiseLike +>p2 : Promise + +pl1 = p0; +>pl1 = p0 : Promise +>pl1 : PromiseLike> +>p0 : Promise + +pl1 = p1; +>pl1 = p1 : Promise> +>pl1 : PromiseLike> +>p1 : Promise> + +pl1 = p2; +>pl1 = p2 : Promise +>pl1 : PromiseLike> +>p2 : Promise + +pl2 = p0; +>pl2 = p0 : Promise +>pl2 : PromiseLike +>p0 : Promise + +pl2 = p1; +>pl2 = p1 : Promise> +>pl2 : PromiseLike +>p1 : Promise> + +pl2 = p2; +>pl2 = p2 : Promise +>pl2 : PromiseLike +>p2 : Promise + +interface A { + x: awaited T; +>x : awaited T +} + +declare let a1: A; +>a1 : A + +declare let a2: A>; +>a2 : A> + +a1 = a2; +>a1 = a2 : A> +>a1 : A +>a2 : A> + +a2 = a1; +>a2 = a1 : A +>a2 : A> +>a1 : A + +interface B { + a: A; +>a : A +} + +declare let b1: B; +>b1 : B + +declare let b2: B>; +>b2 : B> + +b1 = b2; +>b1 = b2 : B> +>b1 : B +>b2 : B> + +b2 = b1; +>b2 = b1 : B +>b2 : B> +>b1 : B + +interface C { + x: awaited ({_tag: string} & T); +>x : awaited ({ _tag: string; } & T) +>_tag : string +} + +declare let c1: C; +>c1 : C + +declare let c2: C>; +>c2 : C> + +// Not assignable since `awaited ({_tag: string} & Promise)` is `number`, which isn't assignable to `({_tag: string} & number)`. +c1 = c2; +>c1 = c2 : C> +>c1 : C +>c2 : C> + +c2 = c1; +>c2 = c1 : C +>c2 : C> +>c1 : C + +interface D { + a: C; +>a : C +} + +declare let d1: D; +>d1 : D + +declare let d2: D>; +>d2 : D> + +// Not assignable since `awaited ({_tag: string} & Promise)` is `number`, which isn't assignable to `({_tag: string} & number)`. +d1 = d2; +>d1 = d2 : D> +>d1 : D +>d2 : D> + +d2 = d1; +>d2 = d1 : D +>d2 : D> +>d1 : D + +interface E { + x: awaited (T | {otherOption: string}); +>x : { otherOption: string; } | awaited T +>otherOption : string +} + +declare let e1: E; +>e1 : E + +declare let e2: E>; +>e2 : E> + +e1 = e2; +>e1 = e2 : E> +>e1 : E +>e2 : E> + +e2 = e1; +>e2 = e1 : E +>e2 : E> +>e1 : E + +interface F { + a: E; +>a : E +} + +declare let f1: F; +>f1 : F + +declare let f2: F>; +>f2 : F> + +f1 = f2; +>f1 = f2 : F> +>f1 : F +>f2 : F> + +f2 = f1; +>f2 = f1 : F +>f2 : F> +>f1 : F + +interface G { + x: awaited T[K]; +>x : awaited T[K] +} + +declare let g1: G<{x: number}, "x">; +>g1 : G<{ x: number; }, "x"> +>x : number + +declare let g2: G<{x: Promise}, "x">; +>g2 : G<{ x: Promise; }, "x"> +>x : Promise + +g1 = g2; +>g1 = g2 : G<{ x: Promise; }, "x"> +>g1 : G<{ x: number; }, "x"> +>g2 : G<{ x: Promise; }, "x"> + +g2 = g1; +>g2 = g1 : G<{ x: number; }, "x"> +>g2 : G<{ x: Promise; }, "x"> +>g1 : G<{ x: number; }, "x"> + +interface H { + a: G; +>a : G +} + +declare let h1: H<{x: number}, "x">; +>h1 : H<{ x: number; }, "x"> +>x : number + +declare let h2: H<{x: Promise}, "x">; +>h2 : H<{ x: Promise; }, "x"> +>x : Promise + +h1 = h2; +>h1 = h2 : H<{ x: Promise; }, "x"> +>h1 : H<{ x: number; }, "x"> +>h2 : H<{ x: Promise; }, "x"> + +h2 = h1; +>h2 = h1 : H<{ x: number; }, "x"> +>h2 : H<{ x: Promise; }, "x"> +>h1 : H<{ x: number; }, "x"> + diff --git a/tests/baselines/reference/correctOrderOfPromiseMethod.symbols b/tests/baselines/reference/correctOrderOfPromiseMethod.symbols index 29a494f4ec5c3..efd5ccc07b576 100644 --- a/tests/baselines/reference/correctOrderOfPromiseMethod.symbols +++ b/tests/baselines/reference/correctOrderOfPromiseMethod.symbols @@ -33,9 +33,9 @@ async function countEverything(): Promise { const [resultA, resultB] = await Promise.all([ >resultA : Symbol(resultA, Decl(correctOrderOfPromiseMethod.ts, 13, 11)) >resultB : Symbol(resultB, Decl(correctOrderOfPromiseMethod.ts, 13, 19)) ->Promise.all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --) ... and 6 more) +>Promise.all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --) ... and 7 more) >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --) ... and 6 more) +>all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --) ... and 7 more) providerA(), >providerA : Symbol(providerA, Decl(correctOrderOfPromiseMethod.ts, 10, 9)) @@ -75,8 +75,8 @@ async function countEverything(): Promise { const expected: Promise<["a", "b", "c"]> = Promise.all(undefined as readonly ["a", "b", "c"]); >expected : Symbol(expected, Decl(correctOrderOfPromiseMethod.ts, 28, 5)) >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->Promise.all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --) ... and 6 more) +>Promise.all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --) ... and 7 more) >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --) ... and 6 more) +>all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --) ... and 7 more) >undefined : Symbol(undefined) diff --git a/tests/baselines/reference/correctOrderOfPromiseMethod.types b/tests/baselines/reference/correctOrderOfPromiseMethod.types index 4d7667cc4d847..6699798da9dd9 100644 --- a/tests/baselines/reference/correctOrderOfPromiseMethod.types +++ b/tests/baselines/reference/correctOrderOfPromiseMethod.types @@ -30,9 +30,9 @@ async function countEverything(): Promise { >resultB : B[] >await Promise.all([ providerA(), providerB(), ]) : [A[], B[]] >Promise.all([ providerA(), providerB(), ]) : Promise<[A[], B[]]> ->Promise.all : { (values: Iterable>): Promise; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[T1, T2, T3, T4]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; (values: readonly (T | PromiseLike)[]): Promise; } +>Promise.all : { (values: Iterable>): Promise<(awaited T)[]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9, awaited T10]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[awaited T1, awaited T2]>; (values: T): Promise<{ -readonly [P in keyof T]: awaited T[P]; }>; (values: readonly (T | PromiseLike)[]): Promise<(awaited T)[]>; } >Promise : PromiseConstructor ->all : { (values: Iterable>): Promise; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[T1, T2, T3, T4]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; (values: readonly (T | PromiseLike)[]): Promise; } +>all : { (values: Iterable>): Promise<(awaited T)[]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9, awaited T10]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[awaited T1, awaited T2]>; (values: T): Promise<{ -readonly [P in keyof T]: awaited T[P]; }>; (values: readonly (T | PromiseLike)[]): Promise<(awaited T)[]>; } >[ providerA(), providerB(), ] : [Promise, Promise] providerA(), @@ -76,9 +76,9 @@ async function countEverything(): Promise { const expected: Promise<["a", "b", "c"]> = Promise.all(undefined as readonly ["a", "b", "c"]); >expected : Promise<["a", "b", "c"]> >Promise.all(undefined as readonly ["a", "b", "c"]) : Promise<["a", "b", "c"]> ->Promise.all : { (values: Iterable>): Promise; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[T1, T2, T3, T4]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; (values: readonly (T | PromiseLike)[]): Promise; } +>Promise.all : { (values: Iterable>): Promise<(awaited T)[]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9, awaited T10]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[awaited T1, awaited T2]>; (values: T): Promise<{ -readonly [P in keyof T]: awaited T[P]; }>; (values: readonly (T | PromiseLike)[]): Promise<(awaited T)[]>; } >Promise : PromiseConstructor ->all : { (values: Iterable>): Promise; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[T1, T2, T3, T4]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; (values: readonly (T | PromiseLike)[]): Promise; } +>all : { (values: Iterable>): Promise<(awaited T)[]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9, awaited T10]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[awaited T1, awaited T2]>; (values: T): Promise<{ -readonly [P in keyof T]: awaited T[P]; }>; (values: readonly (T | PromiseLike)[]): Promise<(awaited T)[]>; } >undefined as readonly ["a", "b", "c"] : readonly ["a", "b", "c"] >undefined : undefined diff --git a/tests/baselines/reference/covariantCallbacks.errors.txt b/tests/baselines/reference/covariantCallbacks.errors.txt index 401bf454baa19..61faf8d40fb82 100644 --- a/tests/baselines/reference/covariantCallbacks.errors.txt +++ b/tests/baselines/reference/covariantCallbacks.errors.txt @@ -1,7 +1,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covariantCallbacks.ts(12,5): error TS2322: Type 'P' is not assignable to type 'P'. Property 'b' is missing in type 'A' but required in type 'B'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covariantCallbacks.ts(17,5): error TS2322: Type 'Promise' is not assignable to type 'Promise'. - Type 'A' is not assignable to type 'B'. + Types of property 'then' are incompatible. + Type '(onfulfilled?: ((value: A) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise' is not assignable to type '(onfulfilled?: ((value: B) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise'. + Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. + Types of parameters 'value' and 'value' are incompatible. + Type 'A' is not assignable to type 'B'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covariantCallbacks.ts(30,5): error TS2322: Type 'AList1' is not assignable to type 'BList1'. Types of property 'forEach' are incompatible. Type '(cb: (item: A) => void) => void' is not assignable to type '(cb: (item: B) => void) => void'. @@ -48,7 +52,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covarian b = a; // Error ~ !!! error TS2322: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2322: Type 'A' is not assignable to type 'B'. +!!! error TS2322: Types of property 'then' are incompatible. +!!! error TS2322: Type '(onfulfilled?: ((value: A) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise' is not assignable to type '(onfulfilled?: ((value: B) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise'. +!!! error TS2322: Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. +!!! error TS2322: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2322: Type 'A' is not assignable to type 'B'. } interface AList1 { diff --git a/tests/baselines/reference/declarationEmitExportAliasVisibiilityMarking.types b/tests/baselines/reference/declarationEmitExportAliasVisibiilityMarking.types index bf9666f3082b1..e069c3087b9bd 100644 --- a/tests/baselines/reference/declarationEmitExportAliasVisibiilityMarking.types +++ b/tests/baselines/reference/declarationEmitExportAliasVisibiilityMarking.types @@ -28,10 +28,10 @@ export let lazyCard = () => import('./Card').then(a => a.default); >lazyCard : () => Promise<(suit: import("tests/cases/compiler/Types").Suit, rank: import("tests/cases/compiler/Types").Rank) => { suit: import("tests/cases/compiler/Types").Suit; rank: import("tests/cases/compiler/Types").Rank; }> >() => import('./Card').then(a => a.default) : () => Promise<(suit: import("tests/cases/compiler/Types").Suit, rank: import("tests/cases/compiler/Types").Rank) => { suit: import("tests/cases/compiler/Types").Suit; rank: import("tests/cases/compiler/Types").Rank; }> >import('./Card').then(a => a.default) : Promise<(suit: import("tests/cases/compiler/Types").Suit, rank: import("tests/cases/compiler/Types").Rank) => { suit: import("tests/cases/compiler/Types").Suit; rank: import("tests/cases/compiler/Types").Rank; }> ->import('./Card').then : (onfulfilled?: (value: typeof import("tests/cases/compiler/Card")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>import('./Card').then : (onfulfilled?: (value: typeof import("tests/cases/compiler/Card")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >import('./Card') : Promise >'./Card' : "./Card" ->then : (onfulfilled?: (value: typeof import("tests/cases/compiler/Card")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/compiler/Card")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >a => a.default : (a: typeof import("tests/cases/compiler/Card")) => (suit: import("tests/cases/compiler/Types").Suit, rank: import("tests/cases/compiler/Types").Rank) => { suit: import("tests/cases/compiler/Types").Suit; rank: import("tests/cases/compiler/Types").Rank; } >a : typeof import("tests/cases/compiler/Card") >a.default : (suit: import("tests/cases/compiler/Types").Suit, rank: import("tests/cases/compiler/Types").Rank) => { suit: import("tests/cases/compiler/Types").Suit; rank: import("tests/cases/compiler/Types").Rank; } diff --git a/tests/baselines/reference/es2018ObjectAssign.types b/tests/baselines/reference/es2018ObjectAssign.types index f4cc265f67a97..ddb14ae77b965 100644 --- a/tests/baselines/reference/es2018ObjectAssign.types +++ b/tests/baselines/reference/es2018ObjectAssign.types @@ -15,7 +15,7 @@ declare const p: Promise; p.finally(); >p.finally() : Promise ->p.finally : (onfinally?: () => void) => Promise +>p.finally : (onfinally?: () => void | PromiseLike) => Promise >p : Promise ->finally : (onfinally?: () => void) => Promise +>finally : (onfinally?: () => void | PromiseLike) => Promise diff --git a/tests/baselines/reference/esModuleInteropImportCall.types b/tests/baselines/reference/esModuleInteropImportCall.types index 59d1de3076822..f26b63db88bfa 100644 --- a/tests/baselines/reference/esModuleInteropImportCall.types +++ b/tests/baselines/reference/esModuleInteropImportCall.types @@ -9,10 +9,10 @@ export = foo; === tests/cases/compiler/index.ts === import("./foo").then(f => { >import("./foo").then(f => { f.default;}) : Promise ->import("./foo").then : void; }, TResult2 = never>(onfulfilled?: (value: { default: () => void; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>import("./foo").then : void; }, TResult2 = never>(onfulfilled?: (value: { default: () => void; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >import("./foo") : Promise<{ default: () => void; }> >"./foo" : "./foo" ->then : void; }, TResult2 = never>(onfulfilled?: (value: { default: () => void; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : void; }, TResult2 = never>(onfulfilled?: (value: { default: () => void; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >f => { f.default;} : (f: { default: () => void; }) => void >f : { default: () => void; } diff --git a/tests/baselines/reference/exportDefaultAsyncFunction2.types b/tests/baselines/reference/exportDefaultAsyncFunction2.types index 0e6ad89ccdfe6..08745abf42acf 100644 --- a/tests/baselines/reference/exportDefaultAsyncFunction2.types +++ b/tests/baselines/reference/exportDefaultAsyncFunction2.types @@ -19,9 +19,9 @@ export default async(() => await(Promise.resolve(1))); >await(Promise.resolve(1)) : any >await : (...args: any[]) => any >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 === tests/cases/compiler/b.ts === diff --git a/tests/baselines/reference/forAwaitForUnion.types b/tests/baselines/reference/forAwaitForUnion.types index 180197b26eafc..182196ebbcb6d 100644 --- a/tests/baselines/reference/forAwaitForUnion.types +++ b/tests/baselines/reference/forAwaitForUnion.types @@ -4,7 +4,7 @@ async function f(source: Iterable | AsyncIterable) { >source : Iterable | AsyncIterable for await (const x of source) { ->x : T +>x : T | awaited T >source : Iterable | AsyncIterable } } diff --git a/tests/baselines/reference/genericFunctionInference1.types b/tests/baselines/reference/genericFunctionInference1.types index 2b44e9560dfcc..06f94b743b079 100644 --- a/tests/baselines/reference/genericFunctionInference1.types +++ b/tests/baselines/reference/genericFunctionInference1.types @@ -835,16 +835,16 @@ const fn30: Fn = pipe( const promise = Promise.resolve(1); >promise : Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 promise.then( >promise.then( pipe( x => x + 1, x => x * 2, ),) : Promise ->promise.then : (onfulfilled?: ((value: number) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>promise.then : (onfulfilled?: ((value: number) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >promise : Promise ->then : (onfulfilled?: ((value: number) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: number) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise pipe( >pipe( x => x + 1, x => x * 2, ) : (x: number) => number diff --git a/tests/baselines/reference/importCallExpression1ES2020.types b/tests/baselines/reference/importCallExpression1ES2020.types index fd3564b2c147c..37f67a3933b97 100644 --- a/tests/baselines/reference/importCallExpression1ES2020.types +++ b/tests/baselines/reference/importCallExpression1ES2020.types @@ -15,9 +15,9 @@ var p1 = import("./0"); p1.then(zero => { >p1.then(zero => { return zero.foo();}) : Promise ->p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p1 : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >zero => { return zero.foo();} : (zero: typeof import("tests/cases/conformance/dynamicImport/0")) => string >zero : typeof import("tests/cases/conformance/dynamicImport/0") diff --git a/tests/baselines/reference/importCallExpression2ES2020.types b/tests/baselines/reference/importCallExpression2ES2020.types index 80580e35d5362..d1eb4e4124a84 100644 --- a/tests/baselines/reference/importCallExpression2ES2020.types +++ b/tests/baselines/reference/importCallExpression2ES2020.types @@ -14,9 +14,9 @@ function foo(x: Promise) { x.then(value => { >x.then(value => { let b = new value.B(); b.print(); }) : Promise ->x.then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x.then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >x : Promise ->then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >value => { let b = new value.B(); b.print(); } : (value: any) => void >value : any diff --git a/tests/baselines/reference/importCallExpression4ES2020.types b/tests/baselines/reference/importCallExpression4ES2020.types index e7f75126c1494..58c6281aae1f1 100644 --- a/tests/baselines/reference/importCallExpression4ES2020.types +++ b/tests/baselines/reference/importCallExpression4ES2020.types @@ -38,11 +38,11 @@ class C { this.myModule.then(Zero => { >this.myModule.then(Zero => { console.log(Zero.foo()); }, async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); }) : Promise ->this.myModule.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>this.myModule.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >this.myModule : Promise >this : this >myModule : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >Zero => { console.log(Zero.foo()); } : (Zero: typeof import("tests/cases/conformance/dynamicImport/0")) => void >Zero : typeof import("tests/cases/conformance/dynamicImport/0") diff --git a/tests/baselines/reference/importCallExpressionCheckReturntype1.errors.txt b/tests/baselines/reference/importCallExpressionCheckReturntype1.errors.txt index dd3445deb562f..951d8731e4bb5 100644 --- a/tests/baselines/reference/importCallExpressionCheckReturntype1.errors.txt +++ b/tests/baselines/reference/importCallExpressionCheckReturntype1.errors.txt @@ -1,7 +1,15 @@ tests/cases/conformance/dynamicImport/1.ts(4,5): error TS2322: Type 'Promise' is not assignable to type 'Promise'. - Property 'D' is missing in type 'typeof import("tests/cases/conformance/dynamicImport/defaultPath")' but required in type 'typeof import("tests/cases/conformance/dynamicImport/anotherModule")'. + Types of property 'then' are incompatible. + Type '(onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/defaultPath")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise' is not assignable to type '(onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/anotherModule")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise'. + Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. + Types of parameters 'value' and 'value' are incompatible. + Type 'typeof import("tests/cases/conformance/dynamicImport/defaultPath")' is not assignable to type 'typeof import("tests/cases/conformance/dynamicImport/anotherModule")'. tests/cases/conformance/dynamicImport/1.ts(5,10): error TS2352: Conversion of type 'Promise' to type 'Promise' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. - Property 'D' is missing in type 'typeof import("tests/cases/conformance/dynamicImport/defaultPath")' but required in type 'typeof import("tests/cases/conformance/dynamicImport/anotherModule")'. + Types of property 'then' are incompatible. + Type '(onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/defaultPath")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise' is not comparable to type '(onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/anotherModule")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise'. + Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. + Types of parameters 'value' and 'value' are incompatible. + Type 'typeof import("tests/cases/conformance/dynamicImport/defaultPath")' is not comparable to type 'typeof import("tests/cases/conformance/dynamicImport/anotherModule")'. ==== tests/cases/conformance/dynamicImport/anotherModule.ts (0 errors) ==== @@ -17,12 +25,18 @@ tests/cases/conformance/dynamicImport/1.ts(5,10): error TS2352: Conversion of ty let p1: Promise = import("./defaultPath"); ~~ !!! error TS2322: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2322: Property 'D' is missing in type 'typeof import("tests/cases/conformance/dynamicImport/defaultPath")' but required in type 'typeof import("tests/cases/conformance/dynamicImport/anotherModule")'. -!!! related TS2728 tests/cases/conformance/dynamicImport/anotherModule.ts:1:14: 'D' is declared here. +!!! error TS2322: Types of property 'then' are incompatible. +!!! error TS2322: Type '(onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/defaultPath")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise' is not assignable to type '(onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/anotherModule")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise'. +!!! error TS2322: Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. +!!! error TS2322: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2322: Type 'typeof import("tests/cases/conformance/dynamicImport/defaultPath")' is not assignable to type 'typeof import("tests/cases/conformance/dynamicImport/anotherModule")'. let p2 = import("./defaultPath") as Promise; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2352: Conversion of type 'Promise' to type 'Promise' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. -!!! error TS2352: Property 'D' is missing in type 'typeof import("tests/cases/conformance/dynamicImport/defaultPath")' but required in type 'typeof import("tests/cases/conformance/dynamicImport/anotherModule")'. -!!! related TS2728 tests/cases/conformance/dynamicImport/anotherModule.ts:1:14: 'D' is declared here. +!!! error TS2352: Types of property 'then' are incompatible. +!!! error TS2352: Type '(onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/defaultPath")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise' is not comparable to type '(onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/anotherModule")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise'. +!!! error TS2352: Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. +!!! error TS2352: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2352: Type 'typeof import("tests/cases/conformance/dynamicImport/defaultPath")' is not comparable to type 'typeof import("tests/cases/conformance/dynamicImport/anotherModule")'. let p3: Promise = import("./defaultPath"); \ No newline at end of file diff --git a/tests/baselines/reference/importCallExpressionES5AMD.types b/tests/baselines/reference/importCallExpressionES5AMD.types index ceb6a6fe29962..564692b05de52 100644 --- a/tests/baselines/reference/importCallExpressionES5AMD.types +++ b/tests/baselines/reference/importCallExpressionES5AMD.types @@ -15,9 +15,9 @@ var p1 = import("./0"); p1.then(zero => { >p1.then(zero => { return zero.foo();}) : Promise ->p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p1 : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >zero => { return zero.foo();} : (zero: typeof import("tests/cases/conformance/dynamicImport/0")) => string >zero : typeof import("tests/cases/conformance/dynamicImport/0") diff --git a/tests/baselines/reference/importCallExpressionES5CJS.types b/tests/baselines/reference/importCallExpressionES5CJS.types index ceb6a6fe29962..564692b05de52 100644 --- a/tests/baselines/reference/importCallExpressionES5CJS.types +++ b/tests/baselines/reference/importCallExpressionES5CJS.types @@ -15,9 +15,9 @@ var p1 = import("./0"); p1.then(zero => { >p1.then(zero => { return zero.foo();}) : Promise ->p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p1 : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >zero => { return zero.foo();} : (zero: typeof import("tests/cases/conformance/dynamicImport/0")) => string >zero : typeof import("tests/cases/conformance/dynamicImport/0") diff --git a/tests/baselines/reference/importCallExpressionES5System.types b/tests/baselines/reference/importCallExpressionES5System.types index ceb6a6fe29962..564692b05de52 100644 --- a/tests/baselines/reference/importCallExpressionES5System.types +++ b/tests/baselines/reference/importCallExpressionES5System.types @@ -15,9 +15,9 @@ var p1 = import("./0"); p1.then(zero => { >p1.then(zero => { return zero.foo();}) : Promise ->p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p1 : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >zero => { return zero.foo();} : (zero: typeof import("tests/cases/conformance/dynamicImport/0")) => string >zero : typeof import("tests/cases/conformance/dynamicImport/0") diff --git a/tests/baselines/reference/importCallExpressionES5UMD.types b/tests/baselines/reference/importCallExpressionES5UMD.types index ceb6a6fe29962..564692b05de52 100644 --- a/tests/baselines/reference/importCallExpressionES5UMD.types +++ b/tests/baselines/reference/importCallExpressionES5UMD.types @@ -15,9 +15,9 @@ var p1 = import("./0"); p1.then(zero => { >p1.then(zero => { return zero.foo();}) : Promise ->p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p1 : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >zero => { return zero.foo();} : (zero: typeof import("tests/cases/conformance/dynamicImport/0")) => string >zero : typeof import("tests/cases/conformance/dynamicImport/0") diff --git a/tests/baselines/reference/importCallExpressionES6AMD.types b/tests/baselines/reference/importCallExpressionES6AMD.types index ceb6a6fe29962..564692b05de52 100644 --- a/tests/baselines/reference/importCallExpressionES6AMD.types +++ b/tests/baselines/reference/importCallExpressionES6AMD.types @@ -15,9 +15,9 @@ var p1 = import("./0"); p1.then(zero => { >p1.then(zero => { return zero.foo();}) : Promise ->p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p1 : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >zero => { return zero.foo();} : (zero: typeof import("tests/cases/conformance/dynamicImport/0")) => string >zero : typeof import("tests/cases/conformance/dynamicImport/0") diff --git a/tests/baselines/reference/importCallExpressionES6CJS.types b/tests/baselines/reference/importCallExpressionES6CJS.types index ceb6a6fe29962..564692b05de52 100644 --- a/tests/baselines/reference/importCallExpressionES6CJS.types +++ b/tests/baselines/reference/importCallExpressionES6CJS.types @@ -15,9 +15,9 @@ var p1 = import("./0"); p1.then(zero => { >p1.then(zero => { return zero.foo();}) : Promise ->p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p1 : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >zero => { return zero.foo();} : (zero: typeof import("tests/cases/conformance/dynamicImport/0")) => string >zero : typeof import("tests/cases/conformance/dynamicImport/0") diff --git a/tests/baselines/reference/importCallExpressionES6System.types b/tests/baselines/reference/importCallExpressionES6System.types index ceb6a6fe29962..564692b05de52 100644 --- a/tests/baselines/reference/importCallExpressionES6System.types +++ b/tests/baselines/reference/importCallExpressionES6System.types @@ -15,9 +15,9 @@ var p1 = import("./0"); p1.then(zero => { >p1.then(zero => { return zero.foo();}) : Promise ->p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p1 : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >zero => { return zero.foo();} : (zero: typeof import("tests/cases/conformance/dynamicImport/0")) => string >zero : typeof import("tests/cases/conformance/dynamicImport/0") diff --git a/tests/baselines/reference/importCallExpressionES6UMD.types b/tests/baselines/reference/importCallExpressionES6UMD.types index ceb6a6fe29962..564692b05de52 100644 --- a/tests/baselines/reference/importCallExpressionES6UMD.types +++ b/tests/baselines/reference/importCallExpressionES6UMD.types @@ -15,9 +15,9 @@ var p1 = import("./0"); p1.then(zero => { >p1.then(zero => { return zero.foo();}) : Promise ->p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p1 : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >zero => { return zero.foo();} : (zero: typeof import("tests/cases/conformance/dynamicImport/0")) => string >zero : typeof import("tests/cases/conformance/dynamicImport/0") diff --git a/tests/baselines/reference/importCallExpressionErrorInES2015.types b/tests/baselines/reference/importCallExpressionErrorInES2015.types index f0a055e7a0626..2e2c2d2e85065 100644 --- a/tests/baselines/reference/importCallExpressionErrorInES2015.types +++ b/tests/baselines/reference/importCallExpressionErrorInES2015.types @@ -15,9 +15,9 @@ var p1 = import("./0"); p1.then(zero => { >p1.then(zero => { return zero.foo();}) : Promise ->p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p1 : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >zero => { return zero.foo();} : (zero: typeof import("tests/cases/conformance/dynamicImport/0")) => string >zero : typeof import("tests/cases/conformance/dynamicImport/0") diff --git a/tests/baselines/reference/importCallExpressionInAMD1.types b/tests/baselines/reference/importCallExpressionInAMD1.types index 6d270e686edf2..6d272d332a7d2 100644 --- a/tests/baselines/reference/importCallExpressionInAMD1.types +++ b/tests/baselines/reference/importCallExpressionInAMD1.types @@ -15,9 +15,9 @@ var p1 = import("./0"); p1.then(zero => { >p1.then(zero => { return zero.foo();}) : Promise ->p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p1 : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >zero => { return zero.foo();} : (zero: typeof import("tests/cases/conformance/dynamicImport/0")) => string >zero : typeof import("tests/cases/conformance/dynamicImport/0") diff --git a/tests/baselines/reference/importCallExpressionInAMD2.types b/tests/baselines/reference/importCallExpressionInAMD2.types index 875118acbac1a..53f3da4d2dfce 100644 --- a/tests/baselines/reference/importCallExpressionInAMD2.types +++ b/tests/baselines/reference/importCallExpressionInAMD2.types @@ -15,9 +15,9 @@ function foo(x: Promise) { x.then(value => { >x.then(value => { let b = new value.B(); b.print(); }) : Promise ->x.then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x.then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >x : Promise ->then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >value => { let b = new value.B(); b.print(); } : (value: any) => void >value : any diff --git a/tests/baselines/reference/importCallExpressionInAMD4.types b/tests/baselines/reference/importCallExpressionInAMD4.types index afedd6f4b815f..34e6761eb6117 100644 --- a/tests/baselines/reference/importCallExpressionInAMD4.types +++ b/tests/baselines/reference/importCallExpressionInAMD4.types @@ -38,11 +38,11 @@ class C { this.myModule.then(Zero => { >this.myModule.then(Zero => { console.log(Zero.foo()); }, async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); }) : Promise ->this.myModule.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>this.myModule.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >this.myModule : Promise >this : this >myModule : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >Zero => { console.log(Zero.foo()); } : (Zero: typeof import("tests/cases/conformance/dynamicImport/0")) => void >Zero : typeof import("tests/cases/conformance/dynamicImport/0") @@ -105,11 +105,11 @@ export class D { this.myModule.then(Zero => { >this.myModule.then(Zero => { console.log(Zero.foo()); }, async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); }) : Promise ->this.myModule.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>this.myModule.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >this.myModule : Promise >this : this >myModule : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >Zero => { console.log(Zero.foo()); } : (Zero: typeof import("tests/cases/conformance/dynamicImport/0")) => void >Zero : typeof import("tests/cases/conformance/dynamicImport/0") diff --git a/tests/baselines/reference/importCallExpressionInCJS1.types b/tests/baselines/reference/importCallExpressionInCJS1.types index 6d270e686edf2..6d272d332a7d2 100644 --- a/tests/baselines/reference/importCallExpressionInCJS1.types +++ b/tests/baselines/reference/importCallExpressionInCJS1.types @@ -15,9 +15,9 @@ var p1 = import("./0"); p1.then(zero => { >p1.then(zero => { return zero.foo();}) : Promise ->p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p1 : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >zero => { return zero.foo();} : (zero: typeof import("tests/cases/conformance/dynamicImport/0")) => string >zero : typeof import("tests/cases/conformance/dynamicImport/0") diff --git a/tests/baselines/reference/importCallExpressionInCJS3.types b/tests/baselines/reference/importCallExpressionInCJS3.types index 875118acbac1a..53f3da4d2dfce 100644 --- a/tests/baselines/reference/importCallExpressionInCJS3.types +++ b/tests/baselines/reference/importCallExpressionInCJS3.types @@ -15,9 +15,9 @@ function foo(x: Promise) { x.then(value => { >x.then(value => { let b = new value.B(); b.print(); }) : Promise ->x.then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x.then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >x : Promise ->then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >value => { let b = new value.B(); b.print(); } : (value: any) => void >value : any diff --git a/tests/baselines/reference/importCallExpressionInCJS5.types b/tests/baselines/reference/importCallExpressionInCJS5.types index aea65c1407070..584fcc2ff5826 100644 --- a/tests/baselines/reference/importCallExpressionInCJS5.types +++ b/tests/baselines/reference/importCallExpressionInCJS5.types @@ -38,11 +38,11 @@ class C { this.myModule.then(Zero => { >this.myModule.then(Zero => { console.log(Zero.foo()); }, async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); }) : Promise ->this.myModule.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>this.myModule.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >this.myModule : Promise >this : this >myModule : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >Zero => { console.log(Zero.foo()); } : (Zero: typeof import("tests/cases/conformance/dynamicImport/0")) => void >Zero : typeof import("tests/cases/conformance/dynamicImport/0") @@ -105,11 +105,11 @@ export class D { this.myModule.then(Zero => { >this.myModule.then(Zero => { console.log(Zero.foo()); }, async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); }) : Promise ->this.myModule.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>this.myModule.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >this.myModule : Promise >this : this >myModule : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >Zero => { console.log(Zero.foo()); } : (Zero: typeof import("tests/cases/conformance/dynamicImport/0")) => void >Zero : typeof import("tests/cases/conformance/dynamicImport/0") diff --git a/tests/baselines/reference/importCallExpressionInSystem1.types b/tests/baselines/reference/importCallExpressionInSystem1.types index 6d270e686edf2..6d272d332a7d2 100644 --- a/tests/baselines/reference/importCallExpressionInSystem1.types +++ b/tests/baselines/reference/importCallExpressionInSystem1.types @@ -15,9 +15,9 @@ var p1 = import("./0"); p1.then(zero => { >p1.then(zero => { return zero.foo();}) : Promise ->p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p1 : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >zero => { return zero.foo();} : (zero: typeof import("tests/cases/conformance/dynamicImport/0")) => string >zero : typeof import("tests/cases/conformance/dynamicImport/0") diff --git a/tests/baselines/reference/importCallExpressionInSystem2.types b/tests/baselines/reference/importCallExpressionInSystem2.types index 875118acbac1a..53f3da4d2dfce 100644 --- a/tests/baselines/reference/importCallExpressionInSystem2.types +++ b/tests/baselines/reference/importCallExpressionInSystem2.types @@ -15,9 +15,9 @@ function foo(x: Promise) { x.then(value => { >x.then(value => { let b = new value.B(); b.print(); }) : Promise ->x.then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x.then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >x : Promise ->then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >value => { let b = new value.B(); b.print(); } : (value: any) => void >value : any diff --git a/tests/baselines/reference/importCallExpressionInSystem4.types b/tests/baselines/reference/importCallExpressionInSystem4.types index afedd6f4b815f..34e6761eb6117 100644 --- a/tests/baselines/reference/importCallExpressionInSystem4.types +++ b/tests/baselines/reference/importCallExpressionInSystem4.types @@ -38,11 +38,11 @@ class C { this.myModule.then(Zero => { >this.myModule.then(Zero => { console.log(Zero.foo()); }, async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); }) : Promise ->this.myModule.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>this.myModule.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >this.myModule : Promise >this : this >myModule : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >Zero => { console.log(Zero.foo()); } : (Zero: typeof import("tests/cases/conformance/dynamicImport/0")) => void >Zero : typeof import("tests/cases/conformance/dynamicImport/0") @@ -105,11 +105,11 @@ export class D { this.myModule.then(Zero => { >this.myModule.then(Zero => { console.log(Zero.foo()); }, async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); }) : Promise ->this.myModule.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>this.myModule.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >this.myModule : Promise >this : this >myModule : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >Zero => { console.log(Zero.foo()); } : (Zero: typeof import("tests/cases/conformance/dynamicImport/0")) => void >Zero : typeof import("tests/cases/conformance/dynamicImport/0") diff --git a/tests/baselines/reference/importCallExpressionInUMD1.types b/tests/baselines/reference/importCallExpressionInUMD1.types index 6d270e686edf2..6d272d332a7d2 100644 --- a/tests/baselines/reference/importCallExpressionInUMD1.types +++ b/tests/baselines/reference/importCallExpressionInUMD1.types @@ -15,9 +15,9 @@ var p1 = import("./0"); p1.then(zero => { >p1.then(zero => { return zero.foo();}) : Promise ->p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p1.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p1 : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >zero => { return zero.foo();} : (zero: typeof import("tests/cases/conformance/dynamicImport/0")) => string >zero : typeof import("tests/cases/conformance/dynamicImport/0") diff --git a/tests/baselines/reference/importCallExpressionInUMD2.types b/tests/baselines/reference/importCallExpressionInUMD2.types index 875118acbac1a..53f3da4d2dfce 100644 --- a/tests/baselines/reference/importCallExpressionInUMD2.types +++ b/tests/baselines/reference/importCallExpressionInUMD2.types @@ -15,9 +15,9 @@ function foo(x: Promise) { x.then(value => { >x.then(value => { let b = new value.B(); b.print(); }) : Promise ->x.then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x.then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >x : Promise ->then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >value => { let b = new value.B(); b.print(); } : (value: any) => void >value : any diff --git a/tests/baselines/reference/importCallExpressionInUMD4.types b/tests/baselines/reference/importCallExpressionInUMD4.types index afedd6f4b815f..34e6761eb6117 100644 --- a/tests/baselines/reference/importCallExpressionInUMD4.types +++ b/tests/baselines/reference/importCallExpressionInUMD4.types @@ -38,11 +38,11 @@ class C { this.myModule.then(Zero => { >this.myModule.then(Zero => { console.log(Zero.foo()); }, async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); }) : Promise ->this.myModule.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>this.myModule.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >this.myModule : Promise >this : this >myModule : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >Zero => { console.log(Zero.foo()); } : (Zero: typeof import("tests/cases/conformance/dynamicImport/0")) => void >Zero : typeof import("tests/cases/conformance/dynamicImport/0") @@ -105,11 +105,11 @@ export class D { this.myModule.then(Zero => { >this.myModule.then(Zero => { console.log(Zero.foo()); }, async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); }) : Promise ->this.myModule.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>this.myModule.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >this.myModule : Promise >this : this >myModule : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >Zero => { console.log(Zero.foo()); } : (Zero: typeof import("tests/cases/conformance/dynamicImport/0")) => void >Zero : typeof import("tests/cases/conformance/dynamicImport/0") diff --git a/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.types b/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.types index ef8cdaec2fa72..8b22ef71cc4cd 100644 --- a/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.types +++ b/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.types @@ -38,11 +38,11 @@ class C { this.myModule.then(Zero => { >this.myModule.then(Zero => { console.log(Zero.foo()); }, async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); }) : Promise ->this.myModule.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>this.myModule.then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >this.myModule : Promise >this : this >myModule : Promise ->then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: typeof import("tests/cases/conformance/dynamicImport/0")) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >Zero => { console.log(Zero.foo()); } : (Zero: typeof import("tests/cases/conformance/dynamicImport/0")) => void >Zero : typeof import("tests/cases/conformance/dynamicImport/0") diff --git a/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.types b/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.types index b5f526adc8e89..01f883750ae35 100644 --- a/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.types +++ b/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.types @@ -66,9 +66,9 @@ const p2 = import(whatToLoad ? getSpecifier() : "defaulPath") as Promise { >p1.then(zero => { return zero.foo(); // ok, zero is any}) : Promise ->p1.then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p1.then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p1 : Promise ->then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >zero => { return zero.foo(); // ok, zero is any} : (zero: any) => any >zero : any diff --git a/tests/baselines/reference/importCallExpressionShouldNotGetParen.types b/tests/baselines/reference/importCallExpressionShouldNotGetParen.types index 6c45228344687..2590fd62df0a7 100644 --- a/tests/baselines/reference/importCallExpressionShouldNotGetParen.types +++ b/tests/baselines/reference/importCallExpressionShouldNotGetParen.types @@ -5,11 +5,11 @@ const localeName = "zh-CN"; import(`./locales/${localeName}.js`).then(bar => { >import(`./locales/${localeName}.js`).then(bar => { let x = bar;}) : Promise ->import(`./locales/${localeName}.js`).then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>import(`./locales/${localeName}.js`).then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >import(`./locales/${localeName}.js`) : Promise >`./locales/${localeName}.js` : string >localeName : "zh-CN" ->then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >bar => { let x = bar;} : (bar: any) => void >bar : any @@ -21,14 +21,14 @@ import(`./locales/${localeName}.js`).then(bar => { import("./locales/" + localeName + ".js").then(bar => { >import("./locales/" + localeName + ".js").then(bar => { let x = bar;}) : Promise ->import("./locales/" + localeName + ".js").then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>import("./locales/" + localeName + ".js").then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >import("./locales/" + localeName + ".js") : Promise >"./locales/" + localeName + ".js" : string >"./locales/" + localeName : string >"./locales/" : "./locales/" >localeName : "zh-CN" >".js" : ".js" ->then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >bar => { let x = bar;} : (bar: any) => void >bar : any diff --git a/tests/baselines/reference/importCallExpressionSpecifierNotStringTypeError.types b/tests/baselines/reference/importCallExpressionSpecifierNotStringTypeError.types index 6378e7c582be8..dcaf760969722 100644 --- a/tests/baselines/reference/importCallExpressionSpecifierNotStringTypeError.types +++ b/tests/baselines/reference/importCallExpressionSpecifierNotStringTypeError.types @@ -28,9 +28,9 @@ const p2 = import(whatToLoad ? getSpecifier() : "defaulPath") p1.then(zero => { >p1.then(zero => { return zero.foo(); // ok, zero is any}) : Promise ->p1.then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p1.then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p1 : Promise ->then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >zero => { return zero.foo(); // ok, zero is any} : (zero: any) => any >zero : any diff --git a/tests/baselines/reference/inferFromGenericFunctionReturnTypes3.symbols b/tests/baselines/reference/inferFromGenericFunctionReturnTypes3.symbols index ecf867a2bf715..8deaf8a246922 100644 --- a/tests/baselines/reference/inferFromGenericFunctionReturnTypes3.symbols +++ b/tests/baselines/reference/inferFromGenericFunctionReturnTypes3.symbols @@ -381,9 +381,9 @@ const f1: F = () => { >F : Symbol(F, Decl(inferFromGenericFunctionReturnTypes3.ts, 153, 2)) return Promise.all([ ->Promise.all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --) ... and 6 more) +>Promise.all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --) ... and 7 more) >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --) ... and 6 more) +>all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --) ... and 7 more) { name: "David Gomes", >name : Symbol(name, Decl(inferFromGenericFunctionReturnTypes3.ts, 159, 9)) diff --git a/tests/baselines/reference/inferFromGenericFunctionReturnTypes3.types b/tests/baselines/reference/inferFromGenericFunctionReturnTypes3.types index baecdf626dd19..cf5622307a04d 100644 --- a/tests/baselines/reference/inferFromGenericFunctionReturnTypes3.types +++ b/tests/baselines/reference/inferFromGenericFunctionReturnTypes3.types @@ -7,9 +7,9 @@ function truePromise(): Promise { return Promise.resolve(true); >Promise.resolve(true) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >true : true } @@ -413,9 +413,9 @@ const f1: F = () => { return Promise.all([ >Promise.all([ { name: "David Gomes", age: 23, position: "GOALKEEPER", }, { name: "Cristiano Ronaldo", age: 33, position: "STRIKER", } ]) : Promise<[{ name: string; age: number; position: "GOALKEEPER"; }, { name: string; age: number; position: "STRIKER"; }]> ->Promise.all : { (values: Iterable>): Promise; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[T1, T2, T3, T4]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; (values: readonly (T | PromiseLike)[]): Promise; } +>Promise.all : { (values: Iterable>): Promise<(awaited T)[]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9, awaited T10]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[awaited T1, awaited T2]>; (values: T): Promise<{ -readonly [P in keyof T]: awaited T[P]; }>; (values: readonly (T | PromiseLike)[]): Promise<(awaited T)[]>; } >Promise : PromiseConstructor ->all : { (values: Iterable>): Promise; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[T1, T2, T3, T4]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; (values: readonly (T | PromiseLike)[]): Promise; } +>all : { (values: Iterable>): Promise<(awaited T)[]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9, awaited T10]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[awaited T1, awaited T2]>; (values: T): Promise<{ -readonly [P in keyof T]: awaited T[P]; }>; (values: readonly (T | PromiseLike)[]): Promise<(awaited T)[]>; } >[ { name: "David Gomes", age: 23, position: "GOALKEEPER", }, { name: "Cristiano Ronaldo", age: 33, position: "STRIKER", } ] : [{ name: string; age: number; position: "GOALKEEPER"; }, { name: string; age: number; position: "STRIKER"; }] { >{ name: "David Gomes", age: 23, position: "GOALKEEPER", } : { name: string; age: number; position: "GOALKEEPER"; } diff --git a/tests/baselines/reference/inferenceLimit.symbols b/tests/baselines/reference/inferenceLimit.symbols index 4b7091a05857e..55cf1c34802e7 100644 --- a/tests/baselines/reference/inferenceLimit.symbols +++ b/tests/baselines/reference/inferenceLimit.symbols @@ -61,9 +61,9 @@ export class BrokenClass { return Promise.all(result.map(populateItems)) >Promise.all(result.map(populateItems)) .then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --) ... and 6 more) +>Promise.all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --) ... and 7 more) >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --) ... and 6 more) +>all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --) ... and 7 more) >result.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) >result : Symbol(result, Decl(file1.ts, 10, 7)) >map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) diff --git a/tests/baselines/reference/inferenceLimit.types b/tests/baselines/reference/inferenceLimit.types index fc2836e6dea9c..1eb43601bbdd3 100644 --- a/tests/baselines/reference/inferenceLimit.types +++ b/tests/baselines/reference/inferenceLimit.types @@ -42,7 +42,7 @@ export class BrokenClass { this.doStuff(order.id) >this.doStuff(order.id) .then((items) => { order.items = items; resolve(order); }) : Promise ->this.doStuff(order.id) .then : (onfulfilled?: (value: void) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>this.doStuff(order.id) .then : (onfulfilled?: (value: void) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >this.doStuff(order.id) : Promise >this.doStuff : (id: number) => Promise >this : this @@ -52,7 +52,7 @@ export class BrokenClass { >id : any .then((items) => { ->then : (onfulfilled?: (value: void) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: void) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >(items) => { order.items = items; resolve(order); } : (items: void) => void >items : void @@ -74,11 +74,11 @@ export class BrokenClass { return Promise.all(result.map(populateItems)) >Promise.all(result.map(populateItems)) .then((orders: Array) => { resolve(orders); }) : Promise ->Promise.all(result.map(populateItems)) .then : (onfulfilled?: (value: unknown[]) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>Promise.all(result.map(populateItems)) .then : (onfulfilled?: (value: unknown[]) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >Promise.all(result.map(populateItems)) : Promise ->Promise.all : { (values: Iterable>): Promise; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[T1, T2, T3, T4]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; (values: readonly (T | PromiseLike)[]): Promise; } +>Promise.all : { (values: Iterable>): Promise<(awaited T)[]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9, awaited T10]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[awaited T1, awaited T2]>; (values: T): Promise<{ -readonly [P in keyof T]: awaited T[P]; }>; (values: readonly (T | PromiseLike)[]): Promise<(awaited T)[]>; } >Promise : PromiseConstructor ->all : { (values: Iterable>): Promise; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[T1, T2, T3, T4]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; (values: readonly (T | PromiseLike)[]): Promise; } +>all : { (values: Iterable>): Promise<(awaited T)[]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9, awaited T10]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3]>; (values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[awaited T1, awaited T2]>; (values: T): Promise<{ -readonly [P in keyof T]: awaited T[P]; }>; (values: readonly (T | PromiseLike)[]): Promise<(awaited T)[]>; } >result.map(populateItems) : Promise[] >result.map : (callbackfn: (value: MyModule.MyModel, index: number, array: MyModule.MyModel[]) => U, thisArg?: any) => U[] >result : MyModule.MyModel[] @@ -86,7 +86,7 @@ export class BrokenClass { >populateItems : (order: any) => Promise .then((orders: Array) => { ->then : (onfulfilled?: (value: unknown[]) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: unknown[]) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >(orders: Array) => { resolve(orders); } : (orders: MyModule.MyModel[]) => void >orders : MyModule.MyModel[] >MyModule : any diff --git a/tests/baselines/reference/instantiateContextualTypes.types b/tests/baselines/reference/instantiateContextualTypes.types index b5317b6f7561f..acb790935ff6f 100644 --- a/tests/baselines/reference/instantiateContextualTypes.types +++ b/tests/baselines/reference/instantiateContextualTypes.types @@ -340,12 +340,12 @@ class Interesting { return Promise.resolve().then(() => { >Promise.resolve().then(() => { if (1 < 2) { return 'SOMETHING'; } return 'ELSE'; }) : Promise ->Promise.resolve().then : (onfulfilled?: ((value: void) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>Promise.resolve().then : (onfulfilled?: ((value: void) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >Promise.resolve() : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } ->then : (onfulfilled?: ((value: void) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>then : (onfulfilled?: ((value: void) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => { if (1 < 2) { return 'SOMETHING'; } return 'ELSE'; } : () => "SOMETHING" | "ELSE" if (1 < 2) { @@ -367,12 +367,12 @@ class Interesting { return Promise.resolve().then(() => { >Promise.resolve().then(() => { return 'ELSE'; }) : Promise ->Promise.resolve().then : (onfulfilled?: ((value: void) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>Promise.resolve().then : (onfulfilled?: ((value: void) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >Promise.resolve() : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } ->then : (onfulfilled?: ((value: void) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>then : (onfulfilled?: ((value: void) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => { return 'ELSE'; } : () => "ELSE" return 'ELSE'; @@ -386,12 +386,12 @@ class Interesting { return Promise.resolve().then(() => { >Promise.resolve().then(() => { if (1 < 2) { return 'SOMETHING'; } return 'SOMETHING'; }) : Promise ->Promise.resolve().then : (onfulfilled?: ((value: void) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>Promise.resolve().then : (onfulfilled?: ((value: void) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >Promise.resolve() : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } ->then : (onfulfilled?: ((value: void) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>then : (onfulfilled?: ((value: void) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => { if (1 < 2) { return 'SOMETHING'; } return 'SOMETHING'; } : () => "SOMETHING" if (1 < 2) { diff --git a/tests/baselines/reference/jsFileCompilationAwaitModifier.types b/tests/baselines/reference/jsFileCompilationAwaitModifier.types index b4fe2405adadf..8b71bdc6ddeaf 100644 --- a/tests/baselines/reference/jsFileCompilationAwaitModifier.types +++ b/tests/baselines/reference/jsFileCompilationAwaitModifier.types @@ -8,9 +8,9 @@ class Foo { await Promise.resolve(1); >await Promise.resolve(1) : number >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 } @@ -21,9 +21,9 @@ class Foo { await Promise.resolve(1); >await Promise.resolve(1) : number >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 } } diff --git a/tests/baselines/reference/jsdocArrayObjectPromiseImplicitAny.types b/tests/baselines/reference/jsdocArrayObjectPromiseImplicitAny.types index 3fab5033c2305..8bfec84987bf1 100644 --- a/tests/baselines/reference/jsdocArrayObjectPromiseImplicitAny.types +++ b/tests/baselines/reference/jsdocArrayObjectPromiseImplicitAny.types @@ -27,18 +27,18 @@ function returnAnyArray(arr) { var anyPromise = Promise.resolve(5); >anyPromise : Promise >Promise.resolve(5) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >5 : 5 /** @type {Promise} */ var numberPromise = Promise.resolve(5); >numberPromise : Promise >Promise.resolve(5) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >5 : 5 /** diff --git a/tests/baselines/reference/jsdocArrayObjectPromiseNoImplicitAny.types b/tests/baselines/reference/jsdocArrayObjectPromiseNoImplicitAny.types index 82ff886f1ec68..e846ada0294ad 100644 --- a/tests/baselines/reference/jsdocArrayObjectPromiseNoImplicitAny.types +++ b/tests/baselines/reference/jsdocArrayObjectPromiseNoImplicitAny.types @@ -27,18 +27,18 @@ function returnNotAnyArray(arr) { var notAnyPromise = Promise.resolve(5); >notAnyPromise : Promise >Promise.resolve(5) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >5 : 5 /** @type {Promise} */ var numberPromise = Promise.resolve(5); >numberPromise : Promise >Promise.resolve(5) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >5 : 5 /** diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types index c9a0476c2adcf..f25dd08ae1ab6 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types @@ -148,10 +148,10 @@ declare var console: any; out().then(() => { >out().then(() => { console.log("Yea!");}) : Promise ->out().then : (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>out().then : (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >out() : Promise >out : () => Promise ->then : (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => { console.log("Yea!");} : () => void console.log("Yea!"); diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types index a695213a42ccd..105969d7a24fe 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types @@ -148,10 +148,10 @@ declare var console: any; out().then(() => { >out().then(() => { console.log("Yea!");}) : Promise ->out().then : (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>out().then : (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >out() : Promise >out : () => Promise ->then : (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => { console.log("Yea!");} : () => void console.log("Yea!"); diff --git a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types index 3e7c23fde87ac..87ef0159c4558 100644 --- a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types +++ b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types @@ -148,10 +148,10 @@ declare var console: any; out().then(() => { >out().then(() => { console.log("Yea!");}) : Promise ->out().then : (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>out().then : (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >out() : Promise >out : () => Promise ->then : (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => { console.log("Yea!");} : () => void console.log("Yea!"); diff --git a/tests/baselines/reference/noImplicitReturnsInAsync1.types b/tests/baselines/reference/noImplicitReturnsInAsync1.types index dd468d33e6e21..1198e8208e134 100644 --- a/tests/baselines/reference/noImplicitReturnsInAsync1.types +++ b/tests/baselines/reference/noImplicitReturnsInAsync1.types @@ -15,8 +15,8 @@ async function test(isError: boolean = false) { >x : string >await Promise.resolve("The test is passed without an error.") : string >Promise.resolve("The test is passed without an error.") : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >"The test is passed without an error." : "The test is passed without an error." } diff --git a/tests/baselines/reference/optionalFunctionArgAssignability.types b/tests/baselines/reference/optionalFunctionArgAssignability.types index a1975cc3645e0..e4e9dc5760480 100644 --- a/tests/baselines/reference/optionalFunctionArgAssignability.types +++ b/tests/baselines/reference/optionalFunctionArgAssignability.types @@ -1,7 +1,7 @@ === tests/cases/compiler/optionalFunctionArgAssignability.ts === interface Promise { then(onFulfill?: (value: T) => U, onReject?: (reason: any) => U): Promise; ->then : { (onfulfilled?: (value: T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (onFulfill?: (value: T) => U, onReject?: (reason: any) => U): Promise; } +>then : { (onfulfilled?: (value: awaited T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (onFulfill?: (value: T) => U, onReject?: (reason: any) => U): Promise; } >onFulfill : (value: T) => U >value : T >onReject : (reason: any) => U diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index 8b70977a0e5a2..742f56f117f6a 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -117,14 +117,18 @@ tests/cases/compiler/promisePermutations.ts(158,21): error TS2769: No overload m tests/cases/compiler/promisePermutations.ts(159,21): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. + Call signature return types 'Promise' and 'Promise' are incompatible. + The types of 'then' are incompatible between these types. + Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. + Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. + Types of parameters 'value' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. Call signature return types 'Promise' and 'IPromise' are incompatible. The types of 'then' are incompatible between these types. - Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. + Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. Types of parameters 'onfulfilled' and 'success' are incompatible. Types of parameters 'value' and 'value' are incompatible. Type 'number' is not assignable to type 'string'. @@ -473,8 +477,12 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! error TS2769: No overload matches this call. !!! error TS2769: The last overload gave the following error. !!! error TS2769: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. -!!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! error TS2769: Call signature return types 'Promise' and 'Promise' are incompatible. +!!! error TS2769: The types of 'then' are incompatible between these types. +!!! error TS2769: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. +!!! error TS2769: Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. +!!! error TS2769: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2769: Type 'number' is not assignable to type 'string'. !!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~~ @@ -483,7 +491,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! error TS2769: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. !!! error TS2769: Call signature return types 'Promise' and 'IPromise' are incompatible. !!! error TS2769: The types of 'then' are incompatible between these types. -!!! error TS2769: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. +!!! error TS2769: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. !!! error TS2769: Types of parameters 'onfulfilled' and 'success' are incompatible. !!! error TS2769: Types of parameters 'value' and 'value' are incompatible. !!! error TS2769: Type 'number' is not assignable to type 'string'. diff --git a/tests/baselines/reference/promisePermutations.types b/tests/baselines/reference/promisePermutations.types index 9a4607fb75d61..d7b0e33e47d1b 100644 --- a/tests/baselines/reference/promisePermutations.types +++ b/tests/baselines/reference/promisePermutations.types @@ -1,7 +1,7 @@ === tests/cases/compiler/promisePermutations.ts === interface Promise { then(success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; ->then : { (onfulfilled?: (value: T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: awaited T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >success : (value: T) => Promise >value : T >error : (error: any) => Promise @@ -10,7 +10,7 @@ interface Promise { >progress : any then(success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; ->then : { (onfulfilled?: (value: T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: awaited T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >success : (value: T) => Promise >value : T >error : (error: any) => U @@ -19,7 +19,7 @@ interface Promise { >progress : any then(success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; ->then : { (onfulfilled?: (value: T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: awaited T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >success : (value: T) => U >value : T >error : (error: any) => Promise @@ -28,7 +28,7 @@ interface Promise { >progress : any then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; ->then : { (onfulfilled?: (value: T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: awaited T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >success : (value: T) => U >value : T >error : (error: any) => U @@ -272,9 +272,9 @@ var s1: Promise; var s1a = s1.then(testFunction, testFunction, testFunction); >s1a : Promise> >s1.then(testFunction, testFunction, testFunction) : Promise> ->s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s1 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction : () => IPromise >testFunction : () => IPromise >testFunction : () => IPromise @@ -282,9 +282,9 @@ var s1a = s1.then(testFunction, testFunction, testFunction); var s1b = s1.then(testFunctionP, testFunctionP, testFunctionP); >s1b : Promise >s1.then(testFunctionP, testFunctionP, testFunctionP) : Promise ->s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s1 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunctionP : () => Promise >testFunctionP : () => Promise >testFunctionP : () => Promise @@ -292,9 +292,9 @@ var s1b = s1.then(testFunctionP, testFunctionP, testFunctionP); var s1c = s1.then(testFunctionP, testFunction, testFunction); >s1c : Promise> >s1.then(testFunctionP, testFunction, testFunction) : Promise> ->s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s1 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunctionP : () => Promise >testFunction : () => IPromise >testFunction : () => IPromise @@ -302,15 +302,15 @@ var s1c = s1.then(testFunctionP, testFunction, testFunction); var s1d = s1.then(testFunctionP, testFunction, testFunction).then(testFunction, testFunction, testFunction); >s1d : Promise> >s1.then(testFunctionP, testFunction, testFunction).then(testFunction, testFunction, testFunction) : Promise> ->s1.then(testFunctionP, testFunction, testFunction).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s1.then(testFunctionP, testFunction, testFunction).then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s1.then(testFunctionP, testFunction, testFunction) : Promise> ->s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s1 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunctionP : () => Promise >testFunction : () => IPromise >testFunction : () => IPromise ->then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction : () => IPromise >testFunction : () => IPromise >testFunction : () => IPromise @@ -352,9 +352,9 @@ var s2: Promise<{ x: number; }>; var s2a = s2.then(testFunction2, testFunction2, testFunction2); >s2a : Promise> >s2.then(testFunction2, testFunction2, testFunction2) : Promise> ->s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s2 : Promise<{ x: number; }> ->then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction2 : () => IPromise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> @@ -362,9 +362,9 @@ var s2a = s2.then(testFunction2, testFunction2, testFunction2); var s2b = s2.then(testFunction2P, testFunction2P, testFunction2P); >s2b : Promise<{ x: number; }> >s2.then(testFunction2P, testFunction2P, testFunction2P) : Promise<{ x: number; }> ->s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s2 : Promise<{ x: number; }> ->then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction2P : () => Promise<{ x: number; }> >testFunction2P : () => Promise<{ x: number; }> >testFunction2P : () => Promise<{ x: number; }> @@ -372,9 +372,9 @@ var s2b = s2.then(testFunction2P, testFunction2P, testFunction2P); var s2c = s2.then(testFunction2P, testFunction2, testFunction2); >s2c : Promise> >s2.then(testFunction2P, testFunction2, testFunction2) : Promise> ->s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s2 : Promise<{ x: number; }> ->then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction2P : () => Promise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> @@ -382,15 +382,15 @@ var s2c = s2.then(testFunction2P, testFunction2, testFunction2); var s2d = s2.then(testFunction2P, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); >s2d : Promise> >s2.then(testFunction2P, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2) : Promise> ->s2.then(testFunction2P, testFunction2, testFunction2).then : { , TResult2 = never>(onfulfilled?: (value: IPromise<{ x: number; }>) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise<{ x: number; }>) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s2.then(testFunction2P, testFunction2, testFunction2).then : { , TResult2 = never>(onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise<{ x: number; }>) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s2.then(testFunction2P, testFunction2, testFunction2) : Promise> ->s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s2 : Promise<{ x: number; }> ->then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction2P : () => Promise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> ->then : { , TResult2 = never>(onfulfilled?: (value: IPromise<{ x: number; }>) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise<{ x: number; }>) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise<{ x: number; }>) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction2 : () => IPromise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> @@ -430,9 +430,9 @@ var s3: Promise; var s3a = s3.then(testFunction3, testFunction3, testFunction3); >s3a : Promise> >s3.then(testFunction3, testFunction3, testFunction3) : Promise> ->s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s3 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction3 : (x: number) => IPromise >testFunction3 : (x: number) => IPromise >testFunction3 : (x: number) => IPromise @@ -440,9 +440,9 @@ var s3a = s3.then(testFunction3, testFunction3, testFunction3); var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); >s3b : Promise >s3.then(testFunction3P, testFunction3P, testFunction3P) : Promise ->s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s3 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction3P : (x: number) => Promise >testFunction3P : (x: number) => Promise >testFunction3P : (x: number) => Promise @@ -450,9 +450,9 @@ var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); var s3c = s3.then(testFunction3P, testFunction3, testFunction3); >s3c : Promise> >s3.then(testFunction3P, testFunction3, testFunction3) : Promise> ->s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s3 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction3P : (x: number) => Promise >testFunction3 : (x: number) => IPromise >testFunction3 : (x: number) => IPromise @@ -460,15 +460,15 @@ var s3c = s3.then(testFunction3P, testFunction3, testFunction3); var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); // error >s3d : Promise >s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3) : Promise ->s3.then(testFunction3P, testFunction3, testFunction3).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s3.then(testFunction3P, testFunction3, testFunction3).then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s3.then(testFunction3P, testFunction3, testFunction3) : Promise> ->s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s3 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction3P : (x: number) => Promise >testFunction3 : (x: number) => IPromise >testFunction3 : (x: number) => IPromise ->then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction3 : (x: number) => IPromise >testFunction3 : (x: number) => IPromise >testFunction3 : (x: number) => IPromise @@ -516,9 +516,9 @@ var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error >s4a : Promise >s4.then(testFunction4, testFunction4, testFunction4) : Promise ->s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction4 : (x: number, y?: string) => IPromise >testFunction4 : (x: number, y?: string) => IPromise >testFunction4 : (x: number, y?: string) => IPromise @@ -526,9 +526,9 @@ var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error >s4b : Promise >s4.then(testFunction4P, testFunction4P, testFunction4P) : Promise ->s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction4P : (x: number, y?: string) => Promise >testFunction4P : (x: number, y?: string) => Promise >testFunction4P : (x: number, y?: string) => Promise @@ -536,9 +536,9 @@ var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error >s4c : Promise >s4.then(testFunction4P, testFunction4, testFunction4) : Promise ->s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction4P : (x: number, y?: string) => Promise >testFunction4 : (x: number, y?: string) => IPromise >testFunction4 : (x: number, y?: string) => IPromise @@ -546,15 +546,15 @@ var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); >s4d : Promise> >s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4) : Promise> ->s4.then(sIPromise, testFunction4P, testFunction4).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s4.then(sIPromise, testFunction4P, testFunction4).then : { , TResult2 = never>(onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4.then(sIPromise, testFunction4P, testFunction4) : Promise> ->s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sIPromise : (x: any) => IPromise >testFunction4P : (x: number, y?: string) => Promise >testFunction4 : (x: number, y?: string) => IPromise ->then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sIPromise : (x: any) => IPromise >testFunction4P : (x: number, y?: string) => Promise >testFunction4 : (x: number, y?: string) => IPromise @@ -594,9 +594,9 @@ var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error >s5a : Promise >s5.then(testFunction5, testFunction5, testFunction5) : Promise ->s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction5 : (x: number, cb: (a: string) => string) => IPromise >testFunction5 : (x: number, cb: (a: string) => string) => IPromise >testFunction5 : (x: number, cb: (a: string) => string) => IPromise @@ -604,9 +604,9 @@ var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error >s5b : Promise >s5.then(testFunction5P, testFunction5P, testFunction5P) : Promise ->s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction5P : (x: number, cb: (a: string) => string) => Promise >testFunction5P : (x: number, cb: (a: string) => string) => Promise >testFunction5P : (x: number, cb: (a: string) => string) => Promise @@ -614,9 +614,9 @@ var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error >s5c : Promise >s5.then(testFunction5P, testFunction5, testFunction5) : Promise ->s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction5P : (x: number, cb: (a: string) => string) => Promise >testFunction5 : (x: number, cb: (a: string) => string) => IPromise >testFunction5 : (x: number, cb: (a: string) => string) => IPromise @@ -624,15 +624,15 @@ var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok >s5d : Promise> >s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise) : Promise> ->s5.then(sPromise, sPromise, sPromise).then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s5.then(sPromise, sPromise, sPromise).then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5.then(sPromise, sPromise, sPromise) : Promise ->s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise @@ -672,9 +672,9 @@ var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error >s6a : Promise >s6.then(testFunction6, testFunction6, testFunction6) : Promise ->s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction6 : (x: number, cb: (a: T) => T) => IPromise >testFunction6 : (x: number, cb: (a: T) => T) => IPromise >testFunction6 : (x: number, cb: (a: T) => T) => IPromise @@ -682,9 +682,9 @@ var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error >s6b : Promise >s6.then(testFunction6P, testFunction6P, testFunction6P) : Promise ->s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction6P : (x: number, cb: (a: T) => T) => Promise >testFunction6P : (x: number, cb: (a: T) => T) => Promise >testFunction6P : (x: number, cb: (a: T) => T) => Promise @@ -692,9 +692,9 @@ var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error >s6c : Promise >s6.then(testFunction6P, testFunction6, testFunction6) : Promise ->s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction6P : (x: number, cb: (a: T) => T) => Promise >testFunction6 : (x: number, cb: (a: T) => T) => IPromise >testFunction6 : (x: number, cb: (a: T) => T) => IPromise @@ -702,15 +702,15 @@ var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok >s6d : Promise> >s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise) : Promise> ->s6.then(sPromise, sPromise, sPromise).then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s6.then(sPromise, sPromise, sPromise).then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6.then(sPromise, sPromise, sPromise) : Promise ->s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise @@ -836,9 +836,9 @@ var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error >s8a : Promise >s8.then(testFunction8, testFunction8, testFunction8) : Promise ->s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction8 : (x: T, cb: (a: T) => T) => IPromise >testFunction8 : (x: T, cb: (a: T) => T) => IPromise >testFunction8 : (x: T, cb: (a: T) => T) => IPromise @@ -846,9 +846,9 @@ var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error >s8b : Promise >s8.then(testFunction8P, testFunction8P, testFunction8P) : Promise ->s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction8P : (x: T, cb: (a: T) => T) => Promise >testFunction8P : (x: T, cb: (a: T) => T) => Promise >testFunction8P : (x: T, cb: (a: T) => T) => Promise @@ -856,9 +856,9 @@ var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error >s8c : Promise >s8.then(testFunction8P, testFunction8, testFunction8) : Promise ->s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction8P : (x: T, cb: (a: T) => T) => Promise >testFunction8 : (x: T, cb: (a: T) => T) => IPromise >testFunction8 : (x: T, cb: (a: T) => T) => IPromise @@ -866,15 +866,15 @@ var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok >s8d : Promise> >s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise) : Promise> ->s8.then(nIPromise, nIPromise, nIPromise).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s8.then(nIPromise, nIPromise, nIPromise).then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8.then(nIPromise, nIPromise, nIPromise) : Promise> ->s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >nIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise ->then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >nIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise @@ -944,9 +944,9 @@ var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error >s9a : Promise >s9.then(testFunction9, testFunction9, testFunction9) : Promise ->s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction9 : (x: T, cb: (a: U) => U) => IPromise >testFunction9 : (x: T, cb: (a: U) => U) => IPromise >testFunction9 : (x: T, cb: (a: U) => U) => IPromise @@ -954,9 +954,9 @@ var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error >s9b : Promise >s9.then(testFunction9P, testFunction9P, testFunction9P) : Promise ->s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction9P : (x: T, cb: (a: U) => U) => Promise >testFunction9P : (x: T, cb: (a: U) => U) => Promise >testFunction9P : (x: T, cb: (a: U) => U) => Promise @@ -964,9 +964,9 @@ var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error >s9c : Promise >s9.then(testFunction9P, testFunction9, testFunction9) : Promise ->s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction9P : (x: T, cb: (a: U) => U) => Promise >testFunction9 : (x: T, cb: (a: U) => U) => IPromise >testFunction9 : (x: T, cb: (a: U) => U) => IPromise @@ -974,9 +974,9 @@ var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error var s9d = s9.then(sPromise, sPromise, sPromise); // ok >s9d : Promise >s9.then(sPromise, sPromise, sPromise) : Promise ->s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise @@ -984,9 +984,9 @@ var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok >s9e : Promise >s9.then(nPromise, nPromise, nPromise) : Promise ->s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >nPromise : (x: any) => Promise >nPromise : (x: any) => Promise >nPromise : (x: any) => Promise @@ -994,9 +994,9 @@ var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error >s9f : Promise >s9.then(testFunction, sIPromise, nIPromise) : Promise ->s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction : () => IPromise >sIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise @@ -1004,15 +1004,15 @@ var s9f = s9.then(testFunction, sIPromise, nIPromise); // error var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok >s9g : Promise> >s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise) : Promise> ->s9.then(testFunction, nIPromise, sIPromise).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then(testFunction, nIPromise, sIPromise).then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9.then(testFunction, nIPromise, sIPromise) : Promise> ->s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction : () => IPromise >nIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise ->then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise @@ -1092,9 +1092,9 @@ var s10 = testFunction10P(x => x); var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok >s10a : Promise> >s10.then(testFunction10, testFunction10, testFunction10) : Promise> ->s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise ->then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise @@ -1102,9 +1102,9 @@ var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); // ok >s10b : Promise >s10.then(testFunction10P, testFunction10P, testFunction10P) : Promise ->s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise ->then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction10P : (cb: (a: U) => U) => Promise >testFunction10P : (cb: (a: U) => U) => Promise >testFunction10P : (cb: (a: U) => U) => Promise @@ -1112,9 +1112,9 @@ var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); // ok var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok >s10c : Promise >s10.then(testFunction10P, testFunction10, testFunction10) : Promise ->s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise ->then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction10P : (cb: (a: U) => U) => Promise >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise @@ -1122,9 +1122,9 @@ var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok var s10d = s10.then(sPromise, sPromise, sPromise); // ok >s10d : Promise >s10.then(sPromise, sPromise, sPromise) : Promise ->s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise ->then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise @@ -1132,9 +1132,9 @@ var s10d = s10.then(sPromise, sPromise, sPromise); // ok var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok >s10e : Promise> >s10.then(nIPromise, nPromise, nIPromise) : Promise> ->s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise ->then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >nIPromise : (x: any) => IPromise >nPromise : (x: any) => Promise >nIPromise : (x: any) => IPromise @@ -1142,9 +1142,9 @@ var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error >s10f : Promise >s10.then(testFunctionP, sIPromise, nIPromise) : Promise ->s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise ->then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunctionP : () => Promise >sIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise @@ -1152,15 +1152,15 @@ var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok >s10g : Promise> >s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise) : Promise> ->s10.then(testFunctionP, nIPromise, sIPromise).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then(testFunctionP, nIPromise, sIPromise).then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10.then(testFunctionP, nIPromise, sIPromise) : Promise> ->s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise ->then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunctionP : () => Promise >nIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise ->then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sPromise : (x: any) => Promise >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise @@ -1184,9 +1184,9 @@ var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok >s11a : Promise >s11.then(testFunction11, testFunction11, testFunction11) : Promise ->s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s11 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction11 : { (x: number): IPromise; (x: string): IPromise; } >testFunction11 : { (x: number): IPromise; (x: string): IPromise; } >testFunction11 : { (x: number): IPromise; (x: string): IPromise; } @@ -1194,9 +1194,9 @@ var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error >s11b : Promise >s11.then(testFunction11P, testFunction11P, testFunction11P) : Promise ->s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s11 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction11P : { (x: number): Promise; (x: string): Promise; } >testFunction11P : { (x: number): Promise; (x: string): Promise; } >testFunction11P : { (x: number): Promise; (x: string): Promise; } @@ -1204,9 +1204,9 @@ var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error >s11c : Promise >s11.then(testFunction11P, testFunction11, testFunction11) : Promise ->s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s11 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction11P : { (x: number): Promise; (x: string): Promise; } >testFunction11 : { (x: number): IPromise; (x: string): IPromise; } >testFunction11 : { (x: number): IPromise; (x: string): IPromise; } diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index bc676c9dd5e85..4cc2f1cc0cfc2 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -77,12 +77,16 @@ tests/cases/compiler/promisePermutations2.ts(155,21): error TS2769: No overload tests/cases/compiler/promisePermutations2.ts(157,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. tests/cases/compiler/promisePermutations2.ts(158,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. + Call signature return types 'Promise' and 'Promise' are incompatible. + The types of 'then' are incompatible between these types. + Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. + Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. + Types of parameters 'value' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. Call signature return types 'Promise' and 'IPromise' are incompatible. The types of 'then' are incompatible between these types. - Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. + Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. Types of parameters 'onfulfilled' and 'success' are incompatible. Types of parameters 'value' and 'value' are incompatible. Type 'number' is not assignable to type 'string'. @@ -371,14 +375,18 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // ok ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Call signature return types 'Promise' and 'Promise' are incompatible. +!!! error TS2345: The types of 'then' are incompatible between these types. +!!! error TS2345: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. +!!! error TS2345: Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. +!!! error TS2345: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. !!! error TS2345: Call signature return types 'Promise' and 'IPromise' are incompatible. !!! error TS2345: The types of 'then' are incompatible between these types. -!!! error TS2345: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. +!!! error TS2345: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. !!! error TS2345: Types of parameters 'onfulfilled' and 'success' are incompatible. !!! error TS2345: Types of parameters 'value' and 'value' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. diff --git a/tests/baselines/reference/promisePermutations2.types b/tests/baselines/reference/promisePermutations2.types index 49a704375bac0..e72a2c3eace68 100644 --- a/tests/baselines/reference/promisePermutations2.types +++ b/tests/baselines/reference/promisePermutations2.types @@ -3,7 +3,7 @@ interface Promise { then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; ->then : { (onfulfilled?: (value: T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: awaited T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >success : (value: T) => U >value : T >error : (error: any) => U @@ -247,9 +247,9 @@ var s1: Promise; var s1a = s1.then(testFunction, testFunction, testFunction); >s1a : Promise> >s1.then(testFunction, testFunction, testFunction) : Promise> ->s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s1 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction : () => IPromise >testFunction : () => IPromise >testFunction : () => IPromise @@ -257,9 +257,9 @@ var s1a = s1.then(testFunction, testFunction, testFunction); var s1b = s1.then(testFunctionP, testFunctionP, testFunctionP); >s1b : Promise> >s1.then(testFunctionP, testFunctionP, testFunctionP) : Promise> ->s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s1 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunctionP : () => Promise >testFunctionP : () => Promise >testFunctionP : () => Promise @@ -267,9 +267,9 @@ var s1b = s1.then(testFunctionP, testFunctionP, testFunctionP); var s1c = s1.then(testFunctionP, testFunction, testFunction); >s1c : Promise> >s1.then(testFunctionP, testFunction, testFunction) : Promise> ->s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s1 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunctionP : () => Promise >testFunction : () => IPromise >testFunction : () => IPromise @@ -277,15 +277,15 @@ var s1c = s1.then(testFunctionP, testFunction, testFunction); var s1d = s1.then(testFunctionP, testFunction, testFunction).then(testFunction, testFunction, testFunction); >s1d : Promise> >s1.then(testFunctionP, testFunction, testFunction).then(testFunction, testFunction, testFunction) : Promise> ->s1.then(testFunctionP, testFunction, testFunction).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s1.then(testFunctionP, testFunction, testFunction).then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s1.then(testFunctionP, testFunction, testFunction) : Promise> ->s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s1 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunctionP : () => Promise >testFunction : () => IPromise >testFunction : () => IPromise ->then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction : () => IPromise >testFunction : () => IPromise >testFunction : () => IPromise @@ -327,9 +327,9 @@ var s2: Promise<{ x: number; }>; var s2a = s2.then(testFunction2, testFunction2, testFunction2); >s2a : Promise> >s2.then(testFunction2, testFunction2, testFunction2) : Promise> ->s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s2 : Promise<{ x: number; }> ->then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction2 : () => IPromise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> @@ -337,9 +337,9 @@ var s2a = s2.then(testFunction2, testFunction2, testFunction2); var s2b = s2.then(testFunction2P, testFunction2P, testFunction2P); >s2b : Promise> >s2.then(testFunction2P, testFunction2P, testFunction2P) : Promise> ->s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s2 : Promise<{ x: number; }> ->then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction2P : () => Promise<{ x: number; }> >testFunction2P : () => Promise<{ x: number; }> >testFunction2P : () => Promise<{ x: number; }> @@ -347,9 +347,9 @@ var s2b = s2.then(testFunction2P, testFunction2P, testFunction2P); var s2c = s2.then(testFunction2P, testFunction2, testFunction2); >s2c : Promise> >s2.then(testFunction2P, testFunction2, testFunction2) : Promise> ->s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s2 : Promise<{ x: number; }> ->then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction2P : () => Promise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> @@ -357,15 +357,15 @@ var s2c = s2.then(testFunction2P, testFunction2, testFunction2); var s2d = s2.then(testFunction2P, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); >s2d : Promise> >s2.then(testFunction2P, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2) : Promise> ->s2.then(testFunction2P, testFunction2, testFunction2).then : { , TResult2 = never>(onfulfilled?: (value: IPromise<{ x: number; }>) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise<{ x: number; }>) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s2.then(testFunction2P, testFunction2, testFunction2).then : { , TResult2 = never>(onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise<{ x: number; }>) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s2.then(testFunction2P, testFunction2, testFunction2) : Promise> ->s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s2 : Promise<{ x: number; }> ->then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction2P : () => Promise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> ->then : { , TResult2 = never>(onfulfilled?: (value: IPromise<{ x: number; }>) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise<{ x: number; }>) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise<{ x: number; }>) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction2 : () => IPromise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> @@ -405,9 +405,9 @@ var s3: Promise; var s3a = s3.then(testFunction3, testFunction3, testFunction3); >s3a : Promise> >s3.then(testFunction3, testFunction3, testFunction3) : Promise> ->s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s3 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction3 : (x: number) => IPromise >testFunction3 : (x: number) => IPromise >testFunction3 : (x: number) => IPromise @@ -415,9 +415,9 @@ var s3a = s3.then(testFunction3, testFunction3, testFunction3); var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); >s3b : Promise> >s3.then(testFunction3P, testFunction3P, testFunction3P) : Promise> ->s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s3 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction3P : (x: number) => Promise >testFunction3P : (x: number) => Promise >testFunction3P : (x: number) => Promise @@ -425,9 +425,9 @@ var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); var s3c = s3.then(testFunction3P, testFunction3, testFunction3); >s3c : Promise> >s3.then(testFunction3P, testFunction3, testFunction3) : Promise> ->s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s3 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction3P : (x: number) => Promise >testFunction3 : (x: number) => IPromise >testFunction3 : (x: number) => IPromise @@ -435,15 +435,15 @@ var s3c = s3.then(testFunction3P, testFunction3, testFunction3); var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); // Should error >s3d : Promise> >s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3) : Promise> ->s3.then(testFunction3P, testFunction3, testFunction3).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s3.then(testFunction3P, testFunction3, testFunction3).then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s3.then(testFunction3P, testFunction3, testFunction3) : Promise> ->s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s3 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction3P : (x: number) => Promise >testFunction3 : (x: number) => IPromise >testFunction3 : (x: number) => IPromise ->then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction3 : (x: number) => IPromise >testFunction3 : (x: number) => IPromise >testFunction3 : (x: number) => IPromise @@ -491,9 +491,9 @@ var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error >s4a : Promise> >s4.then(testFunction4, testFunction4, testFunction4) : Promise> ->s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction4 : (x: number, y?: string) => IPromise >testFunction4 : (x: number, y?: string) => IPromise >testFunction4 : (x: number, y?: string) => IPromise @@ -501,9 +501,9 @@ var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error >s4b : Promise> >s4.then(testFunction4P, testFunction4P, testFunction4P) : Promise> ->s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction4P : (x: number, y?: string) => Promise >testFunction4P : (x: number, y?: string) => Promise >testFunction4P : (x: number, y?: string) => Promise @@ -511,9 +511,9 @@ var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error >s4c : Promise> >s4.then(testFunction4P, testFunction4, testFunction4) : Promise> ->s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction4P : (x: number, y?: string) => Promise >testFunction4 : (x: number, y?: string) => IPromise >testFunction4 : (x: number, y?: string) => IPromise @@ -521,15 +521,15 @@ var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); >s4d : Promise> >s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4) : Promise> ->s4.then(sIPromise, testFunction4P, testFunction4).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s4.then(sIPromise, testFunction4P, testFunction4).then : { , TResult2 = never>(onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4.then(sIPromise, testFunction4P, testFunction4) : Promise> ->s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sIPromise : (x: any) => IPromise >testFunction4P : (x: number, y?: string) => Promise >testFunction4 : (x: number, y?: string) => IPromise ->then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sIPromise : (x: any) => IPromise >testFunction4P : (x: number, y?: string) => Promise >testFunction4 : (x: number, y?: string) => IPromise @@ -569,9 +569,9 @@ var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error >s5a : Promise> >s5.then(testFunction5, testFunction5, testFunction5) : Promise> ->s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction5 : (x: number, cb: (a: string) => string) => IPromise >testFunction5 : (x: number, cb: (a: string) => string) => IPromise >testFunction5 : (x: number, cb: (a: string) => string) => IPromise @@ -579,9 +579,9 @@ var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error >s5b : Promise> >s5.then(testFunction5P, testFunction5P, testFunction5P) : Promise> ->s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction5P : (x: number, cb: (a: string) => string) => Promise >testFunction5P : (x: number, cb: (a: string) => string) => Promise >testFunction5P : (x: number, cb: (a: string) => string) => Promise @@ -589,9 +589,9 @@ var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error >s5c : Promise> >s5.then(testFunction5P, testFunction5, testFunction5) : Promise> ->s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction5P : (x: number, cb: (a: string) => string) => Promise >testFunction5 : (x: number, cb: (a: string) => string) => IPromise >testFunction5 : (x: number, cb: (a: string) => string) => IPromise @@ -599,15 +599,15 @@ var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok >s5d : Promise> >s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise) : Promise> ->s5.then(sPromise, sPromise, sPromise).then : { , TResult2 = never>(onfulfilled?: (value: Promise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: Promise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s5.then(sPromise, sPromise, sPromise).then : { , TResult2 = never>(onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: Promise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5.then(sPromise, sPromise, sPromise) : Promise> ->s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise ->then : { , TResult2 = never>(onfulfilled?: (value: Promise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: Promise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: Promise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise @@ -647,9 +647,9 @@ var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error >s6a : Promise> >s6.then(testFunction6, testFunction6, testFunction6) : Promise> ->s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction6 : (x: number, cb: (a: T) => T) => IPromise >testFunction6 : (x: number, cb: (a: T) => T) => IPromise >testFunction6 : (x: number, cb: (a: T) => T) => IPromise @@ -657,9 +657,9 @@ var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error >s6b : Promise> >s6.then(testFunction6P, testFunction6P, testFunction6P) : Promise> ->s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction6P : (x: number, cb: (a: T) => T) => Promise >testFunction6P : (x: number, cb: (a: T) => T) => Promise >testFunction6P : (x: number, cb: (a: T) => T) => Promise @@ -667,9 +667,9 @@ var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error >s6c : Promise> >s6.then(testFunction6P, testFunction6, testFunction6) : Promise> ->s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction6P : (x: number, cb: (a: T) => T) => Promise >testFunction6 : (x: number, cb: (a: T) => T) => IPromise >testFunction6 : (x: number, cb: (a: T) => T) => IPromise @@ -677,15 +677,15 @@ var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok >s6d : Promise> >s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise) : Promise> ->s6.then(sPromise, sPromise, sPromise).then : { , TResult2 = never>(onfulfilled?: (value: Promise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: Promise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s6.then(sPromise, sPromise, sPromise).then : { , TResult2 = never>(onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: Promise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6.then(sPromise, sPromise, sPromise) : Promise> ->s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise ->then : { , TResult2 = never>(onfulfilled?: (value: Promise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: Promise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: Promise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise @@ -811,9 +811,9 @@ var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error >s8a : Promise >s8.then(testFunction8, testFunction8, testFunction8) : Promise ->s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction8 : (x: T, cb: (a: T) => T) => IPromise >testFunction8 : (x: T, cb: (a: T) => T) => IPromise >testFunction8 : (x: T, cb: (a: T) => T) => IPromise @@ -821,9 +821,9 @@ var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error >s8b : Promise >s8.then(testFunction8P, testFunction8P, testFunction8P) : Promise ->s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction8P : (x: T, cb: (a: T) => T) => Promise >testFunction8P : (x: T, cb: (a: T) => T) => Promise >testFunction8P : (x: T, cb: (a: T) => T) => Promise @@ -831,9 +831,9 @@ var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error >s8c : Promise >s8.then(testFunction8P, testFunction8, testFunction8) : Promise ->s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction8P : (x: T, cb: (a: T) => T) => Promise >testFunction8 : (x: T, cb: (a: T) => T) => IPromise >testFunction8 : (x: T, cb: (a: T) => T) => IPromise @@ -841,15 +841,15 @@ var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok >s8d : Promise> >s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise) : Promise> ->s8.then(nIPromise, nIPromise, nIPromise).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s8.then(nIPromise, nIPromise, nIPromise).then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8.then(nIPromise, nIPromise, nIPromise) : Promise> ->s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >nIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise ->then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >nIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise @@ -919,9 +919,9 @@ var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error >s9a : Promise >s9.then(testFunction9, testFunction9, testFunction9) : Promise ->s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction9 : (x: T, cb: (a: U) => U) => IPromise >testFunction9 : (x: T, cb: (a: U) => U) => IPromise >testFunction9 : (x: T, cb: (a: U) => U) => IPromise @@ -929,9 +929,9 @@ var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error >s9b : Promise >s9.then(testFunction9P, testFunction9P, testFunction9P) : Promise ->s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction9P : (x: T, cb: (a: U) => U) => Promise >testFunction9P : (x: T, cb: (a: U) => U) => Promise >testFunction9P : (x: T, cb: (a: U) => U) => Promise @@ -939,9 +939,9 @@ var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error >s9c : Promise >s9.then(testFunction9P, testFunction9, testFunction9) : Promise ->s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction9P : (x: T, cb: (a: U) => U) => Promise >testFunction9 : (x: T, cb: (a: U) => U) => IPromise >testFunction9 : (x: T, cb: (a: U) => U) => IPromise @@ -949,9 +949,9 @@ var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error var s9d = s9.then(sPromise, sPromise, sPromise); // ok >s9d : Promise> >s9.then(sPromise, sPromise, sPromise) : Promise> ->s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise @@ -959,9 +959,9 @@ var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok >s9e : Promise> >s9.then(nPromise, nPromise, nPromise) : Promise> ->s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >nPromise : (x: any) => Promise >nPromise : (x: any) => Promise >nPromise : (x: any) => Promise @@ -969,9 +969,9 @@ var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error >s9f : Promise> >s9.then(testFunction, sIPromise, nIPromise) : Promise> ->s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction : () => IPromise >sIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise @@ -979,15 +979,15 @@ var s9f = s9.then(testFunction, sIPromise, nIPromise); // error var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok >s9g : Promise> >s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise) : Promise> ->s9.then(testFunction, nIPromise, sIPromise).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then(testFunction, nIPromise, sIPromise).then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9.then(testFunction, nIPromise, sIPromise) : Promise> ->s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction : () => IPromise >nIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise ->then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise @@ -1067,9 +1067,9 @@ var s10 = testFunction10P(x => x); var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok >s10a : Promise> >s10.then(testFunction10, testFunction10, testFunction10) : Promise> ->s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise ->then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise @@ -1077,9 +1077,9 @@ var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); // ok >s10b : Promise> >s10.then(testFunction10P, testFunction10P, testFunction10P) : Promise> ->s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise ->then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction10P : (cb: (a: U) => U) => Promise >testFunction10P : (cb: (a: U) => U) => Promise >testFunction10P : (cb: (a: U) => U) => Promise @@ -1087,9 +1087,9 @@ var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); // ok var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok >s10c : Promise> >s10.then(testFunction10P, testFunction10, testFunction10) : Promise> ->s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise ->then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction10P : (cb: (a: U) => U) => Promise >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise @@ -1097,9 +1097,9 @@ var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok var s10d = s10.then(sPromise, sPromise, sPromise); // ok >s10d : Promise> >s10.then(sPromise, sPromise, sPromise) : Promise> ->s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise ->then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise @@ -1107,9 +1107,9 @@ var s10d = s10.then(sPromise, sPromise, sPromise); // ok var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok >s10e : Promise> >s10.then(nIPromise, nPromise, nIPromise) : Promise> ->s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise ->then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >nIPromise : (x: any) => IPromise >nPromise : (x: any) => Promise >nIPromise : (x: any) => IPromise @@ -1117,9 +1117,9 @@ var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error >s10f : Promise> >s10.then(testFunctionP, sIPromise, nIPromise) : Promise> ->s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise ->then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunctionP : () => Promise >sIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise @@ -1127,15 +1127,15 @@ var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok >s10g : Promise> >s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise) : Promise> ->s10.then(testFunctionP, nIPromise, sIPromise).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then(testFunctionP, nIPromise, sIPromise).then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10.then(testFunctionP, nIPromise, sIPromise) : Promise> ->s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise ->then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunctionP : () => Promise >nIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise ->then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sPromise : (x: any) => Promise >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise @@ -1159,9 +1159,9 @@ var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok >s11a : Promise> >s11.then(testFunction11, testFunction11, testFunction11) : Promise> ->s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s11 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction11 : { (x: number): IPromise; (x: string): IPromise; } >testFunction11 : { (x: number): IPromise; (x: string): IPromise; } >testFunction11 : { (x: number): IPromise; (x: string): IPromise; } @@ -1169,9 +1169,9 @@ var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // ok >s11b : Promise> >s11.then(testFunction11P, testFunction11P, testFunction11P) : Promise> ->s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s11 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction11P : { (x: number): Promise; (x: string): Promise; } >testFunction11P : { (x: number): Promise; (x: string): Promise; } >testFunction11P : { (x: number): Promise; (x: string): Promise; } @@ -1179,9 +1179,9 @@ var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // ok var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // ok >s11c : Promise> >s11.then(testFunction11P, testFunction11, testFunction11) : Promise> ->s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s11 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction11P : { (x: number): Promise; (x: string): Promise; } >testFunction11 : { (x: number): IPromise; (x: string): IPromise; } >testFunction11 : { (x: number): IPromise; (x: string): IPromise; } diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index 7467009abce93..4f47b6bef697c 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -96,14 +96,18 @@ tests/cases/compiler/promisePermutations3.ts(157,21): error TS2769: No overload tests/cases/compiler/promisePermutations3.ts(158,21): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. + Call signature return types 'Promise' and 'Promise' are incompatible. + The types of 'then' are incompatible between these types. + Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. + Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. + Types of parameters 'value' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations3.ts(159,21): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. Call signature return types 'Promise' and 'IPromise' are incompatible. The types of 'then' are incompatible between these types. - Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. + Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. Types of parameters 'onfulfilled' and 'success' are incompatible. Types of parameters 'value' and 'value' are incompatible. Type 'number' is not assignable to type 'string'. @@ -421,8 +425,12 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! error TS2769: No overload matches this call. !!! error TS2769: The last overload gave the following error. !!! error TS2769: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. -!!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! error TS2769: Call signature return types 'Promise' and 'Promise' are incompatible. +!!! error TS2769: The types of 'then' are incompatible between these types. +!!! error TS2769: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. +!!! error TS2769: Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. +!!! error TS2769: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2769: Type 'number' is not assignable to type 'string'. !!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~~ @@ -431,7 +439,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! error TS2769: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. !!! error TS2769: Call signature return types 'Promise' and 'IPromise' are incompatible. !!! error TS2769: The types of 'then' are incompatible between these types. -!!! error TS2769: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. +!!! error TS2769: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. !!! error TS2769: Types of parameters 'onfulfilled' and 'success' are incompatible. !!! error TS2769: Types of parameters 'value' and 'value' are incompatible. !!! error TS2769: Type 'number' is not assignable to type 'string'. diff --git a/tests/baselines/reference/promisePermutations3.types b/tests/baselines/reference/promisePermutations3.types index 9ce0662c27a19..8222252b9232a 100644 --- a/tests/baselines/reference/promisePermutations3.types +++ b/tests/baselines/reference/promisePermutations3.types @@ -3,7 +3,7 @@ interface Promise { then(success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; ->then : { (onfulfilled?: (value: T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: awaited T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >success : (value: T) => Promise >value : T >error : (error: any) => Promise @@ -12,7 +12,7 @@ interface Promise { >progress : any then(success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; ->then : { (onfulfilled?: (value: T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: awaited T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >success : (value: T) => Promise >value : T >error : (error: any) => U @@ -21,7 +21,7 @@ interface Promise { >progress : any then(success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; ->then : { (onfulfilled?: (value: T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: awaited T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >success : (value: T) => U >value : T >error : (error: any) => Promise @@ -30,7 +30,7 @@ interface Promise { >progress : any then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; ->then : { (onfulfilled?: (value: T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: awaited T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >success : (value: T) => U >value : T >error : (error: any) => U @@ -247,9 +247,9 @@ var s1: Promise; var s1a = s1.then(testFunction, testFunction, testFunction); >s1a : Promise> >s1.then(testFunction, testFunction, testFunction) : Promise> ->s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s1 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction : () => IPromise >testFunction : () => IPromise >testFunction : () => IPromise @@ -257,9 +257,9 @@ var s1a = s1.then(testFunction, testFunction, testFunction); var s1b = s1.then(testFunctionP, testFunctionP, testFunctionP); >s1b : Promise >s1.then(testFunctionP, testFunctionP, testFunctionP) : Promise ->s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s1 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunctionP : () => Promise >testFunctionP : () => Promise >testFunctionP : () => Promise @@ -267,9 +267,9 @@ var s1b = s1.then(testFunctionP, testFunctionP, testFunctionP); var s1c = s1.then(testFunctionP, testFunction, testFunction); >s1c : Promise> >s1.then(testFunctionP, testFunction, testFunction) : Promise> ->s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s1 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunctionP : () => Promise >testFunction : () => IPromise >testFunction : () => IPromise @@ -277,15 +277,15 @@ var s1c = s1.then(testFunctionP, testFunction, testFunction); var s1d = s1.then(testFunctionP, testFunction, testFunction).then(testFunction, testFunction, testFunction); >s1d : Promise> >s1.then(testFunctionP, testFunction, testFunction).then(testFunction, testFunction, testFunction) : Promise> ->s1.then(testFunctionP, testFunction, testFunction).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s1.then(testFunctionP, testFunction, testFunction).then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s1.then(testFunctionP, testFunction, testFunction) : Promise> ->s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s1.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s1 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunctionP : () => Promise >testFunction : () => IPromise >testFunction : () => IPromise ->then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction : () => IPromise >testFunction : () => IPromise >testFunction : () => IPromise @@ -327,9 +327,9 @@ var s2: Promise<{ x: number; }>; var s2a = s2.then(testFunction2, testFunction2, testFunction2); >s2a : Promise> >s2.then(testFunction2, testFunction2, testFunction2) : Promise> ->s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s2 : Promise<{ x: number; }> ->then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction2 : () => IPromise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> @@ -337,9 +337,9 @@ var s2a = s2.then(testFunction2, testFunction2, testFunction2); var s2b = s2.then(testFunction2P, testFunction2P, testFunction2P); >s2b : Promise<{ x: number; }> >s2.then(testFunction2P, testFunction2P, testFunction2P) : Promise<{ x: number; }> ->s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s2 : Promise<{ x: number; }> ->then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction2P : () => Promise<{ x: number; }> >testFunction2P : () => Promise<{ x: number; }> >testFunction2P : () => Promise<{ x: number; }> @@ -347,9 +347,9 @@ var s2b = s2.then(testFunction2P, testFunction2P, testFunction2P); var s2c = s2.then(testFunction2P, testFunction2, testFunction2); >s2c : Promise> >s2.then(testFunction2P, testFunction2, testFunction2) : Promise> ->s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s2 : Promise<{ x: number; }> ->then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction2P : () => Promise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> @@ -357,15 +357,15 @@ var s2c = s2.then(testFunction2P, testFunction2, testFunction2); var s2d = s2.then(testFunction2P, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); >s2d : Promise> >s2.then(testFunction2P, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2) : Promise> ->s2.then(testFunction2P, testFunction2, testFunction2).then : { , TResult2 = never>(onfulfilled?: (value: IPromise<{ x: number; }>) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise<{ x: number; }>) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s2.then(testFunction2P, testFunction2, testFunction2).then : { , TResult2 = never>(onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise<{ x: number; }>) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s2.then(testFunction2P, testFunction2, testFunction2) : Promise> ->s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s2.then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s2 : Promise<{ x: number; }> ->then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: { x: number; }) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction2P : () => Promise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> ->then : { , TResult2 = never>(onfulfilled?: (value: IPromise<{ x: number; }>) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise<{ x: number; }>) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: { x: number; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise<{ x: number; }>) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise<{ x: number; }>) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction2 : () => IPromise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> >testFunction2 : () => IPromise<{ x: number; }> @@ -405,9 +405,9 @@ var s3: Promise; var s3a = s3.then(testFunction3, testFunction3, testFunction3); >s3a : Promise> >s3.then(testFunction3, testFunction3, testFunction3) : Promise> ->s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s3 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction3 : (x: number) => IPromise >testFunction3 : (x: number) => IPromise >testFunction3 : (x: number) => IPromise @@ -415,9 +415,9 @@ var s3a = s3.then(testFunction3, testFunction3, testFunction3); var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); >s3b : Promise >s3.then(testFunction3P, testFunction3P, testFunction3P) : Promise ->s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s3 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction3P : (x: number) => Promise >testFunction3P : (x: number) => Promise >testFunction3P : (x: number) => Promise @@ -425,9 +425,9 @@ var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); var s3c = s3.then(testFunction3P, testFunction3, testFunction3); >s3c : Promise> >s3.then(testFunction3P, testFunction3, testFunction3) : Promise> ->s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s3 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction3P : (x: number) => Promise >testFunction3 : (x: number) => IPromise >testFunction3 : (x: number) => IPromise @@ -435,15 +435,15 @@ var s3c = s3.then(testFunction3P, testFunction3, testFunction3); var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); >s3d : Promise >s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3) : Promise ->s3.then(testFunction3P, testFunction3, testFunction3).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s3.then(testFunction3P, testFunction3, testFunction3).then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s3.then(testFunction3P, testFunction3, testFunction3) : Promise> ->s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s3 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction3P : (x: number) => Promise >testFunction3 : (x: number) => IPromise >testFunction3 : (x: number) => IPromise ->then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction3 : (x: number) => IPromise >testFunction3 : (x: number) => IPromise >testFunction3 : (x: number) => IPromise @@ -491,9 +491,9 @@ var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error >s4a : Promise >s4.then(testFunction4, testFunction4, testFunction4) : Promise ->s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction4 : (x: number, y?: string) => IPromise >testFunction4 : (x: number, y?: string) => IPromise >testFunction4 : (x: number, y?: string) => IPromise @@ -501,9 +501,9 @@ var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error >s4b : Promise >s4.then(testFunction4P, testFunction4P, testFunction4P) : Promise ->s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction4P : (x: number, y?: string) => Promise >testFunction4P : (x: number, y?: string) => Promise >testFunction4P : (x: number, y?: string) => Promise @@ -511,9 +511,9 @@ var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error >s4c : Promise >s4.then(testFunction4P, testFunction4, testFunction4) : Promise ->s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction4P : (x: number, y?: string) => Promise >testFunction4 : (x: number, y?: string) => IPromise >testFunction4 : (x: number, y?: string) => IPromise @@ -521,15 +521,15 @@ var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); >s4d : Promise> >s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4) : Promise> ->s4.then(sIPromise, testFunction4P, testFunction4).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s4.then(sIPromise, testFunction4P, testFunction4).then : { , TResult2 = never>(onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4.then(sIPromise, testFunction4P, testFunction4) : Promise> ->s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sIPromise : (x: any) => IPromise >testFunction4P : (x: number, y?: string) => Promise >testFunction4 : (x: number, y?: string) => IPromise ->then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sIPromise : (x: any) => IPromise >testFunction4P : (x: number, y?: string) => Promise >testFunction4 : (x: number, y?: string) => IPromise @@ -569,9 +569,9 @@ var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error >s5a : Promise >s5.then(testFunction5, testFunction5, testFunction5) : Promise ->s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction5 : (x: number, cb: (a: string) => string) => IPromise >testFunction5 : (x: number, cb: (a: string) => string) => IPromise >testFunction5 : (x: number, cb: (a: string) => string) => IPromise @@ -579,9 +579,9 @@ var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error >s5b : Promise >s5.then(testFunction5P, testFunction5P, testFunction5P) : Promise ->s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction5P : (x: number, cb: (a: string) => string) => Promise >testFunction5P : (x: number, cb: (a: string) => string) => Promise >testFunction5P : (x: number, cb: (a: string) => string) => Promise @@ -589,9 +589,9 @@ var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error >s5c : Promise >s5.then(testFunction5P, testFunction5, testFunction5) : Promise ->s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction5P : (x: number, cb: (a: string) => string) => Promise >testFunction5 : (x: number, cb: (a: string) => string) => IPromise >testFunction5 : (x: number, cb: (a: string) => string) => IPromise @@ -599,15 +599,15 @@ var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok >s5d : Promise> >s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise) : Promise> ->s5.then(sPromise, sPromise, sPromise).then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s5.then(sPromise, sPromise, sPromise).then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5.then(sPromise, sPromise, sPromise) : Promise ->s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise @@ -647,9 +647,9 @@ var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error >s6a : Promise >s6.then(testFunction6, testFunction6, testFunction6) : Promise ->s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction6 : (x: number, cb: (a: T) => T) => IPromise >testFunction6 : (x: number, cb: (a: T) => T) => IPromise >testFunction6 : (x: number, cb: (a: T) => T) => IPromise @@ -657,9 +657,9 @@ var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error >s6b : Promise >s6.then(testFunction6P, testFunction6P, testFunction6P) : Promise ->s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction6P : (x: number, cb: (a: T) => T) => Promise >testFunction6P : (x: number, cb: (a: T) => T) => Promise >testFunction6P : (x: number, cb: (a: T) => T) => Promise @@ -667,9 +667,9 @@ var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error >s6c : Promise >s6.then(testFunction6P, testFunction6, testFunction6) : Promise ->s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction6P : (x: number, cb: (a: T) => T) => Promise >testFunction6 : (x: number, cb: (a: T) => T) => IPromise >testFunction6 : (x: number, cb: (a: T) => T) => IPromise @@ -677,15 +677,15 @@ var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok >s6d : Promise> >s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise) : Promise> ->s6.then(sPromise, sPromise, sPromise).then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s6.then(sPromise, sPromise, sPromise).then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6.then(sPromise, sPromise, sPromise) : Promise ->s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6 : Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise @@ -811,9 +811,9 @@ var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error >s8a : Promise >s8.then(testFunction8, testFunction8, testFunction8) : Promise ->s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction8 : (x: T, cb: (a: T) => T) => IPromise >testFunction8 : (x: T, cb: (a: T) => T) => IPromise >testFunction8 : (x: T, cb: (a: T) => T) => IPromise @@ -821,9 +821,9 @@ var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error >s8b : Promise >s8.then(testFunction8P, testFunction8P, testFunction8P) : Promise ->s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction8P : (x: T, cb: (a: T) => T) => Promise >testFunction8P : (x: T, cb: (a: T) => T) => Promise >testFunction8P : (x: T, cb: (a: T) => T) => Promise @@ -831,9 +831,9 @@ var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error >s8c : Promise >s8.then(testFunction8P, testFunction8, testFunction8) : Promise ->s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction8P : (x: T, cb: (a: T) => T) => Promise >testFunction8 : (x: T, cb: (a: T) => T) => IPromise >testFunction8 : (x: T, cb: (a: T) => T) => IPromise @@ -841,15 +841,15 @@ var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok >s8d : Promise> >s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise) : Promise> ->s8.then(nIPromise, nIPromise, nIPromise).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s8.then(nIPromise, nIPromise, nIPromise).then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8.then(nIPromise, nIPromise, nIPromise) : Promise> ->s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >nIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise ->then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >nIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise @@ -919,9 +919,9 @@ var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error >s9a : Promise >s9.then(testFunction9, testFunction9, testFunction9) : Promise ->s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction9 : (x: T, cb: (a: U) => U) => IPromise >testFunction9 : (x: T, cb: (a: U) => U) => IPromise >testFunction9 : (x: T, cb: (a: U) => U) => IPromise @@ -929,9 +929,9 @@ var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error >s9b : Promise >s9.then(testFunction9P, testFunction9P, testFunction9P) : Promise ->s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction9P : (x: T, cb: (a: U) => U) => Promise >testFunction9P : (x: T, cb: (a: U) => U) => Promise >testFunction9P : (x: T, cb: (a: U) => U) => Promise @@ -939,9 +939,9 @@ var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error >s9c : Promise >s9.then(testFunction9P, testFunction9, testFunction9) : Promise ->s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction9P : (x: T, cb: (a: U) => U) => Promise >testFunction9 : (x: T, cb: (a: U) => U) => IPromise >testFunction9 : (x: T, cb: (a: U) => U) => IPromise @@ -949,9 +949,9 @@ var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error var s9d = s9.then(sPromise, sPromise, sPromise); // ok >s9d : Promise >s9.then(sPromise, sPromise, sPromise) : Promise ->s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise @@ -959,9 +959,9 @@ var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok >s9e : Promise >s9.then(nPromise, nPromise, nPromise) : Promise ->s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >nPromise : (x: any) => Promise >nPromise : (x: any) => Promise >nPromise : (x: any) => Promise @@ -969,9 +969,9 @@ var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error >s9f : Promise >s9.then(testFunction, sIPromise, nIPromise) : Promise ->s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction : () => IPromise >sIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise @@ -979,15 +979,15 @@ var s9f = s9.then(testFunction, sIPromise, nIPromise); // error var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok >s9g : Promise> >s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise) : Promise> ->s9.then(testFunction, nIPromise, sIPromise).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then(testFunction, nIPromise, sIPromise).then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9.then(testFunction, nIPromise, sIPromise) : Promise> ->s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction : () => IPromise >nIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise ->then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise @@ -1067,9 +1067,9 @@ var s10 = testFunction10P(x => x); var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok >s10a : Promise> >s10.then(testFunction10, testFunction10, testFunction10) : Promise> ->s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise ->then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise @@ -1077,9 +1077,9 @@ var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); // ok >s10b : Promise >s10.then(testFunction10P, testFunction10P, testFunction10P) : Promise ->s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise ->then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction10P : (cb: (a: U) => U) => Promise >testFunction10P : (cb: (a: U) => U) => Promise >testFunction10P : (cb: (a: U) => U) => Promise @@ -1087,9 +1087,9 @@ var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); // ok var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok >s10c : Promise >s10.then(testFunction10P, testFunction10, testFunction10) : Promise ->s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise ->then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction10P : (cb: (a: U) => U) => Promise >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise @@ -1097,9 +1097,9 @@ var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok var s10d = s10.then(sPromise, sPromise, sPromise); // ok >s10d : Promise >s10.then(sPromise, sPromise, sPromise) : Promise ->s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise ->then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise @@ -1107,9 +1107,9 @@ var s10d = s10.then(sPromise, sPromise, sPromise); // ok var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok >s10e : Promise> >s10.then(nIPromise, nPromise, nIPromise) : Promise> ->s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise ->then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >nIPromise : (x: any) => IPromise >nPromise : (x: any) => Promise >nIPromise : (x: any) => IPromise @@ -1117,9 +1117,9 @@ var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error >s10f : Promise >s10.then(testFunctionP, sIPromise, nIPromise) : Promise ->s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise ->then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunctionP : () => Promise >sIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise @@ -1127,15 +1127,15 @@ var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok >s10g : Promise> >s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise) : Promise> ->s10.then(testFunctionP, nIPromise, sIPromise).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then(testFunctionP, nIPromise, sIPromise).then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10.then(testFunctionP, nIPromise, sIPromise) : Promise> ->s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise ->then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunctionP : () => Promise >nIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise ->then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { , TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sPromise : (x: any) => Promise >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise @@ -1159,9 +1159,9 @@ var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok >s11a : Promise >s11.then(testFunction11, testFunction11, testFunction11) : Promise ->s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s11 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction11 : { (x: number): IPromise; (x: string): IPromise; } >testFunction11 : { (x: number): IPromise; (x: string): IPromise; } >testFunction11 : { (x: number): IPromise; (x: string): IPromise; } @@ -1169,9 +1169,9 @@ var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error >s11b : Promise >s11.then(testFunction11P, testFunction11P, testFunction11P) : Promise ->s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s11 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction11P : { (x: number): Promise; (x: string): Promise; } >testFunction11P : { (x: number): Promise; (x: string): Promise; } >testFunction11P : { (x: number): Promise; (x: string): Promise; } @@ -1179,9 +1179,9 @@ var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error >s11c : Promise >s11.then(testFunction11P, testFunction11, testFunction11) : Promise ->s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s11 : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction11P : { (x: number): Promise; (x: string): Promise; } >testFunction11 : { (x: number): IPromise; (x: string): IPromise; } >testFunction11 : { (x: number): IPromise; (x: string): IPromise; } diff --git a/tests/baselines/reference/promiseTest.types b/tests/baselines/reference/promiseTest.types index 3d250c11c1f87..03c9683e2e7d8 100644 --- a/tests/baselines/reference/promiseTest.types +++ b/tests/baselines/reference/promiseTest.types @@ -1,12 +1,12 @@ === tests/cases/compiler/promiseTest.ts === interface Promise { then(success?: (value: T) => Promise): Promise; ->then : { (onfulfilled?: (value: T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => Promise): Promise; (success?: (value: T) => B): Promise; } +>then : { (onfulfilled?: (value: awaited T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => Promise): Promise; (success?: (value: T) => B): Promise; } >success : (value: T) => Promise >value : T then(success?: (value: T) => B): Promise; ->then : { (onfulfilled?: (value: T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => Promise): Promise; (success?: (value: T) => B): Promise; } +>then : { (onfulfilled?: (value: awaited T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => Promise): Promise; (success?: (value: T) => B): Promise; } >success : (value: T) => B >value : T @@ -21,9 +21,9 @@ var p: Promise = null; var p2 = p.then(function (x) { >p2 : Promise >p.then(function (x) { return p;} ) : Promise ->p.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise): Promise; (success?: (value: number) => B): Promise; } +>p.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise): Promise; (success?: (value: number) => B): Promise; } >p : Promise ->then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise): Promise; (success?: (value: number) => B): Promise; } +>then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise): Promise; (success?: (value: number) => B): Promise; } >function (x) { return p;} : (x: number) => Promise >x : number diff --git a/tests/baselines/reference/promiseType.types b/tests/baselines/reference/promiseType.types index dd20fb656ea5a..27f6c2c46b2d2 100644 --- a/tests/baselines/reference/promiseType.types +++ b/tests/baselines/reference/promiseType.types @@ -104,9 +104,9 @@ async function F() { return Promise.reject(Error()); >Promise.reject(Error()) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >Error() : Error >Error : ErrorConstructor } @@ -169,9 +169,9 @@ async function I() { return Promise.reject(Error()); >Promise.reject(Error()) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >Error() : Error >Error : ErrorConstructor } @@ -182,231 +182,231 @@ async function I() { const p00 = p.catch(); >p00 : Promise >p.catch() : Promise ->p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise >p : Promise ->catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise const p01 = p.then(); >p01 : Promise >p.then() : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise const p10 = p.catch(undefined); >p10 : Promise >p.catch(undefined) : Promise ->p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise >p : Promise ->catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise >undefined : undefined const p11 = p.catch(null); >p11 : Promise >p.catch(null) : Promise ->p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise >p : Promise ->catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise >null : null const p12 = p.catch(() => 1); >p12 : Promise >p.catch(() => 1) : Promise ->p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise >p : Promise ->catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise >() => 1 : () => number >1 : 1 const p13 = p.catch(() => x); >p13 : Promise >p.catch(() => x) : Promise ->p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise >p : Promise ->catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise >() => x : () => any >x : any const p14 = p.catch(() => undefined); >p14 : Promise >p.catch(() => undefined) : Promise ->p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise >p : Promise ->catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise >() => undefined : () => any >undefined : undefined const p15 = p.catch(() => null); >p15 : Promise >p.catch(() => null) : Promise ->p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise >p : Promise ->catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise >() => null : () => any >null : null const p16 = p.catch(() => {}); >p16 : Promise >p.catch(() => {}) : Promise ->p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise >p : Promise ->catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise >() => {} : () => void const p17 = p.catch(() => {throw 1}); >p17 : Promise >p.catch(() => {throw 1}) : Promise ->p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise >p : Promise ->catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise >() => {throw 1} : () => never >1 : 1 const p18 = p.catch(() => Promise.reject(1)); >p18 : Promise >p.catch(() => Promise.reject(1)) : Promise ->p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise >p : Promise ->catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const p19 = p.catch(() => Promise.resolve(1)); >p19 : Promise >p.catch(() => Promise.resolve(1)) : Promise ->p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>p.catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise >p : Promise ->catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise +>catch : (onrejected?: (reason: any) => TResult | PromiseLike) => Promise >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const p20 = p.then(undefined); >p20 : Promise >p.then(undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >undefined : undefined const p21 = p.then(null); >p21 : Promise >p.then(null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >null : null const p22 = p.then(() => 1); >p22 : Promise >p.then(() => 1) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => 1 : () => number >1 : 1 const p23 = p.then(() => x); >p23 : Promise >p.then(() => x) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => x : () => any >x : any const p24 = p.then(() => undefined); >p24 : Promise >p.then(() => undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => undefined : () => any >undefined : undefined const p25 = p.then(() => null); >p25 : Promise >p.then(() => null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => null : () => any >null : null const p26 = p.then(() => {}); >p26 : Promise >p.then(() => {}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {} : () => void const p27 = p.then(() => {throw 1}); >p27 : Promise >p.then(() => {throw 1}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {throw 1} : () => never >1 : 1 const p28 = p.then(() => Promise.resolve(1)); >p28 : Promise >p.then(() => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const p29 = p.then(() => Promise.reject(1)); >p29 : Promise >p.then(() => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const p30 = p.then(undefined, undefined); >p30 : Promise >p.then(undefined, undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >undefined : undefined >undefined : undefined const p31 = p.then(undefined, null); >p31 : Promise >p.then(undefined, null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >undefined : undefined >null : null const p32 = p.then(undefined, () => 1); >p32 : Promise >p.then(undefined, () => 1) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >undefined : undefined >() => 1 : () => number >1 : 1 @@ -414,9 +414,9 @@ const p32 = p.then(undefined, () => 1); const p33 = p.then(undefined, () => x); >p33 : Promise >p.then(undefined, () => x) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >undefined : undefined >() => x : () => any >x : any @@ -424,9 +424,9 @@ const p33 = p.then(undefined, () => x); const p34 = p.then(undefined, () => undefined); >p34 : Promise >p.then(undefined, () => undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >undefined : undefined >() => undefined : () => any >undefined : undefined @@ -434,9 +434,9 @@ const p34 = p.then(undefined, () => undefined); const p35 = p.then(undefined, () => null); >p35 : Promise >p.then(undefined, () => null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >undefined : undefined >() => null : () => any >null : null @@ -444,18 +444,18 @@ const p35 = p.then(undefined, () => null); const p36 = p.then(undefined, () => {}); >p36 : Promise >p.then(undefined, () => {}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >undefined : undefined >() => {} : () => void const p37 = p.then(undefined, () => {throw 1}); >p37 : Promise >p.then(undefined, () => {throw 1}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >undefined : undefined >() => {throw 1} : () => never >1 : 1 @@ -463,55 +463,55 @@ const p37 = p.then(undefined, () => {throw 1}); const p38 = p.then(undefined, () => Promise.resolve(1)); >p38 : Promise >p.then(undefined, () => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >undefined : undefined >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const p39 = p.then(undefined, () => Promise.reject(1)); >p39 : Promise >p.then(undefined, () => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >undefined : undefined >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const p40 = p.then(null, undefined); >p40 : Promise >p.then(null, undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >null : null >undefined : undefined const p41 = p.then(null, null); >p41 : Promise >p.then(null, null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >null : null >null : null const p42 = p.then(null, () => 1); >p42 : Promise >p.then(null, () => 1) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >null : null >() => 1 : () => number >1 : 1 @@ -519,9 +519,9 @@ const p42 = p.then(null, () => 1); const p43 = p.then(null, () => x); >p43 : Promise >p.then(null, () => x) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >null : null >() => x : () => any >x : any @@ -529,9 +529,9 @@ const p43 = p.then(null, () => x); const p44 = p.then(null, () => undefined); >p44 : Promise >p.then(null, () => undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >null : null >() => undefined : () => any >undefined : undefined @@ -539,9 +539,9 @@ const p44 = p.then(null, () => undefined); const p45 = p.then(null, () => null); >p45 : Promise >p.then(null, () => null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >null : null >() => null : () => any >null : null @@ -549,18 +549,18 @@ const p45 = p.then(null, () => null); const p46 = p.then(null, () => {}); >p46 : Promise >p.then(null, () => {}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >null : null >() => {} : () => void const p47 = p.then(null, () => {throw 1}); >p47 : Promise >p.then(null, () => {throw 1}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >null : null >() => {throw 1} : () => never >1 : 1 @@ -568,37 +568,37 @@ const p47 = p.then(null, () => {throw 1}); const p48 = p.then(null, () => Promise.resolve(1)); >p48 : Promise >p.then(null, () => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >null : null >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const p49 = p.then(null, () => Promise.reject(1)); >p49 : Promise >p.then(null, () => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >null : null >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const p50 = p.then(() => "1", undefined); >p50 : Promise >p.then(() => "1", undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => "1" : () => string >"1" : "1" >undefined : undefined @@ -606,9 +606,9 @@ const p50 = p.then(() => "1", undefined); const p51 = p.then(() => "1", null); >p51 : Promise >p.then(() => "1", null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => "1" : () => string >"1" : "1" >null : null @@ -616,9 +616,9 @@ const p51 = p.then(() => "1", null); const p52 = p.then(() => "1", () => 1); >p52 : Promise >p.then(() => "1", () => 1) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => "1" : () => string >"1" : "1" >() => 1 : () => number @@ -627,9 +627,9 @@ const p52 = p.then(() => "1", () => 1); const p53 = p.then(() => "1", () => x); >p53 : Promise >p.then(() => "1", () => x) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => "1" : () => string >"1" : "1" >() => x : () => any @@ -638,9 +638,9 @@ const p53 = p.then(() => "1", () => x); const p54 = p.then(() => "1", () => undefined); >p54 : Promise >p.then(() => "1", () => undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => "1" : () => string >"1" : "1" >() => undefined : () => any @@ -649,9 +649,9 @@ const p54 = p.then(() => "1", () => undefined); const p55 = p.then(() => "1", () => null); >p55 : Promise >p.then(() => "1", () => null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => "1" : () => string >"1" : "1" >() => null : () => any @@ -660,9 +660,9 @@ const p55 = p.then(() => "1", () => null); const p56 = p.then(() => "1", () => {}); >p56 : Promise >p.then(() => "1", () => {}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => "1" : () => string >"1" : "1" >() => {} : () => void @@ -670,9 +670,9 @@ const p56 = p.then(() => "1", () => {}); const p57 = p.then(() => "1", () => {throw 1}); >p57 : Promise >p.then(() => "1", () => {throw 1}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => "1" : () => string >"1" : "1" >() => {throw 1} : () => never @@ -681,39 +681,39 @@ const p57 = p.then(() => "1", () => {throw 1}); const p58 = p.then(() => "1", () => Promise.resolve(1)); >p58 : Promise >p.then(() => "1", () => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => "1" : () => string >"1" : "1" >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const p59 = p.then(() => "1", () => Promise.reject(1)); >p59 : Promise >p.then(() => "1", () => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => "1" : () => string >"1" : "1" >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const p60 = p.then(() => x, undefined); >p60 : Promise >p.then(() => x, undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => x : () => any >x : any >undefined : undefined @@ -721,9 +721,9 @@ const p60 = p.then(() => x, undefined); const p61 = p.then(() => x, null); >p61 : Promise >p.then(() => x, null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => x : () => any >x : any >null : null @@ -731,9 +731,9 @@ const p61 = p.then(() => x, null); const p62 = p.then(() => x, () => 1); >p62 : Promise >p.then(() => x, () => 1) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => x : () => any >x : any >() => 1 : () => number @@ -742,9 +742,9 @@ const p62 = p.then(() => x, () => 1); const p63 = p.then(() => x, () => x); >p63 : Promise >p.then(() => x, () => x) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => x : () => any >x : any >() => x : () => any @@ -753,9 +753,9 @@ const p63 = p.then(() => x, () => x); const p64 = p.then(() => x, () => undefined); >p64 : Promise >p.then(() => x, () => undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => x : () => any >x : any >() => undefined : () => any @@ -764,9 +764,9 @@ const p64 = p.then(() => x, () => undefined); const p65 = p.then(() => x, () => null); >p65 : Promise >p.then(() => x, () => null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => x : () => any >x : any >() => null : () => any @@ -775,9 +775,9 @@ const p65 = p.then(() => x, () => null); const p66 = p.then(() => x, () => {}); >p66 : Promise >p.then(() => x, () => {}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => x : () => any >x : any >() => {} : () => void @@ -785,9 +785,9 @@ const p66 = p.then(() => x, () => {}); const p67 = p.then(() => x, () => {throw 1}); >p67 : Promise >p.then(() => x, () => {throw 1}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => x : () => any >x : any >() => {throw 1} : () => never @@ -796,39 +796,39 @@ const p67 = p.then(() => x, () => {throw 1}); const p68 = p.then(() => x, () => Promise.resolve(1)); >p68 : Promise >p.then(() => x, () => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => x : () => any >x : any >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const p69 = p.then(() => x, () => Promise.reject(1)); >p69 : Promise >p.then(() => x, () => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => x : () => any >x : any >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const p70 = p.then(() => undefined, undefined); >p70 : Promise >p.then(() => undefined, undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => undefined : () => any >undefined : undefined >undefined : undefined @@ -836,9 +836,9 @@ const p70 = p.then(() => undefined, undefined); const p71 = p.then(() => undefined, null); >p71 : Promise >p.then(() => undefined, null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => undefined : () => any >undefined : undefined >null : null @@ -846,9 +846,9 @@ const p71 = p.then(() => undefined, null); const p72 = p.then(() => undefined, () => 1); >p72 : Promise >p.then(() => undefined, () => 1) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => undefined : () => any >undefined : undefined >() => 1 : () => number @@ -857,9 +857,9 @@ const p72 = p.then(() => undefined, () => 1); const p73 = p.then(() => undefined, () => x); >p73 : Promise >p.then(() => undefined, () => x) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => undefined : () => any >undefined : undefined >() => x : () => any @@ -868,9 +868,9 @@ const p73 = p.then(() => undefined, () => x); const p74 = p.then(() => undefined, () => undefined); >p74 : Promise >p.then(() => undefined, () => undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => undefined : () => any >undefined : undefined >() => undefined : () => any @@ -879,9 +879,9 @@ const p74 = p.then(() => undefined, () => undefined); const p75 = p.then(() => undefined, () => null); >p75 : Promise >p.then(() => undefined, () => null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => undefined : () => any >undefined : undefined >() => null : () => any @@ -890,9 +890,9 @@ const p75 = p.then(() => undefined, () => null); const p76 = p.then(() => undefined, () => {}); >p76 : Promise >p.then(() => undefined, () => {}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => undefined : () => any >undefined : undefined >() => {} : () => void @@ -900,9 +900,9 @@ const p76 = p.then(() => undefined, () => {}); const p77 = p.then(() => undefined, () => {throw 1}); >p77 : Promise >p.then(() => undefined, () => {throw 1}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => undefined : () => any >undefined : undefined >() => {throw 1} : () => never @@ -911,39 +911,39 @@ const p77 = p.then(() => undefined, () => {throw 1}); const p78 = p.then(() => undefined, () => Promise.resolve(1)); >p78 : Promise >p.then(() => undefined, () => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => undefined : () => any >undefined : undefined >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const p79 = p.then(() => undefined, () => Promise.reject(1)); >p79 : Promise >p.then(() => undefined, () => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => undefined : () => any >undefined : undefined >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const p80 = p.then(() => null, undefined); >p80 : Promise >p.then(() => null, undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => null : () => any >null : null >undefined : undefined @@ -951,9 +951,9 @@ const p80 = p.then(() => null, undefined); const p81 = p.then(() => null, null); >p81 : Promise >p.then(() => null, null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => null : () => any >null : null >null : null @@ -961,9 +961,9 @@ const p81 = p.then(() => null, null); const p82 = p.then(() => null, () => 1); >p82 : Promise >p.then(() => null, () => 1) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => null : () => any >null : null >() => 1 : () => number @@ -972,9 +972,9 @@ const p82 = p.then(() => null, () => 1); const p83 = p.then(() => null, () => x); >p83 : Promise >p.then(() => null, () => x) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => null : () => any >null : null >() => x : () => any @@ -983,9 +983,9 @@ const p83 = p.then(() => null, () => x); const p84 = p.then(() => null, () => undefined); >p84 : Promise >p.then(() => null, () => undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => null : () => any >null : null >() => undefined : () => any @@ -994,9 +994,9 @@ const p84 = p.then(() => null, () => undefined); const p85 = p.then(() => null, () => null); >p85 : Promise >p.then(() => null, () => null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => null : () => any >null : null >() => null : () => any @@ -1005,9 +1005,9 @@ const p85 = p.then(() => null, () => null); const p86 = p.then(() => null, () => {}); >p86 : Promise >p.then(() => null, () => {}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => null : () => any >null : null >() => {} : () => void @@ -1015,9 +1015,9 @@ const p86 = p.then(() => null, () => {}); const p87 = p.then(() => null, () => {throw 1}); >p87 : Promise >p.then(() => null, () => {throw 1}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => null : () => any >null : null >() => {throw 1} : () => never @@ -1026,57 +1026,57 @@ const p87 = p.then(() => null, () => {throw 1}); const p88 = p.then(() => null, () => Promise.resolve(1)); >p88 : Promise >p.then(() => null, () => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => null : () => any >null : null >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const p89 = p.then(() => null, () => Promise.reject(1)); >p89 : Promise >p.then(() => null, () => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => null : () => any >null : null >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const p90 = p.then(() => {}, undefined); >p90 : Promise >p.then(() => {}, undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {} : () => void >undefined : undefined const p91 = p.then(() => {}, null); >p91 : Promise >p.then(() => {}, null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {} : () => void >null : null const p92 = p.then(() => {}, () => 1); >p92 : Promise >p.then(() => {}, () => 1) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {} : () => void >() => 1 : () => number >1 : 1 @@ -1084,9 +1084,9 @@ const p92 = p.then(() => {}, () => 1); const p93 = p.then(() => {}, () => x); >p93 : Promise >p.then(() => {}, () => x) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {} : () => void >() => x : () => any >x : any @@ -1094,9 +1094,9 @@ const p93 = p.then(() => {}, () => x); const p94 = p.then(() => {}, () => undefined); >p94 : Promise >p.then(() => {}, () => undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {} : () => void >() => undefined : () => any >undefined : undefined @@ -1104,9 +1104,9 @@ const p94 = p.then(() => {}, () => undefined); const p95 = p.then(() => {}, () => null); >p95 : Promise >p.then(() => {}, () => null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {} : () => void >() => null : () => any >null : null @@ -1114,18 +1114,18 @@ const p95 = p.then(() => {}, () => null); const p96 = p.then(() => {}, () => {}); >p96 : Promise >p.then(() => {}, () => {}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {} : () => void >() => {} : () => void const p97 = p.then(() => {}, () => {throw 1}); >p97 : Promise >p.then(() => {}, () => {throw 1}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {} : () => void >() => {throw 1} : () => never >1 : 1 @@ -1133,37 +1133,37 @@ const p97 = p.then(() => {}, () => {throw 1}); const p98 = p.then(() => {}, () => Promise.resolve(1)); >p98 : Promise >p.then(() => {}, () => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {} : () => void >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const p99 = p.then(() => {}, () => Promise.reject(1)); >p99 : Promise >p.then(() => {}, () => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {} : () => void >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const pa0 = p.then(() => {throw 1}, undefined); >pa0 : Promise >p.then(() => {throw 1}, undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {throw 1} : () => never >1 : 1 >undefined : undefined @@ -1171,9 +1171,9 @@ const pa0 = p.then(() => {throw 1}, undefined); const pa1 = p.then(() => {throw 1}, null); >pa1 : Promise >p.then(() => {throw 1}, null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {throw 1} : () => never >1 : 1 >null : null @@ -1181,9 +1181,9 @@ const pa1 = p.then(() => {throw 1}, null); const pa2 = p.then(() => {throw 1}, () => 1); >pa2 : Promise >p.then(() => {throw 1}, () => 1) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {throw 1} : () => never >1 : 1 >() => 1 : () => number @@ -1192,9 +1192,9 @@ const pa2 = p.then(() => {throw 1}, () => 1); const pa3 = p.then(() => {throw 1}, () => x); >pa3 : Promise >p.then(() => {throw 1}, () => x) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {throw 1} : () => never >1 : 1 >() => x : () => any @@ -1203,9 +1203,9 @@ const pa3 = p.then(() => {throw 1}, () => x); const pa4 = p.then(() => {throw 1}, () => undefined); >pa4 : Promise >p.then(() => {throw 1}, () => undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {throw 1} : () => never >1 : 1 >() => undefined : () => any @@ -1214,9 +1214,9 @@ const pa4 = p.then(() => {throw 1}, () => undefined); const pa5 = p.then(() => {throw 1}, () => null); >pa5 : Promise >p.then(() => {throw 1}, () => null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {throw 1} : () => never >1 : 1 >() => null : () => any @@ -1225,9 +1225,9 @@ const pa5 = p.then(() => {throw 1}, () => null); const pa6 = p.then(() => {throw 1}, () => {}); >pa6 : Promise >p.then(() => {throw 1}, () => {}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {throw 1} : () => never >1 : 1 >() => {} : () => void @@ -1235,9 +1235,9 @@ const pa6 = p.then(() => {throw 1}, () => {}); const pa7 = p.then(() => {throw 1}, () => {throw 1}); >pa7 : Promise >p.then(() => {throw 1}, () => {throw 1}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {throw 1} : () => never >1 : 1 >() => {throw 1} : () => never @@ -1246,72 +1246,72 @@ const pa7 = p.then(() => {throw 1}, () => {throw 1}); const pa8 = p.then(() => {throw 1}, () => Promise.resolve(1)); >pa8 : Promise >p.then(() => {throw 1}, () => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {throw 1} : () => never >1 : 1 >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const pa9 = p.then(() => {throw 1}, () => Promise.reject(1)); >pa9 : Promise >p.then(() => {throw 1}, () => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => {throw 1} : () => never >1 : 1 >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const pb0 = p.then(() => Promise.resolve("1"), undefined); >pb0 : Promise >p.then(() => Promise.resolve("1"), undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.resolve("1") : () => Promise >Promise.resolve("1") : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >"1" : "1" >undefined : undefined const pb1 = p.then(() => Promise.resolve("1"), null); >pb1 : Promise >p.then(() => Promise.resolve("1"), null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.resolve("1") : () => Promise >Promise.resolve("1") : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >"1" : "1" >null : null const pb2 = p.then(() => Promise.resolve("1"), () => 1); >pb2 : Promise >p.then(() => Promise.resolve("1"), () => 1) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.resolve("1") : () => Promise >Promise.resolve("1") : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >"1" : "1" >() => 1 : () => number >1 : 1 @@ -1319,14 +1319,14 @@ const pb2 = p.then(() => Promise.resolve("1"), () => 1); const pb3 = p.then(() => Promise.resolve("1"), () => x); >pb3 : Promise >p.then(() => Promise.resolve("1"), () => x) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.resolve("1") : () => Promise >Promise.resolve("1") : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >"1" : "1" >() => x : () => any >x : any @@ -1334,14 +1334,14 @@ const pb3 = p.then(() => Promise.resolve("1"), () => x); const pb4 = p.then(() => Promise.resolve("1"), () => undefined); >pb4 : Promise >p.then(() => Promise.resolve("1"), () => undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.resolve("1") : () => Promise >Promise.resolve("1") : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >"1" : "1" >() => undefined : () => any >undefined : undefined @@ -1349,14 +1349,14 @@ const pb4 = p.then(() => Promise.resolve("1"), () => undefined); const pb5 = p.then(() => Promise.resolve("1"), () => null); >pb5 : Promise >p.then(() => Promise.resolve("1"), () => null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.resolve("1") : () => Promise >Promise.resolve("1") : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >"1" : "1" >() => null : () => any >null : null @@ -1364,28 +1364,28 @@ const pb5 = p.then(() => Promise.resolve("1"), () => null); const pb6 = p.then(() => Promise.resolve("1"), () => {}); >pb6 : Promise >p.then(() => Promise.resolve("1"), () => {}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.resolve("1") : () => Promise >Promise.resolve("1") : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >"1" : "1" >() => {} : () => void const pb7 = p.then(() => Promise.resolve("1"), () => {throw 1}); >pb7 : Promise >p.then(() => Promise.resolve("1"), () => {throw 1}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.resolve("1") : () => Promise >Promise.resolve("1") : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >"1" : "1" >() => {throw 1} : () => never >1 : 1 @@ -1393,80 +1393,80 @@ const pb7 = p.then(() => Promise.resolve("1"), () => {throw 1}); const pb8 = p.then(() => Promise.resolve("1"), () => Promise.resolve(1)); >pb8 : Promise >p.then(() => Promise.resolve("1"), () => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.resolve("1") : () => Promise >Promise.resolve("1") : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >"1" : "1" >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const pb9 = p.then(() => Promise.resolve("1"), () => Promise.reject(1)); >pb9 : Promise >p.then(() => Promise.resolve("1"), () => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.resolve("1") : () => Promise >Promise.resolve("1") : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >"1" : "1" >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const pc0 = p.then(() => Promise.reject("1"), undefined); >pc0 : Promise >p.then(() => Promise.reject("1"), undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.reject("1") : () => Promise >Promise.reject("1") : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >"1" : "1" >undefined : undefined const pc1 = p.then(() => Promise.reject("1"), null); >pc1 : Promise >p.then(() => Promise.reject("1"), null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.reject("1") : () => Promise >Promise.reject("1") : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >"1" : "1" >null : null const pc2 = p.then(() => Promise.reject("1"), () => 1); >pc2 : Promise >p.then(() => Promise.reject("1"), () => 1) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.reject("1") : () => Promise >Promise.reject("1") : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >"1" : "1" >() => 1 : () => number >1 : 1 @@ -1474,14 +1474,14 @@ const pc2 = p.then(() => Promise.reject("1"), () => 1); const pc3 = p.then(() => Promise.reject("1"), () => x); >pc3 : Promise >p.then(() => Promise.reject("1"), () => x) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.reject("1") : () => Promise >Promise.reject("1") : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >"1" : "1" >() => x : () => any >x : any @@ -1489,14 +1489,14 @@ const pc3 = p.then(() => Promise.reject("1"), () => x); const pc4 = p.then(() => Promise.reject("1"), () => undefined); >pc4 : Promise >p.then(() => Promise.reject("1"), () => undefined) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.reject("1") : () => Promise >Promise.reject("1") : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >"1" : "1" >() => undefined : () => any >undefined : undefined @@ -1504,14 +1504,14 @@ const pc4 = p.then(() => Promise.reject("1"), () => undefined); const pc5 = p.then(() => Promise.reject("1"), () => null); >pc5 : Promise >p.then(() => Promise.reject("1"), () => null) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.reject("1") : () => Promise >Promise.reject("1") : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >"1" : "1" >() => null : () => any >null : null @@ -1519,28 +1519,28 @@ const pc5 = p.then(() => Promise.reject("1"), () => null); const pc6 = p.then(() => Promise.reject("1"), () => {}); >pc6 : Promise >p.then(() => Promise.reject("1"), () => {}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.reject("1") : () => Promise >Promise.reject("1") : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >"1" : "1" >() => {} : () => void const pc7 = p.then(() => Promise.reject("1"), () => {throw 1}); >pc7 : Promise >p.then(() => Promise.reject("1"), () => {throw 1}) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.reject("1") : () => Promise >Promise.reject("1") : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >"1" : "1" >() => {throw 1} : () => never >1 : 1 @@ -1548,38 +1548,38 @@ const pc7 = p.then(() => Promise.reject("1"), () => {throw 1}); const pc8 = p.then(() => Promise.reject("1"), () => Promise.resolve(1)); >pc8 : Promise >p.then(() => Promise.reject("1"), () => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.reject("1") : () => Promise >Promise.reject("1") : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >"1" : "1" >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const pc9 = p.then(() => Promise.reject("1"), () => Promise.reject(1)); >pc9 : Promise >p.then(() => Promise.reject("1"), () => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p.then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >p : Promise ->then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: boolean) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => Promise.reject("1") : () => Promise >Promise.reject("1") : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >"1" : "1" >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 diff --git a/tests/baselines/reference/promiseTypeInference.errors.txt b/tests/baselines/reference/promiseTypeInference.errors.txt deleted file mode 100644 index ada81bfb4962b..0000000000000 --- a/tests/baselines/reference/promiseTypeInference.errors.txt +++ /dev/null @@ -1,38 +0,0 @@ -tests/cases/compiler/promiseTypeInference.ts(10,39): error TS2769: No overload matches this call. - Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. - Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. - Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike, onrejected?: (reason: any) => PromiseLike): Promise', gave the following error. - Type 'IPromise' is not assignable to type 'number | PromiseLike'. - Type 'IPromise' is not assignable to type 'PromiseLike'. - Types of property 'then' are incompatible. - Types of parameters 'success' and 'onfulfilled' are incompatible. - Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. - Type 'TResult1' is not assignable to type 'IPromise'. - - -==== tests/cases/compiler/promiseTypeInference.ts (1 errors) ==== - declare class Promise { - then(success?: (value: T) => Promise): Promise; - } - interface IPromise { - then(success?: (value: T) => IPromise): IPromise; - } - declare function load(name: string): Promise; - declare function convert(s: string): IPromise; - - var $$x = load("something").then(s => convert(s)); - ~~~~~~~~~~ -!!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. -!!! error TS2769: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -!!! error TS2769: Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike, onrejected?: (reason: any) => PromiseLike): Promise', gave the following error. -!!! error TS2769: Type 'IPromise' is not assignable to type 'number | PromiseLike'. -!!! error TS2769: Type 'IPromise' is not assignable to type 'PromiseLike'. -!!! error TS2769: Types of property 'then' are incompatible. -!!! error TS2769: Types of parameters 'success' and 'onfulfilled' are incompatible. -!!! error TS2769: Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. -!!! error TS2769: Type 'TResult1' is not assignable to type 'IPromise'. -!!! related TS2728 /.ts/lib.es5.d.ts:1430:5: 'catch' is declared here. -!!! related TS6502 tests/cases/compiler/promiseTypeInference.ts:2:23: The expected type comes from the return type of this signature. -!!! related TS6502 /.ts/lib.es5.d.ts:1423:57: The expected type comes from the return type of this signature. - \ No newline at end of file diff --git a/tests/baselines/reference/promiseTypeInference.js b/tests/baselines/reference/promiseTypeInference.js index 6faf131438ab1..fad9d4377be57 100644 --- a/tests/baselines/reference/promiseTypeInference.js +++ b/tests/baselines/reference/promiseTypeInference.js @@ -1,11 +1,11 @@ //// [promiseTypeInference.ts] -declare class Promise { - then(success?: (value: T) => Promise): Promise; +declare class CPromise { + then(success?: (value: T) => CPromise): CPromise; } interface IPromise { then(success?: (value: T) => IPromise): IPromise; } -declare function load(name: string): Promise; +declare function load(name: string): CPromise; declare function convert(s: string): IPromise; var $$x = load("something").then(s => convert(s)); diff --git a/tests/baselines/reference/promiseTypeInference.symbols b/tests/baselines/reference/promiseTypeInference.symbols index ae87c8a82b550..b7f746a436208 100644 --- a/tests/baselines/reference/promiseTypeInference.symbols +++ b/tests/baselines/reference/promiseTypeInference.symbols @@ -1,17 +1,17 @@ === tests/cases/compiler/promiseTypeInference.ts === -declare class Promise { ->Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(promiseTypeInference.ts, 0, 0)) ->T : Symbol(T, Decl(lib.es5.d.ts, --, --), Decl(promiseTypeInference.ts, 0, 22)) +declare class CPromise { +>CPromise : Symbol(CPromise, Decl(promiseTypeInference.ts, 0, 0)) +>T : Symbol(T, Decl(promiseTypeInference.ts, 0, 23)) - then(success?: (value: T) => Promise): Promise; ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --), Decl(promiseTypeInference.ts, 0, 26)) + then(success?: (value: T) => CPromise): CPromise; +>then : Symbol(CPromise.then, Decl(promiseTypeInference.ts, 0, 27)) >U : Symbol(U, Decl(promiseTypeInference.ts, 1, 9)) >success : Symbol(success, Decl(promiseTypeInference.ts, 1, 12)) >value : Symbol(value, Decl(promiseTypeInference.ts, 1, 23)) ->T : Symbol(T, Decl(lib.es5.d.ts, --, --), Decl(promiseTypeInference.ts, 0, 22)) ->Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(promiseTypeInference.ts, 0, 0)) +>T : Symbol(T, Decl(promiseTypeInference.ts, 0, 23)) +>CPromise : Symbol(CPromise, Decl(promiseTypeInference.ts, 0, 0)) >U : Symbol(U, Decl(promiseTypeInference.ts, 1, 9)) ->Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(promiseTypeInference.ts, 0, 0)) +>CPromise : Symbol(CPromise, Decl(promiseTypeInference.ts, 0, 0)) >U : Symbol(U, Decl(promiseTypeInference.ts, 1, 9)) } interface IPromise { @@ -29,22 +29,22 @@ interface IPromise { >IPromise : Symbol(IPromise, Decl(promiseTypeInference.ts, 2, 1)) >U : Symbol(U, Decl(promiseTypeInference.ts, 4, 9)) } -declare function load(name: string): Promise; +declare function load(name: string): CPromise; >load : Symbol(load, Decl(promiseTypeInference.ts, 5, 1)) >name : Symbol(name, Decl(promiseTypeInference.ts, 6, 22)) ->Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(promiseTypeInference.ts, 0, 0)) +>CPromise : Symbol(CPromise, Decl(promiseTypeInference.ts, 0, 0)) declare function convert(s: string): IPromise; ->convert : Symbol(convert, Decl(promiseTypeInference.ts, 6, 53)) +>convert : Symbol(convert, Decl(promiseTypeInference.ts, 6, 54)) >s : Symbol(s, Decl(promiseTypeInference.ts, 7, 25)) >IPromise : Symbol(IPromise, Decl(promiseTypeInference.ts, 2, 1)) var $$x = load("something").then(s => convert(s)); >$$x : Symbol($$x, Decl(promiseTypeInference.ts, 9, 3)) ->load("something").then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --), Decl(promiseTypeInference.ts, 0, 26)) +>load("something").then : Symbol(CPromise.then, Decl(promiseTypeInference.ts, 0, 27)) >load : Symbol(load, Decl(promiseTypeInference.ts, 5, 1)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --), Decl(promiseTypeInference.ts, 0, 26)) +>then : Symbol(CPromise.then, Decl(promiseTypeInference.ts, 0, 27)) >s : Symbol(s, Decl(promiseTypeInference.ts, 9, 33)) ->convert : Symbol(convert, Decl(promiseTypeInference.ts, 6, 53)) +>convert : Symbol(convert, Decl(promiseTypeInference.ts, 6, 54)) >s : Symbol(s, Decl(promiseTypeInference.ts, 9, 33)) diff --git a/tests/baselines/reference/promiseTypeInference.types b/tests/baselines/reference/promiseTypeInference.types index 72c7001f52554..2484e9b97d207 100644 --- a/tests/baselines/reference/promiseTypeInference.types +++ b/tests/baselines/reference/promiseTypeInference.types @@ -1,10 +1,10 @@ === tests/cases/compiler/promiseTypeInference.ts === -declare class Promise { ->Promise : Promise +declare class CPromise { +>CPromise : CPromise - then(success?: (value: T) => Promise): Promise; ->then : { (onfulfilled?: (value: T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => Promise): Promise; } ->success : (value: T) => Promise + then(success?: (value: T) => CPromise): CPromise; +>then : (success?: (value: T) => CPromise) => CPromise +>success : (value: T) => CPromise >value : T } interface IPromise { @@ -13,8 +13,8 @@ interface IPromise { >success : (value: T) => IPromise >value : T } -declare function load(name: string): Promise; ->load : (name: string) => Promise +declare function load(name: string): CPromise; +>load : (name: string) => CPromise >name : string declare function convert(s: string): IPromise; @@ -22,13 +22,13 @@ declare function convert(s: string): IPromise; >s : string var $$x = load("something").then(s => convert(s)); ->$$x : Promise ->load("something").then(s => convert(s)) : Promise ->load("something").then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise): Promise; } ->load("something") : Promise ->load : (name: string) => Promise +>$$x : CPromise +>load("something").then(s => convert(s)) : CPromise +>load("something").then : (success?: (value: string) => CPromise) => CPromise +>load("something") : CPromise +>load : (name: string) => CPromise >"something" : "something" ->then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise): Promise; } +>then : (success?: (value: string) => CPromise) => CPromise >s => convert(s) : (s: string) => IPromise >s : string >convert(s) : IPromise diff --git a/tests/baselines/reference/promiseTypeStrictNull.types b/tests/baselines/reference/promiseTypeStrictNull.types index 73d2f70346135..a8a070066fe2c 100644 --- a/tests/baselines/reference/promiseTypeStrictNull.types +++ b/tests/baselines/reference/promiseTypeStrictNull.types @@ -104,9 +104,9 @@ async function F() { return Promise.reject(Error()); >Promise.reject(Error()) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >Error() : Error >Error : ErrorConstructor } @@ -169,9 +169,9 @@ async function I() { return Promise.reject(Error()); >Promise.reject(Error()) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >Error() : Error >Error : ErrorConstructor } @@ -182,231 +182,231 @@ async function I() { const p00 = p.catch(); >p00 : Promise >p.catch() : Promise ->p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise >p : Promise ->catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise const p01 = p.then(); >p01 : Promise >p.then() : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise const p10 = p.catch(undefined); >p10 : Promise >p.catch(undefined) : Promise ->p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise >p : Promise ->catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise >undefined : undefined const p11 = p.catch(null); >p11 : Promise >p.catch(null) : Promise ->p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise >p : Promise ->catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise >null : null const p12 = p.catch(() => 1); >p12 : Promise >p.catch(() => 1) : Promise ->p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise >p : Promise ->catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise >() => 1 : () => number >1 : 1 const p13 = p.catch(() => x); >p13 : Promise >p.catch(() => x) : Promise ->p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise >p : Promise ->catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise >() => x : () => any >x : any const p14 = p.catch(() => undefined); >p14 : Promise >p.catch(() => undefined) : Promise ->p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise >p : Promise ->catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise >() => undefined : () => undefined >undefined : undefined const p15 = p.catch(() => null); >p15 : Promise >p.catch(() => null) : Promise ->p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise >p : Promise ->catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise >() => null : () => null >null : null const p16 = p.catch(() => {}); >p16 : Promise >p.catch(() => {}) : Promise ->p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise >p : Promise ->catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise >() => {} : () => void const p17 = p.catch(() => {throw 1}); >p17 : Promise >p.catch(() => {throw 1}) : Promise ->p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise >p : Promise ->catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise >() => {throw 1} : () => never >1 : 1 const p18 = p.catch(() => Promise.reject(1)); >p18 : Promise >p.catch(() => Promise.reject(1)) : Promise ->p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise >p : Promise ->catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const p19 = p.catch(() => Promise.resolve(1)); >p19 : Promise >p.catch(() => Promise.resolve(1)) : Promise ->p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>p.catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise >p : Promise ->catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise +>catch : (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const p20 = p.then(undefined); >p20 : Promise >p.then(undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >undefined : undefined const p21 = p.then(null); >p21 : Promise >p.then(null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >null : null const p22 = p.then(() => 1); >p22 : Promise >p.then(() => 1) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => 1 : () => number >1 : 1 const p23 = p.then(() => x); >p23 : Promise >p.then(() => x) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => x : () => any >x : any const p24 = p.then(() => undefined); >p24 : Promise >p.then(() => undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => undefined : () => undefined >undefined : undefined const p25 = p.then(() => null); >p25 : Promise >p.then(() => null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => null : () => null >null : null const p26 = p.then(() => {}); >p26 : Promise >p.then(() => {}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {} : () => void const p27 = p.then(() => {throw 1}); >p27 : Promise >p.then(() => {throw 1}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {throw 1} : () => never >1 : 1 const p28 = p.then(() => Promise.resolve(1)); >p28 : Promise >p.then(() => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const p29 = p.then(() => Promise.reject(1)); >p29 : Promise >p.then(() => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const p30 = p.then(undefined, undefined); >p30 : Promise >p.then(undefined, undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >undefined : undefined >undefined : undefined const p31 = p.then(undefined, null); >p31 : Promise >p.then(undefined, null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >undefined : undefined >null : null const p32 = p.then(undefined, () => 1); >p32 : Promise >p.then(undefined, () => 1) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >undefined : undefined >() => 1 : () => number >1 : 1 @@ -414,9 +414,9 @@ const p32 = p.then(undefined, () => 1); const p33 = p.then(undefined, () => x); >p33 : Promise >p.then(undefined, () => x) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >undefined : undefined >() => x : () => any >x : any @@ -424,9 +424,9 @@ const p33 = p.then(undefined, () => x); const p34 = p.then(undefined, () => undefined); >p34 : Promise >p.then(undefined, () => undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >undefined : undefined >() => undefined : () => undefined >undefined : undefined @@ -434,9 +434,9 @@ const p34 = p.then(undefined, () => undefined); const p35 = p.then(undefined, () => null); >p35 : Promise >p.then(undefined, () => null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >undefined : undefined >() => null : () => null >null : null @@ -444,18 +444,18 @@ const p35 = p.then(undefined, () => null); const p36 = p.then(undefined, () => {}); >p36 : Promise >p.then(undefined, () => {}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >undefined : undefined >() => {} : () => void const p37 = p.then(undefined, () => {throw 1}); >p37 : Promise >p.then(undefined, () => {throw 1}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >undefined : undefined >() => {throw 1} : () => never >1 : 1 @@ -463,55 +463,55 @@ const p37 = p.then(undefined, () => {throw 1}); const p38 = p.then(undefined, () => Promise.resolve(1)); >p38 : Promise >p.then(undefined, () => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >undefined : undefined >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const p39 = p.then(undefined, () => Promise.reject(1)); >p39 : Promise >p.then(undefined, () => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >undefined : undefined >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const p40 = p.then(null, undefined); >p40 : Promise >p.then(null, undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >null : null >undefined : undefined const p41 = p.then(null, null); >p41 : Promise >p.then(null, null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >null : null >null : null const p42 = p.then(null, () => 1); >p42 : Promise >p.then(null, () => 1) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >null : null >() => 1 : () => number >1 : 1 @@ -519,9 +519,9 @@ const p42 = p.then(null, () => 1); const p43 = p.then(null, () => x); >p43 : Promise >p.then(null, () => x) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >null : null >() => x : () => any >x : any @@ -529,9 +529,9 @@ const p43 = p.then(null, () => x); const p44 = p.then(null, () => undefined); >p44 : Promise >p.then(null, () => undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >null : null >() => undefined : () => undefined >undefined : undefined @@ -539,9 +539,9 @@ const p44 = p.then(null, () => undefined); const p45 = p.then(null, () => null); >p45 : Promise >p.then(null, () => null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >null : null >() => null : () => null >null : null @@ -549,18 +549,18 @@ const p45 = p.then(null, () => null); const p46 = p.then(null, () => {}); >p46 : Promise >p.then(null, () => {}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >null : null >() => {} : () => void const p47 = p.then(null, () => {throw 1}); >p47 : Promise >p.then(null, () => {throw 1}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >null : null >() => {throw 1} : () => never >1 : 1 @@ -568,37 +568,37 @@ const p47 = p.then(null, () => {throw 1}); const p48 = p.then(null, () => Promise.resolve(1)); >p48 : Promise >p.then(null, () => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >null : null >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const p49 = p.then(null, () => Promise.reject(1)); >p49 : Promise >p.then(null, () => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >null : null >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const p50 = p.then(() => "1", undefined); >p50 : Promise >p.then(() => "1", undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => "1" : () => string >"1" : "1" >undefined : undefined @@ -606,9 +606,9 @@ const p50 = p.then(() => "1", undefined); const p51 = p.then(() => "1", null); >p51 : Promise >p.then(() => "1", null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => "1" : () => string >"1" : "1" >null : null @@ -616,9 +616,9 @@ const p51 = p.then(() => "1", null); const p52 = p.then(() => "1", () => 1); >p52 : Promise >p.then(() => "1", () => 1) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => "1" : () => string >"1" : "1" >() => 1 : () => number @@ -627,9 +627,9 @@ const p52 = p.then(() => "1", () => 1); const p53 = p.then(() => "1", () => x); >p53 : Promise >p.then(() => "1", () => x) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => "1" : () => string >"1" : "1" >() => x : () => any @@ -638,9 +638,9 @@ const p53 = p.then(() => "1", () => x); const p54 = p.then(() => "1", () => undefined); >p54 : Promise >p.then(() => "1", () => undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => "1" : () => string >"1" : "1" >() => undefined : () => undefined @@ -649,9 +649,9 @@ const p54 = p.then(() => "1", () => undefined); const p55 = p.then(() => "1", () => null); >p55 : Promise >p.then(() => "1", () => null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => "1" : () => string >"1" : "1" >() => null : () => null @@ -660,9 +660,9 @@ const p55 = p.then(() => "1", () => null); const p56 = p.then(() => "1", () => {}); >p56 : Promise >p.then(() => "1", () => {}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => "1" : () => string >"1" : "1" >() => {} : () => void @@ -670,9 +670,9 @@ const p56 = p.then(() => "1", () => {}); const p57 = p.then(() => "1", () => {throw 1}); >p57 : Promise >p.then(() => "1", () => {throw 1}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => "1" : () => string >"1" : "1" >() => {throw 1} : () => never @@ -681,39 +681,39 @@ const p57 = p.then(() => "1", () => {throw 1}); const p58 = p.then(() => "1", () => Promise.resolve(1)); >p58 : Promise >p.then(() => "1", () => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => "1" : () => string >"1" : "1" >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const p59 = p.then(() => "1", () => Promise.reject(1)); >p59 : Promise >p.then(() => "1", () => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => "1" : () => string >"1" : "1" >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const p60 = p.then(() => x, undefined); >p60 : Promise >p.then(() => x, undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => x : () => any >x : any >undefined : undefined @@ -721,9 +721,9 @@ const p60 = p.then(() => x, undefined); const p61 = p.then(() => x, null); >p61 : Promise >p.then(() => x, null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => x : () => any >x : any >null : null @@ -731,9 +731,9 @@ const p61 = p.then(() => x, null); const p62 = p.then(() => x, () => 1); >p62 : Promise >p.then(() => x, () => 1) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => x : () => any >x : any >() => 1 : () => number @@ -742,9 +742,9 @@ const p62 = p.then(() => x, () => 1); const p63 = p.then(() => x, () => x); >p63 : Promise >p.then(() => x, () => x) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => x : () => any >x : any >() => x : () => any @@ -753,9 +753,9 @@ const p63 = p.then(() => x, () => x); const p64 = p.then(() => x, () => undefined); >p64 : Promise >p.then(() => x, () => undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => x : () => any >x : any >() => undefined : () => undefined @@ -764,9 +764,9 @@ const p64 = p.then(() => x, () => undefined); const p65 = p.then(() => x, () => null); >p65 : Promise >p.then(() => x, () => null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => x : () => any >x : any >() => null : () => null @@ -775,9 +775,9 @@ const p65 = p.then(() => x, () => null); const p66 = p.then(() => x, () => {}); >p66 : Promise >p.then(() => x, () => {}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => x : () => any >x : any >() => {} : () => void @@ -785,9 +785,9 @@ const p66 = p.then(() => x, () => {}); const p67 = p.then(() => x, () => {throw 1}); >p67 : Promise >p.then(() => x, () => {throw 1}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => x : () => any >x : any >() => {throw 1} : () => never @@ -796,39 +796,39 @@ const p67 = p.then(() => x, () => {throw 1}); const p68 = p.then(() => x, () => Promise.resolve(1)); >p68 : Promise >p.then(() => x, () => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => x : () => any >x : any >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const p69 = p.then(() => x, () => Promise.reject(1)); >p69 : Promise >p.then(() => x, () => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => x : () => any >x : any >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const p70 = p.then(() => undefined, undefined); >p70 : Promise >p.then(() => undefined, undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => undefined : () => undefined >undefined : undefined >undefined : undefined @@ -836,9 +836,9 @@ const p70 = p.then(() => undefined, undefined); const p71 = p.then(() => undefined, null); >p71 : Promise >p.then(() => undefined, null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => undefined : () => undefined >undefined : undefined >null : null @@ -846,9 +846,9 @@ const p71 = p.then(() => undefined, null); const p72 = p.then(() => undefined, () => 1); >p72 : Promise >p.then(() => undefined, () => 1) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => undefined : () => undefined >undefined : undefined >() => 1 : () => number @@ -857,9 +857,9 @@ const p72 = p.then(() => undefined, () => 1); const p73 = p.then(() => undefined, () => x); >p73 : Promise >p.then(() => undefined, () => x) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => undefined : () => undefined >undefined : undefined >() => x : () => any @@ -868,9 +868,9 @@ const p73 = p.then(() => undefined, () => x); const p74 = p.then(() => undefined, () => undefined); >p74 : Promise >p.then(() => undefined, () => undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => undefined : () => undefined >undefined : undefined >() => undefined : () => undefined @@ -879,9 +879,9 @@ const p74 = p.then(() => undefined, () => undefined); const p75 = p.then(() => undefined, () => null); >p75 : Promise >p.then(() => undefined, () => null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => undefined : () => undefined >undefined : undefined >() => null : () => null @@ -890,9 +890,9 @@ const p75 = p.then(() => undefined, () => null); const p76 = p.then(() => undefined, () => {}); >p76 : Promise >p.then(() => undefined, () => {}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => undefined : () => undefined >undefined : undefined >() => {} : () => void @@ -900,9 +900,9 @@ const p76 = p.then(() => undefined, () => {}); const p77 = p.then(() => undefined, () => {throw 1}); >p77 : Promise >p.then(() => undefined, () => {throw 1}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => undefined : () => undefined >undefined : undefined >() => {throw 1} : () => never @@ -911,39 +911,39 @@ const p77 = p.then(() => undefined, () => {throw 1}); const p78 = p.then(() => undefined, () => Promise.resolve(1)); >p78 : Promise >p.then(() => undefined, () => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => undefined : () => undefined >undefined : undefined >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const p79 = p.then(() => undefined, () => Promise.reject(1)); >p79 : Promise >p.then(() => undefined, () => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => undefined : () => undefined >undefined : undefined >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const p80 = p.then(() => null, undefined); >p80 : Promise >p.then(() => null, undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => null : () => null >null : null >undefined : undefined @@ -951,9 +951,9 @@ const p80 = p.then(() => null, undefined); const p81 = p.then(() => null, null); >p81 : Promise >p.then(() => null, null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => null : () => null >null : null >null : null @@ -961,9 +961,9 @@ const p81 = p.then(() => null, null); const p82 = p.then(() => null, () => 1); >p82 : Promise >p.then(() => null, () => 1) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => null : () => null >null : null >() => 1 : () => number @@ -972,9 +972,9 @@ const p82 = p.then(() => null, () => 1); const p83 = p.then(() => null, () => x); >p83 : Promise >p.then(() => null, () => x) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => null : () => null >null : null >() => x : () => any @@ -983,9 +983,9 @@ const p83 = p.then(() => null, () => x); const p84 = p.then(() => null, () => undefined); >p84 : Promise >p.then(() => null, () => undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => null : () => null >null : null >() => undefined : () => undefined @@ -994,9 +994,9 @@ const p84 = p.then(() => null, () => undefined); const p85 = p.then(() => null, () => null); >p85 : Promise >p.then(() => null, () => null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => null : () => null >null : null >() => null : () => null @@ -1005,9 +1005,9 @@ const p85 = p.then(() => null, () => null); const p86 = p.then(() => null, () => {}); >p86 : Promise >p.then(() => null, () => {}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => null : () => null >null : null >() => {} : () => void @@ -1015,9 +1015,9 @@ const p86 = p.then(() => null, () => {}); const p87 = p.then(() => null, () => {throw 1}); >p87 : Promise >p.then(() => null, () => {throw 1}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => null : () => null >null : null >() => {throw 1} : () => never @@ -1026,57 +1026,57 @@ const p87 = p.then(() => null, () => {throw 1}); const p88 = p.then(() => null, () => Promise.resolve(1)); >p88 : Promise >p.then(() => null, () => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => null : () => null >null : null >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const p89 = p.then(() => null, () => Promise.reject(1)); >p89 : Promise >p.then(() => null, () => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => null : () => null >null : null >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const p90 = p.then(() => {}, undefined); >p90 : Promise >p.then(() => {}, undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {} : () => void >undefined : undefined const p91 = p.then(() => {}, null); >p91 : Promise >p.then(() => {}, null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {} : () => void >null : null const p92 = p.then(() => {}, () => 1); >p92 : Promise >p.then(() => {}, () => 1) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {} : () => void >() => 1 : () => number >1 : 1 @@ -1084,9 +1084,9 @@ const p92 = p.then(() => {}, () => 1); const p93 = p.then(() => {}, () => x); >p93 : Promise >p.then(() => {}, () => x) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {} : () => void >() => x : () => any >x : any @@ -1094,9 +1094,9 @@ const p93 = p.then(() => {}, () => x); const p94 = p.then(() => {}, () => undefined); >p94 : Promise >p.then(() => {}, () => undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {} : () => void >() => undefined : () => undefined >undefined : undefined @@ -1104,9 +1104,9 @@ const p94 = p.then(() => {}, () => undefined); const p95 = p.then(() => {}, () => null); >p95 : Promise >p.then(() => {}, () => null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {} : () => void >() => null : () => null >null : null @@ -1114,18 +1114,18 @@ const p95 = p.then(() => {}, () => null); const p96 = p.then(() => {}, () => {}); >p96 : Promise >p.then(() => {}, () => {}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {} : () => void >() => {} : () => void const p97 = p.then(() => {}, () => {throw 1}); >p97 : Promise >p.then(() => {}, () => {throw 1}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {} : () => void >() => {throw 1} : () => never >1 : 1 @@ -1133,37 +1133,37 @@ const p97 = p.then(() => {}, () => {throw 1}); const p98 = p.then(() => {}, () => Promise.resolve(1)); >p98 : Promise >p.then(() => {}, () => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {} : () => void >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const p99 = p.then(() => {}, () => Promise.reject(1)); >p99 : Promise >p.then(() => {}, () => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {} : () => void >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const pa0 = p.then(() => {throw 1}, undefined); >pa0 : Promise >p.then(() => {throw 1}, undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {throw 1} : () => never >1 : 1 >undefined : undefined @@ -1171,9 +1171,9 @@ const pa0 = p.then(() => {throw 1}, undefined); const pa1 = p.then(() => {throw 1}, null); >pa1 : Promise >p.then(() => {throw 1}, null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {throw 1} : () => never >1 : 1 >null : null @@ -1181,9 +1181,9 @@ const pa1 = p.then(() => {throw 1}, null); const pa2 = p.then(() => {throw 1}, () => 1); >pa2 : Promise >p.then(() => {throw 1}, () => 1) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {throw 1} : () => never >1 : 1 >() => 1 : () => number @@ -1192,9 +1192,9 @@ const pa2 = p.then(() => {throw 1}, () => 1); const pa3 = p.then(() => {throw 1}, () => x); >pa3 : Promise >p.then(() => {throw 1}, () => x) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {throw 1} : () => never >1 : 1 >() => x : () => any @@ -1203,9 +1203,9 @@ const pa3 = p.then(() => {throw 1}, () => x); const pa4 = p.then(() => {throw 1}, () => undefined); >pa4 : Promise >p.then(() => {throw 1}, () => undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {throw 1} : () => never >1 : 1 >() => undefined : () => undefined @@ -1214,9 +1214,9 @@ const pa4 = p.then(() => {throw 1}, () => undefined); const pa5 = p.then(() => {throw 1}, () => null); >pa5 : Promise >p.then(() => {throw 1}, () => null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {throw 1} : () => never >1 : 1 >() => null : () => null @@ -1225,9 +1225,9 @@ const pa5 = p.then(() => {throw 1}, () => null); const pa6 = p.then(() => {throw 1}, () => {}); >pa6 : Promise >p.then(() => {throw 1}, () => {}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {throw 1} : () => never >1 : 1 >() => {} : () => void @@ -1235,9 +1235,9 @@ const pa6 = p.then(() => {throw 1}, () => {}); const pa7 = p.then(() => {throw 1}, () => {throw 1}); >pa7 : Promise >p.then(() => {throw 1}, () => {throw 1}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {throw 1} : () => never >1 : 1 >() => {throw 1} : () => never @@ -1246,72 +1246,72 @@ const pa7 = p.then(() => {throw 1}, () => {throw 1}); const pa8 = p.then(() => {throw 1}, () => Promise.resolve(1)); >pa8 : Promise >p.then(() => {throw 1}, () => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {throw 1} : () => never >1 : 1 >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const pa9 = p.then(() => {throw 1}, () => Promise.reject(1)); >pa9 : Promise >p.then(() => {throw 1}, () => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => {throw 1} : () => never >1 : 1 >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const pb0 = p.then(() => Promise.resolve("1"), undefined); >pb0 : Promise >p.then(() => Promise.resolve("1"), undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.resolve("1") : () => Promise >Promise.resolve("1") : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >"1" : "1" >undefined : undefined const pb1 = p.then(() => Promise.resolve("1"), null); >pb1 : Promise >p.then(() => Promise.resolve("1"), null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.resolve("1") : () => Promise >Promise.resolve("1") : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >"1" : "1" >null : null const pb2 = p.then(() => Promise.resolve("1"), () => 1); >pb2 : Promise >p.then(() => Promise.resolve("1"), () => 1) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.resolve("1") : () => Promise >Promise.resolve("1") : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >"1" : "1" >() => 1 : () => number >1 : 1 @@ -1319,14 +1319,14 @@ const pb2 = p.then(() => Promise.resolve("1"), () => 1); const pb3 = p.then(() => Promise.resolve("1"), () => x); >pb3 : Promise >p.then(() => Promise.resolve("1"), () => x) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.resolve("1") : () => Promise >Promise.resolve("1") : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >"1" : "1" >() => x : () => any >x : any @@ -1334,14 +1334,14 @@ const pb3 = p.then(() => Promise.resolve("1"), () => x); const pb4 = p.then(() => Promise.resolve("1"), () => undefined); >pb4 : Promise >p.then(() => Promise.resolve("1"), () => undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.resolve("1") : () => Promise >Promise.resolve("1") : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >"1" : "1" >() => undefined : () => undefined >undefined : undefined @@ -1349,14 +1349,14 @@ const pb4 = p.then(() => Promise.resolve("1"), () => undefined); const pb5 = p.then(() => Promise.resolve("1"), () => null); >pb5 : Promise >p.then(() => Promise.resolve("1"), () => null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.resolve("1") : () => Promise >Promise.resolve("1") : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >"1" : "1" >() => null : () => null >null : null @@ -1364,28 +1364,28 @@ const pb5 = p.then(() => Promise.resolve("1"), () => null); const pb6 = p.then(() => Promise.resolve("1"), () => {}); >pb6 : Promise >p.then(() => Promise.resolve("1"), () => {}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.resolve("1") : () => Promise >Promise.resolve("1") : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >"1" : "1" >() => {} : () => void const pb7 = p.then(() => Promise.resolve("1"), () => {throw 1}); >pb7 : Promise >p.then(() => Promise.resolve("1"), () => {throw 1}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.resolve("1") : () => Promise >Promise.resolve("1") : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >"1" : "1" >() => {throw 1} : () => never >1 : 1 @@ -1393,80 +1393,80 @@ const pb7 = p.then(() => Promise.resolve("1"), () => {throw 1}); const pb8 = p.then(() => Promise.resolve("1"), () => Promise.resolve(1)); >pb8 : Promise >p.then(() => Promise.resolve("1"), () => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.resolve("1") : () => Promise >Promise.resolve("1") : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >"1" : "1" >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const pb9 = p.then(() => Promise.resolve("1"), () => Promise.reject(1)); >pb9 : Promise >p.then(() => Promise.resolve("1"), () => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.resolve("1") : () => Promise >Promise.resolve("1") : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >"1" : "1" >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 const pc0 = p.then(() => Promise.reject("1"), undefined); >pc0 : Promise >p.then(() => Promise.reject("1"), undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.reject("1") : () => Promise >Promise.reject("1") : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >"1" : "1" >undefined : undefined const pc1 = p.then(() => Promise.reject("1"), null); >pc1 : Promise >p.then(() => Promise.reject("1"), null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.reject("1") : () => Promise >Promise.reject("1") : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >"1" : "1" >null : null const pc2 = p.then(() => Promise.reject("1"), () => 1); >pc2 : Promise >p.then(() => Promise.reject("1"), () => 1) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.reject("1") : () => Promise >Promise.reject("1") : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >"1" : "1" >() => 1 : () => number >1 : 1 @@ -1474,14 +1474,14 @@ const pc2 = p.then(() => Promise.reject("1"), () => 1); const pc3 = p.then(() => Promise.reject("1"), () => x); >pc3 : Promise >p.then(() => Promise.reject("1"), () => x) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.reject("1") : () => Promise >Promise.reject("1") : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >"1" : "1" >() => x : () => any >x : any @@ -1489,14 +1489,14 @@ const pc3 = p.then(() => Promise.reject("1"), () => x); const pc4 = p.then(() => Promise.reject("1"), () => undefined); >pc4 : Promise >p.then(() => Promise.reject("1"), () => undefined) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.reject("1") : () => Promise >Promise.reject("1") : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >"1" : "1" >() => undefined : () => undefined >undefined : undefined @@ -1504,14 +1504,14 @@ const pc4 = p.then(() => Promise.reject("1"), () => undefined); const pc5 = p.then(() => Promise.reject("1"), () => null); >pc5 : Promise >p.then(() => Promise.reject("1"), () => null) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.reject("1") : () => Promise >Promise.reject("1") : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >"1" : "1" >() => null : () => null >null : null @@ -1519,28 +1519,28 @@ const pc5 = p.then(() => Promise.reject("1"), () => null); const pc6 = p.then(() => Promise.reject("1"), () => {}); >pc6 : Promise >p.then(() => Promise.reject("1"), () => {}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.reject("1") : () => Promise >Promise.reject("1") : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >"1" : "1" >() => {} : () => void const pc7 = p.then(() => Promise.reject("1"), () => {throw 1}); >pc7 : Promise >p.then(() => Promise.reject("1"), () => {throw 1}) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.reject("1") : () => Promise >Promise.reject("1") : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >"1" : "1" >() => {throw 1} : () => never >1 : 1 @@ -1548,38 +1548,38 @@ const pc7 = p.then(() => Promise.reject("1"), () => {throw 1}); const pc8 = p.then(() => Promise.reject("1"), () => Promise.resolve(1)); >pc8 : Promise >p.then(() => Promise.reject("1"), () => Promise.resolve(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.reject("1") : () => Promise >Promise.reject("1") : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >"1" : "1" >() => Promise.resolve(1) : () => Promise >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 const pc9 = p.then(() => Promise.reject("1"), () => Promise.reject(1)); >pc9 : Promise >p.then(() => Promise.reject("1"), () => Promise.reject(1)) : Promise ->p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>p.then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >p : Promise ->then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +>then : (onfulfilled?: ((value: boolean) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >() => Promise.reject("1") : () => Promise >Promise.reject("1") : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >"1" : "1" >() => Promise.reject(1) : () => Promise >Promise.reject(1) : Promise ->Promise.reject : (reason?: any) => Promise +>Promise.reject : (reason?: any) => Promise >Promise : PromiseConstructor ->reject : (reason?: any) => Promise +>reject : (reason?: any) => Promise >1 : 1 diff --git a/tests/baselines/reference/promiseVoidErrorCallback.types b/tests/baselines/reference/promiseVoidErrorCallback.types index a1388cb04ef69..68905c16cb431 100644 --- a/tests/baselines/reference/promiseVoidErrorCallback.types +++ b/tests/baselines/reference/promiseVoidErrorCallback.types @@ -19,9 +19,9 @@ function f1(): Promise { return Promise.resolve({ __t1: "foo_t1" }); >Promise.resolve({ __t1: "foo_t1" }) : Promise<{ __t1: string; }> ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >{ __t1: "foo_t1" } : { __t1: string; } >__t1 : string >"foo_t1" : "foo_t1" @@ -44,14 +44,14 @@ function f2(x: T1): T2 { var x3 = f1() >x3 : Promise<{ __t3: string; }> >f1() .then(f2, (e: Error) => { throw e;}) .then((x: T2) => { return { __t3: x.__t2 + "bar" };}) : Promise<{ __t3: string; }> ->f1() .then(f2, (e: Error) => { throw e;}) .then : (onfulfilled?: (value: T2) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>f1() .then(f2, (e: Error) => { throw e;}) .then : (onfulfilled?: (value: T2) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >f1() .then(f2, (e: Error) => { throw e;}) : Promise ->f1() .then : (onfulfilled?: (value: T1) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>f1() .then : (onfulfilled?: (value: T1) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >f1() : Promise >f1 : () => Promise .then(f2, (e: Error) => { ->then : (onfulfilled?: (value: T1) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: T1) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >f2 : (x: T1) => T2 >(e: Error) => { throw e;} : (e: Error) => never >e : Error @@ -61,7 +61,7 @@ var x3 = f1() }) .then((x: T2) => { ->then : (onfulfilled?: (value: T2) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: T2) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >(x: T2) => { return { __t3: x.__t2 + "bar" };} : (x: T2) => { __t3: string; } >x : T2 diff --git a/tests/baselines/reference/promises.types b/tests/baselines/reference/promises.types index 0640f0135498f..355bd586216a6 100644 --- a/tests/baselines/reference/promises.types +++ b/tests/baselines/reference/promises.types @@ -1,12 +1,12 @@ === tests/cases/compiler/promises.ts === interface Promise { then(success?: (value: T) => U): Promise; ->then : { (onfulfilled?: (value: T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => U): Promise; (success?: (value: T) => Promise): Promise; } +>then : { (onfulfilled?: (value: awaited T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => U): Promise; (success?: (value: T) => Promise): Promise; } >success : (value: T) => U >value : T then(success?: (value: T) => Promise): Promise; ->then : { (onfulfilled?: (value: T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => U): Promise; (success?: (value: T) => Promise): Promise; } +>then : { (onfulfilled?: (value: awaited T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: T) => U): Promise; (success?: (value: T) => Promise): Promise; } >success : (value: T) => Promise >value : T diff --git a/tests/baselines/reference/promisesWithConstraints.errors.txt b/tests/baselines/reference/promisesWithConstraints.errors.txt index e85c6764b8b14..0817c2fef6ef3 100644 --- a/tests/baselines/reference/promisesWithConstraints.errors.txt +++ b/tests/baselines/reference/promisesWithConstraints.errors.txt @@ -1,5 +1,9 @@ tests/cases/compiler/promisesWithConstraints.ts(15,1): error TS2322: Type 'Promise' is not assignable to type 'Promise'. - Property 'y' is missing in type 'Foo' but required in type 'Bar'. + Types of property 'then' are incompatible. + Type '{ (onfulfilled?: (value: Foo) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (cb: (x: Foo) => Promise): Promise; }' is not assignable to type '{ (onfulfilled?: (value: Bar) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (cb: (x: Bar) => Promise): Promise; }'. + Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. + Types of parameters 'value' and 'value' are incompatible. + Type 'Foo' is not assignable to type 'Bar'. tests/cases/compiler/promisesWithConstraints.ts(20,1): error TS2322: Type 'CPromise' is not assignable to type 'CPromise'. Type 'Foo' is not assignable to type 'Bar'. @@ -22,8 +26,11 @@ tests/cases/compiler/promisesWithConstraints.ts(20,1): error TS2322: Type 'CProm b = a; // ok ~ !!! error TS2322: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2322: Property 'y' is missing in type 'Foo' but required in type 'Bar'. -!!! related TS2728 tests/cases/compiler/promisesWithConstraints.ts:10:20: 'y' is declared here. +!!! error TS2322: Types of property 'then' are incompatible. +!!! error TS2322: Type '{ (onfulfilled?: (value: Foo) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (cb: (x: Foo) => Promise): Promise; }' is not assignable to type '{ (onfulfilled?: (value: Bar) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (cb: (x: Bar) => Promise): Promise; }'. +!!! error TS2322: Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. +!!! error TS2322: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2322: Type 'Foo' is not assignable to type 'Bar'. var a2: CPromise; var b2: CPromise; diff --git a/tests/baselines/reference/promisesWithConstraints.types b/tests/baselines/reference/promisesWithConstraints.types index 367cd6a61a677..2afce5cd5b510 100644 --- a/tests/baselines/reference/promisesWithConstraints.types +++ b/tests/baselines/reference/promisesWithConstraints.types @@ -1,7 +1,7 @@ === tests/cases/compiler/promisesWithConstraints.ts === interface Promise { then(cb: (x: T) => Promise): Promise; ->then : { (onfulfilled?: (value: T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (cb: (x: T) => Promise): Promise; } +>then : { (onfulfilled?: (value: awaited T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (cb: (x: T) => Promise): Promise; } >cb : (x: T) => Promise >x : T } diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/strictAwaitedTypes/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/strictAwaitedTypes/tsconfig.json new file mode 100644 index 0000000000000..92eab375f248d --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/strictAwaitedTypes/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "strictAwaitedTypes": true + } +} diff --git a/tests/baselines/reference/specializationError.types b/tests/baselines/reference/specializationError.types index 8f0b5747bfa9d..9e55e4bd4f11e 100644 --- a/tests/baselines/reference/specializationError.types +++ b/tests/baselines/reference/specializationError.types @@ -1,7 +1,7 @@ === tests/cases/compiler/specializationError.ts === interface Promise { then(value: T): void; ->then : { (onfulfilled?: (value: T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (value: T): void; } +>then : { (onfulfilled?: (value: awaited T) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (value: T): void; } >value : T } diff --git a/tests/baselines/reference/syntheticDefaultExportsWithDynamicImports.types b/tests/baselines/reference/syntheticDefaultExportsWithDynamicImports.types index 3f1ef83a0ae9c..a1b482b08c035 100644 --- a/tests/baselines/reference/syntheticDefaultExportsWithDynamicImports.types +++ b/tests/baselines/reference/syntheticDefaultExportsWithDynamicImports.types @@ -9,10 +9,10 @@ export = packageExport; === tests/cases/compiler/index.ts === import("package").then(({default: foo}) => foo(42)); >import("package").then(({default: foo}) => foo(42)) : Promise ->import("package").then : string; }, TResult2 = never>(onfulfilled?: (value: { default: (x: number) => string; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>import("package").then : string; }, TResult2 = never>(onfulfilled?: (value: { default: (x: number) => string; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >import("package") : Promise<{ default: (x: number) => string; }> >"package" : "package" ->then : string; }, TResult2 = never>(onfulfilled?: (value: { default: (x: number) => string; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : string; }, TResult2 = never>(onfulfilled?: (value: { default: (x: number) => string; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >({default: foo}) => foo(42) : ({ default: foo }: { default: (x: number) => string; }) => string >default : any >foo : (x: number) => string diff --git a/tests/baselines/reference/transformNestedGeneratorsWithTry.types b/tests/baselines/reference/transformNestedGeneratorsWithTry.types index 061342eaf44b0..335151941e723 100644 --- a/tests/baselines/reference/transformNestedGeneratorsWithTry.types +++ b/tests/baselines/reference/transformNestedGeneratorsWithTry.types @@ -16,9 +16,9 @@ async function a(): Bluebird { await Bluebird.resolve(); // -- remove this and it compiles >await Bluebird.resolve() : void >Bluebird.resolve() : Promise ->Bluebird.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Bluebird.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Bluebird : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } } catch (error) { } >error : any diff --git a/tests/baselines/reference/types.asyncGenerators.es2018.1.types b/tests/baselines/reference/types.asyncGenerators.es2018.1.types index 3c6e51c56d220..4750468a34618 100644 --- a/tests/baselines/reference/types.asyncGenerators.es2018.1.types +++ b/tests/baselines/reference/types.asyncGenerators.es2018.1.types @@ -21,9 +21,9 @@ async function * inferReturnType4() { yield Promise.resolve(1); >yield Promise.resolve(1) : any >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 } async function * inferReturnType5() { @@ -36,9 +36,9 @@ async function * inferReturnType5() { yield Promise.resolve(2); >yield Promise.resolve(2) : any >Promise.resolve(2) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >2 : 2 } async function * inferReturnType6() { @@ -57,9 +57,9 @@ async function * inferReturnType7() { >yield* [Promise.resolve(1)] : any >[Promise.resolve(1)] : Promise[] >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 } async function * inferReturnType8() { @@ -89,9 +89,9 @@ const assignability2: () => AsyncIterableIterator = async function * () yield Promise.resolve(1); >yield Promise.resolve(1) : undefined >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 }; @@ -114,9 +114,9 @@ const assignability4: () => AsyncIterableIterator = async function * () >yield* [Promise.resolve(1)] : any >[Promise.resolve(1)] : Promise[] >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 }; @@ -149,9 +149,9 @@ const assignability7: () => AsyncIterable = async function * () { yield Promise.resolve(1); >yield Promise.resolve(1) : undefined >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 }; @@ -174,9 +174,9 @@ const assignability9: () => AsyncIterable = async function * () { >yield* [Promise.resolve(1)] : any >[Promise.resolve(1)] : Promise[] >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 }; @@ -209,9 +209,9 @@ const assignability12: () => AsyncIterator = async function * () { yield Promise.resolve(1); >yield Promise.resolve(1) : undefined >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 }; @@ -234,9 +234,9 @@ const assignability14: () => AsyncIterator = async function * () { >yield* [Promise.resolve(1)] : any >[Promise.resolve(1)] : Promise[] >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 }; @@ -266,9 +266,9 @@ async function * explicitReturnType2(): AsyncIterableIterator { yield Promise.resolve(1); >yield Promise.resolve(1) : undefined >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 } async function * explicitReturnType3(): AsyncIterableIterator { @@ -287,9 +287,9 @@ async function * explicitReturnType4(): AsyncIterableIterator { >yield* [Promise.resolve(1)] : any >[Promise.resolve(1)] : Promise[] >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 } async function * explicitReturnType5(): AsyncIterableIterator { @@ -316,9 +316,9 @@ async function * explicitReturnType7(): AsyncIterable { yield Promise.resolve(1); >yield Promise.resolve(1) : undefined >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 } async function * explicitReturnType8(): AsyncIterable { @@ -337,9 +337,9 @@ async function * explicitReturnType9(): AsyncIterable { >yield* [Promise.resolve(1)] : any >[Promise.resolve(1)] : Promise[] >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 } async function * explicitReturnType10(): AsyncIterable { @@ -366,9 +366,9 @@ async function * explicitReturnType12(): AsyncIterator { yield Promise.resolve(1); >yield Promise.resolve(1) : undefined >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 } async function * explicitReturnType13(): AsyncIterator { @@ -387,9 +387,9 @@ async function * explicitReturnType14(): AsyncIterator { >yield* [Promise.resolve(1)] : any >[Promise.resolve(1)] : Promise[] >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 } async function * explicitReturnType15(): AsyncIterator { @@ -425,9 +425,9 @@ async function * awaitedType2() { >x : number >await Promise.resolve(1) : number >Promise.resolve(1) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >1 : 1 } async function * nextType1(): { next(...args: [] | [number | PromiseLike]): any } { diff --git a/tests/baselines/reference/types.asyncGenerators.es2018.2.errors.txt b/tests/baselines/reference/types.asyncGenerators.es2018.2.errors.txt index 3d588abf1ee84..3c02a66a97a1d 100644 --- a/tests/baselines/reference/types.asyncGenerators.es2018.2.errors.txt +++ b/tests/baselines/reference/types.asyncGenerators.es2018.2.errors.txt @@ -2,12 +2,13 @@ tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts( tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(8,12): error TS2504: Type 'Promise' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(10,7): error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterableIterator'. Call signature return types 'AsyncGenerator' and 'AsyncIterableIterator' are incompatible. - The types returned by 'next(...)' are incompatible between these types. - Type 'Promise>' is not assignable to type 'Promise>'. - Type 'IteratorResult' is not assignable to type 'IteratorResult'. - Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. - Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. - Type 'string' is not assignable to type 'number'. + The types of 'next(...).then' are incompatible between these types. + Type ', TResult2 = never>(onfulfilled?: (value: IteratorResult) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise' is not assignable to type ', TResult2 = never>(onfulfilled?: (value: IteratorResult) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise'. + Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. + Types of parameters 'value' and 'value' are incompatible. + Type 'IteratorResult' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(13,7): error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterableIterator'. Type 'AsyncGenerator' is not assignable to type 'AsyncIterableIterator'. tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(16,7): error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterableIterator'. @@ -67,12 +68,13 @@ tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts( ~~~~~~~~~~~~~~ !!! error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterableIterator'. !!! error TS2322: Call signature return types 'AsyncGenerator' and 'AsyncIterableIterator' are incompatible. -!!! error TS2322: The types returned by 'next(...)' are incompatible between these types. -!!! error TS2322: Type 'Promise>' is not assignable to type 'Promise>'. -!!! error TS2322: Type 'IteratorResult' is not assignable to type 'IteratorResult'. -!!! error TS2322: Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. -!!! error TS2322: Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: The types of 'next(...).then' are incompatible between these types. +!!! error TS2322: Type ', TResult2 = never>(onfulfilled?: (value: IteratorResult) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise' is not assignable to type ', TResult2 = never>(onfulfilled?: (value: IteratorResult) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise'. +!!! error TS2322: Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. +!!! error TS2322: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2322: Type 'IteratorResult' is not assignable to type 'IteratorResult'. +!!! error TS2322: Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. +!!! error TS2322: Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. yield "a"; }; const assignability2: () => AsyncIterableIterator = async function * () { diff --git a/tests/baselines/reference/types.asyncGenerators.es2018.2.types b/tests/baselines/reference/types.asyncGenerators.es2018.2.types index 8352487119937..d08ea642f67f4 100644 --- a/tests/baselines/reference/types.asyncGenerators.es2018.2.types +++ b/tests/baselines/reference/types.asyncGenerators.es2018.2.types @@ -20,9 +20,9 @@ async function * inferReturnType3() { yield* Promise.resolve([1, 2]); >yield* Promise.resolve([1, 2]) : any >Promise.resolve([1, 2]) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >[1, 2] : number[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/unionAndIntersectionInference1.types b/tests/baselines/reference/unionAndIntersectionInference1.types index 72d60545e6a51..5cdd44534786f 100644 --- a/tests/baselines/reference/unionAndIntersectionInference1.types +++ b/tests/baselines/reference/unionAndIntersectionInference1.types @@ -190,12 +190,12 @@ const createTestAsync = (): Promise => Promise.resolve().then(() => ({ na >createTestAsync : () => Promise >(): Promise => Promise.resolve().then(() => ({ name: 'test' })) : () => Promise >Promise.resolve().then(() => ({ name: 'test' })) : Promise ->Promise.resolve().then : (onfulfilled?: (value: void) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>Promise.resolve().then : (onfulfilled?: (value: void) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >Promise.resolve() : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } ->then : (onfulfilled?: (value: void) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>then : (onfulfilled?: (value: void) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => ({ name: 'test' }) : () => { name: "test"; } >({ name: 'test' }) : { name: "test"; } >{ name: 'test' } : { name: "test"; } diff --git a/tests/baselines/reference/uniqueSymbols.types b/tests/baselines/reference/uniqueSymbols.types index a321593c11a8c..30e30d3ed0a2e 100644 --- a/tests/baselines/reference/uniqueSymbols.types +++ b/tests/baselines/reference/uniqueSymbols.types @@ -400,9 +400,9 @@ const constInitToLReadonlyNestedTypeWithIndexedAccess: L["nested"]["readonlyNest const promiseForConstCall = Promise.resolve(constCall); >promiseForConstCall : Promise >Promise.resolve(constCall) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >constCall : unique symbol const arrayOfConstCall = [constCall]; diff --git a/tests/baselines/reference/uniqueSymbolsDeclarations.types b/tests/baselines/reference/uniqueSymbolsDeclarations.types index bacdafc5680db..202f93ba44109 100644 --- a/tests/baselines/reference/uniqueSymbolsDeclarations.types +++ b/tests/baselines/reference/uniqueSymbolsDeclarations.types @@ -393,9 +393,9 @@ const constInitToLReadonlyNestedTypeWithIndexedAccess: L["nested"]["readonlyNest const promiseForConstCall = Promise.resolve(constCall); >promiseForConstCall : Promise >Promise.resolve(constCall) : Promise ->Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor ->resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } >constCall : unique symbol const arrayOfConstCall = [constCall]; diff --git a/tests/baselines/reference/usePromiseFinally.types b/tests/baselines/reference/usePromiseFinally.types index b704e54231cfd..d8788f42ea03d 100644 --- a/tests/baselines/reference/usePromiseFinally.types +++ b/tests/baselines/reference/usePromiseFinally.types @@ -2,7 +2,7 @@ let promise1 = new Promise(function(resolve, reject) {}) >promise1 : Promise >new Promise(function(resolve, reject) {}) .finally(function() {}) : Promise ->new Promise(function(resolve, reject) {}) .finally : (onfinally?: () => void) => Promise +>new Promise(function(resolve, reject) {}) .finally : (onfinally?: () => void | PromiseLike) => Promise >new Promise(function(resolve, reject) {}) : Promise >Promise : PromiseConstructor >function(resolve, reject) {} : (resolve: (value?: unknown) => void, reject: (reason?: any) => void) => void @@ -10,6 +10,6 @@ let promise1 = new Promise(function(resolve, reject) {}) >reject : (reason?: any) => void .finally(function() {}); ->finally : (onfinally?: () => void) => Promise +>finally : (onfinally?: () => void | PromiseLike) => Promise >function() {} : () => void diff --git a/tests/cases/compiler/promiseTypeInference.ts b/tests/cases/compiler/promiseTypeInference.ts index f26a3eb0256af..49d83ef0094f0 100644 --- a/tests/cases/compiler/promiseTypeInference.ts +++ b/tests/cases/compiler/promiseTypeInference.ts @@ -1,10 +1,10 @@ -declare class Promise { - then(success?: (value: T) => Promise): Promise; +declare class CPromise { + then(success?: (value: T) => CPromise): CPromise; } interface IPromise { then(success?: (value: T) => IPromise): IPromise; } -declare function load(name: string): Promise; +declare function load(name: string): CPromise; declare function convert(s: string): IPromise; var $$x = load("something").then(s => convert(s)); diff --git a/tests/cases/conformance/types/awaited/awaited.ts b/tests/cases/conformance/types/awaited/awaited.ts new file mode 100644 index 0000000000000..91564b4945c24 --- /dev/null +++ b/tests/cases/conformance/types/awaited/awaited.ts @@ -0,0 +1,96 @@ +// @target: es2015 +// @declaration: true +// simple +declare const p0: Promise; +p0.then(x => x); + +declare const p1: Promise>; +p1.then(x => x); + +declare const p2: Promise>; +p2.then(x => x); + +// generics +declare const f: boolean; +declare function makePromise(x: T): Promise; +makePromise(1).then(x => x); +makePromise("a").then(x => x); +makePromise({ a: 1 }).then(x => x); +makePromise(f ? 1 : "a").then(x => x); + +function f0(u: U) { + return makePromise(u).then(x => x); +} +f0(1).then(x => x); +f0("a").then(x => x); +f0(f ? 1 : "a").then(x => x); +f0(makePromise(1)).then(x => x); + +function f1(u: U, v: V) { + return makePromise(u).then(x => { + if (f) return x; + return makePromise(v).then(x => x); + }); +} +f1(1, "a").then(x => x); +f1(makePromise(1), makePromise("a")).then(x => x); + +function f2(u: U) { + return makePromise(u).then(x => { + if (f) return x; + return Promise.reject("b"); + }); +} +f2(1).then(x => x); +f2(makePromise(1)).then(x => x); + +function f3(u: U, v: V) { + return makePromise(u).catch(x => v); +} +f3(1, "a").then(x => x); +f3(makePromise(1), makePromise("a")).then(x => x); + +function f4(u: U, v: V) { + return makePromise(u).catch(x => { + if (f) return v; + return Promise.reject("b"); + }); +} +f4(1, "a").then(x => x); +f4(makePromise(1), makePromise("a")).then(x => x); + +async function f5(u: Promise) { + return await u; +} +f5(makePromise(1)).then(x => x); +f5(makePromise(makePromise(1))).then(x => x); + +async function f6(u: Promise>) { + return await u; +} + +// assignability +let v0: number; +let v1: awaited number; +let v2: awaited Promise; +v0 = v1; +v0 = v2; +v1 = v0; +v1 = v2; +v2 = v0; +v2 = v1; + +function f7() { + let v0: awaited U; + let v1: awaited Promise; + v0 = v1; + v1 = v0; +} + +async function f8() { + let pu: Promise; + let v0: awaited U; + let v1: awaited Promise; + v0 = await pu; + v1 = await pu; +} \ No newline at end of file diff --git a/tests/cases/conformance/types/awaited/awaitedInference.ts b/tests/cases/conformance/types/awaited/awaitedInference.ts new file mode 100644 index 0000000000000..fcc88aee6d92c --- /dev/null +++ b/tests/cases/conformance/types/awaited/awaitedInference.ts @@ -0,0 +1,15 @@ +declare function foo(f: () => PromiseLike, x: T): void; +declare const nullOrNumber: number | null; +foo(async () => nullOrNumber, null); + +type UnwrapAwaited = T extends awaited infer Inner ? Inner : T; +type Result1 = UnwrapAwaited>; // number +type Result2 = UnwrapAwaited | number>; // number +function f() { + type Result1 = UnwrapAwaited; // UnwrapAwaited + type Result2 = UnwrapAwaited; // UnwrapAwaited + return null as any as [Result1, Result2]; +} +const x = f(); // number +const y = f>(); // number ? +const z = f | number>(); // number ? \ No newline at end of file diff --git a/tests/cases/conformance/types/awaited/awaitedVariance.ts b/tests/cases/conformance/types/awaited/awaitedVariance.ts new file mode 100644 index 0000000000000..6aa4584412daf --- /dev/null +++ b/tests/cases/conformance/types/awaited/awaitedVariance.ts @@ -0,0 +1,123 @@ +// @target: es2015 + +declare let p0: Promise; +declare let p1: Promise>; +declare let p2: Promise; +p0 = p1; +p0 = p2; +p1 = p0; +p1 = p2; +p2 = p0; +p2 = p1; + +function fn1(p0: Promise, p1: Promise>, p2: Promise) { + p0 = p1; + p0 = p2; + p1 = p0; + p1 = p2; + p2 = p0; + p2 = p1; +} + +declare let pl0: PromiseLike; +declare let pl1: PromiseLike>; +declare let pl2: PromiseLike; +pl0 = pl1; +pl0 = pl2; +pl1 = pl0; +pl1 = pl2; +pl2 = pl0; +pl2 = pl1; + +function fn2(pl0: PromiseLike, pl1: PromiseLike>, pl2: PromiseLike) { + pl0 = pl1; + pl0 = pl2; + pl1 = pl0; + pl1 = pl2; + pl2 = pl0; + pl2 = pl1; +} + +pl0 = p0; +pl0 = p1; +pl0 = p2; +pl1 = p0; +pl1 = p1; +pl1 = p2; +pl2 = p0; +pl2 = p1; +pl2 = p2; + +interface A { + x: awaited T; +} + +declare let a1: A; +declare let a2: A>; +a1 = a2; +a2 = a1; + +interface B { + a: A; +} + +declare let b1: B; +declare let b2: B>; +b1 = b2; +b2 = b1; + +interface C { + x: awaited ({_tag: string} & T); +} + +declare let c1: C; +declare let c2: C>; +// Not assignable since `awaited ({_tag: string} & Promise)` is `number`, which isn't assignable to `({_tag: string} & number)`. +c1 = c2; +c2 = c1; + +interface D { + a: C; +} + +declare let d1: D; +declare let d2: D>; +// Not assignable since `awaited ({_tag: string} & Promise)` is `number`, which isn't assignable to `({_tag: string} & number)`. +d1 = d2; +d2 = d1; + +interface E { + x: awaited (T | {otherOption: string}); +} + +declare let e1: E; +declare let e2: E>; +e1 = e2; +e2 = e1; + +interface F { + a: E; +} + +declare let f1: F; +declare let f2: F>; +f1 = f2; +f2 = f1; + +interface G { + x: awaited T[K]; +} + +declare let g1: G<{x: number}, "x">; +declare let g2: G<{x: Promise}, "x">; +g1 = g2; +g2 = g1; + +interface H { + a: G; +} + +declare let h1: H<{x: number}, "x">; +declare let h2: H<{x: Promise}, "x">; +h1 = h2; +h2 = h1; \ No newline at end of file